@deepbounty/sdk 1.2.5 → 1.2.7

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
@@ -209,6 +209,13 @@ export interface TargetAPI {
209
209
  * @returns The target ID or null if not found
210
210
  */
211
211
  getTargetIdByHostname(hostname: string): Promise<number | null>;
212
+ /**
213
+ * Get all targets with their information
214
+ * Only targets enabled for the given task template are returned.
215
+ * @param taskTemplateId The task template ID
216
+ * @returns Array of targets enabled for the task template
217
+ */
218
+ getTargetsForTask(taskTemplateId: number): Promise<Target[]>;
212
219
  }
213
220
  export interface ServerAPI {
214
221
  version: string;
@@ -228,12 +235,14 @@ export interface ServerAPI {
228
235
  * @param description Task description
229
236
  * @param taskContent The task content including commands and tools
230
237
  * @param interval Interval in seconds between task executions. For CUSTOM mode: if <= 0, no automatic scheduling (manual mode only)
238
+ * @param aggressive Whether the task is aggressive (only run on worker that allows aggressive tasks)
231
239
  * @param schedulingType How to schedule tasks: "TARGET_BASED" (one per target), "GLOBAL" (single instance), or "CUSTOM" (callback-based)
232
240
  * @param onComplete Optional callback executed when a task instance completes
233
241
  * @param onSchedule Optional callback for CUSTOM mode, invoked at interval to create instances (not called if interval <= 0)
242
+ * @param onManualTrigger Optional callback invoked when a task instance is manually triggered
234
243
  * @returns The ID of the registered task template
235
244
  */
236
- 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>;
245
+ registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, aggressive: boolean, schedulingType?: "TARGET_BASED" | "GLOBAL" | "CUSTOM", onComplete?: (result: TaskResult) => void, onSchedule?: (templateId: number) => void | Promise<void>, onManualTrigger?: (templateId: number, targetId: number) => void | Promise<void>): Promise<number>;
237
246
  /**
238
247
  * Unregister a task template
239
248
  * @param templateId The ID of the task template to unregister
@@ -15,6 +15,7 @@ export interface TaskTemplate {
15
15
  interval: number;
16
16
  schedulingType: SchedulingType;
17
17
  active: boolean;
18
+ aggressive: boolean;
18
19
  }
19
20
  export interface ScheduledTask {
20
21
  id: number;
@@ -6,4 +6,5 @@ export interface Worker {
6
6
  currentTasks: TaskExecution[];
7
7
  availableTools: Tool[];
8
8
  connectedAt: Date;
9
+ aggressiveTasksEnabled: boolean;
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",