replicas-cli 0.3.542 → 0.3.544

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 +25 -8
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -21151,7 +21151,7 @@ function isWorkspaceSizeOption(value) {
21151
21151
  function trimLogTailCommand(file2, maxBytes, keepBytes) {
21152
21152
  return `size=$(stat -c %s ${file2} 2>/dev/null || echo 0); [ "$size" -gt ${maxBytes} ] && { fallocate --collapse-range --offset 0 --length $(( (size - ${keepBytes}) / 4096 * 4096 )) ${file2} 2>/dev/null || truncate -s 0 ${file2}; }`;
21153
21153
  }
21154
- var SANDBOX_LIFECYCLE, SANDBOX_PATHS, WORKSPACE_SIZES, DEFAULT_WORKSPACE_SIZE, AUTO_WORKSPACE_SIZE, WORKSPACE_SIZE_OPTIONS, INVALID_WORKSPACE_SIZE_ERROR;
21154
+ var SANDBOX_LIFECYCLE, SANDBOX_PATHS, WORKSPACE_SIZES, AUTO_WORKSPACE_SIZE, WORKSPACE_SIZE_OPTIONS, DEFAULT_AUTOMATION_WORKSPACE_SIZE, INVALID_WORKSPACE_SIZE_ERROR;
21155
21155
  var init_sandbox = __esm({
21156
21156
  "../shared/src/sandbox.ts"() {
21157
21157
  "use strict";
@@ -21171,9 +21171,9 @@ var init_sandbox = __esm({
21171
21171
  REPLICAS_RUNTIME_ENV_FILE: "/home/user/.replicas/runtime-env.sh"
21172
21172
  };
21173
21173
  WORKSPACE_SIZES = ["small", "large", "ultra"];
21174
- DEFAULT_WORKSPACE_SIZE = "small";
21175
21174
  AUTO_WORKSPACE_SIZE = "auto";
21176
21175
  WORKSPACE_SIZE_OPTIONS = [...WORKSPACE_SIZES, AUTO_WORKSPACE_SIZE];
21176
+ DEFAULT_AUTOMATION_WORKSPACE_SIZE = AUTO_WORKSPACE_SIZE;
21177
21177
  INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
21178
21178
  }
21179
21179
  });
@@ -38329,6 +38329,7 @@ function parseReplicasEvents(events) {
38329
38329
  const latestMs = (types) => Math.max(0, ...events.filter((event) => types.includes(event.type)).map((event) => Date.parse(event.timestamp)));
38330
38330
  const streamEndedMs = latestMs(["assistant_message", "error", "status"].map((type) => `${HARNESS_EVENT_TYPE_PREFIX}${type}`));
38331
38331
  const livePartialMs = latestMs([CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE]);
38332
+ const retryMs = latestMs([HARNESS_RETRY_EVENT_TYPE]);
38332
38333
  events.forEach((event) => {
38333
38334
  const { payload, timestamp: timestamp2 } = event;
38334
38335
  const message2 = isRecord(payload.message) ? payload.message : {};
@@ -38406,9 +38407,23 @@ function parseReplicasEvents(events) {
38406
38407
  case `${HARNESS_EVENT_TYPE_PREFIX}error`:
38407
38408
  messages.push({ id: `replicas-error-${String(payload.seq)}`, type: "error", message: stringifyDisplayValue(payload.message) ?? "The agent stopped with an error", timestamp: timestamp2 });
38408
38409
  return;
38410
+ case HARNESS_RETRY_EVENT_TYPE: {
38411
+ const at = Date.parse(timestamp2);
38412
+ if (at < retryMs || at <= streamEndedMs || at < livePartialMs || typeof payload.attempt !== "number" || typeof payload.maxAttempts !== "number") return;
38413
+ messages.push({
38414
+ id: "replicas-retry",
38415
+ type: "capacity_retry",
38416
+ attempt: payload.attempt,
38417
+ maxAttempts: payload.maxAttempts,
38418
+ ...typeof payload.reason === "string" ? { reason: payload.reason } : {},
38419
+ status: "in_progress",
38420
+ timestamp: timestamp2
38421
+ });
38422
+ return;
38423
+ }
38409
38424
  case CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE: {
38410
38425
  const partial2 = coerceClaudePartialMessagePayload(payload);
38411
- if (!partial2 || Date.parse(event.timestamp) <= streamEndedMs || Date.parse(event.timestamp) < livePartialMs) return;
38426
+ if (!partial2 || Date.parse(event.timestamp) <= Math.max(streamEndedMs, retryMs) || Date.parse(event.timestamp) < livePartialMs) return;
38412
38427
  if (partial2.thinking) upsertDisplayMessage(messages, { id: `replicas-partial-${partial2.streamId}-thinking`, type: "reasoning", content: partial2.thinking, status: "in_progress", timestamp: timestamp2 });
38413
38428
  if (partial2.text) upsertDisplayMessage(messages, { id: `replicas-partial-${partial2.streamId}`, type: "agent", content: partial2.text, timestamp: timestamp2 });
38414
38429
  return;
@@ -38417,7 +38432,7 @@ function parseReplicasEvents(events) {
38417
38432
  });
38418
38433
  return messages;
38419
38434
  }
38420
- var HARNESS_EVENT_TYPE_PREFIX;
38435
+ var HARNESS_EVENT_TYPE_PREFIX, HARNESS_RETRY_EVENT_TYPE;
38421
38436
  var init_replicas_parser = __esm({
38422
38437
  "../shared/src/display-message/parsers/replicas-parser.ts"() {
38423
38438
  "use strict";
@@ -38429,6 +38444,7 @@ var init_replicas_parser = __esm({
38429
38444
  init_inference_error();
38430
38445
  init_utils();
38431
38446
  HARNESS_EVENT_TYPE_PREFIX = "harness-";
38447
+ HARNESS_RETRY_EVENT_TYPE = "harness-live-retry";
38432
38448
  }
38433
38449
  });
38434
38450
 
@@ -40276,7 +40292,8 @@ var init_types8 = __esm({
40276
40292
  external_exports.object({ type: external_exports.literal("delta"), streamId: external_exports.string(), thinking: external_exports.string() }),
40277
40293
  external_exports.object({ type: external_exports.literal("delta"), streamId: external_exports.string(), toolCall: external_exports.object({ id: external_exports.string(), name: external_exports.string(), argumentsDelta: external_exports.string() }) }),
40278
40294
  external_exports.object({ type: external_exports.literal("step_saved"), seq: external_exports.number() }),
40279
- external_exports.object({ type: external_exports.literal("status"), status: external_exports.enum(HARNESS_THREAD_STATUSES) })
40295
+ external_exports.object({ type: external_exports.literal("status"), status: external_exports.enum(HARNESS_THREAD_STATUSES) }),
40296
+ external_exports.object({ type: external_exports.literal("retry"), attempt: external_exports.number(), maxAttempts: external_exports.number(), reason: external_exports.string() })
40280
40297
  ]);
40281
40298
  }
40282
40299
  });
@@ -40384,7 +40401,7 @@ var CLI_VERSION;
40384
40401
  var init_cli_version = __esm({
40385
40402
  "../shared/src/cli-version.ts"() {
40386
40403
  "use strict";
40387
- CLI_VERSION = "0.3.542";
40404
+ CLI_VERSION = "0.3.544";
40388
40405
  }
40389
40406
  });
40390
40407
 
@@ -55879,7 +55896,7 @@ Automation: ${automation2.name}
55879
55896
  console.log(import_chalk27.default.gray(` Workspace: ${formatDestination(automation2)}`));
55880
55897
  console.log(import_chalk27.default.gray(` List: ${automation2.background ? "background" : "main"}`));
55881
55898
  if (automation2.credential_user_id) console.log(import_chalk27.default.gray(` Credentials: member ${automation2.credential_user_id}, then the organization's`));
55882
- console.log(import_chalk27.default.gray(` Size: ${automation2.workspace_size ?? DEFAULT_WORKSPACE_SIZE}${automation2.target_workspace_id ? " (new workspaces only; runs reuse the pinned workspace)" : ""}`));
55899
+ console.log(import_chalk27.default.gray(` Size: ${automation2.workspace_size ?? DEFAULT_AUTOMATION_WORKSPACE_SIZE}${automation2.target_workspace_id ? " (new workspaces only; runs reuse the pinned workspace)" : ""}`));
55883
55900
  if (automation2.workspace_lifecycle_policy) {
55884
55901
  console.log(import_chalk27.default.gray(` Lifecycle Policy: ${automation2.workspace_lifecycle_policy}`));
55885
55902
  }
@@ -58559,7 +58576,7 @@ var init_src2 = __esm({
58559
58576
  automation = program.command("automation").alias("auto").description("Manage automations");
58560
58577
  automation.command("list").description("List all automations").option("-p, --page <page>", "Page number").option("-l, --limit <limit>", "Number of items per page").option("--owner <owner>", "Ownership filter: org, user, all").option("--trigger-type <type>", "Only automations with a trigger of this type (cron, github, gitlab, slack, sentry, linear, custom)").option("--enabled <enabled>", "Only enabled or disabled automations (true/false)").option("--search <search>", "Case-insensitive substring match on the name").option("--background <background>", "Only background (true) or main-list (false) automations").action(run(automationListCommand));
58561
58578
  automation.command("get <id>").description("Get automation details by ID").action(run(automationGetCommand));
58562
- automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-d, --description <description>", "Description shown with the automation").option("-e, --environment <environment>", "Environment name or ID").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small (default), large, ultra, auto").option("--trigger-cron <schedule>", 'Cron schedule expression, e.g. "0 9 * * 1-5" (repeatable)', collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules (default: UTC)").option("--trigger-github <event>", 'GitHub event, e.g. "pull_request.opened" (repeatable)', collect, []).option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-github-reviewers <users>", "Comma-separated GitHub usernames to fire for (required with pull_request.review_requested)").option("--trigger-gitlab <event>", 'GitLab event, e.g. "merge_request.opened" (repeatable)', collect, []).option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done (default for new automations except one-time ones), sleep_when_done, archive_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (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, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--in <duration>", "Run once after this long, e.g. 30m, 2h, 3d, 1w (inside a workspace, defaults --workspace to current)").option("--at <datetime>", "Run once at this ISO-8601 time with timezone, e.g. 2026-10-08T09:00:00-07:00").option("--max-runs <n>", 'Delete the automation after this many runs ("none" for unlimited)').option("--workspace <target>", "Where runs go: new (default, new workspace each run), reuse (one workspace for every run), current (this workspace), or a workspace ID").option("--background", "Mark this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list").option("--credentials <who>", "Run on your coding agent credentials before the organization's: me or your email (organization automations only)").option("--disabled", "Create in disabled state").action(run((name, options) => automationCreateCommand(name, { ...options, enabled: !options.disabled })));
58579
+ automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-d, --description <description>", "Description shown with the automation").option("-e, --environment <environment>", "Environment name or ID").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small, large, ultra, auto (default)").option("--trigger-cron <schedule>", 'Cron schedule expression, e.g. "0 9 * * 1-5" (repeatable)', collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules (default: UTC)").option("--trigger-github <event>", 'GitHub event, e.g. "pull_request.opened" (repeatable)', collect, []).option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-github-reviewers <users>", "Comma-separated GitHub usernames to fire for (required with pull_request.review_requested)").option("--trigger-gitlab <event>", 'GitLab event, e.g. "merge_request.opened" (repeatable)', collect, []).option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done (default for new automations except one-time ones), sleep_when_done, archive_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (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, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--in <duration>", "Run once after this long, e.g. 30m, 2h, 3d, 1w (inside a workspace, defaults --workspace to current)").option("--at <datetime>", "Run once at this ISO-8601 time with timezone, e.g. 2026-10-08T09:00:00-07:00").option("--max-runs <n>", 'Delete the automation after this many runs ("none" for unlimited)').option("--workspace <target>", "Where runs go: new (default, new workspace each run), reuse (one workspace for every run), current (this workspace), or a workspace ID").option("--background", "Mark this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list").option("--credentials <who>", "Run on your coding agent credentials before the organization's: me or your email (organization automations only)").option("--disabled", "Create in disabled state").action(run((name, options) => automationCreateCommand(name, { ...options, enabled: !options.disabled })));
58563
58580
  automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-d, --description <description>", "New description (pass empty string to clear)").option("--size <size>", "Size of workspaces runs create (not a reused existing one): small, large, ultra, auto").option("--enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (repeatable; replaces existing triggers unless --keep-triggers)", collect, []).option("--trigger-cron-timezone <timezone>", "Timezone for cron schedules").option("--trigger-github <event>", "Set GitHub event (repeatable; replaces existing triggers unless --keep-triggers)", collect, []).option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-github-reviewers <users>", "Comma-separated GitHub usernames to fire for (required with pull_request.review_requested)").option("--trigger-gitlab <event>", "Set GitLab event (repeatable; replaces existing triggers unless --keep-triggers)", collect, []).option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--keep-triggers", "Add the --trigger-cron, --trigger-github, --trigger-gitlab, --in or --at triggers to the existing ones instead of replacing them").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: delete_when_done (default for new automations except one-time ones), sleep_when_done, archive_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").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 (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, xhigh, 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 goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).option("--in <duration>", "Replace triggers with a one-time run after this long, e.g. 30m, 2h, 3d, 1w").option("--at <datetime>", "Replace triggers with a one-time run at this ISO-8601 time with timezone").option("--max-runs <n>", 'Delete the automation after this many runs in total ("none" for unlimited)').option("--workspace <target>", "Where runs go: new, reuse, current, or a workspace ID").option("--background <enabled>", "Keep it out of the main automations list (true/false)", parseBooleanOption).option("--credentials <who>", "Run on your coding agent credentials before the organization's: me or your email, or org to use the organization's").option("--move-to-org", "Move a personal automation to the organization so teammates can see and edit it (cannot be undone)").action(run(automationEditCommand));
58564
58581
  automation.command("run <id>").description("Manually trigger an automation (cron-triggered automations only)").action(run(automationRunCommand));
58565
58582
  automation.command("delete <id>").description("Delete an automation").option("-f, --force", "Skip confirmation prompt").action(run(automationDeleteCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.542",
3
+ "version": "0.3.544",
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": {