@paretools/make 0.8.5 → 0.9.0
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/dist/lib/formatters.d.ts +2 -1
- package/dist/lib/formatters.d.ts.map +1 -1
- package/dist/lib/formatters.js +16 -3
- package/dist/lib/formatters.js.map +1 -1
- package/dist/lib/parsers.d.ts +83 -1
- package/dist/lib/parsers.d.ts.map +1 -1
- package/dist/lib/parsers.js +155 -4
- package/dist/lib/parsers.js.map +1 -1
- package/dist/schemas/index.d.ts +6 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +4 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/list.d.ts.map +1 -1
- package/dist/tools/list.js +115 -7
- package/dist/tools/list.js.map +1 -1
- package/dist/tools/run.d.ts.map +1 -1
- package/dist/tools/run.js +101 -4
- package/dist/tools/run.js.map +1 -1
- package/package.json +2 -2
package/dist/lib/formatters.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { MakeRunResult, MakeListResult } from "../schemas/index.js";
|
|
|
3
3
|
export declare function formatRun(data: MakeRunResult): string;
|
|
4
4
|
/** Formats structured list results into a human-readable target listing. */
|
|
5
5
|
export declare function formatList(data: MakeListResult): string;
|
|
6
|
-
/** Compact run: target, exitCode, success, duration. Drop stdout/stderr. */
|
|
6
|
+
/** Compact run: target, exitCode, success, duration, timedOut. Drop stdout/stderr. */
|
|
7
7
|
export interface MakeRunCompact {
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
target: string;
|
|
@@ -11,6 +11,7 @@ export interface MakeRunCompact {
|
|
|
11
11
|
exitCode: number;
|
|
12
12
|
duration: number;
|
|
13
13
|
tool: "make" | "just";
|
|
14
|
+
timedOut: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare function compactRunMap(data: MakeRunResult): MakeRunCompact;
|
|
16
17
|
export declare function formatRunCompact(data: MakeRunCompact): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIzE,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIzE,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAcrD;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAcvD;AAID,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,cAAc,CASjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAK7D;AAED,oEAAoE;AACpE,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,eAAe,CAKpE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAG/D"}
|
package/dist/lib/formatters.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
/** Formats structured run results into a human-readable output summary. */
|
|
3
3
|
export function formatRun(data) {
|
|
4
4
|
const lines = [];
|
|
5
|
-
if (data.
|
|
5
|
+
if (data.timedOut) {
|
|
6
|
+
lines.push(`${data.tool} ${data.target}: TIMED OUT after ${data.duration}ms (exit code ${data.exitCode}).`);
|
|
7
|
+
}
|
|
8
|
+
else if (data.success) {
|
|
6
9
|
lines.push(`${data.tool} ${data.target}: success (${data.duration}ms).`);
|
|
7
10
|
}
|
|
8
11
|
else {
|
|
@@ -20,8 +23,15 @@ export function formatList(data) {
|
|
|
20
23
|
return `${data.tool}: no targets found.`;
|
|
21
24
|
const lines = [`${data.tool}: ${data.total} targets`];
|
|
22
25
|
for (const t of data.targets ?? []) {
|
|
23
|
-
const
|
|
24
|
-
|
|
26
|
+
const parts = [` ${t.name}`];
|
|
27
|
+
if (t.isPhony)
|
|
28
|
+
parts.push("[phony]");
|
|
29
|
+
if (t.dependencies && t.dependencies.length > 0) {
|
|
30
|
+
parts.push(`-> ${t.dependencies.join(", ")}`);
|
|
31
|
+
}
|
|
32
|
+
if (t.description)
|
|
33
|
+
parts.push(`# ${t.description}`);
|
|
34
|
+
lines.push(parts.join(" "));
|
|
25
35
|
}
|
|
26
36
|
return lines.join("\n");
|
|
27
37
|
}
|
|
@@ -32,9 +42,12 @@ export function compactRunMap(data) {
|
|
|
32
42
|
exitCode: data.exitCode,
|
|
33
43
|
duration: data.duration,
|
|
34
44
|
tool: data.tool,
|
|
45
|
+
timedOut: data.timedOut,
|
|
35
46
|
};
|
|
36
47
|
}
|
|
37
48
|
export function formatRunCompact(data) {
|
|
49
|
+
if (data.timedOut)
|
|
50
|
+
return `${data.tool} ${data.target}: TIMED OUT after ${data.duration}ms (exit code ${data.exitCode}).`;
|
|
38
51
|
if (data.success)
|
|
39
52
|
return `${data.tool} ${data.target}: success (${data.duration}ms).`;
|
|
40
53
|
return `${data.tool} ${data.target}: exit code ${data.exitCode} (${data.duration}ms).`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAEA,wEAAwE;AAExE,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,IAAmB;IAC3C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/lib/formatters.ts"],"names":[],"mappings":"AAEA,wEAAwE;AAExE,2EAA2E;AAC3E,MAAM,UAAU,SAAS,CAAC,IAAmB;IAC3C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CACR,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,qBAAqB,IAAI,CAAC,QAAQ,iBAAiB,IAAI,CAAC,QAAQ,IAAI,CAChG,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,cAAc,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC;IAC3E,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,eAAe,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC;IAC9F,CAAC;IACD,IAAI,IAAI,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,IAAI,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,OAAO,KAAK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IAAI,CAAC,QAAQ;KACxB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAoB;IACnD,IAAI,IAAI,CAAC,QAAQ;QACf,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,qBAAqB,IAAI,CAAC,QAAQ,iBAAiB,IAAI,CAAC,QAAQ,IAAI,CAAC;IACzG,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,cAAc,IAAI,CAAC,QAAQ,MAAM,CAAC;IACtF,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,eAAe,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,MAAM,CAAC;AACzF,CAAC;AASD,MAAM,UAAU,cAAc,CAAC,IAAoB;IACjD,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACrD,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;QAAE,OAAO,GAAG,IAAI,CAAC,IAAI,qBAAqB,CAAC;IAC/D,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,UAAU,CAAC;AAC/C,CAAC"}
|
package/dist/lib/parsers.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { MakeTool } from "./make-runner.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the output of a `make` or `just` run into structured result data.
|
|
5
5
|
*/
|
|
6
|
-
export declare function parseRunOutput(target: string, stdout: string, stderr: string, exitCode: number, duration: number, tool: MakeTool): MakeRunResult;
|
|
6
|
+
export declare function parseRunOutput(target: string, stdout: string, stderr: string, exitCode: number, duration: number, tool: MakeTool, timedOut?: boolean): MakeRunResult;
|
|
7
7
|
/**
|
|
8
8
|
* Parses `just --list` output into structured target data.
|
|
9
9
|
*
|
|
@@ -22,6 +22,40 @@ export declare function parseJustList(stdout: string): {
|
|
|
22
22
|
}[];
|
|
23
23
|
total: number;
|
|
24
24
|
};
|
|
25
|
+
/** Shape returned by `just --dump-format json`. */
|
|
26
|
+
export interface JustDumpRecipe {
|
|
27
|
+
name?: string;
|
|
28
|
+
doc?: string | null;
|
|
29
|
+
parameters?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
default?: string | null;
|
|
32
|
+
}>;
|
|
33
|
+
dependencies?: Array<{
|
|
34
|
+
recipe: string;
|
|
35
|
+
} | string>;
|
|
36
|
+
body?: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface JustDump {
|
|
39
|
+
recipes?: Record<string, JustDumpRecipe>;
|
|
40
|
+
aliases?: Record<string, {
|
|
41
|
+
target: string;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parses `just --dump-format json` output into structured target data.
|
|
46
|
+
*
|
|
47
|
+
* The JSON dump includes recipe names, parameters, dependencies, and docs.
|
|
48
|
+
* All just recipes are inherently phony (no file targets).
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseJustDumpJson(jsonOutput: string): {
|
|
51
|
+
targets: {
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
isPhony?: boolean;
|
|
55
|
+
dependencies?: string[];
|
|
56
|
+
}[];
|
|
57
|
+
total: number;
|
|
58
|
+
};
|
|
25
59
|
/**
|
|
26
60
|
* Parses `make -pRrq` database output to extract user-defined target names.
|
|
27
61
|
*
|
|
@@ -38,9 +72,55 @@ export declare function parseJustList(stdout: string): {
|
|
|
38
72
|
export declare function parseMakeTargets(stdout: string): {
|
|
39
73
|
targets: {
|
|
40
74
|
name: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
dependencies?: string[];
|
|
41
77
|
}[];
|
|
42
78
|
total: number;
|
|
43
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* Parses `.PHONY` declarations from Makefile source to determine which targets are phony.
|
|
82
|
+
*
|
|
83
|
+
* @param makefileSource - Raw contents of the Makefile
|
|
84
|
+
* @returns Set of target names declared as .PHONY
|
|
85
|
+
*/
|
|
86
|
+
export declare function parsePhonyTargets(makefileSource: string): Set<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Enriches targets with isPhony flag based on .PHONY declarations.
|
|
89
|
+
*
|
|
90
|
+
* @param targets - Targets previously extracted from `make -pRrq` output
|
|
91
|
+
* @param phonySet - Set of phony target names from parsePhonyTargets
|
|
92
|
+
* @returns The same targets array, mutated with `isPhony` fields where applicable
|
|
93
|
+
*/
|
|
94
|
+
export declare function enrichPhonyFlags(targets: {
|
|
95
|
+
name: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
isPhony?: boolean;
|
|
98
|
+
dependencies?: string[];
|
|
99
|
+
}[], phonySet: Set<string>): void;
|
|
100
|
+
/**
|
|
101
|
+
* Enriches parsed make targets with descriptions extracted from the Makefile source.
|
|
102
|
+
*
|
|
103
|
+
* Supports the common `target: [deps] ## Description text` convention where a
|
|
104
|
+
* double-hash comment at the end of the target rule line serves as documentation.
|
|
105
|
+
* This convention is widely used in Makefiles that provide a `help` target.
|
|
106
|
+
*
|
|
107
|
+
* @param targets - Targets previously extracted from `make -pRrq` output
|
|
108
|
+
* @param makefileSource - Raw contents of the Makefile
|
|
109
|
+
* @returns The same targets array, mutated with `description` fields where found
|
|
110
|
+
*/
|
|
111
|
+
export declare function enrichMakeTargetDescriptions(targets: {
|
|
112
|
+
name: string;
|
|
113
|
+
description?: string;
|
|
114
|
+
}[], makefileSource: string): {
|
|
115
|
+
name: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
}[];
|
|
118
|
+
/**
|
|
119
|
+
* Parses dependency lists from Makefile source for best-effort dependency enrichment.
|
|
120
|
+
* This extracts dependencies from `target: dep1 dep2` lines in the Makefile source
|
|
121
|
+
* (not the make database output), providing cleaner results for user-defined rules.
|
|
122
|
+
*/
|
|
123
|
+
export declare function parseMakeDependencies(makefileSource: string): Map<string, string[]>;
|
|
44
124
|
/**
|
|
45
125
|
* Builds a full MakeListResult from parsed target data and the detected tool.
|
|
46
126
|
*/
|
|
@@ -48,6 +128,8 @@ export declare function buildListResult(parsed: {
|
|
|
48
128
|
targets: {
|
|
49
129
|
name: string;
|
|
50
130
|
description?: string;
|
|
131
|
+
isPhony?: boolean;
|
|
132
|
+
dependencies?: string[];
|
|
51
133
|
}[];
|
|
52
134
|
total: number;
|
|
53
135
|
}, tool: MakeTool): MakeListResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../src/lib/parsers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../src/lib/parsers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,EACd,QAAQ,GAAE,OAAe,GACxB,aAAa,CAWf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE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.
|
|
3
3
|
*/
|
|
4
|
-
export function parseRunOutput(target, stdout, stderr, exitCode, duration, tool) {
|
|
4
|
+
export function parseRunOutput(target, stdout, stderr, exitCode, duration, tool, timedOut = false) {
|
|
5
5
|
return {
|
|
6
6
|
target,
|
|
7
|
-
success: exitCode === 0,
|
|
7
|
+
success: exitCode === 0 && !timedOut,
|
|
8
8
|
exitCode,
|
|
9
9
|
stdout: stdout.trimEnd() || undefined,
|
|
10
10
|
stderr: stderr.trimEnd() || undefined,
|
|
11
11
|
duration,
|
|
12
12
|
tool,
|
|
13
|
+
timedOut,
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -39,6 +40,55 @@ export function parseJustList(stdout) {
|
|
|
39
40
|
}
|
|
40
41
|
return { targets, total: targets.length };
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Parses `just --dump-format json` output into structured target data.
|
|
45
|
+
*
|
|
46
|
+
* The JSON dump includes recipe names, parameters, dependencies, and docs.
|
|
47
|
+
* All just recipes are inherently phony (no file targets).
|
|
48
|
+
*/
|
|
49
|
+
export function parseJustDumpJson(jsonOutput) {
|
|
50
|
+
const dump = JSON.parse(jsonOutput);
|
|
51
|
+
const targets = [];
|
|
52
|
+
if (dump.recipes) {
|
|
53
|
+
for (const [recipeName, recipe] of Object.entries(dump.recipes)) {
|
|
54
|
+
const deps = [];
|
|
55
|
+
if (recipe.dependencies && recipe.dependencies.length > 0) {
|
|
56
|
+
for (const dep of recipe.dependencies) {
|
|
57
|
+
if (typeof dep === "string") {
|
|
58
|
+
deps.push(dep);
|
|
59
|
+
}
|
|
60
|
+
else if (dep && typeof dep === "object" && "recipe" in dep) {
|
|
61
|
+
deps.push(dep.recipe);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
targets.push({
|
|
66
|
+
name: recipeName,
|
|
67
|
+
description: recipe.doc?.trim() || undefined,
|
|
68
|
+
isPhony: true,
|
|
69
|
+
dependencies: deps.length > 0 ? deps : undefined,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Sort alphabetically by default (consistent with just --list default)
|
|
74
|
+
targets.sort((a, b) => a.name.localeCompare(b.name));
|
|
75
|
+
return { targets, total: targets.length };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Strips order-only dependencies from a make dependency list.
|
|
79
|
+
* In make, `target: normal_dep1 | order_only_dep` — everything after `|` is order-only.
|
|
80
|
+
* We only return dependencies before the `|` separator.
|
|
81
|
+
*/
|
|
82
|
+
function stripOrderOnlyDeps(tokens) {
|
|
83
|
+
const result = [];
|
|
84
|
+
for (const token of tokens) {
|
|
85
|
+
if (token === "|")
|
|
86
|
+
break;
|
|
87
|
+
if (token.length > 0)
|
|
88
|
+
result.push(token);
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
42
92
|
/**
|
|
43
93
|
* Parses `make -pRrq` database output to extract user-defined target names.
|
|
44
94
|
*
|
|
@@ -57,7 +107,7 @@ export function parseMakeTargets(stdout) {
|
|
|
57
107
|
const seen = new Set();
|
|
58
108
|
// The make -pRrq output includes a "# Files" section followed by rules.
|
|
59
109
|
// Target lines appear as: "targetname: deps" or "targetname:"
|
|
60
|
-
const targetRe = /^([a-zA-Z0-9_][a-zA-Z0-9_.\-/]*)
|
|
110
|
+
const targetRe = /^([a-zA-Z0-9_][a-zA-Z0-9_.\-/]*):\s*(.*)/;
|
|
61
111
|
for (const line of stdout.split("\n")) {
|
|
62
112
|
// Skip comments and empty lines
|
|
63
113
|
if (line.startsWith("#") || line.startsWith("\t") || !line.trim())
|
|
@@ -70,12 +120,113 @@ export function parseMakeTargets(stdout) {
|
|
|
70
120
|
continue;
|
|
71
121
|
if (!seen.has(name)) {
|
|
72
122
|
seen.add(name);
|
|
73
|
-
|
|
123
|
+
// Parse dependencies from the right side of ":"
|
|
124
|
+
const depsStr = match[2].trim();
|
|
125
|
+
const tokens = depsStr ? depsStr.split(/\s+/) : [];
|
|
126
|
+
const deps = stripOrderOnlyDeps(tokens);
|
|
127
|
+
targets.push({
|
|
128
|
+
name,
|
|
129
|
+
dependencies: deps.length > 0 ? deps : undefined,
|
|
130
|
+
});
|
|
74
131
|
}
|
|
75
132
|
}
|
|
76
133
|
}
|
|
77
134
|
return { targets, total: targets.length };
|
|
78
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Parses `.PHONY` declarations from Makefile source to determine which targets are phony.
|
|
138
|
+
*
|
|
139
|
+
* @param makefileSource - Raw contents of the Makefile
|
|
140
|
+
* @returns Set of target names declared as .PHONY
|
|
141
|
+
*/
|
|
142
|
+
export function parsePhonyTargets(makefileSource) {
|
|
143
|
+
const phonySet = new Set();
|
|
144
|
+
const phonyRe = /^\.PHONY\s*:\s*(.+)$/;
|
|
145
|
+
for (const line of makefileSource.split("\n")) {
|
|
146
|
+
const trimmed = line.trim();
|
|
147
|
+
const match = trimmed.match(phonyRe);
|
|
148
|
+
if (match) {
|
|
149
|
+
const names = match[1].split(/\s+/).filter((n) => n.length > 0);
|
|
150
|
+
for (const name of names) {
|
|
151
|
+
phonySet.add(name);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return phonySet;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Enriches targets with isPhony flag based on .PHONY declarations.
|
|
159
|
+
*
|
|
160
|
+
* @param targets - Targets previously extracted from `make -pRrq` output
|
|
161
|
+
* @param phonySet - Set of phony target names from parsePhonyTargets
|
|
162
|
+
* @returns The same targets array, mutated with `isPhony` fields where applicable
|
|
163
|
+
*/
|
|
164
|
+
export function enrichPhonyFlags(targets, phonySet) {
|
|
165
|
+
for (const target of targets) {
|
|
166
|
+
if (phonySet.has(target.name)) {
|
|
167
|
+
target.isPhony = true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Enriches parsed make targets with descriptions extracted from the Makefile source.
|
|
173
|
+
*
|
|
174
|
+
* Supports the common `target: [deps] ## Description text` convention where a
|
|
175
|
+
* double-hash comment at the end of the target rule line serves as documentation.
|
|
176
|
+
* This convention is widely used in Makefiles that provide a `help` target.
|
|
177
|
+
*
|
|
178
|
+
* @param targets - Targets previously extracted from `make -pRrq` output
|
|
179
|
+
* @param makefileSource - Raw contents of the Makefile
|
|
180
|
+
* @returns The same targets array, mutated with `description` fields where found
|
|
181
|
+
*/
|
|
182
|
+
export function enrichMakeTargetDescriptions(targets, makefileSource) {
|
|
183
|
+
// Build a map of target name → description from lines matching: target: ... ## desc
|
|
184
|
+
const descMap = new Map();
|
|
185
|
+
// Match: targetname: [anything] ## description
|
|
186
|
+
const descRe = /^([a-zA-Z0-9_][a-zA-Z0-9_.\-/]*):[^#]*##\s*(.+)$/;
|
|
187
|
+
for (const line of makefileSource.split("\n")) {
|
|
188
|
+
const match = line.match(descRe);
|
|
189
|
+
if (match) {
|
|
190
|
+
const name = match[1];
|
|
191
|
+
const desc = match[2].trim();
|
|
192
|
+
if (desc) {
|
|
193
|
+
descMap.set(name, desc);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Enrich targets with descriptions
|
|
198
|
+
for (const target of targets) {
|
|
199
|
+
const desc = descMap.get(target.name);
|
|
200
|
+
if (desc) {
|
|
201
|
+
target.description = desc;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return targets;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Parses dependency lists from Makefile source for best-effort dependency enrichment.
|
|
208
|
+
* This extracts dependencies from `target: dep1 dep2` lines in the Makefile source
|
|
209
|
+
* (not the make database output), providing cleaner results for user-defined rules.
|
|
210
|
+
*/
|
|
211
|
+
export function parseMakeDependencies(makefileSource) {
|
|
212
|
+
const depMap = new Map();
|
|
213
|
+
const depRe = /^([a-zA-Z0-9_][a-zA-Z0-9_.\-/]*):\s*([^#\n]*)/;
|
|
214
|
+
for (const line of makefileSource.split("\n")) {
|
|
215
|
+
const match = line.match(depRe);
|
|
216
|
+
if (match) {
|
|
217
|
+
const name = match[1];
|
|
218
|
+
const depsStr = match[2].trim();
|
|
219
|
+
if (depsStr) {
|
|
220
|
+
const tokens = depsStr.split(/\s+/);
|
|
221
|
+
const deps = stripOrderOnlyDeps(tokens);
|
|
222
|
+
if (deps.length > 0) {
|
|
223
|
+
depMap.set(name, deps);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return depMap;
|
|
229
|
+
}
|
|
79
230
|
/**
|
|
80
231
|
* Builds a full MakeListResult from parsed target data and the detected tool.
|
|
81
232
|
*/
|
package/dist/lib/parsers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/lib/parsers.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,MAAc,EACd,MAAc,EACd,QAAgB,EAChB,QAAgB,EAChB,IAAc;
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/lib/parsers.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,MAAc,EACd,MAAc,EACd,QAAgB,EAChB,QAAgB,EAChB,IAAc,EACd,WAAoB,KAAK;IAEzB,OAAO;QACL,MAAM;QACN,OAAO,EAAE,QAAQ,KAAK,CAAC,IAAI,CAAC,QAAQ;QACpC,QAAQ;QACR,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,SAAS;QACrC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,SAAS;QACrC,QAAQ;QACR,IAAI;QACJ,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAI1C,MAAM,OAAO,GAA6C,EAAE,CAAC;IAE7D,K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,IAAI,EAAE,IAAI,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,MAQC,EACD,IAAc;IAEd,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI;KACL,CAAC;AACJ,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -11,18 +11,23 @@ export declare const MakeRunResultSchema: z.ZodObject<{
|
|
|
11
11
|
make: "make";
|
|
12
12
|
just: "just";
|
|
13
13
|
}>;
|
|
14
|
+
timedOut: z.ZodBoolean;
|
|
14
15
|
}, z.core.$strip>;
|
|
15
16
|
export type MakeRunResult = z.infer<typeof MakeRunResultSchema>;
|
|
16
|
-
/** Zod schema for a single target entry with name
|
|
17
|
+
/** Zod schema for a single target entry with name, optional description, phony flag, and dependencies. */
|
|
17
18
|
export declare const MakeTargetSchema: z.ZodObject<{
|
|
18
19
|
name: z.ZodString;
|
|
19
20
|
description: z.ZodOptional<z.ZodString>;
|
|
21
|
+
isPhony: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
23
|
}, z.core.$strip>;
|
|
21
24
|
/** Zod schema for structured make/just list output with targets and total count. */
|
|
22
25
|
export declare const MakeListResultSchema: z.ZodObject<{
|
|
23
26
|
targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
27
|
name: z.ZodString;
|
|
25
28
|
description: z.ZodOptional<z.ZodString>;
|
|
29
|
+
isPhony: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
31
|
}, z.core.$strip>>>;
|
|
27
32
|
total: z.ZodNumber;
|
|
28
33
|
tool: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mGAAmG;AACnG,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mGAAmG;AACnG,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAS9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB;;;;;iBAK3B,CAAC;AAEH,oFAAoF;AACpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAI/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -8,11 +8,14 @@ export const MakeRunResultSchema = z.object({
|
|
|
8
8
|
stderr: z.string().optional(),
|
|
9
9
|
duration: z.number(),
|
|
10
10
|
tool: z.enum(["make", "just"]),
|
|
11
|
+
timedOut: z.boolean(),
|
|
11
12
|
});
|
|
12
|
-
/** Zod schema for a single target entry with name
|
|
13
|
+
/** Zod schema for a single target entry with name, optional description, phony flag, and dependencies. */
|
|
13
14
|
export const MakeTargetSchema = z.object({
|
|
14
15
|
name: z.string(),
|
|
15
16
|
description: z.string().optional(),
|
|
17
|
+
isPhony: z.boolean().optional(),
|
|
18
|
+
dependencies: z.array(z.string()).optional(),
|
|
16
19
|
});
|
|
17
20
|
/** Zod schema for structured make/just list output with targets and total count. */
|
|
18
21
|
export const MakeListResultSchema = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources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CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC,CAAC"}
|
package/dist/tools/list.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA2CzE,yDAAyD;AACzD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QA6JjD"}
|
package/dist/tools/list.js
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { compactDualOutput, INPUT_LIMITS } from "@paretools/shared";
|
|
2
|
+
import { compactDualOutput, assertNoFlagInjection, INPUT_LIMITS } from "@paretools/shared";
|
|
3
3
|
import { makeCmd, justCmd, resolveTool } from "../lib/make-runner.js";
|
|
4
|
-
import { parseJustList, parseMakeTargets, buildListResult } from "../lib/parsers.js";
|
|
4
|
+
import { parseJustList, parseJustDumpJson, parseMakeTargets, enrichMakeTargetDescriptions, parsePhonyTargets, enrichPhonyFlags, buildListResult, } from "../lib/parsers.js";
|
|
5
5
|
import { formatList, compactListMap, formatListCompact } from "../lib/formatters.js";
|
|
6
6
|
import { MakeListResultSchema } from "../schemas/index.js";
|
|
7
|
+
import { readFile } from "node:fs/promises";
|
|
8
|
+
import { join } from "node:path";
|
|
9
|
+
/** Attempts to use `just --dump-format json` for structured recipe parsing. */
|
|
10
|
+
async function tryJustJsonDump(cwd, file) {
|
|
11
|
+
try {
|
|
12
|
+
const jsonArgs = ["--dump-format", "json"];
|
|
13
|
+
if (file)
|
|
14
|
+
jsonArgs.push("--justfile", file);
|
|
15
|
+
const jsonResult = await justCmd(jsonArgs, cwd);
|
|
16
|
+
if (jsonResult.exitCode === 0 && jsonResult.stdout.trim()) {
|
|
17
|
+
return parseJustDumpJson(jsonResult.stdout);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// JSON dump not supported or failed — fall back
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
7
25
|
/** Registers the `list` tool on the given MCP server. */
|
|
8
26
|
export function registerListTool(server) {
|
|
9
27
|
server.registerTool("list", {
|
|
@@ -20,6 +38,24 @@ export function registerListTool(server) {
|
|
|
20
38
|
.optional()
|
|
21
39
|
.default("auto")
|
|
22
40
|
.describe('Task runner to use: "auto" detects from files, or force "make"/"just"'),
|
|
41
|
+
file: z
|
|
42
|
+
.string()
|
|
43
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Path to a non-default makefile or justfile (maps to make -f FILE / just --justfile FILE)"),
|
|
46
|
+
filter: z
|
|
47
|
+
.string()
|
|
48
|
+
.max(INPUT_LIMITS.SHORT_STRING_MAX)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Client-side regex filter on target names — useful for projects with many targets"),
|
|
51
|
+
includeSubmodules: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Include recipes from justfile submodules (just --list-submodules, just only)"),
|
|
55
|
+
unsorted: z
|
|
56
|
+
.boolean()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("List targets in definition order instead of alphabetical (just --unsorted, just only)"),
|
|
23
59
|
compact: z
|
|
24
60
|
.boolean()
|
|
25
61
|
.optional()
|
|
@@ -27,22 +63,94 @@ export function registerListTool(server) {
|
|
|
27
63
|
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
28
64
|
},
|
|
29
65
|
outputSchema: MakeListResultSchema,
|
|
30
|
-
}, async ({ path, tool, compact }) => {
|
|
66
|
+
}, async ({ path, tool, file, filter, includeSubmodules, unsorted, compact }) => {
|
|
67
|
+
if (file)
|
|
68
|
+
assertNoFlagInjection(file, "file");
|
|
69
|
+
if (filter)
|
|
70
|
+
assertNoFlagInjection(filter, "filter");
|
|
31
71
|
const cwd = path || process.cwd();
|
|
32
72
|
const resolved = resolveTool(tool || "auto", cwd);
|
|
33
73
|
let parsed;
|
|
34
74
|
let rawOutput;
|
|
35
75
|
if (resolved === "just") {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
76
|
+
// Try JSON dump first for more reliable parsing (Gap #171)
|
|
77
|
+
const jsonParsed = await tryJustJsonDump(cwd, file);
|
|
78
|
+
if (jsonParsed) {
|
|
79
|
+
parsed = jsonParsed;
|
|
80
|
+
// Get --list output for raw display and optional ordering
|
|
81
|
+
const listArgs = ["--list"];
|
|
82
|
+
if (file)
|
|
83
|
+
listArgs.push("--justfile", file);
|
|
84
|
+
if (includeSubmodules)
|
|
85
|
+
listArgs.push("--list-submodules");
|
|
86
|
+
if (unsorted) {
|
|
87
|
+
listArgs.push("--unsorted");
|
|
88
|
+
// Reorder JSON-parsed targets to match --list definition order
|
|
89
|
+
const listResult = await justCmd(listArgs, cwd);
|
|
90
|
+
rawOutput = listResult.stdout.trim();
|
|
91
|
+
const listParsed = parseJustList(listResult.stdout);
|
|
92
|
+
const orderMap = new Map(listParsed.targets.map((t, i) => [t.name, i]));
|
|
93
|
+
parsed.targets.sort((a, b) => {
|
|
94
|
+
const aIdx = orderMap.get(a.name) ?? Infinity;
|
|
95
|
+
const bIdx = orderMap.get(b.name) ?? Infinity;
|
|
96
|
+
return aIdx - bIdx;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const listResult = await justCmd(listArgs, cwd);
|
|
101
|
+
rawOutput = listResult.stdout.trim();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// Fall back to text parsing if JSON dump fails
|
|
106
|
+
const justArgs = ["--list"];
|
|
107
|
+
if (file)
|
|
108
|
+
justArgs.push("--justfile", file);
|
|
109
|
+
if (includeSubmodules)
|
|
110
|
+
justArgs.push("--list-submodules");
|
|
111
|
+
if (unsorted)
|
|
112
|
+
justArgs.push("--unsorted");
|
|
113
|
+
const result = await justCmd(justArgs, cwd);
|
|
114
|
+
rawOutput = result.stdout.trim();
|
|
115
|
+
const textParsed = parseJustList(result.stdout);
|
|
116
|
+
// Mark all just targets as phony (Gap #172: just recipes are inherently phony)
|
|
117
|
+
parsed = {
|
|
118
|
+
targets: textParsed.targets.map((t) => ({
|
|
119
|
+
...t,
|
|
120
|
+
isPhony: true,
|
|
121
|
+
})),
|
|
122
|
+
total: textParsed.total,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
39
125
|
}
|
|
40
126
|
else {
|
|
41
|
-
const
|
|
127
|
+
const makeArgs = ["-pRrq"];
|
|
128
|
+
if (file)
|
|
129
|
+
makeArgs.push("-f", file);
|
|
130
|
+
makeArgs.push(":");
|
|
131
|
+
const result = await makeCmd(makeArgs, cwd);
|
|
42
132
|
// make -pRrq exits non-zero when the dummy target ":" fails, but still
|
|
43
133
|
// prints the database to stdout. We only care about stdout.
|
|
44
134
|
rawOutput = result.stdout.trim();
|
|
45
135
|
parsed = parseMakeTargets(result.stdout);
|
|
136
|
+
// Enrich targets with ## descriptions and .PHONY info from the Makefile source
|
|
137
|
+
const makefilePath = file || join(cwd, "Makefile");
|
|
138
|
+
try {
|
|
139
|
+
const makefileSource = await readFile(makefilePath, "utf-8");
|
|
140
|
+
enrichMakeTargetDescriptions(parsed.targets, makefileSource);
|
|
141
|
+
// Gap #172: Extract .PHONY declarations
|
|
142
|
+
const phonySet = parsePhonyTargets(makefileSource);
|
|
143
|
+
enrichPhonyFlags(parsed.targets, phonySet);
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
// Makefile not readable (e.g. generated targets only) — skip enrichment
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Apply client-side filter if provided
|
|
150
|
+
if (filter) {
|
|
151
|
+
const re = new RegExp(filter);
|
|
152
|
+
parsed.targets = parsed.targets.filter((t) => re.test(t.name));
|
|
153
|
+
parsed.total = parsed.targets.length;
|
|
46
154
|
}
|
|
47
155
|
const data = buildListResult(parsed, resolved);
|
|
48
156
|
return compactDualOutput(data, rawOutput, formatList, compactListMap, formatListCompact, compact === false);
|
package/dist/tools/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/tools/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EA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CAAC"}
|
package/dist/tools/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/tools/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/tools/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,QA+KhD"}
|
package/dist/tools/run.js
CHANGED
|
@@ -27,6 +27,41 @@ export function registerRunTool(server) {
|
|
|
27
27
|
.optional()
|
|
28
28
|
.default("auto")
|
|
29
29
|
.describe('Task runner to use: "auto" detects from files, or force "make"/"just"'),
|
|
30
|
+
file: z
|
|
31
|
+
.string()
|
|
32
|
+
.max(INPUT_LIMITS.PATH_MAX)
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Path to a non-default makefile or justfile (maps to make -f FILE / just --justfile FILE)"),
|
|
35
|
+
env: z
|
|
36
|
+
.record(z.string(), z.string())
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Environment variables to pass to the target execution (key-value pairs)"),
|
|
39
|
+
dryRun: z
|
|
40
|
+
.boolean()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Preview commands without executing (make -n / just --dry-run)"),
|
|
43
|
+
jobs: z.number().optional().describe("Number of parallel jobs (make -j N, make only)"),
|
|
44
|
+
silent: z
|
|
45
|
+
.boolean()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Suppress command echoing (make -s / just --quiet)"),
|
|
48
|
+
keepGoing: z
|
|
49
|
+
.boolean()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Continue after errors in independent targets (make -k, make only)"),
|
|
52
|
+
alwaysMake: z
|
|
53
|
+
.boolean()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("Force rebuild regardless of timestamps (make -B, make only)"),
|
|
56
|
+
verbose: z
|
|
57
|
+
.boolean()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Enable verbose output (just --verbose, just only)"),
|
|
60
|
+
trace: z.boolean().optional().describe("Trace execution order (make --trace, make only)"),
|
|
61
|
+
question: z
|
|
62
|
+
.boolean()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Check if target is up to date without executing (make -q, make only). Exit code 0 = up to date."),
|
|
30
65
|
compact: z
|
|
31
66
|
.boolean()
|
|
32
67
|
.optional()
|
|
@@ -34,18 +69,80 @@ export function registerRunTool(server) {
|
|
|
34
69
|
.describe("Auto-compact when structured output exceeds raw CLI tokens. Set false to always get full schema."),
|
|
35
70
|
},
|
|
36
71
|
outputSchema: MakeRunResultSchema,
|
|
37
|
-
}, async ({ target, args, path, tool, compact }) => {
|
|
72
|
+
}, async ({ target, args, path, tool, file, env, dryRun, jobs, silent, keepGoing, alwaysMake, verbose, trace, question, compact, }) => {
|
|
38
73
|
const cwd = path || process.cwd();
|
|
39
74
|
assertNoFlagInjection(target, "target");
|
|
75
|
+
if (file)
|
|
76
|
+
assertNoFlagInjection(file, "file");
|
|
40
77
|
for (const a of args ?? []) {
|
|
41
78
|
assertNoFlagInjection(a, "args");
|
|
42
79
|
}
|
|
43
80
|
const resolved = resolveTool(tool || "auto", cwd);
|
|
44
|
-
|
|
81
|
+
// Build flags before the target
|
|
82
|
+
const flags = [];
|
|
83
|
+
if (resolved === "just") {
|
|
84
|
+
if (file)
|
|
85
|
+
flags.push("--justfile", file);
|
|
86
|
+
if (dryRun)
|
|
87
|
+
flags.push("--dry-run");
|
|
88
|
+
if (silent)
|
|
89
|
+
flags.push("--quiet");
|
|
90
|
+
if (verbose)
|
|
91
|
+
flags.push("--verbose");
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
// make
|
|
95
|
+
if (file)
|
|
96
|
+
flags.push("-f", file);
|
|
97
|
+
if (dryRun)
|
|
98
|
+
flags.push("-n");
|
|
99
|
+
if (jobs !== undefined)
|
|
100
|
+
flags.push("-j", String(jobs));
|
|
101
|
+
if (silent)
|
|
102
|
+
flags.push("-s");
|
|
103
|
+
if (keepGoing)
|
|
104
|
+
flags.push("-k");
|
|
105
|
+
if (alwaysMake)
|
|
106
|
+
flags.push("-B");
|
|
107
|
+
if (trace)
|
|
108
|
+
flags.push("--trace");
|
|
109
|
+
if (question)
|
|
110
|
+
flags.push("-q");
|
|
111
|
+
}
|
|
112
|
+
// Build environment variable arguments
|
|
113
|
+
// For make: pass as VAR=VALUE positional args
|
|
114
|
+
// For just: pass as VAR=VALUE positional args (just supports env var overrides this way)
|
|
115
|
+
const envArgs = [];
|
|
116
|
+
if (env) {
|
|
117
|
+
for (const [key, value] of Object.entries(env)) {
|
|
118
|
+
envArgs.push(`${key}=${value}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const cmdArgs = [...flags, target, ...(args || []), ...envArgs];
|
|
45
122
|
const start = Date.now();
|
|
46
|
-
|
|
123
|
+
let timedOut = false;
|
|
124
|
+
let result;
|
|
125
|
+
try {
|
|
126
|
+
result = resolved === "just" ? await justCmd(cmdArgs, cwd) : await makeCmd(cmdArgs, cwd);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
130
|
+
// Gap #174: Detect timeout errors from the shared runner
|
|
131
|
+
if (errMsg.includes("timed out")) {
|
|
132
|
+
timedOut = true;
|
|
133
|
+
result = {
|
|
134
|
+
exitCode: 124, // Standard timeout exit code
|
|
135
|
+
stdout: "",
|
|
136
|
+
stderr: errMsg,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Re-throw non-timeout errors
|
|
141
|
+
throw err;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
47
144
|
const duration = Date.now() - start;
|
|
48
|
-
const data = parseRunOutput(target, result.stdout, result.stderr, result.exitCode, duration, resolved);
|
|
145
|
+
const data = parseRunOutput(target, result.stdout, result.stderr, result.exitCode, duration, resolved, timedOut);
|
|
49
146
|
const rawOutput = (result.stdout + "\n" + result.stderr).trim();
|
|
50
147
|
return compactDualOutput(data, rawOutput, formatRun, compactRunMap, formatRunCompact, compact === false);
|
|
51
148
|
});
|
package/dist/tools/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/tools/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,wDAAwD;AACxD,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,YAAY,CACjB,KAAK,EACL;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,qLAAqL;QACvL,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;YAC/E,IAAI,EAAE,CAAC;iBACJ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;iBAC9C,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC;iBAC3B,QAAQ,EAAE;iBACV,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AG,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAChE,OAAO,iBAAiB,CACtB,IAAI,EACJ,SAAS,EACT,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,KAAK,KAAK,CAClB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paretools/make",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"mcpName": "io.github.Dave-London/pare-make",
|
|
5
5
|
"description": "MCP server for Make/Just task runners with structured, token-efficient output",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
53
53
|
"zod": "^4.3.6",
|
|
54
|
-
"@paretools/shared": "0.
|
|
54
|
+
"@paretools/shared": "0.9.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/node": "^25.2.3",
|