replicas-cli 0.3.660 → 0.3.662

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 +60 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -28427,7 +28427,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
28427
28427
 
28428
28428
  Environments are the org-scoped *primitives* workspaces are built from. Each environment lists the repositories to clone (none is fine) and carries environment variables, project files, enabled skills, and MCP servers. A fork inherits everything from its parent environment and stores only its own overrides. The org's default environment is used for Scout. Slack or Linear requests that don't name one use the requester's own default environment, falling back to the org default.
28429
28429
 
28430
- ### List / get / create / edit / delete
28430
+ ### List / get / create / fork / edit / delete
28431
28431
 
28432
28432
  \`\`\`bash
28433
28433
  replicas environment list
@@ -28436,6 +28436,8 @@ replicas environment create [name] \\
28436
28436
  --description "..." \\
28437
28437
  --repository <repo-names-or-ids> \\
28438
28438
  --system-prompt "..."
28439
+ replicas environment fork <id-or-name> <name> \\
28440
+ [--repository <repo-names-or-ids>] [--personal]
28439
28441
  replicas environment edit <id-or-name> \\
28440
28442
  --name "..." --description "..." \\
28441
28443
  --repository <repo-names-or-ids>
@@ -29821,8 +29823,25 @@ var init_environment_config_source = __esm({
29821
29823
  }
29822
29824
  });
29823
29825
 
29826
+ // ../shared/src/routes/environment-inheritance.ts
29827
+ var ENVIRONMENT_INHERITANCE_KINDS, RESET_INHERITED_KINDS, forkEnvironmentRequestSchema;
29828
+ var init_environment_inheritance = __esm({
29829
+ "../shared/src/routes/environment-inheritance.ts"() {
29830
+ "use strict";
29831
+ init_zod();
29832
+ ENVIRONMENT_INHERITANCE_KINDS = ["variable", "file", "mcp", "device", "skill", "skills_registry", "plugin", "integration"];
29833
+ RESET_INHERITED_KINDS = [...ENVIRONMENT_INHERITANCE_KINDS, "repository", "memory", "default_skills", "gpu", "mobile_testing"];
29834
+ forkEnvironmentRequestSchema = external_exports.object({
29835
+ name: external_exports.string(),
29836
+ description: external_exports.string().nullable().optional(),
29837
+ scope: external_exports.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal fork. A personal environment only forks into `user`"),
29838
+ repository_ids: external_exports.array(external_exports.string()).optional().describe("Repositories to clone instead of this environment's, in checkout order. Omit to keep cloning the same ones")
29839
+ });
29840
+ }
29841
+ });
29842
+
29824
29843
  // ../shared/src/replicas-mcp.ts
29825
- var REPLICAS_MCP_TOOLS, automationToolInputSchema, credentialUserIdDescription, automationBackgroundSchema, automationCreateToolInputSchema, automationUpdateToolInputSchema, chatPath, provider, model, thinkingLevel, title2, message, createChatToolInputSchema, forkChatToolInputSchema, renameChatToolInputSchema, runCommandToolInputSchema, environmentMcpPath, createEnvironmentMcpToolInputSchema, updateEnvironmentMcpToolInputSchema, createEnvironmentDeviceToolInputSchema, previewEnvironmentConfigSourceToolInputSchema, applyEnvironmentConfigSourceToolInputSchema;
29844
+ var REPLICAS_MCP_TOOLS, automationToolInputSchema, credentialUserIdDescription, automationBackgroundSchema, automationCreateToolInputSchema, automationUpdateToolInputSchema, chatPath, provider, model, thinkingLevel, title2, message, createChatToolInputSchema, forkChatToolInputSchema, renameChatToolInputSchema, runCommandToolInputSchema, environmentMcpPath, createEnvironmentMcpToolInputSchema, updateEnvironmentMcpToolInputSchema, forkEnvironmentToolInputSchema, createEnvironmentDeviceToolInputSchema, previewEnvironmentConfigSourceToolInputSchema, applyEnvironmentConfigSourceToolInputSchema;
29826
29845
  var init_replicas_mcp = __esm({
29827
29846
  "../shared/src/replicas-mcp.ts"() {
29828
29847
  "use strict";
@@ -29835,6 +29854,7 @@ var init_replicas_mcp = __esm({
29835
29854
  init_v1();
29836
29855
  init_environment();
29837
29856
  init_environment_config_source();
29857
+ init_environment_inheritance();
29838
29858
  init_workspaces();
29839
29859
  init_sandbox();
29840
29860
  REPLICAS_MCP_TOOLS = {
@@ -29945,6 +29965,7 @@ var init_replicas_mcp = __esm({
29945
29965
  mcp_id: external_exports.string().describe("MCP ID"),
29946
29966
  ...updateEnvironmentMcpRequestSchema.shape
29947
29967
  });
29968
+ forkEnvironmentToolInputSchema = forkEnvironmentRequestSchema.extend({ environment_id: external_exports.string().min(1).describe("Environment to fork") });
29948
29969
  createEnvironmentDeviceToolInputSchema = external_exports.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
29949
29970
  previewEnvironmentConfigSourceToolInputSchema = previewEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
29950
29971
  applyEnvironmentConfigSourceToolInputSchema = applyEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
@@ -42977,7 +42998,7 @@ var init_organizations = __esm({
42977
42998
  });
42978
42999
 
42979
43000
  // ../shared/src/harness/types.ts
42980
- var HARNESS_THREAD_STATUSES, textSchema, imageSchema, userMessageSchema, assistantMessageSchema, toolResultMessageSchema, harnessAgentOutcomeSchema, HARNESS_AGENT_TYPES, harnessThreadOriginSchema, harnessInboxPayloadSchemas, harnessEventBodySchema, harnessLiveMessageSchema, HARNESS_LIVE_MAX_BYTES, harnessWorkspaceLiveMessageSchema;
43001
+ var HARNESS_THREAD_STATUSES, textSchema, imageSchema, userMessageSchema, assistantMessageSchema, toolResultMessageSchema, harnessAgentOutcomeSchema, HARNESS_AGENT_TYPES, harnessAgentOriginSchema, harnessSwitchOriginSchema, harnessThreadOriginSchema, harnessThreadOriginMetaSchema, harnessInboxPayloadSchemas, harnessEventBodySchema, harnessLiveMessageSchema, HARNESS_LIVE_MAX_BYTES, harnessWorkspaceLiveMessageSchema;
42981
43002
  var init_types8 = __esm({
42982
43003
  "../shared/src/harness/types.ts"() {
42983
43004
  "use strict";
@@ -43029,13 +43050,28 @@ var init_types8 = __esm({
43029
43050
  response: external_exports.string()
43030
43051
  });
43031
43052
  HARNESS_AGENT_TYPES = ["general", "explore", "execute"];
43032
- harnessThreadOriginSchema = external_exports.object({
43053
+ harnessAgentOriginSchema = external_exports.object({
43033
43054
  kind: external_exports.enum(["side_chat", "subagent"]),
43034
43055
  agentType: external_exports.enum(HARNESS_AGENT_TYPES).optional(),
43035
43056
  parentThreadId: external_exports.string().uuid(),
43036
43057
  depth: external_exports.number().int().nonnegative(),
43037
43058
  message: userMessageSchema
43038
43059
  });
43060
+ harnessSwitchOriginSchema = external_exports.object({
43061
+ kind: external_exports.literal("switch"),
43062
+ sourceChatId: external_exports.string().min(1),
43063
+ sourceProvider: external_exports.enum(VALID_AGENT_PROVIDERS),
43064
+ sourceTitle: external_exports.string(),
43065
+ message: userMessageSchema
43066
+ });
43067
+ harnessThreadOriginSchema = external_exports.discriminatedUnion("kind", [
43068
+ harnessAgentOriginSchema,
43069
+ harnessSwitchOriginSchema
43070
+ ]);
43071
+ harnessThreadOriginMetaSchema = external_exports.discriminatedUnion("kind", [
43072
+ harnessAgentOriginSchema.omit({ message: true }),
43073
+ harnessSwitchOriginSchema.omit({ message: true })
43074
+ ]);
43039
43075
  harnessInboxPayloadSchemas = {
43040
43076
  message: external_exports.looseObject({
43041
43077
  message: userMessageSchema,
@@ -43372,7 +43408,7 @@ var CLI_VERSION;
43372
43408
  var init_cli_version = __esm({
43373
43409
  "../shared/src/cli-version.ts"() {
43374
43410
  "use strict";
43375
- CLI_VERSION = "0.3.660";
43411
+ CLI_VERSION = "0.3.662";
43376
43412
  }
43377
43413
  });
43378
43414
 
@@ -57589,6 +57625,24 @@ Created environment: ${environment2.name}`));
57589
57625
  `));
57590
57626
  });
57591
57627
  }
57628
+ async function environmentForkCommand(idOrName, name, options) {
57629
+ ensureOrgApiAuthenticated();
57630
+ if (!idOrName.trim()) throw new Error("Give the name or ID of the environment to fork.");
57631
+ const id = await resolveEnvironmentId(idOrName);
57632
+ const body2 = {
57633
+ name,
57634
+ description: options.description,
57635
+ scope: options.personal ? "user" : "org",
57636
+ repository_ids: options.repository === void 0 ? void 0 : await resolveRepositoryIds(splitList(options.repository))
57637
+ };
57638
+ const response = await orgAuthenticatedFetch(`/v1/environments/${id}/fork`, { method: "POST", body: body2 });
57639
+ output2(response, ({ environment: environment2 }) => {
57640
+ console.log(import_chalk22.default.green(`
57641
+ Forked ${idOrName} into ${environment2.name}`));
57642
+ console.log(import_chalk22.default.gray(` ID: ${environment2.id}
57643
+ `));
57644
+ });
57645
+ }
57592
57646
  async function environmentEditCommand(idOrName, options) {
57593
57647
  ensureOrgApiAuthenticated();
57594
57648
  const id = await resolveEnvironmentId(idOrName);
@@ -62743,6 +62797,7 @@ var init_src2 = __esm({
62743
62797
  environment.command("list").description("List all environments").action(run(environmentListCommand));
62744
62798
  environment.command("get <id-or-name>").description("Get an environment by ID or name").action(run(environmentGetCommand));
62745
62799
  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));
62800
+ environment.command("fork <id-or-name> <name>").description("Create an environment that inherits another one").option("-d, --description <description>", "Environment description").option("-r, --repository <names>", "Repositories to clone instead of the source's (comma-separated names or IDs; empty string for none)").option("--personal", "Make a personal fork only you can see").action(run(environmentForkCommand));
62746
62801
  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));
62747
62802
  environment.command("delete <id-or-name>").description("Delete an environment").option("-f, --force", "Skip confirmation prompt").action(run(environmentDeleteCommand));
62748
62803
  envConfig = environment.command("config").description("Link and sync environment configuration from Git");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.660",
3
+ "version": "0.3.662",
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": {