replicas-cli 0.3.567 → 0.3.569

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 +62 -7
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -23366,9 +23366,11 @@ function formatCompactRelativeTime(input2, now = Date.now()) {
23366
23366
  const compact = compactTimeAgo(future ? now - (then - now) : then, { now });
23367
23367
  return future ? `in ${compact}` : `${compact} ago`;
23368
23368
  }
23369
+ var USD;
23369
23370
  var init_format = __esm({
23370
23371
  "../shared/src/format.ts"() {
23371
23372
  "use strict";
23373
+ USD = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });
23372
23374
  }
23373
23375
  });
23374
23376
 
@@ -23539,6 +23541,9 @@ var init_environment_setups = __esm({
23539
23541
  });
23540
23542
 
23541
23543
  // ../shared/src/routes/environment.ts
23544
+ function isEnvironmentSetupSourceMode(value) {
23545
+ return ENVIRONMENT_SETUP_SOURCE_MODES.some((mode) => mode === value);
23546
+ }
23542
23547
  function validateEnvironmentMcpAuthentication(transport, config3) {
23543
23548
  if (!config3.auth) return createSuccessResult();
23544
23549
  const url2 = new URL(config3.url);
@@ -23557,7 +23562,7 @@ function validateEnvironmentMcpAuthentication(transport, config3) {
23557
23562
  function isReservedMcpName(name) {
23558
23563
  return RESERVED_MCP_NAME_PREFIXES.some((prefix) => name.startsWith(prefix));
23559
23564
  }
23560
- var ENVIRONMENT_MCP_TRANSPORTS, MCP_NAME_PATTERN, environmentMcpVariableReferenceSchema, getMcpProxyDroppedHeader, stringMap, environmentMcpStdioConfigSchema, environmentMcpHttpConfigSchema, createEnvironmentMcpRequestSchema, updateEnvironmentMcpRequestSchema, RESERVED_MCP_NAME_PREFIXES, screenPasswordSchema, hostSchema, createEnvironmentDeviceRequestSchema, updateEnvironmentDeviceRequestSchema, DEVICE_ONLINE_WINDOW_MS, isDeviceOnline, deviceConnectionResponseSchema, deviceHostKeysRequestSchema, DEVICE_CONNECT_COMMAND, provisionedDeviceSchema;
23565
+ var ENVIRONMENT_SETUP_SOURCE_MODES, ENVIRONMENT_MCP_TRANSPORTS, MCP_NAME_PATTERN, environmentMcpVariableReferenceSchema, getMcpProxyDroppedHeader, stringMap, environmentMcpStdioConfigSchema, environmentMcpHttpConfigSchema, createEnvironmentMcpRequestSchema, updateEnvironmentMcpRequestSchema, RESERVED_MCP_NAME_PREFIXES, screenPasswordSchema, hostSchema, createEnvironmentDeviceRequestSchema, updateEnvironmentDeviceRequestSchema, DEVICE_ONLINE_WINDOW_MS, isDeviceOnline, deviceConnectionResponseSchema, deviceHostKeysRequestSchema, DEVICE_CONNECT_COMMAND, provisionedDeviceSchema;
23561
23566
  var init_environment = __esm({
23562
23567
  "../shared/src/routes/environment.ts"() {
23563
23568
  "use strict";
@@ -23567,6 +23572,7 @@ var init_environment = __esm({
23567
23572
  init_environment_setups();
23568
23573
  init_result();
23569
23574
  init_urls();
23575
+ ENVIRONMENT_SETUP_SOURCE_MODES = ["app_and_repo", "repo_only", "app_only"];
23570
23576
  ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
23571
23577
  MCP_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
23572
23578
  environmentMcpVariableReferenceSchema = external_exports.strictObject({
@@ -27511,6 +27517,7 @@ var init_environment_config = __esm({
27511
27517
  memory: external_exports.strictObject({ read: external_exports.boolean().optional(), write: external_exports.boolean().optional() }).nullable().optional(),
27512
27518
  gpu: external_exports.boolean().nullable().optional(),
27513
27519
  mobileTesting: external_exports.boolean().nullable().optional(),
27520
+ setupSourceMode: external_exports.enum(ENVIRONMENT_SETUP_SOURCE_MODES).nullable().optional(),
27514
27521
  defaultSkills: defaultSkillsOverridesSchema.superRefine((skills2, context) => {
27515
27522
  for (const ability of REPLICAS_AGENT_ABILITIES) if (skills2.replicas_agent?.abilities?.[ability] === false && REPLICAS_AGENT_ABILITY_REGISTRY[ability].locked) context.addIssue({ code: "custom", path: ["replicas_agent", "abilities", ability], message: "This built-in ability cannot be disabled" });
27516
27523
  }).nullable().optional(),
@@ -27556,7 +27563,7 @@ var init_environment_config_source = __esm({
27556
27563
  "use strict";
27557
27564
  init_zod();
27558
27565
  init_environment_config();
27559
- ENVIRONMENT_CONFIG_PREFERENCES = [["memory", "memory"], ["gpu", "gpu"], ["mobileTesting", "mobile_testing"], ["defaultSkills", "default_skills"]];
27566
+ ENVIRONMENT_CONFIG_PREFERENCES = [["memory", "memory"], ["gpu", "gpu"], ["mobileTesting", "mobile_testing"], ["defaultSkills", "default_skills"], ["setupSourceMode", "setup_source_mode"]];
27560
27567
  ENVIRONMENT_CONFIG_SETTING_FIELDS = ["repositories", "workspaceSize", "inheritRepositories", ...ENVIRONMENT_CONFIG_PREFERENCES.map(([field2]) => field2)];
27561
27568
  environmentConfigLocationSchema = external_exports.union([
27562
27569
  external_exports.object({
@@ -28282,6 +28289,32 @@ var init_constants = __esm({
28282
28289
  });
28283
28290
 
28284
28291
  // ../shared/src/user-message-parser/chat-fork.ts
28292
+ function readChatForkEnvelope(content) {
28293
+ if (!content.startsWith(OPEN_MARKER)) return null;
28294
+ const metaEnd = content.indexOf(OPEN_MARKER_END, OPEN_MARKER.length);
28295
+ if (metaEnd === -1) return null;
28296
+ let meta3;
28297
+ try {
28298
+ meta3 = JSON.parse(content.slice(OPEN_MARKER.length, metaEnd));
28299
+ } catch {
28300
+ return null;
28301
+ }
28302
+ if (!isRecord(meta3)) return null;
28303
+ const closeIndex = content.lastIndexOf(CLOSE_MARKER);
28304
+ const closed = closeIndex > metaEnd;
28305
+ return {
28306
+ meta: meta3,
28307
+ closed,
28308
+ inner: content.slice(metaEnd + OPEN_MARKER_END.length, closed ? closeIndex : void 0).trim(),
28309
+ replyText: closed ? content.slice(closeIndex + CLOSE_MARKER.length).trim() : ""
28310
+ };
28311
+ }
28312
+ function threadHandoffText(content) {
28313
+ const envelope = readChatForkEnvelope(content);
28314
+ if (!envelope?.closed) return null;
28315
+ return envelope.meta.trigger === "auto" ? "" : envelope.replyText;
28316
+ }
28317
+ var OPEN_MARKER, OPEN_MARKER_END, CLOSE_MARKER;
28285
28318
  var init_chat_fork2 = __esm({
28286
28319
  "../shared/src/user-message-parser/chat-fork.ts"() {
28287
28320
  "use strict";
@@ -28289,6 +28322,9 @@ var init_chat_fork2 = __esm({
28289
28322
  init_agent_quota();
28290
28323
  init_chat_fork();
28291
28324
  init_type_guards();
28325
+ OPEN_MARKER = "<!-- replicas:chat-fork ";
28326
+ OPEN_MARKER_END = " -->";
28327
+ CLOSE_MARKER = "<!-- /replicas:chat-fork -->";
28292
28328
  }
28293
28329
  });
28294
28330
 
@@ -39561,7 +39597,7 @@ function filterDisplayMessages(messages, provider2) {
39561
39597
  }
39562
39598
  const cleaned = withoutAttachmentPlaceholder(content, Boolean(msg.images?.length || files.length));
39563
39599
  if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [];
39564
- const origin = msg.cancelled ? null : parseMessageOrigin(msg.content);
39600
+ const origin = msg.cancelled ? null : parseMessageOrigin(threadHandoffText(msg.content) || msg.content);
39565
39601
  if (cleaned === msg.content && !origin && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
39566
39602
  return [{
39567
39603
  ...msg,
@@ -39584,6 +39620,7 @@ var init_parsers = __esm({
39584
39620
  init_manager_events();
39585
39621
  init_prompts();
39586
39622
  init_message_origin();
39623
+ init_chat_fork2();
39587
39624
  init_user_message_attachments();
39588
39625
  init_agent_event_utils();
39589
39626
  init_constants();
@@ -40710,7 +40747,7 @@ var CLI_VERSION;
40710
40747
  var init_cli_version = __esm({
40711
40748
  "../shared/src/cli-version.ts"() {
40712
40749
  "use strict";
40713
- CLI_VERSION = "0.3.567";
40750
+ CLI_VERSION = "0.3.569";
40714
40751
  }
40715
40752
  });
40716
40753
 
@@ -51393,12 +51430,24 @@ var init_x_leaderboard = __esm({
51393
51430
  });
51394
51431
 
51395
51432
  // ../shared/src/routes/environment-hook-runs.ts
51396
- var ENVIRONMENT_HOOK_RUN_LOG_LIMIT, ENVIRONMENT_HOOK_RUN_TAIL_LIMIT;
51433
+ var ENVIRONMENT_HOOK_RUN_LOG_LIMIT, ENVIRONMENT_HOOK_RUN_TAIL_LIMIT, environmentHookRunStepsSchema;
51397
51434
  var init_environment_hook_runs = __esm({
51398
51435
  "../shared/src/routes/environment-hook-runs.ts"() {
51399
51436
  "use strict";
51437
+ init_zod();
51400
51438
  ENVIRONMENT_HOOK_RUN_LOG_LIMIT = 5 * 1024 * 1024;
51401
51439
  ENVIRONMENT_HOOK_RUN_TAIL_LIMIT = 8 * 1024;
51440
+ environmentHookRunStepsSchema = external_exports.array(external_exports.object({
51441
+ repository: external_exports.string().max(255).nullable(),
51442
+ status: external_exports.enum(["succeeded", "failed", "skipped"])
51443
+ })).max(1024);
51444
+ }
51445
+ });
51446
+
51447
+ // ../shared/src/routes/environment-setup-steps.ts
51448
+ var init_environment_setup_steps = __esm({
51449
+ "../shared/src/routes/environment-setup-steps.ts"() {
51450
+ "use strict";
51402
51451
  }
51403
51452
  });
51404
51453
 
@@ -51899,6 +51948,7 @@ var init_src = __esm({
51899
51948
  init_x_leaderboard();
51900
51949
  init_environment();
51901
51950
  init_environment_hook_runs();
51951
+ init_environment_setup_steps();
51902
51952
  init_messages();
51903
51953
  init_mobile_testing();
51904
51954
  init_compute();
@@ -54482,6 +54532,7 @@ function printEnvironment(env, repoSkillCount) {
54482
54532
  if (repositoryIds.length > 0) {
54483
54533
  console.log(import_chalk21.default.gray(` Repositories: ${repositoryIds.join(", ")}`));
54484
54534
  }
54535
+ console.log(import_chalk21.default.gray(` Setup source: ${env.setup_source_mode}`));
54485
54536
  if (env.variable_count !== void 0) {
54486
54537
  console.log(import_chalk21.default.gray(` Variables: ${env.variable_count}, Files: ${env.file_count ?? 0}, Added skills: ${env.skill_count ?? 0}, MCPs: ${env.mcp_count ?? 0}`));
54487
54538
  }
@@ -54576,6 +54627,10 @@ async function environmentEditCommand(idOrName, options) {
54576
54627
  ensureOrgApiAuthenticated();
54577
54628
  const id = await resolveEnvironmentId(idOrName);
54578
54629
  const body2 = {};
54630
+ if (options.setupSourceMode !== void 0) {
54631
+ if (!isEnvironmentSetupSourceMode(options.setupSourceMode)) throw new Error(`--setup-source-mode must be one of ${ENVIRONMENT_SETUP_SOURCE_MODES.join(", ")}.`);
54632
+ body2.setup_source_mode = options.setupSourceMode;
54633
+ }
54579
54634
  if (options.name !== void 0) body2.name = options.name;
54580
54635
  if (options.description !== void 0) body2.description = options.description;
54581
54636
  if (options.systemPrompt !== void 0) body2.system_prompt = options.systemPrompt;
@@ -54583,7 +54638,7 @@ async function environmentEditCommand(idOrName, options) {
54583
54638
  body2.repository_ids = options.repository === "" || options.repository === "null" ? [] : await resolveRepositoryIds(splitList(options.repository));
54584
54639
  }
54585
54640
  if (Object.keys(body2).length === 0) {
54586
- throw new Error("No changes specified. Pass --name, --description, --repository, or --system-prompt.");
54641
+ throw new Error("No changes specified. Pass --name, --description, --repository, --system-prompt, or --setup-source-mode.");
54587
54642
  }
54588
54643
  const response = await orgAuthenticatedFetch(`/v1/environments/${id}`, {
54589
54644
  method: "PATCH",
@@ -59094,7 +59149,7 @@ var init_src2 = __esm({
59094
59149
  environment.command("list").description("List all environments").action(run(environmentListCommand));
59095
59150
  environment.command("get <id-or-name>").description("Get an environment by ID or name").action(run(environmentGetCommand));
59096
59151
  environment.command("create [name]").description("Create a new environment").option("-d, --description <description>", "Environment description").option("-r, --repository <names>", "Repositories to clone (comma-separated names or IDs)").option("--system-prompt <prompt>", "System prompt for agents started in this environment").action(run(environmentCreateCommand));
59097
- environment.command("edit <id-or-name>").description("Edit an environment").option("-n, --name <name>", "New name").option("-d, --description <description>", "New description").option("-r, --repository <names>", "Replace the repositories (comma-separated names or IDs; empty string for none)").option("--system-prompt <prompt>", "System prompt").action(run(environmentEditCommand));
59152
+ environment.command("edit <id-or-name>").description("Edit an environment").option("-n, --name <name>", "New name").option("-d, --description <description>", "New description").option("-r, --repository <names>", "Replace the repositories (comma-separated names or IDs; empty string for none)").option("--system-prompt <prompt>", "System prompt").option("--setup-source-mode <mode>", "Which hooks run: app_and_repo, repo_only (app hooks locked), or app_only (replicas.json hooks ignored)").action(run(environmentEditCommand));
59098
59153
  environment.command("delete <id-or-name>").description("Delete an environment").option("-f, --force", "Skip confirmation prompt").action(run(environmentDeleteCommand));
59099
59154
  envConfig = environment.command("config").description("Link and sync environment configuration from Git");
59100
59155
  envConfig.command("get <env>").description("Show the linked configuration source and sync status").action(run(environmentConfigGetCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.567",
3
+ "version": "0.3.569",
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": {