misoai-web 1.5.9 → 1.6.0
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/es/agent.js +56 -7
- package/dist/es/agent.js.map +1 -1
- package/dist/es/bridge-mode-browser.js +3 -3
- package/dist/es/bridge-mode.js +58 -9
- package/dist/es/bridge-mode.js.map +1 -1
- package/dist/es/chrome-extension.js +57 -8
- package/dist/es/chrome-extension.js.map +1 -1
- package/dist/es/index.js +56 -7
- package/dist/es/index.js.map +1 -1
- package/dist/es/midscene-playground.js +56 -7
- package/dist/es/midscene-playground.js.map +1 -1
- package/dist/es/playground.js +56 -7
- package/dist/es/playground.js.map +1 -1
- package/dist/es/playwright.js +56 -7
- package/dist/es/playwright.js.map +1 -1
- package/dist/es/puppeteer-agent-launcher.js +56 -7
- package/dist/es/puppeteer-agent-launcher.js.map +1 -1
- package/dist/es/puppeteer.js +56 -7
- package/dist/es/puppeteer.js.map +1 -1
- package/dist/lib/agent.js +56 -7
- package/dist/lib/agent.js.map +1 -1
- package/dist/lib/bridge-mode-browser.js +3 -3
- package/dist/lib/bridge-mode.js +58 -9
- package/dist/lib/bridge-mode.js.map +1 -1
- package/dist/lib/chrome-extension.js +57 -8
- package/dist/lib/chrome-extension.js.map +1 -1
- package/dist/lib/index.js +56 -7
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/midscene-playground.js +56 -7
- package/dist/lib/midscene-playground.js.map +1 -1
- package/dist/lib/playground.js +56 -7
- package/dist/lib/playground.js.map +1 -1
- package/dist/lib/playwright.js +56 -7
- package/dist/lib/playwright.js.map +1 -1
- package/dist/lib/puppeteer-agent-launcher.js +56 -7
- package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
- package/dist/lib/puppeteer.js +56 -7
- package/dist/lib/puppeteer.js.map +1 -1
- package/dist/types/agent.d.ts +8 -1
- package/package.json +1 -1
@@ -1850,9 +1850,15 @@ var PageTaskExecutor = class {
|
|
1850
1850
|
}
|
1851
1851
|
async waitFor(assertion, opt) {
|
1852
1852
|
const description = `waitFor: ${assertion}`;
|
1853
|
-
const
|
1854
|
-
|
1855
|
-
|
1853
|
+
const useMemory = true;
|
1854
|
+
let taskExecutor;
|
1855
|
+
if (useMemory) {
|
1856
|
+
taskExecutor = this.getPersistentExecutor();
|
1857
|
+
} else {
|
1858
|
+
taskExecutor = new Executor(taskTitleStr("WaitFor", description), {
|
1859
|
+
onTaskStart: this.onTaskStartCallback
|
1860
|
+
});
|
1861
|
+
}
|
1856
1862
|
const { timeoutMs, checkIntervalMs } = opt;
|
1857
1863
|
assert4(assertion, "No assertion for waitFor");
|
1858
1864
|
assert4(timeoutMs, "No timeoutMs for waitFor");
|
@@ -1907,6 +1913,20 @@ var PageTaskExecutor = class {
|
|
1907
1913
|
`waitFor timeout: ${errorThought}`
|
1908
1914
|
);
|
1909
1915
|
}
|
1916
|
+
/**
|
1917
|
+
* Hafızaya yeni bir öğe ekler
|
1918
|
+
*/
|
1919
|
+
addToMemory(memoryItem) {
|
1920
|
+
if (!this.persistentExecutor || this.persistentExecutor.status === "error") {
|
1921
|
+
const previousMemory = this.workflowMemory.getWorkflowMemory(this.sessionContext.workflowId);
|
1922
|
+
this.persistentExecutor = new Executor("Persistent Task Executor", {
|
1923
|
+
onTaskStart: this.onTaskStartCallback,
|
1924
|
+
initialMemory: previousMemory
|
1925
|
+
});
|
1926
|
+
}
|
1927
|
+
this.persistentExecutor.memoryStore?.add(memoryItem);
|
1928
|
+
this.persistentExecutor.memoryAnalytics?.recordMemoryOperation("add", memoryItem);
|
1929
|
+
}
|
1910
1930
|
};
|
1911
1931
|
|
1912
1932
|
// src/common/plan-builder.ts
|
@@ -2001,7 +2021,7 @@ import yaml3 from "js-yaml";
|
|
2001
2021
|
import semver from "semver";
|
2002
2022
|
|
2003
2023
|
// package.json
|
2004
|
-
var version = "1.
|
2024
|
+
var version = "1.6.0";
|
2005
2025
|
|
2006
2026
|
// src/common/task-cache.ts
|
2007
2027
|
var debug3 = getDebug3("cache");
|
@@ -2212,7 +2232,10 @@ var PageAgent = class {
|
|
2212
2232
|
}
|
2213
2233
|
this.taskExecutor = new PageTaskExecutor(this.page, this.insight, {
|
2214
2234
|
taskCache: this.taskCache,
|
2215
|
-
onTaskStart: this.callbackOnTaskStartTip.bind(this)
|
2235
|
+
onTaskStart: this.callbackOnTaskStartTip.bind(this),
|
2236
|
+
memoryConfig: opts?.memoryConfig,
|
2237
|
+
sessionId: opts?.sessionId,
|
2238
|
+
workflowId: opts?.workflowId
|
2216
2239
|
});
|
2217
2240
|
this.dump = this.resetDump();
|
2218
2241
|
this.reportFileName = reportFileName(
|
@@ -2663,6 +2686,7 @@ ${reasonMsg}`);
|
|
2663
2686
|
}
|
2664
2687
|
async aiCaptcha(options) {
|
2665
2688
|
const { deepThink = false, autoDetectComplexity = true } = options || {};
|
2689
|
+
const memoryContext = this.getMemoryAsContext();
|
2666
2690
|
let shouldUseDeepThink = deepThink;
|
2667
2691
|
if (autoDetectComplexity && !deepThink) {
|
2668
2692
|
const context = await this.getUIContext();
|
@@ -2743,6 +2767,26 @@ Return only "complex" or "simple" based on your analysis.
|
|
2743
2767
|
}
|
2744
2768
|
}
|
2745
2769
|
await new Promise((resolve2) => setTimeout(resolve2, 3e3));
|
2770
|
+
const captchaMemoryItem = {
|
2771
|
+
id: `captcha_${Date.now()}`,
|
2772
|
+
timestamp: Date.now(),
|
2773
|
+
taskType: "Action",
|
2774
|
+
summary: `Solved ${captchaResult.captchaType} CAPTCHA: ${captchaResult.thought}`,
|
2775
|
+
context: {
|
2776
|
+
url: await this.page.url?.() || "",
|
2777
|
+
captchaType: captchaResult.captchaType,
|
2778
|
+
actions: captchaResult.actions,
|
2779
|
+
deepThink: actualDeepThink
|
2780
|
+
},
|
2781
|
+
metadata: {
|
2782
|
+
executionTime: Date.now() - Date.now(),
|
2783
|
+
// Will be updated
|
2784
|
+
success: true,
|
2785
|
+
confidence: 0.9
|
2786
|
+
},
|
2787
|
+
tags: ["captcha", "action", captchaResult.captchaType]
|
2788
|
+
};
|
2789
|
+
this.taskExecutor.addToMemory(captchaMemoryItem);
|
2746
2790
|
const metadata = {
|
2747
2791
|
status: "finished",
|
2748
2792
|
usage,
|
@@ -2759,10 +2803,15 @@ Return only "complex" or "simple" based on your analysis.
|
|
2759
2803
|
}
|
2760
2804
|
async aiWaitFor(assertion, opt) {
|
2761
2805
|
const startTime = Date.now();
|
2762
|
-
const
|
2806
|
+
const memoryContext = this.getMemoryAsContext();
|
2807
|
+
const assertionWithContext = memoryContext ? `${assertion}
|
2808
|
+
|
2809
|
+
Previous workflow steps:
|
2810
|
+
${memoryContext}` : assertion;
|
2811
|
+
const { executor } = await this.taskExecutor.waitFor(assertionWithContext, {
|
2763
2812
|
timeoutMs: opt?.timeoutMs || 15 * 1e3,
|
2764
2813
|
checkIntervalMs: opt?.checkIntervalMs || 3 * 1e3,
|
2765
|
-
assertion
|
2814
|
+
assertion: assertionWithContext
|
2766
2815
|
});
|
2767
2816
|
const metadata = {
|
2768
2817
|
status: executor.isInErrorState() ? "failed" : "finished",
|
@@ -3240,7 +3289,7 @@ function sleep2(ms) {
|
|
3240
3289
|
var ChromeExtensionProxyPage = class {
|
3241
3290
|
constructor(forceSameTabNavigation) {
|
3242
3291
|
this.pageType = "chrome-extension-proxy";
|
3243
|
-
this.version = "1.
|
3292
|
+
this.version = "1.6.0";
|
3244
3293
|
this.activeTabId = null;
|
3245
3294
|
this.tabIdOfDebuggerAttached = null;
|
3246
3295
|
this.attachingDebugger = null;
|