@deepbounty/sdk 1.1.6 → 1.1.8

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
@@ -90,11 +90,12 @@ export interface ServerAPI {
90
90
  * @param description Task description
91
91
  * @param taskContent The task content including commands and tools
92
92
  * @param interval Interval in seconds between task executions
93
- * @param schedulingType How to schedule tasks: "TARGET_BASED" (one per target), "GLOBAL" (single instance), or "CUSTOM" (manual control)
94
- * @param onComplete Optional callback executed when the task completes
93
+ * @param schedulingType How to schedule tasks: "TARGET_BASED" (one per target), "GLOBAL" (single instance), or "CUSTOM" (callback-based)
94
+ * @param onComplete Optional callback executed when a task instance completes
95
+ * @param onSchedule Optional callback for CUSTOM mode, invoked at interval to create instances
95
96
  * @returns The ID of the registered task template
96
97
  */
97
- registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, schedulingType?: "TARGET_BASED" | "GLOBAL" | "CUSTOM", onComplete?: (result: TaskResult) => void): Promise<number>;
98
+ registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, schedulingType?: "TARGET_BASED" | "GLOBAL" | "CUSTOM", onComplete?: (result: TaskResult) => void, onSchedule?: (templateId: number) => void | Promise<void>): Promise<number>;
98
99
  /**
99
100
  * Unregister a task template
100
101
  * @param templateId The ID of the task template to unregister
@@ -127,11 +128,11 @@ export interface ServerAPI {
127
128
  */
128
129
  createAlert(targetId: number, name: string, subdomain: string, score: number, description: string, endpoint: string, confirmed?: boolean): Promise<Alert>;
129
130
  }
130
- export interface PluginLifecycle {
131
+ export interface ModuleLifecycle {
131
132
  run?(api: ServerAPI): Promise<void> | void;
132
133
  stop?(): Promise<void> | void;
133
134
  }
134
- export type PluginFactory = (api: ServerAPI) => PluginLifecycle | Promise<PluginLifecycle>;
135
+ export type ModuleFactory = (api: ServerAPI) => ModuleLifecycle | Promise<ModuleLifecycle>;
135
136
  export { IEventBus, EventSubscription, CoreEvents, EventHandler, } from "./events";
136
137
  declare const _default: any;
137
138
  export default _default;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export default {}; // Type-only module for plugins to import types during compile
1
+ export default {}; // Type-only module for modules to import types during compile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",