replicas-cli 0.3.89 → 0.3.92

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 +27 -15
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -24527,7 +24527,7 @@ Every Replicas workspace is a remote Linux VM. Repositories are cloned under \`~
24527
24527
 
24528
24528
  Hooks run with \`bash -lc\` from \`~/workspaces\` (the parent of every repository checkout), so start scripts with \`cd ~/workspaces/<repo-name>\`. A repository may also ship its own \`replicas.json\` / \`replicas.yaml\` with \`startHook\`, \`warmHook\`, and \`systemPrompt\`; repository hooks run after the environment hooks. Prefer proposing environment hooks unless the repository already manages its own.
24529
24529
 
24530
- The Global environment applies to every workspace in the organization; never propose putting repository-specific setup there.
24530
+ The organization's base environment applies to every environment built on it; never propose putting repository-specific setup there.
24531
24531
 
24532
24532
  ## Progress and the setup run
24533
24533
 
@@ -25479,7 +25479,8 @@ Expose locally running services (web apps, APIs, databases) as public preview UR
25479
25479
  Use this when:
25480
25480
  - You need to start a service that a human should view or interact with
25481
25481
  - The task involves UI work that benefits from human review
25482
- - You are verifying frontend/backend integrations visually`;
25482
+ - You are verifying frontend/backend integrations visually
25483
+ - You need a URL for OAuth redirects, GitHub App callbacks, or webhooks (never the sandbox's \`*.e2b.app\` address)`;
25483
25484
  var REFERENCE8 = `# Preview URLs
25484
25485
 
25485
25486
  When you run services on ports \u2014 such as a web app, API server, or database \u2014 humans may want to interact with them directly. You can expose your locally running services as public preview URLs.
@@ -25526,6 +25527,19 @@ Previews can optionally require cookie-based authentication. When \`--authentica
25526
25527
 
25527
25528
  **Rule of thumb:** Make frontend previews authenticated, leave backend/API previews unauthenticated.
25528
25529
 
25530
+ ## OAuth Redirects, App Callbacks, and Webhooks
25531
+
25532
+ Never use the sandbox's raw \`https://<port>-<sandbox-id>.e2b.app\` address (built from \`E2B_SANDBOX_ID\`) anywhere a browser or third party will load it. It only accepts requests carrying a per-sandbox token that the Replicas preview proxy adds, so browsers, OAuth providers, and webhook senders get \`403 Missing traffic access token\`.
25533
+
25534
+ Use the port's preview URL instead:
25535
+ - As the app's public base URL (\`APP_URL\`, \`NEXTAUTH_URL\`, and similar)
25536
+ - For OAuth redirect URIs and GitHub App callback and setup URLs
25537
+ - For webhook URLs (GitHub, Stripe, Slack, and others)
25538
+
25539
+ OAuth and GitHub App redirects happen in the browser, so they work on an \`--authenticated\` preview when the person is logged in to Replicas. Webhooks and other server-to-server calls carry no Replicas login, so the port receiving them needs a preview without \`--authenticated\`. That makes the whole port public to anyone with the URL: tell the user, and verify webhook signatures in the app.
25540
+
25541
+ A preview URL stays the same for a workspace and port, so register it with the provider once. Other workspaces get different URLs.
25542
+
25529
25543
  ## Cross-Service References
25530
25544
 
25531
25545
  When you expose multiple services that reference each other, you must update their configuration so they use preview URLs instead of \`localhost\`.
@@ -25555,7 +25569,7 @@ It is your responsibility to make previews work for outsiders as well as they wo
25555
25569
  var PREVIEWS_ABILITY = {
25556
25570
  label: "Previews",
25557
25571
  description: "Expose locally running services on public preview URLs for humans.",
25558
- bullet: "- Creating preview URLs for locally running services",
25572
+ bullet: "- Creating preview URLs for locally running services, including OAuth redirect, app callback, and webhook URLs (never a raw `*.e2b.app` address)",
25559
25573
  section: SECTION8,
25560
25574
  referenceFile: { name: "PREVIEWS.md", content: REFERENCE8 }
25561
25575
  };
@@ -25876,7 +25890,7 @@ Environments are the org-scoped *primitives* workspaces are built from. Each env
25876
25890
 
25877
25891
  \`\`\`bash
25878
25892
  replicas environment list
25879
- replicas environment get <id-or-name> # use "global" for the Global env
25893
+ replicas environment get <id-or-name>
25880
25894
  replicas environment create [name] \\
25881
25895
  --description "..." \\
25882
25896
  --repository <repo-name-or-id> \\
@@ -25888,9 +25902,8 @@ replicas environment delete <id-or-name> [--force]
25888
25902
  \`\`\`
25889
25903
 
25890
25904
  Notes:
25891
- - Environments resolve by **name or UUID**. \`global\` is an alias for the org's Global env.
25892
- - Non-global envs need a repo (or repo set) to back a workspace. If you \`create\` without \`--repository\`, the CLI prompts; in non-interactive contexts pass \`-r\`.
25893
- - \`edit\` on the Global env is rejected by the API \u2014 manage its contents through the \`vars\` / \`files\` subcommands instead.
25905
+ - Environments resolve by **name or UUID**. \`replicas environment list\` marks the org's base environment, which every other environment builds on.
25906
+ - An env needs a repo to back a workspace with code. If you \`create\` without \`--repository\`, the CLI prompts; in non-interactive contexts pass \`-r\`.
25894
25907
 
25895
25908
  ### Environment variables
25896
25909
 
@@ -26059,7 +26072,6 @@ Repos are connected via the GitHub integration in the dashboard \u2014 not from
26059
26072
  - \`Missing Replicas-Org-Id header\` \u2192 the workspace is hitting an older monolith that doesn't yet recognize agent auth on this endpoint. Surface this to the user; don't try to work around it by faking headers.
26060
26073
  - \`Workspace not found\` \u2192 the workspace was deleted while you were running. Stop and tell the user.
26061
26074
  - \`An environment with this name already exists\` \u2192 use \`environment edit\` instead, or pick a different name.
26062
- - \`Cannot delete the global environment\` \u2192 there is exactly one Global env per org and it's permanent. Manage its *contents* (\`vars\`, \`files\`) instead.
26063
26075
  `;
26064
26076
  var REPLICAS_ABILITY = {
26065
26077
  label: "Replicas",
@@ -28652,7 +28664,7 @@ var headlessAgentRequestSchema = external_exports.object({
28652
28664
  });
28653
28665
 
28654
28666
  // ../shared/src/cli-version.ts
28655
- var CLI_VERSION = "0.3.89";
28667
+ var CLI_VERSION = "0.3.92";
28656
28668
 
28657
28669
  // ../shared/src/version.ts
28658
28670
  function compareVersions(v1, v2) {
@@ -31504,8 +31516,8 @@ async function resolveEnvironmentId(input) {
31504
31516
  }
31505
31517
  return resolved.id;
31506
31518
  }
31507
- function printEnvironment(env) {
31508
- console.log(import_chalk20.default.white(` ${env.name}${env.is_global ? import_chalk20.default.gray(" (global)") : ""}`));
31519
+ function printEnvironment(env, isBase = false) {
31520
+ console.log(import_chalk20.default.white(` ${env.name}${isBase ? import_chalk20.default.gray(" (base)") : ""}`));
31509
31521
  console.log(import_chalk20.default.gray(` ID: ${env.id}`));
31510
31522
  if (env.description) {
31511
31523
  console.log(import_chalk20.default.gray(` Description: ${env.description}`));
@@ -31523,7 +31535,7 @@ function printEnvironment(env) {
31523
31535
  async function environmentListCommand() {
31524
31536
  ensureOrgApiAuthenticated();
31525
31537
  const response = await orgAuthenticatedFetch("/v1/environments");
31526
- output(response, ({ environments }) => {
31538
+ output(response, ({ environments, base_environment_id }) => {
31527
31539
  if (environments.length === 0) {
31528
31540
  console.log(import_chalk20.default.yellow("\nNo environments found.\n"));
31529
31541
  return;
@@ -31531,7 +31543,7 @@ async function environmentListCommand() {
31531
31543
  console.log(import_chalk20.default.green(`
31532
31544
  Environments (${environments.length}):
31533
31545
  `));
31534
- for (const env of environments) printEnvironment(env);
31546
+ for (const env of environments) printEnvironment(env, env.id === base_environment_id);
31535
31547
  });
31536
31548
  }
31537
31549
  async function environmentGetCommand(idOrName) {
@@ -32215,7 +32227,7 @@ async function replicaCreateCommand(name, options) {
32215
32227
  choices: environments.map((env) => ({
32216
32228
  title: env.name,
32217
32229
  value: env.id,
32218
- description: env.is_global ? "global" : `${env.repository_ids?.length ?? 0} repositories`
32230
+ description: env.id === envResponse.base_environment_id ? "base" : `${env.repository_ids?.length ?? 0} repositories`
32219
32231
  }))
32220
32232
  });
32221
32233
  const answer = response2.environment;
@@ -34568,7 +34580,7 @@ media.command("list").description("List media uploaded by a workspace (this work
34568
34580
  media.command("url <mediaId>").description("Print a short-lived download URL for media").action(run(mediaUrlCommand));
34569
34581
  var environment = program.command("environment").alias("env").description("Manage environments (org-scoped templates that back workspaces)");
34570
34582
  environment.command("list").description("List all environments").action(run(environmentListCommand));
34571
- environment.command("get <id-or-name>").description('Get an environment by ID or name (use "global" for the global env)').action(run(environmentGetCommand));
34583
+ environment.command("get <id-or-name>").description("Get an environment by ID or name").action(run(environmentGetCommand));
34572
34584
  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));
34573
34585
  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));
34574
34586
  environment.command("delete <id-or-name>").description("Delete an environment").option("-f, --force", "Skip confirmation prompt").action(run(environmentDeleteCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.89",
3
+ "version": "0.3.92",
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": {