@hotbunny/hackhub-content-sdk 0.9.0 → 0.9.2

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.
Files changed (2) hide show
  1. package/README.md +187 -173
  2. package/package.json +8 -4
package/README.md CHANGED
@@ -1,272 +1,281 @@
1
1
  # @hotbunny/hackhub-content-sdk
2
2
 
3
- Type definitions and build tools for creating HackHub mods.
3
+ Official modding SDK for [HackHub - Ultimate Hacker Simulator](https://store.steampowered.com/app/2980270/HackHub__Ultimate_Hacker_Simulator/) on Steam. Create custom quests, websites, terminal commands, desktop apps, and more.
4
4
 
5
- ## Quick Start
5
+ ## Getting Started
6
6
 
7
- The easiest way to create a new mod is with the interactive CLI:
7
+ ### Create a New Mod
8
8
 
9
9
  ```bash
10
10
  npm create hackhub-mod
11
11
  ```
12
12
 
13
- This will scaffold a ready-to-go project with templates, build config, and everything set up.
13
+ The CLI scaffolds a complete mod project with build config, templates, and TypeScript support.
14
14
 
15
- ## Manual Installation
15
+ ### Manual Setup
16
16
 
17
17
  ```bash
18
18
  npm install @hotbunny/hackhub-content-sdk --save-dev
19
19
  ```
20
20
 
21
- ## Example
21
+ ## Mod Entry Point
22
+
23
+ Every mod needs a `Bootstrap` class decorated with `@RegisterModPackage`:
22
24
 
23
25
  ```typescript
24
- import {
25
- Bootstrap,
26
- Quest,
27
- Events,
28
- Network,
29
- Random,
30
- RegisterModPackage,
31
- RegisterQuest,
32
- } from "@hotbunny/hackhub-content-sdk";
26
+ import { Bootstrap, RegisterModPackage, Storage } from "@hotbunny/hackhub-content-sdk";
33
27
 
34
28
  @RegisterModPackage
35
- class MyMod extends Bootstrap {
36
- Settings = [
37
- { key: "difficulty", label: "Difficulty", type: "select" as const, default: "normal", options: [
38
- { label: "Easy", value: "easy" },
39
- { label: "Normal", value: "normal" },
40
- { label: "Hard", value: "hard" },
41
- ]},
42
- { key: "showHints", label: "Show Hints", type: "toggle" as const, default: true },
43
- ];
44
-
29
+ export default class MyMod extends Bootstrap {
45
30
  OnModPackageLoaded() {
46
- console.log("My mod loaded!");
31
+ const difficulty = Storage.get<string>("difficulty");
32
+ console.log(`Loaded with difficulty: ${difficulty}`);
33
+ }
34
+
35
+ OnModPackageUnloaded() {
36
+ console.log("Mod unloaded");
47
37
  }
48
38
  }
39
+ ```
40
+
41
+ ## Quests
42
+
43
+ ```typescript
44
+ import { Quest, Network, RegisterQuest } from "@hotbunny/hackhub-content-sdk";
49
45
 
50
46
  @RegisterQuest
51
- class MyQuest extends Quest {
47
+ class InfiltrationQuest extends Quest {
52
48
  definition = {
53
- name: "MyQuest",
54
- title: "My Custom Quest",
55
- description: "A quest added by a mod.",
56
- rewards: { money: 100 },
49
+ name: "Infiltration",
50
+ title: "Server Infiltration",
51
+ description: "Hack into the target server and download the data.",
52
+ employer: { name: "Mr. X", avatar: "mrx" },
53
+ rewards: { money: 5000, xp: 200 },
57
54
  objectives: [
58
55
  {
59
56
  name: "scan",
60
- description: "Scan the target",
61
- trigger: {
62
- event: "Terminal.NmapScan",
63
- condition: (data) => data.ip === "10.0.0.1",
64
- },
57
+ description: "Scan the target server",
58
+ trigger: { event: "Terminal.NmapScan", condition: (data) => data.ip === this.Data.targetIp },
59
+ },
60
+ {
61
+ name: "connect",
62
+ description: "Connect via SSH",
63
+ trigger: { event: "Terminal.SSH.Connected", condition: (data) => data.ip === this.Data.targetIp },
65
64
  },
66
65
  ],
67
66
  };
68
67
 
69
- OnStart() {
70
- const targetIp = Random.pick(["10.0.0.1", "10.0.0.2", "10.0.0.3"]);
68
+ Data = {
69
+ targetIp: "10.0.0.50",
70
+ };
71
71
 
72
+ OnStart() {
72
73
  Network.createSubnetNetwork({
73
- ip: targetIp,
74
+ ip: this.Data.targetIp,
74
75
  type: "ROUTER",
75
- ports: [{ external: 80, internal: 80, active: true, service: "http" }],
76
- users: [Network.createUser({ username: "admin", password: Random.password() })],
76
+ ports: [{ external: 22, internal: 22, active: true, service: "ssh" }],
77
+ users: [Network.createUser({ username: "admin", password: "secret123" })],
77
78
  children: [],
78
79
  });
79
80
  }
80
81
  }
81
82
  ```
82
83
 
83
- ## API Overview
84
+ ### Quest Mail & Dialogs
84
85
 
85
- ### Base Classes
86
-
87
- | Class | Purpose |
88
- |-------|---------|
89
- | `Bootstrap` | Mod entry point with lifecycle callbacks, settings, and manifest |
90
- | `Quest` | Define custom quests with objectives, rewards, mail, and dialogs |
91
- | `Website` | Add in-game websites to the browser |
92
- | `Command` | Register custom terminal commands |
93
- | `App` | Create desktop applications |
94
-
95
- ### API Namespaces
96
-
97
- | Namespace | Purpose |
98
- |-----------|---------|
99
- | `Events` | Listen to 60+ game events, emit custom cross-mod events |
100
- | `Files` | Create, read, write, delete files in the game filesystem |
101
- | `Network` | Create networks, manage ports, firewalls, domains |
102
- | `Mail` | Send in-game emails |
103
- | `Bank` | Manage bank transactions |
104
- | `Random` | Random generation helpers (id, uuid, number, password, username, pick, sleep) |
105
- | `Storage` | Persistent key-value storage (per-mod) |
106
- | `Variables` | Session-only variables (per-mod, reset on game close) |
107
- | `SharedStorage` | Persistent storage shared between mods |
108
- | `SharedVariables` | Session variables shared between mods |
109
- | `Shell` | Execute terminal commands programmatically |
110
- | `UI` | Show notifications and toasts |
111
- | `Twotter` | In-game Twitter -- create users, post tweets |
112
- | `Kisscord` | In-game Discord -- create users, send messages |
113
- | `WeeChat` | In-game IRC -- create servers, send messages |
114
-
115
- ### Decorators
86
+ Quests can send in-game emails and start phone call dialogs:
116
87
 
117
88
  ```typescript
118
- @RegisterModPackage // Register the mod's Bootstrap class
119
- @RegisterQuest // Register a Quest
120
- @RegisterWebsite // Register a Website
121
- @RegisterCommand // Register a terminal Command
122
- @RegisterApp // Register a desktop App
123
- ```
89
+ @RegisterQuest
90
+ class StoryQuest extends Quest {
91
+ // ... definition, Data ...
124
92
 
125
- ## Mod Settings
93
+ Mails = [
94
+ { title: "Mission Briefing", content: "Your target is ready. Good luck." },
95
+ ];
126
96
 
127
- Mods can define settings that players can configure from the in-game Mods menu.
97
+ Dialog = {
98
+ default: [
99
+ { speaker: "Handler", text: "Are you ready for the mission?", options: [
100
+ { label: "Yes", text: "I'm ready.", switchBranch: "briefing" },
101
+ { label: "No", text: "Not yet.", isEnd: true },
102
+ ]},
103
+ ],
104
+ briefing: [
105
+ { speaker: "Handler", text: "Good luck out there.", isEnd: true },
106
+ ],
107
+ };
128
108
 
129
- ### Declarative Settings
109
+ OnStart() {
110
+ this.sendMail(0);
111
+ this.createDialog("default");
112
+ }
113
+ }
114
+ ```
130
115
 
131
- Define a `Settings` array on your Bootstrap class:
116
+ ## Websites
132
117
 
133
118
  ```typescript
134
- @RegisterModPackage
135
- class MyMod extends Bootstrap {
136
- Settings = [
137
- { key: "difficulty", label: "Difficulty", type: "select" as const, default: "normal", options: [
138
- { label: "Easy", value: "easy" },
139
- { label: "Normal", value: "normal" },
140
- { label: "Hard", value: "hard" },
141
- ]},
142
- { key: "showHints", label: "Show Hints", type: "toggle" as const, default: true },
143
- { key: "volume", label: "Volume", type: "slider" as const, default: 50, min: 0, max: 100, step: 5 },
144
- { key: "playerName", label: "Player Name", type: "text" as const, default: "Player" },
145
- ];
119
+ import { Website, RegisterWebsite } from "@hotbunny/hackhub-content-sdk";
120
+
121
+ @RegisterWebsite
122
+ class MyWebsite extends Website {
123
+ SiteName = "darkforum";
124
+ DisplayName = "DarkForum";
125
+ Description = "Underground hacking forum";
126
+ HTML = "website.html";
146
127
  }
147
128
  ```
148
129
 
149
- Setting values are stored in mod-scoped storage and can be read with `Storage.get("key")`.
130
+ ## Terminal Commands
150
131
 
151
- Available types: `toggle`, `select`, `text`, `number`, `slider`.
132
+ ```typescript
133
+ import { Command, RegisterCommand } from "@hotbunny/hackhub-content-sdk";
134
+
135
+ @RegisterCommand
136
+ class PingCommand extends Command {
137
+ CommandName = "myping";
138
+ Description = "Custom ping command";
152
139
 
153
- ### Custom HTML Settings
140
+ OnCommand(args: string[], tools: any) {
141
+ tools.println(`Pinging ${args[0] || "nowhere"}...`);
142
+ }
143
+ }
144
+ ```
154
145
 
155
- For advanced settings panels, provide an HTML file:
146
+ ## Desktop Apps
156
147
 
157
148
  ```typescript
158
- @RegisterModPackage
159
- class MyMod extends Bootstrap {
160
- SettingsHTML = "settings.html";
149
+ import { App, RegisterApp } from "@hotbunny/hackhub-content-sdk";
150
+
151
+ @RegisterApp
152
+ class MyApp extends App {
153
+ AppName = "mytool";
154
+ DisplayName = "My Tool";
155
+ Description = "A custom desktop application";
156
+ HTML = "app.html";
157
+ Size = { width: 600, height: 400 };
161
158
  }
162
159
  ```
163
160
 
164
- The HTML file is rendered in a sandboxed iframe within the Mods menu.
161
+ ## Mod Settings
165
162
 
166
- ## Random Helpers
163
+ Players can configure your mod from the in-game Mods menu. Settings values are accessible via `Storage.get(key)`.
167
164
 
168
165
  ```typescript
169
- import { Random } from "@hotbunny/hackhub-content-sdk";
166
+ import { Bootstrap, ModSettingDefinition, RegisterModPackage, Storage } from "@hotbunny/hackhub-content-sdk";
170
167
 
171
- Random.id(); // Short unique ID (default 10 chars)
172
- Random.uuid(); // UUID v4
173
- Random.number(1, 100); // Random integer between 1-100
174
- Random.password(); // Random password from game's list
175
- Random.username(); // Random username from game's list
176
- Random.pick(["a", "b", "c"]); // Random element from array
177
- Random.pickMultiple(arr, 3); // 3 unique random elements
178
- await Random.sleep(2000); // Wait 2 seconds
168
+ @RegisterModPackage
169
+ export default class MyMod extends Bootstrap {
170
+ Settings: ModSettingDefinition[] = [
171
+ {
172
+ key: "difficulty",
173
+ label: "Difficulty",
174
+ type: "select",
175
+ default: "normal",
176
+ options: [
177
+ { label: "Easy", value: "easy" },
178
+ { label: "Normal", value: "normal" },
179
+ { label: "Hard", value: "hard" },
180
+ ],
181
+ },
182
+ { key: "showHints", label: "Show Hints", type: "toggle", default: true },
183
+ { key: "maxEnemies", label: "Max Enemies", type: "slider", default: 5, min: 1, max: 20 },
184
+ ];
185
+
186
+ OnModPackageLoaded() {
187
+ const difficulty = Storage.get<string>("difficulty");
188
+ const hints = Storage.get<boolean>("showHints");
189
+ console.log(`Difficulty: ${difficulty}, Hints: ${hints}`);
190
+ }
191
+ }
179
192
  ```
180
193
 
181
- ## Events
194
+ Available setting types: `toggle`, `select`, `text`, `number`, `slider`.
182
195
 
183
- ### Listening to Game Events
196
+ For fully custom settings panels, use an HTML file rendered in iframe:
184
197
 
185
198
  ```typescript
186
- Events.on("Terminal.NmapScan", (data) => {
187
- console.log(`Player scanned ${data.ip}`);
188
- });
199
+ @RegisterModPackage
200
+ export default class MyMod extends Bootstrap {
201
+ SettingsHTML = "settings.html";
202
+ }
203
+ ```
189
204
 
190
- Events.on("Bettercap.Open", () => {
191
- console.log("Player opened Bettercap");
192
- });
205
+ ## API Reference
193
206
 
194
- Events.on("Process.Killed", (data) => {
195
- console.log(`Process ${data.name} was killed`);
196
- });
197
- ```
207
+ ### Namespaces
198
208
 
199
- ### Custom Cross-Mod Events
209
+ | Namespace | Purpose |
210
+ |-----------|---------|
211
+ | `Events` | Listen to 60+ game events, emit custom events |
212
+ | `Files` | Create, read, write, delete in-game files |
213
+ | `Network` | Create networks, ports, firewalls, domains |
214
+ | `Mail` | Send in-game emails |
215
+ | `Bank` | Bank accounts and transactions |
216
+ | `Random` | Random generation (id, password, username, pick, etc.) |
217
+ | `Storage` | Persistent key-value storage per mod |
218
+ | `Variables` | Session-only variables (reset on game close) |
219
+ | `SharedStorage` | Persistent storage shared between mods |
220
+ | `SharedVariables` | Session variables shared between mods |
221
+ | `Shell` | Execute terminal commands programmatically |
222
+ | `UI` | Notifications and toasts |
223
+ | `Twotter` | In-game social media (Twitter-like) |
224
+ | `Kisscord` | In-game messaging (Discord-like) |
225
+ | `WeeChat` | In-game IRC chat |
200
226
 
201
- ```typescript
202
- declare module "@hotbunny/hackhub-content-sdk" {
203
- interface ModEventMap {
204
- "MyMod.BossDefeated": { bossName: string; reward: number };
205
- }
206
- }
227
+ ### Random
207
228
 
208
- Events.register("MyMod.BossDefeated");
209
- Events.emit("MyMod.BossDefeated", { bossName: "Hydra", reward: 500 });
229
+ ```typescript
230
+ import { Random } from "@hotbunny/hackhub-content-sdk";
210
231
 
211
- Events.on("MyMod.BossDefeated", (data) => {
212
- console.log(`Boss ${data.bossName} defeated!`);
213
- });
232
+ Random.id(); // Short unique ID
233
+ Random.uuid(); // UUID v4
234
+ Random.number(1, 100); // Random integer 1-100
235
+ Random.password(); // Random password
236
+ Random.username(); // Random username
237
+ Random.pick(["a", "b", "c"]); // Random array element
238
+ Random.pickMultiple(arr, 3); // 3 unique random elements
239
+ await Random.sleep(2000); // Wait 2 seconds
214
240
  ```
215
241
 
216
- ## Quest Mail & Dialogs
217
-
218
- Quests can send in-game emails and start phone call dialogs:
242
+ ### Events
219
243
 
220
244
  ```typescript
221
- @RegisterQuest
222
- class MyQuest extends Quest {
223
- Mails = [
224
- { title: "Mission Briefing", content: "Your target is...", replyable: false },
225
- ];
245
+ import { Events } from "@hotbunny/hackhub-content-sdk";
226
246
 
227
- Dialog = {
228
- default: [
229
- { speaker: "Handler", text: "Are you ready?", options: [
230
- { label: "Yes", text: "I'm ready.", switchBranch: "briefing" },
231
- { label: "No", text: "Not yet.", isEnd: true },
232
- ]},
233
- ],
234
- briefing: [
235
- { speaker: "Handler", text: "Good luck.", isEnd: true },
236
- ],
237
- };
247
+ // Listen to game events
248
+ Events.on("Terminal.NmapScan", (data) => console.log(`Scanned ${data.ip}`));
249
+ Events.on("Bettercap.Open", () => console.log("Bettercap opened"));
250
+ Events.on("Process.Killed", (data) => console.log(`Killed ${data.name}`));
238
251
 
239
- OnStart() {
240
- this.sendMail(0);
241
- this.createDialog("default");
242
- }
243
- }
252
+ // Custom cross-mod events
253
+ Events.emit("MyMod.ScoreUpdated", { score: 100 });
254
+ Events.on("MyMod.ScoreUpdated", (data) => console.log(data.score));
244
255
  ```
245
256
 
246
257
  ## Manifest
247
258
 
248
- Each mod requires a `manifest.json`:
259
+ Each mod requires a `manifest.json` in its root:
249
260
 
250
261
  ```json
251
262
  {
252
- "id": "my-unique-mod-id",
263
+ "id": "my-mod-id",
253
264
  "name": "My Mod",
254
265
  "version": "1.0.0",
255
266
  "author": "Your Name",
256
- "description": "What the mod does",
267
+ "description": "A brief description of the mod",
257
268
  "apiVersion": 1,
258
269
  "permissions": ["filesystem", "network", "events"],
259
270
  "cover": "cover.png",
260
- "tags": ["quest", "network"],
261
- "dependencies": [],
262
- "workshopId": ""
271
+ "tags": ["quest", "network"]
263
272
  }
264
273
  ```
265
274
 
266
275
  ### Permissions
267
276
 
268
- | Permission | Required for |
269
- |------------|-------------|
277
+ | Permission | Grants access to |
278
+ |------------|-----------------|
270
279
  | `filesystem` | Files API |
271
280
  | `network` | Network API |
272
281
  | `events` | Events API |
@@ -277,11 +286,16 @@ Each mod requires a `manifest.json`:
277
286
 
278
287
  ## Steam Workshop
279
288
 
280
- Mods can be published to and downloaded from Steam Workshop directly from the in-game Mods menu.
289
+ Mods support Steam Workshop for easy distribution:
290
+
291
+ - **Upload** local mods to Workshop from the in-game Mods menu
292
+ - **Subscribe** to mods on Workshop -- they're automatically downloaded and loaded
293
+ - **Update** published mods with change notes
294
+
295
+ ## Links
281
296
 
282
- - **Browse**: View and manage your Workshop subscriptions
283
- - **Upload**: Publish local mods to Workshop with cover image, tags, and change notes
284
- - **Auto-discovery**: Subscribed Workshop mods are automatically loaded on game start
297
+ - [HackHub - Ultimate Hacker Simulator on Steam](https://store.steampowered.com/app/2980270/HackHub__Ultimate_Hacker_Simulator/)
298
+ - [Steam Workshop](https://steamcommunity.com/app/2980270/workshop/)
285
299
 
286
300
  ## License
287
301
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hotbunny/hackhub-content-sdk",
3
- "version": "0.9.0",
4
- "description": "Type definitions and build tools for HackHub mod development",
3
+ "version": "0.9.2",
4
+ "description": "Official modding SDK for HackHub - Ultimate Hacker Simulator on Steam. Create custom quests, websites, terminal commands, and desktop apps.",
5
5
  "types": "index.d.ts",
6
6
  "exports": {
7
7
  ".": {
@@ -19,10 +19,14 @@
19
19
  ],
20
20
  "keywords": [
21
21
  "hackhub",
22
+ "hacker-simulator",
23
+ "hacking-game",
24
+ "steam",
22
25
  "modding",
23
- "sdk",
24
- "types",
26
+ "modding-sdk",
25
27
  "game-modding",
28
+ "steam-workshop",
29
+ "typescript",
26
30
  "hotbunny"
27
31
  ],
28
32
  "repository": {