mcp-efficiency-engine 0.1.6 → 0.1.7
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/FINAL_USAGE_GUIDE.md +8 -0
- package/README.md +39 -4
- package/bin/install-host.js +27 -3
- package/package.json +1 -1
- package/scripts/setup/setup-prerequisites.ps1 +30 -2
- package/scripts/setup/validate-context.ps1 +25 -4
package/FINAL_USAGE_GUIDE.md
CHANGED
|
@@ -95,6 +95,14 @@ npm install mcp-efficiency-engine
|
|
|
95
95
|
|
|
96
96
|
Si el entorno bloquea scripts de npm (`allow-scripts`), ejecutar manualmente:
|
|
97
97
|
|
|
98
|
+
```powershell
|
|
99
|
+
npm install mcp-efficiency-engine
|
|
100
|
+
npm approve-scripts mcp-efficiency-engine
|
|
101
|
+
npm rebuild mcp-efficiency-engine
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Alternativa manual equivalente:
|
|
105
|
+
|
|
98
106
|
```powershell
|
|
99
107
|
npx mcp-efficiency-engine install
|
|
100
108
|
npx mcp-efficiency-engine validate -PortableMode
|
package/README.md
CHANGED
|
@@ -190,13 +190,21 @@ Comportamiento esperado:
|
|
|
190
190
|
|
|
191
191
|
- copia al proyecto host los artefactos canonicos del engine (`scripts`, `.github`, `.vscode`, `repo-intake`, `orchestrator`, `policies`, `observability`, `autodocs/schema`, `memory`, etc.)
|
|
192
192
|
- instala motores y herramientas via bootstrap portable
|
|
193
|
-
- si no existe `repo-registry/repos.yml`, pregunta por owner/prefix y
|
|
194
|
-
- si no
|
|
193
|
+
- si no existe `repo-registry/repos.yml`, en modo interactivo pregunta por owner/prefix y repo inicial para intake
|
|
194
|
+
- si la instalacion corre en modo no interactivo (comun en lifecycle scripts de npm), crea automaticamente un repo inicial por defecto: dominio `dev`, location `.`
|
|
195
195
|
|
|
196
196
|
Nota npm (entornos con politicas de scripts):
|
|
197
197
|
|
|
198
|
-
- si `npm` bloquea `install`/`postinstall` (por ejemplo con `allow-scripts`), el scaffold/bootstrapping
|
|
199
|
-
-
|
|
198
|
+
- si `npm` bloquea `install`/`postinstall` (por ejemplo con `allow-scripts`), el scaffold/bootstrapping no se ejecuta automaticamente
|
|
199
|
+
- flujo recomendado en dos pasos:
|
|
200
|
+
|
|
201
|
+
```powershell
|
|
202
|
+
npm install mcp-efficiency-engine
|
|
203
|
+
npm approve-scripts mcp-efficiency-engine
|
|
204
|
+
npm rebuild mcp-efficiency-engine
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
- alternativa manual equivalente:
|
|
200
208
|
|
|
201
209
|
```powershell
|
|
202
210
|
npx mcp-efficiency-engine install
|
|
@@ -217,6 +225,33 @@ npm install -g mcp-efficiency-engine
|
|
|
217
225
|
mcpee install
|
|
218
226
|
```
|
|
219
227
|
|
|
228
|
+
### Cuando se conectan boosts/repos auxiliares
|
|
229
|
+
|
|
230
|
+
Resumen rapido:
|
|
231
|
+
|
|
232
|
+
- `npm install` + `rebuild` instala/configura el engine.
|
|
233
|
+
- La conexion real de boosts/repos ocurre al ejecutar intake.
|
|
234
|
+
- Si no configuras repos adicionales, se usa el repo inicial por defecto.
|
|
235
|
+
|
|
236
|
+
Pasos recomendados despues de instalar:
|
|
237
|
+
|
|
238
|
+
```powershell
|
|
239
|
+
# 1) (Opcional) editar repos auxiliares/boosts
|
|
240
|
+
notepad .\repo-registry\repos.yml
|
|
241
|
+
|
|
242
|
+
# 2) materializar capacidades de todos los repos del registry
|
|
243
|
+
.\scripts\intake\run-repo-intake.cmd
|
|
244
|
+
|
|
245
|
+
# 3) validar que el router ya los ve
|
|
246
|
+
.\scripts\ops\hi.ps1
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Si quieres que te pregunte por owner/prefix/repo inicial en modo asistido, ejecuta:
|
|
250
|
+
|
|
251
|
+
```powershell
|
|
252
|
+
npx mcp-efficiency-engine install
|
|
253
|
+
```
|
|
254
|
+
|
|
220
255
|
### 2) Validación mínima
|
|
221
256
|
|
|
222
257
|
```powershell
|
package/bin/install-host.js
CHANGED
|
@@ -238,6 +238,15 @@ function deriveRepoPrefix(targetRoot, options) {
|
|
|
238
238
|
return `${path.basename(targetRoot).replace(/[^a-zA-Z0-9_-]/g, "-").toLowerCase()}_`;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
function deriveDefaultRepoName(targetRoot, options) {
|
|
242
|
+
if (options.initialRepoName) {
|
|
243
|
+
return options.initialRepoName;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const safeBaseName = path.basename(targetRoot).replace(/[^a-zA-Z0-9_-]/g, "-").toLowerCase();
|
|
247
|
+
return `${deriveRepoPrefix(targetRoot, options)}${safeBaseName}`;
|
|
248
|
+
}
|
|
249
|
+
|
|
241
250
|
function initializeTemplateRegistry(targetRoot, options) {
|
|
242
251
|
const registryPath = path.join(targetRoot, "repo-registry", "repos.yml");
|
|
243
252
|
if (fs.existsSync(registryPath)) {
|
|
@@ -245,14 +254,28 @@ function initializeTemplateRegistry(targetRoot, options) {
|
|
|
245
254
|
}
|
|
246
255
|
|
|
247
256
|
const initScript = path.join(targetRoot, "scripts", "intake", "init-template-registry.ps1");
|
|
257
|
+
const resolvedPrefix = deriveRepoPrefix(targetRoot, options);
|
|
248
258
|
const args = [
|
|
249
259
|
"-Owner",
|
|
250
260
|
options.owner || "your-team",
|
|
251
261
|
"-RepoNamePrefix",
|
|
252
|
-
|
|
253
|
-
"-SkipInitialRepo",
|
|
262
|
+
resolvedPrefix,
|
|
254
263
|
];
|
|
255
264
|
|
|
265
|
+
if (options.skipInitialRepo) {
|
|
266
|
+
args.push("-SkipInitialRepo");
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
args.push(
|
|
270
|
+
"-InitialRepoName",
|
|
271
|
+
deriveDefaultRepoName(targetRoot, options),
|
|
272
|
+
"-InitialRepoDomain",
|
|
273
|
+
options.initialRepoDomain || "dev",
|
|
274
|
+
"-InitialRepoLocation",
|
|
275
|
+
options.initialRepoLocation || ".",
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
256
279
|
return runPowerShell(initScript, args, targetRoot);
|
|
257
280
|
}
|
|
258
281
|
|
|
@@ -314,7 +337,8 @@ function runHostInstall(rawOptions) {
|
|
|
314
337
|
return hookStatus;
|
|
315
338
|
}
|
|
316
339
|
|
|
317
|
-
process.stdout.write("[mcpee] Modo no interactivo detectado. Se inicializo
|
|
340
|
+
process.stdout.write("[mcpee] Modo no interactivo detectado. Se inicializo repos.yml con un repo inicial por defecto y se omitio bootstrap interactivo.\n");
|
|
341
|
+
process.stdout.write("[mcpee] Si npm bloqueo scripts, ejecuta: npm approve-scripts mcp-efficiency-engine ; npm rebuild mcp-efficiency-engine\n");
|
|
318
342
|
return 0;
|
|
319
343
|
}
|
|
320
344
|
|
package/package.json
CHANGED
|
@@ -143,6 +143,27 @@ function Ensure-PythonModuleInstalled {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
function Sync-GraphifyArtifactsFromScripts {
|
|
147
|
+
$scriptsGraphPath = 'scripts/graphify-out/graph.json'
|
|
148
|
+
$contextGraphDir = 'context/graphify-out'
|
|
149
|
+
$contextGraphPath = Join-Path $contextGraphDir 'graph.json'
|
|
150
|
+
|
|
151
|
+
if (-not (Test-Path $scriptsGraphPath)) {
|
|
152
|
+
return $false
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
New-Item -ItemType Directory -Path $contextGraphDir -Force | Out-Null
|
|
156
|
+
Copy-Item -Path $scriptsGraphPath -Destination $contextGraphPath -Force
|
|
157
|
+
|
|
158
|
+
$scriptsManifestPath = 'scripts/graphify-out/manifest.json'
|
|
159
|
+
$contextManifestPath = Join-Path $contextGraphDir 'manifest.json'
|
|
160
|
+
if (Test-Path $scriptsManifestPath) {
|
|
161
|
+
Copy-Item -Path $scriptsManifestPath -Destination $contextManifestPath -Force
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return $true
|
|
165
|
+
}
|
|
166
|
+
|
|
146
167
|
Write-Host '== MCP platform prerequisites setup =='
|
|
147
168
|
|
|
148
169
|
$toolingManifest = Get-ToolingManifest -Path $toolingManifestPath
|
|
@@ -212,8 +233,15 @@ if (-not $SkipGraphify) {
|
|
|
212
233
|
}
|
|
213
234
|
|
|
214
235
|
if (-not (Test-Path 'context/graphify-out/graph.json')) {
|
|
215
|
-
Write-Host '[setup] graphify
|
|
216
|
-
& $pyCmd @pyArgs -m graphify
|
|
236
|
+
Write-Host '[setup] graphify update scripts --no-cluster'
|
|
237
|
+
& $pyCmd @pyArgs -m graphify update scripts --no-cluster
|
|
238
|
+
if ($LASTEXITCODE -ne 0) {
|
|
239
|
+
throw "graphify update failed with exit code $LASTEXITCODE"
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (Sync-GraphifyArtifactsFromScripts) {
|
|
243
|
+
Write-Host '[ok] graphify output synced from scripts/graphify-out to context/graphify-out'
|
|
244
|
+
}
|
|
217
245
|
}
|
|
218
246
|
else {
|
|
219
247
|
Write-Host '[ok] context/graphify-out/graph.json already exists'
|
|
@@ -69,6 +69,24 @@ function Write-SetupValidationReport {
|
|
|
69
69
|
$Report | ConvertTo-Json -Depth 20 | Set-Content -Path $Path -Encoding utf8
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
function Sync-GraphifyArtifactsIfNeeded {
|
|
73
|
+
$contextGraphDir = Join-Path $repoRoot 'context/graphify-out'
|
|
74
|
+
$contextGraphPath = Join-Path $contextGraphDir 'graph.json'
|
|
75
|
+
$scriptsGraphDir = Join-Path $repoRoot 'scripts/graphify-out'
|
|
76
|
+
$scriptsGraphPath = Join-Path $scriptsGraphDir 'graph.json'
|
|
77
|
+
|
|
78
|
+
if ((-not (Test-Path $contextGraphPath)) -and (Test-Path $scriptsGraphPath)) {
|
|
79
|
+
New-Item -ItemType Directory -Path $contextGraphDir -Force | Out-Null
|
|
80
|
+
Copy-Item -Path $scriptsGraphPath -Destination $contextGraphPath -Force
|
|
81
|
+
|
|
82
|
+
$scriptsManifestPath = Join-Path $scriptsGraphDir 'manifest.json'
|
|
83
|
+
$contextManifestPath = Join-Path $contextGraphDir 'manifest.json'
|
|
84
|
+
if ((-not (Test-Path $contextManifestPath)) -and (Test-Path $scriptsManifestPath)) {
|
|
85
|
+
Copy-Item -Path $scriptsManifestPath -Destination $contextManifestPath -Force
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
72
90
|
# Ensure report directory exists
|
|
73
91
|
$reportDir = Split-Path -Parent $setupValidationReportPath
|
|
74
92
|
if (-not (Test-Path $reportDir)) {
|
|
@@ -192,8 +210,9 @@ if ($toolingManifest -and ($toolingManifest.PSObject.Properties.Name -contains '
|
|
|
192
210
|
|
|
193
211
|
try {
|
|
194
212
|
$mcpRaw = Get-Content -Raw -Path '.vscode/mcp.json' | ConvertFrom-Json -Depth 20
|
|
195
|
-
|
|
196
|
-
|
|
213
|
+
$gitnexusCommand = [string]$mcpRaw.servers.gitnexus.command
|
|
214
|
+
if ($gitnexusCommand -eq 'npx') {
|
|
215
|
+
$errors += 'MCP gitnexus command should avoid `npx` (startup latency). Use local `gitnexus` or local wrapper script.'
|
|
197
216
|
}
|
|
198
217
|
$scanLimit = 0
|
|
199
218
|
$gitnexusHasEnv = ($mcpRaw.servers.gitnexus.PSObject.Properties.Name -contains 'env')
|
|
@@ -215,6 +234,8 @@ catch {
|
|
|
215
234
|
$errors += "Unable to parse .vscode/mcp.json: $($_.Exception.Message)"
|
|
216
235
|
}
|
|
217
236
|
|
|
237
|
+
Sync-GraphifyArtifactsIfNeeded
|
|
238
|
+
|
|
218
239
|
$specFiles = @(
|
|
219
240
|
"specs/architecture.spec.md",
|
|
220
241
|
"specs/azure-rag.spec.md",
|
|
@@ -332,9 +353,9 @@ else {
|
|
|
332
353
|
}
|
|
333
354
|
}
|
|
334
355
|
|
|
335
|
-
if (-not (Test-Path "context/graphify-out/graph.json")) {
|
|
356
|
+
if ((-not (Test-Path "context/graphify-out/graph.json")) -and (-not (Test-Path "scripts/graphify-out/graph.json"))) {
|
|
336
357
|
if (-not ($CIMode)) {
|
|
337
|
-
$errors += "Missing
|
|
358
|
+
$errors += "Missing graphify graph output. Run: py -3.14 -m graphify update scripts --no-cluster"
|
|
338
359
|
}
|
|
339
360
|
}
|
|
340
361
|
|