misoai-web 1.5.7 → 1.5.9
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 +410 -25
- package/dist/es/agent.js.map +1 -1
- package/dist/es/bridge-mode-browser.js +3 -3
- package/dist/es/bridge-mode.js +412 -27
- package/dist/es/bridge-mode.js.map +1 -1
- package/dist/es/chrome-extension.js +411 -26
- package/dist/es/chrome-extension.js.map +1 -1
- package/dist/es/index.js +410 -25
- package/dist/es/index.js.map +1 -1
- package/dist/es/midscene-playground.js +410 -25
- package/dist/es/midscene-playground.js.map +1 -1
- package/dist/es/playground.js +410 -25
- package/dist/es/playground.js.map +1 -1
- package/dist/es/playwright.js +410 -25
- package/dist/es/playwright.js.map +1 -1
- package/dist/es/puppeteer-agent-launcher.js +410 -25
- package/dist/es/puppeteer-agent-launcher.js.map +1 -1
- package/dist/es/puppeteer.js +410 -25
- package/dist/es/puppeteer.js.map +1 -1
- package/dist/lib/agent.js +410 -25
- package/dist/lib/agent.js.map +1 -1
- package/dist/lib/bridge-mode-browser.js +3 -3
- package/dist/lib/bridge-mode.js +412 -27
- package/dist/lib/bridge-mode.js.map +1 -1
- package/dist/lib/chrome-extension.js +411 -26
- package/dist/lib/chrome-extension.js.map +1 -1
- package/dist/lib/index.js +410 -25
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/midscene-playground.js +410 -25
- package/dist/lib/midscene-playground.js.map +1 -1
- package/dist/lib/playground.js +410 -25
- package/dist/lib/playground.js.map +1 -1
- package/dist/lib/playwright.js +410 -25
- package/dist/lib/playwright.js.map +1 -1
- package/dist/lib/puppeteer-agent-launcher.js +410 -25
- package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
- package/dist/lib/puppeteer.js +410 -25
- package/dist/lib/puppeteer.js.map +1 -1
- package/dist/types/agent.d.ts +107 -2
- package/package.json +2 -2
package/dist/types/agent.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { W as WebPage, e as WebElementInfo, f as WebUIContext } from './page-ed0ecb44.js';
|
2
|
-
import { Insight, ExecutionTaskProgressOptions, PlanningAction, ExecutionTaskApply, Executor, MidsceneYamlFlowItem, InsightExtractParam, InsightExtractOption, InsightAssertionResponse, PlanningActionParamWaitFor, OnTaskStartTip, GroupedActionDump, InsightAction, ExecutionDump, LocateOption, PlanningActionParamScroll, LocatorValidatorOption, AgentDescribeElementAtPointResult, LocateValidatorResult, LocateResultElement, AgentAssertOpt, AgentWaitForOpt } from 'misoai-core';
|
2
|
+
import { Insight, ExecutionTaskProgressOptions, MemoryConfig, PlanningAction, ExecutionTaskApply, Executor, MemoryItem, MemoryStats, MidsceneYamlFlowItem, InsightExtractParam, InsightExtractOption, InsightAssertionResponse, PlanningActionParamWaitFor, OnTaskStartTip, GroupedActionDump, InsightAction, ExecutionDump, LocateOption, PlanningActionParamScroll, LocatorValidatorOption, AgentDescribeElementAtPointResult, LocateValidatorResult, LocateResultElement, AgentAssertOpt, AgentWaitForOpt, MemoryReport, MemorySummary } from 'misoai-core';
|
3
3
|
import { ChatCompletionMessageParam } from 'misoai-core/ai-model';
|
4
4
|
import 'playwright';
|
5
5
|
import 'misoai-shared/extractor';
|
@@ -47,15 +47,52 @@ interface ExecutionResult<OutputType = any> {
|
|
47
47
|
output: OutputType;
|
48
48
|
executor: Executor;
|
49
49
|
}
|
50
|
+
interface WorkflowMemoryData {
|
51
|
+
workflowId: string;
|
52
|
+
steps: WorkflowStep[];
|
53
|
+
memory: MemoryItem[];
|
54
|
+
context: WorkflowContext;
|
55
|
+
metadata: WorkflowMetadata;
|
56
|
+
}
|
57
|
+
interface WorkflowStep {
|
58
|
+
stepId: string;
|
59
|
+
stepName: string;
|
60
|
+
timestamp: number;
|
61
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
62
|
+
memoryItems: string[];
|
63
|
+
}
|
64
|
+
interface WorkflowContext {
|
65
|
+
currentStep?: string;
|
66
|
+
pageInfo: {
|
67
|
+
url: string;
|
68
|
+
title: string;
|
69
|
+
};
|
70
|
+
timestamp: number;
|
71
|
+
}
|
72
|
+
interface WorkflowMetadata {
|
73
|
+
totalSteps: number;
|
74
|
+
completedSteps: number;
|
75
|
+
failedSteps: number;
|
76
|
+
startTime: number;
|
77
|
+
endTime?: number;
|
78
|
+
duration?: number;
|
79
|
+
}
|
50
80
|
declare class PageTaskExecutor {
|
51
81
|
page: WebPage;
|
52
82
|
insight: Insight<WebElementInfo, WebUIContext>;
|
53
83
|
taskCache?: TaskCache;
|
54
84
|
conversationHistory: ChatCompletionMessageParam[];
|
55
85
|
onTaskStartCallback?: ExecutionTaskProgressOptions['onTaskStart'];
|
86
|
+
private persistentExecutor?;
|
87
|
+
private memoryConfig;
|
88
|
+
private sessionContext;
|
89
|
+
private workflowMemory;
|
56
90
|
constructor(page: WebPage, insight: Insight<WebElementInfo, WebUIContext>, opts: {
|
57
91
|
taskCache?: TaskCache;
|
58
92
|
onTaskStart?: ExecutionTaskProgressOptions['onTaskStart'];
|
93
|
+
memoryConfig?: Partial<MemoryConfig>;
|
94
|
+
sessionId?: string;
|
95
|
+
workflowId?: string;
|
59
96
|
});
|
60
97
|
private recordScreenshot;
|
61
98
|
private getElementXpath;
|
@@ -71,8 +108,45 @@ declare class PageTaskExecutor {
|
|
71
108
|
}>;
|
72
109
|
private planningTaskFromPrompt;
|
73
110
|
private planningTaskToGoal;
|
111
|
+
/**
|
112
|
+
* Persistent executor'ı getirir veya oluşturur
|
113
|
+
*/
|
114
|
+
private getPersistentExecutor;
|
115
|
+
/**
|
116
|
+
* Sayfa bağlamını günceller
|
117
|
+
*/
|
118
|
+
private updatePageContext;
|
119
|
+
/**
|
120
|
+
* Hafızayı temizler
|
121
|
+
*/
|
122
|
+
clearMemory(): void;
|
123
|
+
/**
|
124
|
+
* Mevcut hafızayı döndürür
|
125
|
+
*/
|
126
|
+
getMemory(): readonly MemoryItem[];
|
127
|
+
/**
|
128
|
+
* İş akışı hafızasını döndürür
|
129
|
+
*/
|
130
|
+
getWorkflowMemory(): WorkflowMemoryData;
|
131
|
+
/**
|
132
|
+
* Hafıza istatistiklerini döndürür
|
133
|
+
*/
|
134
|
+
getMemoryStats(): MemoryStats;
|
135
|
+
/**
|
136
|
+
* Hafıza konfigürasyonunu günceller
|
137
|
+
*/
|
138
|
+
updateMemoryConfig(config: Partial<MemoryConfig>): void;
|
139
|
+
/**
|
140
|
+
* Oturum ID'sini oluşturur
|
141
|
+
*/
|
142
|
+
private generateSessionId;
|
143
|
+
/**
|
144
|
+
* Hafızayı bağlam olarak formatlar
|
145
|
+
*/
|
146
|
+
private getMemoryAsContext;
|
74
147
|
runPlans(title: string, plans: PlanningAction[], opts?: {
|
75
148
|
cacheable?: boolean;
|
149
|
+
useMemory?: boolean;
|
76
150
|
}): Promise<ExecutionResult>;
|
77
151
|
action(userPrompt: string, actionContext?: string, opts?: {
|
78
152
|
cacheable?: boolean;
|
@@ -89,7 +163,7 @@ declare class PageTaskExecutor {
|
|
89
163
|
boolean(prompt: string, opt?: InsightExtractOption): Promise<ExecutionResult<boolean>>;
|
90
164
|
number(prompt: string, opt?: InsightExtractOption): Promise<ExecutionResult<number>>;
|
91
165
|
string(prompt: string, opt?: InsightExtractOption): Promise<ExecutionResult<string>>;
|
92
|
-
assert(assertion: string): Promise<ExecutionResult<InsightAssertionResponse>>;
|
166
|
+
assert(assertion: string, memoryContext?: string): Promise<ExecutionResult<InsightAssertionResponse>>;
|
93
167
|
/**
|
94
168
|
* Append a message to the conversation history
|
95
169
|
* For user messages with images:
|
@@ -262,6 +336,37 @@ declare class PageAgent<PageType extends WebPage = WebPage> {
|
|
262
336
|
content?: string;
|
263
337
|
}): Promise<void>;
|
264
338
|
destroy(): Promise<void>;
|
339
|
+
/**
|
340
|
+
* Hafızayı bağlam olarak formatlar
|
341
|
+
*/
|
342
|
+
private getMemoryAsContext;
|
343
|
+
/**
|
344
|
+
* Mevcut hafızayı döndürür
|
345
|
+
*/
|
346
|
+
getMemory(): readonly MemoryItem[];
|
347
|
+
/**
|
348
|
+
* Hafıza istatistiklerini döndürür
|
349
|
+
*/
|
350
|
+
getMemoryStats(): MemoryStats;
|
351
|
+
/**
|
352
|
+
* Hafızayı temizler
|
353
|
+
*/
|
354
|
+
clearMemory(): void;
|
355
|
+
/**
|
356
|
+
* Test sonunda kullanım için detaylı hafıza raporu döndürür (JSON formatında)
|
357
|
+
*/
|
358
|
+
getMemoryReport(): MemoryReport;
|
359
|
+
/**
|
360
|
+
* Test sonunda kullanım için basit hafıza özeti döndürür (JSON formatında)
|
361
|
+
*/
|
362
|
+
getMemorySummary(): MemorySummary;
|
363
|
+
private formatRelativeTime;
|
364
|
+
private getTaskTypeDistribution;
|
365
|
+
private calculateSuccessRate;
|
366
|
+
private calculateAverageExecutionTime;
|
367
|
+
private countDataExtractions;
|
368
|
+
private extractWorkflowSteps;
|
369
|
+
private getExtractedDataSummary;
|
265
370
|
}
|
266
371
|
|
267
372
|
export { type AITaskMetadata, type AITaskResult, PageAgent, type PageAgentOpt };
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"Browser use",
|
9
9
|
"Android use"
|
10
10
|
],
|
11
|
-
"version": "1.5.
|
11
|
+
"version": "1.5.9",
|
12
12
|
"repository": "https://github.com/web-infra-dev/midscene",
|
13
13
|
"homepage": "https://midscenejs.com/",
|
14
14
|
"jsnext:source": "./src/index.ts",
|
@@ -163,7 +163,7 @@
|
|
163
163
|
"bin"
|
164
164
|
],
|
165
165
|
"dependencies": {
|
166
|
-
"misoai-core": "1.0.
|
166
|
+
"misoai-core": "1.0.9",
|
167
167
|
"misoai-shared": "1.0.3",
|
168
168
|
"@xmldom/xmldom": "0.8.10",
|
169
169
|
"cors": "2.8.5",
|