@midscene/core 0.30.2-beta-20250930144216.0 → 0.30.2-beta-20251009120232.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.
@@ -142,7 +142,7 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
142
142
  private processCacheConfig;
143
143
  /**
144
144
  * Manually flush cache to file
145
- * Only meaningful in read-only mode, other modes will throw error
145
+ * Only supported in read-only mode where writes are deferred by default
146
146
  */
147
147
  flushCache(): Promise<void>;
148
148
  }
@@ -30,8 +30,12 @@ export declare class TaskCache {
30
30
  isCacheResultUsed: boolean;
31
31
  cacheOriginalLength: number;
32
32
  readOnlyMode: boolean;
33
+ writeOnlyMode: boolean;
33
34
  private matchedCacheIndices;
34
- constructor(cacheId: string, isCacheResultUsed: boolean, cacheFilePath?: string, readOnlyMode?: boolean);
35
+ constructor(cacheId: string, isCacheResultUsed: boolean, cacheFilePath?: string, options?: {
36
+ readOnly?: boolean;
37
+ writeOnly?: boolean;
38
+ });
35
39
  matchCache(prompt: TUserPrompt, type: 'plan' | 'locate'): MatchCacheResult<PlanningCache | LocateCache> | undefined;
36
40
  matchPlanCache(prompt: string): MatchCacheResult<PlanningCache> | undefined;
37
41
  matchLocateCache(prompt: TUserPrompt): MatchCacheResult<LocateCache> | undefined;
@@ -23,7 +23,7 @@ export declare class TaskExecutor {
23
23
  });
24
24
  private recordScreenshot;
25
25
  private prependExecutorWithScreenshot;
26
- convertPlanToExecutable(plans: PlanningAction[], modelConfig: IModelConfig): Promise<{
26
+ convertPlanToExecutable(plans: PlanningAction[], modelConfig: IModelConfig, cacheable?: boolean): Promise<{
27
27
  tasks: ExecutionTaskApply<any, any, any, any>[];
28
28
  }>;
29
29
  private setupPlanningContext;
@@ -33,7 +33,7 @@ export declare class TaskExecutor {
33
33
  private createPlanningTask;
34
34
  runPlans(title: string, plans: PlanningAction[], modelConfig: IModelConfig): Promise<ExecutionResult>;
35
35
  private getReplanningCycleLimit;
36
- action(userPrompt: string, modelConfig: IModelConfig, actionContext?: string): Promise<ExecutionResult<{
36
+ action(userPrompt: string, modelConfig: IModelConfig, actionContext?: string, cacheable?: boolean): Promise<ExecutionResult<{
37
37
  yamlFlow?: MidsceneYamlFlowItem[];
38
38
  } | undefined>>;
39
39
  private createTypeQueryTask;
@@ -382,7 +382,7 @@ export type WebUIContext = UIContext<WebElementInfo>;
382
382
  * Agent
383
383
  */
384
384
  export type CacheConfig = {
385
- strategy?: 'read-only' | 'read-write';
385
+ strategy?: 'read-only' | 'read-write' | 'write-only';
386
386
  id: string;
387
387
  };
388
388
  export type Cache = false | true | CacheConfig;
@@ -399,5 +399,4 @@ export interface AgentOpt {
399
399
  modelConfig?: TModelConfigFn;
400
400
  cache?: Cache;
401
401
  replanningCycleLimit?: number;
402
- screenshotScale?: number;
403
402
  }
@@ -168,4 +168,12 @@ export interface MidsceneYamlConfigResult {
168
168
  report?: string | null;
169
169
  error?: string;
170
170
  duration?: number;
171
+ /**
172
+ * Type of result:
173
+ * - 'success': All tasks completed successfully
174
+ * - 'failed': Execution failed (player error)
175
+ * - 'partialFailed': Some tasks failed but execution continued (continueOnError)
176
+ * - 'notExecuted': Not executed due to previous failures
177
+ */
178
+ resultType?: 'success' | 'failed' | 'partialFailed' | 'notExecuted';
171
179
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/core",
3
3
  "description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
4
- "version": "0.30.2-beta-20250930144216.0",
4
+ "version": "0.30.2-beta-20251009120232.0",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -87,8 +87,8 @@
87
87
  "zod": "3.24.3",
88
88
  "semver": "7.5.2",
89
89
  "js-yaml": "4.1.0",
90
- "@midscene/recorder": "0.30.2-beta-20250930144216.0",
91
- "@midscene/shared": "0.30.2-beta-20250930144216.0"
90
+ "@midscene/recorder": "0.30.2-beta-20251009120232.0",
91
+ "@midscene/shared": "0.30.2-beta-20251009120232.0"
92
92
  },
93
93
  "devDependencies": {
94
94
  "@rslib/core": "^0.11.2",