mcp-fs-shell-windows 0.2.19 → 0.2.29
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/LICENSE +2 -1
- package/README.md +352 -190
- package/dist/analyze_project/handler.js +62 -0
- package/dist/analyze_project/schema.js +5 -0
- package/dist/browser/browserActions.js +128 -0
- package/dist/browser/fuzzySearch.js +49 -0
- package/dist/browser/handler.js +227 -0
- package/dist/browser/launcher.js +103 -0
- package/dist/browser/schema.js +37 -0
- package/dist/browser/session.js +14 -0
- package/dist/compat/handler.js +254 -0
- package/dist/compat/schema.js +97 -0
- package/dist/gh/handler.js +406 -0
- package/dist/gh/schema.js +36 -0
- package/dist/git/handler.js +209 -0
- package/dist/git/schema.js +23 -0
- package/dist/launch_file/handler.js +3 -1
- package/dist/query_database/handler.js +27 -0
- package/dist/query_database/schema.js +5 -0
- package/dist/rag/handler.js +103 -0
- package/dist/rag/helpers.js +126 -0
- package/dist/rag/schema.js +16 -0
- package/dist/read_document/handler.js +61 -0
- package/dist/read_document/schema.js +4 -0
- package/dist/run_javascript/handler.js +124 -0
- package/dist/run_javascript/schema.js +28 -0
- package/dist/server.js +885 -1
- package/dist/shell/handler.js +14 -6
- package/dist/subagent/handler.js +752 -0
- package/dist/subagent/handoffMessage.js +56 -0
- package/dist/subagent/schema.js +18 -0
- package/dist/subagent/subAgentToolCallParser.js +491 -0
- package/dist/subagent/toolCallValidator.js +97 -0
- package/dist/system/handler.js +239 -0
- package/dist/system/schema.js +21 -0
- package/dist/web/ddgParse.js +51 -0
- package/dist/web/handler.js +286 -0
- package/dist/web/schema.js +18 -0
- package/package.json +22 -2
package/dist/shell/handler.js
CHANGED
|
@@ -16,6 +16,14 @@ import { SHELL_MAX_TIMEOUT_SEC } from "./schema.js";
|
|
|
16
16
|
export const SHELL_JOBS_DIR = nodePath.join(os.tmpdir(), "mcp-fs-shell-windows", "shell-jobs");
|
|
17
17
|
const jobs = new Map();
|
|
18
18
|
let defaultShellCwd = process.cwd();
|
|
19
|
+
/**
|
|
20
|
+
* The shell_cwd default working directory. Exposed for tools that operate on
|
|
21
|
+
* "the working directory" as their context (fork equivalent of the
|
|
22
|
+
* Beledarian plugin's currentWorkingDirectory), e.g. analyze_project.
|
|
23
|
+
*/
|
|
24
|
+
export function getDefaultShellCwd() {
|
|
25
|
+
return defaultShellCwd;
|
|
26
|
+
}
|
|
19
27
|
// Best-effort startup cleanup: drop job log files older than 24 h.
|
|
20
28
|
try {
|
|
21
29
|
const entries = fs.readdirSync(SHELL_JOBS_DIR);
|
|
@@ -36,19 +44,19 @@ catch {
|
|
|
36
44
|
// Job dir may not exist yet — that's fine.
|
|
37
45
|
}
|
|
38
46
|
/** Keep only the last `max` chars; mark truncation. */
|
|
39
|
-
function cap(text, max) {
|
|
47
|
+
export function cap(text, max) {
|
|
40
48
|
if (text.length <= max)
|
|
41
49
|
return text;
|
|
42
50
|
return `...[truncated] ` + text.slice(-max);
|
|
43
51
|
}
|
|
44
|
-
const CAP_OK = 100000; // cap for stdout/stderr in success payloads
|
|
45
|
-
const CAP_ERR = 20000; // cap for output embedded in error messages
|
|
52
|
+
export const CAP_OK = 100000; // cap for stdout/stderr in success payloads
|
|
53
|
+
export const CAP_ERR = 20000; // cap for output embedded in error messages
|
|
46
54
|
const TAIL = 262144; // per-stream in-memory job tail (256 KB)
|
|
47
55
|
function newJobId() {
|
|
48
56
|
return `sj-${Date.now().toString(36)}-${crypto.randomBytes(3).toString("hex")}`;
|
|
49
57
|
}
|
|
50
58
|
/** Resolve the effective working directory (param override or module default) and validate it. */
|
|
51
|
-
async function resolveCwd(cwd) {
|
|
59
|
+
export async function resolveCwd(cwd) {
|
|
52
60
|
const abs = cwd ? nodePath.resolve(cwd) : defaultShellCwd;
|
|
53
61
|
const st = await fsp.stat(abs).catch(() => null);
|
|
54
62
|
if (!st || !st.isDirectory()) {
|
|
@@ -189,14 +197,14 @@ function makeLineFeeder(logStream) {
|
|
|
189
197
|
};
|
|
190
198
|
return { feed, flush };
|
|
191
199
|
}
|
|
192
|
-
async function ensureJobsDir() {
|
|
200
|
+
export async function ensureJobsDir() {
|
|
193
201
|
await fsp.mkdir(SHELL_JOBS_DIR, { recursive: true }).catch(() => undefined);
|
|
194
202
|
}
|
|
195
203
|
/**
|
|
196
204
|
* Spawn a process, capture stdout/stderr (utf-8), enforce a timeout via killTree.
|
|
197
205
|
* Resolves (never rejects) with the outcome; spawn failures are reported in spawnError.
|
|
198
206
|
*/
|
|
199
|
-
async function runCaptured(exe, args, opts) {
|
|
207
|
+
export async function runCaptured(exe, args, opts) {
|
|
200
208
|
const result = { stdout: "", stderr: "", code: null, timedOut: false };
|
|
201
209
|
await new Promise((resolve) => {
|
|
202
210
|
let proc;
|