@midscene/test 1.12.4-beta-20260903111111.0 → 1.12.4
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/android/index.mjs +50 -106
- package/dist/es/android/index.mjs.map +1 -1
- package/dist/es/cli/index.mjs +99 -149
- package/dist/es/cli/index.mjs.map +1 -1
- package/dist/es/harmony/index.mjs +119 -0
- package/dist/es/harmony/index.mjs.map +1 -0
- package/dist/es/index.mjs +36 -87
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/ios/index.mjs +51 -101
- package/dist/es/ios/index.mjs.map +1 -1
- package/dist/es/midscene/index.mjs +37 -235
- package/dist/es/midscene/index.mjs.map +1 -1
- package/dist/es/playwright/index.mjs +14 -10
- package/dist/es/playwright/index.mjs.map +1 -1
- package/dist/es/test-cli.mjs +102 -150
- package/dist/es/test-cli.mjs.map +1 -1
- package/dist/lib/android/index.js +151 -178
- package/dist/lib/android/index.js.map +1 -1
- package/dist/lib/cli/index.js +99 -149
- package/dist/lib/cli/index.js.map +1 -1
- package/dist/lib/harmony/index.js +188 -0
- package/dist/lib/harmony/index.js.map +1 -0
- package/dist/lib/index.js +37 -100
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/ios/index.js +152 -173
- package/dist/lib/ios/index.js.map +1 -1
- package/dist/lib/midscene/index.js +264 -412
- package/dist/lib/midscene/index.js.map +1 -1
- package/dist/lib/playwright/index.js +14 -10
- package/dist/lib/playwright/index.js.map +1 -1
- package/dist/lib/test-cli.js +102 -150
- package/dist/lib/test-cli.js.map +1 -1
- package/dist/types/android/index.d.ts +27 -101
- package/dist/types/cli/index.d.ts +9 -32
- package/dist/types/harmony/index.d.ts +124 -0
- package/dist/types/index.d.ts +18 -45
- package/dist/types/ios/index.d.ts +28 -107
- package/dist/types/midscene/index.d.ts +54 -153
- package/dist/types/playwright/index.d.ts +9 -63
- package/package.json +25 -6
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IOSAgent } from '@midscene/ios';
|
|
2
|
+
import { launchInputSchema } from '@midscene/ios/test-runner';
|
|
3
|
+
import { LaunchNodeInput } from '@midscene/ios/test-runner';
|
|
4
|
+
import { runWdaRequestInputSchema } from '@midscene/ios/test-runner';
|
|
5
|
+
import { RunWdaRequestNodeInput } from '@midscene/ios/test-runner';
|
|
6
|
+
import { terminateInputSchema } from '@midscene/ios/test-runner';
|
|
7
|
+
import { TerminateNodeInput } from '@midscene/ios/test-runner';
|
|
8
|
+
import { WDAHttpMethod } from '@midscene/ios/test-runner';
|
|
9
|
+
import { wdaRequestInputSchema } from '@midscene/ios/test-runner';
|
|
10
|
+
import type { z } from 'zod/v4';
|
|
2
11
|
|
|
3
12
|
declare type Awaitable<T> = T | Promise<T>;
|
|
4
13
|
|
|
@@ -10,62 +19,39 @@ declare interface CaseExecutionContext {
|
|
|
10
19
|
readonly name: string;
|
|
11
20
|
readonly sourcePath: string;
|
|
12
21
|
readonly caseIndex: number;
|
|
13
|
-
readonly completedSteps: readonly StepRunResult[];
|
|
14
22
|
}
|
|
15
23
|
|
|
16
24
|
declare type CaseNodePhase = 'beforeEach' | 'steps' | 'afterEach';
|
|
17
25
|
|
|
18
|
-
declare interface CommonNodeInput {
|
|
19
|
-
prompt?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** Create the P0 iOS preset Nodes for an injected iOS Agent. */
|
|
23
26
|
export declare function createIOSNodes<TContext>(options: CreateIOSNodesOptions<TContext>): readonly NodeDefinition<any, any, TContext>[];
|
|
24
27
|
|
|
25
|
-
/** Dependencies used by the iOS preset Nodes. */
|
|
26
28
|
export declare interface CreateIOSNodesOptions<TContext> {
|
|
27
|
-
|
|
28
|
-
getAgent(ctx: NodeContext<TContext>): Awaitable<IOSRunnerAgent>;
|
|
29
|
+
getAgent(ctx: NodeExecutionContext<unknown, TContext>): Awaitable<IOSRunnerAgent>;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
declare interface DefineNodeOptions<TInput = unknown, TData = unknown, TContext = unknown> {
|
|
32
33
|
name: string;
|
|
33
34
|
title?: string;
|
|
34
35
|
description?: string;
|
|
36
|
+
/** Object field populated by string shorthand. Omit or set false to disable it. */
|
|
37
|
+
stringInputKey?: string | false;
|
|
35
38
|
inputSchema?: NodeInputSchema;
|
|
36
39
|
execute(ctx: NodeExecutionContext<TInput, TContext>): NodeExecutionReturn<TData>;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
/** Device capabilities required by Android and iOS lifecycle Nodes. */
|
|
40
|
-
declare interface DeviceLifecycleAgent {
|
|
41
|
-
launch(uri: string): Promise<void>;
|
|
42
|
-
terminate(uri: string): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
42
|
declare type DocumentNodePhase = 'beforeAll' | 'afterAll';
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
export declare interface IOSRunnerAgent extends DeviceLifecycleAgent {
|
|
49
|
-
/** Execute one WebDriverAgent request through the iOS Agent action API. */
|
|
50
|
-
runWdaRequest(input: RunWdaRequestNodeInput): Promise<unknown>;
|
|
51
|
-
}
|
|
44
|
+
export declare type IOSRunnerAgent = Pick<IOSAgent, 'launch' | 'terminate' | 'runWdaRequest' | 'home' | 'appSwitcher'>;
|
|
52
45
|
|
|
53
|
-
|
|
54
|
-
export declare const launchInputSchema: z.ZodObject<{
|
|
55
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
56
|
-
uri: z.ZodOptional<z.ZodString>;
|
|
57
|
-
}, z.core.$strict>;
|
|
46
|
+
export { launchInputSchema }
|
|
58
47
|
|
|
59
|
-
export
|
|
48
|
+
export { LaunchNodeInput }
|
|
60
49
|
|
|
61
50
|
declare interface NodeCaseContext extends CaseExecutionContext {
|
|
62
51
|
readonly phase: CaseNodePhase;
|
|
63
52
|
readonly stepIndex: number;
|
|
64
|
-
readonly completedNodes: readonly StepRunResult[];
|
|
65
53
|
}
|
|
66
54
|
|
|
67
|
-
declare type NodeContext<TContext> = NodeExecutionContext<unknown, TContext>;
|
|
68
|
-
|
|
69
55
|
declare interface NodeDefinition<TInput = unknown, TData = unknown, TContext = unknown> extends DefineNodeOptions<TInput, TData, TContext> {
|
|
70
56
|
}
|
|
71
57
|
|
|
@@ -77,64 +63,43 @@ declare interface NodeDocumentContext {
|
|
|
77
63
|
readonly sourcePath: string;
|
|
78
64
|
readonly phase: DocumentNodePhase;
|
|
79
65
|
readonly stepIndex: number;
|
|
80
|
-
readonly completedNodes: readonly StepRunResult[];
|
|
81
66
|
}
|
|
82
67
|
|
|
83
68
|
declare type NodeExecutionContext<TInput = unknown, TContext = unknown> = NodeExecutionContextBase<TInput, TContext> & ({
|
|
84
69
|
/** The node is running for one case. */
|
|
85
70
|
scope: 'case';
|
|
86
|
-
/** Identity and
|
|
71
|
+
/** Identity and phase information for the case being executed. */
|
|
87
72
|
case: NodeCaseContext;
|
|
88
73
|
document?: never;
|
|
89
74
|
} | {
|
|
90
75
|
/** The node is running for the workflow document. */
|
|
91
76
|
scope: 'document';
|
|
92
|
-
/** Identity and
|
|
77
|
+
/** Identity and phase information for the document being executed. */
|
|
93
78
|
document: NodeDocumentContext;
|
|
94
79
|
case?: never;
|
|
95
80
|
});
|
|
96
81
|
|
|
97
82
|
declare interface NodeExecutionContextBase<TInput = unknown, TContext = unknown> {
|
|
98
|
-
/** The node input without
|
|
99
|
-
input: TInput
|
|
83
|
+
/** The validated node input without `$`. */
|
|
84
|
+
input: TInput;
|
|
100
85
|
/** The normalized engine metadata for this step. */
|
|
101
86
|
$: Readonly<NormalizedStepMeta>;
|
|
102
87
|
/** The timeout and cancellation signal for this step. */
|
|
103
88
|
signal: AbortSignal;
|
|
104
89
|
/** Resources shared by the current workflow document. */
|
|
105
90
|
context: TContext;
|
|
106
|
-
/** Read-only results completed in the current document/case scope. */
|
|
107
|
-
history: readonly NodeHistoryEntry[];
|
|
108
91
|
/** Register resource cleanup for the current case attempt or document. */
|
|
109
92
|
onTeardown(teardown: NodeScopeTeardown): void;
|
|
110
93
|
}
|
|
111
94
|
|
|
112
|
-
declare type NodeExecutionPhase = CaseNodePhase | DocumentNodePhase;
|
|
113
|
-
|
|
114
95
|
declare type NodeExecutionReturn<TData = unknown> = Promise<NodeResult<TData> | void> | NodeResult<TData> | void;
|
|
115
96
|
|
|
116
|
-
declare interface NodeHistoryEntry {
|
|
117
|
-
readonly scope: 'document' | 'case';
|
|
118
|
-
readonly phase: NodeExecutionPhase;
|
|
119
|
-
readonly stepIndex: number;
|
|
120
|
-
readonly node: string;
|
|
121
|
-
readonly input?: unknown;
|
|
122
|
-
readonly intent?: string;
|
|
123
|
-
readonly status: 'passed' | 'failed' | 'skipped';
|
|
124
|
-
readonly summary?: string;
|
|
125
|
-
readonly data?: unknown;
|
|
126
|
-
readonly error?: {
|
|
127
|
-
readonly name: string;
|
|
128
|
-
readonly message: string;
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
97
|
declare type NodeInputSchema = z.ZodObject;
|
|
133
98
|
|
|
134
99
|
declare interface NodeResult<TData = unknown> {
|
|
135
|
-
/** Human-readable summary for reports
|
|
100
|
+
/** Human-readable summary for reports. */
|
|
136
101
|
summary?: string;
|
|
137
|
-
/** Structured data
|
|
102
|
+
/** Structured data included in the step result. */
|
|
138
103
|
data?: TData;
|
|
139
104
|
}
|
|
140
105
|
|
|
@@ -150,60 +115,16 @@ declare interface NormalizedStepMeta {
|
|
|
150
115
|
continueOnError: boolean;
|
|
151
116
|
}
|
|
152
117
|
|
|
153
|
-
|
|
154
|
-
export declare const runWdaRequestInputSchema: z.ZodObject<{
|
|
155
|
-
method: z.ZodEnum<{
|
|
156
|
-
GET: "GET";
|
|
157
|
-
POST: "POST";
|
|
158
|
-
DELETE: "DELETE";
|
|
159
|
-
PUT: "PUT";
|
|
160
|
-
}>;
|
|
161
|
-
endpoint: z.ZodString;
|
|
162
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
163
|
-
}, z.core.$strict>;
|
|
164
|
-
|
|
165
|
-
/** Validated input accepted by the iOS runWdaRequest Node. */
|
|
166
|
-
export declare type RunWdaRequestNodeInput = z.infer<typeof runWdaRequestInputSchema>;
|
|
167
|
-
|
|
168
|
-
declare interface StepRunResult<TOutputData = unknown> {
|
|
169
|
-
phase: NodeExecutionPhase;
|
|
170
|
-
stepIndex: number;
|
|
171
|
-
node: string;
|
|
172
|
-
input: unknown;
|
|
173
|
-
meta: NormalizedStepMeta;
|
|
174
|
-
status: 'success' | 'failed';
|
|
175
|
-
continuedAfterError: boolean;
|
|
176
|
-
startedAt: string;
|
|
177
|
-
endedAt: string;
|
|
178
|
-
durationMs: number;
|
|
179
|
-
output?: NodeResult<TOutputData>;
|
|
180
|
-
error?: WorkflowError;
|
|
181
|
-
}
|
|
118
|
+
export { runWdaRequestInputSchema }
|
|
182
119
|
|
|
183
|
-
|
|
184
|
-
export declare const terminateInputSchema: z.ZodObject<{
|
|
185
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
186
|
-
uri: z.ZodOptional<z.ZodString>;
|
|
187
|
-
}, z.core.$strict>;
|
|
120
|
+
export { RunWdaRequestNodeInput }
|
|
188
121
|
|
|
189
|
-
export
|
|
122
|
+
export { terminateInputSchema }
|
|
190
123
|
|
|
191
|
-
|
|
124
|
+
export { TerminateNodeInput }
|
|
192
125
|
|
|
193
|
-
|
|
194
|
-
export declare type WDAHttpMethod = (typeof WDA_HTTP_METHODS)[number];
|
|
126
|
+
export { WDAHttpMethod }
|
|
195
127
|
|
|
196
|
-
|
|
197
|
-
readonly code: string;
|
|
198
|
-
readonly details?: unknown;
|
|
199
|
-
constructor(message: string, options?: WorkflowErrorOptions);
|
|
200
|
-
toJSON(): Record<string, unknown>;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
declare interface WorkflowErrorOptions {
|
|
204
|
-
code?: string;
|
|
205
|
-
details?: unknown;
|
|
206
|
-
cause?: unknown;
|
|
207
|
-
}
|
|
128
|
+
export { wdaRequestInputSchema }
|
|
208
129
|
|
|
209
130
|
export { }
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
import { AgentTestRunnerNodeDefinition } from '@midscene/core/agent/test-runner';
|
|
2
|
+
import { AgentTestRunnerNodeProvider } from '@midscene/core/agent/test-runner';
|
|
3
|
+
import { aiActInputSchema } from '@midscene/core/agent/test-runner';
|
|
4
|
+
import { aiActOptionsInputSchema } from '@midscene/core/agent/test-runner';
|
|
5
|
+
import { aiAssertInputSchema } from '@midscene/core/agent/test-runner';
|
|
6
|
+
import { aiAssertOptionsInputSchema } from '@midscene/core/agent/test-runner';
|
|
7
|
+
import { aiTapInputSchema } from '@midscene/core/agent/test-runner';
|
|
8
|
+
import { CommonAgentTestRunnerApi } from '@midscene/core/agent/test-runner';
|
|
9
|
+
import { insightInputSchema } from '@midscene/core/agent/test-runner';
|
|
10
|
+
import { insightOptionsInputSchema } from '@midscene/core/agent/test-runner';
|
|
11
|
+
import { locateOptionsInputSchema } from '@midscene/core/agent/test-runner';
|
|
12
|
+
import { promptImageInputSchema } from '@midscene/core/agent/test-runner';
|
|
13
|
+
import { recordToReportInputSchema } from '@midscene/core/agent/test-runner';
|
|
14
|
+
import { recordToReportOptionsInputSchema } from '@midscene/core/agent/test-runner';
|
|
15
|
+
import { reportScreenshotInputSchema } from '@midscene/core/agent/test-runner';
|
|
16
|
+
import { structuredUserPromptInputSchema } from '@midscene/core/agent/test-runner';
|
|
17
|
+
import { userPromptInputSchema } from '@midscene/core/agent/test-runner';
|
|
1
18
|
import { z } from 'zod/v4';
|
|
2
19
|
|
|
3
20
|
export declare interface AgentExecutor<TContext> {
|
|
@@ -6,7 +23,6 @@ export declare interface AgentExecutor<TContext> {
|
|
|
6
23
|
|
|
7
24
|
export declare interface AgentExecutorInput<TContext> {
|
|
8
25
|
prompt: string;
|
|
9
|
-
history: readonly NodeHistoryEntry[];
|
|
10
26
|
context: TContext;
|
|
11
27
|
signal: AbortSignal;
|
|
12
28
|
execution: {
|
|
@@ -35,41 +51,22 @@ export declare interface AgentReleaseResult {
|
|
|
35
51
|
reportPath?: string;
|
|
36
52
|
}
|
|
37
53
|
|
|
38
|
-
export
|
|
39
|
-
prompt: z.ZodString;
|
|
40
|
-
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
41
|
-
name: z.ZodString;
|
|
42
|
-
url: z.ZodString;
|
|
43
|
-
}, z.core.$strict>>>;
|
|
44
|
-
convertHttpImage2Base64: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
46
|
-
cacheable: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
-
fileChooserAccept: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
48
|
-
deepThink: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"unset">, z.ZodBoolean]>>;
|
|
49
|
-
deepLocate: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
-
context: z.ZodOptional<z.ZodString>;
|
|
51
|
-
}, z.core.$strict>>;
|
|
52
|
-
}, z.core.$strict>;
|
|
54
|
+
export { aiActInputSchema }
|
|
53
55
|
|
|
54
56
|
export declare type AiActNodeInput = z.infer<typeof aiActInputSchema>;
|
|
55
57
|
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
url: z.ZodString;
|
|
61
|
-
}, z.core.$strict>>>;
|
|
62
|
-
convertHttpImage2Base64: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
-
message: z.ZodOptional<z.ZodString>;
|
|
64
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
65
|
-
domIncluded: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"visible-only">]>>;
|
|
66
|
-
screenshotIncluded: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
-
context: z.ZodOptional<z.ZodString>;
|
|
68
|
-
}, z.core.$strict>>;
|
|
69
|
-
}, z.core.$strict>;
|
|
58
|
+
export { aiActOptionsInputSchema }
|
|
59
|
+
|
|
60
|
+
export { aiAssertInputSchema }
|
|
70
61
|
|
|
71
62
|
export declare type AiAssertNodeInput = z.infer<typeof aiAssertInputSchema>;
|
|
72
63
|
|
|
64
|
+
export { aiAssertOptionsInputSchema }
|
|
65
|
+
|
|
66
|
+
export { aiTapInputSchema }
|
|
67
|
+
|
|
68
|
+
export declare type AiTapNodeInput = z.infer<typeof aiTapInputSchema>;
|
|
69
|
+
|
|
73
70
|
declare type Awaitable<T> = T | Promise<T>;
|
|
74
71
|
|
|
75
72
|
declare interface CaseExecutionContext {
|
|
@@ -80,22 +77,20 @@ declare interface CaseExecutionContext {
|
|
|
80
77
|
readonly name: string;
|
|
81
78
|
readonly sourcePath: string;
|
|
82
79
|
readonly caseIndex: number;
|
|
83
|
-
readonly completedSteps: readonly StepRunResult[];
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
declare type CaseNodePhase = 'beforeEach' | 'steps' | 'afterEach';
|
|
87
83
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
84
|
+
/** Adapt Agent-owned descriptions to executable Test Runner Nodes. */
|
|
85
|
+
export declare const createAgentTestRunnerNodes: <TContext>(definitions: readonly AgentTestRunnerNodeDefinition[], getAgent: (ctx: NodeExecutionContext<unknown, TContext>) => Awaitable<unknown>) => readonly NodeDefinition<any, any, TContext>[];
|
|
91
86
|
|
|
92
87
|
export declare function createMidsceneNodes<TContext>(options: CreateMidsceneNodesOptions<TContext>): readonly NodeDefinition<any, any, TContext>[];
|
|
93
88
|
|
|
94
89
|
export declare interface CreateMidsceneNodesOptions<TContext> {
|
|
95
90
|
getAgent?(ctx: NodeExecutionContext<unknown, TContext>): Awaitable<MidsceneUIAgent>;
|
|
96
91
|
agentProvider?: AgentProvider<TContext>;
|
|
97
|
-
/**
|
|
98
|
-
|
|
92
|
+
/** Agent class that declares the Agent-backed Nodes to register. */
|
|
93
|
+
agentClass: AgentTestRunnerNodeProvider;
|
|
99
94
|
agentExecutor?: AgentExecutor<TContext>;
|
|
100
95
|
}
|
|
101
96
|
|
|
@@ -103,71 +98,27 @@ declare interface DefineNodeOptions<TInput = unknown, TData = unknown, TContext
|
|
|
103
98
|
name: string;
|
|
104
99
|
title?: string;
|
|
105
100
|
description?: string;
|
|
101
|
+
/** Object field populated by string shorthand. Omit or set false to disable it. */
|
|
102
|
+
stringInputKey?: string | false;
|
|
106
103
|
inputSchema?: NodeInputSchema;
|
|
107
104
|
execute(ctx: NodeExecutionContext<TInput, TContext>): NodeExecutionReturn<TData>;
|
|
108
105
|
}
|
|
109
106
|
|
|
110
107
|
declare type DocumentNodePhase = 'beforeAll' | 'afterAll';
|
|
111
108
|
|
|
112
|
-
|
|
113
|
-
export declare const launchInputSchema: z.ZodObject<{
|
|
114
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
115
|
-
uri: z.ZodOptional<z.ZodString>;
|
|
116
|
-
}, z.core.$strict>;
|
|
109
|
+
export { insightInputSchema }
|
|
117
110
|
|
|
118
|
-
export declare type
|
|
119
|
-
|
|
120
|
-
export declare interface MidsceneAiActOptions {
|
|
121
|
-
cacheable?: boolean;
|
|
122
|
-
fileChooserAccept?: string | string[];
|
|
123
|
-
deepThink?: 'unset' | boolean;
|
|
124
|
-
deepLocate?: boolean;
|
|
125
|
-
context?: string;
|
|
126
|
-
abortSignal?: AbortSignal;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export declare interface MidsceneAiAssertOptions {
|
|
130
|
-
domIncluded?: boolean | 'visible-only';
|
|
131
|
-
screenshotIncluded?: boolean;
|
|
132
|
-
context?: string;
|
|
133
|
-
abortSignal?: AbortSignal;
|
|
134
|
-
keepRawResponse?: boolean;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export declare interface MidscenePromptImage {
|
|
138
|
-
name: string;
|
|
139
|
-
url: string;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export declare interface MidsceneRecordToReportOptions {
|
|
143
|
-
content?: string;
|
|
144
|
-
screenshotBase64?: string;
|
|
145
|
-
screenshots?: MidsceneReportScreenshot[];
|
|
146
|
-
}
|
|
111
|
+
export declare type InsightNodeInput = z.infer<typeof insightInputSchema>;
|
|
147
112
|
|
|
148
|
-
export
|
|
149
|
-
base64: string;
|
|
150
|
-
description?: string;
|
|
151
|
-
}
|
|
113
|
+
export { insightOptionsInputSchema }
|
|
152
114
|
|
|
153
|
-
export
|
|
154
|
-
aiAct(prompt: MidsceneUserPrompt, options?: MidsceneAiActOptions): Promise<string | undefined>;
|
|
155
|
-
aiAssert(prompt: MidsceneUserPrompt, message?: string, options?: MidsceneAiAssertOptions): Promise<unknown>;
|
|
156
|
-
recordToReport(title?: string, options?: MidsceneRecordToReportOptions): Promise<unknown>;
|
|
157
|
-
/** Available on device Agents that support launching an app, URL, or URI. */
|
|
158
|
-
launch?(uri: string): Promise<void>;
|
|
159
|
-
}
|
|
115
|
+
export { locateOptionsInputSchema }
|
|
160
116
|
|
|
161
|
-
export declare type
|
|
162
|
-
prompt: string;
|
|
163
|
-
images?: MidscenePromptImage[];
|
|
164
|
-
convertHttpImage2Base64?: boolean;
|
|
165
|
-
};
|
|
117
|
+
export declare type MidsceneUIAgent = CommonAgentTestRunnerApi;
|
|
166
118
|
|
|
167
119
|
declare interface NodeCaseContext extends CaseExecutionContext {
|
|
168
120
|
readonly phase: CaseNodePhase;
|
|
169
121
|
readonly stepIndex: number;
|
|
170
|
-
readonly completedNodes: readonly StepRunResult[];
|
|
171
122
|
}
|
|
172
123
|
|
|
173
124
|
declare interface NodeDefinition<TInput = unknown, TData = unknown, TContext = unknown> extends DefineNodeOptions<TInput, TData, TContext> {
|
|
@@ -181,64 +132,43 @@ declare interface NodeDocumentContext {
|
|
|
181
132
|
readonly sourcePath: string;
|
|
182
133
|
readonly phase: DocumentNodePhase;
|
|
183
134
|
readonly stepIndex: number;
|
|
184
|
-
readonly completedNodes: readonly StepRunResult[];
|
|
185
135
|
}
|
|
186
136
|
|
|
187
137
|
declare type NodeExecutionContext<TInput = unknown, TContext = unknown> = NodeExecutionContextBase<TInput, TContext> & ({
|
|
188
138
|
/** The node is running for one case. */
|
|
189
139
|
scope: 'case';
|
|
190
|
-
/** Identity and
|
|
140
|
+
/** Identity and phase information for the case being executed. */
|
|
191
141
|
case: NodeCaseContext;
|
|
192
142
|
document?: never;
|
|
193
143
|
} | {
|
|
194
144
|
/** The node is running for the workflow document. */
|
|
195
145
|
scope: 'document';
|
|
196
|
-
/** Identity and
|
|
146
|
+
/** Identity and phase information for the document being executed. */
|
|
197
147
|
document: NodeDocumentContext;
|
|
198
148
|
case?: never;
|
|
199
149
|
});
|
|
200
150
|
|
|
201
151
|
declare interface NodeExecutionContextBase<TInput = unknown, TContext = unknown> {
|
|
202
|
-
/** The node input without
|
|
203
|
-
input: TInput
|
|
152
|
+
/** The validated node input without `$`. */
|
|
153
|
+
input: TInput;
|
|
204
154
|
/** The normalized engine metadata for this step. */
|
|
205
155
|
$: Readonly<NormalizedStepMeta>;
|
|
206
156
|
/** The timeout and cancellation signal for this step. */
|
|
207
157
|
signal: AbortSignal;
|
|
208
158
|
/** Resources shared by the current workflow document. */
|
|
209
159
|
context: TContext;
|
|
210
|
-
/** Read-only results completed in the current document/case scope. */
|
|
211
|
-
history: readonly NodeHistoryEntry[];
|
|
212
160
|
/** Register resource cleanup for the current case attempt or document. */
|
|
213
161
|
onTeardown(teardown: NodeScopeTeardown): void;
|
|
214
162
|
}
|
|
215
163
|
|
|
216
|
-
declare type NodeExecutionPhase = CaseNodePhase | DocumentNodePhase;
|
|
217
|
-
|
|
218
164
|
declare type NodeExecutionReturn<TData = unknown> = Promise<NodeResult<TData> | void> | NodeResult<TData> | void;
|
|
219
165
|
|
|
220
|
-
declare interface NodeHistoryEntry {
|
|
221
|
-
readonly scope: 'document' | 'case';
|
|
222
|
-
readonly phase: NodeExecutionPhase;
|
|
223
|
-
readonly stepIndex: number;
|
|
224
|
-
readonly node: string;
|
|
225
|
-
readonly input?: unknown;
|
|
226
|
-
readonly intent?: string;
|
|
227
|
-
readonly status: 'passed' | 'failed' | 'skipped';
|
|
228
|
-
readonly summary?: string;
|
|
229
|
-
readonly data?: unknown;
|
|
230
|
-
readonly error?: {
|
|
231
|
-
readonly name: string;
|
|
232
|
-
readonly message: string;
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
166
|
declare type NodeInputSchema = z.ZodObject;
|
|
237
167
|
|
|
238
168
|
declare interface NodeResult<TData = unknown> {
|
|
239
|
-
/** Human-readable summary for reports
|
|
169
|
+
/** Human-readable summary for reports. */
|
|
240
170
|
summary?: string;
|
|
241
|
-
/** Structured data
|
|
171
|
+
/** Structured data included in the step result. */
|
|
242
172
|
data?: TData;
|
|
243
173
|
}
|
|
244
174
|
|
|
@@ -254,35 +184,19 @@ declare interface NormalizedStepMeta {
|
|
|
254
184
|
continueOnError: boolean;
|
|
255
185
|
}
|
|
256
186
|
|
|
257
|
-
export
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
content: z.ZodOptional<z.ZodString>;
|
|
261
|
-
screenshotBase64: z.ZodOptional<z.ZodString>;
|
|
262
|
-
screenshots: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
263
|
-
base64: z.ZodString;
|
|
264
|
-
description: z.ZodOptional<z.ZodString>;
|
|
265
|
-
}, z.core.$strict>>>;
|
|
266
|
-
}, z.core.$strict>;
|
|
187
|
+
export { promptImageInputSchema }
|
|
188
|
+
|
|
189
|
+
export { recordToReportInputSchema }
|
|
267
190
|
|
|
268
191
|
export declare type RecordToReportNodeInput = z.infer<typeof recordToReportInputSchema>;
|
|
269
192
|
|
|
270
|
-
export
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
meta: NormalizedStepMeta;
|
|
278
|
-
status: 'success' | 'failed';
|
|
279
|
-
continuedAfterError: boolean;
|
|
280
|
-
startedAt: string;
|
|
281
|
-
endedAt: string;
|
|
282
|
-
durationMs: number;
|
|
283
|
-
output?: NodeResult<TOutputData>;
|
|
284
|
-
error?: WorkflowError;
|
|
285
|
-
}
|
|
193
|
+
export { recordToReportOptionsInputSchema }
|
|
194
|
+
|
|
195
|
+
export { reportScreenshotInputSchema }
|
|
196
|
+
|
|
197
|
+
export { structuredUserPromptInputSchema }
|
|
198
|
+
|
|
199
|
+
export { userPromptInputSchema }
|
|
286
200
|
|
|
287
201
|
export declare const waitInputSchema: z.ZodObject<{
|
|
288
202
|
duration: z.ZodNumber;
|
|
@@ -295,17 +209,4 @@ export declare const waitInputSchema: z.ZodObject<{
|
|
|
295
209
|
|
|
296
210
|
export declare type WaitNodeInput = z.infer<typeof waitInputSchema>;
|
|
297
211
|
|
|
298
|
-
declare class WorkflowError extends Error {
|
|
299
|
-
readonly code: string;
|
|
300
|
-
readonly details?: unknown;
|
|
301
|
-
constructor(message: string, options?: WorkflowErrorOptions);
|
|
302
|
-
toJSON(): Record<string, unknown>;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
declare interface WorkflowErrorOptions {
|
|
306
|
-
code?: string;
|
|
307
|
-
details?: unknown;
|
|
308
|
-
cause?: unknown;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
212
|
export { }
|