replicas-cli 0.2.326 → 0.2.327

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 +18 -12
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9308,6 +9308,7 @@ replicas automation create ... --disabled
9308
9308
 
9309
9309
  # Workspace lifecycle
9310
9310
  replicas automation create ... --lifecycle delete_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.327";
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", "delete_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
@@ -13849,8 +13854,8 @@ async function promptForTriggers(repositories) {
13849
13854
  async function automationCreateCommand(name, options) {
13850
13855
  ensureOrgApiAuthenticated();
13851
13856
  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"));
13857
+ if (options.autoStopMinutes && !lifecyclePolicySupportsAutoStop(lifecyclePolicy ?? "default")) {
13858
+ console.log(chalk18.red("--auto-stop-minutes requires --lifecycle default or delete_after_inactivity"));
13854
13859
  process.exit(1);
13855
13860
  }
13856
13861
  if (options.autoStopMinutes) {
@@ -14013,10 +14018,6 @@ Created automation: ${automation2.name}`));
14013
14018
  async function automationEditCommand(id, options) {
14014
14019
  ensureOrgApiAuthenticated();
14015
14020
  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
14021
  if (options.autoStopMinutes) {
14021
14022
  const minutes = parseInt(options.autoStopMinutes, 10);
14022
14023
  if (isNaN(minutes) || minutes < 3 || minutes > 1440) {
@@ -14031,6 +14032,11 @@ async function automationEditCommand(id, options) {
14031
14032
  };
14032
14033
  try {
14033
14034
  const existing = await orgAuthenticatedFetch(`/v1/automations/${id}`);
14035
+ const autoStopLifecyclePolicy = lifecyclePolicy ?? existing.automation.workspace_lifecycle_policy ?? "default";
14036
+ if (options.autoStopMinutes && !lifecyclePolicySupportsAutoStop(autoStopLifecyclePolicy)) {
14037
+ console.log(chalk18.red("--auto-stop-minutes requires --lifecycle default or delete_after_inactivity"));
14038
+ process.exit(1);
14039
+ }
14034
14040
  const agentSelection = applyAgentSelection(parsedAgent, {
14035
14041
  agentProvider: existing.automation.agent_provider,
14036
14042
  model: existing.automation.model
@@ -14146,7 +14152,7 @@ async function automationEditCommand(id, options) {
14146
14152
  }
14147
14153
  if (lifecyclePolicy) {
14148
14154
  body.workspace_lifecycle_policy = lifecyclePolicy;
14149
- if (lifecyclePolicy !== "delete_after_inactivity") {
14155
+ if (!lifecyclePolicySupportsAutoStop(lifecyclePolicy)) {
14150
14156
  body.workspace_auto_stop_minutes = null;
14151
14157
  }
14152
14158
  }
@@ -19398,7 +19404,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
19398
19404
  process.exit(1);
19399
19405
  }
19400
19406
  });
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) => {
19407
+ 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, 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
19408
  try {
19403
19409
  await automationCreateCommand(name, {
19404
19410
  ...options,
@@ -19413,7 +19419,7 @@ automation.command("create [name]").description("Create a new automation").optio
19413
19419
  process.exit(1);
19414
19420
  }
19415
19421
  });
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) => {
19422
+ 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, 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
19423
  try {
19418
19424
  await automationEditCommand(id, options);
19419
19425
  } 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.327",
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": {