@cyberstrike-io/cyberstrike 1.1.16-beta.2 → 1.1.16-beta.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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "scripts": {
8
8
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
9
9
  },
10
- "version": "1.1.16-beta.2",
10
+ "version": "1.1.16-beta.3",
11
11
  "license": "AGPL-3.0-only",
12
12
  "keywords": [
13
13
  "cyberstrike",
@@ -40,16 +40,16 @@
40
40
  "playwright": "1.58.2"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@cyberstrike-io/cyberstrike-linux-x64-musl": "1.1.16-beta.2",
44
- "@cyberstrike-io/cyberstrike-darwin-arm64": "1.1.16-beta.2",
45
- "@cyberstrike-io/cyberstrike-linux-arm64": "1.1.16-beta.2",
46
- "@cyberstrike-io/cyberstrike-windows-x64": "1.1.16-beta.2",
47
- "@cyberstrike-io/cyberstrike-darwin-x64-baseline": "1.1.16-beta.2",
48
- "@cyberstrike-io/cyberstrike-linux-x64": "1.1.16-beta.2",
49
- "@cyberstrike-io/cyberstrike-linux-x64-baseline": "1.1.16-beta.2",
50
- "@cyberstrike-io/cyberstrike-linux-x64-baseline-musl": "1.1.16-beta.2",
51
- "@cyberstrike-io/cyberstrike-darwin-x64": "1.1.16-beta.2",
52
- "@cyberstrike-io/cyberstrike-linux-arm64-musl": "1.1.16-beta.2",
53
- "@cyberstrike-io/cyberstrike-windows-x64-baseline": "1.1.16-beta.2"
43
+ "@cyberstrike-io/cyberstrike-darwin-arm64": "1.1.16-beta.3",
44
+ "@cyberstrike-io/cyberstrike-linux-x64": "1.1.16-beta.3",
45
+ "@cyberstrike-io/cyberstrike-windows-x64": "1.1.16-beta.3",
46
+ "@cyberstrike-io/cyberstrike-linux-arm64": "1.1.16-beta.3",
47
+ "@cyberstrike-io/cyberstrike-windows-x64-baseline": "1.1.16-beta.3",
48
+ "@cyberstrike-io/cyberstrike-darwin-x64": "1.1.16-beta.3",
49
+ "@cyberstrike-io/cyberstrike-linux-arm64-musl": "1.1.16-beta.3",
50
+ "@cyberstrike-io/cyberstrike-darwin-x64-baseline": "1.1.16-beta.3",
51
+ "@cyberstrike-io/cyberstrike-linux-x64-musl": "1.1.16-beta.3",
52
+ "@cyberstrike-io/cyberstrike-linux-x64-baseline-musl": "1.1.16-beta.3",
53
+ "@cyberstrike-io/cyberstrike-linux-x64-baseline": "1.1.16-beta.3"
54
54
  }
55
55
  }
package/postinstall.mjs CHANGED
@@ -202,6 +202,7 @@ function installHackbrowserWorker() {
202
202
  {
203
203
  stdio: "inherit",
204
204
  timeout: 120000,
205
+ env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED: "0" },
205
206
  },
206
207
  )
207
208
  console.log("playwright installed to", nodeModulesDir)
@@ -222,6 +223,48 @@ function installHackbrowserWorker() {
222
223
  )
223
224
  }
224
225
 
226
+ /**
227
+ * Ensure npm's global bin directory is in the Windows user PATH.
228
+ * Corporate installs often skip PATH setup, leaving `cyberstrike` unreachable
229
+ * from both CMD and PowerShell. Uses PowerShell to append to user-level PATH
230
+ * (no admin required). Safe: checks for duplicates, doesn't truncate.
231
+ */
232
+ function ensureWindowsPath() {
233
+ try {
234
+ const npmPrefix = execSync("npm config get prefix", { encoding: "utf-8", timeout: 10000 }).trim()
235
+ if (!npmPrefix) return
236
+
237
+ const currentPath = process.env.PATH || ""
238
+ // Case-insensitive check for Windows paths
239
+ if (currentPath.toLowerCase().includes(npmPrefix.toLowerCase())) {
240
+ console.log(`npm global bin already in PATH: ${npmPrefix}`)
241
+ return
242
+ }
243
+
244
+ console.log(`Adding npm global bin to user PATH: ${npmPrefix}`)
245
+ // Use PowerShell to safely append to user-level PATH without truncation
246
+ const psCommand = [
247
+ `$current = [Environment]::GetEnvironmentVariable('Path', 'User')`,
248
+ `if ($current -and -not $current.ToLower().Contains('${npmPrefix.toLowerCase().replace(/'/g, "''")}')) {`,
249
+ ` [Environment]::SetEnvironmentVariable('Path', $current + ';${npmPrefix}', 'User')`,
250
+ ` Write-Host 'Added to user PATH: ${npmPrefix}'`,
251
+ `}`,
252
+ ].join("; ")
253
+ execSync(`powershell -NoProfile -Command "${psCommand}"`, {
254
+ stdio: "inherit",
255
+ timeout: 15000,
256
+ })
257
+ console.log("PATH updated. Restart your terminal for changes to take effect.")
258
+ } catch (err) {
259
+ console.warn(
260
+ `Warning: Could not add npm global bin to PATH automatically.\n` +
261
+ `If 'cyberstrike' command is not found, add npm's global bin directory to your PATH manually:\n` +
262
+ ` PowerShell: [Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + ';' + (npm config get prefix), 'User')\n` +
263
+ ` CMD: setx PATH "%PATH%;%APPDATA%\\npm"`,
264
+ )
265
+ }
266
+ }
267
+
225
268
  async function main() {
226
269
  try {
227
270
  if (os.platform() === "win32") {
@@ -231,6 +274,7 @@ async function main() {
231
274
  installWebUI()
232
275
  installSkills()
233
276
  installHackbrowserWorker()
277
+ ensureWindowsPath()
234
278
  return
235
279
  }
236
280