@exorcist-98/mcp-server 0.3.4 → 0.3.5
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 +1 -1
- package/dist/index.mjs +29 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ out of results unless you ask for it, and is then marked as untrusted.
|
|
|
37
37
|
```json
|
|
38
38
|
{
|
|
39
39
|
"mcpServers": {
|
|
40
|
-
"exorcist": { "command": "npx", "args": ["-y", "@exorcist-98/mcp-server@0.3.
|
|
40
|
+
"exorcist": { "command": "npx", "args": ["-y", "@exorcist-98/mcp-server@0.3.5"] }
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
```
|
package/dist/index.mjs
CHANGED
|
@@ -22759,7 +22759,7 @@ import { homedir as homedir6 } from "node:os";
|
|
|
22759
22759
|
import { delimiter } from "node:path";
|
|
22760
22760
|
|
|
22761
22761
|
// src/tools.ts
|
|
22762
|
-
import { existsSync as
|
|
22762
|
+
import { existsSync as existsSync5, readFileSync as readFileSync7, realpathSync as realpathSync3, statSync as statSync6 } from "node:fs";
|
|
22763
22763
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
22764
22764
|
|
|
22765
22765
|
// ../shield/src/canonical.ts
|
|
@@ -31207,7 +31207,7 @@ function checkPathSegment(name) {
|
|
|
31207
31207
|
}
|
|
31208
31208
|
|
|
31209
31209
|
// ../core/src/lifecycle-scripts.ts
|
|
31210
|
-
import { closeSync as closeSync2, existsSync, lstatSync as lstatSync2, openSync as openSync2, readdirSync, readSync, realpathSync, statSync as statSync2 } from "node:fs";
|
|
31210
|
+
import { closeSync as closeSync2, existsSync as existsSync2, lstatSync as lstatSync2, openSync as openSync2, readdirSync, readSync, realpathSync, statSync as statSync2 } from "node:fs";
|
|
31211
31211
|
import { isAbsolute as isAbsolute6, join as join8, posix as posix2, relative as relative5, resolve as resolve5, sep } from "node:path";
|
|
31212
31212
|
|
|
31213
31213
|
// ../core/src/install-hooks.ts
|
|
@@ -32036,7 +32036,7 @@ function parseShell(command, sub = false) {
|
|
|
32036
32036
|
|
|
32037
32037
|
// ../core/src/dev-tools.ts
|
|
32038
32038
|
init_zod();
|
|
32039
|
-
import { readFileSync as readFileSync4, statSync } from "node:fs";
|
|
32039
|
+
import { existsSync, readFileSync as readFileSync4, statSync } from "node:fs";
|
|
32040
32040
|
import { homedir as homedir3 } from "node:os";
|
|
32041
32041
|
import { isAbsolute as isAbsolute5, join as join7, normalize as normalize2, relative as relative4, resolve as resolve3 } from "node:path";
|
|
32042
32042
|
|
|
@@ -32139,14 +32139,26 @@ function envFamilyOwners(name) {
|
|
|
32139
32139
|
return null;
|
|
32140
32140
|
}
|
|
32141
32141
|
var PATH_VAR = /(?:CONFIG|_FILES?|_DIR|_HOME|_PATH|_PLUGINS?|CACHEDIR|_CERT\w*|_CA\w*)$/;
|
|
32142
|
+
var PROGRAM_VAR = /(?:EDITOR|PAGER|BROWSER|_CMD|_COMMAND|_HELPER|_PROGRAM|_EXEC|_SHELL|_ARGS(?:_\w+)?)$/u;
|
|
32142
32143
|
var ENDPOINT_VAR = /(?:_HOST|_URL|_ENDPOINT|_SERVER)$/;
|
|
32143
32144
|
function unlockedValueRisk(name, value, cwd, dynamic) {
|
|
32144
32145
|
const runtime = dynamic || /[$`]/.test(value);
|
|
32145
32146
|
const say = `${name} is set to a path inside the project, or to a value built at run time, and a tool config can name a program to run or a daemon to reach`;
|
|
32146
32147
|
if (runtime) return say;
|
|
32147
32148
|
if (PATH_VAR.test(name) && anyInside(value, cwd)) return say;
|
|
32148
|
-
|
|
32149
|
-
|
|
32149
|
+
const parts = value.split(/[\s:,;=]+/u).filter((x) => x !== "");
|
|
32150
|
+
if (PROGRAM_VAR.test(name)) {
|
|
32151
|
+
const only = parts.length === 1 && value.trim() === parts[0] ? parts[0] : void 0;
|
|
32152
|
+
const ok = only !== void 0 && (isAbsolute5(only) ? !insideProject(only, cwd) : !/[/\\~]/u.test(only) && cwd !== void 0 && !existsSync(resolve3(cwd, only)));
|
|
32153
|
+
if (!ok) return `${name} names a program or arguments for the tool, and only one word is allowed: an absolute path outside the project, or a program name that is not a file in the project`;
|
|
32154
|
+
}
|
|
32155
|
+
for (const part of parts) {
|
|
32156
|
+
if (/^[./~]/u.test(part) || part.includes("/")) {
|
|
32157
|
+
if (insideProject(part, cwd)) return say;
|
|
32158
|
+
} else {
|
|
32159
|
+
const bare = part.replace(/^-+/u, "");
|
|
32160
|
+
if (bare !== "" && (cwd === void 0 || existsSync(resolve3(cwd, bare)))) return say;
|
|
32161
|
+
}
|
|
32150
32162
|
}
|
|
32151
32163
|
if (ENDPOINT_VAR.test(name)) {
|
|
32152
32164
|
const m = /^(?:unix|npipe|file):\/\/(.*)$/.exec(value);
|
|
@@ -34011,7 +34023,7 @@ function readLocalText(pkgDir, rel) {
|
|
|
34011
34023
|
const r = relative5(root, p);
|
|
34012
34024
|
return r !== "" && !r.startsWith("..") && !isAbsolute6(r) && !r.split(sep).includes("..");
|
|
34013
34025
|
};
|
|
34014
|
-
if (!within(pkgDir, abs) || !
|
|
34026
|
+
if (!within(pkgDir, abs) || !existsSync2(abs)) return null;
|
|
34015
34027
|
const real = realpathSync(abs);
|
|
34016
34028
|
if (!within(realpathSync(pkgDir), real)) return null;
|
|
34017
34029
|
const st = statSync2(real);
|
|
@@ -35755,7 +35767,7 @@ var LockSchema = external_exports.object({
|
|
|
35755
35767
|
|
|
35756
35768
|
// ../shield/src/vault.ts
|
|
35757
35769
|
import { createHash as createHash3, randomBytes as randomBytes4 } from "node:crypto";
|
|
35758
|
-
import { closeSync as closeSync4, constants as constants3, copyFileSync, existsSync as
|
|
35770
|
+
import { closeSync as closeSync4, constants as constants3, copyFileSync, existsSync as existsSync3, fstatSync as fstatSync3, lstatSync as lstatSync4, mkdirSync as mkdirSync3, openSync as openSync4, readFileSync as readFileSync6, readdirSync as readdirSync3, realpathSync as realpathSync2, rmSync as rmSync2, statSync as statSync4, writeFileSync as writeFileSync2, writeSync as writeSync2 } from "node:fs";
|
|
35759
35771
|
import { basename as basename5, dirname as dirname3, isAbsolute as isAbsolute7, join as join12, resolve as resolve7, sep as sep2 } from "node:path";
|
|
35760
35772
|
init_zod();
|
|
35761
35773
|
var SafeRel = external_exports.string().min(1).max(1024).refine(
|
|
@@ -35853,12 +35865,12 @@ function writeManifest(vaultDir, e) {
|
|
|
35853
35865
|
`);
|
|
35854
35866
|
}
|
|
35855
35867
|
function listEntries(vaultDir) {
|
|
35856
|
-
if (!
|
|
35868
|
+
if (!existsSync3(vaultDir)) return [];
|
|
35857
35869
|
const key = getUserKey();
|
|
35858
35870
|
const out = [];
|
|
35859
35871
|
for (const name of readdirSync3(vaultDir)) {
|
|
35860
35872
|
const file = join12(vaultDir, name, "manifest.json");
|
|
35861
|
-
if (!
|
|
35873
|
+
if (!existsSync3(file)) continue;
|
|
35862
35874
|
try {
|
|
35863
35875
|
const st = lstatSync4(file);
|
|
35864
35876
|
if (!st.isFile()) continue;
|
|
@@ -36092,7 +36104,7 @@ var MAX_HASHED_BYTES = 64 * 1024 * 1024;
|
|
|
36092
36104
|
var MAX_EVENT_BYTES2 = 16 * 1024 * 1024;
|
|
36093
36105
|
|
|
36094
36106
|
// ../shield/src/locate.ts
|
|
36095
|
-
import { existsSync as
|
|
36107
|
+
import { existsSync as existsSync4, readdirSync as readdirSync4, statSync as statSync5 } from "node:fs";
|
|
36096
36108
|
import { dirname as dirname4, isAbsolute as isAbsolute8, join as join13, parse as parse3, resolve as resolve8 } from "node:path";
|
|
36097
36109
|
import { fileURLToPath } from "node:url";
|
|
36098
36110
|
function hasDefinitions(dir) {
|
|
@@ -36158,11 +36170,11 @@ function findDefinitionsDir2(cwd) {
|
|
|
36158
36170
|
}
|
|
36159
36171
|
function resolveInside(cwd, p, roots = [], primary) {
|
|
36160
36172
|
const real = (d) => realpathSync3(d);
|
|
36161
|
-
const extra = roots.filter((r) =>
|
|
36173
|
+
const extra = roots.filter((r) => existsSync5(r)).map(real);
|
|
36162
36174
|
const first = primary !== void 0 && extra.includes(real(primary)) ? [real(primary)] : [];
|
|
36163
36175
|
const bases = [.../* @__PURE__ */ new Set([...first, real(cwd), ...extra])];
|
|
36164
36176
|
const tries = isAbsolute9(p) ? [p] : bases.map((b) => resolve9(b, p));
|
|
36165
|
-
const found = tries.find((t2) =>
|
|
36177
|
+
const found = tries.find((t2) => existsSync5(t2));
|
|
36166
36178
|
if (!found) return { ok: false, error: `Path not found: ${p}` };
|
|
36167
36179
|
const target = realpathSync3(found);
|
|
36168
36180
|
const base = bases.find((b) => {
|
|
@@ -36198,7 +36210,7 @@ var PROJECT_MARKERS = [
|
|
|
36198
36210
|
"README"
|
|
36199
36211
|
];
|
|
36200
36212
|
function looksLikeProject(dir) {
|
|
36201
|
-
const has = (n) =>
|
|
36213
|
+
const has = (n) => existsSync5(join14(dir, n));
|
|
36202
36214
|
if (has("plugin.json") || has("POWER.md")) return false;
|
|
36203
36215
|
return PROJECT_MARKERS.some(has);
|
|
36204
36216
|
}
|
|
@@ -36209,7 +36221,7 @@ var isWithin = (base, p) => {
|
|
|
36209
36221
|
return rel === "" || !rel.startsWith("..") && !isAbsolute9(rel);
|
|
36210
36222
|
};
|
|
36211
36223
|
function sensitiveReason(real, home = homedir5()) {
|
|
36212
|
-
const realHome =
|
|
36224
|
+
const realHome = existsSync5(home) ? realpathSync3(home) : home;
|
|
36213
36225
|
if (dirname5(real) === real) return "it is the filesystem root";
|
|
36214
36226
|
if (isWithin(real, realHome)) return real === realHome ? "it is the home folder" : "it contains the home folder";
|
|
36215
36227
|
for (const n of SENSITIVE_IN_HOME) {
|
|
@@ -36273,7 +36285,7 @@ function usableRoots(entries, home) {
|
|
|
36273
36285
|
continue;
|
|
36274
36286
|
}
|
|
36275
36287
|
} else if (/^[a-z][a-z0-9+.-]*:/i.test(path) && !/^[a-z]:[\\/]/i.test(path)) continue;
|
|
36276
|
-
if (!isAbsolute9(path) || !
|
|
36288
|
+
if (!isAbsolute9(path) || !existsSync5(path)) continue;
|
|
36277
36289
|
let real;
|
|
36278
36290
|
try {
|
|
36279
36291
|
if (!statSync6(path).isDirectory()) continue;
|
|
@@ -36281,7 +36293,7 @@ function usableRoots(entries, home) {
|
|
|
36281
36293
|
} catch {
|
|
36282
36294
|
continue;
|
|
36283
36295
|
}
|
|
36284
|
-
const realHome =
|
|
36296
|
+
const realHome = existsSync5(home) ? realpathSync3(home) : home;
|
|
36285
36297
|
if (real === resolve9("/") || real === realHome || dirname5(real) === real) continue;
|
|
36286
36298
|
if (!out.includes(real)) out.push(real);
|
|
36287
36299
|
}
|
|
@@ -36401,7 +36413,7 @@ Tell the user. They can undo this with: exorcist vault restore ${r.value.id}`
|
|
|
36401
36413
|
}
|
|
36402
36414
|
|
|
36403
36415
|
// src/index.ts
|
|
36404
|
-
var VERSION = "0.3.
|
|
36416
|
+
var VERSION = "0.3.5";
|
|
36405
36417
|
var ctx = {
|
|
36406
36418
|
cwd: process.cwd(),
|
|
36407
36419
|
approved: [],
|