micro-models-agent 0.24.5 → 0.24.7
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 -17
- 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) {
|
|
@@ -26269,26 +26268,14 @@ class Repl {
|
|
|
26269
26268
|
${t("repl.interrupt")}
|
|
26270
26269
|
`));
|
|
26271
26270
|
this.agent.shutdown();
|
|
26272
|
-
setTimeout(() => process.exit(1), 3000);
|
|
26273
26271
|
}
|
|
26274
26272
|
this.lastEscTime = 0;
|
|
26275
26273
|
return;
|
|
26276
26274
|
}
|
|
26277
26275
|
this.lastEscTime = now;
|
|
26278
26276
|
}
|
|
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 {}
|
|
26277
|
+
if (chunk.length === 1 && chunk[0] === 22 && !this.agentRunning) {
|
|
26278
|
+
this.handlePasteImage();
|
|
26292
26279
|
}
|
|
26293
26280
|
});
|
|
26294
26281
|
}
|
|
@@ -26304,6 +26291,20 @@ ${t("image.attached", { source: "clipboard", size: `${sizeKb} KB` })}`));
|
|
|
26304
26291
|
}
|
|
26305
26292
|
});
|
|
26306
26293
|
}
|
|
26294
|
+
async handlePasteImage() {
|
|
26295
|
+
try {
|
|
26296
|
+
const { readClipboardImage: readClipboardImage2, bufferToDataUrl: bufferToDataUrl2 } = await Promise.resolve().then(() => (init_image_utils(), exports_image_utils));
|
|
26297
|
+
const clipBuf = await readClipboardImage2();
|
|
26298
|
+
if (clipBuf) {
|
|
26299
|
+
const { dataUrl } = await bufferToDataUrl2(clipBuf);
|
|
26300
|
+
this.pendingClipboardImage = dataUrl;
|
|
26301
|
+
const sizeKb = Math.round(dataUrl.length * 3 / 4 / 1024);
|
|
26302
|
+
console.log(pc.green(`
|
|
26303
|
+
${t("image.attached", { source: "clipboard", size: `${sizeKb} KB` })}`));
|
|
26304
|
+
this.rl.prompt();
|
|
26305
|
+
}
|
|
26306
|
+
} catch {}
|
|
26307
|
+
}
|
|
26307
26308
|
isMultiLineInput(line) {
|
|
26308
26309
|
if (line.endsWith("\\"))
|
|
26309
26310
|
return true;
|