@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.
Files changed (40) hide show
  1. package/dist/es/android/index.mjs +50 -106
  2. package/dist/es/android/index.mjs.map +1 -1
  3. package/dist/es/cli/index.mjs +99 -149
  4. package/dist/es/cli/index.mjs.map +1 -1
  5. package/dist/es/harmony/index.mjs +119 -0
  6. package/dist/es/harmony/index.mjs.map +1 -0
  7. package/dist/es/index.mjs +36 -87
  8. package/dist/es/index.mjs.map +1 -1
  9. package/dist/es/ios/index.mjs +51 -101
  10. package/dist/es/ios/index.mjs.map +1 -1
  11. package/dist/es/midscene/index.mjs +37 -235
  12. package/dist/es/midscene/index.mjs.map +1 -1
  13. package/dist/es/playwright/index.mjs +14 -10
  14. package/dist/es/playwright/index.mjs.map +1 -1
  15. package/dist/es/test-cli.mjs +102 -150
  16. package/dist/es/test-cli.mjs.map +1 -1
  17. package/dist/lib/android/index.js +151 -178
  18. package/dist/lib/android/index.js.map +1 -1
  19. package/dist/lib/cli/index.js +99 -149
  20. package/dist/lib/cli/index.js.map +1 -1
  21. package/dist/lib/harmony/index.js +188 -0
  22. package/dist/lib/harmony/index.js.map +1 -0
  23. package/dist/lib/index.js +37 -100
  24. package/dist/lib/index.js.map +1 -1
  25. package/dist/lib/ios/index.js +152 -173
  26. package/dist/lib/ios/index.js.map +1 -1
  27. package/dist/lib/midscene/index.js +264 -412
  28. package/dist/lib/midscene/index.js.map +1 -1
  29. package/dist/lib/playwright/index.js +14 -10
  30. package/dist/lib/playwright/index.js.map +1 -1
  31. package/dist/lib/test-cli.js +102 -150
  32. package/dist/lib/test-cli.js.map +1 -1
  33. package/dist/types/android/index.d.ts +27 -101
  34. package/dist/types/cli/index.d.ts +9 -32
  35. package/dist/types/harmony/index.d.ts +124 -0
  36. package/dist/types/index.d.ts +18 -45
  37. package/dist/types/ios/index.d.ts +28 -107
  38. package/dist/types/midscene/index.d.ts +54 -153
  39. package/dist/types/playwright/index.d.ts +9 -63
  40. package/package.json +25 -6
@@ -12,7 +12,6 @@ declare interface CaseExecutionContext {
12
12
  readonly name: string;
13
13
  readonly sourcePath: string;
14
14
  readonly caseIndex: number;
15
- readonly completedSteps: readonly StepRunResult[];
16
15
  }
17
16
 
18
17
  declare type CaseNodePhase = 'beforeEach' | 'steps' | 'afterEach';
