@midscene/playground 1.0.3-beta-20251221011051.0 → 1.0.3-beta-20251223070556.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.
@@ -1,12 +1,13 @@
1
- import type { DeviceAction } from '@midscene/core';
1
+ import type { DeviceAction, ExecutionDump } from '@midscene/core';
2
2
  import type { ExecutionOptions, FormValue, ValidationResult } from '../types';
3
3
  import { BasePlaygroundAdapter } from './base';
4
4
  export declare class RemoteExecutionAdapter extends BasePlaygroundAdapter {
5
5
  private serverUrl?;
6
6
  private _id?;
7
- private progressCallback?;
7
+ private dumpUpdateCallback?;
8
+ private pollingIntervalId?;
8
9
  constructor(serverUrl: string);
9
- setProgressCallback(callback: (tip: string) => void): void;
10
+ onDumpUpdate(callback: (dump: string, executionDump?: ExecutionDump) => void): void;
10
11
  get id(): string | undefined;
11
12
  validateParams(value: FormValue, action: DeviceAction<unknown> | undefined): ValidationResult;
12
13
  parseStructuredParams(action: DeviceAction<unknown>, params: Record<string, unknown>, options: ExecutionOptions): Promise<unknown[]>;
@@ -18,8 +19,16 @@ export declare class RemoteExecutionAdapter extends BasePlaygroundAdapter {
18
19
  checkStatus(): Promise<boolean>;
19
20
  overrideConfig(aiConfig: Record<string, unknown>): Promise<void>;
20
21
  getTaskProgress(requestId: string): Promise<{
21
- tip?: string;
22
+ executionDump?: ExecutionDump;
22
23
  }>;
24
+ /**
25
+ * Start polling for task progress and invoke dump update callback
26
+ */
27
+ private startProgressPolling;
28
+ /**
29
+ * Stop polling for task progress
30
+ */
31
+ private stopProgressPolling;
23
32
  cancelTask(requestId: string): Promise<{
24
33
  error?: string;
25
34
  success?: boolean;
@@ -13,12 +13,15 @@ export declare class PlaygroundSDK {
13
13
  checkStatus(): Promise<boolean>;
14
14
  overrideConfig(aiConfig: any): Promise<void>;
15
15
  getTaskProgress(requestId: string): Promise<{
16
- tip?: string;
16
+ executionDump?: any;
17
17
  }>;
18
18
  cancelTask(requestId: string): Promise<any>;
19
19
  onDumpUpdate(callback: (dump: string, executionDump?: any) => void): void;
20
20
  onProgressUpdate(callback: (tip: string) => void): void;
21
- cancelExecution(requestId: string): Promise<void>;
21
+ cancelExecution(requestId: string): Promise<{
22
+ dump: any | null;
23
+ reportHTML: string | null;
24
+ } | null>;
22
25
  getCurrentExecutionData(): Promise<{
23
26
  dump: any | null;
24
27
  reportHTML: string | null;
@@ -1,7 +1,7 @@
1
1
  import type { Server } from 'node:http';
2
+ import type { ExecutionDump } from '@midscene/core';
2
3
  import type { Agent as PageAgent } from '@midscene/core/agent';
3
4
  import express from 'express';
4
- import type { ProgressMessage } from './types';
5
5
  import 'dotenv/config';
6
6
  declare class PlaygroundServer {
7
7
  private _app;
@@ -10,7 +10,7 @@ declare class PlaygroundServer {
10
10
  port?: number | null;
11
11
  agent: PageAgent;
12
12
  staticPath: string;
13
- taskProgressMessages: Record<string, ProgressMessage[]>;
13
+ taskExecutionDumps: Record<string, ExecutionDump | null>;
14
14
  id: string;
15
15
  private _initialized;
16
16
  private agentFactory?;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/playground",
3
- "version": "1.0.3-beta-20251221011051.0",
3
+ "version": "1.0.3-beta-20251223070556.0",
4
4
  "description": "Midscene playground utilities for web integration",
5
5
  "author": "midscene team",
6
6
  "license": "MIT",
@@ -25,8 +25,8 @@
25
25
  "express": "^4.21.2",
26
26
  "open": "10.1.0",
27
27
  "uuid": "11.1.0",
28
- "@midscene/core": "1.0.3-beta-20251221011051.0",
29
- "@midscene/shared": "1.0.3-beta-20251221011051.0"
28
+ "@midscene/core": "1.0.3-beta-20251223070556.0",
29
+ "@midscene/shared": "1.0.3-beta-20251223070556.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@rslib/core": "^0.18.3",
package/static/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/430.53da0b9c.js"></script><script defer src="/static/js/index.6d26bf76.js"></script><link href="/static/css/index.f2964c15.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1
+ <!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.7b1abe58.js"></script><script defer src="/static/js/430.53da0b9c.js"></script><script defer src="/static/js/index.bd1efdb8.js"></script><link href="/static/css/index.f2964c15.css" rel="stylesheet"></head><body><div id="root"></div></body></html>