@maaxyz/maa-node 2.4.1 → 3.0.0-beta.1
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/context.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/maa.d.ts +6 -6
- package/dist/resource.d.ts +1 -1
- package/dist/tasker.d.ts +1 -1
- package/package.json +7 -7
- package/src/context.ts +2 -2
- package/src/maa.d.ts +6 -6
- package/src/resource.ts +2 -2
- package/src/tasker.ts +2 -2
package/dist/context.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class Context {
|
|
|
5
5
|
#private;
|
|
6
6
|
handle: maa.ContextHandle;
|
|
7
7
|
constructor(handle: maa.ContextHandle);
|
|
8
|
-
|
|
8
|
+
run_task(entry: string, pipeline_override?: Record<string, unknown>): Promise<{
|
|
9
9
|
entry: string;
|
|
10
10
|
nodes: ({
|
|
11
11
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -453,11 +453,11 @@ var TaskerBase = class {
|
|
|
453
453
|
throw "Tasker bind failed";
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
post_task(entry, param = {}) {
|
|
457
457
|
return new TaskJob(
|
|
458
458
|
this,
|
|
459
459
|
this.#source,
|
|
460
|
-
import_maa2.default.
|
|
460
|
+
import_maa2.default.tasker_post_task(this.handle, entry, JSON.stringify(param))
|
|
461
461
|
);
|
|
462
462
|
}
|
|
463
463
|
get inited() {
|
|
@@ -563,8 +563,8 @@ var Context = class _Context {
|
|
|
563
563
|
this.handle = handle;
|
|
564
564
|
this.#tasker = new TaskerBase(maa4.context_get_tasker(this.handle));
|
|
565
565
|
}
|
|
566
|
-
async
|
|
567
|
-
const id = await maa4.
|
|
566
|
+
async run_task(entry, pipeline_override = {}) {
|
|
567
|
+
const id = await maa4.context_run_task(
|
|
568
568
|
this.handle,
|
|
569
569
|
entry,
|
|
570
570
|
JSON.stringify(pipeline_override)
|
|
@@ -715,8 +715,8 @@ var ResourceBase = class {
|
|
|
715
715
|
throw "Resource clear_custom_action failed";
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
|
|
719
|
-
return new Job(this.#source, import_maa3.default.
|
|
718
|
+
post_bundle(path2) {
|
|
719
|
+
return new Job(this.#source, import_maa3.default.resource_post_bundle(this.handle, path2));
|
|
720
720
|
}
|
|
721
721
|
clear() {
|
|
722
722
|
if (!import_maa3.default.resource_clear(this.handle)) {
|
package/dist/maa.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type NotificationCallback = (message: string, details_json: string) => Ma
|
|
|
36
36
|
export type CustomRecognitionCallback = (
|
|
37
37
|
context: ContextHandle,
|
|
38
38
|
task_id: TaskId,
|
|
39
|
-
|
|
39
|
+
node_name: string,
|
|
40
40
|
custom_recognition_name: string,
|
|
41
41
|
custom_recognition_param: string,
|
|
42
42
|
image: ImageData,
|
|
@@ -45,7 +45,7 @@ export type CustomRecognitionCallback = (
|
|
|
45
45
|
export type CustomActionCallback = (
|
|
46
46
|
context: ContextHandle,
|
|
47
47
|
task_id: TaskId,
|
|
48
|
-
|
|
48
|
+
node_name: string,
|
|
49
49
|
custom_action_name: string,
|
|
50
50
|
custom_action_param: string,
|
|
51
51
|
reco_id: RecoId,
|
|
@@ -73,7 +73,7 @@ export type CustomControllerCallback = (
|
|
|
73
73
|
|
|
74
74
|
// context.cpp
|
|
75
75
|
|
|
76
|
-
export declare function
|
|
76
|
+
export declare function context_run_task(
|
|
77
77
|
context: ContextHandle,
|
|
78
78
|
entry: string,
|
|
79
79
|
pipeline_override: string
|
|
@@ -223,7 +223,7 @@ export declare function resource_unregister_custom_action(
|
|
|
223
223
|
name: string
|
|
224
224
|
): boolean
|
|
225
225
|
export declare function resource_clear_custom_action(handle: ResourceHandle): boolean
|
|
226
|
-
export declare function
|
|
226
|
+
export declare function resource_post_bundle(handle: ResourceHandle, path: string): ResId
|
|
227
227
|
export declare function resource_clear(handle: ResourceHandle): boolean
|
|
228
228
|
export declare function resource_status(handle: ResourceHandle, res_id: ResId): Status
|
|
229
229
|
export declare function resource_wait(handle: ResourceHandle, res_id: ResId): Promise<Status>
|
|
@@ -244,7 +244,7 @@ export declare function tasker_bind_controller(
|
|
|
244
244
|
controller: ControllerHandle | null
|
|
245
245
|
): boolean
|
|
246
246
|
export declare function tasker_inited(handle: TaskerHandle): boolean
|
|
247
|
-
export declare function
|
|
247
|
+
export declare function tasker_post_task(
|
|
248
248
|
handle: TaskerHandle,
|
|
249
249
|
entry: string,
|
|
250
250
|
pipeline_override: string
|
|
@@ -280,7 +280,7 @@ export declare function tasker_get_task_detail(
|
|
|
280
280
|
): [entry: string, node_ids: NodeId[], status: Status] | null
|
|
281
281
|
export declare function tasker_get_latest_node(
|
|
282
282
|
handle: TaskerHandle,
|
|
283
|
-
|
|
283
|
+
node_name: string
|
|
284
284
|
): NodeId | null
|
|
285
285
|
|
|
286
286
|
// config.cpp
|
package/dist/resource.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare class ResourceBase {
|
|
|
25
25
|
register_custom_action(name: string, func: CustomActionCallback): void;
|
|
26
26
|
unregister_custom_action(name: string): void;
|
|
27
27
|
clear_custom_action(): void;
|
|
28
|
-
|
|
28
|
+
post_bundle(path: string): Job<maa.ResId, JobSource<maa.ResId>>;
|
|
29
29
|
clear(): void;
|
|
30
30
|
get loaded(): boolean;
|
|
31
31
|
get hash(): string | null;
|
package/dist/tasker.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export declare class TaskerBase {
|
|
|
74
74
|
constructor(handle: maa.TaskerHandle);
|
|
75
75
|
destroy(): void;
|
|
76
76
|
bind(slave: ControllerBase | ResourceBase): void;
|
|
77
|
-
|
|
77
|
+
post_task(entry: string, param?: Record<string, unknown>): TaskJob;
|
|
78
78
|
get inited(): boolean;
|
|
79
79
|
get running(): boolean;
|
|
80
80
|
post_stop(): TaskJob;
|
package/package.json
CHANGED
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"prettier": "^3.3.2",
|
|
22
22
|
"typescript": "^5.4.5"
|
|
23
23
|
},
|
|
24
|
-
"version": "
|
|
24
|
+
"version": "3.0.0-beta.1",
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@maaxyz/maa-node-darwin-arm64": "
|
|
27
|
-
"@maaxyz/maa-node-darwin-x64": "
|
|
28
|
-
"@maaxyz/maa-node-linux-arm64": "
|
|
29
|
-
"@maaxyz/maa-node-linux-x64": "
|
|
30
|
-
"@maaxyz/maa-node-win32-arm64": "
|
|
31
|
-
"@maaxyz/maa-node-win32-x64": "
|
|
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"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/src/context.ts
CHANGED
|
@@ -10,8 +10,8 @@ export class Context {
|
|
|
10
10
|
this.#tasker = new TaskerBase(maa.context_get_tasker(this.handle))
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
async
|
|
14
|
-
const id = await maa.
|
|
13
|
+
async run_task(entry: string, pipeline_override: Record<string, unknown> = {}) {
|
|
14
|
+
const id = await maa.context_run_task(
|
|
15
15
|
this.handle,
|
|
16
16
|
entry,
|
|
17
17
|
JSON.stringify(pipeline_override)
|
package/src/maa.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type NotificationCallback = (message: string, details_json: string) => Ma
|
|
|
36
36
|
export type CustomRecognitionCallback = (
|
|
37
37
|
context: ContextHandle,
|
|
38
38
|
task_id: TaskId,
|
|
39
|
-
|
|
39
|
+
node_name: string,
|
|
40
40
|
custom_recognition_name: string,
|
|
41
41
|
custom_recognition_param: string,
|
|
42
42
|
image: ImageData,
|
|
@@ -45,7 +45,7 @@ export type CustomRecognitionCallback = (
|
|
|
45
45
|
export type CustomActionCallback = (
|
|
46
46
|
context: ContextHandle,
|
|
47
47
|
task_id: TaskId,
|
|
48
|
-
|
|
48
|
+
node_name: string,
|
|
49
49
|
custom_action_name: string,
|
|
50
50
|
custom_action_param: string,
|
|
51
51
|
reco_id: RecoId,
|
|
@@ -73,7 +73,7 @@ export type CustomControllerCallback = (
|
|
|
73
73
|
|
|
74
74
|
// context.cpp
|
|
75
75
|
|
|
76
|
-
export declare function
|
|
76
|
+
export declare function context_run_task(
|
|
77
77
|
context: ContextHandle,
|
|
78
78
|
entry: string,
|
|
79
79
|
pipeline_override: string
|
|
@@ -223,7 +223,7 @@ export declare function resource_unregister_custom_action(
|
|
|
223
223
|
name: string
|
|
224
224
|
): boolean
|
|
225
225
|
export declare function resource_clear_custom_action(handle: ResourceHandle): boolean
|
|
226
|
-
export declare function
|
|
226
|
+
export declare function resource_post_bundle(handle: ResourceHandle, path: string): ResId
|
|
227
227
|
export declare function resource_clear(handle: ResourceHandle): boolean
|
|
228
228
|
export declare function resource_status(handle: ResourceHandle, res_id: ResId): Status
|
|
229
229
|
export declare function resource_wait(handle: ResourceHandle, res_id: ResId): Promise<Status>
|
|
@@ -244,7 +244,7 @@ export declare function tasker_bind_controller(
|
|
|
244
244
|
controller: ControllerHandle | null
|
|
245
245
|
): boolean
|
|
246
246
|
export declare function tasker_inited(handle: TaskerHandle): boolean
|
|
247
|
-
export declare function
|
|
247
|
+
export declare function tasker_post_task(
|
|
248
248
|
handle: TaskerHandle,
|
|
249
249
|
entry: string,
|
|
250
250
|
pipeline_override: string
|
|
@@ -280,7 +280,7 @@ export declare function tasker_get_task_detail(
|
|
|
280
280
|
): [entry: string, node_ids: NodeId[], status: Status] | null
|
|
281
281
|
export declare function tasker_get_latest_node(
|
|
282
282
|
handle: TaskerHandle,
|
|
283
|
-
|
|
283
|
+
node_name: string
|
|
284
284
|
): NodeId | null
|
|
285
285
|
|
|
286
286
|
// config.cpp
|
package/src/resource.ts
CHANGED
|
@@ -135,8 +135,8 @@ export class ResourceBase {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
return new Job(this.#source, maa.
|
|
138
|
+
post_bundle(path: string) {
|
|
139
|
+
return new Job(this.#source, maa.resource_post_bundle(this.handle, path))
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
clear() {
|
package/src/tasker.ts
CHANGED
|
@@ -117,11 +117,11 @@ export class TaskerBase {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
post_task(entry: string, param: Record<string, unknown> = {}) {
|
|
121
121
|
return new TaskJob(
|
|
122
122
|
this,
|
|
123
123
|
this.#source,
|
|
124
|
-
maa.
|
|
124
|
+
maa.tasker_post_task(this.handle, entry, JSON.stringify(param))
|
|
125
125
|
)
|
|
126
126
|
}
|
|
127
127
|
|