@grunnverk/kodrdriv 1.5.1 → 1.5.3
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/constants.js +1 -1
- package/dist/mcp-server.js +86 -42
- package/dist/mcp-server.js.map +4 -4
- package/package.json +4 -4
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
|
-
/** Version string populated at build time with git and system information */ const VERSION = '1.5.
|
|
4
|
+
/** Version string populated at build time with git and system information */ const VERSION = '1.5.3 (HEAD/af44fda T:v1.5.3 2026-01-28 11:05:47 -0800) linux x64 v24.13.0';
|
|
5
5
|
/** The program name used in CLI help and error messages */ const PROGRAM_NAME = 'kodrdriv';
|
|
6
6
|
const DEFAULT_OVERRIDES = false;
|
|
7
7
|
const DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS = 'YYYY-MM-DD-HHmmss.SSS';
|
package/dist/mcp-server.js
CHANGED
|
@@ -13915,7 +13915,7 @@ import path2 from "path";
|
|
|
13915
13915
|
// src/constants.ts
|
|
13916
13916
|
import os from "os";
|
|
13917
13917
|
import path from "path";
|
|
13918
|
-
var VERSION = "1.5.
|
|
13918
|
+
var VERSION = "1.5.3 (HEAD/af44fda T:v1.5.3 2026-01-28 11:05:47 -0800) linux x64 v24.13.0";
|
|
13919
13919
|
var PROGRAM_NAME = "kodrdriv";
|
|
13920
13920
|
var DATE_FORMAT_YEAR_MONTH_DAY_HOURS_MINUTES_SECONDS_MILLISECONDS = "YYYY-MM-DD-HHmmss.SSS";
|
|
13921
13921
|
var DEFAULT_OUTPUT_DIRECTORY = "output/kodrdriv";
|
|
@@ -14144,6 +14144,36 @@ function installLogCapture() {
|
|
|
14144
14144
|
// src/mcp/tools/shared.ts
|
|
14145
14145
|
import { scanForPackageJsonFiles, buildDependencyGraph, topologicalSort } from "@grunnverk/tree-core";
|
|
14146
14146
|
import { setLogger as setTreeExecutionLogger } from "@grunnverk/tree-execution";
|
|
14147
|
+
|
|
14148
|
+
// src/utils/config.ts
|
|
14149
|
+
import fs2 from "fs/promises";
|
|
14150
|
+
import path3 from "path";
|
|
14151
|
+
var CONFIG_FILES = [".kodrdrivrc.json", ".kodrdrivrc", "kodrdriv.config.json"];
|
|
14152
|
+
async function loadConfig(cwd = process.cwd()) {
|
|
14153
|
+
const logger2 = getLogger();
|
|
14154
|
+
for (const filename of CONFIG_FILES) {
|
|
14155
|
+
const configPath = path3.join(cwd, filename);
|
|
14156
|
+
try {
|
|
14157
|
+
const content = await fs2.readFile(configPath, "utf-8");
|
|
14158
|
+
const config2 = JSON.parse(content);
|
|
14159
|
+
logger2.verbose(`Loaded configuration from ${configPath}`);
|
|
14160
|
+
return config2;
|
|
14161
|
+
} catch (error48) {
|
|
14162
|
+
if (error48.code !== "ENOENT") {
|
|
14163
|
+
logger2.warn(`CONFIG_LOAD_FAILED: Failed to load configuration file | Path: ${configPath} | Error: ${error48.message} | Action: Using defaults`);
|
|
14164
|
+
}
|
|
14165
|
+
}
|
|
14166
|
+
}
|
|
14167
|
+
logger2.verbose("No configuration file found, using defaults");
|
|
14168
|
+
return null;
|
|
14169
|
+
}
|
|
14170
|
+
|
|
14171
|
+
// src/mcp/tools/shared.ts
|
|
14172
|
+
var DEFAULT_EXCLUDE_SUBPROJECTS = [
|
|
14173
|
+
"doc/",
|
|
14174
|
+
"docs/",
|
|
14175
|
+
"test-*/"
|
|
14176
|
+
];
|
|
14147
14177
|
function configureTreeExecutionLogger() {
|
|
14148
14178
|
const coreLogger = getCoreLogger();
|
|
14149
14179
|
setTreeExecutionLogger({
|
|
@@ -14204,7 +14234,17 @@ function setupPackageFocusCallback(config2, context) {
|
|
|
14204
14234
|
}
|
|
14205
14235
|
async function discoverTreePackages(directory, packages, startFrom) {
|
|
14206
14236
|
try {
|
|
14207
|
-
const
|
|
14237
|
+
const config2 = await loadConfig(directory);
|
|
14238
|
+
const excludeSubprojects = config2?.workspace?.excludeSubprojects ?? DEFAULT_EXCLUDE_SUBPROJECTS;
|
|
14239
|
+
const excludedPatterns = [
|
|
14240
|
+
"**/node_modules/**",
|
|
14241
|
+
"**/dist/**",
|
|
14242
|
+
"**/build/**",
|
|
14243
|
+
"**/.git/**",
|
|
14244
|
+
// Add subproject exclusions
|
|
14245
|
+
...excludeSubprojects.map((pattern) => `**/${pattern}**`)
|
|
14246
|
+
];
|
|
14247
|
+
const packageJsonPaths = await scanForPackageJsonFiles(directory, excludedPatterns);
|
|
14208
14248
|
if (packageJsonPaths.length === 0) {
|
|
14209
14249
|
return null;
|
|
14210
14250
|
}
|
|
@@ -15020,13 +15060,31 @@ import { formatErrorForMCP as formatErrorForMCP2, getLogger as getCoreLogger3, i
|
|
|
15020
15060
|
import { scanForPackageJsonFiles as scanForPackageJsonFiles2 } from "@grunnverk/tree-core";
|
|
15021
15061
|
import { getGitStatusSummary, getLinkedDependencies, run } from "@grunnverk/git-tools";
|
|
15022
15062
|
import { readFile } from "fs/promises";
|
|
15023
|
-
import * as
|
|
15063
|
+
import * as path4 from "path";
|
|
15064
|
+
var DEFAULT_EXCLUDE_SUBPROJECTS2 = [
|
|
15065
|
+
"doc/",
|
|
15066
|
+
"docs/",
|
|
15067
|
+
"test-*/"
|
|
15068
|
+
];
|
|
15024
15069
|
async function executeCheckDevelopment(args, _context) {
|
|
15025
15070
|
const directory = args.directory || process.cwd();
|
|
15026
15071
|
const { getLogs, remove } = installLogCapture();
|
|
15027
15072
|
try {
|
|
15028
15073
|
const logger2 = getCoreLogger3();
|
|
15029
|
-
const
|
|
15074
|
+
const config2 = await loadConfig(directory);
|
|
15075
|
+
const excludeSubprojects = config2?.workspace?.excludeSubprojects ?? DEFAULT_EXCLUDE_SUBPROJECTS2;
|
|
15076
|
+
const excludedPatterns = [
|
|
15077
|
+
"**/node_modules/**",
|
|
15078
|
+
"**/dist/**",
|
|
15079
|
+
"**/build/**",
|
|
15080
|
+
"**/.git/**",
|
|
15081
|
+
// Add subproject exclusions
|
|
15082
|
+
...excludeSubprojects.map((pattern) => {
|
|
15083
|
+
const normalized = pattern.endsWith("/") ? pattern.slice(0, -1) : pattern;
|
|
15084
|
+
return `**/${normalized}/**`;
|
|
15085
|
+
})
|
|
15086
|
+
];
|
|
15087
|
+
const packageJsonFiles = await scanForPackageJsonFiles2(directory, excludedPatterns);
|
|
15030
15088
|
const isTree = packageJsonFiles.length > 1;
|
|
15031
15089
|
logger2.info(`Checking development readiness for ${isTree ? "tree" : "single package"} in ${directory}`);
|
|
15032
15090
|
const checks = {
|
|
@@ -15035,12 +15093,23 @@ async function executeCheckDevelopment(args, _context) {
|
|
|
15035
15093
|
devVersion: { passed: true, issues: [] },
|
|
15036
15094
|
linkStatus: { passed: true, issues: [] }
|
|
15037
15095
|
};
|
|
15038
|
-
const packagesToCheck = isTree ? packageJsonFiles : [
|
|
15096
|
+
const packagesToCheck = isTree ? packageJsonFiles : [path4.join(directory, "package.json")];
|
|
15097
|
+
const localPackageNames = /* @__PURE__ */ new Set();
|
|
15098
|
+
for (const pkgJsonPath of packagesToCheck) {
|
|
15099
|
+
try {
|
|
15100
|
+
const pkgJsonContent = await readFile(pkgJsonPath, "utf-8");
|
|
15101
|
+
const pkgJson = JSON.parse(pkgJsonContent);
|
|
15102
|
+
if (pkgJson.name) {
|
|
15103
|
+
localPackageNames.add(pkgJson.name);
|
|
15104
|
+
}
|
|
15105
|
+
} catch {
|
|
15106
|
+
}
|
|
15107
|
+
}
|
|
15039
15108
|
for (const pkgJsonPath of packagesToCheck) {
|
|
15040
|
-
const pkgDir =
|
|
15109
|
+
const pkgDir = path4.dirname(pkgJsonPath);
|
|
15041
15110
|
const pkgJsonContent = await readFile(pkgJsonPath, "utf-8");
|
|
15042
15111
|
const pkgJson = JSON.parse(pkgJsonContent);
|
|
15043
|
-
const pkgName = pkgJson.name ||
|
|
15112
|
+
const pkgName = pkgJson.name || path4.basename(pkgDir);
|
|
15044
15113
|
try {
|
|
15045
15114
|
const gitStatus = await getGitStatusSummary(pkgDir);
|
|
15046
15115
|
if (gitStatus.branch === "main" || gitStatus.branch === "master") {
|
|
@@ -15088,12 +15157,12 @@ async function executeCheckDevelopment(args, _context) {
|
|
|
15088
15157
|
...pkgJson.dependencies,
|
|
15089
15158
|
...pkgJson.devDependencies
|
|
15090
15159
|
};
|
|
15091
|
-
const
|
|
15092
|
-
const
|
|
15093
|
-
if (
|
|
15160
|
+
const localDeps = Object.keys(allDeps).filter((dep) => localPackageNames.has(dep));
|
|
15161
|
+
const unlinkedLocal = localDeps.filter((dep) => !linkedDeps.has(dep));
|
|
15162
|
+
if (unlinkedLocal.length > 0) {
|
|
15094
15163
|
checks.linkStatus.passed = false;
|
|
15095
15164
|
checks.linkStatus.issues.push(
|
|
15096
|
-
`${pkgName}:
|
|
15165
|
+
`${pkgName}: Local dependencies not linked: ${unlinkedLocal.join(", ")}`
|
|
15097
15166
|
);
|
|
15098
15167
|
}
|
|
15099
15168
|
} catch (error48) {
|
|
@@ -15731,32 +15800,7 @@ async function readStatusResource(uri) {
|
|
|
15731
15800
|
|
|
15732
15801
|
// src/mcp/resources/workspace.ts
|
|
15733
15802
|
import { buildDependencyGraph as buildDependencyGraph2, scanForPackageJsonFiles as scanForPackageJsonFiles3 } from "@grunnverk/tree-core";
|
|
15734
|
-
|
|
15735
|
-
// src/utils/config.ts
|
|
15736
|
-
import fs2 from "fs/promises";
|
|
15737
|
-
import path4 from "path";
|
|
15738
|
-
var CONFIG_FILES = [".kodrdrivrc.json", ".kodrdrivrc", "kodrdriv.config.json"];
|
|
15739
|
-
async function loadConfig(cwd = process.cwd()) {
|
|
15740
|
-
const logger2 = getLogger();
|
|
15741
|
-
for (const filename of CONFIG_FILES) {
|
|
15742
|
-
const configPath = path4.join(cwd, filename);
|
|
15743
|
-
try {
|
|
15744
|
-
const content = await fs2.readFile(configPath, "utf-8");
|
|
15745
|
-
const config2 = JSON.parse(content);
|
|
15746
|
-
logger2.verbose(`Loaded configuration from ${configPath}`);
|
|
15747
|
-
return config2;
|
|
15748
|
-
} catch (error48) {
|
|
15749
|
-
if (error48.code !== "ENOENT") {
|
|
15750
|
-
logger2.warn(`CONFIG_LOAD_FAILED: Failed to load configuration file | Path: ${configPath} | Error: ${error48.message} | Action: Using defaults`);
|
|
15751
|
-
}
|
|
15752
|
-
}
|
|
15753
|
-
}
|
|
15754
|
-
logger2.verbose("No configuration file found, using defaults");
|
|
15755
|
-
return null;
|
|
15756
|
-
}
|
|
15757
|
-
|
|
15758
|
-
// src/mcp/resources/workspace.ts
|
|
15759
|
-
var DEFAULT_EXCLUDE_SUBPROJECTS = [
|
|
15803
|
+
var DEFAULT_EXCLUDE_SUBPROJECTS3 = [
|
|
15760
15804
|
"doc/",
|
|
15761
15805
|
"docs/",
|
|
15762
15806
|
"test-*/"
|
|
@@ -15765,7 +15809,7 @@ async function readWorkspaceResource(uri) {
|
|
|
15765
15809
|
const root = uri.path || process.cwd();
|
|
15766
15810
|
try {
|
|
15767
15811
|
const config2 = await loadConfig(root);
|
|
15768
|
-
const excludeSubprojects = config2?.workspace?.excludeSubprojects ??
|
|
15812
|
+
const excludeSubprojects = config2?.workspace?.excludeSubprojects ?? DEFAULT_EXCLUDE_SUBPROJECTS3;
|
|
15769
15813
|
const excludedPatterns = [
|
|
15770
15814
|
"**/node_modules/**",
|
|
15771
15815
|
"**/dist/**",
|
|
@@ -15801,7 +15845,7 @@ async function readWorkspaceResource(uri) {
|
|
|
15801
15845
|
|
|
15802
15846
|
// src/mcp/resources/tree-graph.ts
|
|
15803
15847
|
import { buildDependencyGraph as buildDependencyGraph3, scanForPackageJsonFiles as scanForPackageJsonFiles4 } from "@grunnverk/tree-core";
|
|
15804
|
-
var
|
|
15848
|
+
var DEFAULT_EXCLUDE_SUBPROJECTS4 = [
|
|
15805
15849
|
"doc/",
|
|
15806
15850
|
"docs/",
|
|
15807
15851
|
"test-*/"
|
|
@@ -15810,7 +15854,7 @@ async function readTreeGraphResource(uri) {
|
|
|
15810
15854
|
const root = uri.path || process.cwd();
|
|
15811
15855
|
try {
|
|
15812
15856
|
const config2 = await loadConfig(root);
|
|
15813
|
-
const excludeSubprojects = config2?.workspace?.excludeSubprojects ??
|
|
15857
|
+
const excludeSubprojects = config2?.workspace?.excludeSubprojects ?? DEFAULT_EXCLUDE_SUBPROJECTS4;
|
|
15814
15858
|
const excludedPatterns = [
|
|
15815
15859
|
"**/node_modules/**",
|
|
15816
15860
|
"**/dist/**",
|
|
@@ -15857,7 +15901,7 @@ async function readTreeGraphResource(uri) {
|
|
|
15857
15901
|
import { parsePackageJson, scanForPackageJsonFiles as scanForPackageJsonFiles5 } from "@grunnverk/tree-core";
|
|
15858
15902
|
import { resolve } from "node:path";
|
|
15859
15903
|
import { existsSync } from "node:fs";
|
|
15860
|
-
var
|
|
15904
|
+
var DEFAULT_EXCLUDE_SUBPROJECTS5 = [
|
|
15861
15905
|
"doc/",
|
|
15862
15906
|
"docs/",
|
|
15863
15907
|
"test-*/"
|
|
@@ -15874,7 +15918,7 @@ async function readPackageResource(uri) {
|
|
|
15874
15918
|
} else {
|
|
15875
15919
|
const cwd = process.cwd();
|
|
15876
15920
|
const config2 = await loadConfig(cwd);
|
|
15877
|
-
const excludeSubprojects = config2?.workspace?.excludeSubprojects ??
|
|
15921
|
+
const excludeSubprojects = config2?.workspace?.excludeSubprojects ?? DEFAULT_EXCLUDE_SUBPROJECTS5;
|
|
15878
15922
|
const excludedPatterns = [
|
|
15879
15923
|
"**/node_modules/**",
|
|
15880
15924
|
"**/dist/**",
|