@midscene/core 1.0.1-beta-20251209112631.0 → 1.0.1-beta-20251211095502.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.
@@ -23,7 +23,9 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
23
23
  dryMode: boolean;
24
24
  onTaskStartTip?: OnTaskStartTip;
25
25
  taskCache?: TaskCache;
26
- onDumpUpdate?: (dump: string) => void;
26
+ private dumpUpdateListeners;
27
+ get onDumpUpdate(): ((dump: string, executionDump?: ExecutionDump) => void) | undefined;
28
+ set onDumpUpdate(callback: ((dump: string, executionDump?: ExecutionDump) => void) | undefined);
27
29
  destroyed: boolean;
28
30
  modelConfigManager: ModelConfigManager;
29
31
  /**
@@ -57,7 +59,11 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
57
59
  getActionSpace(): Promise<DeviceAction[]>;
58
60
  getUIContext(action?: ServiceAction): Promise<UIContext>;
59
61
  _snapshotContext(): Promise<UIContext>;
62
+ /**
63
+ * @deprecated Use {@link setAIActContext} instead.
64
+ */
60
65
  setAIActionContext(prompt: string): Promise<void>;
66
+ setAIActContext(prompt: string): Promise<void>;
61
67
  resetDump(): GroupedActionDump;
62
68
  appendExecutionDump(execution: ExecutionDump, runner?: TaskRunner): void;
63
69
  dumpDataString(): string;
@@ -139,6 +145,21 @@ export declare class Agent<InterfaceType extends AbstractInterface = AbstractInt
139
145
  result: Record<string, any>;
140
146
  }>;
141
147
  evaluateJavaScript(script: string): Promise<any>;
148
+ /**
149
+ * Add a dump update listener
150
+ * @param listener Listener function
151
+ * @returns A remove function that can be called to remove this listener
152
+ */
153
+ addDumpUpdateListener(listener: (dump: string, executionDump?: ExecutionDump) => void): () => void;
154
+ /**
155
+ * Remove a dump update listener
156
+ * @param listener The listener function to remove
157
+ */
158
+ removeDumpUpdateListener(listener: (dump: string, executionDump?: ExecutionDump) => void): void;
159
+ /**
160
+ * Clear all dump update listeners
161
+ */
162
+ clearDumpUpdateListeners(): void;
142
163
  destroy(): Promise<void>;
143
164
  recordToReport(title?: string, opt?: {
144
165
  content: string;
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": "1.0.1-beta-20251209112631.0",
4
+ "version": "1.0.1-beta-20251211095502.0",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -89,7 +89,7 @@
89
89
  "semver": "7.5.2",
90
90
  "js-yaml": "4.1.0",
91
91
  "zod": "3.24.3",
92
- "@midscene/shared": "1.0.1-beta-20251209112631.0"
92
+ "@midscene/shared": "1.0.1-beta-20251211095502.0"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@rslib/core": "^0.18.3",