@deepbounty/sdk 1.1.7 → 1.1.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/events.d.ts CHANGED
@@ -9,6 +9,10 @@ export interface CoreEvents {
9
9
  context: TrafficContext;
10
10
  js: string;
11
11
  };
12
+ "http:html": {
13
+ context: TrafficContext;
14
+ html: string;
15
+ };
12
16
  }
13
17
  /**
14
18
  * Event handler function signature
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
@@ -103,13 +104,13 @@ export interface ServerAPI {
103
104
  unregisterTaskTemplate(templateId: number): Promise<boolean>;
104
105
  /**
105
106
  * Create a task instance manually (for CUSTOM scheduling type)
107
+ * Task instances are always one-time and automatically deleted after execution.
106
108
  * @param templateId The ID of the task template
107
109
  * @param targetId Optional target ID for this instance
108
110
  * @param customData Optional custom data to attach to this instance (accessible via {{KEY}} placeholders)
109
- * @param oneTime If true, delete the scheduled task after execution (default: false)
110
111
  * @returns The scheduled task ID
111
112
  */
112
- createTaskInstance(templateId: number, targetId?: number, customData?: Record<string, any>, oneTime?: boolean): Promise<number>;
113
+ createTaskInstance(templateId: number, targetId?: number, customData?: Record<string, any>): Promise<number>;
113
114
  /** Register a tool
114
115
  * @param tool The tool to register
115
116
  */
@@ -32,6 +32,7 @@ export interface ScheduledTask {
32
32
  export interface TaskExecution {
33
33
  executionId: number;
34
34
  scheduledTaskId: number;
35
+ templateId?: number;
35
36
  workerId?: number;
36
37
  status: "pending" | "running" | "completed" | "failed";
37
38
  createdAt: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",