testdriverai 4.0.55 → 4.0.56
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/index.js +10 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -464,11 +464,12 @@ const humanInput = async (currentTask, validateAndLoop = false) => {
|
|
|
464
464
|
await save({ silent: true });
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
const generate = async (type) => {
|
|
467
|
+
const generate = async (type, count) => {
|
|
468
468
|
log.log("debug", "generate called", type);
|
|
469
469
|
|
|
470
470
|
speak("thinking...");
|
|
471
471
|
notify("thinking...");
|
|
472
|
+
|
|
472
473
|
log.log("info", chalk.dim("thinking..."), true);
|
|
473
474
|
|
|
474
475
|
log.log("info", "");
|
|
@@ -477,6 +478,9 @@ const generate = async (type) => {
|
|
|
477
478
|
let message = await sdk.req("generate", {
|
|
478
479
|
type,
|
|
479
480
|
image,
|
|
481
|
+
mousePosition: await system.getMousePosition(),
|
|
482
|
+
activeWindow: await system.activeWin(),
|
|
483
|
+
count
|
|
480
484
|
});
|
|
481
485
|
|
|
482
486
|
log.prettyMarkdown(message);
|
|
@@ -493,10 +497,12 @@ const generate = async (type) => {
|
|
|
493
497
|
.replace(/ /g, "-")
|
|
494
498
|
.toLowerCase() + ".md";
|
|
495
499
|
let path1 = path.join(process.cwd(), "testdriver", "generate", fileName);
|
|
500
|
+
|
|
496
501
|
// create generate directory if it doesn't exist
|
|
497
502
|
if (!fs.existsSync(path.join(process.cwd(), "testdriver", "generate"))) {
|
|
498
503
|
fs.mkdirSync(path.join(process.cwd(), "testdriver", "generate"));
|
|
499
504
|
}
|
|
505
|
+
|
|
500
506
|
let list = testPrompt.listsOrdered[0];
|
|
501
507
|
|
|
502
508
|
let contents = list
|
|
@@ -504,6 +510,8 @@ const generate = async (type) => {
|
|
|
504
510
|
.join("\n");
|
|
505
511
|
fs.writeFileSync(path1, contents);
|
|
506
512
|
}
|
|
513
|
+
|
|
514
|
+
exit(false);
|
|
507
515
|
};
|
|
508
516
|
|
|
509
517
|
const popFromHistory = async (fullStep) => {
|
|
@@ -620,7 +628,7 @@ const firstPrompt = async () => {
|
|
|
620
628
|
} else if (input.indexOf("/run") == 0) {
|
|
621
629
|
await run(commands[1], commands[2]);
|
|
622
630
|
} else if (input.indexOf("/generate") == 0) {
|
|
623
|
-
await generate(commands[1]);
|
|
631
|
+
await generate(commands[1], commands[2]);
|
|
624
632
|
} else {
|
|
625
633
|
await humanInput(input, false);
|
|
626
634
|
}
|