replicas-cli 0.3.622 → 0.3.623

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 +14 -20
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -39917,6 +39917,7 @@ var init_context_usage = __esm({
39917
39917
  "use strict";
39918
39918
  init_event();
39919
39919
  init_agent();
39920
+ init_type_guards();
39920
39921
  }
39921
39922
  });
39922
39923
 
@@ -40361,14 +40362,11 @@ var init_hook_config = __esm({
40361
40362
  });
40362
40363
 
40363
40364
  // ../shared/src/warm-hooks.ts
40364
- function isRecord2(value) {
40365
- return typeof value === "object" && value !== null;
40366
- }
40367
40365
  function parseWarmHookConfig(value, filename = "replicas.json") {
40368
40366
  if (typeof value === "string") {
40369
40367
  return value;
40370
40368
  }
40371
- if (!isRecord2(value)) {
40369
+ if (!isRecord(value)) {
40372
40370
  throw new Error(`Invalid ${filename}: "warmHook" must be a string or object`);
40373
40371
  }
40374
40372
  if (!Array.isArray(value.commands) || !value.commands.every((entry) => typeof entry === "string")) {
@@ -40391,6 +40389,7 @@ var init_warm_hooks = __esm({
40391
40389
  "../shared/src/warm-hooks.ts"() {
40392
40390
  "use strict";
40393
40391
  init_hook_config();
40392
+ init_type_guards();
40394
40393
  DEFAULT_WARM_HOOK_TIMEOUT_MS = 60 * 60 * 1e3;
40395
40394
  MAX_WARM_HOOK_TIMEOUT_MS = 120 * 60 * 1e3;
40396
40395
  DEFAULT_START_HOOK_TIMEOUT_MS = 5 * 60 * 1e3;
@@ -40399,11 +40398,8 @@ var init_warm_hooks = __esm({
40399
40398
  });
40400
40399
 
40401
40400
  // ../shared/src/replicas-config.ts
40402
- function isRecord3(value) {
40403
- return typeof value === "object" && value !== null;
40404
- }
40405
40401
  function parseReplicasConfig(value, filename = "replicas.json") {
40406
- if (!isRecord3(value)) {
40402
+ if (!isRecord(value)) {
40407
40403
  throw new Error(`Invalid ${filename}: expected an object`);
40408
40404
  }
40409
40405
  const config3 = {};
@@ -40427,7 +40423,7 @@ function parseReplicasConfig(value, filename = "replicas.json") {
40427
40423
  config3.systemPrompt = value.systemPrompt;
40428
40424
  }
40429
40425
  if ("startHook" in value) {
40430
- if (!isRecord3(value.startHook)) {
40426
+ if (!isRecord(value.startHook)) {
40431
40427
  throw new Error(`Invalid ${filename}: "startHook" must be an object with "commands" array`);
40432
40428
  }
40433
40429
  const { commands, timeout, separate } = value.startHook;
@@ -40483,6 +40479,7 @@ var init_replicas_config = __esm({
40483
40479
  import_yaml2 = __toESM(require_dist());
40484
40480
  init_result();
40485
40481
  init_warm_hooks();
40482
+ init_type_guards();
40486
40483
  init_environment_config();
40487
40484
  REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
40488
40485
  }
@@ -40802,7 +40799,7 @@ var CLI_VERSION;
40802
40799
  var init_cli_version = __esm({
40803
40800
  "../shared/src/cli-version.ts"() {
40804
40801
  "use strict";
40805
- CLI_VERSION = "0.3.622";
40802
+ CLI_VERSION = "0.3.623";
40806
40803
  }
40807
40804
  });
40808
40805
 
@@ -51644,6 +51641,7 @@ var EMAIL_KEYS, MANUAL_EMAIL_TEMPLATE_KEYS, EMAIL_TEMPLATE_KEYS;
51644
51641
  var init_onboarding_emails = __esm({
51645
51642
  "../shared/src/onboarding-emails.ts"() {
51646
51643
  "use strict";
51644
+ init_type_guards();
51647
51645
  EMAIL_KEYS = [
51648
51646
  "welcome",
51649
51647
  "no_repo_24h",
@@ -52907,6 +52905,10 @@ var init_currency = __esm({
52907
52905
  function formatDate(dateString) {
52908
52906
  return new Date(dateString).toLocaleString();
52909
52907
  }
52908
+ function truncate(text3, maxLength) {
52909
+ if (text3.length <= maxLength) return text3;
52910
+ return text3.substring(0, maxLength) + "...";
52911
+ }
52910
52912
  function printReplicaActivity(activity) {
52911
52913
  console.log(import_chalk6.default.gray(` Agent: ${activity.state.replaceAll("_", " ")}${activity.current_step ? ` \xB7 ${activity.current_step}` : ""}`));
52912
52914
  if (activity.last_agent_message) console.log(import_chalk6.default.gray(` Last message: ${activity.last_agent_message}`));
@@ -55372,10 +55374,6 @@ function formatStatus(status) {
55372
55374
  if (isWorkspaceSuspendedStatus(status)) return import_chalk22.default.gray(status);
55373
55375
  return status;
55374
55376
  }
55375
- function truncate(text3, maxLength) {
55376
- if (text3.length <= maxLength) return text3;
55377
- return text3.substring(0, maxLength) + "...";
55378
- }
55379
55377
  function formatDisplayMessage(message2) {
55380
55378
  const time3 = new Date(message2.timestamp).toLocaleTimeString();
55381
55379
  switch (message2.type) {
@@ -56400,10 +56398,6 @@ function buildTriggersFromOptions(options, runAt, repositories) {
56400
56398
  }
56401
56399
  return triggers;
56402
56400
  }
56403
- function truncate2(text3, maxLength) {
56404
- if (text3.length <= maxLength) return text3;
56405
- return text3.substring(0, maxLength) + "...";
56406
- }
56407
56401
  function formatAutoPause(automation2) {
56408
56402
  return `${AUTOMATION_AUTO_PAUSE_LABEL}${automation2.failing_cause ? `: ${automation2.failing_cause}` : ""}`;
56409
56403
  }
@@ -56441,7 +56435,7 @@ function printAutomation(automation2) {
56441
56435
  }
56442
56436
  console.log(import_chalk27.default.gray(` Enabled: ${automation2.enabled ? import_chalk27.default.green("yes") : import_chalk27.default.red("no")}`));
56443
56437
  if (automation2.auto_paused_at) {
56444
- console.log(import_chalk27.default.yellow(` ${truncate2(formatAutoPause(automation2), 120)}`));
56438
+ console.log(import_chalk27.default.yellow(` ${truncate(formatAutoPause(automation2), 120)}`));
56445
56439
  }
56446
56440
  if (automation2.triggers.length > 0) {
56447
56441
  console.log(import_chalk27.default.gray(` Triggers: ${automation2.triggers.map(formatTrigger).join(", ")}`));
@@ -56449,7 +56443,7 @@ function printAutomation(automation2) {
56449
56443
  if (automation2.github_check_names.length > 0) {
56450
56444
  console.log(import_chalk27.default.gray(` GitHub checks: ${automation2.github_check_names.join(", ")}`));
56451
56445
  }
56452
- console.log(import_chalk27.default.gray(` Prompt: ${truncate2(automation2.prompt, 80)}`));
56446
+ console.log(import_chalk27.default.gray(` Prompt: ${truncate(automation2.prompt, 80)}`));
56453
56447
  if (automation2.cron_next_fire_at) {
56454
56448
  console.log(import_chalk27.default.gray(` Next Run: ${formatDate(automation2.cron_next_fire_at)}`));
56455
56449
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.622",
3
+ "version": "0.3.623",
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": {