replicas-cli 0.2.125 → 0.2.127

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.
@@ -7499,7 +7499,7 @@ function getWorkspaceDashboardUrl(workspaceId, options = {}) {
7499
7499
  const { encodeWorkspaceId = true, mode } = options;
7500
7500
  const workspaceIdValue = encodeWorkspaceId ? encodeURIComponent(workspaceId) : workspaceId;
7501
7501
  const modeParam = mode ? `?mode=${encodeURIComponent(mode)}` : "";
7502
- return `https://www.replicas.dev/dashboard/workspaces/${workspaceIdValue}${modeParam}`;
7502
+ return `https://www.replicas.dev/workspaces/${workspaceIdValue}${modeParam}`;
7503
7503
  }
7504
7504
  var PR_URL_REGEX = /github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/;
7505
7505
  function parsePrUrl(url) {
package/dist/index.mjs CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  setIdeCommand,
20
20
  setOrganizationId,
21
21
  writeConfig
22
- } from "./chunk-OGHREKYJ.mjs";
22
+ } from "./chunk-KTD7UV5U.mjs";
23
23
  import "./chunk-FFDYI4OH.mjs";
24
24
 
25
25
  // src/index.ts
@@ -2440,7 +2440,7 @@ function resolveKind(ext, override) {
2440
2440
  }
2441
2441
  return inferred;
2442
2442
  }
2443
- async function mediaUploadCommand(filePath, options) {
2443
+ async function uploadOne(filePath, options) {
2444
2444
  const absPath = path4.resolve(filePath);
2445
2445
  if (!fs3.existsSync(absPath)) {
2446
2446
  throw new Error(`File not found: ${absPath}`);
@@ -2464,11 +2464,34 @@ async function mediaUploadCommand(filePath, options) {
2464
2464
  method: "POST",
2465
2465
  body: form
2466
2466
  });
2467
- console.log(`![${fileName}](${MONOLITH_URL4}/v1/media/${media.id})`);
2467
+ return { fileName, media };
2468
+ }
2469
+ async function mediaUploadCommand(filePaths, options) {
2470
+ if (filePaths.length === 0) {
2471
+ throw new Error("No files specified");
2472
+ }
2473
+ if (options.kind && !MEDIA_KINDS.includes(options.kind)) {
2474
+ throw new Error(`Invalid kind '${options.kind}'. Must be one of: ${MEDIA_KINDS.join(", ")}`);
2475
+ }
2476
+ const results = await Promise.allSettled(filePaths.map((p) => uploadOne(p, options)));
2477
+ const failures = [];
2478
+ for (let i = 0; i < results.length; i++) {
2479
+ const result = results[i];
2480
+ if (result.status === "fulfilled") {
2481
+ console.log(`![${result.value.fileName}](${MONOLITH_URL4}/v1/media/${result.value.media.id})`);
2482
+ } else {
2483
+ const error = result.reason instanceof Error ? result.reason : new Error(String(result.reason));
2484
+ failures.push({ filePath: filePaths[i], error });
2485
+ }
2486
+ }
2468
2487
  const config2 = readAgentConfig();
2469
- if (config2?.workspace_id) {
2488
+ if (config2?.workspace_id && failures.length < filePaths.length) {
2470
2489
  console.log(`View in Replicas: ${getWorkspaceDashboardUrl(config2.workspace_id, { mode: "media" })}`);
2471
2490
  }
2491
+ if (failures.length > 0) {
2492
+ const detail = failures.map((f) => `${f.filePath}: ${f.error.message}`).join("; ");
2493
+ throw new Error(`${failures.length} of ${filePaths.length} upload(s) failed \u2014 ${detail}`);
2494
+ }
2472
2495
  }
2473
2496
  async function mediaListCommand(options) {
2474
2497
  const qs = new URLSearchParams();
@@ -2497,12 +2520,12 @@ async function interactiveCommand() {
2497
2520
  );
2498
2521
  }
2499
2522
  console.log(chalk18.gray("Starting interactive mode..."));
2500
- const { launchInteractive } = await import("./interactive-6X7GW7BA.mjs");
2523
+ const { launchInteractive } = await import("./interactive-7EFXQGUC.mjs");
2501
2524
  await launchInteractive();
2502
2525
  }
2503
2526
 
2504
2527
  // src/index.ts
2505
- var CLI_VERSION = "0.2.125";
2528
+ var CLI_VERSION = "0.2.127";
2506
2529
  var program = new Command();
2507
2530
  program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
2508
2531
  program.command("login").description("Authenticate with your Replicas account").action(async () => {
@@ -2916,9 +2939,9 @@ if (isAgentMode()) {
2916
2939
  }
2917
2940
  if (isAgentMode()) {
2918
2941
  const media = program.command("media").description("Share workspace media (screenshots, videos, audio) inline in chat");
2919
- media.command("upload <file>").description("Upload a screenshot, video, or audio file. Prints a markdown embed for the assistant reply.").option("-k, --kind <kind>", "Media kind: image, video, or audio (inferred from extension if omitted)").option("-s, --session-id <id>", "Session ID to associate the asset with").action(async (file, options) => {
2942
+ media.command("upload <files...>").description("Upload one or more screenshot, video, or audio files. Multiple files are uploaded concurrently. Prints a markdown embed per file for the assistant reply.").option("-k, --kind <kind>", "Media kind: image, video, or audio (inferred from extension if omitted)").option("-s, --session-id <id>", "Session ID to associate the asset with").action(async (files, options) => {
2920
2943
  try {
2921
- await mediaUploadCommand(file, options);
2944
+ await mediaUploadCommand(files, options);
2922
2945
  } catch (error) {
2923
2946
  if (error instanceof Error) {
2924
2947
  console.error(chalk19.red(`
@@ -12,7 +12,7 @@ import {
12
12
  isAgentBackendEvent,
13
13
  parseAgentEvents,
14
14
  parseUserMessage
15
- } from "./chunk-OGHREKYJ.mjs";
15
+ } from "./chunk-KTD7UV5U.mjs";
16
16
  import "./chunk-FFDYI4OH.mjs";
17
17
 
18
18
  // src/interactive/index.tsx
@@ -2202,7 +2202,7 @@ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, a
2202
2202
  if (!item) return;
2203
2203
  switch (item.type) {
2204
2204
  case "dashboard":
2205
- open(`${WEB_APP_URL}/dashboard/workspaces/${item.workspaceId}`).catch(() => {
2205
+ open(`${WEB_APP_URL}/workspaces/${item.workspaceId}`).catch(() => {
2206
2206
  });
2207
2207
  break;
2208
2208
  case "wake":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.125",
3
+ "version": "0.2.127",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.mjs",
6
6
  "bin": {