devsmind-mcp 4.2.0 → 4.3.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/README.md +27 -2
- package/dist/cli/add-repo.d.ts +20 -0
- package/dist/cli/add-repo.js +171 -0
- package/dist/cli/add-repo.js.map +1 -0
- package/dist/cli/branch.d.ts +24 -0
- package/dist/cli/branch.js +148 -0
- package/dist/cli/branch.js.map +1 -0
- package/dist/cli/index.js +54 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.js +6 -28
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/integrations/memory-topics.js +1 -1
- package/dist/cli/integrations/memory-topics.js.map +1 -1
- package/dist/cli/integrations/prompt.d.ts +9 -0
- package/dist/cli/integrations/prompt.js +21 -0
- package/dist/cli/integrations/prompt.js.map +1 -1
- package/dist/cli/integrations/registry.d.ts +22 -6
- package/dist/cli/integrations/registry.js +68 -7
- package/dist/cli/integrations/registry.js.map +1 -1
- package/dist/cli/integrations/skill.d.ts +16 -10
- package/dist/cli/integrations/skill.js +108 -22
- package/dist/cli/integrations/skill.js.map +1 -1
- package/dist/cli/llm-client.js +15 -7
- package/dist/cli/llm-client.js.map +1 -1
- package/dist/cli/rule.js +2 -2
- package/dist/cli/rule.js.map +1 -1
- package/dist/cli/runner.d.ts +8 -0
- package/dist/cli/runner.js +12 -5
- package/dist/cli/runner.js.map +1 -1
- package/dist/cli/sync.d.ts +16 -0
- package/dist/cli/sync.js +80 -0
- package/dist/cli/sync.js.map +1 -1
- package/dist/db/database.d.ts +11 -0
- package/dist/db/database.js +25 -0
- package/dist/db/database.js.map +1 -1
- package/dist/db/indexer.d.ts +1 -1
- package/dist/db/indexer.js +3 -3
- package/dist/db/indexer.js.map +1 -1
- package/dist/mcp/server.js +342 -33
- package/dist/mcp/server.js.map +1 -1
- package/dist/utils/config.d.ts +26 -0
- package/dist/utils/config.js +42 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/devsmind-branch.d.ts +55 -0
- package/dist/utils/devsmind-branch.js +244 -0
- package/dist/utils/devsmind-branch.js.map +1 -0
- package/package.json +1 -1
package/dist/utils/config.d.ts
CHANGED
|
@@ -111,5 +111,31 @@ export declare function loadProjectContext(devmindPath: string): ProjectContext;
|
|
|
111
111
|
* Resolve absolute repo path based on mode.
|
|
112
112
|
*/
|
|
113
113
|
export declare function resolveRepoPath(context: ProjectContext, repoName: string): string | null;
|
|
114
|
+
/** True for a standalone-mode brain (`.devsmind/` living apart from the repos it tracks, each
|
|
115
|
+
* repo's local path recorded per-machine in `.env`) — as opposed to embedded mode, where the
|
|
116
|
+
* brain sits inside the one repo it covers and repo paths are relative, not per-machine. */
|
|
117
|
+
export declare function isStandaloneMode(config: DevMindConfig): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Standalone-mode repos split three ways against `.env`: `ok` (a `path_key` entry that exists
|
|
120
|
+
* and resolves to a real directory), `missing` (no entry in `.env` at all — e.g. a repo a
|
|
121
|
+
* teammate added that this machine hasn't configured yet), and `invalid` (an entry present but
|
|
122
|
+
* the path no longer exists on disk — moved, renamed, or a stale value carried over). Embedded
|
|
123
|
+
* mode has no such split (its paths are relative, not per-machine), so it always returns all-`ok`.
|
|
124
|
+
*
|
|
125
|
+
* The exact scan `devsmind init`'s existing-brain path-repair step already did inline — extracted
|
|
126
|
+
* here so `devsmind sync`/`devsmind pull` can run the same check as their own reconciliation
|
|
127
|
+
* trigger, not a second hand-rolled copy of it.
|
|
128
|
+
*/
|
|
129
|
+
export declare function findMissingStandaloneRepoPaths(config: DevMindConfig, env: Record<string, string>): {
|
|
130
|
+
ok: {
|
|
131
|
+
repo: StandaloneRepoConfig;
|
|
132
|
+
currentPath: string;
|
|
133
|
+
}[];
|
|
134
|
+
missing: StandaloneRepoConfig[];
|
|
135
|
+
invalid: {
|
|
136
|
+
repo: StandaloneRepoConfig;
|
|
137
|
+
currentPath: string;
|
|
138
|
+
}[];
|
|
139
|
+
};
|
|
114
140
|
/** Canonicalizes drive letter to lowercase on Windows for case-insensitive matching. */
|
|
115
141
|
export declare function canonicalizePath(p: string): string;
|
package/dist/utils/config.js
CHANGED
|
@@ -41,6 +41,8 @@ exports.resolveDevmindDir = resolveDevmindDir;
|
|
|
41
41
|
exports.recoverSpaceSplitPath = recoverSpaceSplitPath;
|
|
42
42
|
exports.loadProjectContext = loadProjectContext;
|
|
43
43
|
exports.resolveRepoPath = resolveRepoPath;
|
|
44
|
+
exports.isStandaloneMode = isStandaloneMode;
|
|
45
|
+
exports.findMissingStandaloneRepoPaths = findMissingStandaloneRepoPaths;
|
|
44
46
|
exports.canonicalizePath = canonicalizePath;
|
|
45
47
|
const fs = __importStar(require("fs"));
|
|
46
48
|
const path = __importStar(require("path"));
|
|
@@ -203,6 +205,46 @@ function resolveRepoPath(context, repoName) {
|
|
|
203
205
|
return null;
|
|
204
206
|
}
|
|
205
207
|
}
|
|
208
|
+
/** True for a standalone-mode brain (`.devsmind/` living apart from the repos it tracks, each
|
|
209
|
+
* repo's local path recorded per-machine in `.env`) — as opposed to embedded mode, where the
|
|
210
|
+
* brain sits inside the one repo it covers and repo paths are relative, not per-machine. */
|
|
211
|
+
function isStandaloneMode(config) {
|
|
212
|
+
return config.mode === 'standalone';
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Standalone-mode repos split three ways against `.env`: `ok` (a `path_key` entry that exists
|
|
216
|
+
* and resolves to a real directory), `missing` (no entry in `.env` at all — e.g. a repo a
|
|
217
|
+
* teammate added that this machine hasn't configured yet), and `invalid` (an entry present but
|
|
218
|
+
* the path no longer exists on disk — moved, renamed, or a stale value carried over). Embedded
|
|
219
|
+
* mode has no such split (its paths are relative, not per-machine), so it always returns all-`ok`.
|
|
220
|
+
*
|
|
221
|
+
* The exact scan `devsmind init`'s existing-brain path-repair step already did inline — extracted
|
|
222
|
+
* here so `devsmind sync`/`devsmind pull` can run the same check as their own reconciliation
|
|
223
|
+
* trigger, not a second hand-rolled copy of it.
|
|
224
|
+
*/
|
|
225
|
+
function findMissingStandaloneRepoPaths(config, env) {
|
|
226
|
+
const ok = [];
|
|
227
|
+
const missing = [];
|
|
228
|
+
const invalid = [];
|
|
229
|
+
if (!isStandaloneMode(config))
|
|
230
|
+
return { ok, missing, invalid };
|
|
231
|
+
for (const repo of config.repos) {
|
|
232
|
+
if (!('path_key' in repo) || !repo.path_key)
|
|
233
|
+
continue;
|
|
234
|
+
const standaloneRepo = repo;
|
|
235
|
+
const currentPath = env[repo.path_key];
|
|
236
|
+
if (!currentPath) {
|
|
237
|
+
missing.push(standaloneRepo);
|
|
238
|
+
}
|
|
239
|
+
else if (!fs.existsSync(path.resolve(currentPath))) {
|
|
240
|
+
invalid.push({ repo: standaloneRepo, currentPath });
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
ok.push({ repo: standaloneRepo, currentPath });
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return { ok, missing, invalid };
|
|
247
|
+
}
|
|
206
248
|
/** Canonicalizes drive letter to lowercase on Windows for case-insensitive matching. */
|
|
207
249
|
function canonicalizePath(p) {
|
|
208
250
|
if (!p)
|
package/dist/utils/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,0CAOC;AAWD,8CAEC;AAUD,oCASC;AAWD,8CAMC;AAgBD,sDAQC;AAKD,gDA2BC;AAKD,0CAmBC;AAGD,4CAOC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,0CAOC;AAWD,8CAEC;AAUD,oCASC;AAWD,8CAMC;AAgBD,sDAQC;AAKD,gDA2BC;AAKD,0CAmBC;AAKD,4CAEC;AAaD,wEAwBC;AAGD,4CAOC;AA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AAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,SAAS;QACtD,MAAM,cAAc,GAAG,IAA4B,CAAC;QACpD,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/B,CAAC;aAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;YACrD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,CAAC;QACtD,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAClC,CAAC;AAED,wFAAwF;AACxF,SAAgB,gBAAgB,CAAC,CAAS;IACxC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjB,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChE,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `devsmind push` / `devsmind pull` — moves the churny, multi-hundred-file part of a brain
|
|
3
|
+
* (`graph/`, `history/`, `vectors/`, `workflows/`) onto its own `devsmind` branch, decoupled
|
|
4
|
+
* from whatever code branch you're actually working on. `config.json` deliberately stays on
|
|
5
|
+
* the code branch (see CHANGELOG 4.3.0) — it's what lets a fresh clone recognize "this repo
|
|
6
|
+
* has a brain" before anyone has pulled the `devsmind` branch at all.
|
|
7
|
+
*
|
|
8
|
+
* Implemented via a throwaway `git worktree`, never a checkout of the caller's actual branch:
|
|
9
|
+
* the working tree, HEAD, and index the user is looking at are never touched. A stash-based
|
|
10
|
+
* "stash → checkout → pop → checkout back" approach was considered and rejected — it mutates
|
|
11
|
+
* the user's real working directory mid-flight, and any interruption (crash, conflict on pop)
|
|
12
|
+
* leaves the repo straddling two branches with a stash floating around. A worktree can't do
|
|
13
|
+
* that: it's a separate directory, cleaned up in a `finally`, and the real branch never moves.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEVSMIND_BRANCH = "devsmind";
|
|
16
|
+
/** The subset of a brain that lives on the `devsmind` branch — the actual source of PR/commit
|
|
17
|
+
* noise. `config.json` (and LOCAL-only `.env`/`brain.db`/`local/`/scratchpads) are deliberately
|
|
18
|
+
* excluded; see the module doc above. */
|
|
19
|
+
export declare const DEVSMIND_BRANCH_SUBDIRS: readonly ["graph", "history", "vectors", "workflows"];
|
|
20
|
+
export interface PushResult {
|
|
21
|
+
/** false only when there was literally nothing to commit (working tree already matched). */
|
|
22
|
+
committed: boolean;
|
|
23
|
+
pushed: boolean;
|
|
24
|
+
remote: string | null;
|
|
25
|
+
branch: string;
|
|
26
|
+
commit: string | null;
|
|
27
|
+
filesChanged: number;
|
|
28
|
+
repoRoot: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PullResult {
|
|
31
|
+
/** false when the `devsmind` branch doesn't exist yet, locally or on the remote. */
|
|
32
|
+
found: boolean;
|
|
33
|
+
fromRemote: boolean;
|
|
34
|
+
remote: string | null;
|
|
35
|
+
branch: string;
|
|
36
|
+
commit: string | null;
|
|
37
|
+
/** Subdirs actually copied down (present on the branch, or removed locally because they're
|
|
38
|
+
* no longer on it). Not a content diff — just what this pull touched on disk. */
|
|
39
|
+
subdirsSynced: string[];
|
|
40
|
+
repoRoot: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Commits the current `graph/history/vectors/workflows` state onto the `devsmind` branch and
|
|
44
|
+
* pushes it, without touching the caller's actual checked-out branch. A no-op (returns
|
|
45
|
+
* `committed:false`) when nothing under those subdirs has changed since the last push.
|
|
46
|
+
*/
|
|
47
|
+
export declare function pushDevsmindBranch(devmindDir: string, message: string): PushResult;
|
|
48
|
+
/**
|
|
49
|
+
* Copies `graph/history/vectors/workflows` down from the `devsmind` branch (remote-tracking
|
|
50
|
+
* ref preferred when a remote exists) into the real `.devsmind/` on disk, replacing each
|
|
51
|
+
* subdir wholesale so deletions/renames on the branch propagate too. Does NOT run
|
|
52
|
+
* `devsmind sync` itself — callers own that, since only they know whether a DB connection is
|
|
53
|
+
* already open (the MCP server) or needs to be (the CLI).
|
|
54
|
+
*/
|
|
55
|
+
export declare function pullDevsmindBranch(devmindDir: string): PullResult;
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DEVSMIND_BRANCH_SUBDIRS = exports.DEVSMIND_BRANCH = void 0;
|
|
37
|
+
exports.pushDevsmindBranch = pushDevsmindBranch;
|
|
38
|
+
exports.pullDevsmindBranch = pullDevsmindBranch;
|
|
39
|
+
const child_process_1 = require("child_process");
|
|
40
|
+
const crypto = __importStar(require("crypto"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const os = __importStar(require("os"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
/**
|
|
45
|
+
* `devsmind push` / `devsmind pull` — moves the churny, multi-hundred-file part of a brain
|
|
46
|
+
* (`graph/`, `history/`, `vectors/`, `workflows/`) onto its own `devsmind` branch, decoupled
|
|
47
|
+
* from whatever code branch you're actually working on. `config.json` deliberately stays on
|
|
48
|
+
* the code branch (see CHANGELOG 4.3.0) — it's what lets a fresh clone recognize "this repo
|
|
49
|
+
* has a brain" before anyone has pulled the `devsmind` branch at all.
|
|
50
|
+
*
|
|
51
|
+
* Implemented via a throwaway `git worktree`, never a checkout of the caller's actual branch:
|
|
52
|
+
* the working tree, HEAD, and index the user is looking at are never touched. A stash-based
|
|
53
|
+
* "stash → checkout → pop → checkout back" approach was considered and rejected — it mutates
|
|
54
|
+
* the user's real working directory mid-flight, and any interruption (crash, conflict on pop)
|
|
55
|
+
* leaves the repo straddling two branches with a stash floating around. A worktree can't do
|
|
56
|
+
* that: it's a separate directory, cleaned up in a `finally`, and the real branch never moves.
|
|
57
|
+
*/
|
|
58
|
+
exports.DEVSMIND_BRANCH = 'devsmind';
|
|
59
|
+
/** The subset of a brain that lives on the `devsmind` branch — the actual source of PR/commit
|
|
60
|
+
* noise. `config.json` (and LOCAL-only `.env`/`brain.db`/`local/`/scratchpads) are deliberately
|
|
61
|
+
* excluded; see the module doc above. */
|
|
62
|
+
exports.DEVSMIND_BRANCH_SUBDIRS = ['graph', 'history', 'vectors', 'workflows'];
|
|
63
|
+
/** Runs `git <args>` via argv (never a shell string) — the commit message and paths passed
|
|
64
|
+
* through this module can be arbitrary text, so nothing here may go through `execSync`'s
|
|
65
|
+
* shell interpolation. Never throws; callers check `.ok`. */
|
|
66
|
+
function git(cwd, args) {
|
|
67
|
+
const res = (0, child_process_1.spawnSync)('git', args, { cwd, encoding: 'utf-8' });
|
|
68
|
+
return { ok: res.status === 0, stdout: (res.stdout || '').trim(), stderr: (res.stderr || '').trim() };
|
|
69
|
+
}
|
|
70
|
+
function gitOrThrow(cwd, args, errPrefix) {
|
|
71
|
+
const res = git(cwd, args);
|
|
72
|
+
if (!res.ok)
|
|
73
|
+
throw new Error(`${errPrefix}: ${res.stderr || res.stdout || `git ${args.join(' ')} failed`}`);
|
|
74
|
+
return res.stdout;
|
|
75
|
+
}
|
|
76
|
+
function findRepoRoot(devmindDir) {
|
|
77
|
+
const res = git(devmindDir, ['rev-parse', '--show-toplevel']);
|
|
78
|
+
if (!res.ok) {
|
|
79
|
+
throw new Error(`"${devmindDir}" is not inside a git repository — devsmind push/pull needs one (this is separate from ` +
|
|
80
|
+
`whichever repos the brain tracks). Run "git init" there first.`);
|
|
81
|
+
}
|
|
82
|
+
return path.resolve(res.stdout);
|
|
83
|
+
}
|
|
84
|
+
/** `origin` if present, else whatever single remote exists, else none. */
|
|
85
|
+
function detectRemote(repoRoot) {
|
|
86
|
+
const res = git(repoRoot, ['remote']);
|
|
87
|
+
if (!res.ok || !res.stdout)
|
|
88
|
+
return null;
|
|
89
|
+
const remotes = res.stdout.split('\n').map(l => l.trim()).filter(Boolean);
|
|
90
|
+
if (remotes.includes('origin'))
|
|
91
|
+
return 'origin';
|
|
92
|
+
return remotes[0] ?? null;
|
|
93
|
+
}
|
|
94
|
+
function branchExistsLocally(repoRoot) {
|
|
95
|
+
return git(repoRoot, ['show-ref', '--verify', '--quiet', `refs/heads/${exports.DEVSMIND_BRANCH}`]).ok;
|
|
96
|
+
}
|
|
97
|
+
function branchExistsOnRemote(repoRoot, remote) {
|
|
98
|
+
if (!remote)
|
|
99
|
+
return false;
|
|
100
|
+
return git(repoRoot, ['show-ref', '--verify', '--quiet', `refs/remotes/${remote}/${exports.DEVSMIND_BRANCH}`]).ok;
|
|
101
|
+
}
|
|
102
|
+
function uniqueWorktreeDir() {
|
|
103
|
+
return path.join(os.tmpdir(), `devsmind-branch-${crypto.randomUUID()}`);
|
|
104
|
+
}
|
|
105
|
+
/** Always run from a `finally` — best-effort on every step so a failed push/pull never leaves
|
|
106
|
+
* a dangling worktree registration behind. */
|
|
107
|
+
function removeWorktree(repoRoot, worktreeDir) {
|
|
108
|
+
git(repoRoot, ['worktree', 'remove', worktreeDir, '--force']);
|
|
109
|
+
try {
|
|
110
|
+
if (fs.existsSync(worktreeDir))
|
|
111
|
+
fs.rmSync(worktreeDir, { recursive: true, force: true });
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// best-effort cleanup only
|
|
115
|
+
}
|
|
116
|
+
git(repoRoot, ['worktree', 'prune']);
|
|
117
|
+
}
|
|
118
|
+
/** Sets up `worktreeDir` checked out to the `devsmind` branch, creating it if it exists
|
|
119
|
+
* nowhere yet — as an ORPHAN (no source code in its tree at all, just `.devsmind/`), not a
|
|
120
|
+
* divergent copy of whatever code branch happened to be checked out when it was first made. */
|
|
121
|
+
function setUpPushWorktree(repoRoot, worktreeDir, remote) {
|
|
122
|
+
if (branchExistsLocally(repoRoot)) {
|
|
123
|
+
gitOrThrow(repoRoot, ['worktree', 'add', worktreeDir, exports.DEVSMIND_BRANCH], 'devsmind push: could not check out the devsmind branch');
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (branchExistsOnRemote(repoRoot, remote)) {
|
|
127
|
+
gitOrThrow(repoRoot, ['worktree', 'add', '-b', exports.DEVSMIND_BRANCH, worktreeDir, `${remote}/${exports.DEVSMIND_BRANCH}`], 'devsmind push: could not track the remote devsmind branch');
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const head = git(repoRoot, ['rev-parse', 'HEAD']);
|
|
131
|
+
if (!head.ok)
|
|
132
|
+
throw new Error('devsmind push: this repository has no commits yet — make at least one commit first.');
|
|
133
|
+
gitOrThrow(repoRoot, ['worktree', 'add', '--detach', worktreeDir, head.stdout], 'devsmind push: could not create a scratch worktree');
|
|
134
|
+
gitOrThrow(worktreeDir, ['checkout', '--orphan', exports.DEVSMIND_BRANCH], 'devsmind push: could not create the devsmind branch');
|
|
135
|
+
// --orphan populates the working tree from the detached HEAD it branched off; clear it so
|
|
136
|
+
// the new branch starts holding nothing but the .devsmind/ subset we're about to write in.
|
|
137
|
+
const hasFiles = fs.readdirSync(worktreeDir).some(f => f !== '.git');
|
|
138
|
+
if (hasFiles)
|
|
139
|
+
gitOrThrow(worktreeDir, ['rm', '-rf', '--quiet', '.'], 'devsmind push: could not clear the new branch tree');
|
|
140
|
+
}
|
|
141
|
+
function replaceDir(source, target) {
|
|
142
|
+
const sourceExists = fs.existsSync(source);
|
|
143
|
+
const targetExisted = fs.existsSync(target);
|
|
144
|
+
if (!sourceExists && !targetExisted)
|
|
145
|
+
return false;
|
|
146
|
+
if (targetExisted)
|
|
147
|
+
fs.rmSync(target, { recursive: true, force: true });
|
|
148
|
+
if (sourceExists) {
|
|
149
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
150
|
+
fs.cpSync(source, target, { recursive: true });
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Commits the current `graph/history/vectors/workflows` state onto the `devsmind` branch and
|
|
156
|
+
* pushes it, without touching the caller's actual checked-out branch. A no-op (returns
|
|
157
|
+
* `committed:false`) when nothing under those subdirs has changed since the last push.
|
|
158
|
+
*/
|
|
159
|
+
function pushDevsmindBranch(devmindDir, message) {
|
|
160
|
+
if (!message || !message.trim())
|
|
161
|
+
throw new Error('devsmind push: a commit message is required.');
|
|
162
|
+
const repoRoot = findRepoRoot(devmindDir);
|
|
163
|
+
const remote = detectRemote(repoRoot);
|
|
164
|
+
// Best-effort: so a brand-new local devsmind branch doesn't fork from work a teammate
|
|
165
|
+
// already pushed. Silently skipped if offline or the branch doesn't exist remotely yet.
|
|
166
|
+
if (remote)
|
|
167
|
+
git(repoRoot, ['fetch', remote, exports.DEVSMIND_BRANCH]);
|
|
168
|
+
const worktreeDir = uniqueWorktreeDir();
|
|
169
|
+
try {
|
|
170
|
+
setUpPushWorktree(repoRoot, worktreeDir, remote);
|
|
171
|
+
for (const sub of exports.DEVSMIND_BRANCH_SUBDIRS) {
|
|
172
|
+
replaceDir(path.join(devmindDir, sub), path.join(worktreeDir, '.devsmind', sub));
|
|
173
|
+
}
|
|
174
|
+
gitOrThrow(worktreeDir, ['add', '-A', '.devsmind'], 'devsmind push: staging failed');
|
|
175
|
+
const status = git(worktreeDir, ['status', '--porcelain', '--', '.devsmind']);
|
|
176
|
+
const filesChanged = status.stdout ? status.stdout.split('\n').filter(Boolean).length : 0;
|
|
177
|
+
let committed = false;
|
|
178
|
+
if (filesChanged > 0) {
|
|
179
|
+
gitOrThrow(worktreeDir, ['commit', '-m', message], 'devsmind push: commit failed');
|
|
180
|
+
committed = true;
|
|
181
|
+
}
|
|
182
|
+
const commit = gitOrThrow(worktreeDir, ['rev-parse', 'HEAD'], 'devsmind push: could not read the commit hash');
|
|
183
|
+
// Even with nothing new THIS run, the branch may already be ahead of the remote — e.g. an
|
|
184
|
+
// earlier run committed successfully but its push failed (network blip). Don't silently
|
|
185
|
+
// strand that commit: push whenever local and remote disagree, not only on a fresh commit.
|
|
186
|
+
if (!committed && remote) {
|
|
187
|
+
const remoteHead = git(worktreeDir, ['rev-parse', `${remote}/${exports.DEVSMIND_BRANCH}`]);
|
|
188
|
+
if (remoteHead.ok && remoteHead.stdout === commit) {
|
|
189
|
+
return { committed: false, pushed: false, remote, branch: exports.DEVSMIND_BRANCH, commit, filesChanged: 0, repoRoot };
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else if (!committed && !remote) {
|
|
193
|
+
return { committed: false, pushed: false, remote, branch: exports.DEVSMIND_BRANCH, commit, filesChanged: 0, repoRoot };
|
|
194
|
+
}
|
|
195
|
+
let pushed = false;
|
|
196
|
+
if (remote) {
|
|
197
|
+
const res = git(worktreeDir, ['push', '-u', remote, exports.DEVSMIND_BRANCH]);
|
|
198
|
+
if (!res.ok) {
|
|
199
|
+
throw new Error(`${committed ? `Committed locally on ${exports.DEVSMIND_BRANCH} (${commit.slice(0, 8)}), but push` : 'Push'} to ${remote}/${exports.DEVSMIND_BRANCH} failed: ` +
|
|
200
|
+
`${res.stderr || res.stdout}. Someone else may have pushed since you last pulled — run "devsmind pull" and try again.`);
|
|
201
|
+
}
|
|
202
|
+
pushed = true;
|
|
203
|
+
}
|
|
204
|
+
return { committed, pushed, remote, branch: exports.DEVSMIND_BRANCH, commit, filesChanged, repoRoot };
|
|
205
|
+
}
|
|
206
|
+
finally {
|
|
207
|
+
removeWorktree(repoRoot, worktreeDir);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Copies `graph/history/vectors/workflows` down from the `devsmind` branch (remote-tracking
|
|
212
|
+
* ref preferred when a remote exists) into the real `.devsmind/` on disk, replacing each
|
|
213
|
+
* subdir wholesale so deletions/renames on the branch propagate too. Does NOT run
|
|
214
|
+
* `devsmind sync` itself — callers own that, since only they know whether a DB connection is
|
|
215
|
+
* already open (the MCP server) or needs to be (the CLI).
|
|
216
|
+
*/
|
|
217
|
+
function pullDevsmindBranch(devmindDir) {
|
|
218
|
+
const repoRoot = findRepoRoot(devmindDir);
|
|
219
|
+
const remote = detectRemote(repoRoot);
|
|
220
|
+
if (remote)
|
|
221
|
+
git(repoRoot, ['fetch', remote, exports.DEVSMIND_BRANCH]); // best-effort, offline-safe
|
|
222
|
+
const fromRemote = branchExistsOnRemote(repoRoot, remote);
|
|
223
|
+
const fromLocal = branchExistsLocally(repoRoot);
|
|
224
|
+
if (!fromRemote && !fromLocal) {
|
|
225
|
+
return { found: false, fromRemote: false, remote, branch: exports.DEVSMIND_BRANCH, commit: null, subdirsSynced: [], repoRoot };
|
|
226
|
+
}
|
|
227
|
+
const worktreeDir = uniqueWorktreeDir();
|
|
228
|
+
try {
|
|
229
|
+
const checkoutRef = fromRemote && remote ? `${remote}/${exports.DEVSMIND_BRANCH}` : exports.DEVSMIND_BRANCH;
|
|
230
|
+
gitOrThrow(repoRoot, ['worktree', 'add', '--detach', worktreeDir, checkoutRef], 'devsmind pull: could not read the devsmind branch');
|
|
231
|
+
const subdirsSynced = [];
|
|
232
|
+
for (const sub of exports.DEVSMIND_BRANCH_SUBDIRS) {
|
|
233
|
+
const changed = replaceDir(path.join(worktreeDir, '.devsmind', sub), path.join(devmindDir, sub));
|
|
234
|
+
if (changed)
|
|
235
|
+
subdirsSynced.push(sub);
|
|
236
|
+
}
|
|
237
|
+
const commit = gitOrThrow(worktreeDir, ['rev-parse', 'HEAD'], 'devsmind pull: could not read the commit hash');
|
|
238
|
+
return { found: true, fromRemote, remote, branch: exports.DEVSMIND_BRANCH, commit, subdirsSynced, repoRoot };
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
removeWorktree(repoRoot, worktreeDir);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=devsmind-branch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devsmind-branch.js","sourceRoot":"","sources":["../../src/utils/devsmind-branch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKA,gDAwDC;AASD,gDA2BC;AA7PD,iDAA0C;AAC1C,+CAAiC;AACjC,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B;;;;;;;;;;;;;GAaG;AAEU,QAAA,eAAe,GAAG,UAAU,CAAC;AAE1C;;0CAE0C;AAC7B,QAAA,uBAAuB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAgC7F;;8DAE8D;AAC9D,SAAS,GAAG,CAAC,GAAW,EAAE,IAAc;IACtC,MAAM,GAAG,GAAG,IAAA,yBAAS,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACxG,CAAC;AAED,SAAS,UAAU,CAAC,GAAW,EAAE,IAAc,EAAE,SAAiB;IAChE,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,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