@vibecodetown/mcp-server 2.2.5 → 2.2.6
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// adapters/mcp-ts/src/local-mode/version-lock.ts
|
|
2
2
|
// Version lock management for unified installation
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
|
+
import * as path from "node:path";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
import { getVibeRepoPaths } from "./paths.js";
|
|
6
7
|
export const VersionLockSchema = z.object({
|
|
7
8
|
schema_version: z.literal(1),
|
|
9
|
+
repo_root: z.string().min(1).optional(),
|
|
8
10
|
created_at: z.string(),
|
|
9
11
|
updated_at: z.string(),
|
|
10
12
|
cli: z.object({
|
|
@@ -18,6 +20,7 @@ export const VersionLockSchema = z.object({
|
|
|
18
20
|
});
|
|
19
21
|
/**
|
|
20
22
|
* Read version lock file from repo
|
|
23
|
+
* Auto-injects repo_root if missing (migration for existing files)
|
|
21
24
|
*/
|
|
22
25
|
export function readVersionLock(repoRoot) {
|
|
23
26
|
const paths = getVibeRepoPaths(repoRoot);
|
|
@@ -25,6 +28,10 @@ export function readVersionLock(repoRoot) {
|
|
|
25
28
|
return null;
|
|
26
29
|
try {
|
|
27
30
|
const data = JSON.parse(fs.readFileSync(paths.versionLockFile, "utf-8"));
|
|
31
|
+
// Auto-inject repo_root if missing (migration for existing lock files)
|
|
32
|
+
if (!data.repo_root) {
|
|
33
|
+
data.repo_root = path.resolve(repoRoot);
|
|
34
|
+
}
|
|
28
35
|
return VersionLockSchema.parse(data);
|
|
29
36
|
}
|
|
30
37
|
catch {
|
|
@@ -38,8 +45,11 @@ export function writeVersionLock(repoRoot, cliVersion, engines) {
|
|
|
38
45
|
const paths = getVibeRepoPaths(repoRoot);
|
|
39
46
|
const now = new Date().toISOString();
|
|
40
47
|
const existing = readVersionLock(repoRoot);
|
|
48
|
+
// Store absolute path for later reference (e.g., vibe_pm.update with target=local)
|
|
49
|
+
const absoluteRepoRoot = path.resolve(repoRoot);
|
|
41
50
|
const lock = {
|
|
42
51
|
schema_version: 1,
|
|
52
|
+
repo_root: absoluteRepoRoot,
|
|
43
53
|
created_at: existing?.created_at ?? now,
|
|
44
54
|
updated_at: now,
|
|
45
55
|
cli: { name: "@vibecode/mcp-server", version: cliVersion },
|
|
@@ -4,6 +4,7 @@ import { UpdateInputSchema } from "../../generated/update_input.js";
|
|
|
4
4
|
import { ensureEngines, checkUpdates, clearCache, getEngineHealth, checkRemoteUpdates, updateFromRemote } from "../../bootstrap/installer.js";
|
|
5
5
|
import { ENGINE_SPECS } from "../../bootstrap/registry.js";
|
|
6
6
|
import { invokeCli } from "../../runtime/cli_invoker.js";
|
|
7
|
+
import { readVersionLock } from "../../local-mode/version-lock.js";
|
|
7
8
|
// ============================================================
|
|
8
9
|
// Input/Output Types
|
|
9
10
|
// ============================================================
|
|
@@ -319,7 +320,14 @@ export async function update(input) {
|
|
|
319
320
|
const target = input.target ?? "engines";
|
|
320
321
|
const force = input.force ?? false;
|
|
321
322
|
const targetEngines = input.engines ?? Object.keys(ENGINE_SPECS);
|
|
322
|
-
|
|
323
|
+
// Resolve local path: input > env > version_lock.json
|
|
324
|
+
let localPath = input.local_path ?? process.env.VIBE_LOCAL_DEV_PATH;
|
|
325
|
+
if (!localPath && (target === "local" || target === "all")) {
|
|
326
|
+
const versionLock = readVersionLock(process.cwd());
|
|
327
|
+
if (versionLock?.repo_root) {
|
|
328
|
+
localPath = versionLock.repo_root;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
323
331
|
let engineResults;
|
|
324
332
|
let npmResult;
|
|
325
333
|
let localResult;
|
|
@@ -339,10 +347,10 @@ export async function update(input) {
|
|
|
339
347
|
if (!localPath) {
|
|
340
348
|
localResult = {
|
|
341
349
|
action: "failed",
|
|
342
|
-
path: "",
|
|
350
|
+
path: "(not configured)",
|
|
343
351
|
git_status: "error",
|
|
344
352
|
build_status: "error",
|
|
345
|
-
message: "로컬 경로가 지정되지 않았습니다.
|
|
353
|
+
message: "로컬 경로가 지정되지 않았습니다. 'vibe setup'을 먼저 실행하거나, local_path 파라미터를 지정하세요."
|
|
346
354
|
};
|
|
347
355
|
}
|
|
348
356
|
else {
|