replicas-cli 0.3.650 → 0.3.651

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +54 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -26336,9 +26336,52 @@ function parsePosixEnv(content) {
26336
26336
  }
26337
26337
  return { values: result, unsetKeys };
26338
26338
  }
26339
+ var REPLICAS_RUNTIME_ENV_KEYS, RETIRED_WORKSPACE_ENV_KEYS, RESERVED_REPLICAS_ENV_KEYS;
26339
26340
  var init_runtime_env = __esm({
26340
26341
  "../shared/src/runtime-env.ts"() {
26341
26342
  "use strict";
26343
+ REPLICAS_RUNTIME_ENV_KEYS = [
26344
+ "REPLICAS_ENGINE_PORT",
26345
+ "REPLICAS_ENGINE_STATE_DIR",
26346
+ "REPLICAS_ENGINE_SECRET",
26347
+ "REPLICAS_MONOLITH_URL",
26348
+ "REPLICAS_WORKSPACE_ID",
26349
+ "REPLICAS_DIR",
26350
+ "REPLICAS_CANVAS_DIR",
26351
+ "REPLICAS_RUNTIME_ENV_FILE",
26352
+ "REPLICAS_DESKTOP_STREAM_ICE_SERVERS",
26353
+ "REPLICAS_ENVIRONMENT_SETUP_RUN_ID",
26354
+ "REPLICAS_SECURITY_RUN_ID",
26355
+ "REPLICAS_SECURITY_SANDBOX_ROLE",
26356
+ "REPLICAS_SECURITY_CHECKS_VERIFY_SECRETS",
26357
+ "REPLICAS_DISABLE_AUTO_START_HOOKS",
26358
+ "REPLICAS_LINEAR_SESSION_ID",
26359
+ "REPLICAS_LINEAR_ACCESS_TOKEN",
26360
+ "REPLICAS_LINEAR_ACCESS_CONFIGURED",
26361
+ "REPLICAS_SLACK_BOT_TOKEN",
26362
+ "REPLICAS_SLACK_ACCESS_CONFIGURED",
26363
+ "REPLICAS_SLACK_CHANNEL_ID",
26364
+ "REPLICAS_SLACK_THREAD_TS",
26365
+ "REPLICAS_GPU_DISABLED",
26366
+ "REPLICAS_MACOS_ENABLED",
26367
+ "REPLICAS_SCOUT",
26368
+ "REPLICAS_CLAUDE_AUTH_METHOD",
26369
+ "REPLICAS_CODEX_AUTH_METHOD",
26370
+ "REPLICAS_MUSE_AUTH_METHOD",
26371
+ "REPLICAS_AGENT_CREDENTIALS",
26372
+ "REPLICAS_ENV_SYSTEM_PROMPT",
26373
+ "REPLICAS_ENV_START_HOOK",
26374
+ "REPLICAS_REPOSITORY_HOOKS_DISABLED",
26375
+ "REPLICAS_ENV_DEVICES",
26376
+ "REPLICAS_GUARD_NETWORK_MODE"
26377
+ ];
26378
+ RETIRED_WORKSPACE_ENV_KEYS = /* @__PURE__ */ new Set([
26379
+ "REPLICAS_PROXY_DB_URL"
26380
+ ]);
26381
+ RESERVED_REPLICAS_ENV_KEYS = /* @__PURE__ */ new Set([
26382
+ ...REPLICAS_RUNTIME_ENV_KEYS,
26383
+ ...RETIRED_WORKSPACE_ENV_KEYS
26384
+ ]);
26342
26385
  }
26343
26386
  });
26344
26387
 
@@ -43327,7 +43370,7 @@ var CLI_VERSION;
43327
43370
  var init_cli_version = __esm({
43328
43371
  "../shared/src/cli-version.ts"() {
43329
43372
  "use strict";
43330
- CLI_VERSION = "0.3.650";
43373
+ CLI_VERSION = "0.3.651";
43331
43374
  }
43332
43375
  });
43333
43376
 
@@ -54407,6 +54450,7 @@ var init_variable_requests = __esm({
54407
54450
  "use strict";
54408
54451
  init_zod();
54409
54452
  init_environment_setups();
54453
+ init_runtime_env();
54410
54454
  VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
54411
54455
  VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
54412
54456
  requestedVariableSchema = external_exports.object({
@@ -54416,7 +54460,12 @@ var init_variable_requests = __esm({
54416
54460
  });
54417
54461
  requestedVariablesSchema = external_exports.array(requestedVariableSchema).min(1, "must not be empty").max(ENVIRONMENT_SETUP_LIMITS.variables).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys");
54418
54462
  createVariableRequestSchema = external_exports.object({
54419
- variables: requestedVariablesSchema,
54463
+ variables: requestedVariablesSchema.superRefine((variables, ctx) => {
54464
+ const reserved = variables.find((variable) => RESERVED_REPLICAS_ENV_KEYS.has(variable.key))?.key;
54465
+ if (reserved) {
54466
+ ctx.addIssue({ code: "custom", message: `${reserved} is reserved by Replicas and cannot be requested` });
54467
+ }
54468
+ }),
54420
54469
  reason: external_exports.string().trim().max(500).nullish().transform((value) => value || null),
54421
54470
  wait: external_exports.boolean().default(true)
54422
54471
  });
@@ -57572,6 +57621,8 @@ async function envVarsRequestCommand(requiredKeys, options) {
57572
57621
  if (keys.length === 0) throw new Error("Name at least one variable to request");
57573
57622
  const invalid = keys.find((key2) => !VARIABLE_KEY_RE.test(key2));
57574
57623
  if (invalid) throw new Error(`${invalid} is not a valid environment variable name`);
57624
+ const reserved = keys.find((key2) => RESERVED_REPLICAS_ENV_KEYS.has(key2));
57625
+ if (reserved) throw new Error(`${reserved} is reserved by Replicas and cannot be requested. Use a different variable name.`);
57575
57626
  const timeoutMs = parseRequestTimeout(options.timeout);
57576
57627
  const readRuntimeEnv = () => import_fs5.default.existsSync(RUNTIME_ENV_FILE) ? import_fs5.default.readFileSync(RUNTIME_ENV_FILE, "utf8") : "";
57577
57628
  const local = parsePosixEnvFile(readRuntimeEnv());
@@ -57607,7 +57658,7 @@ async function envVarsRequestCommand(requiredKeys, options) {
57607
57658
  let exported = [];
57608
57659
  if (request2.status === "provided") {
57609
57660
  const loaded = await orgAuthenticatedFetch(`/v1/variable-requests/${request2.id}/load`, { method: "POST" });
57610
- const variables = loaded.variables.filter((variable) => !variable.key.startsWith("REPLICAS_"));
57661
+ const variables = loaded.variables.filter((variable) => !RESERVED_REPLICAS_ENV_KEYS.has(variable.key));
57611
57662
  const existing = parsePosixEnv(readRuntimeEnv());
57612
57663
  const env = { ...existing.values, ...Object.fromEntries(variables.map((variable) => [variable.key, variable.value])) };
57613
57664
  import_fs5.default.mkdirSync(import_path6.default.dirname(RUNTIME_ENV_FILE), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.650",
3
+ "version": "0.3.651",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {