replicas-cli 0.2.326 → 0.2.328

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.mjs +20 -15
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9307,7 +9307,8 @@ replicas automation create "Review my MRs" \\
9307
9307
  replicas automation create ... --disabled
9308
9308
 
9309
9309
  # Workspace lifecycle
9310
- replicas automation create ... --lifecycle delete_when_done
9310
+ replicas automation create ... --lifecycle archive_when_done
9311
+ replicas automation create ... --lifecycle sleep_when_done
9311
9312
  replicas automation create ... --lifecycle delete_after_inactivity --auto-stop-minutes 30
9312
9313
  \`\`\`
9313
9314
 
@@ -9536,7 +9537,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
9536
9537
  var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
9537
9538
 
9538
9539
  // ../shared/src/cli-version.ts
9539
- var CLI_VERSION = "0.2.326";
9540
+ var CLI_VERSION = "0.2.328";
9540
9541
 
9541
9542
  // ../shared/src/engine/environment.ts
9542
9543
  var DESKTOP_NOVNC_PORT = 6080;
@@ -9561,7 +9562,7 @@ var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"
9561
9562
  function isWorkspaceSuspendedStatus(status) {
9562
9563
  return status === "sleeping" || status === "archived";
9563
9564
  }
9564
- var VALID_LIFECYCLE_POLICIES = ["default", "delete_when_done", "delete_after_inactivity"];
9565
+ var VALID_LIFECYCLE_POLICIES = ["default", "archive_when_done", "sleep_when_done", "delete_after_inactivity"];
9565
9566
  function workspaceConfigWithCapabilities(config2, capabilities = {}) {
9566
9567
  const mergedCapabilities = {
9567
9568
  ...config2?.capabilities,
@@ -9616,6 +9617,9 @@ var AUDIT_LOG_ACTIONS = Object.values(AUDIT_LOG_ACTION);
9616
9617
 
9617
9618
  // ../shared/src/automations/types.ts
9618
9619
  var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
9620
+ function lifecyclePolicySupportsAutoStop(policy) {
9621
+ return policy === "default" || policy === "delete_after_inactivity";
9622
+ }
9619
9623
 
9620
9624
  // ../shared/src/automations/agent-validation.ts
9621
9625
  function validateAgentSelection(body, existing) {
@@ -11126,13 +11130,14 @@ function parseDisplayMessages(events, agentType, codexAspTranscript, options = {
11126
11130
  function isCodexInitializationPrompt(message) {
11127
11131
  return message.type === "user" && removeReplicasInstructions(message.content).trim() === "Hello";
11128
11132
  }
11129
- function createUserMessage(content) {
11133
+ function createUserMessage(content, images) {
11130
11134
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
11131
11135
  return {
11132
11136
  message: {
11133
11137
  id: `user-${Date.now()}`,
11134
11138
  type: "user",
11135
11139
  content,
11140
+ images,
11136
11141
  timestamp
11137
11142
  },
11138
11143
  timestamp
@@ -13653,8 +13658,7 @@ function printAutomation(automation2) {
13653
13658
  console.log(chalk18.gray(` Next Run: ${formatDate2(automation2.cron_next_fire_at)}`));
13654
13659
  }
13655
13660
  if (automation2.workspace_lifecycle_policy && automation2.workspace_lifecycle_policy !== "default") {
13656
- const lifecycle = automation2.workspace_lifecycle_policy === "delete_after_inactivity" ? `delete_after_inactivity (${automation2.workspace_auto_stop_minutes ?? 30}m)` : automation2.workspace_lifecycle_policy;
13657
- console.log(chalk18.gray(` Lifecycle: ${lifecycle}`));
13661
+ console.log(chalk18.gray(` Lifecycle: ${automation2.workspace_lifecycle_policy}`));
13658
13662
  }
13659
13663
  if (automation2.agent_provider || automation2.model || automation2.thinking_level) {
13660
13664
  console.log(chalk18.gray(` Agent: ${formatAgentSummary(automation2)}`));
@@ -13849,8 +13853,8 @@ async function promptForTriggers(repositories) {
13849
13853
  async function automationCreateCommand(name, options) {
13850
13854
  ensureOrgApiAuthenticated();
13851
13855
  const lifecyclePolicy = parseWorkspaceLifecyclePolicyOption(options.lifecycle);
13852
- if (options.autoStopMinutes && lifecyclePolicy !== "delete_after_inactivity") {
13853
- console.log(chalk18.red("--auto-stop-minutes requires --lifecycle delete_after_inactivity"));
13856
+ if (options.autoStopMinutes && !lifecyclePolicySupportsAutoStop(lifecyclePolicy ?? "default")) {
13857
+ console.log(chalk18.red("--auto-stop-minutes requires --lifecycle default or delete_after_inactivity"));
13854
13858
  process.exit(1);
13855
13859
  }
13856
13860
  if (options.autoStopMinutes) {
@@ -14013,10 +14017,6 @@ Created automation: ${automation2.name}`));
14013
14017
  async function automationEditCommand(id, options) {
14014
14018
  ensureOrgApiAuthenticated();
14015
14019
  const lifecyclePolicy = parseWorkspaceLifecyclePolicyOption(options.lifecycle);
14016
- if (options.autoStopMinutes && lifecyclePolicy !== "delete_after_inactivity") {
14017
- console.log(chalk18.red("--auto-stop-minutes requires --lifecycle delete_after_inactivity"));
14018
- process.exit(1);
14019
- }
14020
14020
  if (options.autoStopMinutes) {
14021
14021
  const minutes = parseInt(options.autoStopMinutes, 10);
14022
14022
  if (isNaN(minutes) || minutes < 3 || minutes > 1440) {
@@ -14031,6 +14031,11 @@ async function automationEditCommand(id, options) {
14031
14031
  };
14032
14032
  try {
14033
14033
  const existing = await orgAuthenticatedFetch(`/v1/automations/${id}`);
14034
+ const autoStopLifecyclePolicy = lifecyclePolicy ?? existing.automation.workspace_lifecycle_policy ?? "default";
14035
+ if (options.autoStopMinutes && !lifecyclePolicySupportsAutoStop(autoStopLifecyclePolicy)) {
14036
+ console.log(chalk18.red("--auto-stop-minutes requires --lifecycle default or delete_after_inactivity"));
14037
+ process.exit(1);
14038
+ }
14034
14039
  const agentSelection = applyAgentSelection(parsedAgent, {
14035
14040
  agentProvider: existing.automation.agent_provider,
14036
14041
  model: existing.automation.model
@@ -14146,7 +14151,7 @@ async function automationEditCommand(id, options) {
14146
14151
  }
14147
14152
  if (lifecyclePolicy) {
14148
14153
  body.workspace_lifecycle_policy = lifecyclePolicy;
14149
- if (lifecyclePolicy !== "delete_after_inactivity") {
14154
+ if (!lifecyclePolicySupportsAutoStop(lifecyclePolicy)) {
14150
14155
  body.workspace_auto_stop_minutes = null;
14151
14156
  }
14152
14157
  }
@@ -19398,7 +19403,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
19398
19403
  process.exit(1);
19399
19404
  }
19400
19405
  });
19401
- automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle delete_after_inactivity)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as Codex goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--disabled", "Create in disabled state").action(async (name, options) => {
19406
+ automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default or delete_after_inactivity)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as Codex goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--disabled", "Create in disabled state").action(async (name, options) => {
19402
19407
  try {
19403
19408
  await automationCreateCommand(name, {
19404
19409
  ...options,
@@ -19413,7 +19418,7 @@ automation.command("create [name]").description("Create a new automation").optio
19413
19418
  process.exit(1);
19414
19419
  }
19415
19420
  });
19416
- automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle delete_after_inactivity)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as Codex goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
19421
+ automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, delete_after_inactivity, default").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default or delete_after_inactivity)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as Codex goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
19417
19422
  try {
19418
19423
  await automationEditCommand(id, options);
19419
19424
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.326",
3
+ "version": "0.2.328",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.mjs",
6
6
  "bin": {