@@ -27,10 +26,6 @@ export declare const clearCookiesInputSchema: z.ZodObject<{
27
26
  /** Validated input accepted by the Playwright clearCookies Node. */
28
27
  export declare type ClearCookiesNodeInput = z.infer<typeof clearCookiesInputSchema>;
29
28
 
30
- declare interface CommonNodeInput {
31
- prompt?: string;
32
- }
33
-
34
29
  declare type CookieSourceReference = {
35
30
  kind: 'env';
36
31
  name: string;
@@ -73,6 +68,8 @@ declare interface DefineNodeOptions<TInput = unknown, TData = unknown, TContext
73
68
  name: string;
74
69
  title?: string;
75
70
  description?: string;
71
+ /** Object field populated by string shorthand. Omit or set false to disable it. */
72
+ stringInputKey?: string | false;
76
73
  inputSchema?: NodeInputSchema;
77
74
  execute(ctx: NodeExecutionContext<TInput, TContext>): NodeExecutionReturn<TData>;
78
75
  }
@@ -81,8 +78,7 @@ declare type DocumentNodePhase = 'beforeAll' | 'afterAll';
81
78
 
82
79
  /** Input schema for the Playwright gotoUrl Node. */
83
80
  export declare const gotoUrlInputSchema: z.ZodObject<{
84
- prompt: z.ZodOptional<z.ZodString>;
85
- url: z.ZodOptional<z.ZodString>;
81
+ url: z.ZodString;
86
82
  waitUntil: z.ZodDefault<z.ZodEnum<{
87
83
  domcontentloaded: "domcontentloaded";
88
84
  commit: "commit";
@@ -108,7 +104,6 @@ export declare interface GotoUrlNodeResult {
108
104
  declare interface NodeCaseContext extends CaseExecutionContext {
109
105
  readonly phase: CaseNodePhase;
110
106
  readonly stepIndex: number;
111
- readonly completedNodes: readonly StepRunResult[];
112
107
  }
113
108
 
114
109
  declare interface NodeDefinition<TInput = unknown, TData = unknown, TContext = unknown> extends DefineNodeOptions<TInput, TData, TContext> {
@@ -122,64 +117,43 @@ declare interface NodeDocumentContext {
122
117
  readonly sourcePath: string;
123
118
  readonly phase: DocumentNodePhase;
124
119
  readonly stepIndex: number;
125
- readonly completedNodes: readonly StepRunResult[];
126
120
  }
127
121
 
128
122
  declare type NodeExecutionContext<TInput = unknown, TContext = unknown> = NodeExecutionContextBase<TInput, TContext> & ({
129
123
  /** The node is running for one case. */
130
124
  scope: 'case';
131
- /** Identity and completed-step history for the case being executed. */
125
+ /** Identity and phase information for the case being executed. */
132
126
  case: NodeCaseContext;
133
127
  document?: never;
134
128
  } | {
135
129
  /** The node is running for the workflow document. */
136
130
  scope: 'document';
137
- /** Identity and completed-node history for the document being executed. */
131
+ /** Identity and phase information for the document being executed. */
138
132
  document: NodeDocumentContext;
139
133
  case?: never;
140
134
  });
141
135
 
142
136
  declare interface NodeExecutionContextBase<TInput = unknown, TContext = unknown> {
143
- /** The node input without `$`, including the common `prompt` input. */
144
- input: TInput & CommonNodeInput;
137
+ /** The validated node input without `$`. */
138
+ input: TInput;
145
139
  /** The normalized engine metadata for this step. */
146
140
  $: Readonly<NormalizedStepMeta>;
147
141
  /** The timeout and cancellation signal for this step. */
148
142
  signal: AbortSignal;
149
143
  /** Resources shared by the current workflow document. */
150
144
  context: TContext;
151
- /** Read-only results completed in the current document/case scope. */
152
- history: readonly NodeHistoryEntry[];
153
145
  /** Register resource cleanup for the current case attempt or document. */
154
146
  onTeardown(teardown: NodeScopeTeardown): void;
155
147
  }
156
148
 
157
- declare type NodeExecutionPhase = CaseNodePhase | DocumentNodePhase;
158
-
159
149
  declare type NodeExecutionReturn<TData = unknown> = Promise<NodeResult<TData> | void> | NodeResult<TData> | void;
160
150
 
161
- declare interface NodeHistoryEntry {
162
- readonly scope: 'document' | 'case';
163
- readonly phase: NodeExecutionPhase;
164
- readonly stepIndex: number;
165
- readonly node: string;
166
- readonly input?: unknown;
167
- readonly intent?: string;
168
- readonly status: 'passed' | 'failed' | 'skipped';
169
- readonly summary?: string;
170
- readonly data?: unknown;
171
- readonly error?: {
172
- readonly name: string;
173
- readonly message: string;
174
- };
175
- }
176
-
177
151
  declare type NodeInputSchema = z.ZodObject;
178
152
 
179
153
  declare interface NodeResult<TData = unknown> {
180
- /** Human-readable summary for reports and later agent context. */
154
+ /** Human-readable summary for reports. */
181
155
  summary?: string;
182
- /** Structured data for later steps. */
156
+ /** Structured data included in the step result. */
183
157
  data?: TData;
184
158
  }
185
159
 
@@ -239,32 +213,4 @@ export declare const setViewportSizeInputSchema: z.ZodObject<{
239
213
  /** Validated input accepted by the Playwright setViewportSize Node. */
240
214
  export declare type SetViewportSizeNodeInput = z.infer<typeof setViewportSizeInputSchema>;
241
215
 
242
- declare interface StepRunResult<TOutputData = unknown> {
243
- phase: NodeExecutionPhase;
244
- stepIndex: number;
245
- node: string;
246
- input: unknown;
247
- meta: NormalizedStepMeta;
248
- status: 'success' | 'failed';
249
- continuedAfterError: boolean;
250
- startedAt: string;
251
- endedAt: string;
252
- durationMs: number;
253
- output?: NodeResult<TOutputData>;
254
- error?: WorkflowError;
255
- }
256
-
257
- declare class WorkflowError extends Error {
258
- readonly code: string;
259
- readonly details?: unknown;
260
- constructor(message: string, options?: WorkflowErrorOptions);
261
- toJSON(): Record<string, unknown>;
262
- }
263
-
264
- declare interface WorkflowErrorOptions {
265
- code?: string;
266
- details?: unknown;
267
- cause?: unknown;
268
- }
269
-
270
216
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/test",
3
3
  "description": "Extensible YAML test runner and node SDK for Midscene.",
4
- "version": "1.12.4-beta-20260903111111.0",
4
+ "version": "1.12.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/web-infra-dev/midscene.git",
@@ -44,6 +44,11 @@
44
44
  "types": "./dist/types/ios/index.d.ts",
45
45
  "import": "./dist/es/ios/index.mjs",
46
46
  "require": "./dist/lib/ios/index.js"
47
+ },
48
+ "./harmony": {
49
+ "types": "./dist/types/harmony/index.d.ts",
50
+ "import": "./dist/es/harmony/index.mjs",
51
+ "require": "./dist/lib/harmony/index.js"
47
52
  }
48
53
  },
49
54
  "files": [
@@ -54,7 +59,8 @@
54
59
  "js-yaml": "4.1.0",
55
60
  "tinyglobby": "0.2.15",
56
61
  "tsx": "^4.19.2",
57
- "zod": "^3.25.1"
62
+ "zod": "^3.25.1",
63
+ "@midscene/core": "1.12.4"
58
64
  },
59
65
  "devDependencies": {
60
66
  "@rslib/core": "^0.18.3",
@@ -63,14 +69,27 @@
63
69
  "playwright": "^1.45.0",
64
70
  "typescript": "^5.8.3",
65
71
  "vitest": "3.0.5",
66
- "@midscene/android": "1.12.4-beta-20260903111111.0",
67
- "@midscene/ios": "1.12.4-beta-20260903111111.0",
68
- "@midscene/web": "1.12.4-beta-20260903111111.0"
72
+ "@midscene/harmony": "1.12.4",
73
+ "@midscene/android": "1.12.4",
74
+ "@midscene/ios": "1.12.4",
75
+ "@midscene/web": "1.12.4"
69
76
  },
70
77
  "peerDependencies": {
71
- "playwright": "^1.45.0"
78
+ "playwright": "^1.45.0",
79
+ "@midscene/harmony": "1.12.4",
80
+ "@midscene/android": "1.12.4",
81
+ "@midscene/ios": "1.12.4"
72
82
  },
73
83
  "peerDependenciesMeta": {
84
+ "@midscene/android": {
85
+ "optional": true
86
+ },
87
+ "@midscene/harmony": {
88
+ "optional": true
89
+ },
90
+ "@midscene/ios": {
91
+ "optional": true
92
+ },
74
93
  "playwright": {
75
94
  "optional": true
76
95
  }