@autotest/agent 0.0.1
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/README.md +648 -0
- package/dist/api/agent_api.d.ts +37 -0
- package/dist/api/autotest_agent.d.ts +60 -0
- package/dist/api/types.d.ts +86 -0
- package/dist/autotest-cli.d.ts +2 -0
- package/dist/common/case_manager.d.ts +10 -0
- package/dist/common/collect_case.d.ts +29 -0
- package/dist/common/common_errors.d.ts +30 -0
- package/dist/common/config/config.yaml +113 -0
- package/dist/common/config/config_validator.d.ts +8 -0
- package/dist/common/config/manager.d.ts +38 -0
- package/dist/common/config/output.d.ts +11 -0
- package/dist/common/config/types.d.ts +2963 -0
- package/dist/common/dfx/client_factory.d.ts +23 -0
- package/dist/common/dfx/context.d.ts +4 -0
- package/dist/common/dfx/index.d.ts +6 -0
- package/dist/common/dfx/recorder.d.ts +59 -0
- package/dist/common/dfx/recording_fetch.d.ts +4 -0
- package/dist/common/dfx/source.d.ts +9 -0
- package/dist/common/image_cacher.d.ts +10 -0
- package/dist/common/image_helper.d.ts +19 -0
- package/dist/common/image_similarity.d.ts +7 -0
- package/dist/common/llm_cache/cache_transport.d.ts +10 -0
- package/dist/common/logger.d.ts +17 -0
- package/dist/common/model/custom_model.d.ts +52 -0
- package/dist/common/model/index.d.ts +3 -0
- package/dist/common/path_utils.d.ts +11 -0
- package/dist/common/result_parser.d.ts +10 -0
- package/dist/common/usage/token_usage.d.ts +23 -0
- package/dist/common/utils.d.ts +44 -0
- package/dist/core/agent/layered_agent/ability_helper.d.ts +36 -0
- package/dist/core/agent/layered_agent/agent.d.ts +15 -0
- package/dist/core/agent/layered_agent/agent_registry.d.ts +34 -0
- package/dist/core/agent/layered_agent/decision.d.ts +82 -0
- package/dist/core/agent/layered_agent/execute_agent/action_handler.d.ts +26 -0
- package/dist/core/agent/layered_agent/execute_agent/agent_factory.d.ts +24 -0
- package/dist/core/agent/layered_agent/execute_agent/base_agent.d.ts +83 -0
- package/dist/core/agent/layered_agent/execute_agent/general_agent.d.ts +33 -0
- package/dist/core/agent/layered_agent/execute_agent/glm_agent.d.ts +36 -0
- package/dist/core/agent/layered_agent/execute_agent/i18n.d.ts +26 -0
- package/dist/core/agent/layered_agent/execute_agent/index.d.ts +16 -0
- package/dist/core/agent/layered_agent/execute_agent/mai_ui_agent.d.ts +52 -0
- package/dist/core/agent/layered_agent/execute_agent/mcp_prompts.d.ts +4 -0
- package/dist/core/agent/layered_agent/execute_agent/parser/general_parser.d.ts +22 -0
- package/dist/core/agent/layered_agent/execute_agent/parser/glm_parser.d.ts +14 -0
- package/dist/core/agent/layered_agent/execute_agent/parser/index.d.ts +7 -0
- package/dist/core/agent/layered_agent/execute_agent/parser/mai_ui_parser.d.ts +17 -0
- package/dist/core/agent/layered_agent/execute_agent/prompts.d.ts +2 -0
- package/dist/core/agent/layered_agent/execute_agent/simple_reporter.d.ts +13 -0
- package/dist/core/agent/layered_agent/execute_agent/utils.d.ts +6 -0
- package/dist/core/agent/report_analyzer_agent/agent.d.ts +22 -0
- package/dist/core/agent/report_analyzer_agent/config.d.ts +5 -0
- package/dist/core/agent/report_analyzer_agent/data_loader.d.ts +26 -0
- package/dist/core/agent/report_analyzer_agent/guardrails.d.ts +9 -0
- package/dist/core/agent/report_analyzer_agent/hooks.d.ts +6 -0
- package/dist/core/agent/report_analyzer_agent/index.d.ts +17 -0
- package/dist/core/agent/report_analyzer_agent/key_steps_builder.d.ts +9 -0
- package/dist/core/agent/report_analyzer_agent/mapping.d.ts +6 -0
- package/dist/core/agent/report_analyzer_agent/parse.d.ts +4 -0
- package/dist/core/agent/report_analyzer_agent/prompt.d.ts +2 -0
- package/dist/core/agent/report_analyzer_agent/prompts/main_agent.md +198 -0
- package/dist/core/agent/report_analyzer_agent/prompts/main_agent_v2.0.md +420 -0
- package/dist/core/agent/report_analyzer_agent/report_writer.d.ts +8 -0
- package/dist/core/agent/report_analyzer_agent/tools.d.ts +26 -0
- package/dist/core/agent/report_analyzer_agent/types.d.ts +97 -0
- package/dist/core/agent/rewrite_agent/agent.d.ts +27 -0
- package/dist/core/agent/rewrite_agent/guardrails.d.ts +16 -0
- package/dist/core/agent/rewrite_agent/mapping.d.ts +25 -0
- package/dist/core/agent/rewrite_agent/parse.d.ts +14 -0
- package/dist/core/agent/rewrite_agent/prompts/rewriter_v1.0.md +168 -0
- package/dist/core/agent/rewrite_agent/types.d.ts +50 -0
- package/dist/core/agent/single_agent/agent.d.ts +43 -0
- package/dist/core/agent/single_agent/hook_manager.d.ts +43 -0
- package/dist/core/agent/single_agent/hooks.d.ts +23 -0
- package/dist/core/agent/single_agent/image_utils.d.ts +38 -0
- package/dist/core/agent/single_agent/scroll_search_agent.d.ts +58 -0
- package/dist/core/agent/single_agent/subagent_manager.d.ts +51 -0
- package/dist/core/agent/single_agent/tool_recorder_hook.d.ts +20 -0
- package/dist/core/agent/types.d.ts +43 -0
- package/dist/core/agent/utils/message_builder.d.ts +38 -0
- package/dist/core/device/device_protocol.d.ts +3 -0
- package/dist/core/device/hdc/apps.d.ts +38 -0
- package/dist/core/device/hdc/device.d.ts +59 -0
- package/dist/core/device/hdc/index.d.ts +9 -0
- package/dist/core/device/hdc/input.d.ts +20 -0
- package/dist/core/device/hdc/screenshot.d.ts +19 -0
- package/dist/core/device/index.d.ts +49 -0
- package/dist/core/device/types.d.ts +37 -0
- package/dist/core/knowledge/knowledge_manager.d.ts +22 -0
- package/dist/core/knowledge/vectordb.d.ts +44 -0
- package/dist/core/mcp/adapter_factory.d.ts +10 -0
- package/dist/core/mcp/android_adapter.d.ts +30 -0
- package/dist/core/mcp/base_adapter.d.ts +26 -0
- package/dist/core/mcp/harmony_hdc_adapter.d.ts +49 -0
- package/dist/core/mcp/ios_adapter.d.ts +30 -0
- package/dist/core/mcp/local_tools.d.ts +20 -0
- package/dist/core/mcp/mcp_tools.d.ts +51 -0
- package/dist/core/mcp/types.d.ts +24 -0
- package/dist/core/memory/compressed_session.d.ts +46 -0
- package/dist/core/memory/context_compressor.d.ts +24 -0
- package/dist/core/memory/index.d.ts +7 -0
- package/dist/core/memory/memory_manager.d.ts +21 -0
- package/dist/core/memory/reflector.d.ts +20 -0
- package/dist/core/memory/session_factory.d.ts +17 -0
- package/dist/core/memory/tool_player.d.ts +82 -0
- package/dist/core/memory/tool_recorder.d.ts +33 -0
- package/dist/core/preprocessor/task_splitter.d.ts +26 -0
- package/dist/core/prompt/prompt_loader.d.ts +24 -0
- package/dist/core/prompt/templates/debug/planner/planner_v0.0.md +290 -0
- package/dist/core/prompt/templates/debug/planner/planner_v1.0.md +221 -0
- package/dist/core/prompt/templates/debug/planner/planner_v1.1-dy.md +74 -0
- package/dist/core/prompt/templates/debug/planner/planner_v2.0.md +319 -0
- package/dist/core/prompt/templates/fast_action/fast_action_v1.0.md +46 -0
- package/dist/core/prompt/templates/hypium/hypium_v1.0.md +33 -0
- package/dist/core/prompt/templates/hypium/hypium_v2.0.md +285 -0
- package/dist/core/prompt/templates/planner/planner_v2.0.md +319 -0
- package/dist/core/prompt/templates/single/single_v1.0.md +452 -0
- package/dist/core/prompt/templates/single/single_v2.0.md +306 -0
- package/dist/core/prompt/templates/single/single_v2.0_eco.md +313 -0
- package/dist/core/prompt/templates/single/single_v3.0.md +200 -0
- package/dist/core/prompt/templates/splitter/task_splitter_v1.0.md +141 -0
- package/dist/core/skill/skill_manager.d.ts +54 -0
- package/dist/data_types/action.d.ts +2 -0
- package/dist/data_types/agent.d.ts +2 -0
- package/dist/data_types/device.d.ts +2 -0
- package/dist/data_types/index.d.ts +6 -0
- package/dist/data_types/report.d.ts +2 -0
- package/dist/data_types/task.d.ts +2 -0
- package/dist/hypium_generator/generator.d.ts +38 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +1 -0
- package/dist/loop/cli.d.ts +39 -0
- package/dist/loop/orchestrator.d.ts +47 -0
- package/dist/loop/result_writer.d.ts +12 -0
- package/dist/loop/types.d.ts +77 -0
- package/dist/mcp-server/server.d.ts +15 -0
- package/dist/mcp-server/types.d.ts +196 -0
- package/dist/reporter/batch_summary.d.ts +19 -0
- package/dist/reporter/generator.d.ts +46 -0
- package/dist/reporter/types.d.ts +88 -0
- package/dist/tools/batch_runner.d.ts +92 -0
- package/package.json +51 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ConfigManager } from '../common/config/manager';
|
|
2
|
+
import type { AppConfig } from '../common/config/types';
|
|
3
|
+
import type { TaskResult, AnalysisResult, DeviceInfo } from './types';
|
|
4
|
+
import type { AgentMode } from '../core/agent/types';
|
|
5
|
+
import type { DevicePlatform } from '../core/mcp/types';
|
|
6
|
+
export interface ModelSlotConfig {
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
modelName?: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
provider?: string;
|
|
11
|
+
temperature?: number;
|
|
12
|
+
topP?: number;
|
|
13
|
+
maxTokens?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface AutoTestAgentConfig {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
modelName: string;
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
provider?: string;
|
|
20
|
+
executeModel?: ModelSlotConfig;
|
|
21
|
+
decisionModel?: ModelSlotConfig;
|
|
22
|
+
deviceSn?: string;
|
|
23
|
+
ip?: string;
|
|
24
|
+
port?: number;
|
|
25
|
+
platform?: DevicePlatform;
|
|
26
|
+
agentMode?: AgentMode;
|
|
27
|
+
maxSteps?: number;
|
|
28
|
+
reportDir?: string;
|
|
29
|
+
enableCache?: boolean;
|
|
30
|
+
configPath?: string;
|
|
31
|
+
configOverrides?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export interface RunTaskOptions {
|
|
34
|
+
agentMode?: AgentMode;
|
|
35
|
+
platform?: DevicePlatform;
|
|
36
|
+
deviceSn?: string;
|
|
37
|
+
ip?: string;
|
|
38
|
+
port?: number;
|
|
39
|
+
reportDir?: string;
|
|
40
|
+
taskName?: string;
|
|
41
|
+
caseNum?: string;
|
|
42
|
+
maxSteps?: number;
|
|
43
|
+
promptVersion?: string;
|
|
44
|
+
runId?: string;
|
|
45
|
+
configOverrides?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
export declare class AutoTestAgent {
|
|
48
|
+
private api;
|
|
49
|
+
private configManager;
|
|
50
|
+
constructor(config: AutoTestAgentConfig);
|
|
51
|
+
runTask(task: string, options?: RunTaskOptions): Promise<TaskResult>;
|
|
52
|
+
listDevices(): Promise<DeviceInfo[]>;
|
|
53
|
+
getTaskResult(taskId: string): Promise<TaskResult>;
|
|
54
|
+
analyzeFailure(taskId: string, caseIdx: number): Promise<AnalysisResult>;
|
|
55
|
+
stopTask(): void;
|
|
56
|
+
getConfig(): AppConfig;
|
|
57
|
+
getConfigManager(): ConfigManager;
|
|
58
|
+
updateConfig(partial: Record<string, unknown>): AppConfig;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=autotest_agent.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { AgentMode } from '../core/agent/types';
|
|
2
|
+
import type { DevicePlatform } from '../core/mcp/types';
|
|
3
|
+
export type FeedbackMode = 'poll' | 'stream' | 'callback';
|
|
4
|
+
export interface TaskOptions {
|
|
5
|
+
agentMode: AgentMode;
|
|
6
|
+
deviceId: string;
|
|
7
|
+
platform: DevicePlatform;
|
|
8
|
+
promptVersion?: string;
|
|
9
|
+
configOverrides?: Record<string, unknown>;
|
|
10
|
+
reportDir?: string;
|
|
11
|
+
task?: string;
|
|
12
|
+
taskName?: string;
|
|
13
|
+
caseNum?: string;
|
|
14
|
+
ip?: string;
|
|
15
|
+
port?: number;
|
|
16
|
+
runId?: string;
|
|
17
|
+
feedbackMode?: FeedbackMode;
|
|
18
|
+
callbackUrl?: string;
|
|
19
|
+
/** Loop 闭环:>=2 启用 FULL_LOOP 自愈闭环(执行→归因→改写→重执行)。 */
|
|
20
|
+
maxLoops?: number;
|
|
21
|
+
/** 仅归因(跳过执行,对已有报告做根因分析)。 */
|
|
22
|
+
analyzeReportDir?: string;
|
|
23
|
+
/** 仅改写(跳过执行和归因,对已有分析结果做改写)。 */
|
|
24
|
+
rewriteReportDir?: string;
|
|
25
|
+
/** 执行后自动归因(--analyze-after),否则按 config 驱动。 */
|
|
26
|
+
analyzeAfter?: boolean;
|
|
27
|
+
/** 按 name 加载 prompt(--prompt-name,优先于 promptVersion)。 */
|
|
28
|
+
promptName?: string;
|
|
29
|
+
/** app→bundle 映射配置文件路径(--app-config)。 */
|
|
30
|
+
appConfig?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CaseResult {
|
|
33
|
+
execIndex: number;
|
|
34
|
+
uuid?: string;
|
|
35
|
+
caseName?: string;
|
|
36
|
+
appName?: string;
|
|
37
|
+
testSteps?: string;
|
|
38
|
+
reportDir?: string;
|
|
39
|
+
startTime?: string;
|
|
40
|
+
endTime?: string;
|
|
41
|
+
durationSeconds?: number;
|
|
42
|
+
status: 'PASS' | 'FAIL' | 'UNKNOWN';
|
|
43
|
+
returnCode?: number;
|
|
44
|
+
reason?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface TaskResult {
|
|
47
|
+
taskId: string;
|
|
48
|
+
status: 'pending' | 'running' | 'completed' | 'cancelled' | 'failed' | 'interrupted';
|
|
49
|
+
totalCases: number;
|
|
50
|
+
passed: number;
|
|
51
|
+
failed: number;
|
|
52
|
+
tip: string;
|
|
53
|
+
cases?: CaseResult[];
|
|
54
|
+
taskDir?: string;
|
|
55
|
+
reportDir?: string;
|
|
56
|
+
errorMessage?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface AnalysisResult {
|
|
59
|
+
rootCause: string;
|
|
60
|
+
suggestedActions: string[];
|
|
61
|
+
keyScreenshots?: string[];
|
|
62
|
+
modelUsed?: string;
|
|
63
|
+
tokenUsage?: Record<string, number>;
|
|
64
|
+
score?: number;
|
|
65
|
+
executionPros?: string[];
|
|
66
|
+
executionCons?: string[];
|
|
67
|
+
promptSuggestions?: AnalysisSuggestion[];
|
|
68
|
+
codeSuggestions?: AnalysisSuggestion[];
|
|
69
|
+
}
|
|
70
|
+
export interface AnalysisSuggestion {
|
|
71
|
+
description: string;
|
|
72
|
+
priority: 'high' | 'medium' | 'low';
|
|
73
|
+
expectedEffect?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface DeviceInfo {
|
|
76
|
+
deviceSn: string | null;
|
|
77
|
+
platform: DevicePlatform;
|
|
78
|
+
ip: string;
|
|
79
|
+
port: number;
|
|
80
|
+
isConnected: boolean;
|
|
81
|
+
status?: 'online' | 'offline' | 'unknown';
|
|
82
|
+
model?: string;
|
|
83
|
+
detail?: string;
|
|
84
|
+
}
|
|
85
|
+
export declare const TaskStateTransitions: Record<string, string[]>;
|
|
86
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class CaseManager {
|
|
2
|
+
private casesDir;
|
|
3
|
+
private cases;
|
|
4
|
+
constructor(casesDir?: string);
|
|
5
|
+
listCases(): string[];
|
|
6
|
+
loadCase(caseName: string): Record<string, unknown>;
|
|
7
|
+
findCase(taskDescription: string): string | null;
|
|
8
|
+
private loadCases;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=case_manager.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collect test cases from a data file and convert them to JSON format.
|
|
3
|
+
*
|
|
4
|
+
* Supports JSON array and JSONL (one object per line) inputs. Excel (.xlsx)
|
|
5
|
+
* inputs are not supported without an external spreadsheet library; convert
|
|
6
|
+
* them to CSV/JSON first.
|
|
7
|
+
*/
|
|
8
|
+
/** Mapping from source columns to output fields. */
|
|
9
|
+
export interface ColumnMapping {
|
|
10
|
+
caseName: string;
|
|
11
|
+
bundleName: string;
|
|
12
|
+
appName: string;
|
|
13
|
+
testSteps: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TestCase {
|
|
16
|
+
caseName: string;
|
|
17
|
+
bundleName: string;
|
|
18
|
+
appName: string;
|
|
19
|
+
testSteps: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Collect test cases from a JSON/JSONL file and write them out as JSON.
|
|
23
|
+
* @param inputFile Path to the input JSON or JSONL file.
|
|
24
|
+
* @param outputFile Path to the output JSON file (default: test_cases.json).
|
|
25
|
+
* @param mapping Column mapping override.
|
|
26
|
+
* @returns The output file path.
|
|
27
|
+
*/
|
|
28
|
+
export declare function collectTestCase(inputFile: string, outputFile?: string, mapping?: ColumnMapping): string;
|
|
29
|
+
//# sourceMappingURL=collect_case.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type AgentErrorCode = 'DEVICE_NOT_CONNECTED' | 'MCP_SERVICE_TIMEOUT' | 'CASE_FAILED' | 'TASK_NOT_FOUND' | 'CONFIG_VALIDATION_FAILED' | 'LLM_API_ERROR';
|
|
2
|
+
export declare const AgentErrorRecoverableMap: Record<AgentErrorCode, boolean>;
|
|
3
|
+
export declare const AgentErrorSuggestedActionsMap: Record<AgentErrorCode, string[]>;
|
|
4
|
+
export declare class AgentError extends Error {
|
|
5
|
+
readonly code: AgentErrorCode;
|
|
6
|
+
readonly recoverable: boolean;
|
|
7
|
+
readonly suggestedActions: string[];
|
|
8
|
+
readonly context: Record<string, unknown>;
|
|
9
|
+
constructor(code: AgentErrorCode, message: string, options?: {
|
|
10
|
+
recoverable?: boolean;
|
|
11
|
+
suggestedActions?: string[];
|
|
12
|
+
context?: Record<string, unknown>;
|
|
13
|
+
});
|
|
14
|
+
toJSON(): {
|
|
15
|
+
code: AgentErrorCode;
|
|
16
|
+
message: string;
|
|
17
|
+
recoverable: boolean;
|
|
18
|
+
suggestedActions: string[];
|
|
19
|
+
context: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare class LLMNotFollowRuleError extends AgentError {
|
|
23
|
+
readonly rawOutput: string;
|
|
24
|
+
readonly rawContent: string;
|
|
25
|
+
readonly retryCount: number;
|
|
26
|
+
readonly userMessage: string;
|
|
27
|
+
constructor(rawOutput: string, retryCount: number, context?: Record<string, unknown>, userMessage?: string);
|
|
28
|
+
}
|
|
29
|
+
export declare const COMMON_ERRORS_PROMPT = "\u5E38\u89C1\u9519\u8BEF\u63D0\u793A\uFF1A\n1. \u6B7B\u5FAA\u73AF\uFF1AAgent\u53CD\u590D\u6267\u884C\u76F8\u540C\u64CD\u4F5C\uFF0C\u65E0\u6CD5\u53D6\u5F97\u8FDB\u5C55\u3002\u8BF7\u68C0\u67E5\u76EE\u6807\u5143\u7D20\u5B9A\u4F4D\u662F\u5426\u6B63\u786E\uFF0C\u6216\u8C03\u6574\u64CD\u4F5C\u7B56\u7565\u3002\n2. \u5750\u6807\u5B9A\u4F4D\u9519\u8BEF\uFF1A\u70B9\u51FB/\u6ED1\u52A8\u5750\u6807\u504F\u5DEE\u5BFC\u81F4\u64CD\u4F5C\u5931\u8D25\u3002\u8BF7\u91CD\u65B0\u89C2\u5BDF\u622A\u56FE\uFF0C\u786E\u8BA4\u5143\u7D20\u4F4D\u7F6E\u3002\n3. Bug\u5224\u65AD\u9519\u8BEF\uFF1A\u5C06\u6B63\u5E38\u884C\u4E3A\u8BEF\u5224\u4E3ABug\uFF0C\u6216\u5C06Bug\u6F0F\u5224\u3002\u8BF7\u4ED4\u7EC6\u5BF9\u6BD4\u9884\u671F\u7ED3\u679C\u4E0E\u5B9E\u9645\u7ED3\u679C\u3002";
|
|
30
|
+
//# sourceMappingURL=common_errors.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
model:
|
|
2
|
+
unified:
|
|
3
|
+
name: "qwen3.7-plus"
|
|
4
|
+
base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
|
5
|
+
api_key: "YOUR_API_KEY_HERE"
|
|
6
|
+
provider: "openai"
|
|
7
|
+
temperature: 0.4
|
|
8
|
+
top_p: 0.85
|
|
9
|
+
frequency_penalty: 0.0
|
|
10
|
+
repetition_penalty: 1.1
|
|
11
|
+
presence_penalty: 0.0
|
|
12
|
+
enable_thinking: false
|
|
13
|
+
max_tokens: 2048
|
|
14
|
+
timeout: 600
|
|
15
|
+
max_retries: 3
|
|
16
|
+
prompt_type: "v2.0"
|
|
17
|
+
extra_headers:
|
|
18
|
+
Chat-Id: "autotest"
|
|
19
|
+
|
|
20
|
+
execute:
|
|
21
|
+
name: "gui-plus-2026-02-26"
|
|
22
|
+
base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
|
23
|
+
api_key: "YOUR_API_KEY_HERE"
|
|
24
|
+
provider: "mai-ui"
|
|
25
|
+
max_steps: 3
|
|
26
|
+
|
|
27
|
+
decision:
|
|
28
|
+
name: "qwen3.7-plus"
|
|
29
|
+
base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
|
30
|
+
api_key: "YOUR_API_KEY_HERE"
|
|
31
|
+
provider: "openai"
|
|
32
|
+
temperature: 0.0
|
|
33
|
+
top_p: 0.1
|
|
34
|
+
frequency_penalty: 0.0
|
|
35
|
+
|
|
36
|
+
verify:
|
|
37
|
+
name: ""
|
|
38
|
+
base_url: ""
|
|
39
|
+
api_key: ""
|
|
40
|
+
provider: "openai"
|
|
41
|
+
temperature: 0.0
|
|
42
|
+
top_p: 0.1
|
|
43
|
+
frequency_penalty: 0.0
|
|
44
|
+
|
|
45
|
+
agent:
|
|
46
|
+
mode: "single"
|
|
47
|
+
max_steps: 50
|
|
48
|
+
lang: "zh"
|
|
49
|
+
enable_preprocess: false
|
|
50
|
+
enable_hypium_generation: false
|
|
51
|
+
stream_log: false
|
|
52
|
+
debug_mode: null
|
|
53
|
+
adapter_class: null
|
|
54
|
+
action_interval: 1.0
|
|
55
|
+
max_history_image: 3
|
|
56
|
+
screenshot_max_pixels: 1500
|
|
57
|
+
include_previous_screenshot: true
|
|
58
|
+
previous_screenshot_compress_ratio: 0.7
|
|
59
|
+
enable_cache: true
|
|
60
|
+
|
|
61
|
+
log:
|
|
62
|
+
level: "INFO"
|
|
63
|
+
device_log_level: "info"
|
|
64
|
+
verbose: true
|
|
65
|
+
max_log_size: 10
|
|
66
|
+
max_log_file_num: 5
|
|
67
|
+
enable_console_log: true
|
|
68
|
+
enable_file_log: true
|
|
69
|
+
|
|
70
|
+
output:
|
|
71
|
+
json_output: false
|
|
72
|
+
report_dir: null
|
|
73
|
+
root_dir: "reports"
|
|
74
|
+
report_name: "autotest_report"
|
|
75
|
+
embed_images: false
|
|
76
|
+
embed_max_pixels: 800
|
|
77
|
+
|
|
78
|
+
device:
|
|
79
|
+
device_sn: null
|
|
80
|
+
ip: "127.0.0.1"
|
|
81
|
+
port: 8710
|
|
82
|
+
device_serial: ""
|
|
83
|
+
hdc_path: "hdc"
|
|
84
|
+
reset_device: true # true=回主页+清全部后台, false=跳过, 列表=只 force-stop 指定包名
|
|
85
|
+
screen_always_on: true
|
|
86
|
+
operation_mode: "phone"
|
|
87
|
+
screenshot_quality: 90
|
|
88
|
+
screenshot_max_width: 1500
|
|
89
|
+
|
|
90
|
+
network:
|
|
91
|
+
timeout: 600
|
|
92
|
+
max_retries: 3
|
|
93
|
+
no_proxy: ""
|
|
94
|
+
|
|
95
|
+
analyze:
|
|
96
|
+
model_name: ""
|
|
97
|
+
base_url: ""
|
|
98
|
+
api_key: ""
|
|
99
|
+
temperature: 0.1
|
|
100
|
+
max_tokens: 4096
|
|
101
|
+
timeout: 90
|
|
102
|
+
max_retries: 3
|
|
103
|
+
enable_multimodal: true
|
|
104
|
+
max_screenshot_pixels: 800
|
|
105
|
+
max_key_steps: 5
|
|
106
|
+
only_fail: true
|
|
107
|
+
|
|
108
|
+
knowledge:
|
|
109
|
+
apps:
|
|
110
|
+
vmall:
|
|
111
|
+
keywords: ["华为商城", "vmall", "com.huawei.hmos.vmall"]
|
|
112
|
+
md_file: "vmall.md"
|
|
113
|
+
label: "华为商城"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type AppConfig, type ModelConfig, type ModelGroupConfig, type AgentConfig } from './types';
|
|
2
|
+
export declare class ConfigManager {
|
|
3
|
+
private config;
|
|
4
|
+
private loadedConfigFile;
|
|
5
|
+
constructor(initial?: Partial<AppConfig>);
|
|
6
|
+
loadYamlFile(filePath: string): void;
|
|
7
|
+
loadDefaultConfig(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Layer 4: Load a --config override file (highest priority, aligned with python
|
|
10
|
+
* ConfigManager Layer 4). Merges after loadDefaultConfig, prints loaded file,
|
|
11
|
+
* and validates.
|
|
12
|
+
*/
|
|
13
|
+
loadFileConfig(configFile: string): void;
|
|
14
|
+
private convertKeysToCamel;
|
|
15
|
+
deepMerge<T extends Record<string, unknown>>(target: T, source: Record<string, unknown>): T;
|
|
16
|
+
validateWithZod(data: Record<string, unknown>): AppConfig;
|
|
17
|
+
getEffectiveConfig(): AppConfig;
|
|
18
|
+
updateConfig(partial: Record<string, unknown>): AppConfig;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resolve a model config by agent name with unified fallback.
|
|
22
|
+
* Mirrors python ModelGroupConfig.get_model:
|
|
23
|
+
* 1. direct slot match (unified/execute/decision/verify/reflection/analyze)
|
|
24
|
+
* 2. `_agent` suffix aliasing (e.g. `execute_agent` → `execute` slot)
|
|
25
|
+
* 3. extra_models[name]
|
|
26
|
+
* 4. fallback to `unified`
|
|
27
|
+
*/
|
|
28
|
+
export declare function getModel(group: ModelGroupConfig, name: string): ModelConfig;
|
|
29
|
+
/** Resolve a model config for an agent name from the app config. */
|
|
30
|
+
export declare function resolveModelConfig(config: AppConfig, agentName: string): ModelConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve an agent config by name. Node's config.agent is currently a flat
|
|
33
|
+
* AgentConfig (AgentGroupConfig restructure deferred), so this returns the
|
|
34
|
+
* flat config for any name — kept for API parity with python
|
|
35
|
+
* resolve_agent_config until extra_agents support lands.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveAgentConfig(config: AppConfig, _agentName: string): AgentConfig;
|
|
38
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface OutputConfig {
|
|
2
|
+
rootDir: string;
|
|
3
|
+
reportDir: string;
|
|
4
|
+
screenPath: string;
|
|
5
|
+
layoutDir: string;
|
|
6
|
+
logDir: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function initOutputDir(taskName: string, config?: {
|
|
9
|
+
rootDir?: string;
|
|
10
|
+
}): OutputConfig;
|
|
11
|
+
//# sourceMappingURL=output.d.ts.map
|