replicas-cli 0.2.37 → 0.2.39

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.js +64 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7965,6 +7965,56 @@ Error: ${error instanceof Error ? error.message : "Unknown error"}`));
7965
7965
  var import_chalk6 = __toESM(require("chalk"));
7966
7966
  var import_child_process3 = require("child_process");
7967
7967
 
7968
+ // ../shared/src/pricing.ts
7969
+ var PLANS = {
7970
+ hobby: {
7971
+ id: "hobby",
7972
+ name: "Hobby",
7973
+ monthlyPrice: 0,
7974
+ seatPriceCents: 0,
7975
+ creditsIncluded: 20,
7976
+ features: ["20 hours of usage"]
7977
+ },
7978
+ developer: {
7979
+ id: "developer",
7980
+ name: "Developer",
7981
+ monthlyPrice: 30,
7982
+ seatPriceCents: 3e3,
7983
+ creditsIncluded: 0,
7984
+ features: ["Unlimited usage", "API access ($1/hr)"]
7985
+ },
7986
+ team: {
7987
+ id: "team",
7988
+ name: "Team",
7989
+ monthlyPrice: 120,
7990
+ seatPriceCents: 12e3,
7991
+ creditsIncluded: 0,
7992
+ features: [
7993
+ "Unlimited usage",
7994
+ "API access",
7995
+ "Higher API rate limits",
7996
+ "Warm hooks and pool access",
7997
+ "Optional add-ons for higher resources, warm pools, rate limits, and SOC 2"
7998
+ ]
7999
+ },
8000
+ enterprise: {
8001
+ id: "enterprise",
8002
+ name: "Enterprise",
8003
+ monthlyPrice: 0,
8004
+ seatPriceCents: 0,
8005
+ creditsIncluded: 0,
8006
+ features: [
8007
+ "Unlimited usage",
8008
+ "Custom API rates",
8009
+ "Custom rate limits",
8010
+ "Custom warm hooks and pools",
8011
+ "SOC 2"
8012
+ ]
8013
+ }
8014
+ };
8015
+ var TEAM_PLAN = PLANS.team;
8016
+ var ENTERPRISE_PLAN = PLANS.enterprise;
8017
+
7968
8018
  // ../shared/src/sandbox.ts
7969
8019
  var SANDBOX_LIFECYCLE = {
7970
8020
  AUTO_STOP_MINUTES: 60,
@@ -8281,7 +8331,7 @@ function parseClaudeEvents(events, parentToolUseId) {
8281
8331
  toolName,
8282
8332
  input: toolInput
8283
8333
  });
8284
- if (toolName === "Task") {
8334
+ if (toolName === "Task" || toolName === "Agent") {
8285
8335
  const inputObj = typeof toolInput === "string" ? safeJsonParse2(toolInput, {}) : toolInput;
8286
8336
  const nestedEvents = events.filter((e) => e.payload.parent_tool_use_id === toolUseId).map((e) => ({
8287
8337
  timestamp: e.timestamp,
@@ -9725,7 +9775,7 @@ async function engineFetch(path5, options) {
9725
9775
  }
9726
9776
 
9727
9777
  // src/commands/preview.ts
9728
- async function previewCreateCommand(port) {
9778
+ async function previewCreateCommand(port, options) {
9729
9779
  const portNum = parseInt(port, 10);
9730
9780
  if (isNaN(portNum) || portNum < 1 || portNum > 65535) {
9731
9781
  throw new Error("Port must be a number between 1 and 65535");
@@ -9733,7 +9783,7 @@ async function previewCreateCommand(port) {
9733
9783
  if (isAgentMode()) {
9734
9784
  const result = await agentFetch("/v1/previews", {
9735
9785
  method: "POST",
9736
- body: { port: portNum }
9786
+ body: { port: portNum, authenticated: options.authenticated ?? false }
9737
9787
  });
9738
9788
  console.log(result.preview.publicUrl);
9739
9789
  } else {
@@ -9775,14 +9825,14 @@ async function previewAddCommand(workspaceId, options) {
9775
9825
  `/v1/workspaces/${workspaceId}/previews`,
9776
9826
  {
9777
9827
  method: "POST",
9778
- body: { port: portNum }
9828
+ body: { port: portNum, authenticated: options.authenticated ?? false }
9779
9829
  }
9780
9830
  );
9781
9831
  console.log(import_chalk16.default.green(`Preview created: ${result.preview.publicUrl}`));
9782
9832
  }
9783
9833
 
9784
9834
  // src/index.ts
9785
- var CLI_VERSION = "0.2.37";
9835
+ var CLI_VERSION = "0.2.39";
9786
9836
  var program = new import_commander.Command();
9787
9837
  program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
9788
9838
  program.command("login").description("Authenticate with your Replicas account").action(async () => {
@@ -10042,9 +10092,12 @@ repos.action(async () => {
10042
10092
  });
10043
10093
  var preview = program.command("preview").description("Manage preview URLs");
10044
10094
  if (isAgentMode()) {
10045
- preview.command("create <port>").description("Register a preview port").action(async (port) => {
10095
+ preview.command("create <port>").description("Register a preview port").option(
10096
+ "-a, --authenticated",
10097
+ "Require cookie authentication for this preview. Use for user-facing frontends (e.g. web apps) where you want only logged-in Replicas users to access the preview. Do not use for backend APIs that are called by frontend code, as the frontend cannot forward the auth cookie."
10098
+ ).action(async (port, options) => {
10046
10099
  try {
10047
- await previewCreateCommand(port);
10100
+ await previewCreateCommand(port, options);
10048
10101
  } catch (error) {
10049
10102
  if (error instanceof Error) {
10050
10103
  console.error(`Error: ${error.message}`);
@@ -10063,7 +10116,10 @@ if (isAgentMode()) {
10063
10116
  }
10064
10117
  });
10065
10118
  } else {
10066
- preview.command("add <workspaceId>").description("Register a preview port for a workspace").requiredOption("-p, --port <port>", "Port number to preview").action(async (workspaceId, options) => {
10119
+ preview.command("add <workspaceId>").description("Register a preview port for a workspace").requiredOption("-p, --port <port>", "Port number to preview").option(
10120
+ "-a, --authenticated",
10121
+ "Require cookie authentication for this preview. Use for user-facing frontends (e.g. web apps) where you want only logged-in Replicas users to access the preview. Do not use for backend APIs that are called by frontend code, as the frontend cannot forward the auth cookie."
10122
+ ).action(async (workspaceId, options) => {
10067
10123
  try {
10068
10124
  await previewAddCommand(workspaceId, options);
10069
10125
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.js",
6
6
  "bin": {