@sealant/api-contracts-next 0.39.0-next.688 → 0.39.0-next.692
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/control-plane.d.ts +122 -4
- package/dist/core-api/sessions.d.ts +18 -0
- package/dist/core-api/sessions.js +18 -1
- package/dist/core-api/system.d.ts +16 -0
- package/dist/core-api/system.js +8 -0
- package/dist/core-api/workspaces.d.ts +511 -4
- package/dist/core-api/workspaces.js +204 -0
- package/package.json +2 -2
|
@@ -641,6 +641,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
641
641
|
readonly term: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
642
642
|
readonly mode: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pty", "pipe"]>>;
|
|
643
643
|
readonly metadata: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
|
|
644
|
+
readonly user: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
644
645
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
645
646
|
readonly authorization: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
646
647
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
@@ -803,6 +804,9 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
803
804
|
readonly version: import("effect/Schema").String;
|
|
804
805
|
readonly docsPath: import("effect/Schema").String;
|
|
805
806
|
readonly openApiPath: import("effect/Schema").String;
|
|
807
|
+
readonly features: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
808
|
+
readonly processUser: import("effect/Schema").Boolean;
|
|
809
|
+
}>>;
|
|
806
810
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSetupState", "GET", "/v1/system/setup-state", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
807
811
|
readonly needsSetup: import("effect/Schema").Boolean;
|
|
808
812
|
readonly sshGateway: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
@@ -913,6 +917,7 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
913
917
|
readonly args: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
914
918
|
readonly cwd: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
915
919
|
}>>;
|
|
920
|
+
readonly user: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
916
921
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
917
922
|
readonly runId: import("effect/Schema").String;
|
|
918
923
|
readonly workspaceId: import("effect/Schema").String;
|
|
@@ -1024,6 +1029,13 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1024
1029
|
readonly reference: import("effect/Schema").String;
|
|
1025
1030
|
readonly digestReference: import("effect/Schema").String;
|
|
1026
1031
|
readonly digest: import("effect/Schema").String;
|
|
1032
|
+
readonly personLayout: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1033
|
+
readonly status: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1034
|
+
readonly missing: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1035
|
+
readonly unknown: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1036
|
+
readonly runtime: import("effect/Schema").String;
|
|
1037
|
+
readonly acl: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1038
|
+
}>>;
|
|
1027
1039
|
}>>;
|
|
1028
1040
|
readonly error: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1029
1041
|
readonly message: import("effect/Schema").String;
|
|
@@ -1154,7 +1166,32 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1154
1166
|
readonly status: import("effect/Schema").Literals<readonly ["pending", "running", "ready", "failed", "stopped"]>;
|
|
1155
1167
|
readonly endpoint: import("effect/Schema").String;
|
|
1156
1168
|
}>;
|
|
1157
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceUnauthorizedError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceServiceUnavailableError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
1169
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceUnauthorizedError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceServiceUnavailableError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"inspectWorkspaceImage", "POST", "/v1/workspaces/image", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1170
|
+
readonly ownerUserId: import("effect/Schema").String;
|
|
1171
|
+
readonly registryId: import("effect/Schema").String;
|
|
1172
|
+
readonly spec: import("effect/Schema").Unknown;
|
|
1173
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1174
|
+
readonly planHash: import("effect/Schema").String;
|
|
1175
|
+
readonly publishedImage: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1176
|
+
readonly reference: import("effect/Schema").String;
|
|
1177
|
+
readonly digestReference: import("effect/Schema").String;
|
|
1178
|
+
readonly digest: import("effect/Schema").String;
|
|
1179
|
+
readonly personLayout: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1180
|
+
readonly status: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1181
|
+
readonly missing: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1182
|
+
readonly unknown: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1183
|
+
readonly runtime: import("effect/Schema").String;
|
|
1184
|
+
readonly acl: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1185
|
+
}>>;
|
|
1186
|
+
}>>;
|
|
1187
|
+
readonly personLayout: import("effect/Schema").Struct<{
|
|
1188
|
+
readonly status: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1189
|
+
readonly missing: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1190
|
+
readonly unknown: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1191
|
+
readonly runtime: import("effect/Schema").String;
|
|
1192
|
+
readonly acl: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1193
|
+
}>;
|
|
1194
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listWorkspaceAttempts", "GET", "/v1/workspaces/:workspaceId/attempts", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1158
1195
|
readonly workspaceId: import("effect/Schema").String;
|
|
1159
1196
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1160
1197
|
readonly ownerUserId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
@@ -1180,6 +1217,13 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1180
1217
|
readonly reference: import("effect/Schema").String;
|
|
1181
1218
|
readonly digestReference: import("effect/Schema").String;
|
|
1182
1219
|
readonly digest: import("effect/Schema").String;
|
|
1220
|
+
readonly personLayout: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1221
|
+
readonly status: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1222
|
+
readonly missing: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1223
|
+
readonly unknown: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1224
|
+
readonly runtime: import("effect/Schema").String;
|
|
1225
|
+
readonly acl: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1226
|
+
}>>;
|
|
1183
1227
|
}>>;
|
|
1184
1228
|
readonly error: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1185
1229
|
readonly message: import("effect/Schema").String;
|
|
@@ -1194,7 +1238,32 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1194
1238
|
readonly finishedAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
1195
1239
|
readonly durationMs: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
1196
1240
|
}>>;
|
|
1197
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
1241
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listWorkspaceCredentials", "GET", "/v1/workspaces/:workspaceId/credentials", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1242
|
+
readonly workspaceId: import("effect/Schema").String;
|
|
1243
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1244
|
+
readonly ownerUserId: import("effect/Schema").String;
|
|
1245
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1246
|
+
readonly workspaceId: import("effect/Schema").String;
|
|
1247
|
+
readonly runId: import("effect/Schema").String;
|
|
1248
|
+
readonly homes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
1249
|
+
readonly home: import("effect/Schema").String;
|
|
1250
|
+
readonly onBehalfOfUserId: import("effect/Schema").String;
|
|
1251
|
+
readonly accounts: import("effect/Schema").Struct<{
|
|
1252
|
+
readonly claude: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1253
|
+
readonly connectedAccountId: import("effect/Schema").String;
|
|
1254
|
+
readonly name: import("effect/Schema").String;
|
|
1255
|
+
}>>;
|
|
1256
|
+
readonly codex: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1257
|
+
readonly connectedAccountId: import("effect/Schema").String;
|
|
1258
|
+
readonly name: import("effect/Schema").String;
|
|
1259
|
+
}>>;
|
|
1260
|
+
readonly github: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1261
|
+
readonly connectedAccountId: import("effect/Schema").String;
|
|
1262
|
+
readonly name: import("effect/Schema").String;
|
|
1263
|
+
}>>;
|
|
1264
|
+
}>;
|
|
1265
|
+
}>>;
|
|
1266
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceForbiddenError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listWorkspaceEvents", "GET", "/v1/workspaces/:workspaceId/events", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1198
1267
|
readonly workspaceId: import("effect/Schema").String;
|
|
1199
1268
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1200
1269
|
readonly ownerUserId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
@@ -1237,6 +1306,13 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1237
1306
|
readonly reference: import("effect/Schema").String;
|
|
1238
1307
|
readonly digestReference: import("effect/Schema").String;
|
|
1239
1308
|
readonly digest: import("effect/Schema").String;
|
|
1309
|
+
readonly personLayout: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1310
|
+
readonly status: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1311
|
+
readonly missing: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1312
|
+
readonly unknown: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
1313
|
+
readonly runtime: import("effect/Schema").String;
|
|
1314
|
+
readonly acl: import("effect/Schema").Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1315
|
+
}>>;
|
|
1240
1316
|
}>>;
|
|
1241
1317
|
readonly error: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1242
1318
|
readonly message: import("effect/Schema").String;
|
|
@@ -1248,7 +1324,39 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1248
1324
|
readonly finishedAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
1249
1325
|
readonly expiresAt: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
1250
1326
|
}>>;
|
|
1251
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
1327
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"putWorkspaceCredentials", "POST", "/v1/workspaces/:workspaceId/credentials", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1328
|
+
readonly workspaceId: import("effect/Schema").String;
|
|
1329
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1330
|
+
readonly ownerUserId: import("effect/Schema").String;
|
|
1331
|
+
readonly onBehalfOfUserId: import("effect/Schema").String;
|
|
1332
|
+
readonly home: import("effect/Schema").String;
|
|
1333
|
+
readonly uid: import("effect/Schema").optional<import("effect/Schema").Int>;
|
|
1334
|
+
readonly gid: import("effect/Schema").optional<import("effect/Schema").Int>;
|
|
1335
|
+
readonly claude: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
1336
|
+
readonly codex: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
1337
|
+
readonly github: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
1338
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1339
|
+
readonly workspaceId: import("effect/Schema").String;
|
|
1340
|
+
readonly runId: import("effect/Schema").String;
|
|
1341
|
+
readonly home: import("effect/Schema").Struct<{
|
|
1342
|
+
readonly home: import("effect/Schema").String;
|
|
1343
|
+
readonly onBehalfOfUserId: import("effect/Schema").String;
|
|
1344
|
+
readonly accounts: import("effect/Schema").Struct<{
|
|
1345
|
+
readonly claude: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1346
|
+
readonly connectedAccountId: import("effect/Schema").String;
|
|
1347
|
+
readonly name: import("effect/Schema").String;
|
|
1348
|
+
}>>;
|
|
1349
|
+
readonly codex: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1350
|
+
readonly connectedAccountId: import("effect/Schema").String;
|
|
1351
|
+
readonly name: import("effect/Schema").String;
|
|
1352
|
+
}>>;
|
|
1353
|
+
readonly github: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
1354
|
+
readonly connectedAccountId: import("effect/Schema").String;
|
|
1355
|
+
readonly name: import("effect/Schema").String;
|
|
1356
|
+
}>>;
|
|
1357
|
+
}>;
|
|
1358
|
+
}>;
|
|
1359
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceForbiddenError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceBadGatewayError | typeof import("./workspaces.js").WorkspaceServiceUnavailableError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"recoverWorkspace", "POST", "/v1/workspaces/:workspaceId/recover", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1252
1360
|
readonly workspaceId: import("effect/Schema").String;
|
|
1253
1361
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1254
1362
|
readonly ownerUserId: import("effect/Schema").String;
|
|
@@ -1256,7 +1364,17 @@ export declare const ControlPlaneAPI: HttpApi.HttpApi<"sealantControlPlaneApi",
|
|
|
1256
1364
|
readonly workspaceId: import("effect/Schema").String;
|
|
1257
1365
|
readonly state: import("effect/Schema").Literals<readonly ["requested", "not-retained"]>;
|
|
1258
1366
|
readonly recoverable: import("effect/Schema").optional<import("effect/Schema").Boolean>;
|
|
1259
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
1367
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"releaseWorkspaceCredentials", "DELETE", "/v1/workspaces/:workspaceId/credentials", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1368
|
+
readonly workspaceId: import("effect/Schema").String;
|
|
1369
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1370
|
+
readonly ownerUserId: import("effect/Schema").String;
|
|
1371
|
+
readonly home: import("effect/Schema").String;
|
|
1372
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1373
|
+
readonly workspaceId: import("effect/Schema").String;
|
|
1374
|
+
readonly runId: import("effect/Schema").String;
|
|
1375
|
+
readonly home: import("effect/Schema").String;
|
|
1376
|
+
readonly released: import("effect/Schema").Boolean;
|
|
1377
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./workspaces.js").WorkspaceBadRequestError | typeof import("./workspaces.js").WorkspaceForbiddenError | typeof import("./workspaces.js").WorkspaceNotFoundError | typeof import("./workspaces.js").WorkspaceConflictError | typeof import("./workspaces.js").WorkspaceBadGatewayError | typeof import("./workspaces.js").WorkspaceServiceUnavailableError | typeof import("./workspaces.js").WorkspaceInternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"renameWorkspace", "PATCH", "/v1/workspaces/:workspaceId/name", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
1260
1378
|
readonly workspaceId: import("effect/Schema").String;
|
|
1261
1379
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
1262
1380
|
readonly name: import("effect/Schema").String;
|
|
@@ -30,6 +30,18 @@ export type SessionAuthorizationHeaders = typeof sessionAuthorizationHeadersSche
|
|
|
30
30
|
*/
|
|
31
31
|
export declare const sessionModeSchema: Schema.Literals<readonly ["pty", "pipe"]>;
|
|
32
32
|
export type SessionMode = typeof sessionModeSchema.Type;
|
|
33
|
+
/**
|
|
34
|
+
* The Linux user a process runs as (Mend ADR 0016): a user name of the image's passwd, or a numeric
|
|
35
|
+
* uid. The process takes its uid, gid, supplementary groups and `HOME`, `USER`, `LOGNAME` and
|
|
36
|
+
* `SHELL` from the passwd entry, umask 0002. Absent: the workspace's own user, as before.
|
|
37
|
+
*/
|
|
38
|
+
export declare const workspaceProcessUserSchema: Schema.String;
|
|
39
|
+
export type WorkspaceProcessUser = typeof workspaceProcessUserSchema.Type;
|
|
40
|
+
/**
|
|
41
|
+
* The stable `code` a create or exec answers while no workspace runtime can start a process as
|
|
42
|
+
* another user: Core asks sealantd to, and no released sealantd does yet. Nothing is started.
|
|
43
|
+
*/
|
|
44
|
+
export declare const PROCESS_USER_UNSUPPORTED_CODE = "user-unsupported";
|
|
33
45
|
export declare const createSessionRequestSchema: Schema.Struct<{
|
|
34
46
|
readonly workspaceId: Schema.String;
|
|
35
47
|
readonly ownerUserId: Schema.String;
|
|
@@ -46,6 +58,8 @@ export declare const createSessionRequestSchema: Schema.Struct<{
|
|
|
46
58
|
readonly mode: Schema.optional<Schema.Literals<readonly ["pty", "pipe"]>>;
|
|
47
59
|
/** Opaque caller correlation bag: stored verbatim, echoed on reads, no platform semantics. */
|
|
48
60
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
61
|
+
/** Run the session's process as this Linux user (see `workspaceProcessUserSchema`). */
|
|
62
|
+
readonly user: Schema.optional<Schema.String>;
|
|
49
63
|
}>;
|
|
50
64
|
export type CreateSessionRequest = typeof createSessionRequestSchema.Type;
|
|
51
65
|
export declare const sessionSchema: Schema.Struct<{
|
|
@@ -185,6 +199,8 @@ export declare class SessionNotFoundError extends SessionNotFoundError_base {
|
|
|
185
199
|
}
|
|
186
200
|
declare const SessionConflictError_base: Schema.Class<SessionConflictError, Schema.TaggedStruct<"SessionConflictError", {
|
|
187
201
|
readonly message: Schema.String;
|
|
202
|
+
/** A stable reason, where one applies (`user-unsupported`). */
|
|
203
|
+
readonly code: Schema.optional<Schema.String>;
|
|
188
204
|
}>, import("effect/Cause").YieldableError>;
|
|
189
205
|
export declare class SessionConflictError extends SessionConflictError_base {
|
|
190
206
|
}
|
|
@@ -245,6 +261,8 @@ export declare const SessionsGroup: HttpApiGroup.HttpApiGroup<"sessions", HttpAp
|
|
|
245
261
|
readonly mode: Schema.optional<Schema.Literals<readonly ["pty", "pipe"]>>;
|
|
246
262
|
/** Opaque caller correlation bag: stored verbatim, echoed on reads, no platform semantics. */
|
|
247
263
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
264
|
+
/** Run the session's process as this Linux user (see `workspaceProcessUserSchema`). */
|
|
265
|
+
readonly user: Schema.optional<Schema.String>;
|
|
248
266
|
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
249
267
|
readonly authorization: Schema.optional<Schema.String>;
|
|
250
268
|
}>>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
@@ -28,6 +28,17 @@ export const sessionAuthorizationHeadersSchema = Schema.Struct({
|
|
|
28
28
|
* rejected.
|
|
29
29
|
*/
|
|
30
30
|
export const sessionModeSchema = Schema.Literals(["pty", "pipe"]);
|
|
31
|
+
/**
|
|
32
|
+
* The Linux user a process runs as (Mend ADR 0016): a user name of the image's passwd, or a numeric
|
|
33
|
+
* uid. The process takes its uid, gid, supplementary groups and `HOME`, `USER`, `LOGNAME` and
|
|
34
|
+
* `SHELL` from the passwd entry, umask 0002. Absent: the workspace's own user, as before.
|
|
35
|
+
*/
|
|
36
|
+
export const workspaceProcessUserSchema = Schema.String.check(Schema.isPattern(/^(?:[a-z_][a-z0-9_-]{0,31}|[0-9]{1,10})$/));
|
|
37
|
+
/**
|
|
38
|
+
* The stable `code` a create or exec answers while no workspace runtime can start a process as
|
|
39
|
+
* another user: Core asks sealantd to, and no released sealantd does yet. Nothing is started.
|
|
40
|
+
*/
|
|
41
|
+
export const PROCESS_USER_UNSUPPORTED_CODE = "user-unsupported";
|
|
31
42
|
export const createSessionRequestSchema = Schema.Struct({
|
|
32
43
|
workspaceId: NonEmptyString,
|
|
33
44
|
ownerUserId: NonEmptyString,
|
|
@@ -44,6 +55,8 @@ export const createSessionRequestSchema = Schema.Struct({
|
|
|
44
55
|
mode: Schema.optional(sessionModeSchema),
|
|
45
56
|
/** Opaque caller correlation bag: stored verbatim, echoed on reads, no platform semantics. */
|
|
46
57
|
metadata: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
58
|
+
/** Run the session's process as this Linux user (see `workspaceProcessUserSchema`). */
|
|
59
|
+
user: Schema.optional(workspaceProcessUserSchema),
|
|
47
60
|
});
|
|
48
61
|
export const sessionSchema = Schema.Struct({
|
|
49
62
|
sessionId: NonEmptyString,
|
|
@@ -129,7 +142,11 @@ export class SessionForbiddenError extends Schema.TaggedErrorClass()("SessionFor
|
|
|
129
142
|
}
|
|
130
143
|
export class SessionNotFoundError extends Schema.TaggedErrorClass()("SessionNotFoundError", { message: Schema.String }, { httpApiStatus: 404 }) {
|
|
131
144
|
}
|
|
132
|
-
export class SessionConflictError extends Schema.TaggedErrorClass()("SessionConflictError", {
|
|
145
|
+
export class SessionConflictError extends Schema.TaggedErrorClass()("SessionConflictError", {
|
|
146
|
+
message: Schema.String,
|
|
147
|
+
/** A stable reason, where one applies (`user-unsupported`). */
|
|
148
|
+
code: Schema.optional(NonEmptyString),
|
|
149
|
+
}, { httpApiStatus: 409 }) {
|
|
133
150
|
}
|
|
134
151
|
export class SessionBadGatewayError extends Schema.TaggedErrorClass()("SessionBadGatewayError", { message: Schema.String }, { httpApiStatus: 502 }) {
|
|
135
152
|
}
|
|
@@ -5,6 +5,14 @@ export declare const systemIndexResponseSchema: Schema.Struct<{
|
|
|
5
5
|
readonly version: Schema.String;
|
|
6
6
|
readonly docsPath: Schema.String;
|
|
7
7
|
readonly openApiPath: Schema.String;
|
|
8
|
+
/**
|
|
9
|
+
* What this control plane can do that an older one cannot, so a client refuses a request it would
|
|
10
|
+
* otherwise send to a server that ignores part of it. Absent from older control planes: nothing.
|
|
11
|
+
*/
|
|
12
|
+
readonly features: Schema.optional<Schema.Struct<{
|
|
13
|
+
/** A process can run as a given Linux user (`user` on exec and sessions). */
|
|
14
|
+
readonly processUser: Schema.Boolean;
|
|
15
|
+
}>>;
|
|
8
16
|
}>;
|
|
9
17
|
export type SystemIndexResponse = typeof systemIndexResponseSchema.Type;
|
|
10
18
|
export declare const systemHealthResponseSchema: Schema.Struct<{
|
|
@@ -36,6 +44,14 @@ export declare const SystemGroup: HttpApiGroup.HttpApiGroup<"system", HttpApiEnd
|
|
|
36
44
|
readonly version: Schema.String;
|
|
37
45
|
readonly docsPath: Schema.String;
|
|
38
46
|
readonly openApiPath: Schema.String;
|
|
47
|
+
/**
|
|
48
|
+
* What this control plane can do that an older one cannot, so a client refuses a request it would
|
|
49
|
+
* otherwise send to a server that ignores part of it. Absent from older control planes: nothing.
|
|
50
|
+
*/
|
|
51
|
+
readonly features: Schema.optional<Schema.Struct<{
|
|
52
|
+
/** A process can run as a given Linux user (`user` on exec and sessions). */
|
|
53
|
+
readonly processUser: Schema.Boolean;
|
|
54
|
+
}>>;
|
|
39
55
|
}>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getSetupState", "GET", "/v1/system/setup-state", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
40
56
|
readonly needsSetup: Schema.Boolean;
|
|
41
57
|
readonly sshGateway: Schema.NullOr<Schema.Struct<{
|
package/dist/core-api/system.js
CHANGED
|
@@ -6,6 +6,14 @@ export const systemIndexResponseSchema = Schema.Struct({
|
|
|
6
6
|
version: NonEmptyString,
|
|
7
7
|
docsPath: NonEmptyString,
|
|
8
8
|
openApiPath: NonEmptyString,
|
|
9
|
+
/**
|
|
10
|
+
* What this control plane can do that an older one cannot, so a client refuses a request it would
|
|
11
|
+
* otherwise send to a server that ignores part of it. Absent from older control planes: nothing.
|
|
12
|
+
*/
|
|
13
|
+
features: Schema.optional(Schema.Struct({
|
|
14
|
+
/** A process can run as a given Linux user (`user` on exec and sessions). */
|
|
15
|
+
processUser: Schema.Boolean,
|
|
16
|
+
})),
|
|
9
17
|
});
|
|
10
18
|
export const systemHealthResponseSchema = Schema.Struct({
|
|
11
19
|
status: Schema.Literal("ok"),
|
|
@@ -47,10 +47,48 @@ export declare const workspaceSshTargetSchema: Schema.Struct<{
|
|
|
47
47
|
}>;
|
|
48
48
|
}>;
|
|
49
49
|
export type WorkspaceSshTarget = typeof workspaceSshTargetSchema.Type;
|
|
50
|
+
/**
|
|
51
|
+
* Whether an image can run Mend's per-person layout on a runtime (Mend ADR 0016): the verdict of
|
|
52
|
+
* the image build's probe (`metadata.imageProbe`: setuid `sudo` and a usable sudoers rule,
|
|
53
|
+
* `useradd`, `setfacl`, `setpriv`, `flock`, a writable passwd, the `mend` group and the reserved
|
|
54
|
+
* ids, and what its sealantd reports), the runtime's `no_new_privs` (Kubernetes), and ACLs on
|
|
55
|
+
* `/workspace` as the operator declares them (`SEALANT_WORKSPACE_ACLS`). What is not known is
|
|
56
|
+
* `unknown`, never `supported`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const workspaceImagePersonLayoutSchema: Schema.Struct<{
|
|
59
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
60
|
+
/**
|
|
61
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
62
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
63
|
+
*/
|
|
64
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
65
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
66
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
67
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
68
|
+
readonly runtime: Schema.String;
|
|
69
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
70
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
71
|
+
}>;
|
|
72
|
+
export type WorkspaceImagePersonLayout = typeof workspaceImagePersonLayoutSchema.Type;
|
|
50
73
|
export declare const workspacePublishedImageSchema: Schema.Struct<{
|
|
51
74
|
readonly reference: Schema.String;
|
|
52
75
|
readonly digestReference: Schema.String;
|
|
53
76
|
readonly digest: Schema.String;
|
|
77
|
+
/** Absent from control planes before the per-person capability. */
|
|
78
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
79
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
80
|
+
/**
|
|
81
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
82
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
83
|
+
*/
|
|
84
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
85
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
86
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
87
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
88
|
+
readonly runtime: Schema.String;
|
|
89
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
90
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
91
|
+
}>>;
|
|
54
92
|
}>;
|
|
55
93
|
export declare const workspaceErrorSchema: Schema.Struct<{
|
|
56
94
|
readonly message: Schema.String;
|
|
@@ -144,6 +182,8 @@ export declare const execWorkspaceRequestSchema: Schema.Struct<{
|
|
|
144
182
|
readonly args: Schema.$Array<Schema.String>;
|
|
145
183
|
readonly cwd: Schema.optional<Schema.String>;
|
|
146
184
|
}>>;
|
|
185
|
+
/** Run every command as this Linux user (see `workspaceProcessUserSchema`). */
|
|
186
|
+
readonly user: Schema.optional<Schema.String>;
|
|
147
187
|
}>;
|
|
148
188
|
export type ExecWorkspaceRequest = typeof execWorkspaceRequestSchema.Type;
|
|
149
189
|
/**
|
|
@@ -504,6 +544,215 @@ export declare const restartWorkspaceResponseSchema: Schema.Struct<{
|
|
|
504
544
|
readonly status: Schema.Literals<readonly ["queued", "running", "ready", "failed", "cancelled", "stopped", "retained"]>;
|
|
505
545
|
}>;
|
|
506
546
|
export type RestartWorkspaceResponse = typeof restartWorkspaceResponseSchema.Type;
|
|
547
|
+
/**
|
|
548
|
+
* What a create would build, read before the create (Mend ADR 0016 needs the per-person capability
|
|
549
|
+
* before it chooses a layout): the spec is planned exactly as the build plans it, and the latest
|
|
550
|
+
* image published for that plan answers. Nothing is created, built or reserved.
|
|
551
|
+
*/
|
|
552
|
+
export declare const inspectWorkspaceImageRequestSchema: Schema.Struct<{
|
|
553
|
+
readonly ownerUserId: Schema.String;
|
|
554
|
+
readonly registryId: Schema.String;
|
|
555
|
+
/** The spec a create would send (`CreateWorkspaceRequest.spec`). */
|
|
556
|
+
readonly spec: Schema.Unknown;
|
|
557
|
+
}>;
|
|
558
|
+
export type InspectWorkspaceImageRequest = typeof inspectWorkspaceImageRequestSchema.Type;
|
|
559
|
+
export declare const inspectWorkspaceImageResponseSchema: Schema.Struct<{
|
|
560
|
+
/** The hash of the image plan the spec renders: one per distinct build input. */
|
|
561
|
+
readonly planHash: Schema.String;
|
|
562
|
+
/** The latest image published for the plan; absent when none has been built yet. */
|
|
563
|
+
readonly publishedImage: Schema.optional<Schema.Struct<{
|
|
564
|
+
readonly reference: Schema.String;
|
|
565
|
+
readonly digestReference: Schema.String;
|
|
566
|
+
readonly digest: Schema.String;
|
|
567
|
+
/** Absent from control planes before the per-person capability. */
|
|
568
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
569
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
570
|
+
/**
|
|
571
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
572
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
573
|
+
*/
|
|
574
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
575
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
576
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
577
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
578
|
+
readonly runtime: Schema.String;
|
|
579
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
580
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
581
|
+
}>>;
|
|
582
|
+
}>>;
|
|
583
|
+
/** The image's per-person capability (`unknown` when none has been built yet). */
|
|
584
|
+
readonly personLayout: Schema.Struct<{
|
|
585
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
586
|
+
/**
|
|
587
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
588
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
589
|
+
*/
|
|
590
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
591
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
592
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
593
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
594
|
+
readonly runtime: Schema.String;
|
|
595
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
596
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
597
|
+
}>;
|
|
598
|
+
}>;
|
|
599
|
+
export type InspectWorkspaceImageResponse = typeof inspectWorkspaceImageResponseSchema.Type;
|
|
600
|
+
/** The providers a home holds logins for (docs/connected-accounts-design.md §6c). */
|
|
601
|
+
export declare const workspaceCredentialHomeProviders: readonly ["claude", "codex", "github"];
|
|
602
|
+
export type WorkspaceCredentialHomeProvider = (typeof workspaceCredentialHomeProviders)[number];
|
|
603
|
+
/**
|
|
604
|
+
* Put one person's logins into one home of a RUNNING workspace (docs/connected-accounts-design.md
|
|
605
|
+
* §6c). A home holds one person's logins while it is held: the first put names its person, a put
|
|
606
|
+
* for anyone else is refused (`home-held`) until the home is released. Core writes a copy of each
|
|
607
|
+
* named account (no refresh token, like a launch) owned by the home's owner, mode 0600, and keeps it
|
|
608
|
+
* refreshed there; GitHub is written as `<home>/.config/gh/hosts.yml`. Values are connected-account
|
|
609
|
+
* ids ("cacc_…") or per-provider account names of `onBehalfOfUserId`, resolved exactly as at create
|
|
610
|
+
* ("default" is the account `true` picks); `null` removes that provider's login from the home (the
|
|
611
|
+
* person has not connected it). A provider left out is left as it is.
|
|
612
|
+
*/
|
|
613
|
+
export declare const putWorkspaceCredentialsRequestSchema: Schema.Struct<{
|
|
614
|
+
/** The workspace's owner (owner scope; uniform 404 otherwise). */
|
|
615
|
+
readonly ownerUserId: Schema.String;
|
|
616
|
+
/** The person whose logins the home holds: every named account must be theirs. */
|
|
617
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
618
|
+
/**
|
|
619
|
+
* Absolute path of the home inside the executor: a person's home, a conversation home, or
|
|
620
|
+
* `/root`. Normalised, never under `/workspace`, and reached without a symbolic link. It must
|
|
621
|
+
* exist; its owner owns the files.
|
|
622
|
+
*/
|
|
623
|
+
readonly home: Schema.String;
|
|
624
|
+
/**
|
|
625
|
+
* The home's owner, given together: a home that does not exist yet is made for them (mode 0700,
|
|
626
|
+
* seeded from `/etc/skel`), so a put can run beside the `useradd` that makes its user. Without
|
|
627
|
+
* them a missing home is refused (`home-unusable`).
|
|
628
|
+
*/
|
|
629
|
+
readonly uid: Schema.optional<Schema.Int>;
|
|
630
|
+
readonly gid: Schema.optional<Schema.Int>;
|
|
631
|
+
readonly claude: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
632
|
+
readonly codex: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
633
|
+
readonly github: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
634
|
+
}>;
|
|
635
|
+
export type PutWorkspaceCredentialsRequest = typeof putWorkspaceCredentialsRequestSchema.Type;
|
|
636
|
+
/** One account whose copy a home holds. */
|
|
637
|
+
export declare const workspaceHomeAccountSchema: Schema.Struct<{
|
|
638
|
+
readonly connectedAccountId: Schema.String;
|
|
639
|
+
/** The account's name under its provider, as it is now. */
|
|
640
|
+
readonly name: Schema.String;
|
|
641
|
+
}>;
|
|
642
|
+
export type WorkspaceHomeAccount = typeof workspaceHomeAccountSchema.Type;
|
|
643
|
+
/** One home of a running workspace and the logins Core keeps in it. */
|
|
644
|
+
export declare const workspaceCredentialHomeSchema: Schema.Struct<{
|
|
645
|
+
readonly home: Schema.String;
|
|
646
|
+
/** The one person whose logins the home holds. */
|
|
647
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
648
|
+
/** By provider; a provider the home holds no login for is absent. */
|
|
649
|
+
readonly accounts: Schema.Struct<{
|
|
650
|
+
readonly claude: Schema.optional<Schema.Struct<{
|
|
651
|
+
readonly connectedAccountId: Schema.String;
|
|
652
|
+
/** The account's name under its provider, as it is now. */
|
|
653
|
+
readonly name: Schema.String;
|
|
654
|
+
}>>;
|
|
655
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
656
|
+
readonly connectedAccountId: Schema.String;
|
|
657
|
+
/** The account's name under its provider, as it is now. */
|
|
658
|
+
readonly name: Schema.String;
|
|
659
|
+
}>>;
|
|
660
|
+
readonly github: Schema.optional<Schema.Struct<{
|
|
661
|
+
readonly connectedAccountId: Schema.String;
|
|
662
|
+
/** The account's name under its provider, as it is now. */
|
|
663
|
+
readonly name: Schema.String;
|
|
664
|
+
}>>;
|
|
665
|
+
}>;
|
|
666
|
+
}>;
|
|
667
|
+
export type WorkspaceCredentialHome = typeof workspaceCredentialHomeSchema.Type;
|
|
668
|
+
export declare const putWorkspaceCredentialsResponseSchema: Schema.Struct<{
|
|
669
|
+
readonly workspaceId: Schema.String;
|
|
670
|
+
/** The launch attempt whose executor was written. */
|
|
671
|
+
readonly runId: Schema.String;
|
|
672
|
+
/** The home as it is after the put. */
|
|
673
|
+
readonly home: Schema.Struct<{
|
|
674
|
+
readonly home: Schema.String;
|
|
675
|
+
/** The one person whose logins the home holds. */
|
|
676
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
677
|
+
/** By provider; a provider the home holds no login for is absent. */
|
|
678
|
+
readonly accounts: Schema.Struct<{
|
|
679
|
+
readonly claude: Schema.optional<Schema.Struct<{
|
|
680
|
+
readonly connectedAccountId: Schema.String;
|
|
681
|
+
/** The account's name under its provider, as it is now. */
|
|
682
|
+
readonly name: Schema.String;
|
|
683
|
+
}>>;
|
|
684
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
685
|
+
readonly connectedAccountId: Schema.String;
|
|
686
|
+
/** The account's name under its provider, as it is now. */
|
|
687
|
+
readonly name: Schema.String;
|
|
688
|
+
}>>;
|
|
689
|
+
readonly github: Schema.optional<Schema.Struct<{
|
|
690
|
+
readonly connectedAccountId: Schema.String;
|
|
691
|
+
/** The account's name under its provider, as it is now. */
|
|
692
|
+
readonly name: Schema.String;
|
|
693
|
+
}>>;
|
|
694
|
+
}>;
|
|
695
|
+
}>;
|
|
696
|
+
}>;
|
|
697
|
+
export type PutWorkspaceCredentialsResponse = typeof putWorkspaceCredentialsResponseSchema.Type;
|
|
698
|
+
/** Release one home: its login files are removed and its record deleted. */
|
|
699
|
+
export declare const releaseWorkspaceCredentialsQuerySchema: Schema.Struct<{
|
|
700
|
+
readonly ownerUserId: Schema.String;
|
|
701
|
+
readonly home: Schema.String;
|
|
702
|
+
}>;
|
|
703
|
+
export type ReleaseWorkspaceCredentialsQuery = typeof releaseWorkspaceCredentialsQuerySchema.Type;
|
|
704
|
+
export declare const releaseWorkspaceCredentialsResponseSchema: Schema.Struct<{
|
|
705
|
+
readonly workspaceId: Schema.String;
|
|
706
|
+
readonly runId: Schema.String;
|
|
707
|
+
readonly home: Schema.String;
|
|
708
|
+
/** `false`: the home held nothing (already released); its login files were removed anyway. */
|
|
709
|
+
readonly released: Schema.Boolean;
|
|
710
|
+
}>;
|
|
711
|
+
export type ReleaseWorkspaceCredentialsResponse = typeof releaseWorkspaceCredentialsResponseSchema.Type;
|
|
712
|
+
export declare const listWorkspaceCredentialsQuerySchema: Schema.Struct<{
|
|
713
|
+
readonly ownerUserId: Schema.String;
|
|
714
|
+
}>;
|
|
715
|
+
export type ListWorkspaceCredentialsQuery = typeof listWorkspaceCredentialsQuerySchema.Type;
|
|
716
|
+
/** The homes of the workspace's running executor, oldest first. */
|
|
717
|
+
export declare const listWorkspaceCredentialsResponseSchema: Schema.Struct<{
|
|
718
|
+
readonly workspaceId: Schema.String;
|
|
719
|
+
readonly runId: Schema.String;
|
|
720
|
+
readonly homes: Schema.$Array<Schema.Struct<{
|
|
721
|
+
readonly home: Schema.String;
|
|
722
|
+
/** The one person whose logins the home holds. */
|
|
723
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
724
|
+
/** By provider; a provider the home holds no login for is absent. */
|
|
725
|
+
readonly accounts: Schema.Struct<{
|
|
726
|
+
readonly claude: Schema.optional<Schema.Struct<{
|
|
727
|
+
readonly connectedAccountId: Schema.String;
|
|
728
|
+
/** The account's name under its provider, as it is now. */
|
|
729
|
+
readonly name: Schema.String;
|
|
730
|
+
}>>;
|
|
731
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
732
|
+
readonly connectedAccountId: Schema.String;
|
|
733
|
+
/** The account's name under its provider, as it is now. */
|
|
734
|
+
readonly name: Schema.String;
|
|
735
|
+
}>>;
|
|
736
|
+
readonly github: Schema.optional<Schema.Struct<{
|
|
737
|
+
readonly connectedAccountId: Schema.String;
|
|
738
|
+
/** The account's name under its provider, as it is now. */
|
|
739
|
+
readonly name: Schema.String;
|
|
740
|
+
}>>;
|
|
741
|
+
}>;
|
|
742
|
+
}>>;
|
|
743
|
+
}>;
|
|
744
|
+
export type ListWorkspaceCredentialsResponse = typeof listWorkspaceCredentialsResponseSchema.Type;
|
|
745
|
+
/**
|
|
746
|
+
* Stable `code`s of the `WorkspaceConflictError` the credential routes answer:
|
|
747
|
+
* `workspace-not-running` (no ready executor), `connected-account-invalid` (a named account is
|
|
748
|
+
* marked invalid: reconnect it), `home-held` (the home holds another person's logins: release it
|
|
749
|
+
* first; `/root` while the launch's own logins are at `$HOME`, or for anyone but the workspace's
|
|
750
|
+
* owner), `home-unusable` (the home does not exist, is not a directory, is reached through a
|
|
751
|
+
* symbolic link, or a login directory in it links outside it), `home-busy` (another write into the
|
|
752
|
+
* home, or too many into this workspace, is still running: nothing was done, try again).
|
|
753
|
+
*/
|
|
754
|
+
export declare const workspaceCredentialsConflictCodes: readonly ["workspace-not-running", "connected-account-invalid", "home-held", "home-unusable", "home-busy"];
|
|
755
|
+
export type WorkspaceCredentialsConflictCode = (typeof workspaceCredentialsConflictCodes)[number];
|
|
507
756
|
export declare const expireWorkspaceRequestSchema: Schema.Struct<{
|
|
508
757
|
readonly ownerUserId: Schema.String;
|
|
509
758
|
readonly ttlSeconds: Schema.optional<Schema.NullOr<Schema.Int>>;
|
|
@@ -626,6 +875,21 @@ export declare const workspaceSummarySchema: Schema.Struct<{
|
|
|
626
875
|
readonly reference: Schema.String;
|
|
627
876
|
readonly digestReference: Schema.String;
|
|
628
877
|
readonly digest: Schema.String;
|
|
878
|
+
/** Absent from control planes before the per-person capability. */
|
|
879
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
880
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
881
|
+
/**
|
|
882
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
883
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
884
|
+
*/
|
|
885
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
886
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
887
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
888
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
889
|
+
readonly runtime: Schema.String;
|
|
890
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
891
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
892
|
+
}>>;
|
|
629
893
|
}>>;
|
|
630
894
|
readonly error: Schema.optional<Schema.Struct<{
|
|
631
895
|
readonly message: Schema.String;
|
|
@@ -753,6 +1017,21 @@ export declare const workspaceDetailsSchema: Schema.Struct<{
|
|
|
753
1017
|
readonly reference: Schema.String;
|
|
754
1018
|
readonly digestReference: Schema.String;
|
|
755
1019
|
readonly digest: Schema.String;
|
|
1020
|
+
/** Absent from control planes before the per-person capability. */
|
|
1021
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
1022
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
1025
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
1026
|
+
*/
|
|
1027
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
1028
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
1029
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
1030
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
1031
|
+
readonly runtime: Schema.String;
|
|
1032
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
1033
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1034
|
+
}>>;
|
|
756
1035
|
}>>;
|
|
757
1036
|
readonly error: Schema.optional<Schema.Struct<{
|
|
758
1037
|
readonly message: Schema.String;
|
|
@@ -881,6 +1160,21 @@ export declare const listWorkspacesResponseSchema: Schema.Struct<{
|
|
|
881
1160
|
readonly reference: Schema.String;
|
|
882
1161
|
readonly digestReference: Schema.String;
|
|
883
1162
|
readonly digest: Schema.String;
|
|
1163
|
+
/** Absent from control planes before the per-person capability. */
|
|
1164
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
1165
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1166
|
+
/**
|
|
1167
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
1168
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
1169
|
+
*/
|
|
1170
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
1171
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
1172
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
1173
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
1174
|
+
readonly runtime: Schema.String;
|
|
1175
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
1176
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1177
|
+
}>>;
|
|
884
1178
|
}>>;
|
|
885
1179
|
readonly error: Schema.optional<Schema.Struct<{
|
|
886
1180
|
readonly message: Schema.String;
|
|
@@ -932,6 +1226,21 @@ export declare const workspaceAttemptSummarySchema: Schema.Struct<{
|
|
|
932
1226
|
readonly reference: Schema.String;
|
|
933
1227
|
readonly digestReference: Schema.String;
|
|
934
1228
|
readonly digest: Schema.String;
|
|
1229
|
+
/** Absent from control planes before the per-person capability. */
|
|
1230
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
1231
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1232
|
+
/**
|
|
1233
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
1234
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
1235
|
+
*/
|
|
1236
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
1237
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
1238
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
1239
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
1240
|
+
readonly runtime: Schema.String;
|
|
1241
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
1242
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1243
|
+
}>>;
|
|
935
1244
|
}>>;
|
|
936
1245
|
readonly error: Schema.optional<Schema.Struct<{
|
|
937
1246
|
readonly message: Schema.String;
|
|
@@ -981,6 +1290,21 @@ export declare const listWorkspaceAttemptsResponseSchema: Schema.Struct<{
|
|
|
981
1290
|
readonly reference: Schema.String;
|
|
982
1291
|
readonly digestReference: Schema.String;
|
|
983
1292
|
readonly digest: Schema.String;
|
|
1293
|
+
/** Absent from control planes before the per-person capability. */
|
|
1294
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
1295
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
1298
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
1299
|
+
*/
|
|
1300
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
1301
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
1302
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
1303
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
1304
|
+
readonly runtime: Schema.String;
|
|
1305
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
1306
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1307
|
+
}>>;
|
|
984
1308
|
}>>;
|
|
985
1309
|
readonly error: Schema.optional<Schema.Struct<{
|
|
986
1310
|
readonly message: Schema.String;
|
|
@@ -1215,6 +1539,8 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1215
1539
|
readonly args: Schema.$Array<Schema.String>;
|
|
1216
1540
|
readonly cwd: Schema.optional<Schema.String>;
|
|
1217
1541
|
}>>;
|
|
1542
|
+
/** Run every command as this Linux user (see `workspaceProcessUserSchema`). */
|
|
1543
|
+
readonly user: Schema.optional<Schema.String>;
|
|
1218
1544
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1219
1545
|
readonly runId: Schema.String;
|
|
1220
1546
|
readonly workspaceId: Schema.String;
|
|
@@ -1415,6 +1741,21 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1415
1741
|
readonly reference: Schema.String;
|
|
1416
1742
|
readonly digestReference: Schema.String;
|
|
1417
1743
|
readonly digest: Schema.String;
|
|
1744
|
+
/** Absent from control planes before the per-person capability. */
|
|
1745
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
1746
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1747
|
+
/**
|
|
1748
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
1749
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
1750
|
+
*/
|
|
1751
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
1752
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
1753
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
1754
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
1755
|
+
readonly runtime: Schema.String;
|
|
1756
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
1757
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1758
|
+
}>>;
|
|
1418
1759
|
}>>;
|
|
1419
1760
|
readonly error: Schema.optional<Schema.Struct<{
|
|
1420
1761
|
readonly message: Schema.String;
|
|
@@ -1637,7 +1978,51 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1637
1978
|
readonly status: Schema.Literals<readonly ["pending", "running", "ready", "failed", "stopped"]>;
|
|
1638
1979
|
readonly endpoint: Schema.String;
|
|
1639
1980
|
}>;
|
|
1640
|
-
}>>, HttpApiEndpoint.Json<typeof WorkspaceUnauthorizedError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
1981
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceUnauthorizedError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"inspectWorkspaceImage", "POST", "/image", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1982
|
+
readonly ownerUserId: Schema.String;
|
|
1983
|
+
readonly registryId: Schema.String;
|
|
1984
|
+
/** The spec a create would send (`CreateWorkspaceRequest.spec`). */
|
|
1985
|
+
readonly spec: Schema.Unknown;
|
|
1986
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1987
|
+
/** The hash of the image plan the spec renders: one per distinct build input. */
|
|
1988
|
+
readonly planHash: Schema.String;
|
|
1989
|
+
/** The latest image published for the plan; absent when none has been built yet. */
|
|
1990
|
+
readonly publishedImage: Schema.optional<Schema.Struct<{
|
|
1991
|
+
readonly reference: Schema.String;
|
|
1992
|
+
readonly digestReference: Schema.String;
|
|
1993
|
+
readonly digest: Schema.String;
|
|
1994
|
+
/** Absent from control planes before the per-person capability. */
|
|
1995
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
1996
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
1999
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
2000
|
+
*/
|
|
2001
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
2002
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
2003
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
2004
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
2005
|
+
readonly runtime: Schema.String;
|
|
2006
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
2007
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2008
|
+
}>>;
|
|
2009
|
+
}>>;
|
|
2010
|
+
/** The image's per-person capability (`unknown` when none has been built yet). */
|
|
2011
|
+
readonly personLayout: Schema.Struct<{
|
|
2012
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2013
|
+
/**
|
|
2014
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
2015
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
2016
|
+
*/
|
|
2017
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
2018
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
2019
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
2020
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
2021
|
+
readonly runtime: Schema.String;
|
|
2022
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
2023
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2024
|
+
}>;
|
|
2025
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listWorkspaceAttempts", "GET", "/:workspaceId/attempts", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1641
2026
|
readonly workspaceId: Schema.String;
|
|
1642
2027
|
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1643
2028
|
readonly ownerUserId: Schema.optional<Schema.String>;
|
|
@@ -1676,6 +2061,21 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1676
2061
|
readonly reference: Schema.String;
|
|
1677
2062
|
readonly digestReference: Schema.String;
|
|
1678
2063
|
readonly digest: Schema.String;
|
|
2064
|
+
/** Absent from control planes before the per-person capability. */
|
|
2065
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
2066
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2067
|
+
/**
|
|
2068
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
2069
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
2070
|
+
*/
|
|
2071
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
2072
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
2073
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
2074
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
2075
|
+
readonly runtime: Schema.String;
|
|
2076
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
2077
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2078
|
+
}>>;
|
|
1679
2079
|
}>>;
|
|
1680
2080
|
readonly error: Schema.optional<Schema.Struct<{
|
|
1681
2081
|
readonly message: Schema.String;
|
|
@@ -1690,7 +2090,37 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1690
2090
|
readonly finishedAt: Schema.optional<Schema.String>;
|
|
1691
2091
|
readonly durationMs: Schema.optional<Schema.Number>;
|
|
1692
2092
|
}>>;
|
|
1693
|
-
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
2093
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listWorkspaceCredentials", "GET", "/:workspaceId/credentials", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
2094
|
+
readonly workspaceId: Schema.String;
|
|
2095
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
2096
|
+
readonly ownerUserId: Schema.String;
|
|
2097
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
2098
|
+
readonly workspaceId: Schema.String;
|
|
2099
|
+
readonly runId: Schema.String;
|
|
2100
|
+
readonly homes: Schema.$Array<Schema.Struct<{
|
|
2101
|
+
readonly home: Schema.String;
|
|
2102
|
+
/** The one person whose logins the home holds. */
|
|
2103
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
2104
|
+
/** By provider; a provider the home holds no login for is absent. */
|
|
2105
|
+
readonly accounts: Schema.Struct<{
|
|
2106
|
+
readonly claude: Schema.optional<Schema.Struct<{
|
|
2107
|
+
readonly connectedAccountId: Schema.String;
|
|
2108
|
+
/** The account's name under its provider, as it is now. */
|
|
2109
|
+
readonly name: Schema.String;
|
|
2110
|
+
}>>;
|
|
2111
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
2112
|
+
readonly connectedAccountId: Schema.String;
|
|
2113
|
+
/** The account's name under its provider, as it is now. */
|
|
2114
|
+
readonly name: Schema.String;
|
|
2115
|
+
}>>;
|
|
2116
|
+
readonly github: Schema.optional<Schema.Struct<{
|
|
2117
|
+
readonly connectedAccountId: Schema.String;
|
|
2118
|
+
/** The account's name under its provider, as it is now. */
|
|
2119
|
+
readonly name: Schema.String;
|
|
2120
|
+
}>>;
|
|
2121
|
+
}>;
|
|
2122
|
+
}>>;
|
|
2123
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceForbiddenError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listWorkspaceEvents", "GET", "/:workspaceId/events", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1694
2124
|
readonly workspaceId: Schema.String;
|
|
1695
2125
|
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1696
2126
|
readonly ownerUserId: Schema.optional<Schema.String>;
|
|
@@ -1747,6 +2177,21 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1747
2177
|
readonly reference: Schema.String;
|
|
1748
2178
|
readonly digestReference: Schema.String;
|
|
1749
2179
|
readonly digest: Schema.String;
|
|
2180
|
+
/** Absent from control planes before the per-person capability. */
|
|
2181
|
+
readonly personLayout: Schema.optional<Schema.Struct<{
|
|
2182
|
+
readonly status: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2183
|
+
/**
|
|
2184
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
2185
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
2186
|
+
*/
|
|
2187
|
+
readonly missing: Schema.$Array<Schema.String>;
|
|
2188
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
2189
|
+
readonly unknown: Schema.$Array<Schema.String>;
|
|
2190
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
2191
|
+
readonly runtime: Schema.String;
|
|
2192
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
2193
|
+
readonly acl: Schema.Literals<readonly ["supported", "unsupported", "unknown"]>;
|
|
2194
|
+
}>>;
|
|
1750
2195
|
}>>;
|
|
1751
2196
|
readonly error: Schema.optional<Schema.Struct<{
|
|
1752
2197
|
readonly message: Schema.String;
|
|
@@ -1758,7 +2203,58 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1758
2203
|
readonly finishedAt: Schema.optional<Schema.String>;
|
|
1759
2204
|
readonly expiresAt: Schema.optional<Schema.String>;
|
|
1760
2205
|
}>>;
|
|
1761
|
-
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
2206
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"putWorkspaceCredentials", "POST", "/:workspaceId/credentials", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
2207
|
+
readonly workspaceId: Schema.String;
|
|
2208
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
2209
|
+
/** The workspace's owner (owner scope; uniform 404 otherwise). */
|
|
2210
|
+
readonly ownerUserId: Schema.String;
|
|
2211
|
+
/** The person whose logins the home holds: every named account must be theirs. */
|
|
2212
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
2213
|
+
/**
|
|
2214
|
+
* Absolute path of the home inside the executor: a person's home, a conversation home, or
|
|
2215
|
+
* `/root`. Normalised, never under `/workspace`, and reached without a symbolic link. It must
|
|
2216
|
+
* exist; its owner owns the files.
|
|
2217
|
+
*/
|
|
2218
|
+
readonly home: Schema.String;
|
|
2219
|
+
/**
|
|
2220
|
+
* The home's owner, given together: a home that does not exist yet is made for them (mode 0700,
|
|
2221
|
+
* seeded from `/etc/skel`), so a put can run beside the `useradd` that makes its user. Without
|
|
2222
|
+
* them a missing home is refused (`home-unusable`).
|
|
2223
|
+
*/
|
|
2224
|
+
readonly uid: Schema.optional<Schema.Int>;
|
|
2225
|
+
readonly gid: Schema.optional<Schema.Int>;
|
|
2226
|
+
readonly claude: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
2227
|
+
readonly codex: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
2228
|
+
readonly github: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
2229
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
2230
|
+
readonly workspaceId: Schema.String;
|
|
2231
|
+
/** The launch attempt whose executor was written. */
|
|
2232
|
+
readonly runId: Schema.String;
|
|
2233
|
+
/** The home as it is after the put. */
|
|
2234
|
+
readonly home: Schema.Struct<{
|
|
2235
|
+
readonly home: Schema.String;
|
|
2236
|
+
/** The one person whose logins the home holds. */
|
|
2237
|
+
readonly onBehalfOfUserId: Schema.String;
|
|
2238
|
+
/** By provider; a provider the home holds no login for is absent. */
|
|
2239
|
+
readonly accounts: Schema.Struct<{
|
|
2240
|
+
readonly claude: Schema.optional<Schema.Struct<{
|
|
2241
|
+
readonly connectedAccountId: Schema.String;
|
|
2242
|
+
/** The account's name under its provider, as it is now. */
|
|
2243
|
+
readonly name: Schema.String;
|
|
2244
|
+
}>>;
|
|
2245
|
+
readonly codex: Schema.optional<Schema.Struct<{
|
|
2246
|
+
readonly connectedAccountId: Schema.String;
|
|
2247
|
+
/** The account's name under its provider, as it is now. */
|
|
2248
|
+
readonly name: Schema.String;
|
|
2249
|
+
}>>;
|
|
2250
|
+
readonly github: Schema.optional<Schema.Struct<{
|
|
2251
|
+
readonly connectedAccountId: Schema.String;
|
|
2252
|
+
/** The account's name under its provider, as it is now. */
|
|
2253
|
+
readonly name: Schema.String;
|
|
2254
|
+
}>>;
|
|
2255
|
+
}>;
|
|
2256
|
+
}>;
|
|
2257
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceForbiddenError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceBadGatewayError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"recoverWorkspace", "POST", "/:workspaceId/recover", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1762
2258
|
readonly workspaceId: Schema.String;
|
|
1763
2259
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1764
2260
|
readonly ownerUserId: Schema.String;
|
|
@@ -1766,7 +2262,18 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
1766
2262
|
readonly workspaceId: Schema.String;
|
|
1767
2263
|
readonly state: Schema.Literals<readonly ["requested", "not-retained"]>;
|
|
1768
2264
|
readonly recoverable: Schema.optional<Schema.Boolean>;
|
|
1769
|
-
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
2265
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"releaseWorkspaceCredentials", "DELETE", "/:workspaceId/credentials", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
2266
|
+
readonly workspaceId: Schema.String;
|
|
2267
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
2268
|
+
readonly ownerUserId: Schema.String;
|
|
2269
|
+
readonly home: Schema.String;
|
|
2270
|
+
}>>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
2271
|
+
readonly workspaceId: Schema.String;
|
|
2272
|
+
readonly runId: Schema.String;
|
|
2273
|
+
readonly home: Schema.String;
|
|
2274
|
+
/** `false`: the home held nothing (already released); its login files were removed anyway. */
|
|
2275
|
+
readonly released: Schema.Boolean;
|
|
2276
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceBadRequestError | typeof WorkspaceForbiddenError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceBadGatewayError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"renameWorkspace", "PATCH", "/:workspaceId/name", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
1770
2277
|
readonly workspaceId: Schema.String;
|
|
1771
2278
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
1772
2279
|
readonly name: Schema.String;
|
|
@@ -2,6 +2,7 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
3
3
|
import { BudgetExceededError } from "./budgets.js";
|
|
4
4
|
import { runCommandSchema, runSchema } from "./runs.js";
|
|
5
|
+
import { workspaceProcessUserSchema } from "./sessions.js";
|
|
5
6
|
const NonEmptyString = Schema.String.check(Schema.isNonEmpty(), Schema.isTrimmed());
|
|
6
7
|
/**
|
|
7
8
|
* `retained`: the workspace's executor ended (or its capture launch failed after it started)
|
|
@@ -54,10 +55,34 @@ export const workspaceSshTargetSchema = Schema.Struct({
|
|
|
54
55
|
endpoint: Schema.String,
|
|
55
56
|
}),
|
|
56
57
|
});
|
|
58
|
+
/**
|
|
59
|
+
* Whether an image can run Mend's per-person layout on a runtime (Mend ADR 0016): the verdict of
|
|
60
|
+
* the image build's probe (`metadata.imageProbe`: setuid `sudo` and a usable sudoers rule,
|
|
61
|
+
* `useradd`, `setfacl`, `setpriv`, `flock`, a writable passwd, the `mend` group and the reserved
|
|
62
|
+
* ids, and what its sealantd reports), the runtime's `no_new_privs` (Kubernetes), and ACLs on
|
|
63
|
+
* `/workspace` as the operator declares them (`SEALANT_WORKSPACE_ACLS`). What is not known is
|
|
64
|
+
* `unknown`, never `supported`.
|
|
65
|
+
*/
|
|
66
|
+
export const workspaceImagePersonLayoutSchema = Schema.Struct({
|
|
67
|
+
status: Schema.Literals(["supported", "unsupported", "unknown"]),
|
|
68
|
+
/**
|
|
69
|
+
* Stable codes of what the image or the runtime lacks (`setuid-sudo`, `sudo-no-new-privileges`,
|
|
70
|
+
* `useradd`, `setpriv`, `flock`, `reserved-ids`, `sealantd:<capability>`, `acl`, …).
|
|
71
|
+
*/
|
|
72
|
+
missing: Schema.Array(Schema.String),
|
|
73
|
+
/** What could not be read: `probe` (an image built before the probe), `sealantd`, `flock`, `acl`. */
|
|
74
|
+
unknown: Schema.Array(Schema.String),
|
|
75
|
+
/** The runtime the answer is for: the workspace's, or the deployment's default before create. */
|
|
76
|
+
runtime: NonEmptyString,
|
|
77
|
+
/** ACLs on that runtime's `/workspace`, as the operator declared them. */
|
|
78
|
+
acl: Schema.Literals(["supported", "unsupported", "unknown"]),
|
|
79
|
+
});
|
|
57
80
|
export const workspacePublishedImageSchema = Schema.Struct({
|
|
58
81
|
reference: NonEmptyString,
|
|
59
82
|
digestReference: NonEmptyString,
|
|
60
83
|
digest: NonEmptyString,
|
|
84
|
+
/** Absent from control planes before the per-person capability. */
|
|
85
|
+
personLayout: Schema.optional(workspaceImagePersonLayoutSchema),
|
|
61
86
|
});
|
|
62
87
|
export const workspaceErrorSchema = Schema.Struct({
|
|
63
88
|
message: Schema.String,
|
|
@@ -141,6 +166,8 @@ export const execWorkspaceRequestSchema = Schema.Struct({
|
|
|
141
166
|
ownerUserId: NonEmptyString,
|
|
142
167
|
/** Commands execute sequentially in the workspace, each recorded like any other process. */
|
|
143
168
|
commands: Schema.Array(runCommandSchema).check(Schema.isNonEmpty(), Schema.isMaxLength(32)),
|
|
169
|
+
/** Run every command as this Linux user (see `workspaceProcessUserSchema`). */
|
|
170
|
+
user: Schema.optional(workspaceProcessUserSchema),
|
|
144
171
|
});
|
|
145
172
|
/**
|
|
146
173
|
* Bind a standby workspace's working directory, or a bindable extra mount, to one subdirectory of
|
|
@@ -453,6 +480,121 @@ export const restartWorkspaceResponseSchema = Schema.Struct({
|
|
|
453
480
|
runId: NonEmptyString,
|
|
454
481
|
status: workspaceStatusSchema,
|
|
455
482
|
});
|
|
483
|
+
/**
|
|
484
|
+
* What a create would build, read before the create (Mend ADR 0016 needs the per-person capability
|
|
485
|
+
* before it chooses a layout): the spec is planned exactly as the build plans it, and the latest
|
|
486
|
+
* image published for that plan answers. Nothing is created, built or reserved.
|
|
487
|
+
*/
|
|
488
|
+
export const inspectWorkspaceImageRequestSchema = Schema.Struct({
|
|
489
|
+
ownerUserId: NonEmptyString,
|
|
490
|
+
registryId: NonEmptyString,
|
|
491
|
+
/** The spec a create would send (`CreateWorkspaceRequest.spec`). */
|
|
492
|
+
spec: Schema.Unknown,
|
|
493
|
+
});
|
|
494
|
+
export const inspectWorkspaceImageResponseSchema = Schema.Struct({
|
|
495
|
+
/** The hash of the image plan the spec renders: one per distinct build input. */
|
|
496
|
+
planHash: NonEmptyString,
|
|
497
|
+
/** The latest image published for the plan; absent when none has been built yet. */
|
|
498
|
+
publishedImage: Schema.optional(workspacePublishedImageSchema),
|
|
499
|
+
/** The image's per-person capability (`unknown` when none has been built yet). */
|
|
500
|
+
personLayout: workspaceImagePersonLayoutSchema,
|
|
501
|
+
});
|
|
502
|
+
/** The providers a home holds logins for (docs/connected-accounts-design.md §6c). */
|
|
503
|
+
export const workspaceCredentialHomeProviders = ["claude", "codex", "github"];
|
|
504
|
+
/**
|
|
505
|
+
* Put one person's logins into one home of a RUNNING workspace (docs/connected-accounts-design.md
|
|
506
|
+
* §6c). A home holds one person's logins while it is held: the first put names its person, a put
|
|
507
|
+
* for anyone else is refused (`home-held`) until the home is released. Core writes a copy of each
|
|
508
|
+
* named account (no refresh token, like a launch) owned by the home's owner, mode 0600, and keeps it
|
|
509
|
+
* refreshed there; GitHub is written as `<home>/.config/gh/hosts.yml`. Values are connected-account
|
|
510
|
+
* ids ("cacc_…") or per-provider account names of `onBehalfOfUserId`, resolved exactly as at create
|
|
511
|
+
* ("default" is the account `true` picks); `null` removes that provider's login from the home (the
|
|
512
|
+
* person has not connected it). A provider left out is left as it is.
|
|
513
|
+
*/
|
|
514
|
+
export const putWorkspaceCredentialsRequestSchema = Schema.Struct({
|
|
515
|
+
/** The workspace's owner (owner scope; uniform 404 otherwise). */
|
|
516
|
+
ownerUserId: NonEmptyString,
|
|
517
|
+
/** The person whose logins the home holds: every named account must be theirs. */
|
|
518
|
+
onBehalfOfUserId: NonEmptyString,
|
|
519
|
+
/**
|
|
520
|
+
* Absolute path of the home inside the executor: a person's home, a conversation home, or
|
|
521
|
+
* `/root`. Normalised, never under `/workspace`, and reached without a symbolic link. It must
|
|
522
|
+
* exist; its owner owns the files.
|
|
523
|
+
*/
|
|
524
|
+
home: NonEmptyString,
|
|
525
|
+
/**
|
|
526
|
+
* The home's owner, given together: a home that does not exist yet is made for them (mode 0700,
|
|
527
|
+
* seeded from `/etc/skel`), so a put can run beside the `useradd` that makes its user. Without
|
|
528
|
+
* them a missing home is refused (`home-unusable`).
|
|
529
|
+
*/
|
|
530
|
+
uid: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
|
|
531
|
+
gid: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),
|
|
532
|
+
claude: Schema.optional(Schema.NullOr(NonEmptyString)),
|
|
533
|
+
codex: Schema.optional(Schema.NullOr(NonEmptyString)),
|
|
534
|
+
github: Schema.optional(Schema.NullOr(NonEmptyString)),
|
|
535
|
+
});
|
|
536
|
+
/** One account whose copy a home holds. */
|
|
537
|
+
export const workspaceHomeAccountSchema = Schema.Struct({
|
|
538
|
+
connectedAccountId: NonEmptyString,
|
|
539
|
+
/** The account's name under its provider, as it is now. */
|
|
540
|
+
name: NonEmptyString,
|
|
541
|
+
});
|
|
542
|
+
/** One home of a running workspace and the logins Core keeps in it. */
|
|
543
|
+
export const workspaceCredentialHomeSchema = Schema.Struct({
|
|
544
|
+
home: NonEmptyString,
|
|
545
|
+
/** The one person whose logins the home holds. */
|
|
546
|
+
onBehalfOfUserId: NonEmptyString,
|
|
547
|
+
/** By provider; a provider the home holds no login for is absent. */
|
|
548
|
+
accounts: Schema.Struct({
|
|
549
|
+
claude: Schema.optional(workspaceHomeAccountSchema),
|
|
550
|
+
codex: Schema.optional(workspaceHomeAccountSchema),
|
|
551
|
+
github: Schema.optional(workspaceHomeAccountSchema),
|
|
552
|
+
}),
|
|
553
|
+
});
|
|
554
|
+
export const putWorkspaceCredentialsResponseSchema = Schema.Struct({
|
|
555
|
+
workspaceId: NonEmptyString,
|
|
556
|
+
/** The launch attempt whose executor was written. */
|
|
557
|
+
runId: NonEmptyString,
|
|
558
|
+
/** The home as it is after the put. */
|
|
559
|
+
home: workspaceCredentialHomeSchema,
|
|
560
|
+
});
|
|
561
|
+
/** Release one home: its login files are removed and its record deleted. */
|
|
562
|
+
export const releaseWorkspaceCredentialsQuerySchema = Schema.Struct({
|
|
563
|
+
ownerUserId: NonEmptyString,
|
|
564
|
+
home: NonEmptyString,
|
|
565
|
+
});
|
|
566
|
+
export const releaseWorkspaceCredentialsResponseSchema = Schema.Struct({
|
|
567
|
+
workspaceId: NonEmptyString,
|
|
568
|
+
runId: NonEmptyString,
|
|
569
|
+
home: NonEmptyString,
|
|
570
|
+
/** `false`: the home held nothing (already released); its login files were removed anyway. */
|
|
571
|
+
released: Schema.Boolean,
|
|
572
|
+
});
|
|
573
|
+
export const listWorkspaceCredentialsQuerySchema = Schema.Struct({
|
|
574
|
+
ownerUserId: NonEmptyString,
|
|
575
|
+
});
|
|
576
|
+
/** The homes of the workspace's running executor, oldest first. */
|
|
577
|
+
export const listWorkspaceCredentialsResponseSchema = Schema.Struct({
|
|
578
|
+
workspaceId: NonEmptyString,
|
|
579
|
+
runId: NonEmptyString,
|
|
580
|
+
homes: Schema.Array(workspaceCredentialHomeSchema),
|
|
581
|
+
});
|
|
582
|
+
/**
|
|
583
|
+
* Stable `code`s of the `WorkspaceConflictError` the credential routes answer:
|
|
584
|
+
* `workspace-not-running` (no ready executor), `connected-account-invalid` (a named account is
|
|
585
|
+
* marked invalid: reconnect it), `home-held` (the home holds another person's logins: release it
|
|
586
|
+
* first; `/root` while the launch's own logins are at `$HOME`, or for anyone but the workspace's
|
|
587
|
+
* owner), `home-unusable` (the home does not exist, is not a directory, is reached through a
|
|
588
|
+
* symbolic link, or a login directory in it links outside it), `home-busy` (another write into the
|
|
589
|
+
* home, or too many into this workspace, is still running: nothing was done, try again).
|
|
590
|
+
*/
|
|
591
|
+
export const workspaceCredentialsConflictCodes = [
|
|
592
|
+
"workspace-not-running",
|
|
593
|
+
"connected-account-invalid",
|
|
594
|
+
"home-held",
|
|
595
|
+
"home-unusable",
|
|
596
|
+
"home-busy",
|
|
597
|
+
];
|
|
456
598
|
export const expireWorkspaceRequestSchema = Schema.Struct({
|
|
457
599
|
ownerUserId: NonEmptyString,
|
|
458
600
|
// Seconds from now until the workspace expires; null clears the TTL (never expires); omitted =
|
|
@@ -929,6 +1071,68 @@ HttpApiEndpoint.post("restartWorkspace", "/:workspaceId/restart", {
|
|
|
929
1071
|
],
|
|
930
1072
|
}))
|
|
931
1073
|
.add(
|
|
1074
|
+
// A read: plans the spec as a build would and looks up what was published for it.
|
|
1075
|
+
HttpApiEndpoint.post("inspectWorkspaceImage", "/image", {
|
|
1076
|
+
payload: inspectWorkspaceImageRequestSchema,
|
|
1077
|
+
success: inspectWorkspaceImageResponseSchema,
|
|
1078
|
+
error: [WorkspaceBadRequestError, WorkspaceNotFoundError, WorkspaceInternalServerError],
|
|
1079
|
+
}))
|
|
1080
|
+
.add(
|
|
1081
|
+
// Synchronous: the files are written over the control connection before this answers.
|
|
1082
|
+
HttpApiEndpoint.post("putWorkspaceCredentials", "/:workspaceId/credentials", {
|
|
1083
|
+
params: workspaceIdParams,
|
|
1084
|
+
payload: putWorkspaceCredentialsRequestSchema,
|
|
1085
|
+
success: putWorkspaceCredentialsResponseSchema,
|
|
1086
|
+
error: [
|
|
1087
|
+
// A malformed home, or nothing to do.
|
|
1088
|
+
WorkspaceBadRequestError,
|
|
1089
|
+
// The caller may not act for the people named (only a service key may).
|
|
1090
|
+
WorkspaceForbiddenError,
|
|
1091
|
+
// The workspace or a named account (unknown, someone else's, archived).
|
|
1092
|
+
WorkspaceNotFoundError,
|
|
1093
|
+
// See `workspaceCredentialsConflictCodes`.
|
|
1094
|
+
WorkspaceConflictError,
|
|
1095
|
+
// The executor did not confirm the write.
|
|
1096
|
+
WorkspaceBadGatewayError,
|
|
1097
|
+
// SEALANT_CREDENTIALS_KEY is not configured, or Core cannot reach the executor.
|
|
1098
|
+
WorkspaceServiceUnavailableError,
|
|
1099
|
+
WorkspaceInternalServerError,
|
|
1100
|
+
],
|
|
1101
|
+
}))
|
|
1102
|
+
.add(
|
|
1103
|
+
// Synchronous: the files are removed before this answers. Idempotent.
|
|
1104
|
+
HttpApiEndpoint.delete("releaseWorkspaceCredentials", "/:workspaceId/credentials", {
|
|
1105
|
+
params: workspaceIdParams,
|
|
1106
|
+
query: releaseWorkspaceCredentialsQuerySchema,
|
|
1107
|
+
success: releaseWorkspaceCredentialsResponseSchema,
|
|
1108
|
+
error: [
|
|
1109
|
+
// A malformed home, or nothing to do.
|
|
1110
|
+
WorkspaceBadRequestError,
|
|
1111
|
+
// The caller may not act for the people named (only a service key may).
|
|
1112
|
+
WorkspaceForbiddenError,
|
|
1113
|
+
// The workspace or a named account (unknown, someone else's, archived).
|
|
1114
|
+
WorkspaceNotFoundError,
|
|
1115
|
+
// See `workspaceCredentialsConflictCodes`.
|
|
1116
|
+
WorkspaceConflictError,
|
|
1117
|
+
// The executor did not confirm the write.
|
|
1118
|
+
WorkspaceBadGatewayError,
|
|
1119
|
+
// SEALANT_CREDENTIALS_KEY is not configured, or Core cannot reach the executor.
|
|
1120
|
+
WorkspaceServiceUnavailableError,
|
|
1121
|
+
WorkspaceInternalServerError,
|
|
1122
|
+
],
|
|
1123
|
+
}))
|
|
1124
|
+
.add(HttpApiEndpoint.get("listWorkspaceCredentials", "/:workspaceId/credentials", {
|
|
1125
|
+
params: workspaceIdParams,
|
|
1126
|
+
query: listWorkspaceCredentialsQuerySchema,
|
|
1127
|
+
success: listWorkspaceCredentialsResponseSchema,
|
|
1128
|
+
error: [
|
|
1129
|
+
WorkspaceForbiddenError,
|
|
1130
|
+
WorkspaceNotFoundError,
|
|
1131
|
+
WorkspaceConflictError,
|
|
1132
|
+
WorkspaceInternalServerError,
|
|
1133
|
+
],
|
|
1134
|
+
}))
|
|
1135
|
+
.add(
|
|
932
1136
|
// Synchronous: sets (or clears) the workspace TTL column; the worker reaper enforces it.
|
|
933
1137
|
HttpApiEndpoint.post("expireWorkspace", "/:workspaceId/expire", {
|
|
934
1138
|
params: workspaceIdParams,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/api-contracts-next",
|
|
3
|
-
"version": "0.39.0-next.
|
|
3
|
+
"version": "0.39.0-next.692",
|
|
4
4
|
"description": "Contract-first HTTP API definitions for Sealant services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"effect": ">=4.0.0-beta.85 <5"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "856412ff6b8e8fcae303941ede49f4492c498d4a",
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
}
|