replicas-cli 0.3.650 → 0.3.652
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/index.cjs +64 -5
- 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.
|
|
43373
|
+
CLI_VERSION = "0.3.652";
|
|
43331
43374
|
}
|
|
43332
43375
|
});
|
|
43333
43376
|
|
|
@@ -43862,7 +43905,7 @@ var init_web_auth = __esm({
|
|
|
43862
43905
|
});
|
|
43863
43906
|
|
|
43864
43907
|
// ../shared/src/routes/artifacts.ts
|
|
43865
|
-
var ARTIFACT_KINDS, ARTIFACT_MUTABILITIES, ARTIFACT_PERMISSIONS, ARTIFACT_LIST_OWNERS, ARTIFACT_DISPLAY_NAME_MAX_LENGTH, artifactMetadataSchema, listArtifactsQuerySchema, updateArtifactRequestSchema, setArtifactShareRequestSchema;
|
|
43908
|
+
var ARTIFACT_KINDS, ARTIFACT_MUTABILITIES, ARTIFACT_PERMISSIONS, ARTIFACT_LIST_OWNERS, ARTIFACT_DISPLAY_NAME_MAX_LENGTH, artifactMetadataSchema, listArtifactsQuerySchema, listArtifactWorkspacesQuerySchema, updateArtifactRequestSchema, setArtifactShareRequestSchema;
|
|
43866
43909
|
var init_artifacts2 = __esm({
|
|
43867
43910
|
"../shared/src/routes/artifacts.ts"() {
|
|
43868
43911
|
"use strict";
|
|
@@ -43882,7 +43925,15 @@ var init_artifacts2 = __esm({
|
|
|
43882
43925
|
owner: external_exports.array(external_exports.enum(ARTIFACT_LIST_OWNERS)),
|
|
43883
43926
|
kind: external_exports.array(external_exports.enum(ARTIFACT_KINDS)),
|
|
43884
43927
|
workspace_id: external_exports.string().uuid().optional(),
|
|
43885
|
-
q: external_exports.string().trim().max(ARTIFACT_DISPLAY_NAME_MAX_LENGTH).optional()
|
|
43928
|
+
q: external_exports.string().trim().max(ARTIFACT_DISPLAY_NAME_MAX_LENGTH).optional(),
|
|
43929
|
+
scope: external_exports.literal("listed").optional()
|
|
43930
|
+
});
|
|
43931
|
+
listArtifactWorkspacesQuerySchema = external_exports.object({
|
|
43932
|
+
workspace_id: external_exports.string().uuid().optional(),
|
|
43933
|
+
q: external_exports.string().trim().max(ARTIFACT_DISPLAY_NAME_MAX_LENGTH).optional(),
|
|
43934
|
+
owner: external_exports.array(external_exports.union([external_exports.literal("organization"), external_exports.string().uuid()])),
|
|
43935
|
+
from: external_exports.string().datetime().optional(),
|
|
43936
|
+
to: external_exports.string().datetime().optional()
|
|
43886
43937
|
});
|
|
43887
43938
|
updateArtifactRequestSchema = external_exports.object({
|
|
43888
43939
|
display_name: external_exports.string().trim().min(1).max(ARTIFACT_DISPLAY_NAME_MAX_LENGTH)
|
|
@@ -54407,6 +54458,7 @@ var init_variable_requests = __esm({
|
|
|
54407
54458
|
"use strict";
|
|
54408
54459
|
init_zod();
|
|
54409
54460
|
init_environment_setups();
|
|
54461
|
+
init_runtime_env();
|
|
54410
54462
|
VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
54411
54463
|
VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
54412
54464
|
requestedVariableSchema = external_exports.object({
|
|
@@ -54416,7 +54468,12 @@ var init_variable_requests = __esm({
|
|
|
54416
54468
|
});
|
|
54417
54469
|
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
54470
|
createVariableRequestSchema = external_exports.object({
|
|
54419
|
-
variables: requestedVariablesSchema,
|
|
54471
|
+
variables: requestedVariablesSchema.superRefine((variables, ctx) => {
|
|
54472
|
+
const reserved = variables.find((variable) => RESERVED_REPLICAS_ENV_KEYS.has(variable.key))?.key;
|
|
54473
|
+
if (reserved) {
|
|
54474
|
+
ctx.addIssue({ code: "custom", message: `${reserved} is reserved by Replicas and cannot be requested` });
|
|
54475
|
+
}
|
|
54476
|
+
}),
|
|
54420
54477
|
reason: external_exports.string().trim().max(500).nullish().transform((value) => value || null),
|
|
54421
54478
|
wait: external_exports.boolean().default(true)
|
|
54422
54479
|
});
|
|
@@ -57572,6 +57629,8 @@ async function envVarsRequestCommand(requiredKeys, options) {
|
|
|
57572
57629
|
if (keys.length === 0) throw new Error("Name at least one variable to request");
|
|
57573
57630
|
const invalid = keys.find((key2) => !VARIABLE_KEY_RE.test(key2));
|
|
57574
57631
|
if (invalid) throw new Error(`${invalid} is not a valid environment variable name`);
|
|
57632
|
+
const reserved = keys.find((key2) => RESERVED_REPLICAS_ENV_KEYS.has(key2));
|
|
57633
|
+
if (reserved) throw new Error(`${reserved} is reserved by Replicas and cannot be requested. Use a different variable name.`);
|
|
57575
57634
|
const timeoutMs = parseRequestTimeout(options.timeout);
|
|
57576
57635
|
const readRuntimeEnv = () => import_fs5.default.existsSync(RUNTIME_ENV_FILE) ? import_fs5.default.readFileSync(RUNTIME_ENV_FILE, "utf8") : "";
|
|
57577
57636
|
const local = parsePosixEnvFile(readRuntimeEnv());
|
|
@@ -57607,7 +57666,7 @@ async function envVarsRequestCommand(requiredKeys, options) {
|
|
|
57607
57666
|
let exported = [];
|
|
57608
57667
|
if (request2.status === "provided") {
|
|
57609
57668
|
const loaded = await orgAuthenticatedFetch(`/v1/variable-requests/${request2.id}/load`, { method: "POST" });
|
|
57610
|
-
const variables = loaded.variables.filter((variable) => !variable.key
|
|
57669
|
+
const variables = loaded.variables.filter((variable) => !RESERVED_REPLICAS_ENV_KEYS.has(variable.key));
|
|
57611
57670
|
const existing = parsePosixEnv(readRuntimeEnv());
|
|
57612
57671
|
const env = { ...existing.values, ...Object.fromEntries(variables.map((variable) => [variable.key, variable.value])) };
|
|
57613
57672
|
import_fs5.default.mkdirSync(import_path6.default.dirname(RUNTIME_ENV_FILE), { recursive: true });
|