@midscene/core 1.0.1-beta-20251124014653.0 → 1.0.1-beta-20251124032544.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 +1 -1
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +5 -4
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/conversation-history.mjs +28 -11
- package/dist/es/ai-model/conversation-history.mjs.map +1 -1
- package/dist/es/ai-model/llm-planning.mjs +20 -22
- package/dist/es/ai-model/llm-planning.mjs.map +1 -1
- package/dist/es/ai-model/prompt/llm-planning.mjs +6 -5
- package/dist/es/ai-model/prompt/llm-planning.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 +1 -1
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/tasks.js +5 -4
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/conversation-history.js +28 -11
- package/dist/lib/ai-model/conversation-history.js.map +1 -1
- package/dist/lib/ai-model/llm-planning.js +20 -22
- package/dist/lib/ai-model/llm-planning.js.map +1 -1
- package/dist/lib/ai-model/prompt/llm-planning.js +6 -5
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/types/agent/tasks.d.ts +2 -2
- package/dist/types/ai-model/conversation-history.d.ts +3 -2
- package/dist/types/ai-model/llm-planning.d.ts +2 -1
- package/dist/types/ai-model/prompt/llm-planning.d.ts +3 -2
- package/dist/types/types.d.ts +1 -0
- package/package.json +7 -7
|
@@ -3,7 +3,7 @@ import type { AbstractInterface } from '../device';
|
|
|
3
3
|
import type Service from '../service';
|
|
4
4
|
import type { TaskRunner } from '../task-runner';
|
|
5
5
|
import { TaskExecutionError } from '../task-runner';
|
|
6
|
-
import type { ExecutionTaskApply, ExecutionTaskProgressOptions, MidsceneYamlFlowItem, PlanningAction, PlanningActionParamSleep, PlanningActionParamWaitFor, ServiceExtractOption, ServiceExtractParam,
|
|
6
|
+
import type { ExecutionTaskApply, ExecutionTaskProgressOptions, MidsceneYamlFlowItem, PlanningAction, PlanningActionParamSleep, PlanningActionParamWaitFor, ServiceExtractOption, ServiceExtractParam, ThinkingStrategy } from '../types';
|
|
7
7
|
import { type IModelConfig } from '@midscene/shared/env';
|
|
8
8
|
import type { TaskCache } from './task-cache';
|
|
9
9
|
export { locatePlanForLocate } from './task-builder';
|
|
@@ -45,7 +45,7 @@ export declare class TaskExecutor {
|
|
|
45
45
|
private createPlanningTask;
|
|
46
46
|
runPlans(title: string, plans: PlanningAction[], modelConfigForPlanning: IModelConfig, modelConfigForDefaultIntent: IModelConfig): Promise<ExecutionResult>;
|
|
47
47
|
private getReplanningCycleLimit;
|
|
48
|
-
action(userPrompt: string, modelConfigForPlanning: IModelConfig, modelConfigForDefaultIntent: IModelConfig,
|
|
48
|
+
action(userPrompt: string, modelConfigForPlanning: IModelConfig, modelConfigForDefaultIntent: IModelConfig, includeBboxInPlanning: boolean, thinkingStrategy: ThinkingStrategy, actionContext?: string, cacheable?: boolean): Promise<ExecutionResult<{
|
|
49
49
|
yamlFlow?: MidsceneYamlFlowItem[];
|
|
50
50
|
} | undefined>>;
|
|
51
51
|
private createTypeQueryTask;
|
|
@@ -10,9 +10,10 @@ export declare class ConversationHistory {
|
|
|
10
10
|
append(message: ChatCompletionMessageParam): void;
|
|
11
11
|
seed(messages: ChatCompletionMessageParam[]): void;
|
|
12
12
|
reset(): void;
|
|
13
|
-
snapshot(
|
|
13
|
+
snapshot(options?: {
|
|
14
|
+
maxImageMessages?: number;
|
|
15
|
+
}): ChatCompletionMessageParam[];
|
|
14
16
|
get length(): number;
|
|
15
17
|
[Symbol.iterator](): IterableIterator<ChatCompletionMessageParam>;
|
|
16
18
|
toJSON(): ChatCompletionMessageParam[];
|
|
17
|
-
private pruneOldestUserMessageIfNecessary;
|
|
18
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeviceAction, InterfaceType, PlanningAIResponse, UIContext } from '../types';
|
|
1
|
+
import type { DeviceAction, InterfaceType, PlanningAIResponse, ThinkingStrategy, UIContext } from '../types';
|
|
2
2
|
import type { IModelConfig } from '@midscene/shared/env';
|
|
3
3
|
import type { ConversationHistory } from './conversation-history';
|
|
4
4
|
export declare function plan(userInstruction: string, opts: {
|
|
@@ -9,4 +9,5 @@ export declare function plan(userInstruction: string, opts: {
|
|
|
9
9
|
modelConfig: IModelConfig;
|
|
10
10
|
conversationHistory?: ConversationHistory;
|
|
11
11
|
includeBbox: boolean;
|
|
12
|
+
thinkingStrategy: ThinkingStrategy;
|
|
12
13
|
}): Promise<PlanningAIResponse>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { DeviceAction } from '../../types';
|
|
1
|
+
import type { DeviceAction, ThinkingStrategy } from '../../types';
|
|
2
2
|
import type { TVlModeTypes } from '@midscene/shared/env';
|
|
3
3
|
import type { ResponseFormatJSONSchema } from 'openai/resources/index';
|
|
4
4
|
export declare const descriptionForAction: (action: DeviceAction<any>, locatorSchemaTypeDescription: string) => string;
|
|
5
|
-
export declare function systemPromptToTaskPlanning({ actionSpace, vlMode, includeBbox, }: {
|
|
5
|
+
export declare function systemPromptToTaskPlanning({ actionSpace, vlMode, includeBbox, thinkingStrategy, }: {
|
|
6
6
|
actionSpace: DeviceAction<any>[];
|
|
7
7
|
vlMode: TVlModeTypes | undefined;
|
|
8
8
|
includeBbox: boolean;
|
|
9
|
+
thinkingStrategy: ThinkingStrategy;
|
|
9
10
|
}): Promise<string>;
|
|
10
11
|
export declare const planSchema: ResponseFormatJSONSchema;
|
package/dist/types/types.d.ts
CHANGED
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-20251124032544.0",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -85,21 +85,21 @@
|
|
|
85
85
|
"dotenv": "^16.4.5",
|
|
86
86
|
"https-proxy-agent": "7.0.2",
|
|
87
87
|
"openai": "6.3.0",
|
|
88
|
+
"jsonrepair": "3.12.0",
|
|
89
|
+
"semver": "7.5.2",
|
|
90
|
+
"js-yaml": "4.1.0",
|
|
91
|
+
"zod": "3.24.3",
|
|
88
92
|
"socks-proxy-agent": "8.0.4",
|
|
89
|
-
"@midscene/shared": "1.0.1-beta-
|
|
93
|
+
"@midscene/shared": "1.0.1-beta-20251124032544.0"
|
|
90
94
|
},
|
|
91
95
|
"devDependencies": {
|
|
92
|
-
"jsonrepair": "3.12.0",
|
|
93
96
|
"@rslib/core": "^0.11.2",
|
|
94
97
|
"@types/node": "^18.0.0",
|
|
95
98
|
"@types/node-fetch": "2.6.11",
|
|
96
99
|
"@types/js-yaml": "4.0.9",
|
|
97
100
|
"@types/semver": "7.7.0",
|
|
98
101
|
"typescript": "^5.8.3",
|
|
99
|
-
"
|
|
100
|
-
"js-yaml": "4.1.0",
|
|
101
|
-
"vitest": "3.0.5",
|
|
102
|
-
"zod": "3.24.3"
|
|
102
|
+
"vitest": "3.0.5"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
105
105
|
"node": ">=18.0.0"
|