@flemist/mcp-project-tools 4.0.4 → 5.0.1
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/build/cli.js +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/{startMcpServer--UfKhlmP.js → startMcpServer-eMtH4-uF.js} +659 -660
- package/package.json +32 -29
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import ne from "express";
|
|
2
|
-
import { McpServer as
|
|
3
|
-
import { randomUUID as
|
|
2
|
+
import { McpServer as Zt } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { randomUUID as Xt } from "crypto";
|
|
4
4
|
import * as j from "fs";
|
|
5
5
|
import * as k from "path";
|
|
6
|
-
import { StreamableHTTPServerTransport as
|
|
7
|
-
import { spawn as
|
|
8
|
-
import { z as
|
|
6
|
+
import { StreamableHTTPServerTransport as er } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
7
|
+
import { spawn as tr } from "child_process";
|
|
8
|
+
import { z as m } from "zod";
|
|
9
9
|
import he from "tree-kill";
|
|
10
|
-
import { Pool as
|
|
10
|
+
import { Pool as rr, poolRunWait as V } from "@flemist/time-limits";
|
|
11
11
|
import { priorityCreate as X } from "@flemist/priority-queue";
|
|
12
|
-
import { useAbortController as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { webkit as
|
|
16
|
-
import
|
|
12
|
+
import { useAbortController as sr, combineAbortSignals as or, Locker as nr } from "@flemist/async-utils";
|
|
13
|
+
import ir from "node:os";
|
|
14
|
+
import ar from "picomatch";
|
|
15
|
+
import { webkit as lr, firefox as cr, chromium as ur } from "playwright";
|
|
16
|
+
import dr from "deepmerge";
|
|
17
17
|
import Ne from "json5";
|
|
18
|
-
import
|
|
19
|
-
function
|
|
18
|
+
import fr from "js-yaml";
|
|
19
|
+
function pr(t) {
|
|
20
20
|
const { authToken: r } = t;
|
|
21
21
|
return function(o, e, n) {
|
|
22
22
|
if ((o.query.token || o.headers.authorization?.replace("Bearer ", "")) !== r) {
|
|
@@ -39,12 +39,12 @@ ${n}
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
const ae = /* @__PURE__ */ new Map();
|
|
42
|
-
function
|
|
42
|
+
function hr(t) {
|
|
43
43
|
return t.headers["mcp-session-id"] || t.headers["x-session-id"] || t.query.token;
|
|
44
44
|
}
|
|
45
|
-
async function
|
|
46
|
-
const s = await r.createMcpServer(t), o = new
|
|
47
|
-
sessionIdGenerator:
|
|
45
|
+
async function mr(t, r) {
|
|
46
|
+
const s = await r.createMcpServer(t), o = new er({
|
|
47
|
+
sessionIdGenerator: Xt,
|
|
48
48
|
onsessioninitialized: (n) => {
|
|
49
49
|
ae.set(n, o);
|
|
50
50
|
},
|
|
@@ -66,16 +66,16 @@ async function hr(t, r) {
|
|
|
66
66
|
throw await e(), n;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
async function
|
|
69
|
+
async function gr(t, r, s, o) {
|
|
70
70
|
await ie({
|
|
71
71
|
logFilePath: s.logFilePath,
|
|
72
72
|
message: "REQUEST",
|
|
73
73
|
data: t.body
|
|
74
74
|
});
|
|
75
75
|
let e = o ? ae.get(o) : null;
|
|
76
|
-
e || (e = await
|
|
76
|
+
e || (e = await mr(t, s)), await e.handleRequest(t, r, t.body);
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
78
|
+
async function wr(t, r, s) {
|
|
79
79
|
const o = s ? ae.get(s) : null;
|
|
80
80
|
if (!o) {
|
|
81
81
|
r.status(400).json({ error: "No valid session found" });
|
|
@@ -83,11 +83,11 @@ async function gr(t, r, s) {
|
|
|
83
83
|
}
|
|
84
84
|
await o.handleRequest(t, r);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function yr(t) {
|
|
87
87
|
return async function(s, o) {
|
|
88
88
|
try {
|
|
89
|
-
const e =
|
|
90
|
-
s.method === "POST" ? await
|
|
89
|
+
const e = hr(s);
|
|
90
|
+
s.method === "POST" ? await gr(s, o, t, e) : s.method === "GET" ? await wr(s, o, e) : o.status(405).json({ error: "Method not allowed" });
|
|
91
91
|
} catch (e) {
|
|
92
92
|
console.error("Unhandled error in streamableHttpHandler", e), o.status(500).json({
|
|
93
93
|
error: "Internal server error: " + (e instanceof Error ? e.message : "Unknown error")
|
|
@@ -96,9 +96,9 @@ function wr(t) {
|
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
const Y = /* @__PURE__ */ new Map();
|
|
99
|
-
let
|
|
100
|
-
const ke = 10,
|
|
101
|
-
function
|
|
99
|
+
let br = 0;
|
|
100
|
+
const ke = 10, Sr = 1800 * 1e3, J = 1e4, Q = 2e3, xr = 5e3;
|
|
101
|
+
function Ir(t) {
|
|
102
102
|
const { commandLine: r, commandLineRules: s } = t;
|
|
103
103
|
let o = !1;
|
|
104
104
|
for (const e of s)
|
|
@@ -116,10 +116,10 @@ function xr(t) {
|
|
|
116
116
|
return o;
|
|
117
117
|
}
|
|
118
118
|
function $r() {
|
|
119
|
-
return ++
|
|
119
|
+
return ++br;
|
|
120
120
|
}
|
|
121
121
|
let Oe = !1;
|
|
122
|
-
function
|
|
122
|
+
function Mr() {
|
|
123
123
|
if (Oe)
|
|
124
124
|
return;
|
|
125
125
|
Oe = !0;
|
|
@@ -139,7 +139,7 @@ function Ir() {
|
|
|
139
139
|
function ge() {
|
|
140
140
|
const t = Date.now(), r = [];
|
|
141
141
|
for (const [s, o] of Array.from(Y.entries()))
|
|
142
|
-
!o.isRunning && o.endTime && t - o.endTime.getTime() >
|
|
142
|
+
!o.isRunning && o.endTime && t - o.endTime.getTime() > Sr && r.push(s);
|
|
143
143
|
for (const s of r)
|
|
144
144
|
Y.delete(s);
|
|
145
145
|
}
|
|
@@ -152,11 +152,11 @@ function at(t, r) {
|
|
|
152
152
|
let o;
|
|
153
153
|
return r ? o = s.split(/[\\/]/).map(Re).join(De) : o = Re(s), o += `(?=${De}|$)`, new RegExp(o, r ? "gi" : "g");
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Tr(t, r, s, o) {
|
|
156
156
|
const e = at(r, o);
|
|
157
157
|
return t.replace(e, (n) => s + n.slice(r.length));
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Cr(t, r, s, o) {
|
|
160
160
|
const e = process.platform === "win32", n = {};
|
|
161
161
|
if (s !== "clear") if (s === "replaceServerPaths" || s === "deleteServerPaths") {
|
|
162
162
|
const i = Fe(t, e), a = Fe(r, e);
|
|
@@ -165,7 +165,7 @@ function Tr(t, r, s, o) {
|
|
|
165
165
|
for (const u in process.env) {
|
|
166
166
|
if (!Object.prototype.hasOwnProperty.call(process.env, u)) continue;
|
|
167
167
|
const f = process.env[u];
|
|
168
|
-
f != null && (l.lastIndex = 0, l.test(f) ? s === "replaceServerPaths" && (n[u] =
|
|
168
|
+
f != null && (l.lastIndex = 0, l.test(f) ? s === "replaceServerPaths" && (n[u] = Tr(f, t, r, e)) : n[u] = f);
|
|
169
169
|
}
|
|
170
170
|
} else
|
|
171
171
|
for (const l in process.env) {
|
|
@@ -191,10 +191,10 @@ function Fe(t, r) {
|
|
|
191
191
|
const s = k.normalize(t).replace(/[\\/]+$/, "");
|
|
192
192
|
return r ? s.toLowerCase() : s;
|
|
193
193
|
}
|
|
194
|
-
const
|
|
195
|
-
let
|
|
196
|
-
function
|
|
197
|
-
return ++
|
|
194
|
+
const vr = 1800 * 1e3, Pe = /* @__PURE__ */ new Map();
|
|
195
|
+
let Er = 0;
|
|
196
|
+
function Nr() {
|
|
197
|
+
return ++Er;
|
|
198
198
|
}
|
|
199
199
|
function lt(t) {
|
|
200
200
|
let r = Pe.get(t);
|
|
@@ -208,13 +208,13 @@ function ct(t) {
|
|
|
208
208
|
function ut(t, r) {
|
|
209
209
|
return setTimeout(() => {
|
|
210
210
|
t.storedOutputs.delete(r);
|
|
211
|
-
},
|
|
211
|
+
}, vr);
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function kr(t, r, s) {
|
|
214
214
|
clearTimeout(s.cleanupTimer), s.cleanupTimer = ut(t, r);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
const { sessionId: r, source: s } = t, o = lt(r), e =
|
|
216
|
+
function Or(t) {
|
|
217
|
+
const { sessionId: r, source: s } = t, o = lt(r), e = Nr(), n = {
|
|
218
218
|
source: s,
|
|
219
219
|
cleanupTimer: ut(o, e)
|
|
220
220
|
};
|
|
@@ -229,7 +229,7 @@ function dt(t) {
|
|
|
229
229
|
range: [0, 0],
|
|
230
230
|
error: `Stored output with outputId=${s} not found or expired`
|
|
231
231
|
};
|
|
232
|
-
|
|
232
|
+
kr(i, s, a);
|
|
233
233
|
const c = ct(a.source), l = c.length, u = Math.min(Math.max(e, 0), l), f = Math.min(Math.max(n, 0), l);
|
|
234
234
|
return { content: c.substring(u, f), total: l, range: [u, f] };
|
|
235
235
|
}
|
|
@@ -237,7 +237,7 @@ function we(t) {
|
|
|
237
237
|
const { sessionId: r, source: s, limit: o } = t, e = ct(s);
|
|
238
238
|
if (e.length <= o)
|
|
239
239
|
return { content: e, outputId: null };
|
|
240
|
-
const n =
|
|
240
|
+
const n = Or({ sessionId: r, source: s }), i = dt({
|
|
241
241
|
sessionId: r,
|
|
242
242
|
outputId: n,
|
|
243
243
|
range: [0, o]
|
|
@@ -253,16 +253,22 @@ function F(t) {
|
|
|
253
253
|
|
|
254
254
|
Provide valid parameters according to schema.`;
|
|
255
255
|
}
|
|
256
|
-
const ft =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
const ft = m.object({
|
|
257
|
+
from: m.number().int().min(0).describe("Start index"),
|
|
258
|
+
to: m.number().int().min(0).describe("End index")
|
|
259
|
+
}), Rr = m.object({
|
|
260
|
+
from: m.number().int().min(0).describe("Start index"),
|
|
261
|
+
toExclusive: m.number().int().min(0).describe("End index exclusive")
|
|
262
|
+
}), pt = m.object({
|
|
263
|
+
outputId: m.number().int().describe("Output ID from truncation message"),
|
|
264
|
+
range: Rr.describe(
|
|
265
|
+
`Character range to retrieve. Maximum range size: ${J}.`
|
|
260
266
|
)
|
|
261
267
|
});
|
|
262
|
-
function
|
|
268
|
+
function Dr(t, r) {
|
|
263
269
|
let s;
|
|
264
270
|
try {
|
|
265
|
-
s =
|
|
271
|
+
s = pt.parse(t);
|
|
266
272
|
} catch (i) {
|
|
267
273
|
return {
|
|
268
274
|
error: F(i)
|
|
@@ -272,32 +278,29 @@ function Or(t, r) {
|
|
|
272
278
|
return {
|
|
273
279
|
error: "Session ID is required"
|
|
274
280
|
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
return {
|
|
278
|
-
error: `Invalid range: to (${e}) must be greater than from (${o})`
|
|
279
|
-
};
|
|
280
|
-
if (e - o > J)
|
|
281
|
-
return {
|
|
282
|
-
error: `Range size ${e - o} exceeds maximum ${J}`
|
|
283
|
-
};
|
|
281
|
+
let { from: o, toExclusive: e } = s.range;
|
|
282
|
+
e <= o && (e = o), e - o > J && (e = o + J);
|
|
284
283
|
const n = dt({
|
|
285
284
|
sessionId: r.sessionId,
|
|
286
285
|
outputId: s.outputId,
|
|
287
|
-
range:
|
|
286
|
+
range: [o, e]
|
|
288
287
|
});
|
|
289
|
-
return n.error != null ? { error: n.error } : {
|
|
288
|
+
return n.error != null ? { error: n.error } : {
|
|
289
|
+
content: n.content,
|
|
290
|
+
total: n.total,
|
|
291
|
+
range: n.range
|
|
292
|
+
};
|
|
290
293
|
}
|
|
291
|
-
function
|
|
294
|
+
function Fr(t) {
|
|
292
295
|
t(
|
|
293
296
|
"output-read",
|
|
294
297
|
{
|
|
295
298
|
title: "Read Stored Output Range",
|
|
296
299
|
description: "Read any range from stored output. Use outputId from truncation message and specify character range [from, to).",
|
|
297
|
-
inputSchema:
|
|
300
|
+
inputSchema: pt.shape
|
|
298
301
|
},
|
|
299
302
|
async (r, s) => {
|
|
300
|
-
const o =
|
|
303
|
+
const o = Dr(r, s);
|
|
301
304
|
if (o.error != null)
|
|
302
305
|
return `Method: output-read(${JSON.stringify(r)})
|
|
303
306
|
❌ Error: ${o.error}`;
|
|
@@ -311,14 +314,14 @@ ${o.content}`, a;
|
|
|
311
314
|
}
|
|
312
315
|
);
|
|
313
316
|
}
|
|
314
|
-
function
|
|
315
|
-
|
|
317
|
+
function Pr(t) {
|
|
318
|
+
Fr(t);
|
|
316
319
|
}
|
|
317
|
-
const
|
|
318
|
-
id:
|
|
320
|
+
const ht = m.object({
|
|
321
|
+
id: m.number().describe(
|
|
319
322
|
"Process ID to get detailed status information for. Get process IDs using process-list. Works for both running and completed processes. Examples: 1, 42, 123"
|
|
320
323
|
),
|
|
321
|
-
outputLimit:
|
|
324
|
+
outputLimit: m.number().int().min(0).max(J).default(Q).describe(
|
|
322
325
|
`Maximum output characters to return. Truncated output can be retrieved via output-read tool using outputId from truncation message. Maximum: ${J}. Default: ${Q}`
|
|
323
326
|
)
|
|
324
327
|
});
|
|
@@ -326,7 +329,7 @@ async function ye(t, r, s) {
|
|
|
326
329
|
ge();
|
|
327
330
|
let o;
|
|
328
331
|
try {
|
|
329
|
-
o =
|
|
332
|
+
o = ht.parse(t);
|
|
330
333
|
} catch (c) {
|
|
331
334
|
return {
|
|
332
335
|
error: F(c)
|
|
@@ -359,13 +362,13 @@ async function ye(t, r, s) {
|
|
|
359
362
|
error: i.error
|
|
360
363
|
};
|
|
361
364
|
}
|
|
362
|
-
function
|
|
365
|
+
function Br(t, r) {
|
|
363
366
|
t(
|
|
364
367
|
"process-status",
|
|
365
368
|
{
|
|
366
369
|
title: "Get Host Machine Process Status",
|
|
367
370
|
description: "Get detailed status information about a process on the host machine. Use this to check if commands completed successfully, get their output, or monitor running processes",
|
|
368
|
-
inputSchema:
|
|
371
|
+
inputSchema: ht.shape
|
|
369
372
|
},
|
|
370
373
|
async (s, o) => {
|
|
371
374
|
const e = await ye(s, r, o);
|
|
@@ -381,36 +384,36 @@ ${n.trim()}`;
|
|
|
381
384
|
}
|
|
382
385
|
);
|
|
383
386
|
}
|
|
384
|
-
function
|
|
387
|
+
function mt(t) {
|
|
385
388
|
he(t, "SIGTERM", (r) => {
|
|
386
389
|
r && !r.message.includes("not found") && console.error(`Error sending SIGTERM to process ${t}:`, r);
|
|
387
390
|
}), setTimeout(() => {
|
|
388
391
|
he(t, "SIGKILL", (r) => {
|
|
389
392
|
r && !r.message.includes("not found") && console.error(`Error sending SIGKILL to process ${t}:`, r);
|
|
390
393
|
});
|
|
391
|
-
},
|
|
394
|
+
}, xr);
|
|
392
395
|
}
|
|
393
|
-
const
|
|
394
|
-
id:
|
|
396
|
+
const gt = m.object({
|
|
397
|
+
id: m.number().describe(
|
|
395
398
|
"Process ID to wait for completion. Get process IDs using process-list. The process can be running or already completed. Examples: 1, 42, 123"
|
|
396
399
|
),
|
|
397
|
-
waitTime:
|
|
400
|
+
waitTime: m.number().optional().describe(
|
|
398
401
|
"Maximum time to wait in seconds for process completion. If omitted, waits indefinitely until process completes. If process is already completed, returns immediately. Examples: 30 (wait up to 30 seconds), 300 (wait up to 5 minutes)"
|
|
399
402
|
),
|
|
400
|
-
autoKill:
|
|
403
|
+
autoKill: m.boolean().default(!1).describe(
|
|
401
404
|
"Automatically terminate the process if waitTime expires and it is still running. Only applies when waitTime is specified. Default: false (let process continue running after timeout). Set to true for processes that should not run indefinitely"
|
|
402
405
|
),
|
|
403
|
-
outputLimit:
|
|
406
|
+
outputLimit: m.number().int().min(0).max(J).default(Q).describe(
|
|
404
407
|
`Maximum output characters to return. Truncated output can be retrieved via output-read tool using outputId from truncation message. Maximum: ${J}. Default: ${Q}`
|
|
405
408
|
)
|
|
406
409
|
});
|
|
407
|
-
async function
|
|
410
|
+
async function wt(t, r, s) {
|
|
408
411
|
let o;
|
|
409
412
|
try {
|
|
410
|
-
o =
|
|
411
|
-
} catch (
|
|
413
|
+
o = gt.parse(t);
|
|
414
|
+
} catch (h) {
|
|
412
415
|
return {
|
|
413
|
-
error: F(
|
|
416
|
+
error: F(h)
|
|
414
417
|
};
|
|
415
418
|
}
|
|
416
419
|
const { id: e, waitTime: n, autoKill: i, outputLimit: a } = o, c = Y.get(e);
|
|
@@ -422,7 +425,7 @@ async function gt(t, r, s) {
|
|
|
422
425
|
let u = !1, f = !1;
|
|
423
426
|
n != null && await new Promise((g) => {
|
|
424
427
|
const y = setInterval(() => {
|
|
425
|
-
c.isRunning ? Date.now() - l >= n * 1e3 && (clearInterval(y), u = !0, i && c.pid && (
|
|
428
|
+
c.isRunning ? Date.now() - l >= n * 1e3 && (clearInterval(y), u = !0, i && c.pid && (mt(c.pid), f = !0), g()) : (clearInterval(y), g());
|
|
426
429
|
}, 100);
|
|
427
430
|
});
|
|
428
431
|
const d = (Date.now() - l) / 1e3;
|
|
@@ -433,16 +436,16 @@ async function gt(t, r, s) {
|
|
|
433
436
|
autoKillExecuted: f
|
|
434
437
|
};
|
|
435
438
|
}
|
|
436
|
-
function
|
|
439
|
+
function Lr(t, r) {
|
|
437
440
|
t(
|
|
438
441
|
"process-wait",
|
|
439
442
|
{
|
|
440
443
|
title: "Wait for Host Machine Process",
|
|
441
444
|
description: "Wait for a host machine process to complete execution, with optional timeout and auto-kill functionality. Use this for long-running commands like builds, installs, or tests when you need final results",
|
|
442
|
-
inputSchema:
|
|
445
|
+
inputSchema: gt.shape
|
|
443
446
|
},
|
|
444
447
|
async (s, o) => {
|
|
445
|
-
const e = await
|
|
448
|
+
const e = await wt(s, r, o);
|
|
446
449
|
if (!("output" in e))
|
|
447
450
|
return `Method: process-wait(${JSON.stringify(s)})
|
|
448
451
|
❌ Error: ${e.error}`;
|
|
@@ -468,31 +471,31 @@ function be(t, r) {
|
|
|
468
471
|
error: `Path "${r}" escapes root directory "${t}". Resolved path: "${o}"`
|
|
469
472
|
} : { path: o };
|
|
470
473
|
}
|
|
471
|
-
const
|
|
472
|
-
relativeRootDir:
|
|
474
|
+
const yt = m.object({
|
|
475
|
+
relativeRootDir: m.string().optional().describe(
|
|
473
476
|
'Relative path from project root to working directory for command execution. Use forward slashes. Leave empty for project root. Examples: "src", "src/tools", "tests/unit". Directory must exist'
|
|
474
477
|
),
|
|
475
|
-
commandLine:
|
|
478
|
+
commandLine: m.string().describe(
|
|
476
479
|
'Complete command line to execute on the host machine. Include all arguments and options. Examples: "npm install", "pnpm build", "node script.js --verbose", "git status". Command must be in the allowed commands list for security'
|
|
477
480
|
),
|
|
478
|
-
waitTime:
|
|
481
|
+
waitTime: m.number().optional().describe(
|
|
479
482
|
"Time to wait in seconds for process completion before returning results. If specified, will wait this long then return final status. If omitted, returns immediately with initial status. Use process-wait or process-status to check progress later. Examples: 30 (wait 30 seconds), 120 (wait 2 minutes)"
|
|
480
483
|
),
|
|
481
|
-
autoKill:
|
|
484
|
+
autoKill: m.boolean().default(!1).describe(
|
|
482
485
|
"Automatically kill the process if waitTime expires and it is still running. Only applies when waitTime is specified. Default: false (let process continue running). Set to true for commands that should not run indefinitely"
|
|
483
486
|
),
|
|
484
|
-
outputLimit:
|
|
487
|
+
outputLimit: m.number().int().min(0).max(J).default(Q).describe(
|
|
485
488
|
`Maximum output characters to return. Truncated output can be retrieved via output-read tool using outputId from truncation message. Maximum: ${J}. Default: ${Q}`
|
|
486
489
|
)
|
|
487
490
|
});
|
|
488
|
-
async function
|
|
491
|
+
async function Ar(t, r, s) {
|
|
489
492
|
ge();
|
|
490
493
|
let o;
|
|
491
494
|
try {
|
|
492
|
-
o =
|
|
493
|
-
} catch (
|
|
495
|
+
o = yt.parse(t);
|
|
496
|
+
} catch (h) {
|
|
494
497
|
return {
|
|
495
|
-
error: F(
|
|
498
|
+
error: F(h)
|
|
496
499
|
};
|
|
497
500
|
}
|
|
498
501
|
const { commandLine: e, waitTime: n, autoKill: i, outputLimit: a } = o, { commandLineRules: c } = r, l = be(
|
|
@@ -502,20 +505,20 @@ async function Br(t, r, s) {
|
|
|
502
505
|
if ("error" in l)
|
|
503
506
|
return { error: l.error };
|
|
504
507
|
const u = l.path;
|
|
505
|
-
if (!
|
|
506
|
-
const
|
|
508
|
+
if (!Ir({ commandLine: e, commandLineRules: c })) {
|
|
509
|
+
const h = c.map(
|
|
507
510
|
(g) => `${g.rule.toUpperCase()}: /${g.regexp}/ (${g.note})`
|
|
508
511
|
).join(`
|
|
509
512
|
`);
|
|
510
513
|
return {
|
|
511
514
|
error: `Command line not allowed: "${e}". For security, command lines are validated against configured rules in order. Command line was denied by the rule evaluation. Current command line rules:
|
|
512
|
-
${
|
|
515
|
+
${h}
|
|
513
516
|
|
|
514
517
|
To use this command line, ask the user to modify the command line rules in the configuration.`
|
|
515
518
|
};
|
|
516
519
|
}
|
|
517
520
|
if (Array.from(Y.values()).filter(
|
|
518
|
-
(
|
|
521
|
+
(h) => h.isRunning
|
|
519
522
|
).length >= ke)
|
|
520
523
|
return {
|
|
521
524
|
error: `Maximum concurrent process limit reached (${ke} processes). Cannot start new process until existing processes complete. Use process-list to see active processes, or process-kill to terminate unnecessary processes.`
|
|
@@ -530,15 +533,15 @@ To use this command line, ask the user to modify the command line rules in the c
|
|
|
530
533
|
};
|
|
531
534
|
Y.set(d, p);
|
|
532
535
|
try {
|
|
533
|
-
const
|
|
536
|
+
const h = Cr(
|
|
534
537
|
process.cwd(),
|
|
535
538
|
u,
|
|
536
539
|
r.envCleanup ?? "deleteServerPaths",
|
|
537
540
|
r.env
|
|
538
|
-
), g =
|
|
541
|
+
), g = tr(e, [], {
|
|
539
542
|
shell: !0,
|
|
540
543
|
cwd: u,
|
|
541
|
-
env:
|
|
544
|
+
env: h,
|
|
542
545
|
stdio: ["pipe", "pipe", "pipe"]
|
|
543
546
|
});
|
|
544
547
|
p.pid = g.pid;
|
|
@@ -550,16 +553,16 @@ To use this command line, ask the user to modify the command line rules in the c
|
|
|
550
553
|
p.isRunning = !1, p.endTime = /* @__PURE__ */ new Date(), p.exitCode = w !== null ? w : void 0, console.log(`Process ${d} (${e}) exited with code ${w}`);
|
|
551
554
|
}), g.on("error", (w) => {
|
|
552
555
|
p.isRunning = !1, p.endTime = /* @__PURE__ */ new Date(), p.error = w.message, console.error(`Process ${d} error:`, w.message);
|
|
553
|
-
}), n != null ?
|
|
556
|
+
}), n != null ? wt(
|
|
554
557
|
{ id: d, waitTime: n, autoKill: i, outputLimit: a },
|
|
555
558
|
r,
|
|
556
559
|
s
|
|
557
560
|
) : ye({ id: d, outputLimit: a }, r, s);
|
|
558
|
-
} catch (
|
|
559
|
-
return p.isRunning = !1, p.endTime = /* @__PURE__ */ new Date(), p.error =
|
|
561
|
+
} catch (h) {
|
|
562
|
+
return p.isRunning = !1, p.endTime = /* @__PURE__ */ new Date(), p.error = h instanceof Error ? h.message : "Unknown error", { error: p.error };
|
|
560
563
|
}
|
|
561
564
|
}
|
|
562
|
-
function
|
|
565
|
+
function zr(t, r) {
|
|
563
566
|
const s = r.commandLineRules.map((o) => `${o.rule.toUpperCase()}: ${o.regexp} (${o.note})`).join(`
|
|
564
567
|
`);
|
|
565
568
|
t(
|
|
@@ -568,10 +571,10 @@ function Lr(t, r) {
|
|
|
568
571
|
title: "Execute Command Line on Host Machine",
|
|
569
572
|
description: `Execute command lines on the host machine. Use this to build, test, lint, install packages, or run system commands. Prefer process-run with waitTime parameter if you need to immediately execute and wait for completion, instead of separate process-run and process-wait calls. Security: Command lines are validated against configured rules processed in order (later rules override earlier ones). Current command line rules:
|
|
570
573
|
${s}`,
|
|
571
|
-
inputSchema:
|
|
574
|
+
inputSchema: yt.shape
|
|
572
575
|
},
|
|
573
576
|
async (o, e) => {
|
|
574
|
-
const n = await
|
|
577
|
+
const n = await Ar(o, r, e);
|
|
575
578
|
if (!("output" in n))
|
|
576
579
|
return `Method: process-run(${JSON.stringify(o)})
|
|
577
580
|
❌ Error: ${n.error}`;
|
|
@@ -584,25 +587,25 @@ ${i.trim()}`;
|
|
|
584
587
|
}
|
|
585
588
|
);
|
|
586
589
|
}
|
|
587
|
-
const
|
|
588
|
-
minOpenDateTime:
|
|
590
|
+
const bt = m.object({
|
|
591
|
+
minOpenDateTime: m.string().optional().describe(
|
|
589
592
|
'Filter to processes started after this datetime. Accepts ISO format or space-separated format. Examples: "2024-01-15T10:30:00Z", "2024-01-15 10:30:00". Underscores and spaces are converted to standard ISO format internally'
|
|
590
593
|
),
|
|
591
|
-
minCloseDateTime:
|
|
594
|
+
minCloseDateTime: m.string().optional().describe(
|
|
592
595
|
'Filter to processes that finished after this datetime. Only applies to completed processes. Accepts ISO format or space-separated format. Examples: "2024-01-15T14:30:00Z", "2024-01-15 14:30:00". Useful for finding recently completed processes'
|
|
593
596
|
),
|
|
594
|
-
activeOnly:
|
|
597
|
+
activeOnly: m.boolean().default(!1).describe(
|
|
595
598
|
"Show only currently running processes. Set to true to exclude completed processes, false to show all processes (running and completed). Default: false (show all)"
|
|
596
599
|
),
|
|
597
|
-
fields:
|
|
600
|
+
fields: m.array(m.string()).optional().describe(
|
|
598
601
|
'Specific process data fields to include in the response. If omitted, returns all available fields. Fields id, isRunning, and commandLine are always included. Available fields: id, cwd, commandLine, pid, startTime, endTime, exitCode, isRunning, output, error. Examples: ["id", "commandLine", "isRunning"] for minimal info, ["id", "output", "exitCode"] for execution results'
|
|
599
602
|
)
|
|
600
603
|
});
|
|
601
|
-
async function
|
|
604
|
+
async function Ur(t, r) {
|
|
602
605
|
ge();
|
|
603
606
|
let s;
|
|
604
607
|
try {
|
|
605
|
-
s =
|
|
608
|
+
s = bt.parse(t);
|
|
606
609
|
} catch (l) {
|
|
607
610
|
return {
|
|
608
611
|
error: F(l)
|
|
@@ -641,16 +644,16 @@ async function Ar(t, r) {
|
|
|
641
644
|
return u;
|
|
642
645
|
}) };
|
|
643
646
|
}
|
|
644
|
-
function
|
|
647
|
+
function jr(t, r) {
|
|
645
648
|
t(
|
|
646
649
|
"process-list",
|
|
647
650
|
{
|
|
648
651
|
title: "List Host Machine Processes",
|
|
649
652
|
description: "List all processes that have been executed on the host machine. Use this to see running processes, check command history, or find process IDs for status/wait operations",
|
|
650
|
-
inputSchema:
|
|
653
|
+
inputSchema: bt.shape
|
|
651
654
|
},
|
|
652
655
|
async (s) => {
|
|
653
|
-
const o = await
|
|
656
|
+
const o = await Ur(s, r);
|
|
654
657
|
if (o.error != null)
|
|
655
658
|
return `Method: process-list(${JSON.stringify(s)})
|
|
656
659
|
❌ Error: ${o.error}`;
|
|
@@ -664,15 +667,15 @@ ${e}`;
|
|
|
664
667
|
}
|
|
665
668
|
);
|
|
666
669
|
}
|
|
667
|
-
const
|
|
668
|
-
id:
|
|
670
|
+
const St = m.object({
|
|
671
|
+
id: m.number().describe(
|
|
669
672
|
"Process ID of the process to terminate. Get process IDs using process-list. The process must be currently running. Examples: 1, 42, 123"
|
|
670
673
|
)
|
|
671
674
|
});
|
|
672
|
-
function
|
|
675
|
+
function qr(t) {
|
|
673
676
|
let r;
|
|
674
677
|
try {
|
|
675
|
-
r =
|
|
678
|
+
r = St.parse(t);
|
|
676
679
|
} catch (e) {
|
|
677
680
|
return {
|
|
678
681
|
error: F(e)
|
|
@@ -692,31 +695,31 @@ function Ur(t) {
|
|
|
692
695
|
error: `Process ${s} has no system process ID (PID). This indicates the process failed to start properly or the system was unable to assign a PID. Check process-status for error details.`
|
|
693
696
|
};
|
|
694
697
|
try {
|
|
695
|
-
return
|
|
698
|
+
return mt(o.pid), { success: !0, message: `Kill signal sent to process ${s}` };
|
|
696
699
|
} catch (e) {
|
|
697
700
|
return {
|
|
698
701
|
error: `Failed to terminate process ${s}: ${e instanceof Error ? e.message : "Unknown error"}. The process may have already exited, be protected by the system, or there may be insufficient permissions. Use process-status to check current process state.`
|
|
699
702
|
};
|
|
700
703
|
}
|
|
701
704
|
}
|
|
702
|
-
function
|
|
705
|
+
function _r(t, r) {
|
|
703
706
|
t(
|
|
704
707
|
"process-kill",
|
|
705
708
|
{
|
|
706
709
|
title: "Kill Host Machine Process",
|
|
707
710
|
description: "Forcibly terminate a running process on the host machine. Use this to stop runaway processes, hung commands, or long-running tasks that need to be cancelled",
|
|
708
|
-
inputSchema:
|
|
711
|
+
inputSchema: St.shape
|
|
709
712
|
},
|
|
710
713
|
async (s) => {
|
|
711
|
-
const o =
|
|
714
|
+
const o = qr(s);
|
|
712
715
|
return o.error != null ? `Method: process-kill(${JSON.stringify(s)})
|
|
713
716
|
❌ Error: ${o.error}` : `Method: process-kill(${JSON.stringify(s)})
|
|
714
717
|
${JSON.stringify(o, null, 2)}`;
|
|
715
718
|
}
|
|
716
719
|
);
|
|
717
720
|
}
|
|
718
|
-
function
|
|
719
|
-
|
|
721
|
+
function Gr(t, r) {
|
|
722
|
+
Mr(), r.run && zr(t, r), r.status && Br(t, r), r.wait && Lr(t, r), r.list && jr(t, r), r.kill && _r(t);
|
|
720
723
|
const s = r.commandLineRules?.map(
|
|
721
724
|
(o) => `${o.rule.toUpperCase()}: ${o.regexp} (${o.note})`
|
|
722
725
|
) || [];
|
|
@@ -729,7 +732,7 @@ ${s.map((o) => `- ${o}`).join(`
|
|
|
729
732
|
`
|
|
730
733
|
);
|
|
731
734
|
}
|
|
732
|
-
function
|
|
735
|
+
function Jr(t, r) {
|
|
733
736
|
return function(o, e, n) {
|
|
734
737
|
const i = async (...a) => {
|
|
735
738
|
await ie({
|
|
@@ -758,26 +761,26 @@ function _r(t, r) {
|
|
|
758
761
|
);
|
|
759
762
|
};
|
|
760
763
|
}
|
|
761
|
-
function
|
|
764
|
+
function Wr(t) {
|
|
762
765
|
return t.match(/^[/\\]?[^/\\]+/)[0];
|
|
763
766
|
}
|
|
764
|
-
function
|
|
765
|
-
return
|
|
767
|
+
function Kr(t, r) {
|
|
768
|
+
return Wr(t) + "|" + r.ino;
|
|
766
769
|
}
|
|
767
|
-
function
|
|
770
|
+
function Hr(t) {
|
|
768
771
|
return t.endsWith(":") && (t += "/"), k.resolve(t);
|
|
769
772
|
}
|
|
770
|
-
const Se = new
|
|
773
|
+
const Se = new rr(ir.cpus().length);
|
|
771
774
|
function Be(t, r) {
|
|
772
775
|
t.totalSize += r.totalSize, t.maxFileDateModified = Math.max(
|
|
773
776
|
t.maxFileDateModified,
|
|
774
777
|
r.maxFileDateModified
|
|
775
778
|
), t.countFiles += r.countFiles, t.countDirs += r.countDirs, t.countLinks += r.countLinks;
|
|
776
779
|
}
|
|
777
|
-
const
|
|
780
|
+
const Qr = function(r) {
|
|
778
781
|
return r.code === "ENOENT";
|
|
779
782
|
};
|
|
780
|
-
function
|
|
783
|
+
function xt(t) {
|
|
781
784
|
const r = t.paths;
|
|
782
785
|
if (!r || r.length === 0)
|
|
783
786
|
return Promise.resolve({
|
|
@@ -788,35 +791,35 @@ function St(t) {
|
|
|
788
791
|
countLinks: 0
|
|
789
792
|
});
|
|
790
793
|
const s = t.level ?? 0, o = t.walkedIds ?? /* @__PURE__ */ new Set(), e = t.abortSignal, n = t.pool ?? Se, i = t.handleError, a = t.priority ?? X(0), c = t.walkLinks ?? !1, l = t.log, u = t.handlePath, f = t.matchPath;
|
|
791
|
-
async function d(
|
|
792
|
-
if (!(i && await i(
|
|
793
|
-
throw
|
|
794
|
+
async function d(h) {
|
|
795
|
+
if (!(i && await i(h)) && !Qr(h))
|
|
796
|
+
throw h;
|
|
794
797
|
}
|
|
795
|
-
function p(
|
|
796
|
-
return !(!l || l.minTotalContentSize != null &&
|
|
798
|
+
function p(h) {
|
|
799
|
+
return !(!l || l.minTotalContentSize != null && h < l.minTotalContentSize || l.maxNestedLevel != null && s > l.maxNestedLevel);
|
|
797
800
|
}
|
|
798
|
-
return
|
|
799
|
-
const g =
|
|
801
|
+
return sr(async (h) => {
|
|
802
|
+
const g = or(e, h), y = {
|
|
800
803
|
totalSize: 0,
|
|
801
804
|
maxFileDateModified: 0,
|
|
802
805
|
countFiles: 0,
|
|
803
806
|
countDirs: 0,
|
|
804
807
|
countLinks: 0
|
|
805
808
|
};
|
|
806
|
-
function w(
|
|
809
|
+
function w(I, T) {
|
|
807
810
|
if (p(T.totalSize)) {
|
|
808
|
-
const S = `${T.totalSize.toLocaleString("en-US").replace(/,/g, " ").padStart(19)}: ${
|
|
811
|
+
const S = `${T.totalSize.toLocaleString("en-US").replace(/,/g, " ").padStart(19)}: ${I}`;
|
|
809
812
|
l?.handleLog ? l.handleLog(S) : console.log(S);
|
|
810
813
|
}
|
|
811
814
|
}
|
|
812
|
-
async function M(
|
|
815
|
+
async function M(I, T, x, S) {
|
|
813
816
|
return u ? await V({
|
|
814
817
|
pool: n,
|
|
815
818
|
func: async () => {
|
|
816
819
|
try {
|
|
817
820
|
return await u({
|
|
818
821
|
level: s,
|
|
819
|
-
path:
|
|
822
|
+
path: I,
|
|
820
823
|
stat: T,
|
|
821
824
|
itemStat: x,
|
|
822
825
|
totalStat: y,
|
|
@@ -831,18 +834,18 @@ function St(t) {
|
|
|
831
834
|
abortSignal: g
|
|
832
835
|
}) : !0;
|
|
833
836
|
}
|
|
834
|
-
async function E(
|
|
835
|
-
S || (S =
|
|
837
|
+
async function E(I, T, x, S) {
|
|
838
|
+
S || (S = I);
|
|
836
839
|
const v = await V({
|
|
837
840
|
pool: n,
|
|
838
|
-
func: () => j.promises.lstat(
|
|
841
|
+
func: () => j.promises.lstat(I).catch(d),
|
|
839
842
|
count: 1,
|
|
840
843
|
priority: X(T, X(1, a)),
|
|
841
844
|
abortSignal: g
|
|
842
845
|
});
|
|
843
846
|
if (!v || !x && v.isFile())
|
|
844
847
|
return null;
|
|
845
|
-
const P =
|
|
848
|
+
const P = Kr(I, v);
|
|
846
849
|
if (o.has(P))
|
|
847
850
|
return null;
|
|
848
851
|
o.add(P);
|
|
@@ -853,7 +856,7 @@ function St(t) {
|
|
|
853
856
|
countDirs: 0,
|
|
854
857
|
countLinks: 0
|
|
855
858
|
};
|
|
856
|
-
const
|
|
859
|
+
const $ = X(
|
|
857
860
|
T,
|
|
858
861
|
X(v.isDirectory() ? 2 : 3, a)
|
|
859
862
|
);
|
|
@@ -861,9 +864,9 @@ function St(t) {
|
|
|
861
864
|
if (c) {
|
|
862
865
|
const C = await V({
|
|
863
866
|
pool: n,
|
|
864
|
-
func: () => j.promises.readlink(
|
|
867
|
+
func: () => j.promises.readlink(I).catch(d).then((N) => N ?? null),
|
|
865
868
|
count: 1,
|
|
866
|
-
priority:
|
|
869
|
+
priority: $,
|
|
867
870
|
abortSignal: g
|
|
868
871
|
});
|
|
869
872
|
if (C) {
|
|
@@ -880,12 +883,12 @@ function St(t) {
|
|
|
880
883
|
S,
|
|
881
884
|
v,
|
|
882
885
|
O,
|
|
883
|
-
|
|
886
|
+
$
|
|
884
887
|
) && (Be(y, O), w(S, O))), O;
|
|
885
888
|
} else if (v.isDirectory()) {
|
|
886
889
|
const C = await V({
|
|
887
890
|
pool: n,
|
|
888
|
-
func: () => j.promises.readdir(
|
|
891
|
+
func: () => j.promises.readdir(I).catch(d),
|
|
889
892
|
count: 1,
|
|
890
893
|
priority: a,
|
|
891
894
|
abortSignal: g
|
|
@@ -893,11 +896,11 @@ function St(t) {
|
|
|
893
896
|
if (C) {
|
|
894
897
|
for (let N = 0, R = C.length; N < R; N++)
|
|
895
898
|
C[N] = k.join(S, C[N]);
|
|
896
|
-
O = await
|
|
899
|
+
O = await xt({
|
|
897
900
|
...t,
|
|
898
901
|
paths: C,
|
|
899
902
|
abortSignal: g,
|
|
900
|
-
priority:
|
|
903
|
+
priority: $,
|
|
901
904
|
level: s + 1,
|
|
902
905
|
walkedIds: o
|
|
903
906
|
});
|
|
@@ -907,21 +910,21 @@ function St(t) {
|
|
|
907
910
|
S,
|
|
908
911
|
v,
|
|
909
912
|
O,
|
|
910
|
-
|
|
913
|
+
$
|
|
911
914
|
) && (Be(y, O), w(S, O))), O;
|
|
912
915
|
}
|
|
913
916
|
const b = [];
|
|
914
|
-
for (let
|
|
915
|
-
const x =
|
|
916
|
-
S !== !1 && b.push(E(x,
|
|
917
|
+
for (let I = 0, T = r.length; I < T; I++) {
|
|
918
|
+
const x = Hr(r[I]), S = f ? f(x) : !0;
|
|
919
|
+
S !== !1 && b.push(E(x, I, S));
|
|
917
920
|
}
|
|
918
921
|
return await Promise.all(b), y;
|
|
919
922
|
});
|
|
920
923
|
}
|
|
921
|
-
function
|
|
922
|
-
return
|
|
924
|
+
function It(t) {
|
|
925
|
+
return xt(t);
|
|
923
926
|
}
|
|
924
|
-
function
|
|
927
|
+
function Yr(t, r) {
|
|
925
928
|
if (!r || r === ".")
|
|
926
929
|
return t;
|
|
927
930
|
const s = t.startsWith("^");
|
|
@@ -929,14 +932,14 @@ function Hr(t, r) {
|
|
|
929
932
|
const o = t.startsWith("!");
|
|
930
933
|
return o && (t = t.substring(1)), t.startsWith("/") ? (r.endsWith("/") && (r = r.substring(0, r.length - 1)), t = r + t) : (r.endsWith("/") || (r += "/"), t.startsWith("./") ? t = r + t.substring(2) : t.startsWith("../") ? t = r + t : (r.startsWith("..") && (r = ""), t.startsWith("**") ? t = r + t : t = r + "**/" + t)), t = H(k.normalize(t)), o && (t = "!" + t), s && (t = "^" + t), t;
|
|
931
934
|
}
|
|
932
|
-
function
|
|
935
|
+
function Vr(t) {
|
|
933
936
|
const r = t.startsWith("!");
|
|
934
937
|
return r && (t = t.substring(1)), t.startsWith("/") ? t = t.substring(1) : !t.startsWith("**") && !t.startsWith("../") && (t = `**/${t}`), r && (t = "!" + t), t;
|
|
935
938
|
}
|
|
936
939
|
function Le(t) {
|
|
937
940
|
return "^" + t;
|
|
938
941
|
}
|
|
939
|
-
async function
|
|
942
|
+
async function Zr(t) {
|
|
940
943
|
const s = (await j.promises.readFile(t, "utf-8")).split(`
|
|
941
944
|
`), o = [];
|
|
942
945
|
return s.forEach((e) => {
|
|
@@ -956,16 +959,16 @@ async function $t(t) {
|
|
|
956
959
|
pool: Se,
|
|
957
960
|
count: 1,
|
|
958
961
|
func: async () => {
|
|
959
|
-
const n = k.resolve(r, e.value), i = await
|
|
962
|
+
const n = k.resolve(r, e.value), i = await Zr(n), a = k.relative(r, k.dirname(n));
|
|
960
963
|
i.forEach((c) => {
|
|
961
|
-
c =
|
|
964
|
+
c = Vr(c), c = Yr(c, a), s.push(e.exclude ? Le(c) : c);
|
|
962
965
|
});
|
|
963
966
|
}
|
|
964
967
|
});
|
|
965
968
|
})
|
|
966
969
|
), s;
|
|
967
970
|
}
|
|
968
|
-
function
|
|
971
|
+
function Mt({
|
|
969
972
|
globs: t,
|
|
970
973
|
rootDir: r,
|
|
971
974
|
noCase: s
|
|
@@ -986,7 +989,7 @@ function It({
|
|
|
986
989
|
return;
|
|
987
990
|
let c;
|
|
988
991
|
try {
|
|
989
|
-
c =
|
|
992
|
+
c = ar(a, {
|
|
990
993
|
nocase: s ?? !1,
|
|
991
994
|
dot: !0,
|
|
992
995
|
strictBrackets: !0
|
|
@@ -1013,17 +1016,17 @@ function It({
|
|
|
1013
1016
|
return a ? !1 : i;
|
|
1014
1017
|
};
|
|
1015
1018
|
}
|
|
1016
|
-
async function
|
|
1019
|
+
async function Xr(t) {
|
|
1017
1020
|
const r = t.rootDir ?? ".", s = [], o = {};
|
|
1018
1021
|
t.result.countFiles && (o.countFiles = 0), t.result.size && (o.size = 0);
|
|
1019
1022
|
const e = await $t({
|
|
1020
1023
|
rootDir: r,
|
|
1021
1024
|
globs: t.globs
|
|
1022
1025
|
});
|
|
1023
|
-
return await
|
|
1026
|
+
return await It({
|
|
1024
1027
|
paths: [r],
|
|
1025
1028
|
walkLinks: !0,
|
|
1026
|
-
matchPath:
|
|
1029
|
+
matchPath: Mt({
|
|
1027
1030
|
globs: e,
|
|
1028
1031
|
rootDir: r,
|
|
1029
1032
|
noCase: !0
|
|
@@ -1032,21 +1035,21 @@ async function Vr(t) {
|
|
|
1032
1035
|
const c = k.relative(r, n), l = i.isDirectory(), u = i.isFile();
|
|
1033
1036
|
if (!l && !u)
|
|
1034
1037
|
return !0;
|
|
1035
|
-
const f = H(c || "."), d = l ? "dir" : "file", p = l ? a.maxFileDateModified || null : i.mtimeMs,
|
|
1038
|
+
const f = H(c || "."), d = l ? "dir" : "file", p = l ? a.maxFileDateModified || null : i.mtimeMs, h = l ? a.totalSize : i.size, g = l ? a.countFiles : null, y = {
|
|
1036
1039
|
path: f,
|
|
1037
1040
|
type: d
|
|
1038
1041
|
};
|
|
1039
|
-
if (t.result.dateModified && (y.dateModified = p), t.result.size && (y.size =
|
|
1042
|
+
if (t.result.dateModified && (y.dateModified = p), t.result.size && (y.size = h), t.result.countFiles && (y.countFiles = g), t.dateModified && p != null) {
|
|
1040
1043
|
const [w, M] = t.dateModified;
|
|
1041
1044
|
if (w != null && p < w || M != null && p > M)
|
|
1042
1045
|
return !1;
|
|
1043
1046
|
}
|
|
1044
|
-
if (t.totalSize &&
|
|
1047
|
+
if (t.totalSize && h != null) {
|
|
1045
1048
|
const [w, M] = t.totalSize;
|
|
1046
|
-
if (w != null &&
|
|
1049
|
+
if (w != null && h < w || M != null && h > M)
|
|
1047
1050
|
return !1;
|
|
1048
1051
|
}
|
|
1049
|
-
return d === "file" && (o.countFiles = (o.countFiles ?? 0) + 1), d === "file" &&
|
|
1052
|
+
return d === "file" && (o.countFiles = (o.countFiles ?? 0) + 1), d === "file" && h != null && (o.size = (o.size ?? 0) + h), p != null && (o.dateModified == null || p > o.dateModified) && (o.dateModified = p), l && !t.result.dirs || u && !t.result.files || s.push(y), !0;
|
|
1050
1053
|
}
|
|
1051
1054
|
}), { items: s, totals: o };
|
|
1052
1055
|
}
|
|
@@ -1064,7 +1067,7 @@ function je(t) {
|
|
|
1064
1067
|
const o = Math.floor(s / 1e3), e = Math.floor(o / 60), n = Math.floor(e / 60), i = Math.floor(n / 24), a = Math.floor(i / 7), c = Math.floor(i / 30), l = Math.floor(i / 365);
|
|
1065
1068
|
return l > 0 ? `${l}Y` : c > 0 ? `${c}M` : a > 0 ? `${a}w` : i > 0 ? `${i}d` : n > 0 ? `${n}h` : e > 0 ? `${e}m` : `${o}s`;
|
|
1066
1069
|
}
|
|
1067
|
-
function
|
|
1070
|
+
function es(t, r) {
|
|
1068
1071
|
return r?.length ? [...t].sort((s, o) => {
|
|
1069
1072
|
for (let e = 0, n = r.length; e < n; e++) {
|
|
1070
1073
|
const i = r[e];
|
|
@@ -1100,8 +1103,8 @@ function Zr(t, r) {
|
|
|
1100
1103
|
return 0;
|
|
1101
1104
|
}) : t;
|
|
1102
1105
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const s =
|
|
1106
|
+
function ts(t, r) {
|
|
1107
|
+
const s = es(t.items, r.sort ?? []), o = r.fields && r.fields.length > 0 ? r.fields : [];
|
|
1105
1108
|
let e = "";
|
|
1106
1109
|
if (s.length > 0 && o.length > 0) {
|
|
1107
1110
|
for (let n = 0, i = o.length; n < i; n++) {
|
|
@@ -1159,9 +1162,9 @@ function Xr(t, r) {
|
|
|
1159
1162
|
}
|
|
1160
1163
|
return e;
|
|
1161
1164
|
}
|
|
1162
|
-
const
|
|
1163
|
-
version:
|
|
1164
|
-
},
|
|
1165
|
+
const rs = "5.0.1", ss = {
|
|
1166
|
+
version: rs
|
|
1167
|
+
}, Wo = "Project Tools", Ko = "project-tools", Ho = ss.version, Qo = "d00f70240703039df14c76176a055bce6b5484d2b552ba2c89820f03b8e5e60d", qe = 25e3;
|
|
1165
1168
|
function _e(t) {
|
|
1166
1169
|
const r = t.match(
|
|
1167
1170
|
/^\s*(\d+(?:\.\d+)?)\s*([smhdwMY]|sec(onds?)?|min(utes?)?|hours?|days?|weeks?|months?|years?)\s*$/i
|
|
@@ -1217,49 +1220,49 @@ function Ge(t) {
|
|
|
1217
1220
|
);
|
|
1218
1221
|
}
|
|
1219
1222
|
}
|
|
1220
|
-
const
|
|
1221
|
-
relativeRootDir:
|
|
1223
|
+
const Tt = m.object({
|
|
1224
|
+
relativeRootDir: m.string().optional().describe(
|
|
1222
1225
|
'Relative path from project root to directory for listing. Use forward slashes. Leave empty for project root. Examples: "src", "src/components", "tests". Path must exist'
|
|
1223
1226
|
),
|
|
1224
|
-
globs:
|
|
1227
|
+
globs: m.array(m.string()).optional().describe(
|
|
1225
1228
|
'Glob patterns to filter which files/directories to include. Add leading ** to match files and dirs in subdirectories. Examples: ["**/*.js"] (JavaScript files), ["src/**/*.ts"] (TypeScript files in src), ["**/dir/"] (all directories named "dir"), ["!node_modules"] (exclude {rootDir}/node_modules). If omitted, includes all files matching other criteria. Supports standard glob syntax: * (any chars), ** (any dirs), ? (single char), [abc] (char class)'
|
|
1226
1229
|
),
|
|
1227
|
-
showFiles:
|
|
1230
|
+
showFiles: m.boolean().optional().describe(
|
|
1228
1231
|
"Whether to show regular files in the report table. Set to true to show files, false to hide them from the table. When both showFiles and showDirs are false, nothing will be shown in the table. It Does not affect totals. Default is false (do not show files in the table)"
|
|
1229
1232
|
),
|
|
1230
|
-
showDirs:
|
|
1233
|
+
showDirs: m.boolean().optional().describe(
|
|
1231
1234
|
"Whether to show directories in the report table. Set to true to show directories, false to hide them from the table. When both showFiles and showDirs are false, nothing will be shown in the table. It Does not affect totals. Default is true (show directories in the table)"
|
|
1232
1235
|
),
|
|
1233
|
-
sortBy:
|
|
1234
|
-
|
|
1235
|
-
field:
|
|
1236
|
+
sortBy: m.array(
|
|
1237
|
+
m.object({
|
|
1238
|
+
field: m.enum(["type", "path", "lastModified", "size", "totalCountFiles"]).describe(
|
|
1236
1239
|
'Field to sort results by. "type" sorts files before directories. "path" sorts alphabetically by file/directory name. "lastModified" sorts by modification time (newest first when desc=true). "size" sorts by file/directory size (largest first when desc=true). "totalCountFiles" sorts by total files count (highest first when desc=true, directories only)'
|
|
1237
1240
|
),
|
|
1238
|
-
desc:
|
|
1241
|
+
desc: m.boolean().optional().describe("Sort in descending order (largest/newest first)")
|
|
1239
1242
|
})
|
|
1240
1243
|
).optional().describe(
|
|
1241
1244
|
'Multi-level sorting configuration. Sorts are applied in array order - first sort is primary, second is secondary, etc. Example: [{field: "type", desc: false}, {field: "size", desc: true}] sorts by type ascending, then by size descending within each type'
|
|
1242
1245
|
),
|
|
1243
|
-
fields:
|
|
1246
|
+
fields: m.array(m.enum(["type", "path", "lastModified", "size", "totalCountFiles"])).optional().describe(
|
|
1244
1247
|
'Which data fields to include in the formatted table output. "type" shows file/directory indicator. "path" shows relative file/directory path. "lastModified" shows last modification time as time-ago format (5m, 2h, 3d, etc). "size" shows file/directory size in human-readable format (KB, MB, GB). "totalCountFiles" shows total files count for directories (displays "-" for files). Adding lastModified, size, or totalCountFiles fields increases processing time. Do not set fields if you want to show only totals summary'
|
|
1245
1248
|
),
|
|
1246
|
-
minTimeAgo:
|
|
1249
|
+
minTimeAgo: m.string().optional().describe(
|
|
1247
1250
|
'Filter files/directories modified at least this long ago. Only items older than this duration will be included. Format: number + unit (s/m/h/d/w/M/Y). Examples: "1h" (modified more than 1 hour ago), "7d" (modified more than 7 days ago), "6M" (modified more than 6 months ago)'
|
|
1248
1251
|
),
|
|
1249
|
-
maxTimeAgo:
|
|
1252
|
+
maxTimeAgo: m.string().optional().describe(
|
|
1250
1253
|
'Filter files/directories modified at most this long ago. Only items newer than this duration will be included. Format: number + unit (s/m/h/d/w/M/Y). Examples: "1h" (modified within last hour), "7d" (modified within last 7 days), "1M" (modified within last month). Combine with minTimeAgo for date ranges'
|
|
1251
1254
|
),
|
|
1252
|
-
minTotalSize:
|
|
1255
|
+
minTotalSize: m.string().optional().describe(
|
|
1253
1256
|
'Filter files/directories with total size at least this large. Only items with size >= this value will be included. For directories, uses total size of all contents. Format: number + unit (B/KB/MB/GB/TB). Examples: "1KB" (at least 1 kilobyte), "100MB" (at least 100 megabytes), "1.5GB" (at least 1.5 gigabytes)'
|
|
1254
1257
|
),
|
|
1255
|
-
maxTotalSize:
|
|
1258
|
+
maxTotalSize: m.string().optional().describe(
|
|
1256
1259
|
'Filter files/directories with total size at most this large. Only items with size <= this value will be included. For directories, uses total size of all contents. Format: number + unit (B/KB/MB/GB/TB). Examples: "1MB" (up to 1 megabyte), "500KB" (up to 500 kilobytes), "10GB" (up to 10 gigabytes). Combine with minTotalSize for size ranges'
|
|
1257
1260
|
)
|
|
1258
1261
|
});
|
|
1259
|
-
async function
|
|
1262
|
+
async function os(t, r) {
|
|
1260
1263
|
let s;
|
|
1261
1264
|
try {
|
|
1262
|
-
s =
|
|
1265
|
+
s = Tt.parse(t);
|
|
1263
1266
|
} catch (y) {
|
|
1264
1267
|
return {
|
|
1265
1268
|
error: F(y)
|
|
@@ -1289,13 +1292,13 @@ async function rs(t, r) {
|
|
|
1289
1292
|
};
|
|
1290
1293
|
}) ?? null;
|
|
1291
1294
|
(!d || d.length === 0) && (d = [{ field: "path", desc: !1 }]);
|
|
1292
|
-
const p = d?.map((y) => y.field) || [],
|
|
1295
|
+
const p = d?.map((y) => y.field) || [], h = be(
|
|
1293
1296
|
r.workingDir,
|
|
1294
1297
|
s.relativeRootDir
|
|
1295
1298
|
);
|
|
1296
|
-
if ("error" in
|
|
1297
|
-
return { error:
|
|
1298
|
-
const g =
|
|
1299
|
+
if ("error" in h)
|
|
1300
|
+
return { error: h.error };
|
|
1301
|
+
const g = h.path;
|
|
1299
1302
|
try {
|
|
1300
1303
|
try {
|
|
1301
1304
|
await j.promises.access(g, j.constants.F_OK);
|
|
@@ -1317,7 +1320,7 @@ async function rs(t, r) {
|
|
|
1317
1320
|
size: f.includes("size") || p.includes("size"),
|
|
1318
1321
|
countFiles: f.includes("countFiles") || p.includes("countFiles")
|
|
1319
1322
|
};
|
|
1320
|
-
let b = null,
|
|
1323
|
+
let b = null, I = null;
|
|
1321
1324
|
if (a || c)
|
|
1322
1325
|
try {
|
|
1323
1326
|
const S = Date.now(), v = c ? S - _e(c) : null, P = a ? S - _e(a) : null;
|
|
@@ -1330,23 +1333,23 @@ async function rs(t, r) {
|
|
|
1330
1333
|
if (l || u)
|
|
1331
1334
|
try {
|
|
1332
1335
|
const S = l ? Ge(l) : null, v = u ? Ge(u) : null;
|
|
1333
|
-
|
|
1336
|
+
I = [S, v];
|
|
1334
1337
|
} catch (S) {
|
|
1335
1338
|
return {
|
|
1336
1339
|
error: S instanceof Error ? S.message : "Unknown error parsing size filter"
|
|
1337
1340
|
};
|
|
1338
1341
|
}
|
|
1339
|
-
const T = await
|
|
1342
|
+
const T = await Xr({
|
|
1340
1343
|
rootDir: g || null,
|
|
1341
1344
|
globs: M,
|
|
1342
1345
|
result: E,
|
|
1343
1346
|
dateModified: b,
|
|
1344
|
-
totalSize:
|
|
1347
|
+
totalSize: I
|
|
1345
1348
|
});
|
|
1346
1349
|
return T.items.length > qe ? {
|
|
1347
1350
|
error: `Number of paths (${T.items.length}) exceeds maximum allowed (${qe}). Consider using more specific glob patterns or filters to reduce the result set.`
|
|
1348
1351
|
} : {
|
|
1349
|
-
output:
|
|
1352
|
+
output: ts(T, {
|
|
1350
1353
|
sort: d,
|
|
1351
1354
|
fields: f,
|
|
1352
1355
|
totals: !0
|
|
@@ -1356,16 +1359,16 @@ async function rs(t, r) {
|
|
|
1356
1359
|
return { error: y instanceof Error ? y.message : "Unknown error" };
|
|
1357
1360
|
}
|
|
1358
1361
|
}
|
|
1359
|
-
function
|
|
1362
|
+
function ns(t, r) {
|
|
1360
1363
|
t(
|
|
1361
1364
|
"fs-list",
|
|
1362
1365
|
{
|
|
1363
1366
|
title: "List Files and Directories",
|
|
1364
1367
|
description: "List files and directories with advanced filtering, sorting and formatting options. Use this to analyze filesystem structure",
|
|
1365
|
-
inputSchema:
|
|
1368
|
+
inputSchema: Tt.shape
|
|
1366
1369
|
},
|
|
1367
1370
|
async (s) => {
|
|
1368
|
-
const o = await
|
|
1371
|
+
const o = await os(s, r);
|
|
1369
1372
|
return o.error ? `Method: fs-list(${JSON.stringify(s)})
|
|
1370
1373
|
❌ Error: ${o.error}` : `Method: fs-list(${JSON.stringify(s)})
|
|
1371
1374
|
${o.output || JSON.stringify(o, null, 2)}`;
|
|
@@ -1373,9 +1376,9 @@ ${o.output || JSON.stringify(o, null, 2)}`;
|
|
|
1373
1376
|
);
|
|
1374
1377
|
}
|
|
1375
1378
|
const ue = /* @__PURE__ */ new Map();
|
|
1376
|
-
let
|
|
1377
|
-
function
|
|
1378
|
-
return `${++
|
|
1379
|
+
let is = 0;
|
|
1380
|
+
function as() {
|
|
1381
|
+
return `${++is}-${Math.random().toString(36).slice(2)}`;
|
|
1379
1382
|
}
|
|
1380
1383
|
function Z(t) {
|
|
1381
1384
|
return ue.has(t) || ue.set(t, {
|
|
@@ -1439,32 +1442,32 @@ function We(t) {
|
|
|
1439
1442
|
);
|
|
1440
1443
|
}
|
|
1441
1444
|
}
|
|
1442
|
-
const xe =
|
|
1443
|
-
name:
|
|
1445
|
+
const xe = m.object({
|
|
1446
|
+
name: m.string().describe(
|
|
1444
1447
|
"Unique name for the filesystem snapshot query. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
1445
1448
|
),
|
|
1446
|
-
relativeRootDir:
|
|
1449
|
+
relativeRootDir: m.string().optional().describe(
|
|
1447
1450
|
'Relative path from project root to directory for snapshot. Use forward slashes. Leave empty for project root. Examples: "src", "src/components", "tests". Path must exist'
|
|
1448
1451
|
),
|
|
1449
|
-
bulkGlobs:
|
|
1452
|
+
bulkGlobs: m.array(m.string()).optional().describe(
|
|
1450
1453
|
'Glob patterns to filter files/directories. Include all patterns in this single array; never split across multiple tool calls. Add leading ** for recursive matching. Examples: ["**/*.js"], ["src/**/*.ts"], ["**/*.{ts,svelte}"], ["!node_modules"]. If omitted, includes all files matching other criteria. Supports: * (any chars), ** (any dirs), ? (single char), [abc] (char class)'
|
|
1451
1454
|
),
|
|
1452
|
-
types:
|
|
1455
|
+
types: m.array(m.enum(["file", "dir"])).optional().describe(
|
|
1453
1456
|
"Types of items to include in the snapshot. If omitted, includes both files and directories"
|
|
1454
1457
|
),
|
|
1455
|
-
extraFields:
|
|
1458
|
+
extraFields: m.array(m.enum(["lastModified", "size", "countMatched"])).optional().describe(
|
|
1456
1459
|
'Which extra data fields to include in the snapshot tree output. "lastModified" shows last modification time as time-ago format (5m, 2h, 3d, etc). "size" shows file/directory size in human-readable format (KB, MB, GB). "countMatched" shows total matched items count'
|
|
1457
1460
|
),
|
|
1458
|
-
minTimeAgo:
|
|
1461
|
+
minTimeAgo: m.string().optional().describe(
|
|
1459
1462
|
'Filter files/directories modified at least this long ago. Only items older than this duration will be included. Format: number + unit (s/m/h/d/w/M/Y). Examples: "1h" (modified more than 1 hour ago), "7d" (modified more than 7 days ago), "6M" (modified more than 6 months ago)'
|
|
1460
1463
|
),
|
|
1461
|
-
maxTimeAgo:
|
|
1464
|
+
maxTimeAgo: m.string().optional().describe(
|
|
1462
1465
|
'Filter files/directories modified at most this long ago. Only items newer than this duration will be included. Format: number + unit (s/m/h/d/w/M/Y). Examples: "1h" (modified within last hour), "7d" (modified within last 7 days), "1M" (modified within last month). Combine with minTimeAgo for date ranges'
|
|
1463
1466
|
),
|
|
1464
|
-
minTotalSize:
|
|
1467
|
+
minTotalSize: m.string().optional().describe(
|
|
1465
1468
|
'Filter files/directories with total size at least this large. Only items with size >= this value will be included. For directories, uses total size of all contents. Format: number + unit (B/KB/MB/GB/TB). Examples: "1KB" (at least 1 kilobyte), "100MB" (at least 100 megabytes), "1.5GB" (at least 1.5 gigabytes)'
|
|
1466
1469
|
),
|
|
1467
|
-
maxTotalSize:
|
|
1470
|
+
maxTotalSize: m.string().optional().describe(
|
|
1468
1471
|
'Filter files/directories with total size at most this large. Only items with size <= this value will be included. For directories, uses total size of all contents. Format: number + unit (B/KB/MB/GB/TB). Examples: "1MB" (up to 1 megabyte), "500KB" (up to 500 kilobytes), "10GB" (up to 10 gigabytes). Combine with minTotalSize for size ranges'
|
|
1469
1472
|
)
|
|
1470
1473
|
}), Ke = new Map(
|
|
@@ -1476,17 +1479,17 @@ const xe = h.object({
|
|
|
1476
1479
|
"dateModified"
|
|
1477
1480
|
].map((t, r) => [t, r])
|
|
1478
1481
|
);
|
|
1479
|
-
function
|
|
1482
|
+
function ls(t, r) {
|
|
1480
1483
|
const s = Ke.get(t) ?? 1 / 0, o = Ke.get(r) ?? 1 / 0;
|
|
1481
1484
|
return s > o ? 1 : s < o ? -1 : 0;
|
|
1482
1485
|
}
|
|
1483
|
-
async function
|
|
1486
|
+
async function Ct(t, r, s) {
|
|
1484
1487
|
let o;
|
|
1485
1488
|
try {
|
|
1486
1489
|
o = xe.parse(t);
|
|
1487
|
-
} catch (
|
|
1490
|
+
} catch (h) {
|
|
1488
1491
|
return {
|
|
1489
|
-
error: F(
|
|
1492
|
+
error: F(h)
|
|
1490
1493
|
};
|
|
1491
1494
|
}
|
|
1492
1495
|
const {
|
|
@@ -1519,8 +1522,8 @@ async function Tt(t, r, s) {
|
|
|
1519
1522
|
};
|
|
1520
1523
|
throw x;
|
|
1521
1524
|
}
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1525
|
+
const h = o.extraFields ? o.extraFields.map((x) => x === "lastModified" ? "dateModified" : x) : [];
|
|
1526
|
+
h.includes("name") || h.push("name"), h.sort(ls);
|
|
1524
1527
|
const g = n && n.length > 0 ? n.map((x) => ({
|
|
1525
1528
|
value: x,
|
|
1526
1529
|
valueType: "pattern",
|
|
@@ -1545,26 +1548,26 @@ async function Tt(t, r, s) {
|
|
|
1545
1548
|
error: x instanceof Error ? x.message : "Unknown error parsing size filter"
|
|
1546
1549
|
};
|
|
1547
1550
|
}
|
|
1548
|
-
const b = i ? i.includes("file") : !0,
|
|
1551
|
+
const b = i ? i.includes("file") : !0, I = i ? i.includes("dir") : !0, T = {
|
|
1549
1552
|
name: e,
|
|
1550
1553
|
rootDir: p,
|
|
1551
1554
|
globs: w,
|
|
1552
1555
|
matchFiles: b,
|
|
1553
|
-
matchDirs:
|
|
1556
|
+
matchDirs: I,
|
|
1554
1557
|
dateModified: M,
|
|
1555
1558
|
totalSize: E,
|
|
1556
|
-
fields:
|
|
1559
|
+
fields: h
|
|
1557
1560
|
};
|
|
1558
1561
|
return f.fsSnapshotQueries.set(e, T), {
|
|
1559
1562
|
snapshotQuery: T
|
|
1560
1563
|
};
|
|
1561
|
-
} catch (
|
|
1564
|
+
} catch (h) {
|
|
1562
1565
|
return {
|
|
1563
|
-
error:
|
|
1566
|
+
error: h instanceof Error ? h.message : "Unknown error"
|
|
1564
1567
|
};
|
|
1565
1568
|
}
|
|
1566
1569
|
}
|
|
1567
|
-
function
|
|
1570
|
+
function cs(t, r) {
|
|
1568
1571
|
t(
|
|
1569
1572
|
"fs-snapshot-query-create",
|
|
1570
1573
|
{
|
|
@@ -1573,7 +1576,7 @@ function as(t, r) {
|
|
|
1573
1576
|
inputSchema: xe.shape
|
|
1574
1577
|
},
|
|
1575
1578
|
async (s, o) => {
|
|
1576
|
-
const e = await
|
|
1579
|
+
const e = await Ct(s, r, o);
|
|
1577
1580
|
return e.error != null ? `Method: fs-snapshot-query-create(${JSON.stringify(s)})
|
|
1578
1581
|
❌ Error: ${e.error}` : `Method: fs-snapshot-query-create(${JSON.stringify(s)})
|
|
1579
1582
|
✅ Filesystem snapshot query "${e.snapshotQuery.name}" created successfully`;
|
|
@@ -1620,16 +1623,16 @@ function le(t) {
|
|
|
1620
1623
|
}
|
|
1621
1624
|
};
|
|
1622
1625
|
}
|
|
1623
|
-
function
|
|
1626
|
+
function vt(t, r, s) {
|
|
1624
1627
|
let o = null;
|
|
1625
1628
|
for (let e = 0, n = r.length; e < n; e++) {
|
|
1626
|
-
const i = r[e], a = t(i), c = a == null ? null :
|
|
1629
|
+
const i = r[e], a = t(i), c = a == null ? null : vt(t, a, s), l = s(i, c);
|
|
1627
1630
|
l != null && (o == null && (o = []), o.push(l));
|
|
1628
1631
|
}
|
|
1629
1632
|
return o;
|
|
1630
1633
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const { getId: r, getChilds: s, rootNodes: o, createSnapshotNode: e } = t, n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), c =
|
|
1634
|
+
function Et(t) {
|
|
1635
|
+
const { getId: r, getChilds: s, rootNodes: o, createSnapshotNode: e } = t, n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), c = vt(
|
|
1633
1636
|
s,
|
|
1634
1637
|
o,
|
|
1635
1638
|
(u, f) => {
|
|
@@ -1657,7 +1660,7 @@ function vt(t) {
|
|
|
1657
1660
|
function me(t) {
|
|
1658
1661
|
return t = t != null ? H(t).replace(/\/$/, "") : null, !t || t === "." ? null : t;
|
|
1659
1662
|
}
|
|
1660
|
-
async function
|
|
1663
|
+
async function us(t) {
|
|
1661
1664
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), o = k.resolve(t.rootDir || "."), n = {
|
|
1662
1665
|
path: ".",
|
|
1663
1666
|
name: k.basename(o),
|
|
@@ -1671,10 +1674,10 @@ async function ls(t) {
|
|
|
1671
1674
|
rootDir: o,
|
|
1672
1675
|
globs: t.globs
|
|
1673
1676
|
});
|
|
1674
|
-
return await
|
|
1677
|
+
return await It({
|
|
1675
1678
|
paths: [o],
|
|
1676
1679
|
walkLinks: !0,
|
|
1677
|
-
matchPath:
|
|
1680
|
+
matchPath: Mt({
|
|
1678
1681
|
globs: i,
|
|
1679
1682
|
rootDir: o,
|
|
1680
1683
|
noCase: !0
|
|
@@ -1683,15 +1686,15 @@ async function ls(t) {
|
|
|
1683
1686
|
const u = k.relative(o, a), f = c.isDirectory(), d = c.isFile();
|
|
1684
1687
|
if (!f && !d)
|
|
1685
1688
|
return !0;
|
|
1686
|
-
const p = me(u || "."),
|
|
1689
|
+
const p = me(u || "."), h = f ? "dir" : "file", g = f ? null : c.mtimeMs, y = c.size;
|
|
1687
1690
|
let w = !0;
|
|
1688
1691
|
if (d && !t.matchFiles && (w = !1), f && !t.matchDirs && (w = !1), w && d && t.dateModified && g != null) {
|
|
1689
|
-
const [
|
|
1690
|
-
(
|
|
1692
|
+
const [I, T] = t.dateModified;
|
|
1693
|
+
(I != null && g < I || T != null && g > T) && (w = !1);
|
|
1691
1694
|
}
|
|
1692
1695
|
if (w && d && t.totalSize && y != null) {
|
|
1693
|
-
const [
|
|
1694
|
-
(
|
|
1696
|
+
const [I, T] = t.totalSize;
|
|
1697
|
+
(I != null && y < I || T != null && y > T) && (w = !1);
|
|
1695
1698
|
}
|
|
1696
1699
|
if (f && !w) {
|
|
1697
1700
|
if (!(l.countFiles && l.countFiles > 0)) return !1;
|
|
@@ -1700,7 +1703,7 @@ async function ls(t) {
|
|
|
1700
1703
|
const M = {
|
|
1701
1704
|
path: p ?? ".",
|
|
1702
1705
|
name: k.basename(a),
|
|
1703
|
-
type:
|
|
1706
|
+
type: h,
|
|
1704
1707
|
dateModified: g,
|
|
1705
1708
|
size: y,
|
|
1706
1709
|
isMatched: w
|
|
@@ -1717,7 +1720,7 @@ async function ls(t) {
|
|
|
1717
1720
|
idToChildIds: s
|
|
1718
1721
|
};
|
|
1719
1722
|
}
|
|
1720
|
-
const
|
|
1723
|
+
const ds = [
|
|
1721
1724
|
{ name: "[ ]", match: (t) => t === 32, min: 2, max: 81 },
|
|
1722
1725
|
{ name: "[\\t]", match: (t) => t === 9, min: 2, max: 20 },
|
|
1723
1726
|
{ name: "[\\n]", match: (t) => t === 10, min: 2, max: 14 },
|
|
@@ -1740,7 +1743,7 @@ const cs = [
|
|
|
1740
1743
|
// max: 2,
|
|
1741
1744
|
// },
|
|
1742
1745
|
];
|
|
1743
|
-
function He(t, r =
|
|
1746
|
+
function He(t, r = ds) {
|
|
1744
1747
|
const s = t.length;
|
|
1745
1748
|
if (s === 0) return 0;
|
|
1746
1749
|
const o = r.length;
|
|
@@ -1766,25 +1769,25 @@ function He(t, r = cs) {
|
|
|
1766
1769
|
}
|
|
1767
1770
|
return e;
|
|
1768
1771
|
}
|
|
1769
|
-
function
|
|
1772
|
+
function Nt(t) {
|
|
1770
1773
|
let r = 0;
|
|
1771
1774
|
return r += He(t.textOpen) + 1, t.textClose != null && (r += He(t.textClose) + 1), t.indent && (r += 1), r;
|
|
1772
1775
|
}
|
|
1773
1776
|
const Qe = ["B", "KB", "MB", "GB", "TB"], Ye = 1024;
|
|
1774
|
-
function
|
|
1777
|
+
function fs(t) {
|
|
1775
1778
|
if (t == null) return "-";
|
|
1776
1779
|
let r = t ?? 0, s = 0;
|
|
1777
1780
|
for (; r >= Ye && s < Qe.length - 1; )
|
|
1778
1781
|
r /= Ye, s++;
|
|
1779
1782
|
return `${s === 0 ? r.toString() : r.toFixed(2)}${Qe[s]}`;
|
|
1780
1783
|
}
|
|
1781
|
-
function
|
|
1784
|
+
function ps(t) {
|
|
1782
1785
|
const s = Date.now() - t;
|
|
1783
1786
|
if (s < 0) return "0s";
|
|
1784
1787
|
const o = Math.floor(s / 1e3), e = Math.floor(o / 60), n = Math.floor(e / 60), i = Math.floor(n / 24), a = Math.floor(i / 7), c = Math.floor(i / 30), l = Math.floor(i / 365);
|
|
1785
1788
|
return l > 0 ? `${l}Y` : c > 0 ? `${c}M` : a > 0 ? `${a}w` : i > 0 ? `${i}d` : n > 0 ? `${n}h` : e > 0 ? `${e}m` : `${o}s`;
|
|
1786
1789
|
}
|
|
1787
|
-
function
|
|
1790
|
+
function hs(t) {
|
|
1788
1791
|
return function(s, o) {
|
|
1789
1792
|
const e = t.get(s), n = t.get(o);
|
|
1790
1793
|
if (e.type !== n.type)
|
|
@@ -1797,26 +1800,26 @@ function fs(t) {
|
|
|
1797
1800
|
}
|
|
1798
1801
|
};
|
|
1799
1802
|
}
|
|
1800
|
-
function
|
|
1803
|
+
function ms(t) {
|
|
1801
1804
|
const r = t.fields ?? [];
|
|
1802
1805
|
return function(o, e) {
|
|
1803
1806
|
let n = "", i, a = 0;
|
|
1804
1807
|
const c = e ? e.length : 0;
|
|
1805
|
-
let l = 1, u, f = 0, d = 0, p = 0,
|
|
1808
|
+
let l = 1, u, f = 0, d = 0, p = 0, h = 0, g = null, y, w, M;
|
|
1806
1809
|
if (e)
|
|
1807
1810
|
for (let b = 0; b < e.length; b++) {
|
|
1808
|
-
const
|
|
1809
|
-
a +=
|
|
1811
|
+
const I = e[b];
|
|
1812
|
+
a += I.countMatched, l += I.countTotal, f += I.tokens, d += I.tokensTotal, p += I.size, h += I.countFiles, I.dateModified != null && (g == null || I.dateModified > g) && (g = I.dateModified);
|
|
1810
1813
|
}
|
|
1811
|
-
o ? (y = o.type, w = o.name, M = o.path, i = o.isMatched, i && (a += 1), o.type === "file" ? (p = o.size || 0,
|
|
1812
|
-
for (let b = 0,
|
|
1814
|
+
o ? (y = o.type, w = o.name, M = o.path, i = o.isMatched, i && (a += 1), o.type === "file" ? (p = o.size || 0, h = 1, g = o.dateModified || null) : o.dateModified != null && (g == null || o.dateModified > g) && (g = o.dateModified)) : (y = "dir", w = "<root>", M = ".", i = !0);
|
|
1815
|
+
for (let b = 0, I = r.length; b < I; b++) {
|
|
1813
1816
|
const T = r[b];
|
|
1814
1817
|
switch (b > 0 && (n += " "), T) {
|
|
1815
1818
|
case "dateModified":
|
|
1816
|
-
n += g ?
|
|
1819
|
+
n += g ? ps(g) : "-";
|
|
1817
1820
|
break;
|
|
1818
1821
|
case "size":
|
|
1819
|
-
n +=
|
|
1822
|
+
n += fs(p);
|
|
1820
1823
|
break;
|
|
1821
1824
|
case "type":
|
|
1822
1825
|
n += y;
|
|
@@ -1834,7 +1837,7 @@ function ps(t) {
|
|
|
1834
1837
|
textOpen: n,
|
|
1835
1838
|
textClose: null
|
|
1836
1839
|
};
|
|
1837
|
-
return u =
|
|
1840
|
+
return u = Nt(E), d += u, {
|
|
1838
1841
|
type: y,
|
|
1839
1842
|
name: w,
|
|
1840
1843
|
path: M,
|
|
@@ -1847,13 +1850,13 @@ function ps(t) {
|
|
|
1847
1850
|
tokensTotal: d,
|
|
1848
1851
|
text: E,
|
|
1849
1852
|
size: p,
|
|
1850
|
-
countFiles:
|
|
1853
|
+
countFiles: h,
|
|
1851
1854
|
dateModified: g
|
|
1852
1855
|
};
|
|
1853
1856
|
};
|
|
1854
1857
|
}
|
|
1855
|
-
async function
|
|
1856
|
-
const r = await
|
|
1858
|
+
async function gs(t) {
|
|
1859
|
+
const r = await us(t), s = le(r), o = s.getChilds(s.root), e = Et({
|
|
1857
1860
|
getId: (i) => {
|
|
1858
1861
|
const a = s.getId(i);
|
|
1859
1862
|
if (a == null)
|
|
@@ -1863,19 +1866,19 @@ async function hs(t) {
|
|
|
1863
1866
|
return a;
|
|
1864
1867
|
},
|
|
1865
1868
|
getChilds: (i) => s.getChilds(i),
|
|
1866
|
-
createSnapshotNode:
|
|
1869
|
+
createSnapshotNode: ms(t),
|
|
1867
1870
|
rootNodes: o ?? []
|
|
1868
|
-
}), n =
|
|
1871
|
+
}), n = hs(e.idToNode);
|
|
1869
1872
|
return e.idToChildIds.forEach((i) => {
|
|
1870
1873
|
i.sort(n);
|
|
1871
1874
|
}), le(e);
|
|
1872
1875
|
}
|
|
1873
|
-
const ee =
|
|
1874
|
-
queryName:
|
|
1876
|
+
const ee = m.object({
|
|
1877
|
+
queryName: m.string().optional().describe("Name of previously created filesystem snapshot query, to use"),
|
|
1875
1878
|
query: xe.optional().describe(
|
|
1876
1879
|
"Filesystem snapshot query creation options JSON to automatically create query"
|
|
1877
1880
|
),
|
|
1878
|
-
name:
|
|
1881
|
+
name: m.string().describe(
|
|
1879
1882
|
"Unique name for the filesystem snapshot. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
1880
1883
|
)
|
|
1881
1884
|
});
|
|
@@ -1907,7 +1910,7 @@ async function ce(t, r, s) {
|
|
|
1907
1910
|
};
|
|
1908
1911
|
c = u;
|
|
1909
1912
|
} else if (i) {
|
|
1910
|
-
const u = await
|
|
1913
|
+
const u = await Ct(
|
|
1911
1914
|
i,
|
|
1912
1915
|
r,
|
|
1913
1916
|
s
|
|
@@ -1922,7 +1925,7 @@ async function ce(t, r, s) {
|
|
|
1922
1925
|
error: "Either queryName or query must be provided"
|
|
1923
1926
|
};
|
|
1924
1927
|
try {
|
|
1925
|
-
const u = await
|
|
1928
|
+
const u = await gs(c), f = {
|
|
1926
1929
|
name: e,
|
|
1927
1930
|
query: c,
|
|
1928
1931
|
tree: u
|
|
@@ -1937,7 +1940,7 @@ async function ce(t, r, s) {
|
|
|
1937
1940
|
};
|
|
1938
1941
|
}
|
|
1939
1942
|
}
|
|
1940
|
-
function
|
|
1943
|
+
function ws(t, r) {
|
|
1941
1944
|
t(
|
|
1942
1945
|
"fs-snapshot-create",
|
|
1943
1946
|
{
|
|
@@ -1957,7 +1960,7 @@ function ms(t, r) {
|
|
|
1957
1960
|
}
|
|
1958
1961
|
);
|
|
1959
1962
|
}
|
|
1960
|
-
class
|
|
1963
|
+
class ys {
|
|
1961
1964
|
_first = null;
|
|
1962
1965
|
_last = null;
|
|
1963
1966
|
_size = 0;
|
|
@@ -1980,8 +1983,8 @@ class gs {
|
|
|
1980
1983
|
return this._size;
|
|
1981
1984
|
}
|
|
1982
1985
|
}
|
|
1983
|
-
function
|
|
1984
|
-
const r = new
|
|
1986
|
+
function bs(t) {
|
|
1987
|
+
const r = new ys(), {
|
|
1985
1988
|
tree: s,
|
|
1986
1989
|
limits: { maxCountTotal: o, maxTokensTotal: e, maxCountGroup: n, maxTokensGroup: i },
|
|
1987
1990
|
indexRangeGroupStrategy: a
|
|
@@ -1992,26 +1995,26 @@ function ws(t) {
|
|
|
1992
1995
|
});
|
|
1993
1996
|
let l = null, u = 0, f = 0;
|
|
1994
1997
|
for (; !r.isEmpty(); ) {
|
|
1995
|
-
const { reportNode: d, node: p } = r.dequeue(),
|
|
1996
|
-
if (
|
|
1998
|
+
const { reportNode: d, node: p } = r.dequeue(), h = s.getChilds(p);
|
|
1999
|
+
if (h == null || p.countChilds === 0 || h.length !== p.countChilds)
|
|
1997
2000
|
throw new Error(
|
|
1998
2001
|
"Impossible behavior: nodeChilds is null or length mismatch"
|
|
1999
2002
|
);
|
|
2000
2003
|
let g = r.size();
|
|
2001
|
-
for (let w = 0; w <
|
|
2002
|
-
|
|
2004
|
+
for (let w = 0; w < h.length; w++)
|
|
2005
|
+
h[w].countChilds > 0 && (g += 1);
|
|
2003
2006
|
const y = g * a.tokens;
|
|
2004
2007
|
if (o != null && u + p.countChilds + g > o || e != null && f + p.tokensChilds + y > e) {
|
|
2005
2008
|
const w = [];
|
|
2006
2009
|
let M = null, E = 0;
|
|
2007
|
-
for (let
|
|
2008
|
-
const x =
|
|
2010
|
+
for (let I = 0, T = h.length; I < T; I++) {
|
|
2011
|
+
const x = h[I], S = E * a.tokens;
|
|
2009
2012
|
M != null && // Если общий лимит превышен, то не создаем новую группу, а продолжаем текущую. В случае достижения лимитов, последняя группа может содержать больше элементов, чем указано в лимитах группы, и это допустимо. Главное - дать в отчете полную картину.
|
|
2010
|
-
!(o != null && u + 1 > o || e != null && f + a.tokens > e) && (n != null && M.countGrouped + 1 + E > n || i != null && M.tokensGrouped + x.tokens + S > i) && (w.push(M), u += 1, f += a.tokens, M = null, E = 0), M = a.add(M, x,
|
|
2013
|
+
!(o != null && u + 1 > o || e != null && f + a.tokens > e) && (n != null && M.countGrouped + 1 + E > n || i != null && M.tokensGrouped + x.tokens + S > i) && (w.push(M), u += 1, f += a.tokens, M = null, E = 0), M = a.add(M, x, I), x.countChilds > 0 && (E += 1);
|
|
2011
2014
|
}
|
|
2012
2015
|
M != null && (w.push(M), u += 1, f += a.tokens);
|
|
2013
|
-
const b = w.map((
|
|
2014
|
-
text: a.getReportText(
|
|
2016
|
+
const b = w.map((I) => ({
|
|
2017
|
+
text: a.getReportText(I)
|
|
2015
2018
|
}));
|
|
2016
2019
|
if (d != null) {
|
|
2017
2020
|
if (d.childs != null)
|
|
@@ -2025,13 +2028,13 @@ function ws(t) {
|
|
|
2025
2028
|
} else {
|
|
2026
2029
|
u += p.countChilds, f += p.tokensChilds;
|
|
2027
2030
|
const w = [];
|
|
2028
|
-
for (let M = 0; M <
|
|
2029
|
-
const E =
|
|
2031
|
+
for (let M = 0; M < h.length; M++) {
|
|
2032
|
+
const E = h[M], b = {
|
|
2030
2033
|
text: E.text
|
|
2031
2034
|
};
|
|
2032
2035
|
w.push(b);
|
|
2033
|
-
const
|
|
2034
|
-
|
|
2036
|
+
const I = s.getChilds(E);
|
|
2037
|
+
I != null && I.length > 0 && r.enqueue({
|
|
2035
2038
|
reportNode: b,
|
|
2036
2039
|
node: E
|
|
2037
2040
|
});
|
|
@@ -2049,7 +2052,7 @@ function ws(t) {
|
|
|
2049
2052
|
}
|
|
2050
2053
|
return l ?? [];
|
|
2051
2054
|
}
|
|
2052
|
-
function
|
|
2055
|
+
function kt(t) {
|
|
2053
2056
|
const {
|
|
2054
2057
|
tree: r,
|
|
2055
2058
|
request: { parentNodeId: s, childsIndexRange: o, limits: e },
|
|
@@ -2066,18 +2069,16 @@ function Nt(t) {
|
|
|
2066
2069
|
a = r.root;
|
|
2067
2070
|
let c, l = r.getChilds(a) ?? [];
|
|
2068
2071
|
if (o != null) {
|
|
2069
|
-
|
|
2070
|
-
if (d < 0
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
);
|
|
2074
|
-
const m = [];
|
|
2072
|
+
let [d, p] = o;
|
|
2073
|
+
if (d < 0 && (d = 0), p < 0 && (p = 0), p >= l.length && (p = l.length - 1), p < d)
|
|
2074
|
+
return [];
|
|
2075
|
+
const h = [];
|
|
2075
2076
|
let g = null;
|
|
2076
2077
|
for (let y = d; y <= p; y++) {
|
|
2077
2078
|
const w = l[y];
|
|
2078
|
-
|
|
2079
|
+
h.push(w), g = n.add(g, w, y);
|
|
2079
2080
|
}
|
|
2080
|
-
l =
|
|
2081
|
+
l = h, c = {
|
|
2081
2082
|
...a,
|
|
2082
2083
|
text: n.getReportText(g),
|
|
2083
2084
|
countChilds: g.countGrouped,
|
|
@@ -2093,14 +2094,14 @@ function Nt(t) {
|
|
|
2093
2094
|
root: u,
|
|
2094
2095
|
getChilds: (d) => d === u ? [c] : d === c ? l : r.getChilds(d)
|
|
2095
2096
|
};
|
|
2096
|
-
return
|
|
2097
|
+
return bs({
|
|
2097
2098
|
tree: f,
|
|
2098
2099
|
limits: e,
|
|
2099
2100
|
indexRangeGroupStrategy: n,
|
|
2100
2101
|
...i
|
|
2101
2102
|
});
|
|
2102
2103
|
}
|
|
2103
|
-
function
|
|
2104
|
+
function Ot(t, r) {
|
|
2104
2105
|
if (t == null || t.length === 0)
|
|
2105
2106
|
return "No results found";
|
|
2106
2107
|
let s = "";
|
|
@@ -2117,7 +2118,7 @@ function kt(t, r) {
|
|
|
2117
2118
|
}
|
|
2118
2119
|
return o(t, ""), s;
|
|
2119
2120
|
}
|
|
2120
|
-
class
|
|
2121
|
+
class Ss {
|
|
2121
2122
|
tokens = 16;
|
|
2122
2123
|
// +1 indent, +1 for line break
|
|
2123
2124
|
getReportText = (r) => ({
|
|
@@ -2132,16 +2133,16 @@ class ys {
|
|
|
2132
2133
|
tokensGrouped: s.tokens
|
|
2133
2134
|
} : (r.indexRange[1] = o, r.countGrouped += 1, r.countMatched += s.countMatched, r.tokensGrouped += s.tokens, r);
|
|
2134
2135
|
}
|
|
2135
|
-
const
|
|
2136
|
-
snapshotName:
|
|
2136
|
+
const Rt = m.object({
|
|
2137
|
+
snapshotName: m.string().optional().describe("Name of previously created filesystem snapshot, to use"),
|
|
2137
2138
|
snapshot: ee.optional().describe(
|
|
2138
2139
|
"Filesystem snapshot creation options JSON to automatically create snapshot"
|
|
2139
2140
|
),
|
|
2140
|
-
parentPath:
|
|
2141
|
+
parentPath: m.string().optional().describe(
|
|
2141
2142
|
"Path relative to snapshot rootDir to browse. Omit to browse the rootDir itself"
|
|
2142
2143
|
),
|
|
2143
|
-
childsIndexRange:
|
|
2144
|
-
"Child index range to show
|
|
2144
|
+
childsIndexRange: ft.optional().describe(
|
|
2145
|
+
"Child index range to show. Only use the exact ranges that appeared in previous snapshot results - do not modify, combine, or split them"
|
|
2145
2146
|
)
|
|
2146
2147
|
// maxCountTotal: z
|
|
2147
2148
|
// .number()
|
|
@@ -2154,10 +2155,10 @@ const Ot = h.object({
|
|
|
2154
2155
|
// maxCountGroup: z.number().default(10).describe('Maximum items per group'),
|
|
2155
2156
|
// maxTokensGroup: z.number().default(1000).describe('Maximum tokens per group'),
|
|
2156
2157
|
});
|
|
2157
|
-
async function
|
|
2158
|
+
async function xs(t, r, s) {
|
|
2158
2159
|
let o;
|
|
2159
2160
|
try {
|
|
2160
|
-
o =
|
|
2161
|
+
o = Rt.parse(t);
|
|
2161
2162
|
} catch (g) {
|
|
2162
2163
|
return {
|
|
2163
2164
|
error: F(g)
|
|
@@ -2165,13 +2166,12 @@ async function bs(t, r, s) {
|
|
|
2165
2166
|
}
|
|
2166
2167
|
const {
|
|
2167
2168
|
snapshotName: e,
|
|
2168
|
-
snapshot: n
|
|
2169
|
-
childsIndexRange: i
|
|
2169
|
+
snapshot: n
|
|
2170
2170
|
// maxCountTotal,
|
|
2171
2171
|
// maxTokensTotal,
|
|
2172
2172
|
// maxCountGroup,
|
|
2173
2173
|
// maxTokensGroup,
|
|
2174
|
-
} = o, a = 60, c = 1e3, l = 25, u = 900;
|
|
2174
|
+
} = o, i = o.childsIndexRange?.from != null && o.childsIndexRange?.to != null ? [o.childsIndexRange.from, o.childsIndexRange.to] : null, a = 60, c = 1e3, l = 25, u = 900;
|
|
2175
2175
|
if (!s.sessionId)
|
|
2176
2176
|
return {
|
|
2177
2177
|
error: "Session ID is required"
|
|
@@ -2181,7 +2181,7 @@ async function bs(t, r, s) {
|
|
|
2181
2181
|
return {
|
|
2182
2182
|
error: "Either snapshotName or snapshot must be provided, not both"
|
|
2183
2183
|
};
|
|
2184
|
-
let d, p = !1,
|
|
2184
|
+
let d, p = !1, h = !1;
|
|
2185
2185
|
if (e) {
|
|
2186
2186
|
if (d = f.fsSnapshots.get(e), d == null)
|
|
2187
2187
|
return {
|
|
@@ -2197,13 +2197,13 @@ async function bs(t, r, s) {
|
|
|
2197
2197
|
return {
|
|
2198
2198
|
error: g.error
|
|
2199
2199
|
};
|
|
2200
|
-
d = g.fsSnapshot, p = g.queryCreated,
|
|
2200
|
+
d = g.fsSnapshot, p = g.queryCreated, h = !0;
|
|
2201
2201
|
} else
|
|
2202
2202
|
return {
|
|
2203
2203
|
error: "Either snapshotName or snapshot must be provided"
|
|
2204
2204
|
};
|
|
2205
2205
|
try {
|
|
2206
|
-
const g = me(o.parentPath), y =
|
|
2206
|
+
const g = me(o.parentPath), y = kt({
|
|
2207
2207
|
tree: d.tree,
|
|
2208
2208
|
request: {
|
|
2209
2209
|
parentNodeId: g,
|
|
@@ -2215,12 +2215,12 @@ async function bs(t, r, s) {
|
|
|
2215
2215
|
maxTokensGroup: u
|
|
2216
2216
|
}
|
|
2217
2217
|
},
|
|
2218
|
-
indexRangeGroupStrategy: new
|
|
2219
|
-
}), w =
|
|
2218
|
+
indexRangeGroupStrategy: new Ss()
|
|
2219
|
+
}), w = Ot(y);
|
|
2220
2220
|
return {
|
|
2221
2221
|
fsSnapshot: d,
|
|
2222
2222
|
queryCreated: p,
|
|
2223
|
-
snapshotCreated:
|
|
2223
|
+
snapshotCreated: h,
|
|
2224
2224
|
parentPath: g,
|
|
2225
2225
|
childsIndexRange: i,
|
|
2226
2226
|
report: w
|
|
@@ -2231,16 +2231,16 @@ async function bs(t, r, s) {
|
|
|
2231
2231
|
};
|
|
2232
2232
|
}
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function Is(t, r) {
|
|
2235
2235
|
t(
|
|
2236
2236
|
"fs-snapshot-browse",
|
|
2237
2237
|
{
|
|
2238
2238
|
title: "Browse Filesystem Snapshot",
|
|
2239
2239
|
description: "Browse and explore filesystem. Use this to efficiently browse, analyze, explore, inspect, etc directory and file structures",
|
|
2240
|
-
inputSchema:
|
|
2240
|
+
inputSchema: Rt.shape
|
|
2241
2241
|
},
|
|
2242
2242
|
async (s, o) => {
|
|
2243
|
-
const e = await
|
|
2243
|
+
const e = await xs(s, r, o);
|
|
2244
2244
|
if (e.error != null)
|
|
2245
2245
|
return `Method: fs-snapshot-browse(${JSON.stringify(s)})
|
|
2246
2246
|
❌ Error: ${e.error}`;
|
|
@@ -2262,7 +2262,7 @@ ${e.report}`, n;
|
|
|
2262
2262
|
}
|
|
2263
2263
|
);
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2265
|
+
function Dt(t) {
|
|
2266
2266
|
const r = [], s = t.tree, o = t.query.rootDir ?? ".";
|
|
2267
2267
|
function e(n) {
|
|
2268
2268
|
n.type === "file" && n.isMatched && r.push(o + "/" + n.path);
|
|
@@ -2274,14 +2274,14 @@ function Rt(t) {
|
|
|
2274
2274
|
return e(s.root), r;
|
|
2275
2275
|
}
|
|
2276
2276
|
const Ve = /* @__PURE__ */ new Map();
|
|
2277
|
-
function
|
|
2277
|
+
function $s(t) {
|
|
2278
2278
|
const r = H(t);
|
|
2279
2279
|
let s = Ve.get(r);
|
|
2280
|
-
return s == null && (s = new
|
|
2280
|
+
return s == null && (s = new nr(), Ve.set(r, s)), s;
|
|
2281
2281
|
}
|
|
2282
|
-
async function
|
|
2282
|
+
async function Ms(t) {
|
|
2283
2283
|
const { filePath: r, func: s } = t;
|
|
2284
|
-
return
|
|
2284
|
+
return $s(r).lock(
|
|
2285
2285
|
() => V({
|
|
2286
2286
|
pool: Se,
|
|
2287
2287
|
count: 1,
|
|
@@ -2289,8 +2289,8 @@ async function $s(t) {
|
|
|
2289
2289
|
})
|
|
2290
2290
|
);
|
|
2291
2291
|
}
|
|
2292
|
-
const Ze = 10, re = 48, Xe = 57, de = 36,
|
|
2293
|
-
function
|
|
2292
|
+
const Ze = 10, re = 48, Xe = 57, de = 36, Ts = 38, Cs = 39, vs = 60, Es = 62, Ns = 96, se = 0, et = 1, tt = 2, rt = 3, st = 4, ks = 5;
|
|
2293
|
+
function Os(t) {
|
|
2294
2294
|
const { content: r, pattern: s, replacement: o } = t, e = r.length, n = [0];
|
|
2295
2295
|
for (let b = 0; b < e; b++)
|
|
2296
2296
|
r.charCodeAt(b) === Ze && b + 1 < e && n.push(b + 1);
|
|
@@ -2298,13 +2298,13 @@ function Ns(t) {
|
|
|
2298
2298
|
let l = null, u = null, f = null, d = 0;
|
|
2299
2299
|
if (o != null) {
|
|
2300
2300
|
const b = o.length;
|
|
2301
|
-
let
|
|
2301
|
+
let I = !1;
|
|
2302
2302
|
for (let T = 0; T < b; T++)
|
|
2303
2303
|
if (o.charCodeAt(T) === de) {
|
|
2304
|
-
|
|
2304
|
+
I = !0;
|
|
2305
2305
|
break;
|
|
2306
2306
|
}
|
|
2307
|
-
if (
|
|
2307
|
+
if (I) {
|
|
2308
2308
|
u = [], f = [];
|
|
2309
2309
|
let T = 0, x = 0;
|
|
2310
2310
|
for (; x < b; ) {
|
|
@@ -2316,25 +2316,25 @@ function Ns(t) {
|
|
|
2316
2316
|
let v = -1, P = 0, O = 2;
|
|
2317
2317
|
if (S === de)
|
|
2318
2318
|
v = se, P = "$";
|
|
2319
|
-
else if (S ===
|
|
2319
|
+
else if (S === Ts)
|
|
2320
2320
|
v = et;
|
|
2321
|
-
else if (S ===
|
|
2321
|
+
else if (S === Ns)
|
|
2322
2322
|
v = tt;
|
|
2323
|
-
else if (S ===
|
|
2323
|
+
else if (S === Cs)
|
|
2324
2324
|
v = rt;
|
|
2325
2325
|
else if (S >= re && S <= Xe) {
|
|
2326
|
-
let
|
|
2327
|
-
for (;
|
|
2328
|
-
const C = o.charCodeAt(
|
|
2326
|
+
let $ = x + 2;
|
|
2327
|
+
for (; $ < b; ) {
|
|
2328
|
+
const C = o.charCodeAt($);
|
|
2329
2329
|
if (C < re || C > Xe) break;
|
|
2330
|
-
|
|
2330
|
+
$++;
|
|
2331
2331
|
}
|
|
2332
|
-
v = st, P = o.substring(x + 1,
|
|
2333
|
-
} else if (S ===
|
|
2334
|
-
let
|
|
2335
|
-
for (;
|
|
2336
|
-
|
|
2337
|
-
|
|
2332
|
+
v = st, P = o.substring(x + 1, $), O = $ - x;
|
|
2333
|
+
} else if (S === vs) {
|
|
2334
|
+
let $ = x + 2;
|
|
2335
|
+
for (; $ < b && o.charCodeAt($) !== Es; )
|
|
2336
|
+
$++;
|
|
2337
|
+
$ < b && $ > x + 2 && (v = ks, P = o.substring(x + 2, $), O = $ + 1 - x);
|
|
2338
2338
|
}
|
|
2339
2339
|
v >= 0 ? (x > T && (u.push(se), f.push(o.substring(T, x))), u.push(v), f.push(P), x += O, T = x) : x++;
|
|
2340
2340
|
}
|
|
@@ -2342,27 +2342,27 @@ function Ns(t) {
|
|
|
2342
2342
|
} else
|
|
2343
2343
|
l = o;
|
|
2344
2344
|
}
|
|
2345
|
-
let p = "",
|
|
2345
|
+
let p = "", h = 0, g = 0;
|
|
2346
2346
|
s.lastIndex = 0;
|
|
2347
2347
|
let y;
|
|
2348
2348
|
for (; (y = s.exec(r)) !== null; ) {
|
|
2349
|
-
const b = y.index,
|
|
2349
|
+
const b = y.index, I = y[0], T = I.length, x = b + T;
|
|
2350
2350
|
let S, v, P, O;
|
|
2351
2351
|
if (i === 1)
|
|
2352
2352
|
S = 0, v = 1, P = 0, O = e;
|
|
2353
2353
|
else {
|
|
2354
|
-
let
|
|
2355
|
-
for (;
|
|
2356
|
-
const N =
|
|
2357
|
-
n[N] <= b ?
|
|
2354
|
+
let $ = 0, C = i - 1;
|
|
2355
|
+
for (; $ < C; ) {
|
|
2356
|
+
const N = $ + C + 1 >> 1;
|
|
2357
|
+
n[N] <= b ? $ = N : C = N - 1;
|
|
2358
2358
|
}
|
|
2359
|
-
if (S =
|
|
2359
|
+
if (S = $, T > 0) {
|
|
2360
2360
|
const N = x - 1;
|
|
2361
|
-
for (C = i - 1;
|
|
2362
|
-
const R =
|
|
2363
|
-
n[R] <= N ?
|
|
2361
|
+
for (C = i - 1; $ < C; ) {
|
|
2362
|
+
const R = $ + C + 1 >> 1;
|
|
2363
|
+
n[R] <= N ? $ = R : C = R - 1;
|
|
2364
2364
|
}
|
|
2365
|
-
v =
|
|
2365
|
+
v = $ + 1;
|
|
2366
2366
|
} else
|
|
2367
2367
|
v = S + 1;
|
|
2368
2368
|
P = n[S], O = v < i ? n[v] : e;
|
|
@@ -2372,68 +2372,68 @@ function Ns(t) {
|
|
|
2372
2372
|
lines: [S, v],
|
|
2373
2373
|
linesOffset: [P, O]
|
|
2374
2374
|
}), o != null) {
|
|
2375
|
-
p += r.substring(
|
|
2376
|
-
let
|
|
2375
|
+
p += r.substring(h, b);
|
|
2376
|
+
let $;
|
|
2377
2377
|
if (l != null)
|
|
2378
|
-
|
|
2378
|
+
$ = l;
|
|
2379
2379
|
else {
|
|
2380
|
-
|
|
2380
|
+
$ = "";
|
|
2381
2381
|
const N = y.groups, R = y.length - 1;
|
|
2382
2382
|
for (let K = 0; K < d; K++) {
|
|
2383
2383
|
const q = u[K], L = f[K];
|
|
2384
2384
|
switch (q) {
|
|
2385
2385
|
case se:
|
|
2386
|
-
|
|
2386
|
+
$ += L;
|
|
2387
2387
|
break;
|
|
2388
2388
|
case et:
|
|
2389
|
-
|
|
2389
|
+
$ += I;
|
|
2390
2390
|
break;
|
|
2391
2391
|
case tt:
|
|
2392
|
-
|
|
2392
|
+
$ += r.substring(0, b);
|
|
2393
2393
|
break;
|
|
2394
2394
|
case rt:
|
|
2395
|
-
|
|
2395
|
+
$ += r.substring(x);
|
|
2396
2396
|
break;
|
|
2397
2397
|
case st: {
|
|
2398
2398
|
const B = L, z = B.length, A = B.charCodeAt(0) - re;
|
|
2399
2399
|
if (z >= 2) {
|
|
2400
2400
|
const _ = B.charCodeAt(1) - re, D = A * 10 + _;
|
|
2401
2401
|
if (D >= 1 && D <= R) {
|
|
2402
|
-
|
|
2402
|
+
$ += y[D] ?? "", z > 2 && ($ += B.substring(2));
|
|
2403
2403
|
break;
|
|
2404
2404
|
}
|
|
2405
2405
|
}
|
|
2406
|
-
A >= 1 && A <= R ? (
|
|
2406
|
+
A >= 1 && A <= R ? ($ += y[A] ?? "", z > 1 && ($ += B.substring(1))) : $ += "$" + B;
|
|
2407
2407
|
break;
|
|
2408
2408
|
}
|
|
2409
2409
|
default:
|
|
2410
|
-
N != null ?
|
|
2410
|
+
N != null ? $ += N[L] ?? "" : $ += "$<" + L + ">";
|
|
2411
2411
|
}
|
|
2412
2412
|
}
|
|
2413
2413
|
}
|
|
2414
|
-
p +=
|
|
2414
|
+
p += $;
|
|
2415
2415
|
const C = b + g;
|
|
2416
2416
|
c.push({
|
|
2417
|
-
offset: [C, C +
|
|
2417
|
+
offset: [C, C + $.length],
|
|
2418
2418
|
lines: [0, 0],
|
|
2419
2419
|
linesOffset: [0, 0]
|
|
2420
|
-
}), g +=
|
|
2420
|
+
}), g += $.length - T, h = x;
|
|
2421
2421
|
}
|
|
2422
2422
|
if (T === 0 && s.lastIndex++, !s.global)
|
|
2423
2423
|
break;
|
|
2424
2424
|
}
|
|
2425
2425
|
if (s.lastIndex = 0, o == null)
|
|
2426
2426
|
return { search: { content: r, matches: a }, replace: null };
|
|
2427
|
-
p += r.substring(
|
|
2427
|
+
p += r.substring(h);
|
|
2428
2428
|
const w = p.length, M = [0];
|
|
2429
2429
|
for (let b = 0; b < w; b++)
|
|
2430
2430
|
p.charCodeAt(b) === Ze && b + 1 < w && M.push(b + 1);
|
|
2431
2431
|
const E = M.length;
|
|
2432
|
-
for (let b = 0,
|
|
2432
|
+
for (let b = 0, I = c.length; b < I; b++) {
|
|
2433
2433
|
const T = c[b], x = T.offset[0], S = T.offset[1];
|
|
2434
|
-
let v, P, O,
|
|
2434
|
+
let v, P, O, $;
|
|
2435
2435
|
if (E === 1)
|
|
2436
|
-
v = 0, P = 1, O = 0,
|
|
2436
|
+
v = 0, P = 1, O = 0, $ = w;
|
|
2437
2437
|
else {
|
|
2438
2438
|
let C = 0, N = E - 1;
|
|
2439
2439
|
for (; C < N; ) {
|
|
@@ -2449,16 +2449,16 @@ function Ns(t) {
|
|
|
2449
2449
|
P = C + 1;
|
|
2450
2450
|
} else
|
|
2451
2451
|
P = v + 1;
|
|
2452
|
-
O = M[v],
|
|
2452
|
+
O = M[v], $ = P < E ? M[P] : w;
|
|
2453
2453
|
}
|
|
2454
|
-
T.lines[0] = v, T.lines[1] = P, T.linesOffset[0] = O, T.linesOffset[1] =
|
|
2454
|
+
T.lines[0] = v, T.lines[1] = P, T.linesOffset[0] = O, T.linesOffset[1] = $;
|
|
2455
2455
|
}
|
|
2456
2456
|
return {
|
|
2457
2457
|
search: { content: r, matches: a },
|
|
2458
2458
|
replace: { content: p, matches: c }
|
|
2459
2459
|
};
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2461
|
+
function Ft(t) {
|
|
2462
2462
|
if (t.length === 0)
|
|
2463
2463
|
return [];
|
|
2464
2464
|
const r = [...t].sort((i, a) => {
|
|
@@ -2497,35 +2497,35 @@ function oe(t, r, s, o) {
|
|
|
2497
2497
|
return { startLine: i, endLine: l, startLineOfs: a, endLineOfs: c + 1 };
|
|
2498
2498
|
return { startLine: i, endLine: l, startLineOfs: a, endLineOfs: r };
|
|
2499
2499
|
}
|
|
2500
|
-
function
|
|
2500
|
+
function Rs(t, r) {
|
|
2501
2501
|
if (t.replace == null && r.replace == null) {
|
|
2502
2502
|
const U = [...t.search.matches, ...r.search.matches];
|
|
2503
2503
|
return {
|
|
2504
|
-
search: { content: t.search.content, matches:
|
|
2504
|
+
search: { content: t.search.content, matches: Ft(U) },
|
|
2505
2505
|
replace: null
|
|
2506
2506
|
};
|
|
2507
2507
|
}
|
|
2508
|
-
const s = t.replace ?? t.search, o = r.replace ?? r.search, e = t.search.content, n = o.content, i = e.length, a = n.length, c = t.search.matches, l = s.matches, u = r.search.matches, f = o.matches, d = l.length, p = u.length,
|
|
2509
|
-
let y = 0, w = 0, M = 0, E = 0, b = 0,
|
|
2508
|
+
const s = t.replace ?? t.search, o = r.replace ?? r.search, e = t.search.content, n = o.content, i = e.length, a = n.length, c = t.search.matches, l = s.matches, u = r.search.matches, f = o.matches, d = l.length, p = u.length, h = [], g = [];
|
|
2509
|
+
let y = 0, w = 0, M = 0, E = 0, b = 0, I = 0, T = 0, x = 0, S = 0, v = 0, P = 0, O = 0, $ = 0, C = 0, N = 0, R = 0, K = 0, q = 0, L = 0, B = 0, z = 0, A = 0, _ = 0, D = 0;
|
|
2510
2510
|
for (; y < d || w < p; )
|
|
2511
|
-
if (y < d && (b = l[y].offset[0],
|
|
2512
|
-
K = b < T ? b : T, S =
|
|
2511
|
+
if (y < d && (b = l[y].offset[0], I = l[y].offset[1]), w < p && (T = u[w].offset[0], x = u[w].offset[1]), y < d && w < p && b < x && T < I) {
|
|
2512
|
+
K = b < T ? b : T, S = I > x ? I : x, P = y, O = w, y++, w++;
|
|
2513
2513
|
do {
|
|
2514
2514
|
for (v = S; y < d && l[y].offset[0] < S; )
|
|
2515
|
-
|
|
2515
|
+
I = l[y].offset[1], I > S && (S = I), y++;
|
|
2516
2516
|
for (; w < p && u[w].offset[0] < S; )
|
|
2517
2517
|
x = u[w].offset[1], x > S && (S = x), w++;
|
|
2518
2518
|
} while (S !== v);
|
|
2519
|
-
|
|
2519
|
+
$ = 1 / 0, C = -1 / 0, q = K, L = M;
|
|
2520
2520
|
for (let G = P; G < y; G++)
|
|
2521
|
-
B = c[G].offset[0], z = c[G].offset[1], A = l[G].offset[0], _ = l[G].offset[1], q < A && (D = q + L, D <
|
|
2522
|
-
q < S && (D = q + L, D <
|
|
2521
|
+
B = c[G].offset[0], z = c[G].offset[1], A = l[G].offset[0], _ = l[G].offset[1], q < A && (D = q + L, D < $ && ($ = D), D = A + L, D > C && (C = D)), B < $ && ($ = B), z > C && (C = z), L += z - B - _ + A, q = _;
|
|
2522
|
+
q < S && (D = q + L, D < $ && ($ = D), D = S + L, D > C && (C = D)), M = L, N = 1 / 0, R = -1 / 0, q = K, L = E;
|
|
2523
2523
|
for (let G = O; G < w; G++)
|
|
2524
2524
|
B = u[G].offset[0], z = u[G].offset[1], A = f[G].offset[0], _ = f[G].offset[1], q < B && (D = q + L, D < N && (N = D), D = B + L, D > R && (R = D)), A < N && (N = A), _ > R && (R = _), L += _ - A - z + B, q = z;
|
|
2525
2525
|
q < S && (D = q + L, D < N && (N = D), D = S + L, D > R && (R = D)), E = L;
|
|
2526
|
-
const U = oe(e, i,
|
|
2527
|
-
|
|
2528
|
-
offset: [
|
|
2526
|
+
const U = oe(e, i, $, C);
|
|
2527
|
+
h.push({
|
|
2528
|
+
offset: [$, C],
|
|
2529
2529
|
lines: [U.startLine, U.endLine],
|
|
2530
2530
|
linesOffset: [U.startLineOfs, U.endLineOfs]
|
|
2531
2531
|
});
|
|
@@ -2538,28 +2538,28 @@ function ks(t, r) {
|
|
|
2538
2538
|
} else if (w >= p || y < d && b <= T) {
|
|
2539
2539
|
B = c[y].offset[0], z = c[y].offset[1], A = l[y].offset[0], _ = l[y].offset[1], N = A + E, R = _ + E;
|
|
2540
2540
|
const U = oe(n, a, N, R);
|
|
2541
|
-
|
|
2541
|
+
h.push(c[y]), g.push({
|
|
2542
2542
|
offset: [N, R],
|
|
2543
2543
|
lines: [U.startLine, U.endLine],
|
|
2544
2544
|
linesOffset: [U.startLineOfs, U.endLineOfs]
|
|
2545
2545
|
}), M += z - B - _ + A, y++;
|
|
2546
2546
|
} else {
|
|
2547
|
-
B = u[w].offset[0], z = u[w].offset[1], A = f[w].offset[0], _ = f[w].offset[1],
|
|
2548
|
-
const U = oe(e, i,
|
|
2549
|
-
|
|
2550
|
-
offset: [
|
|
2547
|
+
B = u[w].offset[0], z = u[w].offset[1], A = f[w].offset[0], _ = f[w].offset[1], $ = B + M, C = z + M;
|
|
2548
|
+
const U = oe(e, i, $, C);
|
|
2549
|
+
h.push({
|
|
2550
|
+
offset: [$, C],
|
|
2551
2551
|
lines: [U.startLine, U.endLine],
|
|
2552
2552
|
linesOffset: [U.startLineOfs, U.endLineOfs]
|
|
2553
2553
|
}), g.push(f[w]), E += _ - A - z + B, w++;
|
|
2554
2554
|
}
|
|
2555
2555
|
return {
|
|
2556
|
-
search: { content: e, matches:
|
|
2556
|
+
search: { content: e, matches: h },
|
|
2557
2557
|
replace: { content: n, matches: g }
|
|
2558
2558
|
};
|
|
2559
2559
|
}
|
|
2560
|
-
async function
|
|
2560
|
+
async function Ds(t) {
|
|
2561
2561
|
const { filePath: r, operations: s, dryRun: o } = t;
|
|
2562
|
-
return s.length === 0 ? { filePath: r, result: null } :
|
|
2562
|
+
return s.length === 0 ? { filePath: r, result: null } : Ms({
|
|
2563
2563
|
filePath: r,
|
|
2564
2564
|
func: async () => {
|
|
2565
2565
|
let e;
|
|
@@ -2585,12 +2585,12 @@ async function Os(t) {
|
|
|
2585
2585
|
error: `Invalid RegExp pattern "${c.pattern}": ${d instanceof Error ? d.message : d + ""}`
|
|
2586
2586
|
};
|
|
2587
2587
|
}
|
|
2588
|
-
const u = n?.replace?.content ?? e, f =
|
|
2588
|
+
const u = n?.replace?.content ?? e, f = Os({
|
|
2589
2589
|
content: u,
|
|
2590
2590
|
pattern: l,
|
|
2591
2591
|
replacement: c.replacement
|
|
2592
2592
|
});
|
|
2593
|
-
c.replacement != null && (i = !0), n == null ? n = f : n =
|
|
2593
|
+
c.replacement != null && (i = !0), n == null ? n = f : n = Rs(n, f);
|
|
2594
2594
|
}
|
|
2595
2595
|
if (i && n?.replace != null && !o) {
|
|
2596
2596
|
const a = n.replace.content;
|
|
@@ -2609,7 +2609,7 @@ async function Os(t) {
|
|
|
2609
2609
|
}
|
|
2610
2610
|
});
|
|
2611
2611
|
}
|
|
2612
|
-
async function
|
|
2612
|
+
async function Ie(t) {
|
|
2613
2613
|
const { filePaths: r, operations: s, dryRun: o, dateModifiedMax: e } = t;
|
|
2614
2614
|
return { results: await Promise.all(
|
|
2615
2615
|
r.map(async (i) => {
|
|
@@ -2628,13 +2628,13 @@ async function $e(t) {
|
|
|
2628
2628
|
error: "Not replaced, try again"
|
|
2629
2629
|
};
|
|
2630
2630
|
}
|
|
2631
|
-
return
|
|
2631
|
+
return Ds({ filePath: i, operations: s, dryRun: o });
|
|
2632
2632
|
})
|
|
2633
2633
|
) };
|
|
2634
2634
|
}
|
|
2635
|
-
const
|
|
2636
|
-
function
|
|
2637
|
-
const { content: r, startLine: s } = t, o = t.padWidth ??
|
|
2635
|
+
const Fs = 6;
|
|
2636
|
+
function Ps(t) {
|
|
2637
|
+
const { content: r, startLine: s } = t, o = t.padWidth ?? Fs;
|
|
2638
2638
|
let e = "", n = 0, i = 0;
|
|
2639
2639
|
for (; n < r.length; ) {
|
|
2640
2640
|
const a = r.indexOf(`
|
|
@@ -2649,13 +2649,13 @@ function fe(t) {
|
|
|
2649
2649
|
const { content: r, matches: s, outputLimit: o } = t;
|
|
2650
2650
|
if (s.length === 0)
|
|
2651
2651
|
return { output: "", truncated: !1 };
|
|
2652
|
-
const e =
|
|
2652
|
+
const e = Ft(s);
|
|
2653
2653
|
let n = "", i = !1;
|
|
2654
2654
|
for (let a = 0; a < e.length; a++) {
|
|
2655
2655
|
const c = e[a], l = r.substring(
|
|
2656
2656
|
c.linesOffset[0],
|
|
2657
2657
|
c.linesOffset[1]
|
|
2658
|
-
), u =
|
|
2658
|
+
), u = Ps({
|
|
2659
2659
|
content: l,
|
|
2660
2660
|
startLine: c.lines[0]
|
|
2661
2661
|
}), f = a > 0 ? 2 : 0;
|
|
@@ -2669,15 +2669,15 @@ function fe(t) {
|
|
|
2669
2669
|
return { output: n, truncated: i };
|
|
2670
2670
|
}
|
|
2671
2671
|
const ot = "BEFORE", nt = "AFTER";
|
|
2672
|
-
function
|
|
2672
|
+
function Bs(t) {
|
|
2673
2673
|
const { result: r, outputLimit: s } = t;
|
|
2674
2674
|
if (r.replace == null) {
|
|
2675
|
-
const
|
|
2675
|
+
const h = fe({
|
|
2676
2676
|
content: r.search.content,
|
|
2677
2677
|
matches: r.search.matches,
|
|
2678
2678
|
outputLimit: s
|
|
2679
2679
|
});
|
|
2680
|
-
return { output:
|
|
2680
|
+
return { output: h.output, truncated: h.truncated };
|
|
2681
2681
|
}
|
|
2682
2682
|
const o = `<${ot}>
|
|
2683
2683
|
`, e = `</${ot}>
|
|
@@ -2697,7 +2697,7 @@ function Fs(t) {
|
|
|
2697
2697
|
});
|
|
2698
2698
|
return { output: o + u.output + e + n + d.output + i, truncated: u.truncated || d.truncated };
|
|
2699
2699
|
}
|
|
2700
|
-
function
|
|
2700
|
+
function $e(t) {
|
|
2701
2701
|
const { result: r, rootDir: s, errorsOnly: o } = t;
|
|
2702
2702
|
let e = "";
|
|
2703
2703
|
for (let n = 0; n < r.results.length; n++) {
|
|
@@ -2712,7 +2712,7 @@ function Ie(t) {
|
|
|
2712
2712
|
}
|
|
2713
2713
|
if (o || i.result == null || i.result.search.matches.length === 0)
|
|
2714
2714
|
continue;
|
|
2715
|
-
const l =
|
|
2715
|
+
const l = Bs({
|
|
2716
2716
|
result: i.result
|
|
2717
2717
|
});
|
|
2718
2718
|
l.output.length > 0 && (c > 0 && (e += `
|
|
@@ -2721,25 +2721,25 @@ function Ie(t) {
|
|
|
2721
2721
|
}
|
|
2722
2722
|
return e;
|
|
2723
2723
|
}
|
|
2724
|
-
const
|
|
2725
|
-
pattern:
|
|
2726
|
-
flags:
|
|
2727
|
-
}),
|
|
2728
|
-
snapshotName:
|
|
2724
|
+
const Ls = m.object({
|
|
2725
|
+
pattern: m.string().describe("JS RegExp pattern"),
|
|
2726
|
+
flags: m.string().default("gm").describe('JS RegExp flags. Default: "gm"')
|
|
2727
|
+
}), Pt = m.object({
|
|
2728
|
+
snapshotName: m.string().optional().describe("Name of previously created filesystem snapshot, to use"),
|
|
2729
2729
|
snapshot: ee.optional().describe(
|
|
2730
2730
|
"Filesystem snapshot creation options JSON to automatically create snapshot"
|
|
2731
2731
|
),
|
|
2732
|
-
bulkOperations:
|
|
2732
|
+
bulkOperations: m.array(Ls).describe(
|
|
2733
2733
|
"All search patterns to execute; include every pattern here; never split across multiple calls"
|
|
2734
2734
|
),
|
|
2735
|
-
outputLimit:
|
|
2735
|
+
outputLimit: m.number().int().min(0).max(J).default(Q).describe(
|
|
2736
2736
|
`Maximum output characters. Output exceeding this limit will be truncated. Maximum: ${J}. Default: ${Q}`
|
|
2737
2737
|
)
|
|
2738
2738
|
});
|
|
2739
|
-
async function
|
|
2739
|
+
async function As(t, r, s) {
|
|
2740
2740
|
let o;
|
|
2741
2741
|
try {
|
|
2742
|
-
o =
|
|
2742
|
+
o = Pt.parse(t);
|
|
2743
2743
|
} catch (w) {
|
|
2744
2744
|
return {
|
|
2745
2745
|
error: F(w)
|
|
@@ -2776,11 +2776,11 @@ async function Bs(t, r, s) {
|
|
|
2776
2776
|
return {
|
|
2777
2777
|
error: "Either snapshotName or snapshot must be provided"
|
|
2778
2778
|
};
|
|
2779
|
-
const d =
|
|
2779
|
+
const d = Dt(l), p = l.query.rootDir ?? ".", h = await Ie({
|
|
2780
2780
|
filePaths: d,
|
|
2781
2781
|
operations: i
|
|
2782
|
-
}), g =
|
|
2783
|
-
result:
|
|
2782
|
+
}), g = $e({
|
|
2783
|
+
result: h,
|
|
2784
2784
|
rootDir: p
|
|
2785
2785
|
});
|
|
2786
2786
|
return { output: we({
|
|
@@ -2789,16 +2789,16 @@ async function Bs(t, r, s) {
|
|
|
2789
2789
|
limit: a
|
|
2790
2790
|
}).content, rootDir: p, fsSnapshot: l, queryCreated: u, snapshotCreated: f };
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2792
|
+
function zs(t, r) {
|
|
2793
2793
|
t(
|
|
2794
2794
|
"fs-snapshot-search",
|
|
2795
2795
|
{
|
|
2796
2796
|
title: "Search File Contents in Snapshot",
|
|
2797
2797
|
description: "Search file contents using JS RegExp. Use this to find text patterns across snapshot files. Put all search patterns in the bulkOperations array; use one snapshot with rootDir covering all target files; never split into multiple calls based on file locations, directories, or pattern groups",
|
|
2798
|
-
inputSchema:
|
|
2798
|
+
inputSchema: Pt.shape
|
|
2799
2799
|
},
|
|
2800
2800
|
async (s, o) => {
|
|
2801
|
-
const e = await
|
|
2801
|
+
const e = await As(
|
|
2802
2802
|
s,
|
|
2803
2803
|
r,
|
|
2804
2804
|
o
|
|
@@ -2819,26 +2819,26 @@ Reminder: use one snapshot covering all target files; include all patterns in th
|
|
|
2819
2819
|
}
|
|
2820
2820
|
);
|
|
2821
2821
|
}
|
|
2822
|
-
const
|
|
2823
|
-
pattern:
|
|
2824
|
-
flags:
|
|
2825
|
-
replacement:
|
|
2826
|
-
}),
|
|
2827
|
-
snapshotName:
|
|
2822
|
+
const Us = m.object({
|
|
2823
|
+
pattern: m.string().describe("JS RegExp pattern"),
|
|
2824
|
+
flags: m.string().default("gm").describe('JS RegExp flags. Default: "gm"'),
|
|
2825
|
+
replacement: m.string().describe("JS replacement pattern")
|
|
2826
|
+
}), Bt = m.object({
|
|
2827
|
+
snapshotName: m.string().optional().describe("Name of previously created filesystem snapshot, to use"),
|
|
2828
2828
|
snapshot: ee.optional().describe(
|
|
2829
2829
|
"Filesystem snapshot creation options JSON to automatically create snapshot"
|
|
2830
2830
|
),
|
|
2831
|
-
bulkOperations:
|
|
2831
|
+
bulkOperations: m.array(Us).describe(
|
|
2832
2832
|
"All replace patterns to execute; include every pattern here; never split across multiple calls"
|
|
2833
2833
|
),
|
|
2834
|
-
outputLimit:
|
|
2834
|
+
outputLimit: m.number().int().min(0).max(J).default(Q).describe(
|
|
2835
2835
|
`Maximum output characters. Output exceeding this limit will be truncated. Maximum: ${J}. Default: ${Q}`
|
|
2836
2836
|
)
|
|
2837
2837
|
});
|
|
2838
|
-
async function
|
|
2838
|
+
async function js(t, r, s) {
|
|
2839
2839
|
let o;
|
|
2840
2840
|
try {
|
|
2841
|
-
o =
|
|
2841
|
+
o = Bt.parse(t);
|
|
2842
2842
|
} catch (b) {
|
|
2843
2843
|
return {
|
|
2844
2844
|
error: F(b)
|
|
@@ -2875,20 +2875,20 @@ async function zs(t, r, s) {
|
|
|
2875
2875
|
return {
|
|
2876
2876
|
error: "Either snapshotName or snapshot must be provided"
|
|
2877
2877
|
};
|
|
2878
|
-
const d =
|
|
2878
|
+
const d = Dt(l), p = l.query.rootDir ?? ".", h = {
|
|
2879
2879
|
filePaths: d,
|
|
2880
2880
|
operations: i
|
|
2881
|
-
}, g = Date.now(), y = await
|
|
2882
|
-
...
|
|
2881
|
+
}, g = Date.now(), y = await Ie({
|
|
2882
|
+
...h,
|
|
2883
2883
|
dryRun: !0
|
|
2884
|
-
}), w =
|
|
2884
|
+
}), w = as();
|
|
2885
2885
|
c.preparedReplace = {
|
|
2886
2886
|
id: w,
|
|
2887
|
-
options:
|
|
2887
|
+
options: h,
|
|
2888
2888
|
rootDir: p,
|
|
2889
2889
|
dateCreated: g
|
|
2890
2890
|
};
|
|
2891
|
-
const M =
|
|
2891
|
+
const M = $e({
|
|
2892
2892
|
result: y,
|
|
2893
2893
|
rootDir: p
|
|
2894
2894
|
}) + `
|
|
@@ -2900,16 +2900,16 @@ Review the output carefully before executing. Call fs-snapshot-replace-execute w
|
|
|
2900
2900
|
limit: a
|
|
2901
2901
|
}).content, rootDir: p, fsSnapshot: l, queryCreated: u, snapshotCreated: f };
|
|
2902
2902
|
}
|
|
2903
|
-
function
|
|
2903
|
+
function qs(t, r) {
|
|
2904
2904
|
t(
|
|
2905
2905
|
"fs-snapshot-replace-prepare",
|
|
2906
2906
|
{
|
|
2907
2907
|
title: "Prepare File Content Replacement",
|
|
2908
2908
|
description: "Prepares text replacement in files using JS RegExp. Use this to perform bulk replacements across snapshot files. Put all replace patterns in the bulkOperations array; use one snapshot with rootDir covering all target files; never split into multiple calls based on file locations, directories, or pattern groups. Read and review full output to the end. If all replacements are valid get replaceId from the end of output and call fs-snapshot-replace-execute to apply it.",
|
|
2909
|
-
inputSchema:
|
|
2909
|
+
inputSchema: Bt.shape
|
|
2910
2910
|
},
|
|
2911
2911
|
async (s, o) => {
|
|
2912
|
-
const e = await
|
|
2912
|
+
const e = await js(
|
|
2913
2913
|
s,
|
|
2914
2914
|
r,
|
|
2915
2915
|
o
|
|
@@ -2930,13 +2930,13 @@ Reminder: use one snapshot covering all target files; include all patterns in th
|
|
|
2930
2930
|
}
|
|
2931
2931
|
);
|
|
2932
2932
|
}
|
|
2933
|
-
const
|
|
2934
|
-
replaceId:
|
|
2933
|
+
const Lt = m.object({
|
|
2934
|
+
replaceId: m.string().describe("Replace ID from the END of fs-snapshot-replace-prepare output. NEVER fabricate or guess this value.")
|
|
2935
2935
|
});
|
|
2936
|
-
async function
|
|
2936
|
+
async function _s(t, r, s) {
|
|
2937
2937
|
let o;
|
|
2938
2938
|
try {
|
|
2939
|
-
o =
|
|
2939
|
+
o = Lt.parse(t);
|
|
2940
2940
|
} catch (l) {
|
|
2941
2941
|
return {
|
|
2942
2942
|
error: F(l)
|
|
@@ -2956,26 +2956,26 @@ async function js(t, r, s) {
|
|
|
2956
2956
|
return {
|
|
2957
2957
|
error: `Invalid replaceId "${e}". The replaceId is located at the END of fs-snapshot-replace-prepare output. Read the ENTIRE output to find it. NEVER fabricate or guess this value.`
|
|
2958
2958
|
};
|
|
2959
|
-
const a = await
|
|
2959
|
+
const a = await Ie({
|
|
2960
2960
|
...i.options,
|
|
2961
2961
|
dateModifiedMax: i.dateCreated
|
|
2962
2962
|
});
|
|
2963
|
-
return n.preparedReplace = null, { output:
|
|
2963
|
+
return n.preparedReplace = null, { output: $e({
|
|
2964
2964
|
result: a,
|
|
2965
2965
|
rootDir: i.rootDir,
|
|
2966
2966
|
errorsOnly: !0
|
|
2967
2967
|
}) || null };
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function Gs(t, r) {
|
|
2970
2970
|
t(
|
|
2971
2971
|
"fs-snapshot-replace-execute",
|
|
2972
2972
|
{
|
|
2973
2973
|
title: "Execute Prepared Replacement",
|
|
2974
2974
|
description: "Executes prepared replacement. Requires replaceId from the end of fs-snapshot-replace-prepare output.",
|
|
2975
|
-
inputSchema:
|
|
2975
|
+
inputSchema: Lt.shape
|
|
2976
2976
|
},
|
|
2977
2977
|
async (s, o) => {
|
|
2978
|
-
const e = await
|
|
2978
|
+
const e = await _s(
|
|
2979
2979
|
s,
|
|
2980
2980
|
r,
|
|
2981
2981
|
o
|
|
@@ -2990,8 +2990,8 @@ ${e.output}`), n;
|
|
|
2990
2990
|
}
|
|
2991
2991
|
);
|
|
2992
2992
|
}
|
|
2993
|
-
function
|
|
2994
|
-
r.list &&
|
|
2993
|
+
function Js(t, r) {
|
|
2994
|
+
r.list && ns(t, r), r.snapshotQueryCreate && cs(t, r), r.snapshotCreate && ws(t, r), r.snapshotBrowse && Is(t, r), r.snapshotSearch && zs(t, r), r.snapshotReplace && (qs(t, r), Gs(t, r)), console.log(
|
|
2995
2995
|
`File manager:
|
|
2996
2996
|
- Working directory: ${k.resolve(r.workingDir || "")}
|
|
2997
2997
|
`
|
|
@@ -3004,15 +3004,15 @@ function W(t) {
|
|
|
3004
3004
|
domSnapshotQueries: /* @__PURE__ */ new Map()
|
|
3005
3005
|
}), pe.get(t);
|
|
3006
3006
|
}
|
|
3007
|
-
const Me =
|
|
3008
|
-
name:
|
|
3007
|
+
const Me = m.object({
|
|
3008
|
+
name: m.string().describe(
|
|
3009
3009
|
"Unique name for the browser. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
3010
3010
|
),
|
|
3011
|
-
browserType:
|
|
3012
|
-
muteAudio:
|
|
3013
|
-
devTools:
|
|
3011
|
+
browserType: m.enum(["chromium", "firefox", "webkit"]).describe("Browser type to launch"),
|
|
3012
|
+
muteAudio: m.boolean().optional().describe("Mute audio in the browser"),
|
|
3013
|
+
devTools: m.boolean().optional().describe("Open browser with dev tools")
|
|
3014
3014
|
});
|
|
3015
|
-
async function
|
|
3015
|
+
async function At(t, r, s) {
|
|
3016
3016
|
let o;
|
|
3017
3017
|
try {
|
|
3018
3018
|
o = Me.parse(t);
|
|
@@ -3029,9 +3029,9 @@ async function Lt(t, r, s) {
|
|
|
3029
3029
|
const c = W(s.sessionId);
|
|
3030
3030
|
try {
|
|
3031
3031
|
const u = await {
|
|
3032
|
-
chromium:
|
|
3033
|
-
firefox:
|
|
3034
|
-
webkit:
|
|
3032
|
+
chromium: ur,
|
|
3033
|
+
firefox: cr,
|
|
3034
|
+
webkit: lr
|
|
3035
3035
|
}[n].launch({
|
|
3036
3036
|
headless: !1,
|
|
3037
3037
|
devtools: a,
|
|
@@ -3049,7 +3049,7 @@ async function Lt(t, r, s) {
|
|
|
3049
3049
|
};
|
|
3050
3050
|
}
|
|
3051
3051
|
}
|
|
3052
|
-
function
|
|
3052
|
+
function Ws(t, r) {
|
|
3053
3053
|
t(
|
|
3054
3054
|
"playwright-browser-create",
|
|
3055
3055
|
{
|
|
@@ -3058,17 +3058,17 @@ function Gs(t, r) {
|
|
|
3058
3058
|
inputSchema: Me.shape
|
|
3059
3059
|
},
|
|
3060
3060
|
async (s, o) => {
|
|
3061
|
-
const e = await
|
|
3061
|
+
const e = await At(s, r, o);
|
|
3062
3062
|
return `Method: playwright-browser-create(${JSON.stringify(s)})
|
|
3063
3063
|
${e.error != null ? `❌ Error: ${e.error}` : `✅ Browser "${e.browserInfo.name}" (${e.browserInfo.browserType}) created successfully`}`;
|
|
3064
3064
|
}
|
|
3065
3065
|
);
|
|
3066
3066
|
}
|
|
3067
|
-
const
|
|
3068
|
-
async function
|
|
3067
|
+
const zt = m.object({});
|
|
3068
|
+
async function Ks(t, r, s) {
|
|
3069
3069
|
let o;
|
|
3070
3070
|
try {
|
|
3071
|
-
o =
|
|
3071
|
+
o = zt.parse(t);
|
|
3072
3072
|
} catch (i) {
|
|
3073
3073
|
return {
|
|
3074
3074
|
error: F(i)
|
|
@@ -3083,16 +3083,16 @@ async function Js(t, r, s) {
|
|
|
3083
3083
|
browserInfos: Array.from(e.browsers.values())
|
|
3084
3084
|
};
|
|
3085
3085
|
}
|
|
3086
|
-
function
|
|
3086
|
+
function Hs(t, r) {
|
|
3087
3087
|
t(
|
|
3088
3088
|
"playwright-browser-list",
|
|
3089
3089
|
{
|
|
3090
3090
|
title: "List Browsers",
|
|
3091
3091
|
description: "List active browser instances",
|
|
3092
|
-
inputSchema:
|
|
3092
|
+
inputSchema: zt.shape
|
|
3093
3093
|
},
|
|
3094
3094
|
async (s, o) => {
|
|
3095
|
-
const e = await
|
|
3095
|
+
const e = await Ks(s, r, o);
|
|
3096
3096
|
if (e.error != null)
|
|
3097
3097
|
return `Method: playwright-browser-list(${JSON.stringify(s)})
|
|
3098
3098
|
❌ Error: ${e.error}`;
|
|
@@ -3104,15 +3104,15 @@ ${n.length === 0 ? "No browsers found" : `Browsers: ${n.join(", ")}`}`;
|
|
|
3104
3104
|
}
|
|
3105
3105
|
);
|
|
3106
3106
|
}
|
|
3107
|
-
const
|
|
3108
|
-
names:
|
|
3107
|
+
const Ut = m.object({
|
|
3108
|
+
names: m.array(m.string()).optional().describe(
|
|
3109
3109
|
"Names of browsers to close. If not specified, closes all browsers"
|
|
3110
3110
|
)
|
|
3111
3111
|
});
|
|
3112
|
-
async function
|
|
3112
|
+
async function Qs(t, r, s) {
|
|
3113
3113
|
let o;
|
|
3114
3114
|
try {
|
|
3115
|
-
o =
|
|
3115
|
+
o = Ut.parse(t);
|
|
3116
3116
|
} catch (l) {
|
|
3117
3117
|
return {
|
|
3118
3118
|
error: F(l)
|
|
@@ -3143,16 +3143,16 @@ async function Ks(t, r, s) {
|
|
|
3143
3143
|
...a.length > 0 && { errors: a }
|
|
3144
3144
|
};
|
|
3145
3145
|
}
|
|
3146
|
-
function
|
|
3146
|
+
function Ys(t, r) {
|
|
3147
3147
|
t(
|
|
3148
3148
|
"playwright-browser-close",
|
|
3149
3149
|
{
|
|
3150
3150
|
title: "Close Browsers",
|
|
3151
3151
|
description: "Close browsers. Automatically closes all contexts and pages within the browsers",
|
|
3152
|
-
inputSchema:
|
|
3152
|
+
inputSchema: Ut.shape
|
|
3153
3153
|
},
|
|
3154
3154
|
async (s, o) => {
|
|
3155
|
-
const e = await
|
|
3155
|
+
const e = await Qs(s, r, o);
|
|
3156
3156
|
if (e.error != null)
|
|
3157
3157
|
return `Method: playwright-browser-close(${JSON.stringify(s)})
|
|
3158
3158
|
❌ Error: ${e.error}`;
|
|
@@ -3169,22 +3169,22 @@ ${n.join(`
|
|
|
3169
3169
|
}
|
|
3170
3170
|
);
|
|
3171
3171
|
}
|
|
3172
|
-
const Te =
|
|
3173
|
-
browserName:
|
|
3172
|
+
const Te = m.object({
|
|
3173
|
+
browserName: m.string().optional().describe("Name of previously created browser, to use"),
|
|
3174
3174
|
browser: Me.optional().describe(
|
|
3175
3175
|
"Browser creation options JSON to automatically create browser"
|
|
3176
3176
|
),
|
|
3177
|
-
name:
|
|
3177
|
+
name: m.string().describe(
|
|
3178
3178
|
"Unique name for the context. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
3179
3179
|
),
|
|
3180
|
-
isMobile:
|
|
3181
|
-
hasTouch:
|
|
3182
|
-
viewport:
|
|
3183
|
-
width:
|
|
3184
|
-
height:
|
|
3180
|
+
isMobile: m.boolean().optional().describe("Configure for mobile device simulation"),
|
|
3181
|
+
hasTouch: m.boolean().optional().describe("Enable touch events"),
|
|
3182
|
+
viewport: m.object({
|
|
3183
|
+
width: m.number(),
|
|
3184
|
+
height: m.number()
|
|
3185
3185
|
}).optional().describe("Viewport size configuration")
|
|
3186
3186
|
});
|
|
3187
|
-
async function
|
|
3187
|
+
async function jt(t, r, s) {
|
|
3188
3188
|
let o;
|
|
3189
3189
|
try {
|
|
3190
3190
|
o = Te.parse(t);
|
|
@@ -3210,7 +3210,7 @@ async function Ut(t, r, s) {
|
|
|
3210
3210
|
error: `Browser "${n}" not found`
|
|
3211
3211
|
};
|
|
3212
3212
|
} else if (i) {
|
|
3213
|
-
const p = await
|
|
3213
|
+
const p = await At(i, r, s);
|
|
3214
3214
|
if (p.error != null)
|
|
3215
3215
|
return {
|
|
3216
3216
|
error: p.error
|
|
@@ -3225,16 +3225,16 @@ async function Ut(t, r, s) {
|
|
|
3225
3225
|
isMobile: a,
|
|
3226
3226
|
hasTouch: c,
|
|
3227
3227
|
viewport: l
|
|
3228
|
-
}),
|
|
3228
|
+
}), h = {
|
|
3229
3229
|
browserInfo: d,
|
|
3230
3230
|
name: e,
|
|
3231
3231
|
context: p,
|
|
3232
3232
|
pages: /* @__PURE__ */ new Map()
|
|
3233
3233
|
};
|
|
3234
|
-
return d.contexts.set(e,
|
|
3234
|
+
return d.contexts.set(e, h), {
|
|
3235
3235
|
browserInfoCreated: f,
|
|
3236
3236
|
browserInfo: d,
|
|
3237
|
-
contextInfo:
|
|
3237
|
+
contextInfo: h
|
|
3238
3238
|
};
|
|
3239
3239
|
} catch (p) {
|
|
3240
3240
|
return {
|
|
@@ -3242,7 +3242,7 @@ async function Ut(t, r, s) {
|
|
|
3242
3242
|
};
|
|
3243
3243
|
}
|
|
3244
3244
|
}
|
|
3245
|
-
function
|
|
3245
|
+
function Vs(t, r) {
|
|
3246
3246
|
t(
|
|
3247
3247
|
"playwright-context-create",
|
|
3248
3248
|
{
|
|
@@ -3251,7 +3251,7 @@ function Qs(t, r) {
|
|
|
3251
3251
|
inputSchema: Te.shape
|
|
3252
3252
|
},
|
|
3253
3253
|
async (s, o) => {
|
|
3254
|
-
const e = await
|
|
3254
|
+
const e = await jt(s, r, o);
|
|
3255
3255
|
if (e.error != null)
|
|
3256
3256
|
return `Method: playwright-context-create(${JSON.stringify(s)})
|
|
3257
3257
|
❌ Error: ${e.error}`;
|
|
@@ -3262,15 +3262,15 @@ function Qs(t, r) {
|
|
|
3262
3262
|
}
|
|
3263
3263
|
);
|
|
3264
3264
|
}
|
|
3265
|
-
const
|
|
3266
|
-
browserName:
|
|
3265
|
+
const qt = m.object({
|
|
3266
|
+
browserName: m.string().optional().describe(
|
|
3267
3267
|
"Name of browser to list contexts from. If not specified, lists contexts from all browsers"
|
|
3268
3268
|
)
|
|
3269
3269
|
});
|
|
3270
|
-
async function
|
|
3270
|
+
async function Zs(t, r, s) {
|
|
3271
3271
|
let o;
|
|
3272
3272
|
try {
|
|
3273
|
-
o =
|
|
3273
|
+
o = qt.parse(t);
|
|
3274
3274
|
} catch (a) {
|
|
3275
3275
|
return {
|
|
3276
3276
|
error: F(a)
|
|
@@ -3304,16 +3304,16 @@ async function Ys(t, r, s) {
|
|
|
3304
3304
|
contextsByBrowser: i
|
|
3305
3305
|
};
|
|
3306
3306
|
}
|
|
3307
|
-
function
|
|
3307
|
+
function Xs(t, r) {
|
|
3308
3308
|
t(
|
|
3309
3309
|
"playwright-context-list",
|
|
3310
3310
|
{
|
|
3311
3311
|
title: "List Browser Contexts",
|
|
3312
3312
|
description: "List active browser contexts",
|
|
3313
|
-
inputSchema:
|
|
3313
|
+
inputSchema: qt.shape
|
|
3314
3314
|
},
|
|
3315
3315
|
async (s, o) => {
|
|
3316
|
-
const e = await
|
|
3316
|
+
const e = await Zs(s, r, o);
|
|
3317
3317
|
if ("error" in e)
|
|
3318
3318
|
return `Method: playwright-context-list(${JSON.stringify(s)})
|
|
3319
3319
|
❌ Error: ${e.error}`;
|
|
@@ -3326,18 +3326,18 @@ function Vs(t, r) {
|
|
|
3326
3326
|
}
|
|
3327
3327
|
);
|
|
3328
3328
|
}
|
|
3329
|
-
const
|
|
3330
|
-
names:
|
|
3329
|
+
const _t = m.object({
|
|
3330
|
+
names: m.array(m.string()).optional().describe(
|
|
3331
3331
|
"Names of contexts to close. If not specified, closes all contexts"
|
|
3332
3332
|
),
|
|
3333
|
-
browserName:
|
|
3333
|
+
browserName: m.string().optional().describe(
|
|
3334
3334
|
"Name of browser to close contexts from. If not specified, searches all browsers"
|
|
3335
3335
|
)
|
|
3336
3336
|
});
|
|
3337
|
-
async function
|
|
3337
|
+
async function eo(t, r, s) {
|
|
3338
3338
|
let o;
|
|
3339
3339
|
try {
|
|
3340
|
-
o =
|
|
3340
|
+
o = _t.parse(t);
|
|
3341
3341
|
} catch (u) {
|
|
3342
3342
|
return {
|
|
3343
3343
|
error: F(u)
|
|
@@ -3388,16 +3388,16 @@ async function Zs(t, r, s) {
|
|
|
3388
3388
|
...c.length > 0 && { errors: c }
|
|
3389
3389
|
};
|
|
3390
3390
|
}
|
|
3391
|
-
function
|
|
3391
|
+
function to(t, r) {
|
|
3392
3392
|
t(
|
|
3393
3393
|
"playwright-context-close",
|
|
3394
3394
|
{
|
|
3395
3395
|
title: "Close Browser Contexts",
|
|
3396
3396
|
description: "Close browser contexts. Automatically closes all pages within the contexts",
|
|
3397
|
-
inputSchema:
|
|
3397
|
+
inputSchema: _t.shape
|
|
3398
3398
|
},
|
|
3399
3399
|
async (s, o) => {
|
|
3400
|
-
const e = await
|
|
3400
|
+
const e = await eo(s, r, o);
|
|
3401
3401
|
if ("error" in e)
|
|
3402
3402
|
return `Method: playwright-context-close(${JSON.stringify(s)})
|
|
3403
3403
|
❌ Error: ${e.error}`;
|
|
@@ -3414,7 +3414,7 @@ ${n.join(`
|
|
|
3414
3414
|
}
|
|
3415
3415
|
);
|
|
3416
3416
|
}
|
|
3417
|
-
function
|
|
3417
|
+
function ro() {
|
|
3418
3418
|
class t {
|
|
3419
3419
|
prevId = 0;
|
|
3420
3420
|
objectToId = /* @__PURE__ */ new WeakMap();
|
|
@@ -3440,13 +3440,13 @@ function eo() {
|
|
|
3440
3440
|
function r(a, c, l) {
|
|
3441
3441
|
let u = null;
|
|
3442
3442
|
for (let f = 0, d = c.length; f < d; f++) {
|
|
3443
|
-
const p = c[f],
|
|
3443
|
+
const p = c[f], h = a(p), g = h == null ? null : r(a, h, l), y = l(p, g);
|
|
3444
3444
|
y != null && (u == null && (u = []), u.push(y));
|
|
3445
3445
|
}
|
|
3446
3446
|
return u;
|
|
3447
3447
|
}
|
|
3448
3448
|
function s(a) {
|
|
3449
|
-
const { getId: c, getChilds: l, rootNodes: u, createSnapshotNode: f } = a, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(),
|
|
3449
|
+
const { getId: c, getChilds: l, rootNodes: u, createSnapshotNode: f } = a, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), g = r(
|
|
3450
3450
|
l,
|
|
3451
3451
|
u,
|
|
3452
3452
|
(w, M) => {
|
|
@@ -3455,7 +3455,7 @@ function eo() {
|
|
|
3455
3455
|
const b = c(w);
|
|
3456
3456
|
d.set(b, E), p.set(E, b);
|
|
3457
3457
|
}
|
|
3458
|
-
return E != null && M != null &&
|
|
3458
|
+
return E != null && M != null && h.set(
|
|
3459
3459
|
p.get(E),
|
|
3460
3460
|
M.map((b) => p.get(b))
|
|
3461
3461
|
), E;
|
|
@@ -3463,29 +3463,29 @@ function eo() {
|
|
|
3463
3463
|
), y = f(null, g);
|
|
3464
3464
|
if (y == null)
|
|
3465
3465
|
throw new Error("Impossible behavior: rootNode == null");
|
|
3466
|
-
return d.set(null, y), g != null &&
|
|
3466
|
+
return d.set(null, y), g != null && h.set(
|
|
3467
3467
|
null,
|
|
3468
3468
|
g.map((w) => p.get(w))
|
|
3469
3469
|
), {
|
|
3470
3470
|
idToNode: d,
|
|
3471
|
-
idToChildIds:
|
|
3471
|
+
idToChildIds: h
|
|
3472
3472
|
};
|
|
3473
3473
|
}
|
|
3474
3474
|
const o = (a) => a instanceof HTMLElement ? a.childNodes : null;
|
|
3475
3475
|
function e(a) {
|
|
3476
3476
|
return function(l, u) {
|
|
3477
3477
|
const f = u != null && u.length > 0;
|
|
3478
|
-
let d = !1, p = null,
|
|
3478
|
+
let d = !1, p = null, h = null;
|
|
3479
3479
|
if (l instanceof HTMLElement) {
|
|
3480
|
-
if (p = n.getOrCreateId(l),
|
|
3480
|
+
if (p = n.getOrCreateId(l), h = l.tagName.toLowerCase(), d = l.matches(a.cssSelector), !d && !f)
|
|
3481
3481
|
return null;
|
|
3482
3482
|
} else if (l == null)
|
|
3483
|
-
p = null,
|
|
3483
|
+
p = null, h = null, d = !1;
|
|
3484
3484
|
else
|
|
3485
3485
|
return null;
|
|
3486
3486
|
return {
|
|
3487
3487
|
uid: p,
|
|
3488
|
-
tagName:
|
|
3488
|
+
tagName: h,
|
|
3489
3489
|
isMatched: d
|
|
3490
3490
|
};
|
|
3491
3491
|
};
|
|
@@ -3502,16 +3502,16 @@ function eo() {
|
|
|
3502
3502
|
}
|
|
3503
3503
|
window.__mcp_playwright_tool_tx4byhar35_createDomSnapshotTreeRawDom = i;
|
|
3504
3504
|
}
|
|
3505
|
-
const
|
|
3506
|
-
contextName:
|
|
3505
|
+
const so = `(function (){function __name(fn){return fn};${ro.toString()}; setupPageGlobals();})()`, Ce = m.object({
|
|
3506
|
+
contextName: m.string().optional().describe("Name of previously created context, to use"),
|
|
3507
3507
|
context: Te.optional().describe(
|
|
3508
3508
|
"Context creation options JSON to automatically create context"
|
|
3509
3509
|
),
|
|
3510
|
-
name:
|
|
3510
|
+
name: m.string().describe(
|
|
3511
3511
|
"Unique name for the page. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
3512
3512
|
)
|
|
3513
3513
|
});
|
|
3514
|
-
async function
|
|
3514
|
+
async function Gt(t, r, s) {
|
|
3515
3515
|
let o;
|
|
3516
3516
|
try {
|
|
3517
3517
|
o = Ce.parse(t);
|
|
@@ -3542,7 +3542,7 @@ async function _t(t, r, s) {
|
|
|
3542
3542
|
error: `Context "${n}" not found`
|
|
3543
3543
|
};
|
|
3544
3544
|
} else if (i) {
|
|
3545
|
-
const f = await
|
|
3545
|
+
const f = await jt(i, r, s);
|
|
3546
3546
|
if (f.error != null)
|
|
3547
3547
|
return {
|
|
3548
3548
|
error: f.error
|
|
@@ -3554,7 +3554,7 @@ async function _t(t, r, s) {
|
|
|
3554
3554
|
};
|
|
3555
3555
|
try {
|
|
3556
3556
|
const f = await u.context.newPage();
|
|
3557
|
-
await f.addInitScript(
|
|
3557
|
+
await f.addInitScript(so), await f.goto("about:blank");
|
|
3558
3558
|
const d = {
|
|
3559
3559
|
contextInfo: u,
|
|
3560
3560
|
name: e,
|
|
@@ -3572,7 +3572,7 @@ async function _t(t, r, s) {
|
|
|
3572
3572
|
};
|
|
3573
3573
|
}
|
|
3574
3574
|
}
|
|
3575
|
-
function
|
|
3575
|
+
function oo(t, r) {
|
|
3576
3576
|
t(
|
|
3577
3577
|
"playwright-page-create",
|
|
3578
3578
|
{
|
|
@@ -3581,7 +3581,7 @@ function ro(t, r) {
|
|
|
3581
3581
|
inputSchema: Ce.shape
|
|
3582
3582
|
},
|
|
3583
3583
|
async (s, o) => {
|
|
3584
|
-
const e = await
|
|
3584
|
+
const e = await Gt(s, r, o);
|
|
3585
3585
|
if (e.error != null)
|
|
3586
3586
|
return `Method: playwright-page-create(${JSON.stringify(s)})
|
|
3587
3587
|
❌ Error: ${e.error}`;
|
|
@@ -3593,18 +3593,18 @@ function ro(t, r) {
|
|
|
3593
3593
|
}
|
|
3594
3594
|
);
|
|
3595
3595
|
}
|
|
3596
|
-
const
|
|
3597
|
-
contextName:
|
|
3596
|
+
const Jt = m.object({
|
|
3597
|
+
contextName: m.string().optional().describe(
|
|
3598
3598
|
"Name of context to list pages from. If not specified, lists pages from all contexts"
|
|
3599
3599
|
),
|
|
3600
|
-
browserName:
|
|
3600
|
+
browserName: m.string().optional().describe(
|
|
3601
3601
|
"Name of browser to search in. If not specified, searches all browsers"
|
|
3602
3602
|
)
|
|
3603
3603
|
});
|
|
3604
|
-
async function
|
|
3604
|
+
async function no(t, r, s) {
|
|
3605
3605
|
let o;
|
|
3606
3606
|
try {
|
|
3607
|
-
o =
|
|
3607
|
+
o = Jt.parse(t);
|
|
3608
3608
|
} catch (c) {
|
|
3609
3609
|
return {
|
|
3610
3610
|
error: F(c)
|
|
@@ -3665,16 +3665,16 @@ async function so(t, r, s) {
|
|
|
3665
3665
|
pagesByContext: a
|
|
3666
3666
|
};
|
|
3667
3667
|
}
|
|
3668
|
-
function
|
|
3668
|
+
function io(t, r) {
|
|
3669
3669
|
t(
|
|
3670
3670
|
"playwright-page-list",
|
|
3671
3671
|
{
|
|
3672
3672
|
title: "List Pages",
|
|
3673
3673
|
description: "List active pages",
|
|
3674
|
-
inputSchema:
|
|
3674
|
+
inputSchema: Jt.shape
|
|
3675
3675
|
},
|
|
3676
3676
|
async (s, o) => {
|
|
3677
|
-
const e = await
|
|
3677
|
+
const e = await no(s, r, o);
|
|
3678
3678
|
if ("error" in e)
|
|
3679
3679
|
return `Method: playwright-page-list(${JSON.stringify(s)})
|
|
3680
3680
|
❌ Error: ${e.error}`;
|
|
@@ -3687,19 +3687,19 @@ function oo(t, r) {
|
|
|
3687
3687
|
}
|
|
3688
3688
|
);
|
|
3689
3689
|
}
|
|
3690
|
-
const
|
|
3691
|
-
names:
|
|
3692
|
-
contextName:
|
|
3690
|
+
const Wt = m.object({
|
|
3691
|
+
names: m.array(m.string()).optional().describe("Names of pages to close. If not specified, closes all pages"),
|
|
3692
|
+
contextName: m.string().optional().describe(
|
|
3693
3693
|
"Name of context to close pages from. If not specified, searches all contexts"
|
|
3694
3694
|
),
|
|
3695
|
-
browserName:
|
|
3695
|
+
browserName: m.string().optional().describe(
|
|
3696
3696
|
"Name of browser to search in. If not specified, searches all browsers"
|
|
3697
3697
|
)
|
|
3698
3698
|
});
|
|
3699
|
-
async function
|
|
3699
|
+
async function ao(t, r, s) {
|
|
3700
3700
|
let o;
|
|
3701
3701
|
try {
|
|
3702
|
-
o =
|
|
3702
|
+
o = Wt.parse(t);
|
|
3703
3703
|
} catch (f) {
|
|
3704
3704
|
return {
|
|
3705
3705
|
error: F(f)
|
|
@@ -3725,16 +3725,16 @@ async function no(t, r, s) {
|
|
|
3725
3725
|
error: `Context "${n}" not found in browser "${f.name}" (${f.browserType})`
|
|
3726
3726
|
};
|
|
3727
3727
|
e ? e.forEach((p) => {
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3728
|
+
const h = d.pages.get(p);
|
|
3729
|
+
h ? u.push(h) : l.push(
|
|
3730
3730
|
`Page "${p}" not found in context "${d.name}" in browser "${f.name}" (${f.browserType})`
|
|
3731
3731
|
);
|
|
3732
3732
|
}) : u = Array.from(d.pages.values());
|
|
3733
3733
|
} else
|
|
3734
3734
|
for (const d of f.contexts.values())
|
|
3735
3735
|
e ? e.forEach((p) => {
|
|
3736
|
-
const
|
|
3737
|
-
|
|
3736
|
+
const h = d.pages.get(p);
|
|
3737
|
+
h ? u.push(h) : l.push(
|
|
3738
3738
|
`Page "${p}" not found in context "${d.name}" in browser "${f.name}" (${f.browserType})`
|
|
3739
3739
|
);
|
|
3740
3740
|
}) : u.push(...Array.from(d.pages.values()));
|
|
@@ -3742,8 +3742,8 @@ async function no(t, r, s) {
|
|
|
3742
3742
|
for (const f of a.browsers.values()) {
|
|
3743
3743
|
const d = f.contexts.get(n);
|
|
3744
3744
|
d && (e ? e.forEach((p) => {
|
|
3745
|
-
const
|
|
3746
|
-
|
|
3745
|
+
const h = d.pages.get(p);
|
|
3746
|
+
h ? u.push(h) : l.push(
|
|
3747
3747
|
`Page "${p}" not found in context "${d.name}" in browser "${f.name}" (${f.browserType})`
|
|
3748
3748
|
);
|
|
3749
3749
|
}) : u.push(...Array.from(d.pages.values())));
|
|
@@ -3752,8 +3752,8 @@ async function no(t, r, s) {
|
|
|
3752
3752
|
for (const f of a.browsers.values())
|
|
3753
3753
|
for (const d of f.contexts.values())
|
|
3754
3754
|
e ? e.forEach((p) => {
|
|
3755
|
-
const
|
|
3756
|
-
|
|
3755
|
+
const h = d.pages.get(p);
|
|
3756
|
+
h ? u.push(h) : l.push(
|
|
3757
3757
|
`Page "${p}" not found in context "${d.name}" in browser "${f.name}" (${f.browserType})`
|
|
3758
3758
|
);
|
|
3759
3759
|
}) : u.push(...Array.from(d.pages.values()));
|
|
@@ -3774,16 +3774,16 @@ async function no(t, r, s) {
|
|
|
3774
3774
|
...l.length > 0 && { errors: l }
|
|
3775
3775
|
};
|
|
3776
3776
|
}
|
|
3777
|
-
function
|
|
3777
|
+
function lo(t, r) {
|
|
3778
3778
|
t(
|
|
3779
3779
|
"playwright-page-close",
|
|
3780
3780
|
{
|
|
3781
3781
|
title: "Close Pages",
|
|
3782
3782
|
description: "Close pages",
|
|
3783
|
-
inputSchema:
|
|
3783
|
+
inputSchema: Wt.shape
|
|
3784
3784
|
},
|
|
3785
3785
|
async (s, o) => {
|
|
3786
|
-
const e = await
|
|
3786
|
+
const e = await ao(s, r, o);
|
|
3787
3787
|
if ("error" in e)
|
|
3788
3788
|
return `Method: playwright-page-close(${JSON.stringify(s)})
|
|
3789
3789
|
❌ Error: ${e.error}`;
|
|
@@ -3794,14 +3794,14 @@ ${n.join(`
|
|
|
3794
3794
|
}
|
|
3795
3795
|
);
|
|
3796
3796
|
}
|
|
3797
|
-
const
|
|
3798
|
-
pageName:
|
|
3797
|
+
const Kt = m.object({
|
|
3798
|
+
pageName: m.string().optional().describe("Name of previously created page to navigate"),
|
|
3799
3799
|
page: Ce.optional().describe(
|
|
3800
3800
|
"Page creation options JSON to automatically create page"
|
|
3801
3801
|
),
|
|
3802
|
-
url:
|
|
3803
|
-
timeout:
|
|
3804
|
-
waitUntil:
|
|
3802
|
+
url: m.string().describe("URL to navigate to"),
|
|
3803
|
+
timeout: m.number().describe("Timeout in seconds"),
|
|
3804
|
+
waitUntil: m.enum(["load", "domcontentloaded", "networkidle", "commit"]).describe(
|
|
3805
3805
|
`Wait until event:
|
|
3806
3806
|
- 'domcontentloaded': DOMContentLoaded event is fired
|
|
3807
3807
|
- 'load': load event is fired
|
|
@@ -3809,13 +3809,13 @@ const Wt = h.object({
|
|
|
3809
3809
|
- 'commit': network response received and document started loading`
|
|
3810
3810
|
)
|
|
3811
3811
|
});
|
|
3812
|
-
async function
|
|
3812
|
+
async function co(t, r, s) {
|
|
3813
3813
|
let o;
|
|
3814
3814
|
try {
|
|
3815
|
-
o =
|
|
3816
|
-
} catch (
|
|
3815
|
+
o = Kt.parse(t);
|
|
3816
|
+
} catch (h) {
|
|
3817
3817
|
return {
|
|
3818
|
-
error: F(
|
|
3818
|
+
error: F(h)
|
|
3819
3819
|
};
|
|
3820
3820
|
}
|
|
3821
3821
|
const { pageName: e, page: n, url: i, timeout: a, waitUntil: c } = o;
|
|
@@ -3830,8 +3830,8 @@ async function ao(t, r, s) {
|
|
|
3830
3830
|
};
|
|
3831
3831
|
let u = !1, f = !1, d = !1, p;
|
|
3832
3832
|
if (e) {
|
|
3833
|
-
for (const
|
|
3834
|
-
for (const g of
|
|
3833
|
+
for (const h of l.browsers.values()) {
|
|
3834
|
+
for (const g of h.contexts.values())
|
|
3835
3835
|
if (g.pages.has(e)) {
|
|
3836
3836
|
p = g.pages.get(e);
|
|
3837
3837
|
break;
|
|
@@ -3843,27 +3843,27 @@ async function ao(t, r, s) {
|
|
|
3843
3843
|
error: `Page "${e}" not found`
|
|
3844
3844
|
};
|
|
3845
3845
|
} else if (n) {
|
|
3846
|
-
const
|
|
3847
|
-
if (
|
|
3846
|
+
const h = await Gt(n, r, s);
|
|
3847
|
+
if (h.error != null)
|
|
3848
3848
|
return {
|
|
3849
|
-
error:
|
|
3849
|
+
error: h.error
|
|
3850
3850
|
};
|
|
3851
|
-
p =
|
|
3851
|
+
p = h.pageInfo, u = h.browserInfoCreated, f = h.contextInfoCreated, d = !0;
|
|
3852
3852
|
} else
|
|
3853
3853
|
return {
|
|
3854
3854
|
error: "Either pageName or page must be provided"
|
|
3855
3855
|
};
|
|
3856
3856
|
try {
|
|
3857
|
-
const
|
|
3857
|
+
const h = await p.page.goto(i, {
|
|
3858
3858
|
timeout: a * 1e3,
|
|
3859
3859
|
waitUntil: c
|
|
3860
3860
|
});
|
|
3861
|
-
return
|
|
3861
|
+
return h ? {
|
|
3862
3862
|
browserInfoCreated: u,
|
|
3863
3863
|
contextInfoCreated: f,
|
|
3864
3864
|
pageInfoCreated: d,
|
|
3865
3865
|
pageInfo: p,
|
|
3866
|
-
status:
|
|
3866
|
+
status: h.status()
|
|
3867
3867
|
} : {
|
|
3868
3868
|
browserInfoCreated: u,
|
|
3869
3869
|
contextInfoCreated: f,
|
|
@@ -3871,22 +3871,22 @@ async function ao(t, r, s) {
|
|
|
3871
3871
|
pageInfo: p,
|
|
3872
3872
|
status: 200
|
|
3873
3873
|
};
|
|
3874
|
-
} catch (
|
|
3874
|
+
} catch (h) {
|
|
3875
3875
|
return {
|
|
3876
|
-
error: `Failed to navigate to "${i}": ${
|
|
3876
|
+
error: `Failed to navigate to "${i}": ${h instanceof Error ? h.message : "Unknown error"}`
|
|
3877
3877
|
};
|
|
3878
3878
|
}
|
|
3879
3879
|
}
|
|
3880
|
-
function
|
|
3880
|
+
function uo(t, r) {
|
|
3881
3881
|
t(
|
|
3882
3882
|
"playwright-page-goto",
|
|
3883
3883
|
{
|
|
3884
3884
|
title: "Navigate Page",
|
|
3885
3885
|
description: "Navigate page to URL. Use for manual browser interaction",
|
|
3886
|
-
inputSchema:
|
|
3886
|
+
inputSchema: Kt.shape
|
|
3887
3887
|
},
|
|
3888
3888
|
async (s, o) => {
|
|
3889
|
-
const e = await
|
|
3889
|
+
const e = await co(s, r, o);
|
|
3890
3890
|
if (e.error != null)
|
|
3891
3891
|
return `Method: playwright-page-goto(${JSON.stringify(s)})
|
|
3892
3892
|
❌ Error: ${e.error}`;
|
|
@@ -3899,13 +3899,13 @@ function lo(t, r) {
|
|
|
3899
3899
|
}
|
|
3900
3900
|
);
|
|
3901
3901
|
}
|
|
3902
|
-
const ve =
|
|
3903
|
-
name:
|
|
3902
|
+
const ve = m.object({
|
|
3903
|
+
name: m.string().describe(
|
|
3904
3904
|
"Unique name for the DOM snapshot query. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
3905
3905
|
),
|
|
3906
|
-
cssSelector:
|
|
3906
|
+
cssSelector: m.string().describe("CSS selector to capture page content")
|
|
3907
3907
|
});
|
|
3908
|
-
async function
|
|
3908
|
+
async function Ht(t, r, s) {
|
|
3909
3909
|
let o;
|
|
3910
3910
|
try {
|
|
3911
3911
|
o = ve.parse(t);
|
|
@@ -3927,7 +3927,7 @@ async function Kt(t, r, s) {
|
|
|
3927
3927
|
snapshotQuery: a
|
|
3928
3928
|
};
|
|
3929
3929
|
}
|
|
3930
|
-
function
|
|
3930
|
+
function fo(t, r) {
|
|
3931
3931
|
t(
|
|
3932
3932
|
"playwright-dom-snapshot-query-create",
|
|
3933
3933
|
{
|
|
@@ -3936,21 +3936,21 @@ function co(t, r) {
|
|
|
3936
3936
|
inputSchema: ve.shape
|
|
3937
3937
|
},
|
|
3938
3938
|
async (s, o) => {
|
|
3939
|
-
const e = await
|
|
3939
|
+
const e = await Ht(s, r, o);
|
|
3940
3940
|
return e.error != null ? `Method: playwright-dom-snapshot-query-create(${JSON.stringify(s)})
|
|
3941
3941
|
❌ Error: ${e.error}` : `Method: playwright-dom-snapshot-query-create(${JSON.stringify(s)})
|
|
3942
3942
|
✅ DOM snapshot query "${e.snapshotQuery.name}" created successfully`;
|
|
3943
3943
|
}
|
|
3944
3944
|
);
|
|
3945
3945
|
}
|
|
3946
|
-
function
|
|
3946
|
+
function po(t) {
|
|
3947
3947
|
return function(s, o) {
|
|
3948
3948
|
let e, n = 0;
|
|
3949
3949
|
const i = o ? o.length : 0;
|
|
3950
3950
|
let a = 1, c = 0, l = 0, u, f;
|
|
3951
3951
|
if (o)
|
|
3952
|
-
for (let
|
|
3953
|
-
const g = o[
|
|
3952
|
+
for (let h = 0; h < o.length; h++) {
|
|
3953
|
+
const g = o[h];
|
|
3954
3954
|
n += g.countMatched, a += g.countTotal, c += g.tokens, l += g.tokensTotal;
|
|
3955
3955
|
}
|
|
3956
3956
|
s ? (u = s.uid, f = s.tagName, e = s.isMatched, e && (n += 1)) : (u = null, f = null, e = !1);
|
|
@@ -3964,7 +3964,7 @@ function uo(t) {
|
|
|
3964
3964
|
textOpen: `<root uid:${u}>`,
|
|
3965
3965
|
textClose: "</root>"
|
|
3966
3966
|
};
|
|
3967
|
-
const p =
|
|
3967
|
+
const p = Nt(d);
|
|
3968
3968
|
return l += p, {
|
|
3969
3969
|
uid: u,
|
|
3970
3970
|
tagName: f,
|
|
@@ -3979,8 +3979,8 @@ function uo(t) {
|
|
|
3979
3979
|
};
|
|
3980
3980
|
};
|
|
3981
3981
|
}
|
|
3982
|
-
function
|
|
3983
|
-
const s = le(r), o = s.getChilds(s.root), e =
|
|
3982
|
+
function ho(t, r) {
|
|
3983
|
+
const s = le(r), o = s.getChilds(s.root), e = Et({
|
|
3984
3984
|
getId: (n) => {
|
|
3985
3985
|
const i = s.getId(n);
|
|
3986
3986
|
if (i == null)
|
|
@@ -3990,22 +3990,22 @@ function fo(t, r) {
|
|
|
3990
3990
|
return i;
|
|
3991
3991
|
},
|
|
3992
3992
|
getChilds: (n) => s.getChilds(n),
|
|
3993
|
-
createSnapshotNode:
|
|
3993
|
+
createSnapshotNode: po(),
|
|
3994
3994
|
rootNodes: o ?? []
|
|
3995
3995
|
});
|
|
3996
3996
|
return le(e);
|
|
3997
3997
|
}
|
|
3998
|
-
const Ee =
|
|
3999
|
-
pageName:
|
|
4000
|
-
queryName:
|
|
3998
|
+
const Ee = m.object({
|
|
3999
|
+
pageName: m.string().describe("Name of previously created page, to create snapshot from"),
|
|
4000
|
+
queryName: m.string().optional().describe("Name of previously created DOM snapshot query, to use"),
|
|
4001
4001
|
query: ve.optional().describe(
|
|
4002
4002
|
"DOM snapshot query creation options JSON to automatically create query"
|
|
4003
4003
|
),
|
|
4004
|
-
name:
|
|
4004
|
+
name: m.string().describe(
|
|
4005
4005
|
"Unique name for the DOM snapshot. Recommended format: kebab-case-1, kebab-case-2, ..."
|
|
4006
4006
|
)
|
|
4007
4007
|
});
|
|
4008
|
-
async function
|
|
4008
|
+
async function Qt(t, r, s) {
|
|
4009
4009
|
let o;
|
|
4010
4010
|
try {
|
|
4011
4011
|
o = Ee.parse(t);
|
|
@@ -4046,7 +4046,7 @@ async function Ht(t, r, s) {
|
|
|
4046
4046
|
};
|
|
4047
4047
|
u = d;
|
|
4048
4048
|
} else if (i) {
|
|
4049
|
-
const d = await
|
|
4049
|
+
const d = await Ht(
|
|
4050
4050
|
i,
|
|
4051
4051
|
r,
|
|
4052
4052
|
s
|
|
@@ -4076,10 +4076,10 @@ async function Ht(t, r, s) {
|
|
|
4076
4076
|
), p = {
|
|
4077
4077
|
idToNode: new Map(d.idToNode),
|
|
4078
4078
|
idToChildIds: new Map(d.idToChildIds)
|
|
4079
|
-
},
|
|
4079
|
+
}, h = ho(u, p), g = {
|
|
4080
4080
|
name: a,
|
|
4081
4081
|
query: u,
|
|
4082
|
-
tree:
|
|
4082
|
+
tree: h
|
|
4083
4083
|
};
|
|
4084
4084
|
return l.domSnapshots.set(a, g), {
|
|
4085
4085
|
domSnapshot: g,
|
|
@@ -4091,7 +4091,7 @@ async function Ht(t, r, s) {
|
|
|
4091
4091
|
};
|
|
4092
4092
|
}
|
|
4093
4093
|
}
|
|
4094
|
-
function
|
|
4094
|
+
function mo(t, r) {
|
|
4095
4095
|
t(
|
|
4096
4096
|
"playwright-dom-snapshot-create",
|
|
4097
4097
|
{
|
|
@@ -4100,7 +4100,7 @@ function po(t, r) {
|
|
|
4100
4100
|
inputSchema: Ee.shape
|
|
4101
4101
|
},
|
|
4102
4102
|
async (s, o) => {
|
|
4103
|
-
const e = await
|
|
4103
|
+
const e = await Qt(s, r, o);
|
|
4104
4104
|
if (e.error != null)
|
|
4105
4105
|
return `Method: playwright-dom-snapshot-create(${JSON.stringify(s)})
|
|
4106
4106
|
❌ Error: ${e.error}`;
|
|
@@ -4111,7 +4111,7 @@ function po(t, r) {
|
|
|
4111
4111
|
}
|
|
4112
4112
|
);
|
|
4113
4113
|
}
|
|
4114
|
-
class
|
|
4114
|
+
class go {
|
|
4115
4115
|
tokens = 20;
|
|
4116
4116
|
getReportText = (r) => ({
|
|
4117
4117
|
indent: !0,
|
|
@@ -4125,14 +4125,14 @@ class ho {
|
|
|
4125
4125
|
tokensGrouped: s.tokens
|
|
4126
4126
|
} : (r.indexRange[1] = o, r.countGrouped += 1, r.countMatched += s.countMatched, r.tokensGrouped += s.tokens, r);
|
|
4127
4127
|
}
|
|
4128
|
-
const
|
|
4129
|
-
snapshotName:
|
|
4128
|
+
const Yt = m.object({
|
|
4129
|
+
snapshotName: m.string().optional().describe("Name of previously created DOM snapshot, to use"),
|
|
4130
4130
|
snapshot: Ee.optional().describe(
|
|
4131
4131
|
"DOM snapshot creation options JSON to automatically create snapshot"
|
|
4132
4132
|
),
|
|
4133
|
-
parentUid:
|
|
4134
|
-
childsIndexRange:
|
|
4135
|
-
"Child index range to show
|
|
4133
|
+
parentUid: m.number().optional().describe("UID of parent node to browse. Omit to browse the root node"),
|
|
4134
|
+
childsIndexRange: ft.optional().describe(
|
|
4135
|
+
"Child index range to show. Only use the exact ranges that appeared in previous snapshot results - do not modify, combine, or split them"
|
|
4136
4136
|
)
|
|
4137
4137
|
// maxCountTotal: z
|
|
4138
4138
|
// .number()
|
|
@@ -4145,10 +4145,10 @@ const Qt = h.object({
|
|
|
4145
4145
|
// maxCountGroup: z.number().default(10).describe('Maximum items per group'),
|
|
4146
4146
|
// maxTokensGroup: z.number().default(1000).describe('Maximum tokens per group'),
|
|
4147
4147
|
});
|
|
4148
|
-
async function
|
|
4148
|
+
async function wo(t, r, s) {
|
|
4149
4149
|
let o;
|
|
4150
4150
|
try {
|
|
4151
|
-
o =
|
|
4151
|
+
o = Yt.parse(t);
|
|
4152
4152
|
} catch (g) {
|
|
4153
4153
|
return {
|
|
4154
4154
|
error: F(g)
|
|
@@ -4156,13 +4156,12 @@ async function mo(t, r, s) {
|
|
|
4156
4156
|
}
|
|
4157
4157
|
const {
|
|
4158
4158
|
snapshotName: e,
|
|
4159
|
-
snapshot: n
|
|
4160
|
-
childsIndexRange: i
|
|
4159
|
+
snapshot: n
|
|
4161
4160
|
// maxCountTotal,
|
|
4162
4161
|
// maxTokensTotal,
|
|
4163
4162
|
// maxCountGroup,
|
|
4164
4163
|
// maxTokensGroup,
|
|
4165
|
-
} = o, a = 60, c = 1e3, l = 25, u = 900;
|
|
4164
|
+
} = o, i = o.childsIndexRange?.from != null && o.childsIndexRange?.to != null ? [o.childsIndexRange.from, o.childsIndexRange.to] : null, a = 60, c = 1e3, l = 25, u = 900;
|
|
4166
4165
|
if (!s.sessionId)
|
|
4167
4166
|
return {
|
|
4168
4167
|
error: "Session ID is required"
|
|
@@ -4172,7 +4171,7 @@ async function mo(t, r, s) {
|
|
|
4172
4171
|
return {
|
|
4173
4172
|
error: "Either snapshotName or snapshot must be provided, not both"
|
|
4174
4173
|
};
|
|
4175
|
-
let d, p = !1,
|
|
4174
|
+
let d, p = !1, h = !1;
|
|
4176
4175
|
if (e) {
|
|
4177
4176
|
for (const g of f.browsers.values()) {
|
|
4178
4177
|
for (const y of g.contexts.values()) {
|
|
@@ -4190,7 +4189,7 @@ async function mo(t, r, s) {
|
|
|
4190
4189
|
error: `DOM snapshot "${e}" not found`
|
|
4191
4190
|
};
|
|
4192
4191
|
} else if (n) {
|
|
4193
|
-
const g = await
|
|
4192
|
+
const g = await Qt(
|
|
4194
4193
|
n,
|
|
4195
4194
|
r,
|
|
4196
4195
|
s
|
|
@@ -4199,13 +4198,13 @@ async function mo(t, r, s) {
|
|
|
4199
4198
|
return {
|
|
4200
4199
|
error: g.error
|
|
4201
4200
|
};
|
|
4202
|
-
d = g.domSnapshot, p = g.queryCreated,
|
|
4201
|
+
d = g.domSnapshot, p = g.queryCreated, h = !0;
|
|
4203
4202
|
} else
|
|
4204
4203
|
return {
|
|
4205
4204
|
error: "Either snapshotName or snapshot must be provided"
|
|
4206
4205
|
};
|
|
4207
4206
|
try {
|
|
4208
|
-
const g = o.parentUid, y =
|
|
4207
|
+
const g = o.parentUid, y = kt({
|
|
4209
4208
|
tree: d.tree,
|
|
4210
4209
|
request: {
|
|
4211
4210
|
parentNodeId: g,
|
|
@@ -4217,12 +4216,12 @@ async function mo(t, r, s) {
|
|
|
4217
4216
|
maxTokensGroup: u
|
|
4218
4217
|
}
|
|
4219
4218
|
},
|
|
4220
|
-
indexRangeGroupStrategy: new
|
|
4221
|
-
}), w =
|
|
4219
|
+
indexRangeGroupStrategy: new go()
|
|
4220
|
+
}), w = Ot(y);
|
|
4222
4221
|
return {
|
|
4223
4222
|
domSnapshot: d,
|
|
4224
4223
|
queryCreated: p,
|
|
4225
|
-
snapshotCreated:
|
|
4224
|
+
snapshotCreated: h,
|
|
4226
4225
|
parentUid: g,
|
|
4227
4226
|
childsIndexRange: i,
|
|
4228
4227
|
report: w
|
|
@@ -4233,16 +4232,16 @@ async function mo(t, r, s) {
|
|
|
4233
4232
|
};
|
|
4234
4233
|
}
|
|
4235
4234
|
}
|
|
4236
|
-
function
|
|
4235
|
+
function yo(t, r) {
|
|
4237
4236
|
t(
|
|
4238
4237
|
"playwright-dom-snapshot-browse",
|
|
4239
4238
|
{
|
|
4240
4239
|
title: "Browse DOM Snapshot",
|
|
4241
4240
|
description: "Browse and explore DOM. Use this to browse, analyze, explore, inspect, etc webpage structure and styles, find elements, or inspect page content",
|
|
4242
|
-
inputSchema:
|
|
4241
|
+
inputSchema: Yt.shape
|
|
4243
4242
|
},
|
|
4244
4243
|
async (s, o) => {
|
|
4245
|
-
const e = await
|
|
4244
|
+
const e = await wo(s, r, o);
|
|
4246
4245
|
if (e.error != null)
|
|
4247
4246
|
return `Method: playwright-dom-snapshot-browse(${JSON.stringify(s)})
|
|
4248
4247
|
❌ Error: ${e.error}`;
|
|
@@ -4263,10 +4262,10 @@ ${e.report}`, n;
|
|
|
4263
4262
|
}
|
|
4264
4263
|
);
|
|
4265
4264
|
}
|
|
4266
|
-
function
|
|
4267
|
-
r.browserCreate &&
|
|
4265
|
+
function bo(t, r) {
|
|
4266
|
+
r.browserCreate && Ws(t, r), r.browserList && Hs(t, r), r.browserClose && Ys(t, r), r.contextCreate && Vs(t, r), r.contextList && Xs(t, r), r.contextClose && to(t, r), r.pageCreate && oo(t, r), r.pageList && io(t, r), r.pageClose && lo(t, r), r.pageGoto && uo(t, r), r.domSnapshotQueryCreate && fo(t, r), r.domSnapshotCreate && mo(t, r), r.domSnapshotBrowse && yo(t, r), console.log("Playwright manager");
|
|
4268
4267
|
}
|
|
4269
|
-
function
|
|
4268
|
+
function So(t) {
|
|
4270
4269
|
const { logFilePath: r } = t;
|
|
4271
4270
|
return async function(o, e, n, i) {
|
|
4272
4271
|
await ie({
|
|
@@ -4293,7 +4292,7 @@ const it = [
|
|
|
4293
4292
|
"flemist-mcp.config.json5",
|
|
4294
4293
|
"flemist-mcp.config.yaml"
|
|
4295
4294
|
];
|
|
4296
|
-
async function
|
|
4295
|
+
async function xo(t) {
|
|
4297
4296
|
const r = k.resolve(t);
|
|
4298
4297
|
for (let s = 0, o = it.length; s < o; s++) {
|
|
4299
4298
|
const e = it[s], n = k.join(r, e);
|
|
@@ -4318,7 +4317,7 @@ ${c instanceof Error ? c.message : String(c)}`);
|
|
|
4318
4317
|
if (a === ".json5")
|
|
4319
4318
|
return Ne.parse(i);
|
|
4320
4319
|
if (a === ".yaml")
|
|
4321
|
-
return
|
|
4320
|
+
return fr.load(i);
|
|
4322
4321
|
} catch (c) {
|
|
4323
4322
|
throw new Error(`MCP Error: Failed to parse config file: ${n}
|
|
4324
4323
|
|
|
@@ -4332,7 +4331,7 @@ Expected one of:
|
|
|
4332
4331
|
- flemist-mcp.config.json5
|
|
4333
4332
|
- flemist-mcp.config.yaml`);
|
|
4334
4333
|
}
|
|
4335
|
-
const
|
|
4334
|
+
const Io = {
|
|
4336
4335
|
logDir: "tmp/mcp-project-tools/logs",
|
|
4337
4336
|
tools: {
|
|
4338
4337
|
processManager: {
|
|
@@ -4373,8 +4372,8 @@ const So = {
|
|
|
4373
4372
|
}
|
|
4374
4373
|
}
|
|
4375
4374
|
};
|
|
4376
|
-
async function
|
|
4377
|
-
const r = k.resolve(t), s = await
|
|
4375
|
+
async function $o(t) {
|
|
4376
|
+
const r = k.resolve(t), s = await xo(r), o = k.join(r, ".flemist-mcpignore");
|
|
4378
4377
|
try {
|
|
4379
4378
|
await j.promises.stat(o);
|
|
4380
4379
|
} catch {
|
|
@@ -4384,7 +4383,7 @@ Create .flemist-mcpignore file in: ${r}
|
|
|
4384
4383
|
|
|
4385
4384
|
This file contains glob patterns for files/directories to exclude from MCP operations.`);
|
|
4386
4385
|
}
|
|
4387
|
-
const e =
|
|
4386
|
+
const e = dr(Io, s, {
|
|
4388
4387
|
arrayMerge(n, i) {
|
|
4389
4388
|
return i;
|
|
4390
4389
|
}
|
|
@@ -4406,25 +4405,25 @@ This file contains glob patterns for files/directories to exclude from MCP opera
|
|
|
4406
4405
|
n.valueType === "file-contains-patterns" && (a[i].value = k.resolve(r, n.value));
|
|
4407
4406
|
}), e.logDir = k.resolve(r, e.logDir), e;
|
|
4408
4407
|
}
|
|
4409
|
-
function
|
|
4408
|
+
function Vt() {
|
|
4410
4409
|
return `mcp_${(/* @__PURE__ */ new Date()).toISOString().substring(0, 19).replace(/T/, "_").replace(/:/g, "-")}.log`;
|
|
4411
4410
|
}
|
|
4412
|
-
function
|
|
4413
|
-
const r = ne(), s =
|
|
4411
|
+
function Mo(t) {
|
|
4412
|
+
const r = ne(), s = To();
|
|
4414
4413
|
return r.use(s), r;
|
|
4415
4414
|
}
|
|
4416
|
-
function
|
|
4415
|
+
function To(t) {
|
|
4417
4416
|
const r = ne.Router();
|
|
4418
4417
|
return r.use((s, o, e) => {
|
|
4419
4418
|
s.method === "OPTIONS" ? o.status(403).send("CORS forbidden") : e();
|
|
4420
4419
|
}), r.use(ne.json()), r;
|
|
4421
4420
|
}
|
|
4422
|
-
function
|
|
4421
|
+
function Co(t) {
|
|
4423
4422
|
const r = ne.Router();
|
|
4424
|
-
return r.use(
|
|
4423
|
+
return r.use(pr({ authToken: t.authToken })), r.all("/mcp", yr(t)), r;
|
|
4425
4424
|
}
|
|
4426
|
-
function
|
|
4427
|
-
return t.use(
|
|
4425
|
+
function vo(t, r) {
|
|
4426
|
+
return t.use(So({ logFilePath: r.logFilePath })), new Promise((s, o) => {
|
|
4428
4427
|
let e;
|
|
4429
4428
|
const n = () => {
|
|
4430
4429
|
s(e);
|
|
@@ -4438,7 +4437,7 @@ function To(t, r) {
|
|
|
4438
4437
|
}
|
|
4439
4438
|
});
|
|
4440
4439
|
}
|
|
4441
|
-
function
|
|
4440
|
+
function Eo(t, r) {
|
|
4442
4441
|
if (!t.address())
|
|
4443
4442
|
throw new Error(
|
|
4444
4443
|
"Server address is not available. Check your DNS and host configuration."
|
|
@@ -4456,20 +4455,20 @@ SSE Endpoint: ${i}/sse
|
|
|
4456
4455
|
|
|
4457
4456
|
Log File: ${k.resolve(r.logFilePath)}`;
|
|
4458
4457
|
}
|
|
4459
|
-
function
|
|
4460
|
-
const s = k.join(r.logDir,
|
|
4458
|
+
function No(t, r) {
|
|
4459
|
+
const s = k.join(r.logDir, Vt()), o = Jr(t, {
|
|
4461
4460
|
logFilePath: s
|
|
4462
4461
|
});
|
|
4463
|
-
r.tools.processManager &&
|
|
4462
|
+
r.tools.processManager && Gr(
|
|
4464
4463
|
o,
|
|
4465
4464
|
r.tools.processManager
|
|
4466
|
-
), r.tools.fsManager &&
|
|
4465
|
+
), r.tools.fsManager && Js(o, r.tools.fsManager), r.tools.playwrightManager && bo(
|
|
4467
4466
|
o,
|
|
4468
4467
|
r.tools.playwrightManager
|
|
4469
|
-
),
|
|
4468
|
+
), Pr(o);
|
|
4470
4469
|
}
|
|
4471
|
-
async function
|
|
4472
|
-
const r = k.join(t.logDir,
|
|
4470
|
+
async function Yo(t) {
|
|
4471
|
+
const r = k.join(t.logDir, Vt()), s = Mo(), o = Co({
|
|
4473
4472
|
authToken: t.authToken,
|
|
4474
4473
|
logFilePath: r,
|
|
4475
4474
|
createMcpServer: async (n) => {
|
|
@@ -4492,22 +4491,22 @@ X-Project-Name header is missing. To configure MCP for this project:
|
|
|
4492
4491
|
Ask user to:
|
|
4493
4492
|
1. Add project to server's projects config: projects: { "${i}": "<project-path>" }
|
|
4494
4493
|
2. Restart MCP server`);
|
|
4495
|
-
const c = await
|
|
4494
|
+
const c = await $o(a), l = new Zt({
|
|
4496
4495
|
title: t.title,
|
|
4497
4496
|
name: t.name,
|
|
4498
4497
|
version: t.version
|
|
4499
4498
|
});
|
|
4500
|
-
return
|
|
4499
|
+
return No(l, c), l;
|
|
4501
4500
|
}
|
|
4502
4501
|
});
|
|
4503
4502
|
s.use(o);
|
|
4504
|
-
const e = await
|
|
4503
|
+
const e = await vo(s, {
|
|
4505
4504
|
host: t.host,
|
|
4506
4505
|
port: t.port,
|
|
4507
4506
|
logFilePath: r
|
|
4508
4507
|
});
|
|
4509
4508
|
return console.log(
|
|
4510
|
-
|
|
4509
|
+
Eo(e, {
|
|
4511
4510
|
title: t.title,
|
|
4512
4511
|
name: t.name,
|
|
4513
4512
|
version: t.version,
|
|
@@ -4516,11 +4515,11 @@ Ask user to:
|
|
|
4516
4515
|
), e;
|
|
4517
4516
|
}
|
|
4518
4517
|
export {
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4518
|
+
Qo as A,
|
|
4519
|
+
Ho as S,
|
|
4520
|
+
Ko as a,
|
|
4521
|
+
Wo as b,
|
|
4522
|
+
xo as l,
|
|
4523
|
+
ss as p,
|
|
4524
|
+
Yo as s
|
|
4526
4525
|
};
|