@deepbounty/sdk 1.0.7 → 1.0.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.
- package/dist/index.d.ts +11 -10
- package/dist/types/tasks.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleSetting, TaskContent } from "./types";
|
|
1
|
+
import { ModuleSetting, TaskContent, TaskResult, Tool } from "./types";
|
|
2
2
|
export interface Logger {
|
|
3
3
|
info: (...args: any[]) => void;
|
|
4
4
|
warn: (...args: any[]) => void;
|
|
@@ -39,27 +39,28 @@ export interface ConfigAPI {
|
|
|
39
39
|
*/
|
|
40
40
|
getAllSettings(): Promise<ModuleSetting[]>;
|
|
41
41
|
}
|
|
42
|
-
export interface
|
|
42
|
+
export interface ServerAPI {
|
|
43
|
+
version: string;
|
|
44
|
+
logger: Logger;
|
|
45
|
+
config: ConfigAPI;
|
|
43
46
|
/**
|
|
44
47
|
* Register a scheduled task that runs at a specific interval
|
|
45
48
|
* @param taskContent The task content including commands and required tools
|
|
46
49
|
* @param interval Interval in seconds between task executions
|
|
50
|
+
* @param onComplete Optional callback executed when the task completes
|
|
47
51
|
* @returns The ID of the registered scheduled task
|
|
48
52
|
*/
|
|
49
|
-
registerScheduledTask(taskContent: TaskContent, interval: number): number;
|
|
53
|
+
registerScheduledTask(taskContent: TaskContent, interval: number, onComplete?: (result: TaskResult) => void): number;
|
|
50
54
|
/**
|
|
51
55
|
* Unregister a scheduled task
|
|
52
56
|
* @param taskId The ID of the scheduled task to unregister
|
|
53
57
|
* @returns true if the task was unregistered, false if it didn't exist
|
|
54
58
|
*/
|
|
55
59
|
unregisterScheduledTask(taskId: number): boolean;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
logger: Logger;
|
|
61
|
-
config: ConfigAPI;
|
|
62
|
-
tasks: TasksAPI;
|
|
60
|
+
/** Register a tool
|
|
61
|
+
* @param tool The tool to register
|
|
62
|
+
*/
|
|
63
|
+
registerTool(tool: Tool): void;
|
|
63
64
|
}
|
|
64
65
|
export interface PluginLifecycle {
|
|
65
66
|
run?(api: ServerAPI): Promise<void> | void;
|
package/dist/types/tasks.d.ts
CHANGED