@midscene/core 1.0.1-beta-20251126092253.0 → 1.0.1-beta-20251127021613.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/agent.mjs +15 -3
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +4 -9
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/inspect.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +17 -18
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/task-runner.mjs.map +1 -1
- package/dist/es/types.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/agent.js +14 -2
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/tasks.js +4 -9
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/inspect.js.map +1 -1
- package/dist/lib/ai-model/service-caller/index.js +17 -18
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/task-runner.js.map +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/agent/agent.d.ts +1 -0
- package/dist/types/agent/tasks.d.ts +2 -3
- package/dist/types/types.d.ts +6 -0
- package/package.json +2 -2
|
@@ -48,6 +48,7 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
|
|
|
48
48
|
* Lazily compute the ratio between the physical screenshot width and the logical page width
|
|
49
49
|
*/
|
|
50
50
|
private getScreenshotScale;
|
|
51
|
+
private resolveReplanningCycleLimit;
|
|
51
52
|
constructor(interfaceInstance: InterfaceType, opts?: AgentOpt);
|
|
52
53
|
getActionSpace(): Promise<DeviceAction[]>;
|
|
53
54
|
getUIContext(action?: ServiceAction): Promise<UIContext>;
|
|
@@ -4,7 +4,7 @@ import type Service from '../service';
|
|
|
4
4
|
import type { TaskRunner } from '../task-runner';
|
|
5
5
|
import { TaskExecutionError } from '../task-runner';
|
|
6
6
|
import type { ExecutionTaskApply, ExecutionTaskProgressOptions, MidsceneYamlFlowItem, PlanningAction, PlanningActionParamSleep, PlanningActionParamWaitFor, ServiceExtractOption, ServiceExtractParam, ThinkingStrategy } from '../types';
|
|
7
|
-
import {
|
|
7
|
+
import type { IModelConfig } from '@midscene/shared/env';
|
|
8
8
|
import type { TaskCache } from './task-cache';
|
|
9
9
|
export { locatePlanForLocate } from './task-builder';
|
|
10
10
|
interface ExecutionResult<OutputType = any> {
|
|
@@ -43,8 +43,7 @@ export declare class TaskExecutor {
|
|
|
43
43
|
runner: TaskRunner;
|
|
44
44
|
}>;
|
|
45
45
|
runPlans(title: string, plans: PlanningAction[], modelConfigForPlanning: IModelConfig, modelConfigForDefaultIntent: IModelConfig): Promise<ExecutionResult>;
|
|
46
|
-
|
|
47
|
-
action(userPrompt: string, modelConfigForPlanning: IModelConfig, modelConfigForDefaultIntent: IModelConfig, includeBboxInPlanning: boolean, thinkingStrategy: ThinkingStrategy, backgroundKnowledge?: string, cacheable?: boolean): Promise<ExecutionResult<{
|
|
46
|
+
action(userPrompt: string, modelConfigForPlanning: IModelConfig, modelConfigForDefaultIntent: IModelConfig, includeBboxInPlanning: boolean, thinkingStrategy: ThinkingStrategy, backgroundKnowledge?: string, cacheable?: boolean, replanningCycleLimitOverride?: number): Promise<ExecutionResult<{
|
|
48
47
|
yamlFlow?: MidsceneYamlFlowItem[];
|
|
49
48
|
} | undefined>>;
|
|
50
49
|
private createTypeQueryTask;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type AIUsageInfo = Record<string, any> & {
|
|
|
10
10
|
prompt_tokens: number | undefined;
|
|
11
11
|
completion_tokens: number | undefined;
|
|
12
12
|
total_tokens: number | undefined;
|
|
13
|
+
cached_input: number | undefined;
|
|
13
14
|
time_cost: number | undefined;
|
|
14
15
|
model_name: string | undefined;
|
|
15
16
|
model_description: string | undefined;
|
|
@@ -401,6 +402,11 @@ export interface AgentOpt {
|
|
|
401
402
|
reportFileName?: string;
|
|
402
403
|
modelConfig?: TModelConfig;
|
|
403
404
|
cache?: Cache;
|
|
405
|
+
/**
|
|
406
|
+
* Maximum number of replanning cycles for aiAct.
|
|
407
|
+
* Defaults to 20 (40 for `vlm-ui-tars`) when not provided.
|
|
408
|
+
* If omitted, the agent will also read `MIDSCENE_REPLANNING_CYCLE_LIMIT` for backward compatibility.
|
|
409
|
+
*/
|
|
404
410
|
replanningCycleLimit?: number;
|
|
405
411
|
/**
|
|
406
412
|
* Custom OpenAI client factory function
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/core",
|
|
3
3
|
"description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "1.0.1-beta-
|
|
4
|
+
"version": "1.0.1-beta-20251127021613.0",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"js-yaml": "4.1.0",
|
|
90
90
|
"zod": "3.24.3",
|
|
91
91
|
"socks-proxy-agent": "8.0.4",
|
|
92
|
-
"@midscene/shared": "1.0.1-beta-
|
|
92
|
+
"@midscene/shared": "1.0.1-beta-20251127021613.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@rslib/core": "^0.11.2",
|