MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / extractPaths

Function extractPaths

src/agent/parallel-mutating.ts:35–51  ·  view source on GitHub ↗
(args: any)

Source from the content-addressed store, hash-verified

33const BROAD_TOOLS = new Set(['multi_file_edit', 'safe_rename', 'safe_delete_file']);
34
35function extractPaths(args: any): string[] | null {
36 if (!args || typeof args !== 'object') return null;
37 const out: string[] = [];
38 for (const key of ['path', 'file', 'file_path', 'filepath', 'target']) {
39 if (typeof args[key] === 'string') out.push(args[key]);
40 }
41 for (const key of ['paths', 'files', 'targets']) {
42 if (Array.isArray(args[key])) {
43 for (const v of args[key]) if (typeof v === 'string') out.push(v);
44 }
45 }
46 // multi_edit-style: edits[].path
47 if (Array.isArray(args.edits)) {
48 for (const e of args.edits) if (e && typeof e.path === 'string') out.push(e.path);
49 }
50 return out.length > 0 ? out : null;
51}
52
53function pathsConflict(a: string[], b: string[]): boolean {
54 const sa = new Set(a);

Callers 1

groupMutatingForParallelFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected