@maaxyz/maa-node 3.0.0-beta.1 → 3.0.0-beta.2

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.
package/dist/index.js CHANGED
@@ -427,7 +427,7 @@ var TaskerBase = class {
427
427
  set parsed_notify(cb) {
428
428
  this.notify = (msg, details) => {
429
429
  return cb({
430
- msg: msg.replace(/^Task(?:er)?\./, ""),
430
+ msg: msg.replace(/^(?:Tasker|Node)?\./, ""),
431
431
  ...JSON.parse(details)
432
432
  });
433
433
  };
@@ -467,11 +467,7 @@ var TaskerBase = class {
467
467
  return import_maa2.default.tasker_running(this.handle);
468
468
  }
469
469
  post_stop() {
470
- return new TaskJob(
471
- this,
472
- this.#source,
473
- import_maa2.default.tasker_post_stop(this.handle)
474
- );
470
+ return new TaskJob(this, this.#source, import_maa2.default.tasker_post_stop(this.handle));
475
471
  }
476
472
  get resource() {
477
473
  const res = import_maa2.default.tasker_get_resource(this.handle);
@@ -537,8 +533,8 @@ var TaskerBase = class {
537
533
  return null;
538
534
  }
539
535
  }
540
- latest_node(task) {
541
- return import_maa2.default.tasker_get_latest_node(this.handle, task);
536
+ latest_node(node) {
537
+ return import_maa2.default.tasker_get_latest_node(this.handle, node);
542
538
  }
543
539
  };
544
540
  var Tasker = class extends TaskerBase {
package/dist/tasker.d.ts CHANGED
@@ -40,31 +40,20 @@ export type TaskerNotify = {
40
40
  } & ({
41
41
  msg: 'Task.Started' | 'Task.Completed' | 'Task.Failed';
42
42
  } | {
43
- msg: 'Debug.RecognitionResult' | 'Debug.Hit';
44
- current: string;
45
- recognition: {
46
- reco_id: maa.RecoId;
47
- name: string;
48
- /**
49
- * Won't be `null` for msg `Debug.Hit`
50
- */
51
- box: maa.FlatRect | null;
52
- detail: string;
53
- };
43
+ msg: 'NextList.Starting' | 'NextList.Succeeded' | 'NextList.Failed';
44
+ task_id: number;
45
+ name: string;
46
+ list: string[];
54
47
  } | {
55
- msg: 'Focus.ReadyToRun' | 'Focus.Completed' | 'Debug.ReadyToRun' | 'Debug.Completed';
56
- current: string;
57
- node: {
58
- node_id: maa.NodeId;
59
- name: string;
60
- reco_id: maa.RecoId;
61
- times: number;
62
- completed: boolean;
63
- };
48
+ msg: 'Recognition.Starting' | 'Recognition.Succeeded' | 'Recognition.Failed';
49
+ task_id: number;
50
+ reco_id: number;
51
+ name: string;
64
52
  } | {
65
- msg: 'Debug.ListToRecognize' | 'Debug.MissAll';
66
- current: string;
67
- list: string[];
53
+ msg: 'Action.Starting' | 'Action.Succeeded' | 'Action.Failed';
54
+ task_id: number;
55
+ node_id: number;
56
+ name: string;
68
57
  });
69
58
  export declare class TaskerBase {
70
59
  #private;
@@ -120,7 +109,7 @@ export declare class TaskerBase {
120
109
  } | null)[];
121
110
  status: maa.Status;
122
111
  } | null;
123
- latest_node(task: string): maa.NodeId | null;
112
+ latest_node(node: string): maa.NodeId | null;
124
113
  }
125
114
  export declare class Tasker extends TaskerBase {
126
115
  constructor();
package/package.json CHANGED
@@ -21,13 +21,13 @@
21
21
  "prettier": "^3.3.2",
22
22
  "typescript": "^5.4.5"
23
23
  },
24
- "version": "3.0.0-beta.1",
24
+ "version": "3.0.0-beta.2",
25
25
  "optionalDependencies": {
26
- "@maaxyz/maa-node-darwin-arm64": "3.0.0-beta.1",
27
- "@maaxyz/maa-node-darwin-x64": "3.0.0-beta.1",
28
- "@maaxyz/maa-node-linux-arm64": "3.0.0-beta.1",
29
- "@maaxyz/maa-node-linux-x64": "3.0.0-beta.1",
30
- "@maaxyz/maa-node-win32-arm64": "3.0.0-beta.1",
31
- "@maaxyz/maa-node-win32-x64": "3.0.0-beta.1"
26
+ "@maaxyz/maa-node-darwin-arm64": "3.0.0-beta.2",
27
+ "@maaxyz/maa-node-darwin-x64": "3.0.0-beta.2",
28
+ "@maaxyz/maa-node-linux-arm64": "3.0.0-beta.2",
29
+ "@maaxyz/maa-node-linux-x64": "3.0.0-beta.2",
30
+ "@maaxyz/maa-node-win32-arm64": "3.0.0-beta.2",
31
+ "@maaxyz/maa-node-win32-x64": "3.0.0-beta.2"
32
32
  }
33
33
  }
package/src/tasker.ts CHANGED
@@ -48,33 +48,22 @@ export type TaskerNotify = {
48
48
  msg: 'Task.Started' | 'Task.Completed' | 'Task.Failed'
49
49
  }
50
50
  | {
51
- msg: 'Debug.RecognitionResult' | 'Debug.Hit'
52
- current: string
53
- recognition: {
54
- reco_id: maa.RecoId
55
- name: string
56
- /**
57
- * Won't be `null` for msg `Debug.Hit`
58
- */
59
- box: maa.FlatRect | null
60
- detail: string
61
- }
51
+ msg: 'NextList.Starting' | 'NextList.Succeeded' | 'NextList.Failed'
52
+ task_id: number
53
+ name: string
54
+ list: string[]
62
55
  }
63
56
  | {
64
- msg: 'Focus.ReadyToRun' | 'Focus.Completed' | 'Debug.ReadyToRun' | 'Debug.Completed'
65
- current: string
66
- node: {
67
- node_id: maa.NodeId
68
- name: string
69
- reco_id: maa.RecoId
70
- times: number
71
- completed: boolean
72
- }
57
+ msg: 'Recognition.Starting' | 'Recognition.Succeeded' | 'Recognition.Failed'
58
+ task_id: number
59
+ reco_id: number
60
+ name: string
73
61
  }
74
62
  | {
75
- msg: 'Debug.ListToRecognize' | 'Debug.MissAll'
76
- current: string
77
- list: string[]
63
+ msg: 'Action.Starting' | 'Action.Succeeded' | 'Action.Failed'
64
+ task_id: number
65
+ node_id: number
66
+ name: string
78
67
  }
79
68
  )
