replicas-cli 0.3.637 → 0.3.639

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 +34 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -24027,7 +24027,7 @@ function workspaceConfigWithCapabilities(config3, capabilities = {}) {
24027
24027
  function workspaceConfigWithPrFollowups(config3, prFollowups = config3?.capabilities?.pr_followups === true) {
24028
24028
  return workspaceConfigWithCapabilities(config3, { pr_followups: prFollowups });
24029
24029
  }
24030
- var WORKSPACE_STATUSES, SUPPORT_EMAIL, WORKSPACE_SANDBOX_LOST_MESSAGE, STALE_PREPARING_MS, WORKSPACE_PAUSED_COPY, securityRunConfigSchema, WORKSPACE_KINDS, MANAGER_KINDS, CREATABLE_WORKSPACE_KINDS, createWorkspaceCanvasUploadRequestSchema, completeWorkspaceCanvasUploadRequestSchema, WORKSPACE_SIDEBAR_VIEWS, WORKSPACE_STATUS_FILTERS, DEFAULT_STATUS_FILTERS, DEFAULT_WORKSPACE_FILTERS, ONE_DAY_MS, describeWorkspaceAccess, workspaceExecRequestSchema, terminalRtcCandidateSchema, terminalSocketServerMessageSchema;
24030
+ var WORKSPACE_STATUSES, SUPPORT_EMAIL, WORKSPACE_SANDBOX_LOST_MESSAGE, STALE_PREPARING_MS, WORKSPACE_PAUSED_COPY, securityRunConfigSchema, WORKSPACE_KINDS, MANAGER_KINDS, CREATABLE_WORKSPACE_KINDS, WORKSPACE_ENVIRONMENT_CHANGE_KINDS, WORKSPACE_ENVIRONMENT_CHANGE_LABELS, workspaceEnvironmentChangeSchema, createWorkspaceCanvasUploadRequestSchema, completeWorkspaceCanvasUploadRequestSchema, WORKSPACE_SIDEBAR_VIEWS, WORKSPACE_STATUS_FILTERS, DEFAULT_STATUS_FILTERS, DEFAULT_WORKSPACE_FILTERS, ONE_DAY_MS, describeWorkspaceAccess, workspaceExecRequestSchema, terminalRtcCandidateSchema, terminalSocketServerMessageSchema;
24031
24031
  var init_workspaces = __esm({
24032
24032
  "../shared/src/routes/workspaces.ts"() {
24033
24033
  "use strict";
@@ -24062,6 +24062,22 @@ var init_workspaces = __esm({
24062
24062
  WORKSPACE_KINDS = ["standard", "manager", "mothership", "scout"];
24063
24063
  MANAGER_KINDS = ["manager", "mothership"];
24064
24064
  CREATABLE_WORKSPACE_KINDS = ["standard", ...MANAGER_KINDS];
24065
+ WORKSPACE_ENVIRONMENT_CHANGE_KINDS = ["variable", "file", "mcp", "skill", "skills_registry", "repository", "system_prompt", "start_hook"];
24066
+ WORKSPACE_ENVIRONMENT_CHANGE_LABELS = {
24067
+ variable: "Variable",
24068
+ file: "File",
24069
+ mcp: "MCP server",
24070
+ skill: "Skill",
24071
+ skills_registry: "Skills registry",
24072
+ repository: "Repository",
24073
+ system_prompt: "System prompt",
24074
+ start_hook: "Start hook"
24075
+ };
24076
+ workspaceEnvironmentChangeSchema = external_exports.object({
24077
+ kind: external_exports.enum(WORKSPACE_ENVIRONMENT_CHANGE_KINDS),
24078
+ name: external_exports.string(),
24079
+ change: external_exports.enum(["added", "removed", "updated"])
24080
+ });
24065
24081
  createWorkspaceCanvasUploadRequestSchema = external_exports.object({
24066
24082
  sizeBytes: external_exports.number().int().positive(),
24067
24083
  filename: external_exports.string().min(1)
@@ -28288,6 +28304,8 @@ The user gets a form above the chat composer in Replicas, where they can paste a
28288
28304
 
28289
28305
  In workspaces started from Slack, Linear, or an automation, nobody may be watching Replicas, so the command returns right away with a link to the form; share it where you are talking with the user. If the values don't arrive in time, the request stays open. Either way you get a message when the user saves; run the same command again then. If a saved value is wrong, for example the service rejects it, add \`--replace\` to ask for a new one.
28290
28306
 
28307
+ A value that starts with \`replicas_ph_\` is a proxied secret. Use it as the real key: Replicas swaps in the real value on HTTPS requests to the hosts the user bound it to, and it works nowhere else, including inside Docker containers.
28308
+
28291
28309
  ### Environment files
28292
28310
 
28293
28311
  Files materialize on the workspace filesystem when a workspace starts, at the destination path you specify. Use this for things like \`.env\` files at the repo root, dotfiles in \`~\`, prompt files for agents, etc.
@@ -43147,7 +43165,7 @@ var CLI_VERSION;
43147
43165
  var init_cli_version = __esm({
43148
43166
  "../shared/src/cli-version.ts"() {
43149
43167
  "use strict";
43150
- CLI_VERSION = "0.3.637";
43168
+ CLI_VERSION = "0.3.639";
43151
43169
  }
43152
43170
  });
43153
43171
 
@@ -57296,6 +57314,7 @@ function printVariable(v2) {
57296
57314
  console.log(import_chalk21.default.white(` ${v2.key}`));
57297
57315
  console.log(import_chalk21.default.gray(` ID: ${v2.id}`));
57298
57316
  console.log(import_chalk21.default.gray(` Value: ${v2.value}`));
57317
+ if (v2.proxy_hosts.length > 0) console.log(import_chalk21.default.gray(` Proxied to: ${v2.proxy_hosts.join(", ")}`));
57299
57318
  console.log(import_chalk21.default.gray(` Updated: ${formatDate(v2.updated_at)}`));
57300
57319
  console.log();
57301
57320
  }
@@ -57320,7 +57339,7 @@ Variables (${environment_variables.length}):
57320
57339
  for (const v2 of environment_variables) printVariable(v2);
57321
57340
  });
57322
57341
  }
57323
- async function envVarsSetCommand(envIdOrName, key2, value) {
57342
+ async function envVarsSetCommand(envIdOrName, key2, value, options) {
57324
57343
  ensureOrgApiAuthenticated();
57325
57344
  const id = await resolveEnvironmentId(envIdOrName);
57326
57345
  const existing = await orgAuthenticatedFetch(
@@ -57328,7 +57347,7 @@ async function envVarsSetCommand(envIdOrName, key2, value) {
57328
57347
  );
57329
57348
  const match = existing.environment_variables.find((v2) => v2.key === key2);
57330
57349
  if (match) {
57331
- const body3 = { value };
57350
+ const body3 = { value, proxy_hosts: options.proxyHost };
57332
57351
  const response2 = await orgAuthenticatedFetch(
57333
57352
  `/v1/environments/${id}/variables/${match.id}`,
57334
57353
  { method: "PATCH", body: body3 }
@@ -57341,7 +57360,8 @@ Updated variable ${environment_variable.key}.
57341
57360
  const body2 = {
57342
57361
  environment_id: id,
57343
57362
  key: key2,
57344
- value
57363
+ value,
57364
+ proxy_hosts: options.proxyHost
57345
57365
  };
57346
57366
  const response = await orgAuthenticatedFetch(
57347
57367
  `/v1/environments/${id}/variables`,
@@ -58227,6 +58247,13 @@ async function workspaceWakeCommand(id, options) {
58227
58247
  await orgAuthenticatedFetch(`/v1/replica/${id}/wake${options.restore ? "?restore=true" : ""}`, { method: "POST" });
58228
58248
  outputSuccess(`Waking workspace ${id}. Check progress with: replicas status ${id}`);
58229
58249
  }
58250
+ async function workspaceRefreshEnvironmentCommand(id) {
58251
+ const result = await orgAuthenticatedFetch(`/v1/replica/${id}/environment/refresh`, { method: "POST" });
58252
+ output2(result, ({ status, changes }) => {
58253
+ console.log(status === "waking" ? `Waking workspace ${id} with its latest environment.` : `Workspace ${id} is up to date with its environment.`);
58254
+ for (const { kind, name, change: change2 } of changes) console.log(import_chalk23.default.gray(` ${change2} ${WORKSPACE_ENVIRONMENT_CHANGE_LABELS[kind]} ${name}`));
58255
+ });
58256
+ }
58230
58257
  function workspaceLifecycleCommand(action) {
58231
58258
  return async (id) => {
58232
58259
  await orgAuthenticatedFetch(`/v1/replica/${id}/${action}`, { method: "POST" });
@@ -62137,6 +62164,7 @@ var init_src2 = __esm({
62137
62164
  program.command("read <id>").description("Read conversation history of a replica").option("-l, --limit <limit>", "Maximum number of events to return, from the end").option("--before <cursor>", "Read the page before this cursor (see Has More output)").option("-b, --before-event <index>", "Read the page before this event index (older engines)").option("-c, --chat <chatId>", "Chat to read (defaults to the main chat)").action(run(replicaReadCommand));
62138
62165
  program.command("rename <id> <name>").description("Rename a replica (quote names with spaces)").action(run(workspaceRenameCommand));
62139
62166
  program.command("wake <id>").description("Wake a sleeping or archived replica").option("-r, --restore", "Restore an archived replica").action(run(workspaceWakeCommand));
62167
+ program.command("refresh-environment <id>").description("Apply the latest version of a replica's environment: variables, files, MCP servers, skills, repositories, system prompt and start hook").action(run(workspaceRefreshEnvironmentCommand));
62140
62168
  program.command("sleep <id>").description("Put a replica to sleep").action(run(workspaceLifecycleCommand("sleep")));
62141
62169
  program.command("archive <id>").description("Archive a replica").action(run(workspaceLifecycleCommand("archive")));
62142
62170
  program.command("wait <id>").description("Wait until a replica finishes starting and its agents finish their turns").option("-c, --chat <chatId>", "Wait for only this chat").option("-t, --timeout <seconds>", "Give up after this many seconds (default 600)").action(run(workspaceWaitCommand));
@@ -62248,7 +62276,7 @@ var init_src2 = __esm({
62248
62276
  envConfig.command("disconnect <env>").description("Disconnect Git configuration and preserve current settings").option("-y, --yes", "Disconnect without a confirmation prompt").action(run(environmentConfigDisconnectCommand));
62249
62277
  envVars = environment.command("vars").description("Manage environment variables");
62250
62278
  envVars.command("list <env>").description("List variables in an environment (values masked by default)").option("--reveal", "Show full variable values instead of masking them").action(run(envVarsListCommand));
62251
- envVars.command("set <env> <key> <value>").description("Create or update a variable").action(run(envVarsSetCommand));
62279
+ envVars.command("set <env> <key> <value>").description("Create or update a variable").option("--proxy-host <hosts...>", "Keep the value out of workspaces: they get a placeholder, swapped for the value only on HTTPS requests to these hosts").action(run(envVarsSetCommand));
62252
62280
  envVars.command("delete <env> <key-or-id>").description("Delete a variable by key or ID").option("-f, --force", "Skip confirmation prompt").action(run(envVarsDeleteCommand));
62253
62281
  if (isAgentMode()) {
62254
62282
  envVars.command("request [keys...]").description("Ask the user for variables and load them into this workspace").option("-r, --reason <text>", "One sentence on what the values are for, shown to the user").option("--optional <keys>", "Comma-separated keys to ask for that the user may leave empty (repeatable)", (value, previous) => [...previous, value], []).option("--replace", "Ask for new values even if the keys are already set, for example when a saved key is rejected").option("-t, --timeout <duration>", "How long to wait for the user, for example 90s or 10m (default 10m)").option("--no-wait", "Return right after asking instead of waiting for the user").action(run(envVarsRequestCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.637",
3
+ "version": "0.3.639",
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": {