@deepbounty/sdk 1.0.2 → 1.0.3

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/README.md CHANGED
@@ -8,13 +8,8 @@ The official SDK for developing modules for the DeepBounty project.
8
8
  npm install @deepbounty/sdk
9
9
  ```
10
10
 
11
- ## 🔧 Build & Publish
11
+ ## 📤 Publish
12
12
 
13
- 1. Build the SDK:
14
- ```bash
15
- npm run build
16
- ```
17
- 2. Publish to npm:
18
- ```bash
19
- npm publish --access public
20
- ```
13
+ ```bash
14
+ npm publish --access public
15
+ ```
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ModuleSetting } from "./types";
1
+ import { ModuleSetting, TaskContent, TaskResult } from "./types";
2
2
  export interface Logger {
3
3
  info: (...args: any[]) => void;
4
4
  warn: (...args: any[]) => void;
@@ -13,10 +13,14 @@ export interface ConfigAPI {
13
13
  setSetting(name: string, value: any): Promise<void>;
14
14
  getAllSettings(): Promise<ModuleSetting[]>;
15
15
  }
16
+ export interface TasksAPI {
17
+ submit(taskContent: TaskContent): Promise<TaskResult>;
18
+ }
16
19
  export interface ServerAPI {
17
20
  version: string;
18
21
  logger: Logger;
19
22
  config: ConfigAPI;
23
+ tasks: TasksAPI;
20
24
  }
21
25
  export interface PluginLifecycle {
22
26
  run?(api: ServerAPI): Promise<void> | void;
@@ -4,3 +4,4 @@ export * from "./alerts.js";
4
4
  export * from "./workers.js";
5
5
  export * from "./websockets.js";
6
6
  export * from "./tasks.js";
7
+ export * from "./tools.js";
@@ -4,3 +4,4 @@ export * from "./alerts.js";
4
4
  export * from "./workers.js";
5
5
  export * from "./websockets.js";
6
6
  export * from "./tasks.js";
7
+ export * from "./tools.js";
@@ -1,3 +1,13 @@
1
+ import { Tool } from "./tools";
2
+ export interface Module {
3
+ id: string;
4
+ name: string;
5
+ version: string;
6
+ entry: string;
7
+ description?: string;
8
+ settings?: ModuleSetting[];
9
+ tools?: Tool[];
10
+ }
1
11
  export interface ModuleSetting {
2
12
  name: string;
3
13
  type: "checkbox" | "text" | "select" | "info";
@@ -6,13 +16,7 @@ export interface ModuleSetting {
6
16
  value?: string | boolean;
7
17
  options?: string[];
8
18
  }
9
- export interface Module {
10
- id: string;
11
- name: string;
12
- version: string;
13
- description?: string;
14
- settings?: ModuleSetting[];
15
- }
16
19
  export interface LoadedModule extends Module {
17
20
  run: () => Promise<any>;
21
+ tools?: Tool[];
18
22
  }
@@ -1,8 +1,13 @@
1
- export interface Task {
1
+ import { Tool } from "./tools";
2
+ export interface TaskContent {
3
+ commands: string[];
4
+ requiredTools?: Tool[];
5
+ }
6
+ export interface Task extends TaskContent {
2
7
  id: number;
3
- type: "tool" | "command";
4
- payload: Record<string, any>;
5
- workerId: number;
8
+ }
9
+ export interface ServerTask extends Task {
10
+ workerId?: number;
6
11
  status: "pending" | "running" | "completed" | "failed";
7
12
  createdAt: Date;
8
13
  }
@@ -0,0 +1,8 @@
1
+ export interface Tool {
2
+ name: string;
3
+ version: string;
4
+ description?: string;
5
+ downloadUrl: string;
6
+ preInstallCommands?: string[];
7
+ postInstallCommands?: string[];
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,13 +1,8 @@
1
- import { Task } from "./tasks";
1
+ import { ServerTask } from "./tasks";
2
+ import { Tool } from "./tools";
2
3
  export interface Worker {
3
4
  id: number;
4
- currentTasks: Task[];
5
+ currentTasks: ServerTask[];
5
6
  availableTools: Tool[];
6
7
  loadFactor: number;
7
8
  }
8
- export interface Tool {
9
- name: string;
10
- downloadUrl: string;
11
- version: string;
12
- description?: string;
13
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",