remote-codex 0.11.3 → 0.11.5
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/README.md +4 -0
- package/apps/relay-server/dist/index.js +51 -2
- package/apps/supervisor-api/dist/chunk-ZWZQVPDT.js +27893 -0
- package/apps/supervisor-api/dist/index.js +4 -25727
- package/apps/supervisor-api/dist/worker-index.d.ts +2 -0
- package/apps/supervisor-api/dist/worker-index.js +197 -0
- package/apps/supervisor-web/dist/assets/index-CbdWtyx0.js +5 -0
- package/apps/supervisor-web/dist/assets/index-Di1JBevU.css +1 -0
- package/apps/supervisor-web/dist/assets/thread-ui-ICfwCbte.js +3604 -0
- package/apps/supervisor-web/dist/assets/ui-vendor-D1uxdi-d.js +430 -0
- package/apps/supervisor-web/dist/index.html +6 -7
- package/bin/remote-codex.mjs +534 -19
- package/package.json +41 -2
- package/packages/agent-runtime/src/types.ts +2 -1
- package/packages/codex/src/appServerManager.ts +1 -0
- package/packages/codex/src/historyItems.test.ts +45 -0
- package/packages/codex/src/historyItems.ts +22 -0
- package/packages/codex/src/runtimeAdapter.ts +6 -0
- package/packages/codex/src/types.ts +2 -1
- package/packages/db/migrations/0018_control_plane.sql +129 -0
- package/packages/db/migrations/0019_control_plane_projects.sql +19 -0
- package/packages/db/migrations/0020_control_workspace_status.sql +1 -0
- package/packages/db/migrations/0021_control_sandbox_lifecycle_fields.sql +3 -0
- package/packages/db/migrations/0022_control_sandbox_resource_profile.sql +1 -0
- package/packages/db/migrations/0023_control_usage_import_state.sql +18 -0
- package/packages/db/migrations/0024_control_auth.sql +23 -0
- package/packages/db/migrations/0025_control_harness_credentials.sql +29 -0
- package/packages/db/migrations/0026_control_harness_usage_events.sql +27 -0
- package/packages/db/src/schema.ts +305 -1
- package/packages/shared/src/index.ts +32 -0
- package/packages/shared/src/tokens.ts +137 -0
- package/apps/supervisor-web/dist/assets/index-CBIze1VS.css +0 -1
- package/apps/supervisor-web/dist/assets/index-YpGAPjED.js +0 -4
- package/apps/supervisor-web/dist/assets/thread-ui-BEieA99i.css +0 -1
- package/apps/supervisor-web/dist/assets/thread-ui-CF80LEEN.js +0 -3613
- package/apps/supervisor-web/dist/assets/ui-vendor-CW6egZBG.js +0 -430
package/README.md
CHANGED
|
@@ -607,6 +607,22 @@ function buildRelayServer(config2) {
|
|
|
607
607
|
targetPath
|
|
608
608
|
});
|
|
609
609
|
});
|
|
610
|
+
app2.get("/relay/devices/:deviceId/healthz", async (request, reply) => {
|
|
611
|
+
const user = requireRelayUser(request, reply, store);
|
|
612
|
+
if (!user) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const { deviceId } = z.object({ deviceId: z.string().uuid() }).parse(request.params);
|
|
616
|
+
await forwardRelayHttp({
|
|
617
|
+
request,
|
|
618
|
+
reply,
|
|
619
|
+
state,
|
|
620
|
+
store,
|
|
621
|
+
user,
|
|
622
|
+
deviceId,
|
|
623
|
+
targetPath: "/healthz"
|
|
624
|
+
});
|
|
625
|
+
});
|
|
610
626
|
app2.all("/relay/api/*", async (request, reply) => {
|
|
611
627
|
const user = requireRelayUser(request, reply, store);
|
|
612
628
|
if (!user) {
|
|
@@ -1074,7 +1090,8 @@ function relayRequestBody(body) {
|
|
|
1074
1090
|
function relayRequestHeaders(headers) {
|
|
1075
1091
|
const output = {};
|
|
1076
1092
|
for (const [name, value] of Object.entries(headers)) {
|
|
1077
|
-
|
|
1093
|
+
const lower = name.toLowerCase();
|
|
1094
|
+
if (lower === "authorization" || lower === "content-length" || lower === "transfer-encoding") {
|
|
1078
1095
|
continue;
|
|
1079
1096
|
}
|
|
1080
1097
|
if (Array.isArray(value)) {
|
|
@@ -1159,8 +1176,36 @@ var envSchema = z2.object({
|
|
|
1159
1176
|
REMOTE_CODEX_RELAY_REGISTRATION_ENABLED: z2.string().optional(),
|
|
1160
1177
|
REMOTE_CODEX_RELAY_WEB_DIST_DIR: z2.string().min(1).optional()
|
|
1161
1178
|
});
|
|
1179
|
+
function optionalNonEmpty(value) {
|
|
1180
|
+
const normalized = value?.trim();
|
|
1181
|
+
return normalized ? normalized : void 0;
|
|
1182
|
+
}
|
|
1183
|
+
function normalizeOptionalEnv(env) {
|
|
1184
|
+
return {
|
|
1185
|
+
...env,
|
|
1186
|
+
HOST: optionalNonEmpty(env.HOST),
|
|
1187
|
+
PORT: optionalNonEmpty(env.PORT),
|
|
1188
|
+
REMOTE_CODEX_RELAY_SUPERVISOR_TOKEN: optionalNonEmpty(
|
|
1189
|
+
env.REMOTE_CODEX_RELAY_SUPERVISOR_TOKEN
|
|
1190
|
+
),
|
|
1191
|
+
REMOTE_CODEX_RELAY_CLIENT_TOKEN: optionalNonEmpty(
|
|
1192
|
+
env.REMOTE_CODEX_RELAY_CLIENT_TOKEN
|
|
1193
|
+
),
|
|
1194
|
+
REMOTE_CODEX_ADMIN_EMAIL: optionalNonEmpty(env.REMOTE_CODEX_ADMIN_EMAIL),
|
|
1195
|
+
REMOTE_CODEX_RELAY_DATA_DIR: optionalNonEmpty(env.REMOTE_CODEX_RELAY_DATA_DIR),
|
|
1196
|
+
REMOTE_CODEX_RELAY_SESSION_SECRET: optionalNonEmpty(
|
|
1197
|
+
env.REMOTE_CODEX_RELAY_SESSION_SECRET
|
|
1198
|
+
),
|
|
1199
|
+
REMOTE_CODEX_RELAY_REGISTRATION_ENABLED: optionalNonEmpty(
|
|
1200
|
+
env.REMOTE_CODEX_RELAY_REGISTRATION_ENABLED
|
|
1201
|
+
),
|
|
1202
|
+
REMOTE_CODEX_RELAY_WEB_DIST_DIR: optionalNonEmpty(
|
|
1203
|
+
env.REMOTE_CODEX_RELAY_WEB_DIST_DIR
|
|
1204
|
+
)
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1162
1207
|
function loadRelayServerConfig(env = process.env) {
|
|
1163
|
-
const parsed = envSchema.parse(env);
|
|
1208
|
+
const parsed = envSchema.parse(normalizeOptionalEnv(env));
|
|
1164
1209
|
return {
|
|
1165
1210
|
host: parsed.HOST ?? "0.0.0.0",
|
|
1166
1211
|
port: parsed.PORT ?? 8788,
|
|
@@ -1216,6 +1261,10 @@ var app = buildRelayServer(config);
|
|
|
1216
1261
|
app.listen({ host: config.host, port: config.port }).then(() => {
|
|
1217
1262
|
app.log.info(`Remote Codex relay listening on http://${config.host}:${config.port}`);
|
|
1218
1263
|
}).catch((error) => {
|
|
1264
|
+
console.error(
|
|
1265
|
+
`Failed to start Remote Codex relay on http://${config.host}:${config.port}.`
|
|
1266
|
+
);
|
|
1267
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
1219
1268
|
app.log.error(error);
|
|
1220
1269
|
process.exit(1);
|
|
1221
1270
|
});
|