replicas-cli 0.2.166 → 0.2.168
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.
- package/dist/index.mjs +18 -9
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8071,10 +8071,14 @@ var SANDBOX_PATHS = {
|
|
|
8071
8071
|
|
|
8072
8072
|
// ../shared/src/urls.ts
|
|
8073
8073
|
function getWorkspaceDashboardUrl(workspaceId, options = {}) {
|
|
8074
|
-
const { encodeWorkspaceId = true, mode } = options;
|
|
8074
|
+
const { encodeWorkspaceId = true, mode, mediaId } = options;
|
|
8075
8075
|
const workspaceIdValue = encodeWorkspaceId ? encodeURIComponent(workspaceId) : workspaceId;
|
|
8076
|
-
const
|
|
8077
|
-
|
|
8076
|
+
const effectiveMode = mediaId ? mode ?? "media" : mode;
|
|
8077
|
+
const params = [];
|
|
8078
|
+
if (effectiveMode) params.push(`mode=${encodeURIComponent(effectiveMode)}`);
|
|
8079
|
+
if (mediaId) params.push(`media=${encodeURIComponent(mediaId)}`);
|
|
8080
|
+
const query = params.length > 0 ? `?${params.join("&")}` : "";
|
|
8081
|
+
return `https://tryreplicas.com/workspaces/${workspaceIdValue}${query}`;
|
|
8078
8082
|
}
|
|
8079
8083
|
var PR_URL_REGEX = /github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/;
|
|
8080
8084
|
function parsePrUrl(url) {
|
|
@@ -11320,20 +11324,25 @@ async function mediaUploadCommand(filePaths, options) {
|
|
|
11320
11324
|
throw new Error(`Invalid kind '${options.kind}'. Must be one of: ${MEDIA_KINDS.join(", ")}`);
|
|
11321
11325
|
}
|
|
11322
11326
|
const results = await Promise.allSettled(filePaths.map((p) => uploadOne(p, options)));
|
|
11327
|
+
const config2 = readAgentConfig();
|
|
11323
11328
|
const failures = [];
|
|
11324
11329
|
for (let i = 0; i < results.length; i++) {
|
|
11325
11330
|
const result = results[i];
|
|
11326
11331
|
if (result.status === "fulfilled") {
|
|
11327
|
-
|
|
11332
|
+
const { fileName, media } = result.value;
|
|
11333
|
+
console.log(``);
|
|
11334
|
+
if (config2?.workspace_id) {
|
|
11335
|
+
const deepLink = getWorkspaceDashboardUrl(config2.workspace_id, {
|
|
11336
|
+
mode: "media",
|
|
11337
|
+
mediaId: media.id
|
|
11338
|
+
});
|
|
11339
|
+
console.log(`View in Replicas: ${deepLink}`);
|
|
11340
|
+
}
|
|
11328
11341
|
} else {
|
|
11329
11342
|
const error = result.reason instanceof Error ? result.reason : new Error(String(result.reason));
|
|
11330
11343
|
failures.push({ filePath: filePaths[i], error });
|
|
11331
11344
|
}
|
|
11332
11345
|
}
|
|
11333
|
-
const config2 = readAgentConfig();
|
|
11334
|
-
if (config2?.workspace_id && failures.length < filePaths.length) {
|
|
11335
|
-
console.log(`View in Replicas: ${getWorkspaceDashboardUrl(config2.workspace_id, { mode: "media" })}`);
|
|
11336
|
-
}
|
|
11337
11346
|
if (failures.length > 0) {
|
|
11338
11347
|
const detail = failures.map((f) => `${f.filePath}: ${f.error.message}`).join("; ");
|
|
11339
11348
|
throw new Error(`${failures.length} of ${filePaths.length} upload(s) failed \u2014 ${detail}`);
|
|
@@ -14859,7 +14868,7 @@ Deleted file ${pathOrId}.
|
|
|
14859
14868
|
}
|
|
14860
14869
|
|
|
14861
14870
|
// src/index.ts
|
|
14862
|
-
var CLI_VERSION = "0.2.
|
|
14871
|
+
var CLI_VERSION = "0.2.168";
|
|
14863
14872
|
var program = new Command();
|
|
14864
14873
|
program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
|
|
14865
14874
|
program.command("login").description("Authenticate with your Replicas account").action(async () => {
|