adhdev 0.8.9 → 0.8.10
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/cli/index.js +36 -46
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +29 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39173,6 +39173,33 @@ var init_session_host = __esm({
|
|
|
39173
39173
|
}
|
|
39174
39174
|
});
|
|
39175
39175
|
|
|
39176
|
+
// src/version.ts
|
|
39177
|
+
function resolvePackageVersion(options) {
|
|
39178
|
+
const injectedVersion = options?.injectedVersion || "unknown";
|
|
39179
|
+
const dir = options?.dirname || __dirname;
|
|
39180
|
+
const possiblePaths = [
|
|
39181
|
+
(0, import_path2.join)(dir, "..", "..", "package.json"),
|
|
39182
|
+
(0, import_path2.join)(dir, "..", "package.json"),
|
|
39183
|
+
(0, import_path2.join)(dir, "package.json")
|
|
39184
|
+
];
|
|
39185
|
+
for (const p of possiblePaths) {
|
|
39186
|
+
try {
|
|
39187
|
+
const data = JSON.parse((0, import_fs3.readFileSync)(p, "utf-8"));
|
|
39188
|
+
if (data.version) return data.version;
|
|
39189
|
+
} catch {
|
|
39190
|
+
}
|
|
39191
|
+
}
|
|
39192
|
+
return injectedVersion;
|
|
39193
|
+
}
|
|
39194
|
+
var import_fs3, import_path2;
|
|
39195
|
+
var init_version = __esm({
|
|
39196
|
+
"src/version.ts"() {
|
|
39197
|
+
"use strict";
|
|
39198
|
+
import_fs3 = require("fs");
|
|
39199
|
+
import_path2 = require("path");
|
|
39200
|
+
}
|
|
39201
|
+
});
|
|
39202
|
+
|
|
39176
39203
|
// src/adhdev-daemon.ts
|
|
39177
39204
|
var adhdev_daemon_exports = {};
|
|
39178
39205
|
__export(adhdev_daemon_exports, {
|
|
@@ -39246,26 +39273,8 @@ var init_adhdev_daemon = __esm({
|
|
|
39246
39273
|
import_http = require("http");
|
|
39247
39274
|
import_ws3 = require("ws");
|
|
39248
39275
|
import_chalk2 = __toESM(require("chalk"));
|
|
39249
|
-
|
|
39250
|
-
|
|
39251
|
-
try {
|
|
39252
|
-
const possiblePaths = [
|
|
39253
|
-
path21.join(__dirname, "..", "package.json"),
|
|
39254
|
-
path21.join(__dirname, "package.json")
|
|
39255
|
-
];
|
|
39256
|
-
for (const p of possiblePaths) {
|
|
39257
|
-
try {
|
|
39258
|
-
const data = JSON.parse(fs17.readFileSync(p, "utf-8"));
|
|
39259
|
-
if (data.version) {
|
|
39260
|
-
pkgVersion = data.version;
|
|
39261
|
-
break;
|
|
39262
|
-
}
|
|
39263
|
-
} catch {
|
|
39264
|
-
}
|
|
39265
|
-
}
|
|
39266
|
-
} catch {
|
|
39267
|
-
}
|
|
39268
|
-
}
|
|
39276
|
+
init_version();
|
|
39277
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.10" });
|
|
39269
39278
|
DANGEROUS_PATTERNS = [
|
|
39270
39279
|
/\brm\s+(-[a-z]*f|-[a-z]*r|--force|--recursive)/i,
|
|
39271
39280
|
/\bsudo\b/i,
|