layermap 0.1.47 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/analyzers/go/darwin-arm64/go-map +0 -0
- package/analyzers/go/darwin-x64/go-map +0 -0
- package/analyzers/go/linux-arm64/go-map +0 -0
- package/analyzers/go/linux-x64/go-map +0 -0
- package/analyzers/go/win32-arm64/go-map.exe +0 -0
- package/analyzers/go/win32-x64/go-map.exe +0 -0
- package/analyzers/project-map-java/java-map.jar +0 -0
- package/analyzers/project-map-java-worker.mjs +0 -1
- package/analyzers/project-map-python-worker.mjs +10 -10
- package/analyzers/project-map-worker.mjs +3 -6
- package/dist/cli.mjs +824 -656
- package/package.json +1 -1
- package/pi/layermap.mjs +1 -1
package/README.md
CHANGED
|
@@ -210,6 +210,11 @@ Maps stay in your user cache (`~/Library/Caches/layermap`, `~/.cache/layermap` o
|
|
|
210
210
|
nothing anywhere ([privacy](https://github.com/coffeecoproject/layermap/blob/main/PRIVACY.md),
|
|
211
211
|
[security](https://github.com/coffeecoproject/layermap/blob/main/SECURITY.md)).
|
|
212
212
|
|
|
213
|
+
The MCP server tells a client that asks for progress which step a long check is on, and keeps a
|
|
214
|
+
line for each tool call in `logs/calls.jsonl` in the cache: the tool, its arguments, the
|
|
215
|
+
repository, how long each step took and the first line of the answer, to review how the tools are
|
|
216
|
+
used and where their time goes.
|
|
217
|
+
|
|
213
218
|
| Tool | Use |
|
|
214
219
|
|---|---|
|
|
215
220
|
| `project_explore_map` | A directory, a file, or a declaration's callers and callees (`direction` INCOMING or OUTGOING, `depth` up to 8). |
|
|
@@ -226,6 +231,7 @@ npx layermap refs src/billing/tax.ts calculateTax
|
|
|
226
231
|
npx layermap check --base main
|
|
227
232
|
npx layermap check test/billing.test.ts # also: what of the change this test does not run
|
|
228
233
|
npx layermap check --json # as JSON: related tests by rank, what the map cannot follow, the imports and calls it changes between files
|
|
234
|
+
npx layermap imports --json # every import of the project as it is now, test files apart: file and line, the file imported, and why the rest reach no file
|
|
229
235
|
```
|
|
230
236
|
|
|
231
237
|
## FAQ
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -14755,7 +14755,6 @@ process.once(
|
|
|
14755
14755
|
operation: message.operation,
|
|
14756
14756
|
files: message.files,
|
|
14757
14757
|
release: message.release,
|
|
14758
|
-
tests: message.tests,
|
|
14759
14758
|
lombok: path3.join(path3.dirname(message.compilerPath), "lombok.jar"),
|
|
14760
14759
|
...message.targets ? { targets: message.targets } : {},
|
|
14761
14760
|
...message.incremental ? { incremental: message.incremental } : {}
|
|
@@ -120972,10 +120972,9 @@ function docstring(statements) {
|
|
|
120972
120972
|
return inner.length === 1 && inner[0]?.nodeType === 48 /* StringList */ ? inner[0] : void 0;
|
|
120973
120973
|
}
|
|
120974
120974
|
var Extraction = class {
|
|
120975
|
-
constructor(source, evaluator
|
|
120975
|
+
constructor(source, evaluator) {
|
|
120976
120976
|
this.source = source;
|
|
120977
120977
|
this.evaluator = evaluator;
|
|
120978
|
-
this.tests = tests;
|
|
120979
120978
|
this.facts = { files: [], objects: [], relations: [], notes: [], typeErrors: 0 };
|
|
120980
120979
|
// Objects by the start of their declaring name, per file.
|
|
120981
120980
|
this.byName = /* @__PURE__ */ new Map();
|
|
@@ -121055,9 +121054,6 @@ var Extraction = class {
|
|
|
121055
121054
|
end: end(node)
|
|
121056
121055
|
});
|
|
121057
121056
|
}
|
|
121058
|
-
isTest(path3) {
|
|
121059
|
-
return this.tests.has(path3);
|
|
121060
|
-
}
|
|
121061
121057
|
// Declarations a name refers to, with imports followed to what they import. An import that
|
|
121062
121058
|
// resolves nowhere stays an alias declaration.
|
|
121063
121059
|
declarations(name) {
|
|
@@ -121852,8 +121848,12 @@ var Relater = class extends ParseTreeWalker {
|
|
|
121852
121848
|
}
|
|
121853
121849
|
imports(module, site, from) {
|
|
121854
121850
|
const specifier = `${".".repeat(module.d.leadingDots)}${module.d.nameParts.map((part) => part.d.value).join(".")}`;
|
|
121855
|
-
const
|
|
121856
|
-
|
|
121851
|
+
const fact = {
|
|
121852
|
+
kind: "IMPORTS",
|
|
121853
|
+
from: this.top(this.executing),
|
|
121854
|
+
start: site.start,
|
|
121855
|
+
end: end(site)
|
|
121856
|
+
};
|
|
121857
121857
|
const result = getImportInfo(module, this.x.source.program.analyzerNodeInfoReader);
|
|
121858
121858
|
const resolved2 = result?.isImportFound ? result.resolvedUris.at(-1) : void 0;
|
|
121859
121859
|
const path3 = resolved2 && !resolved2.isEmpty() ? this.x.source.pathOf(resolved2) : void 0;
|
|
@@ -121945,10 +121945,10 @@ function implementations(x2) {
|
|
|
121945
121945
|
}
|
|
121946
121946
|
}
|
|
121947
121947
|
}
|
|
121948
|
-
function extractPython(source
|
|
121948
|
+
function extractPython(source) {
|
|
121949
121949
|
const evaluator = source.program.evaluator;
|
|
121950
121950
|
if (!evaluator) throw new Error("PROJECT_MAP_ANALYSIS_FAILED");
|
|
121951
|
-
const x2 = new Extraction(source, evaluator
|
|
121951
|
+
const x2 = new Extraction(source, evaluator);
|
|
121952
121952
|
const modules = [];
|
|
121953
121953
|
for (const path3 of source.paths) {
|
|
121954
121954
|
const uri = source.uriOf(path3);
|
|
@@ -122118,7 +122118,7 @@ process.once(
|
|
|
122118
122118
|
process.send?.({ result: findPythonReferences(source, message.targets) });
|
|
122119
122119
|
} else {
|
|
122120
122120
|
trace.phase = "TRAVERSAL";
|
|
122121
|
-
process.send?.({ result: extractPython(source
|
|
122121
|
+
process.send?.({ result: extractPython(source) });
|
|
122122
122122
|
}
|
|
122123
122123
|
} finally {
|
|
122124
122124
|
trace.phase = "DISPOSE";
|
|
@@ -30122,8 +30122,7 @@ var MapRelationKindSchema = external_exports.enum([
|
|
|
30122
30122
|
"IMPLEMENTS",
|
|
30123
30123
|
// A member that implements or overrides the target member, so calls to it may dispatch here.
|
|
30124
30124
|
"OVERRIDES",
|
|
30125
|
-
"DECORATED_BY"
|
|
30126
|
-
"TEST_IMPORTS"
|
|
30125
|
+
"DECORATED_BY"
|
|
30127
30126
|
]);
|
|
30128
30127
|
var MapObjectLocatorSchema = external_exports.object({
|
|
30129
30128
|
path: external_exports.string().min(1),
|
|
@@ -30185,7 +30184,6 @@ var MAP_RELATION_PRIORITY = Object.freeze({
|
|
|
30185
30184
|
CALLS: 0,
|
|
30186
30185
|
WRITES: 0,
|
|
30187
30186
|
IMPORTS: 0,
|
|
30188
|
-
TEST_IMPORTS: 0,
|
|
30189
30187
|
EXTENDS: 0,
|
|
30190
30188
|
IMPLEMENTS: 0,
|
|
30191
30189
|
OVERRIDES: 0,
|
|
@@ -31991,7 +31989,6 @@ function isMapWrite(node) {
|
|
|
31991
31989
|
|
|
31992
31990
|
// src/project-map-extract.ts
|
|
31993
31991
|
var key = (node) => `${node.getSourceFile().fileName}:${node.pos}:${node.kind}`;
|
|
31994
|
-
var IMPORT_RELATIONS = /* @__PURE__ */ new Set(["IMPORTS", "TEST_IMPORTS"]);
|
|
31995
31992
|
var declares = (node) => Boolean(mapExecutionDeclaration(node) || mapDeclarationKind(node, true) && mapDeclarationName(node));
|
|
31996
31993
|
var declarationName = (node) => {
|
|
31997
31994
|
const execution = mapExecutionDeclaration(node);
|
|
@@ -32225,7 +32222,7 @@ async function extractProjectMap(project, input, trace, read, installed) {
|
|
|
32225
32222
|
reference = {
|
|
32226
32223
|
node,
|
|
32227
32224
|
lookup: moduleSpecifier,
|
|
32228
|
-
kind:
|
|
32225
|
+
kind: "IMPORTS",
|
|
32229
32226
|
target: moduleSpecifier.text
|
|
32230
32227
|
};
|
|
32231
32228
|
} else if (isCallExpression(node) || isNewExpression(node)) {
|
|
@@ -32667,7 +32664,7 @@ async function extractProjectMap(project, input, trace, read, installed) {
|
|
|
32667
32664
|
if (name) notInstalled.add(name);
|
|
32668
32665
|
}
|
|
32669
32666
|
for (const relation of output.relations) {
|
|
32670
|
-
if (
|
|
32667
|
+
if (relation.kind !== "IMPORTS" || relation.unresolvedReason !== "SYMBOL_NOT_RESOLVED")
|
|
32671
32668
|
continue;
|
|
32672
32669
|
const name = mapPackageOf(relation.target);
|
|
32673
32670
|
if (name && !installed(relation.anchor.path, name)) notInstalled.add(name);
|