@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 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 TasksAPI {
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
- getModuleTasks(): any[];
57
- }
58
- export interface ServerAPI {
59
- version: string;
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;
@@ -2,6 +2,7 @@ import { Tool } from "./tools";
2
2
  export interface TaskContent {
3
3
  commands: string[];
4
4
  requiredTools?: Tool[];
5
+ extractResult?: boolean;
5
6
  }
6
7
  export interface ScheduledTask {
7
8
  id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",