@exorcist-98/mcp-server 0.3.5 → 0.3.7
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 +24 -34
- 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.7"] }
|
|
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 existsSync4, 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
|
|
31210
|
+
import { closeSync as closeSync2, existsSync, 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 {
|
|
32039
|
+
import { 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
|
|
|
@@ -32138,34 +32138,24 @@ function envFamilyOwners(name) {
|
|
|
32138
32138
|
for (const [re2, owners] of ENV_FAMILIES) if (re2.test(name)) return owners;
|
|
32139
32139
|
return null;
|
|
32140
32140
|
}
|
|
32141
|
-
var
|
|
32142
|
-
var PROGRAM_VAR = /(?:EDITOR|PAGER|BROWSER|_CMD|_COMMAND|_HELPER|_PROGRAM|_EXEC|_SHELL|_ARGS(?:_\w+)?)$/u;
|
|
32141
|
+
var PLAIN_VAR = /(?:_LOG|_LOG_LEVEL|_DEBUG|_VERBOSE|_COLOR|_NO_COLOR|_IN_AUTOMATION|_INPUT|_WORKSPACE|_NAMESPACE|_CONTEXT|_REGION|_VAR_[A-Za-z0-9_]+|EDITOR|PAGER|BROWSER|_CLI_ARGS(?:_[a-z]+)?)$/u;
|
|
32143
32142
|
var ENDPOINT_VAR = /(?:_HOST|_URL|_ENDPOINT|_SERVER)$/;
|
|
32144
32143
|
function unlockedValueRisk(name, value, cwd, dynamic) {
|
|
32145
32144
|
const runtime = dynamic || /[$`]/.test(value);
|
|
32146
32145
|
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`;
|
|
32147
32146
|
if (runtime) return say;
|
|
32148
|
-
if (PATH_VAR.test(name) && anyInside(value, cwd)) return say;
|
|
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
|
-
}
|
|
32162
|
-
}
|
|
32163
32147
|
if (ENDPOINT_VAR.test(name)) {
|
|
32164
32148
|
const m = /^(?:unix|npipe|file):\/\/(.*)$/.exec(value);
|
|
32165
32149
|
const target = m === null ? value : m[1];
|
|
32166
|
-
|
|
32150
|
+
return (m !== null || /^[./~]/.test(target)) && insideProject(target, cwd) ? say : null;
|
|
32167
32151
|
}
|
|
32168
|
-
|
|
32152
|
+
let v = value.trim();
|
|
32153
|
+
if (v.startsWith("~")) v = expandTilde(v, cwd) ?? v;
|
|
32154
|
+
const one = `${name} takes one word here: an absolute path outside the project, or, for a variable that holds a plain value, a name with no dot, slash or tilde`;
|
|
32155
|
+
if (v === "") return null;
|
|
32156
|
+
if (/[\s:,;=]/u.test(v)) return one;
|
|
32157
|
+
if (isAbsolute5(v)) return insideProject(v, cwd) ? say : null;
|
|
32158
|
+
return PLAIN_VAR.test(name) && !/[./\\~]/u.test(v) ? null : one;
|
|
32169
32159
|
}
|
|
32170
32160
|
function envAssignRisk(name, value, cwd, dynamic = false, known, prog) {
|
|
32171
32161
|
const owners = envFamilyOwners(name);
|
|
@@ -34023,7 +34013,7 @@ function readLocalText(pkgDir, rel) {
|
|
|
34023
34013
|
const r = relative5(root, p);
|
|
34024
34014
|
return r !== "" && !r.startsWith("..") && !isAbsolute6(r) && !r.split(sep).includes("..");
|
|
34025
34015
|
};
|
|
34026
|
-
if (!within(pkgDir, abs) || !
|
|
34016
|
+
if (!within(pkgDir, abs) || !existsSync(abs)) return null;
|
|
34027
34017
|
const real = realpathSync(abs);
|
|
34028
34018
|
if (!within(realpathSync(pkgDir), real)) return null;
|
|
34029
34019
|
const st = statSync2(real);
|
|
@@ -35767,7 +35757,7 @@ var LockSchema = external_exports.object({
|
|
|
35767
35757
|
|
|
35768
35758
|
// ../shield/src/vault.ts
|
|
35769
35759
|
import { createHash as createHash3, randomBytes as randomBytes4 } from "node:crypto";
|
|
35770
|
-
import { closeSync as closeSync4, constants as constants3, copyFileSync, existsSync as
|
|
35760
|
+
import { closeSync as closeSync4, constants as constants3, copyFileSync, existsSync as existsSync2, 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";
|
|
35771
35761
|
import { basename as basename5, dirname as dirname3, isAbsolute as isAbsolute7, join as join12, resolve as resolve7, sep as sep2 } from "node:path";
|
|
35772
35762
|
init_zod();
|
|
35773
35763
|
var SafeRel = external_exports.string().min(1).max(1024).refine(
|
|
@@ -35865,12 +35855,12 @@ function writeManifest(vaultDir, e) {
|
|
|
35865
35855
|
`);
|
|
35866
35856
|
}
|
|
35867
35857
|
function listEntries(vaultDir) {
|
|
35868
|
-
if (!
|
|
35858
|
+
if (!existsSync2(vaultDir)) return [];
|
|
35869
35859
|
const key = getUserKey();
|
|
35870
35860
|
const out = [];
|
|
35871
35861
|
for (const name of readdirSync3(vaultDir)) {
|
|
35872
35862
|
const file = join12(vaultDir, name, "manifest.json");
|
|
35873
|
-
if (!
|
|
35863
|
+
if (!existsSync2(file)) continue;
|
|
35874
35864
|
try {
|
|
35875
35865
|
const st = lstatSync4(file);
|
|
35876
35866
|
if (!st.isFile()) continue;
|
|
@@ -36104,7 +36094,7 @@ var MAX_HASHED_BYTES = 64 * 1024 * 1024;
|
|
|
36104
36094
|
var MAX_EVENT_BYTES2 = 16 * 1024 * 1024;
|
|
36105
36095
|
|
|
36106
36096
|
// ../shield/src/locate.ts
|
|
36107
|
-
import { existsSync as
|
|
36097
|
+
import { existsSync as existsSync3, readdirSync as readdirSync4, statSync as statSync5 } from "node:fs";
|
|
36108
36098
|
import { dirname as dirname4, isAbsolute as isAbsolute8, join as join13, parse as parse3, resolve as resolve8 } from "node:path";
|
|
36109
36099
|
import { fileURLToPath } from "node:url";
|
|
36110
36100
|
function hasDefinitions(dir) {
|
|
@@ -36170,11 +36160,11 @@ function findDefinitionsDir2(cwd) {
|
|
|
36170
36160
|
}
|
|
36171
36161
|
function resolveInside(cwd, p, roots = [], primary) {
|
|
36172
36162
|
const real = (d) => realpathSync3(d);
|
|
36173
|
-
const extra = roots.filter((r) =>
|
|
36163
|
+
const extra = roots.filter((r) => existsSync4(r)).map(real);
|
|
36174
36164
|
const first = primary !== void 0 && extra.includes(real(primary)) ? [real(primary)] : [];
|
|
36175
36165
|
const bases = [.../* @__PURE__ */ new Set([...first, real(cwd), ...extra])];
|
|
36176
36166
|
const tries = isAbsolute9(p) ? [p] : bases.map((b) => resolve9(b, p));
|
|
36177
|
-
const found = tries.find((t2) =>
|
|
36167
|
+
const found = tries.find((t2) => existsSync4(t2));
|
|
36178
36168
|
if (!found) return { ok: false, error: `Path not found: ${p}` };
|
|
36179
36169
|
const target = realpathSync3(found);
|
|
36180
36170
|
const base = bases.find((b) => {
|
|
@@ -36210,7 +36200,7 @@ var PROJECT_MARKERS = [
|
|
|
36210
36200
|
"README"
|
|
36211
36201
|
];
|
|
36212
36202
|
function looksLikeProject(dir) {
|
|
36213
|
-
const has = (n) =>
|
|
36203
|
+
const has = (n) => existsSync4(join14(dir, n));
|
|
36214
36204
|
if (has("plugin.json") || has("POWER.md")) return false;
|
|
36215
36205
|
return PROJECT_MARKERS.some(has);
|
|
36216
36206
|
}
|
|
@@ -36221,7 +36211,7 @@ var isWithin = (base, p) => {
|
|
|
36221
36211
|
return rel === "" || !rel.startsWith("..") && !isAbsolute9(rel);
|
|
36222
36212
|
};
|
|
36223
36213
|
function sensitiveReason(real, home = homedir5()) {
|
|
36224
|
-
const realHome =
|
|
36214
|
+
const realHome = existsSync4(home) ? realpathSync3(home) : home;
|
|
36225
36215
|
if (dirname5(real) === real) return "it is the filesystem root";
|
|
36226
36216
|
if (isWithin(real, realHome)) return real === realHome ? "it is the home folder" : "it contains the home folder";
|
|
36227
36217
|
for (const n of SENSITIVE_IN_HOME) {
|
|
@@ -36285,7 +36275,7 @@ function usableRoots(entries, home) {
|
|
|
36285
36275
|
continue;
|
|
36286
36276
|
}
|
|
36287
36277
|
} else if (/^[a-z][a-z0-9+.-]*:/i.test(path) && !/^[a-z]:[\\/]/i.test(path)) continue;
|
|
36288
|
-
if (!isAbsolute9(path) || !
|
|
36278
|
+
if (!isAbsolute9(path) || !existsSync4(path)) continue;
|
|
36289
36279
|
let real;
|
|
36290
36280
|
try {
|
|
36291
36281
|
if (!statSync6(path).isDirectory()) continue;
|
|
@@ -36293,7 +36283,7 @@ function usableRoots(entries, home) {
|
|
|
36293
36283
|
} catch {
|
|
36294
36284
|
continue;
|
|
36295
36285
|
}
|
|
36296
|
-
const realHome =
|
|
36286
|
+
const realHome = existsSync4(home) ? realpathSync3(home) : home;
|
|
36297
36287
|
if (real === resolve9("/") || real === realHome || dirname5(real) === real) continue;
|
|
36298
36288
|
if (!out.includes(real)) out.push(real);
|
|
36299
36289
|
}
|
|
@@ -36413,7 +36403,7 @@ Tell the user. They can undo this with: exorcist vault restore ${r.value.id}`
|
|
|
36413
36403
|
}
|
|
36414
36404
|
|
|
36415
36405
|
// src/index.ts
|
|
36416
|
-
var VERSION = "0.3.
|
|
36406
|
+
var VERSION = "0.3.7";
|
|
36417
36407
|
var ctx = {
|
|
36418
36408
|
cwd: process.cwd(),
|
|
36419
36409
|
approved: [],
|