replicas-engine 0.1.593 → 0.1.595
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/src/index.js +27 -13
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -167,6 +167,8 @@ var EXT_TO_LANGUAGE = {
|
|
|
167
167
|
".ini": "ini",
|
|
168
168
|
".md": "markdown",
|
|
169
169
|
".markdown": "markdown",
|
|
170
|
+
".mmd": "mermaid",
|
|
171
|
+
".mermaid": "mermaid",
|
|
170
172
|
".sql": "sql",
|
|
171
173
|
".sh": "bash",
|
|
172
174
|
".bash": "bash",
|
|
@@ -479,7 +481,7 @@ var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
|
479
481
|
var MAX_CANVAS_FILE_BYTES = 25 * 1024 * 1024;
|
|
480
482
|
var MAX_CANVAS_PREVIEW_BYTES = 5 * 1024 * 1024;
|
|
481
483
|
function isCanvasTextKind(kind) {
|
|
482
|
-
return kind === "markdown" || kind === "html";
|
|
484
|
+
return kind === "markdown" || kind === "mermaid" || kind === "html" || kind === "text";
|
|
483
485
|
}
|
|
484
486
|
function sanitizeCanvasFilename(filename) {
|
|
485
487
|
const safe = filename.split(/[\\/]/).pop() ?? "";
|
|
@@ -509,14 +511,33 @@ function serializeCanvasContentResponse(input) {
|
|
|
509
511
|
var CANVAS_KIND_BY_EXTENSION = {
|
|
510
512
|
".md": { kind: "markdown", mimeType: "text/markdown; charset=utf-8" },
|
|
511
513
|
".markdown": { kind: "markdown", mimeType: "text/markdown; charset=utf-8" },
|
|
514
|
+
".mmd": { kind: "mermaid", mimeType: "text/plain; charset=utf-8" },
|
|
515
|
+
".mermaid": { kind: "mermaid", mimeType: "text/plain; charset=utf-8" },
|
|
512
516
|
".html": { kind: "html", mimeType: "text/html; charset=utf-8" },
|
|
513
517
|
".htm": { kind: "html", mimeType: "text/html; charset=utf-8" },
|
|
518
|
+
".txt": { kind: "text", mimeType: "text/plain; charset=utf-8" },
|
|
519
|
+
".log": { kind: "text", mimeType: "text/plain; charset=utf-8" },
|
|
520
|
+
".csv": { kind: "text", mimeType: "text/csv; charset=utf-8" },
|
|
521
|
+
".tsv": { kind: "text", mimeType: "text/tab-separated-values; charset=utf-8" },
|
|
522
|
+
".json": { kind: "text", mimeType: "application/json; charset=utf-8" },
|
|
523
|
+
".json5": { kind: "text", mimeType: "application/json5; charset=utf-8" },
|
|
524
|
+
".yaml": { kind: "text", mimeType: "application/yaml; charset=utf-8" },
|
|
525
|
+
".yml": { kind: "text", mimeType: "application/yaml; charset=utf-8" },
|
|
526
|
+
".toml": { kind: "text", mimeType: "application/toml; charset=utf-8" },
|
|
527
|
+
".ini": { kind: "text", mimeType: "text/plain; charset=utf-8" },
|
|
528
|
+
".xml": { kind: "text", mimeType: "application/xml; charset=utf-8" },
|
|
514
529
|
".png": { kind: "image", mimeType: "image/png" },
|
|
530
|
+
".apng": { kind: "image", mimeType: "image/apng" },
|
|
531
|
+
".avif": { kind: "image", mimeType: "image/avif" },
|
|
532
|
+
".bmp": { kind: "image", mimeType: "image/bmp" },
|
|
533
|
+
".ico": { kind: "image", mimeType: "image/x-icon" },
|
|
515
534
|
".jpg": { kind: "image", mimeType: "image/jpeg" },
|
|
516
535
|
".jpeg": { kind: "image", mimeType: "image/jpeg" },
|
|
536
|
+
".jfif": { kind: "image", mimeType: "image/jpeg" },
|
|
517
537
|
".gif": { kind: "image", mimeType: "image/gif" },
|
|
518
538
|
".webp": { kind: "image", mimeType: "image/webp" },
|
|
519
539
|
".svg": { kind: "image", mimeType: "image/svg+xml" },
|
|
540
|
+
".pdf": { kind: "pdf", mimeType: "application/pdf" },
|
|
520
541
|
".mp4": { kind: "video", mimeType: "video/mp4" },
|
|
521
542
|
".webm": { kind: "video", mimeType: "video/webm" },
|
|
522
543
|
".mov": { kind: "video", mimeType: "video/quicktime" },
|
|
@@ -11047,7 +11068,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
11047
11068
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
11048
11069
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
11049
11070
|
var codexCliVersionEnsured = null;
|
|
11050
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
11071
|
+
var ENGINE_PACKAGE_VERSION = "0.1.595";
|
|
11051
11072
|
var INITIALIZE_METHOD = "initialize";
|
|
11052
11073
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
11053
11074
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -17082,14 +17103,6 @@ var EXCLUDED_DIRS = /* @__PURE__ */ new Set([".git", "node_modules", ".next", "d
|
|
|
17082
17103
|
function isBinaryExtension(filePath) {
|
|
17083
17104
|
const ext = extname2(filePath).toLowerCase();
|
|
17084
17105
|
const binaryExts = /* @__PURE__ */ new Set([
|
|
17085
|
-
".png",
|
|
17086
|
-
".jpg",
|
|
17087
|
-
".jpeg",
|
|
17088
|
-
".gif",
|
|
17089
|
-
".bmp",
|
|
17090
|
-
".ico",
|
|
17091
|
-
".webp",
|
|
17092
|
-
".svg",
|
|
17093
17106
|
".woff",
|
|
17094
17107
|
".woff2",
|
|
17095
17108
|
".ttf",
|
|
@@ -17122,7 +17135,7 @@ function isBinaryExtension(filePath) {
|
|
|
17122
17135
|
".db",
|
|
17123
17136
|
".lock"
|
|
17124
17137
|
]);
|
|
17125
|
-
return binaryExts.has(ext);
|
|
17138
|
+
return classifyCanvasFilename(filePath).kind === "image" || binaryExts.has(ext);
|
|
17126
17139
|
}
|
|
17127
17140
|
function isExcludedPath(filePath) {
|
|
17128
17141
|
const segments = filePath.split("/");
|
|
@@ -17241,8 +17254,9 @@ var RepoFileService = class {
|
|
|
17241
17254
|
const sizeBytes = fileStat.size;
|
|
17242
17255
|
if (isBinaryExtension(filePath)) {
|
|
17243
17256
|
const { kind, mimeType } = classifyCanvasFilename(filePath);
|
|
17244
|
-
if (kind === "image") {
|
|
17245
|
-
|
|
17257
|
+
if (kind === "image" || kind === "pdf") {
|
|
17258
|
+
const maxPreviewBytes = kind === "image" ? MAX_CANVAS_FILE_BYTES : MAX_CANVAS_PREVIEW_BYTES;
|
|
17259
|
+
if (sizeBytes > maxPreviewBytes) {
|
|
17246
17260
|
return {
|
|
17247
17261
|
repoName,
|
|
17248
17262
|
path: filePath,
|