micro-models-agent 0.24.5 → 0.24.6
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/main.js +18 -16
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -26259,9 +26259,8 @@ class Repl {
|
|
|
26259
26259
|
this.running = false;
|
|
26260
26260
|
});
|
|
26261
26261
|
if (process.stdin.isTTY) {
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
if (key.name === "escape") {
|
|
26262
|
+
process.stdin.on("data", (chunk) => {
|
|
26263
|
+
if (chunk.length === 1 && chunk[0] === 27) {
|
|
26265
26264
|
const now = Date.now();
|
|
26266
26265
|
if (now - this.lastEscTime < this.doubleEscDelay) {
|
|
26267
26266
|
if (this.agentRunning) {
|
|
@@ -26276,19 +26275,8 @@ ${t("repl.interrupt")}
|
|
|
26276
26275
|
}
|
|
26277
26276
|
this.lastEscTime = now;
|
|
26278
26277
|
}
|
|
26279
|
-
if (
|
|
26280
|
-
|
|
26281
|
-
const { readClipboardImage: readClipboardImage2, bufferToDataUrl: bufferToDataUrl2 } = await Promise.resolve().then(() => (init_image_utils(), exports_image_utils));
|
|
26282
|
-
const clipBuf = await readClipboardImage2();
|
|
26283
|
-
if (clipBuf) {
|
|
26284
|
-
const { dataUrl } = await bufferToDataUrl2(clipBuf);
|
|
26285
|
-
this.pendingClipboardImage = dataUrl;
|
|
26286
|
-
const sizeKb = Math.round(dataUrl.length * 3 / 4 / 1024);
|
|
26287
|
-
console.log(pc.green(`
|
|
26288
|
-
${t("image.attached", { source: "clipboard", size: `${sizeKb} KB` })}`));
|
|
26289
|
-
this.rl.prompt();
|
|
26290
|
-
}
|
|
26291
|
-
} catch {}
|
|
26278
|
+
if (chunk.length === 1 && chunk[0] === 22 && !this.agentRunning) {
|
|
26279
|
+
this.handlePasteImage();
|
|
26292
26280
|
}
|
|
26293
26281
|
});
|
|
26294
26282
|
}
|
|
@@ -26304,6 +26292,20 @@ ${t("image.attached", { source: "clipboard", size: `${sizeKb} KB` })}`));
|
|
|
26304
26292
|
}
|
|
26305
26293
|
});
|
|
26306
26294
|
}
|
|
26295
|
+
async handlePasteImage() {
|
|
26296
|
+
try {
|
|
26297
|
+
const { readClipboardImage: readClipboardImage2, bufferToDataUrl: bufferToDataUrl2 } = await Promise.resolve().then(() => (init_image_utils(), exports_image_utils));
|
|
26298
|
+
const clipBuf = await readClipboardImage2();
|
|
26299
|
+
if (clipBuf) {
|
|
26300
|
+
const { dataUrl } = await bufferToDataUrl2(clipBuf);
|
|
26301
|
+
this.pendingClipboardImage = dataUrl;
|
|
26302
|
+
const sizeKb = Math.round(dataUrl.length * 3 / 4 / 1024);
|
|
26303
|
+
console.log(pc.green(`
|
|
26304
|
+
${t("image.attached", { source: "clipboard", size: `${sizeKb} KB` })}`));
|
|
26305
|
+
this.rl.prompt();
|
|
26306
|
+
}
|
|
26307
|
+
} catch {}
|
|
26308
|
+
}
|
|
26307
26309
|
isMultiLineInput(line) {
|
|
26308
26310
|
if (line.endsWith("\\"))
|
|
26309
26311
|
return true;
|