80
69
 
@@ -87,7 +76,7 @@ export class TaskerBase {
87
76
  set parsed_notify(cb: (msg: TaskerNotify) => maa.MaybePromise<void>) {
88
77
  this.notify = (msg, details) => {
89
78
  return cb({
90
- msg: msg.replace(/^Task(?:er)?\./, '') as any,
79
+ msg: msg.replace(/^(?:Tasker|Node)?\./, '') as any,
91
80
  ...JSON.parse(details)
92
81
  })
93
82
  }
@@ -134,11 +123,7 @@ export class TaskerBase {
134
123
  }
135
124
 
136
125
  post_stop() {
137
- return new TaskJob(
138
- this,
139
- this.#source,
140
- maa.tasker_post_stop(this.handle)
141
- )
126
+ return new TaskJob(this, this.#source, maa.tasker_post_stop(this.handle))
142
127
  }
143
128
 
144
129
  get resource() {
@@ -211,8 +196,8 @@ export class TaskerBase {
211
196
  }
212
197
  }
213
198
 
214
- latest_node(task: string) {
215
- return maa.tasker_get_latest_node(this.handle, task)
199
+ latest_node(node: string) {
200
+ return maa.tasker_get_latest_node(this.handle, node)
216
201
  }
217
202
  }
218
203