@midscene/core 1.3.8 → 1.3.9

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.
@@ -7,6 +7,7 @@ export declare class ConversationHistory {
7
7
  private readonly messages;
8
8
  private subGoals;
9
9
  private memories;
10
+ private historicalLogs;
10
11
  pendingFeedbackMessage: string;
11
12
  constructor(options?: ConversationHistoryOptions);
12
13
  resetPendingFeedbackMessageIfExists(): void;
@@ -28,12 +29,14 @@ export declare class ConversationHistory {
28
29
  */
29
30
  setSubGoals(subGoals: SubGoal[]): void;
30
31
  /**
31
- * Update a single sub-goal by index
32
+ * Update a single sub-goal by index.
33
+ * Clears logs if status or description actually changes.
32
34
  * @returns true if the sub-goal was found and updated, false otherwise
33
35
  */
34
36
  updateSubGoal(index: number, updates: Partial<Omit<SubGoal, 'index'>>): boolean;
35
37
  /**
36
- * Mark the first pending sub-goal as running
38
+ * Mark the first pending sub-goal as running.
39
+ * Clears logs since status changes.
37
40
  */
38
41
  markFirstPendingAsRunning(): void;
39
42
  /**
@@ -43,13 +46,30 @@ export declare class ConversationHistory {
43
46
  */
44
47
  markSubGoalFinished(index: number): boolean;
45
48
  /**
46
- * Mark all sub-goals as finished
49
+ * Mark all sub-goals as finished.
50
+ * Clears logs for any goal whose status actually changes.
47
51
  */
48
52
  markAllSubGoalsFinished(): void;
49
53
  /**
50
- * Convert sub-goals to text representation
54
+ * Append a log entry to the currently running sub-goal.
55
+ * The log describes an action performed while working on the sub-goal.
56
+ */
57
+ appendSubGoalLog(log: string): void;
58
+ /**
59
+ * Convert sub-goals to text representation.
60
+ * Includes actions performed (logs) for the current sub-goal.
51
61
  */
52
62
  subGoalsToText(): string;
63
+ /**
64
+ * Append a log entry to the historical logs list.
65
+ * Used in non-deepThink mode to track executed steps across planning rounds.
66
+ */
67
+ appendHistoricalLog(log: string): void;
68
+ /**
69
+ * Convert historical logs to text representation.
70
+ * Provides context about previously executed steps to the model.
71
+ */
72
+ historicalLogsToText(): string;
53
73
  /**
54
74
  * Append a memory to the memories list
55
75
  */
@@ -174,6 +174,7 @@ export interface SubGoal {
174
174
  index: number;
175
175
  status: SubGoalStatus;
176
176
  description: string;
177
+ logs?: string[];
177
178
  }
178
179
  export interface RawResponsePlanningAIResponse {
179
180
  action: PlanningAction;
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.3.8",
4
+ "version": "1.3.9",
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
  "undici": "^6.0.0",
91
91
  "zod": "3.24.3",
92
- "@midscene/shared": "1.3.8"
92
+ "@midscene/shared": "1.3.9"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@rslib/core": "^0.18.3",