replicas-cli 0.2.223 → 0.2.225
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 +32 -14
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8933,7 +8933,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
8933
8933
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
8934
8934
|
|
|
8935
8935
|
// ../shared/src/cli-version.ts
|
|
8936
|
-
var CLI_VERSION = "0.2.
|
|
8936
|
+
var CLI_VERSION = "0.2.225";
|
|
8937
8937
|
|
|
8938
8938
|
// ../shared/src/engine/environment.ts
|
|
8939
8939
|
var DESKTOP_NOVNC_PORT = 6080;
|
|
@@ -8991,6 +8991,29 @@ var MODEL_LABELS = {
|
|
|
8991
8991
|
"gpt-5-codex": "GPT-5 Codex",
|
|
8992
8992
|
"gpt-5": "GPT-5"
|
|
8993
8993
|
};
|
|
8994
|
+
var CANVAS_KIND_BY_EXTENSION = {
|
|
8995
|
+
".md": { kind: "markdown", mimeType: "text/markdown; charset=utf-8" },
|
|
8996
|
+
".markdown": { kind: "markdown", mimeType: "text/markdown; charset=utf-8" },
|
|
8997
|
+
".html": { kind: "html", mimeType: "text/html; charset=utf-8" },
|
|
8998
|
+
".htm": { kind: "html", mimeType: "text/html; charset=utf-8" },
|
|
8999
|
+
".png": { kind: "image", mimeType: "image/png" },
|
|
9000
|
+
".jpg": { kind: "image", mimeType: "image/jpeg" },
|
|
9001
|
+
".jpeg": { kind: "image", mimeType: "image/jpeg" },
|
|
9002
|
+
".gif": { kind: "image", mimeType: "image/gif" },
|
|
9003
|
+
".webp": { kind: "image", mimeType: "image/webp" },
|
|
9004
|
+
".svg": { kind: "image", mimeType: "image/svg+xml" },
|
|
9005
|
+
".mp4": { kind: "video", mimeType: "video/mp4" },
|
|
9006
|
+
".webm": { kind: "video", mimeType: "video/webm" },
|
|
9007
|
+
".mov": { kind: "video", mimeType: "video/quicktime" },
|
|
9008
|
+
".mp3": { kind: "audio", mimeType: "audio/mpeg" },
|
|
9009
|
+
".wav": { kind: "audio", mimeType: "audio/wav" },
|
|
9010
|
+
".ogg": { kind: "audio", mimeType: "audio/ogg" }
|
|
9011
|
+
};
|
|
9012
|
+
function classifyCanvasFilename(filename) {
|
|
9013
|
+
const idx = filename.lastIndexOf(".");
|
|
9014
|
+
const ext = idx === -1 ? "" : filename.slice(idx).toLowerCase();
|
|
9015
|
+
return CANVAS_KIND_BY_EXTENSION[ext] ?? { kind: "other", mimeType: "application/octet-stream" };
|
|
9016
|
+
}
|
|
8994
9017
|
|
|
8995
9018
|
// ../shared/src/engine/v1.ts
|
|
8996
9019
|
var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
|
|
@@ -9015,6 +9038,7 @@ function workspaceConfigWithPrFollowups(config2, prFollowups = config2?.capabili
|
|
|
9015
9038
|
var WORKSPACE_FILE_UPLOAD_MAX_SIZE_BYTES = 20 * 1024 * 1024;
|
|
9016
9039
|
var WORKSPACE_FILE_CONTENT_MAX_SIZE_BYTES = 1 * 1024 * 1024;
|
|
9017
9040
|
var WORKSPACE_SIDEBAR_VIEWS = ["owned", "shared", "team", "automation", "integrations", "api"];
|
|
9041
|
+
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
9018
9042
|
|
|
9019
9043
|
// ../shared/src/audit-log.ts
|
|
9020
9044
|
var AUDIT_LOG_ACTION = {
|
|
@@ -13000,17 +13024,11 @@ async function previewRemoveCommand(workspaceId, options) {
|
|
|
13000
13024
|
import fs4 from "fs";
|
|
13001
13025
|
import path5 from "path";
|
|
13002
13026
|
var MONOLITH_URL4 = process.env.MONOLITH_URL || process.env.REPLICAS_MONOLITH_URL || "https://api.tryreplicas.com";
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
svg: { kind: MEDIA_KIND.IMAGE, contentType: "image/svg+xml" },
|
|
13009
|
-
mp4: { kind: MEDIA_KIND.VIDEO, contentType: "video/mp4" },
|
|
13010
|
-
webm: { kind: MEDIA_KIND.VIDEO, contentType: "video/webm" },
|
|
13011
|
-
mp3: { kind: MEDIA_KIND.AUDIO, contentType: "audio/mpeg" },
|
|
13012
|
-
wav: { kind: MEDIA_KIND.AUDIO, contentType: "audio/wav" }
|
|
13013
|
-
};
|
|
13027
|
+
function mediaInfo(ext) {
|
|
13028
|
+
const { kind, mimeType } = classifyCanvasFilename(`.${ext}`);
|
|
13029
|
+
if (kind !== "image" && kind !== "video" && kind !== "audio") return void 0;
|
|
13030
|
+
return { kind, contentType: mimeType };
|
|
13031
|
+
}
|
|
13014
13032
|
function resolveKind(ext, override) {
|
|
13015
13033
|
if (override) {
|
|
13016
13034
|
if (!MEDIA_KINDS.includes(override)) {
|
|
@@ -13018,7 +13036,7 @@ function resolveKind(ext, override) {
|
|
|
13018
13036
|
}
|
|
13019
13037
|
return override;
|
|
13020
13038
|
}
|
|
13021
|
-
const inferred =
|
|
13039
|
+
const inferred = mediaInfo(ext)?.kind;
|
|
13022
13040
|
if (!inferred) {
|
|
13023
13041
|
throw new Error(`Cannot infer kind from extension '.${ext}'. Pass --kind explicitly.`);
|
|
13024
13042
|
}
|
|
@@ -13039,7 +13057,7 @@ async function uploadOne(filePath, options) {
|
|
|
13039
13057
|
const fileName = path5.basename(absPath);
|
|
13040
13058
|
const ext = path5.extname(absPath).slice(1).toLowerCase();
|
|
13041
13059
|
const kind = resolveKind(ext, options.kind);
|
|
13042
|
-
const contentType =
|
|
13060
|
+
const contentType = mediaInfo(ext)?.contentType ?? "application/octet-stream";
|
|
13043
13061
|
const form = new FormData();
|
|
13044
13062
|
form.append("file", new Blob([fs4.readFileSync(absPath)], { type: contentType }), fileName);
|
|
13045
13063
|
form.append("kind", kind);
|