@autotest/agent 0.0.21 → 0.0.22
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 +8 -9
- package/dist/.buildstamp +1 -0
- package/dist/autotest-cli.js +1 -1
- package/dist/common/config/config.yaml +144 -142
- package/dist/common/config/types.d.ts +2376 -2345
- package/dist/core/agent/layered_agent/execute_agent/agent_factory.d.ts +1 -1
- package/dist/core/agent/single_agent/agent.d.ts +4 -0
- package/dist/core/agent/single_agent/image_utils.d.ts +8 -0
- package/dist/core/agent/single_agent/llm_helper.d.ts +2 -0
- package/dist/core/agent/single_agent/scroll_search_agent.d.ts +15 -0
- package/dist/core/mcp/android_adapter.d.ts +1 -1
- package/dist/core/mcp/ios_adapter.d.ts +1 -1
- package/dist/core/memory/_utils.d.ts +1 -1
- package/dist/core/memory/tool_player_replan.d.ts +3 -4
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/mcp-server/types.d.ts +120 -120
- package/dist/reporter/html_template/_cards.d.ts +21 -0
- package/dist/reporter/html_template/_markers.d.ts +11 -0
- package/dist/reporter/html_template/_scripts.d.ts +6 -0
- package/dist/reporter/html_template/_sidebar.d.ts +24 -0
- package/dist/reporter/html_template/_styles.d.ts +6 -0
- package/dist/reporter/html_template/_top_section.d.ts +33 -0
- package/dist/reporter/html_template/_utils.d.ts +87 -0
- package/dist/reporter/html_template/index.d.ts +2 -65
- package/dist/reporter/types.d.ts +14 -14
- package/dist/tools/batch_runner.d.ts +5 -0
- package/dist/tools/batch_runner.js +1 -1
- package/dist/tools/case_runner/runner.js +1 -1
- package/dist/tools/config/config_tool.js +1 -1
- package/dist/tools/gen_analysis_report.d.ts +12 -0
- package/dist/tools/gen_report.d.ts +13 -44
- package/dist/tools/prompt_compare/compare_runner.js +1 -1
- package/package.json +2 -2
- package/scripts/gen_analysis_report.js +0 -724
|
@@ -17,7 +17,7 @@ export declare class AgentFactory {
|
|
|
17
17
|
private static loaded;
|
|
18
18
|
static register(name: string, factory: AgentFactoryFn): void;
|
|
19
19
|
static getAgentFactory(provider: string): AgentFactoryFn;
|
|
20
|
-
static create(provider: string, opts: AgentCreateOptions): BaseAgent;
|
|
20
|
+
static create(provider: string | undefined, opts: AgentCreateOptions): BaseAgent;
|
|
21
21
|
static loadBuiltinAgents(): void;
|
|
22
22
|
}
|
|
23
23
|
export declare function createAgent(provider?: string): AgentFactoryFn;
|
|
@@ -11,6 +11,10 @@ export declare class SingleAgent {
|
|
|
11
11
|
private stepNumber;
|
|
12
12
|
private maxSteps;
|
|
13
13
|
private maxResultRetries;
|
|
14
|
+
/** 连续无有效动作(无工具调用且无结果判定)的步数,用于早退防空转 */
|
|
15
|
+
private noActionStepCount;
|
|
16
|
+
/** 连续无动作早退阈值——超过即终止,防模型退化为叙事模式空转烧 token */
|
|
17
|
+
private readonly maxNoActionSteps;
|
|
14
18
|
private lastScreenshot;
|
|
15
19
|
private previousScreenshotB64;
|
|
16
20
|
private lastActionInfo;
|
|
@@ -19,6 +19,14 @@ export declare function drawActionMarker(base64Data: string, action: {
|
|
|
19
19
|
start?: [number, number];
|
|
20
20
|
end?: [number, number];
|
|
21
21
|
}): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Draw a red bounding box on a screenshot(对齐 Python image_utils.draw_bounding_box)。
|
|
24
|
+
* scroll_search 在送判断 LLM 的截图上画区域红框,助 LLM 聚焦搜索区域
|
|
25
|
+
* (Python screen_executor.draw_bbox 同此)。
|
|
26
|
+
* @param base64Data base64 jpeg
|
|
27
|
+
* @param bbox [left, top, right, bottom] 0-1 归一化坐标
|
|
28
|
+
*/
|
|
29
|
+
export declare function drawBoundingBox(base64Data: string, bbox: [number, number, number, number] | number[] | null | undefined): Promise<string>;
|
|
22
30
|
/**
|
|
23
31
|
* Build a user message with previous screenshot (with action marker) + current screenshot + progress history.
|
|
24
32
|
* Returns content blocks for the AI SDK user message.
|
|
@@ -54,6 +54,21 @@ export declare class ScrollSearchAgent {
|
|
|
54
54
|
private _parseStepJudgment;
|
|
55
55
|
private _calculateSwipeDistance;
|
|
56
56
|
private _adjustNumericSwipe;
|
|
57
|
+
/**
|
|
58
|
+
* 发射子代理报告事件(经 reportGenerator.addEvent 进入报告链路)。
|
|
59
|
+
* 被 SubagentManager 以缓冲代理包装时,事件路由到缓冲区,子代理结束后统一
|
|
60
|
+
* 挂载到父 run_subagent 的 mcp_tool_start 事件下(对齐 Python ReportHook 的
|
|
61
|
+
* on_subagent_start/end 缓冲 + attach_sub_events 挂载语义)。
|
|
62
|
+
* 事件 data 采用 snake_case 键(tool_name/arguments/result),与报告渲染层
|
|
63
|
+
* 子事件消费契约一致;发射失败仅告警,不阻断子代理执行。
|
|
64
|
+
*/
|
|
65
|
+
private _emitEvent;
|
|
66
|
+
/**
|
|
67
|
+
* base64 截图落盘至报告 screenPath/(缓冲代理对 saveScreenshot 透传到真实
|
|
68
|
+
* generator,截图始终写入真实报告目录),返回文件路径;失败返回 null(事件
|
|
69
|
+
* 以无截图形态发射,不阻断)。
|
|
70
|
+
*/
|
|
71
|
+
private _persistScreenshot;
|
|
57
72
|
private _executeSwipe;
|
|
58
73
|
private _takeScreenshot;
|
|
59
74
|
private _scaleFrom1000;
|
|
@@ -12,7 +12,7 @@ export declare class AndroidMCPAdapter extends MCPDeviceAdapterBase {
|
|
|
12
12
|
private static readonly MCP_SERVICE_PORT;
|
|
13
13
|
private static readonly SCREENSHOT_TOOL_NAME;
|
|
14
14
|
private static readonly PRESS_BUTTON_TOOL;
|
|
15
|
-
constructor(adbPath: string, configManager: ConfigManager);
|
|
15
|
+
constructor(adbPath: string | undefined, configManager: ConfigManager);
|
|
16
16
|
getDefaultServerUrl(): string;
|
|
17
17
|
getMcpServicePort(): number;
|
|
18
18
|
useSseTransport(): boolean;
|
|
@@ -12,7 +12,7 @@ export declare class IOSMCPAdapter extends MCPDeviceAdapterBase {
|
|
|
12
12
|
private static readonly MCP_SERVICE_PORT;
|
|
13
13
|
private static readonly SCREENSHOT_TOOL_NAME;
|
|
14
14
|
private static readonly PRESS_BUTTON_TOOL;
|
|
15
|
-
constructor(devicectlPath: string, configManager: ConfigManager);
|
|
15
|
+
constructor(devicectlPath: string | undefined, configManager: ConfigManager);
|
|
16
16
|
getDefaultServerUrl(): string;
|
|
17
17
|
getMcpServicePort(): number;
|
|
18
18
|
useSseTransport(): boolean;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Provides helpers for response text extraction, message filtering, retry
|
|
6
6
|
* decoration, and a lightweight TimeCalculate class used by ToolPlayer.
|
|
7
7
|
*/
|
|
8
|
-
export declare function fallbackToGlobal<T>(config: unknown, extractor: (cfg: unknown) => T, validator?: ((value: T) => boolean) | null, label?: string, globalConfig?: unknown): T | null;
|
|
8
|
+
export declare function fallbackToGlobal<T>(config: unknown, extractor: (cfg: unknown) => T, validator?: ((value: T | null) => boolean) | null, label?: string, globalConfig?: unknown): T | null;
|
|
9
9
|
export declare function isValidModelConfig(modelConfig: unknown): boolean;
|
|
10
10
|
export declare function extractTextFromResponse(response: unknown): string;
|
|
11
11
|
export declare function filterImagesFromMessage(message: unknown): unknown;
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* Delegates to a replanCallback callable so the host application owns the
|
|
7
7
|
* replanning lifecycle.
|
|
8
8
|
*/
|
|
9
|
-
interface RecordingRecord {
|
|
9
|
+
export interface RecordingRecord {
|
|
10
10
|
toolName?: string;
|
|
11
11
|
tool_name?: string;
|
|
12
12
|
arguments?: Record<string, unknown>;
|
|
13
13
|
result?: unknown;
|
|
14
14
|
}
|
|
15
|
-
interface FailureInfo {
|
|
15
|
+
export interface FailureInfo {
|
|
16
16
|
failureReason?: string;
|
|
17
17
|
failure_reason?: string;
|
|
18
18
|
failedStep?: string;
|
|
@@ -23,7 +23,7 @@ interface FailureInfo {
|
|
|
23
23
|
originalTask?: string;
|
|
24
24
|
original_task?: string;
|
|
25
25
|
}
|
|
26
|
-
interface ReplanHost {
|
|
26
|
+
export interface ReplanHost {
|
|
27
27
|
replanTriggered: boolean;
|
|
28
28
|
replanCallback?: (prompt: string) => Promise<string>;
|
|
29
29
|
currentSession: {
|
|
@@ -46,4 +46,3 @@ export declare class ReplanMixin {
|
|
|
46
46
|
static parseResultSummary(result: unknown): [string, boolean];
|
|
47
47
|
triggerReplan(failureInfo: FailureInfo, remainingTimeout?: number): Promise<void>;
|
|
48
48
|
}
|
|
49
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_VERSION = "0.0.22";
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ export { CacheStrategy, DashScopeCacheStrategy, CACHE_STRATEGIES, injectPromptCa
|
|
|
35
35
|
export { McpServerToolName, TOOL_DESCRIPTIONS, ClickInputSchema, DoubleClickInputSchema, LongClickInputSchema, SwipeInputSchema, DragInputSchema, InputTextInputSchema, ClearTextInputSchema, GoBackInputSchema, GoHomeInputSchema, StartAppInputSchema, StopAppInputSchema, ClearAppDataInputSchema, WaitInputSchema, PressKeyInputSchema, ScreenOnInputSchema, ScreenOffInputSchema, UnlockScreenInputSchema, ClearRecentTaskInputSchema, EnterRecentTaskInputSchema, GetCurrentAppInputSchema, ScreenshotInputSchema, LayoutInputSchema, McpCleanUpInputSchema, OpenControlCenterInputSchema, OpenNotificationCenterInputSchema, PinchInInputSchema, PinchOutInputSchema, RotateGestureInputSchema, RotateScreenInputSchema, StopAllAppInputSchema, StartListenToastInputSchema, GetToastInputSchema, StartDataCollectInputSchema, StopDataCollectInputSchema, GenerateReportInputSchema, ListDevicesInputSchema, RunTaskInputSchema, GetTaskResultInputSchema, ResumeTaskInputSchema, AnalyzeFailureInputSchema, GetConfigInputSchema, UpdateConfigInputSchema, type McpServerConfig, type McpServerCapabilities, } from './mcp-server/types';
|
|
36
36
|
export { main } from './autotest-cli';
|
|
37
37
|
export { MessageBuilder, type LLMMessage } from './core/agent/utils/message_builder';
|
|
38
|
-
export { KnowledgeManager } from './core/knowledge/knowledge_manager';
|
|
39
38
|
export { CompressedSession, makeSessionInputFilter, compressContext, estimateTokens, Reflector, ToolRecorder, ToolPlayer, createSession, type CompressionConfig, type CompressionResult, type ReflectionConfig, type ToolCallRecord, type RecordingSession, type SessionType, } from './core/memory/memory_manager';
|
|
40
39
|
export { SkillManager } from './core/skill/skill_manager';
|
|
41
40
|
export { TaskSplitter, type TaskSplitResult, type StepDefinition } from './core/preprocessor/task_splitter';
|