@saleem11kh/repomem 0.4.0 → 0.5.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.
Files changed (48) hide show
  1. package/README.md +655 -462
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +230 -14
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config/config.d.ts +20 -0
  6. package/dist/config/config.d.ts.map +1 -1
  7. package/dist/config/config.js +1 -0
  8. package/dist/config/config.js.map +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +9 -10
  11. package/dist/index.js.map +1 -1
  12. package/dist/store/adr.d.ts +22 -0
  13. package/dist/store/adr.d.ts.map +1 -0
  14. package/dist/store/adr.js +201 -0
  15. package/dist/store/adr.js.map +1 -0
  16. package/dist/store/capture.d.ts +39 -0
  17. package/dist/store/capture.d.ts.map +1 -0
  18. package/dist/store/capture.js +148 -0
  19. package/dist/store/capture.js.map +1 -0
  20. package/dist/store/embeddings.d.ts +34 -0
  21. package/dist/store/embeddings.d.ts.map +1 -0
  22. package/dist/store/embeddings.js +250 -0
  23. package/dist/store/embeddings.js.map +1 -0
  24. package/dist/store/file-store.d.ts +25 -0
  25. package/dist/store/file-store.d.ts.map +1 -1
  26. package/dist/store/file-store.js +76 -12
  27. package/dist/store/file-store.js.map +1 -1
  28. package/dist/store/git.d.ts +29 -5
  29. package/dist/store/git.d.ts.map +1 -1
  30. package/dist/store/git.js +68 -6
  31. package/dist/store/git.js.map +1 -1
  32. package/dist/store/profile.d.ts +18 -0
  33. package/dist/store/profile.d.ts.map +1 -0
  34. package/dist/store/profile.js +345 -0
  35. package/dist/store/profile.js.map +1 -0
  36. package/dist/tools/mem-context.d.ts.map +1 -1
  37. package/dist/tools/mem-context.js +184 -29
  38. package/dist/tools/mem-context.js.map +1 -1
  39. package/dist/tools/mem-handoff.d.ts.map +1 -1
  40. package/dist/tools/mem-handoff.js +8 -1
  41. package/dist/tools/mem-handoff.js.map +1 -1
  42. package/dist/tools/mem-search.d.ts.map +1 -1
  43. package/dist/tools/mem-search.js +26 -14
  44. package/dist/tools/mem-search.js.map +1 -1
  45. package/dist/tools/util.d.ts +6 -1
  46. package/dist/tools/util.d.ts.map +1 -1
  47. package/dist/tools/util.js.map +1 -1
  48. package/package.json +1 -1
package/dist/store/git.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isGitRepo = isGitRepo;
4
+ exports.headHash = headHash;
4
5
  exports.activitySince = activitySince;
6
+ exports.repoConventions = repoConventions;
5
7
  /**
6
8
  * Read-only git introspection, used to fill in what a session actually did.
7
9
  *
@@ -38,18 +40,32 @@ function git(args, cwd) {
38
40
  function isGitRepo(projectRoot) {
39
41
  return git(["rev-parse", "--is-inside-work-tree"], projectRoot) === "true";
40
42
  }
43
+ /** Current HEAD, or null in an empty repo or outside one. */
44
+ function headHash(projectRoot) {
45
+ return git(["rev-parse", "HEAD"], projectRoot);
46
+ }
47
+ function isKnownCommit(ref, projectRoot) {
48
+ return git(["rev-parse", "--verify", "--quiet", `${ref}^{commit}`], projectRoot) !== null;
49
+ }
41
50
  /**
42
51
  * What happened in this repo since `since` ("YYYY-MM-DD HH:MM", as git parses
43
- * it). Returns null when the project is not a git repo.
52
+ * it), or far better — since the commit `sinceRef` when one is known.
53
+ *
54
+ * Prefer the ref. `--since` resolves to minute granularity, so a commit made in
55
+ * the same minute as the marker falls inside the window every time it is
56
+ * consulted and gets reported as new forever. `sinceRef..HEAD` is exact.
44
57
  *
45
- * Note: commits are filtered by time, not by session, so two sessions running in
46
- * parallel will each report the same commits. Time is the only signal available
47
- * without asking the agent to tag its own work.
58
+ * With neither available, commits are matched by time alone, so two sessions
59
+ * running in parallel each report the same ones time is the only signal there
60
+ * is without asking agents to tag their own work.
48
61
  */
49
- function activitySince(since, projectRoot) {
62
+ function activitySince(since, projectRoot, sinceRef) {
50
63
  if (!isGitRepo(projectRoot))
51
64
  return null;
52
- const log = git(["log", `--since=${since}`, "--no-merges", "--format=%h %s"], projectRoot);
65
+ const useRef = sinceRef && isKnownCommit(sinceRef, projectRoot);
66
+ const log = git(useRef
67
+ ? ["log", `${sinceRef}..HEAD`, "--no-merges", "--format=%h %s"]
68
+ : ["log", `--since=${since}`, "--no-merges", "--format=%h %s"], projectRoot);
53
69
  const allCommits = log ? log.split("\n").filter(Boolean) : [];
54
70
  const status = git(["status", "--porcelain"], projectRoot);
55
71
  const allChanged = (status ? status.split("\n") : [])
@@ -66,4 +82,50 @@ function activitySince(since, projectRoot) {
66
82
  moreChanged: Math.max(0, allChanged.length - MAX_CHANGED),
67
83
  };
68
84
  }
85
+ // How much history to sample when inferring conventions. Enough to be
86
+ // representative, small enough that scanning a huge repo stays instant.
87
+ const CONVENTION_SAMPLE = 200;
88
+ const HOTSPOT_SAMPLE = 300;
89
+ const TOP_HOTSPOTS = 8;
90
+ const CONVENTIONAL_COMMIT = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([^)]*\))?!?:\s/;
91
+ /**
92
+ * Conventions a repo demonstrates rather than documents: how commits are
93
+ * written, how releases are tagged, and which files churn. All inferred from
94
+ * history, so there is nothing for a human to have kept up to date.
95
+ */
96
+ function repoConventions(projectRoot) {
97
+ if (!isGitRepo(projectRoot))
98
+ return null;
99
+ const log = git(["log", `-n${CONVENTION_SAMPLE}`, "--no-merges", "--format=%s"], projectRoot);
100
+ const subjects = log ? log.split("\n").filter(Boolean) : [];
101
+ const types = new Map();
102
+ let conventional = 0;
103
+ for (const subject of subjects) {
104
+ const m = subject.match(CONVENTIONAL_COMMIT);
105
+ if (!m)
106
+ continue;
107
+ conventional += 1;
108
+ types.set(m[1], (types.get(m[1]) ?? 0) + 1);
109
+ }
110
+ const tagOut = git(["tag", "--sort=-creatordate"], projectRoot);
111
+ const tags = tagOut ? tagOut.split("\n").filter(Boolean).slice(0, 3) : [];
112
+ // --name-only with an empty format yields just the touched paths.
113
+ const names = git(["log", `-n${HOTSPOT_SAMPLE}`, "--no-merges", "--name-only", "--format="], projectRoot);
114
+ const churn = new Map();
115
+ for (const file of (names ? names.split("\n") : []).map((f) => f.trim())) {
116
+ if (!file || file.startsWith(".repomem/"))
117
+ continue;
118
+ churn.set(file, (churn.get(file) ?? 0) + 1);
119
+ }
120
+ return {
121
+ sampled: subjects.length,
122
+ conventionalShare: subjects.length ? conventional / subjects.length : 0,
123
+ topTypes: [...types.entries()].sort((a, b) => b[1] - a[1]).map(([t]) => t).slice(0, 5),
124
+ tags,
125
+ hotspots: [...churn.entries()]
126
+ .sort((a, b) => b[1] - a[1])
127
+ .slice(0, TOP_HOTSPOTS)
128
+ .map(([file, n]) => `${file} (${n})`),
129
+ };
130
+ }
69
131
  //# sourceMappingURL=git.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/store/git.ts"],"names":[],"mappings":";;AAmCA,8BAEC;AAsBD,sCAwBC;AAnFD;;;;;;;;;GASG;AACH,iDAA6C;AAE7C,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,0EAA0E;AAC1E,SAAS,GAAG,CAAC,IAAc,EAAE,GAAW;IACtC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAA,4BAAY,EAAC,KAAK,EAAE,IAAI,EAAE;YACpC,GAAG;YACH,QAAQ,EAAE,MAAM;YAChB,OAAO,EAAE,cAAc;YACvB,2EAA2E;YAC3E,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;YACnC,WAAW,EAAE,IAAI;SAClB,CAAC,CAAC;QACH,2EAA2E;QAC3E,uEAAuE;QACvE,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;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AAC,CAAC,EAAE,YAAY,CAAC;aACtB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC;KACxC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const PROFILE_FILENAME = "project.md";
2
+ export interface ProjectProfile {
3
+ stack: string[];
4
+ commands: string[];
5
+ entryPoints: string[];
6
+ layout: string[];
7
+ ci: string[];
8
+ conventions: string[];
9
+ hotspots: string[];
10
+ }
11
+ /** Everything deterministically knowable about a repo's shape. */
12
+ export declare function scanProject(projectRoot: string): ProjectProfile;
13
+ export declare function renderProfile(profile: ProjectProfile, projectName: string): string;
14
+ /** Scan and write .repomem/project.md. Returns the profile, or null if uninitialised. */
15
+ export declare function writeProfile(projectRoot: string): ProjectProfile | null;
16
+ /** The written profile, or null when it has not been generated yet. */
17
+ export declare function readProfile(projectRoot: string): string | null;
18
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/store/profile.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAY7C,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAoND,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CA2B/D;AASD,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAalF;AAED,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAMvE;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D"}
@@ -0,0 +1,345 @@
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.PROFILE_FILENAME = void 0;
37
+ exports.scanProject = scanProject;
38
+ exports.renderProfile = renderProfile;
39
+ exports.writeProfile = writeProfile;
40
+ exports.readProfile = readProfile;
41
+ /**
42
+ * Deterministic repo profiling — what an agent otherwise rediscovers by globbing
43
+ * the tree at the start of every session.
44
+ *
45
+ * Nothing here calls a model. Stack, commands, entry points, layout, and CI are
46
+ * all readable from files that already exist, and conventions are inferred from
47
+ * git history. That matters for adoption: `repomem init` on a five-year-old repo
48
+ * has to produce something useful without an agent in the loop.
49
+ *
50
+ * The result is written to .repomem/project.md, which is regenerated wholesale
51
+ * and must never be hand-edited — authored memory lives in the four typed dirs.
52
+ */
53
+ const fs = __importStar(require("fs"));
54
+ const path = __importStar(require("path"));
55
+ const config_js_1 = require("../config/config.js");
56
+ const file_store_js_1 = require("./file-store.js");
57
+ const git_js_1 = require("./git.js");
58
+ exports.PROFILE_FILENAME = "project.md";
59
+ // Directories that tell you nothing about a project's shape.
60
+ const IGNORED_DIRS = new Set([
61
+ "node_modules", ".git", ".repomem", "dist", "build", "out", "coverage",
62
+ "vendor", "target", "__pycache__", ".venv", "venv", ".next", ".nuxt",
63
+ ".turbo", ".cache", ".idea", ".vscode", "bin", "obj",
64
+ ]);
65
+ const MAX_WALK_ENTRIES = 5000;
66
+ const MAX_LAYOUT_DIRS = 12;
67
+ function readText(file) {
68
+ try {
69
+ return fs.readFileSync(file, "utf8");
70
+ }
71
+ catch {
72
+ return null;
73
+ }
74
+ }
75
+ function readJson(file) {
76
+ const raw = readText(file);
77
+ if (!raw)
78
+ return null;
79
+ try {
80
+ return JSON.parse(raw);
81
+ }
82
+ catch {
83
+ return null;
84
+ }
85
+ }
86
+ function exists(root, rel) {
87
+ return fs.existsSync(path.join(root, rel));
88
+ }
89
+ /** Language and framework signals, read from whichever manifests are present. */
90
+ function detectStack(root) {
91
+ const out = [];
92
+ const pkg = readJson(path.join(root, "package.json"));
93
+ if (pkg) {
94
+ const deps = {
95
+ ...(pkg.dependencies ?? {}),
96
+ ...(pkg.devDependencies ?? {}),
97
+ };
98
+ const ts = "typescript" in deps || exists(root, "tsconfig.json");
99
+ out.push(`Node.js${ts ? " + TypeScript" : ""}`);
100
+ if (pkg.type === "module")
101
+ out.push("ESM (`type: module`)");
102
+ for (const [dep, label] of [
103
+ ["react", "React"], ["next", "Next.js"], ["vue", "Vue"], ["svelte", "Svelte"],
104
+ ["express", "Express"], ["fastify", "Fastify"], ["nestjs", "NestJS"],
105
+ ["@modelcontextprotocol/sdk", "MCP SDK"],
106
+ ]) {
107
+ if (Object.keys(deps).some((d) => d === dep || d.startsWith(`${dep}/`)))
108
+ out.push(label);
109
+ }
110
+ for (const [dep, label] of [
111
+ ["vitest", "Vitest"], ["jest", "Jest"], ["mocha", "Mocha"], ["playwright", "Playwright"],
112
+ ["eslint", "ESLint"], ["prettier", "Prettier"], ["biome", "Biome"],
113
+ ]) {
114
+ if (Object.keys(deps).some((d) => d.includes(dep)))
115
+ out.push(label);
116
+ }
117
+ }
118
+ for (const [file, label] of [
119
+ ["pyproject.toml", "Python (pyproject)"],
120
+ ["requirements.txt", "Python (requirements.txt)"],
121
+ ["go.mod", "Go"],
122
+ ["Cargo.toml", "Rust"],
123
+ ["pom.xml", "Java (Maven)"],
124
+ ["build.gradle", "JVM (Gradle)"],
125
+ ["build.gradle.kts", "JVM (Gradle Kotlin)"],
126
+ ["Gemfile", "Ruby"],
127
+ ["composer.json", "PHP"],
128
+ ["Dockerfile", "Docker"],
129
+ ["docker-compose.yml", "Docker Compose"],
130
+ ["terraform.tf", "Terraform"],
131
+ ]) {
132
+ if (exists(root, file))
133
+ out.push(label);
134
+ }
135
+ try {
136
+ if (fs.readdirSync(root).some((f) => f.endsWith(".csproj") || f.endsWith(".sln"))) {
137
+ out.push(".NET");
138
+ }
139
+ }
140
+ catch {
141
+ /* unreadable root is someone else's problem */
142
+ }
143
+ return [...new Set(out)];
144
+ }
145
+ /** How to build, test, run, and lint — the questions asked every session. */
146
+ function detectCommands(root) {
147
+ const out = [];
148
+ const pkg = readJson(path.join(root, "package.json"));
149
+ const scripts = pkg?.scripts ?? {};
150
+ for (const name of ["build", "test", "dev", "start", "lint", "typecheck", "format"]) {
151
+ if (scripts[name])
152
+ out.push(`\`npm run ${name}\` — ${scripts[name]}`);
153
+ }
154
+ const make = readText(path.join(root, "Makefile"));
155
+ if (make) {
156
+ const targets = [...make.matchAll(/^([a-zA-Z][\w-]*):(?!=)/gm)]
157
+ .map((m) => m[1])
158
+ .filter((t) => t !== "PHONY")
159
+ .slice(0, 8);
160
+ if (targets.length)
161
+ out.push(`\`make <target>\` — ${targets.join(", ")}`);
162
+ }
163
+ const just = readText(path.join(root, "justfile")) ?? readText(path.join(root, "Justfile"));
164
+ if (just) {
165
+ const recipes = [...just.matchAll(/^([a-zA-Z][\w-]*)(?:\s+[^:\n]*)?:/gm)]
166
+ .map((m) => m[1])
167
+ .slice(0, 8);
168
+ if (recipes.length)
169
+ out.push(`\`just <recipe>\` — ${recipes.join(", ")}`);
170
+ }
171
+ if (exists(root, "Taskfile.yml") || exists(root, "Taskfile.yaml")) {
172
+ out.push("`task <name>` — see Taskfile");
173
+ }
174
+ if (exists(root, "go.mod"))
175
+ out.push("`go build ./...`, `go test ./...`");
176
+ if (exists(root, "Cargo.toml"))
177
+ out.push("`cargo build`, `cargo test`");
178
+ return out;
179
+ }
180
+ /** Where execution starts — bins, mains, and conventional entry files. */
181
+ function detectEntryPoints(root) {
182
+ const out = [];
183
+ const pkg = readJson(path.join(root, "package.json"));
184
+ if (pkg) {
185
+ if (typeof pkg.main === "string")
186
+ out.push(`main: ${pkg.main}`);
187
+ const bin = pkg.bin;
188
+ if (typeof bin === "string")
189
+ out.push(`bin: ${bin}`);
190
+ else if (bin && typeof bin === "object") {
191
+ for (const [name, target] of Object.entries(bin)) {
192
+ out.push(`bin \`${name}\`: ${target}`);
193
+ }
194
+ }
195
+ }
196
+ for (const candidate of [
197
+ "src/index.ts", "src/index.js", "src/main.ts", "src/main.py",
198
+ "main.go", "main.py", "app.py", "src/main.rs", "index.js",
199
+ ]) {
200
+ if (exists(root, candidate))
201
+ out.push(candidate);
202
+ }
203
+ return [...new Set(out)].slice(0, 8);
204
+ }
205
+ /** Recursive file count and dominant extension, bounded so huge trees stay fast. */
206
+ function summariseDir(dir, budget) {
207
+ const byExt = new Map();
208
+ let files = 0;
209
+ const walk = (current, depth) => {
210
+ if (depth > 3 || budget.left <= 0)
211
+ return;
212
+ let entries;
213
+ try {
214
+ entries = fs.readdirSync(current, { withFileTypes: true });
215
+ }
216
+ catch {
217
+ return;
218
+ }
219
+ for (const entry of entries) {
220
+ if (budget.left-- <= 0)
221
+ return;
222
+ if (entry.isDirectory()) {
223
+ if (!IGNORED_DIRS.has(entry.name))
224
+ walk(path.join(current, entry.name), depth + 1);
225
+ }
226
+ else if (entry.isFile()) {
227
+ files += 1;
228
+ const ext = path.extname(entry.name);
229
+ if (ext)
230
+ byExt.set(ext, (byExt.get(ext) ?? 0) + 1);
231
+ }
232
+ }
233
+ };
234
+ walk(dir, 0);
235
+ const dominant = [...byExt.entries()].sort((a, b) => b[1] - a[1])[0];
236
+ return { files, ext: dominant ? dominant[0] : "" };
237
+ }
238
+ function detectLayout(root) {
239
+ const budget = { left: MAX_WALK_ENTRIES };
240
+ let entries;
241
+ try {
242
+ entries = fs.readdirSync(root, { withFileTypes: true });
243
+ }
244
+ catch {
245
+ return [];
246
+ }
247
+ return entries
248
+ .filter((e) => e.isDirectory() && !IGNORED_DIRS.has(e.name) && !e.name.startsWith("."))
249
+ .map((e) => {
250
+ const { files, ext } = summariseDir(path.join(root, e.name), budget);
251
+ return { name: e.name, files, ext };
252
+ })
253
+ .filter((d) => d.files > 0)
254
+ .sort((a, b) => b.files - a.files)
255
+ .slice(0, MAX_LAYOUT_DIRS)
256
+ .map((d) => `\`${d.name}/\` — ${d.files} file${d.files === 1 ? "" : "s"}${d.ext ? `, mostly ${d.ext}` : ""}`);
257
+ }
258
+ function detectCI(root) {
259
+ const out = [];
260
+ const workflows = path.join(root, ".github", "workflows");
261
+ try {
262
+ for (const f of fs.readdirSync(workflows)) {
263
+ if (/\.ya?ml$/.test(f))
264
+ out.push(`.github/workflows/${f}`);
265
+ }
266
+ }
267
+ catch {
268
+ /* no workflows */
269
+ }
270
+ for (const [file, label] of [
271
+ [".gitlab-ci.yml", "GitLab CI"],
272
+ ["azure-pipelines.yml", "Azure Pipelines"],
273
+ ["Jenkinsfile", "Jenkins"],
274
+ ]) {
275
+ if (exists(root, file))
276
+ out.push(label);
277
+ }
278
+ return out.slice(0, 8);
279
+ }
280
+ /** Everything deterministically knowable about a repo's shape. */
281
+ function scanProject(projectRoot) {
282
+ const conventions = [];
283
+ const git = (0, git_js_1.repoConventions)(projectRoot);
284
+ if (git && git.sampled > 0) {
285
+ const pct = Math.round(git.conventionalShare * 100);
286
+ if (pct >= 60) {
287
+ conventions.push(`Conventional Commits — ${pct}% of the last ${git.sampled} commits` +
288
+ (git.topTypes.length ? ` (mostly ${git.topTypes.join(", ")})` : ""));
289
+ }
290
+ else if (pct > 0) {
291
+ conventions.push(`Commit style is mixed — ${pct}% of the last ${git.sampled} are conventional`);
292
+ }
293
+ else {
294
+ conventions.push(`Free-form commit subjects across the last ${git.sampled} commits`);
295
+ }
296
+ if (git.tags.length)
297
+ conventions.push(`Releases tagged: ${git.tags.join(", ")}`);
298
+ }
299
+ return {
300
+ stack: detectStack(projectRoot),
301
+ commands: detectCommands(projectRoot),
302
+ entryPoints: detectEntryPoints(projectRoot),
303
+ layout: detectLayout(projectRoot),
304
+ ci: detectCI(projectRoot),
305
+ conventions,
306
+ hotspots: git?.hotspots ?? [],
307
+ };
308
+ }
309
+ function section(out, heading, items) {
310
+ if (!items.length)
311
+ return;
312
+ out.push(`## ${heading}`, "");
313
+ for (const item of items)
314
+ out.push(`- ${item}`);
315
+ out.push("");
316
+ }
317
+ function renderProfile(profile, projectName) {
318
+ const out = [];
319
+ out.push(`# ${projectName} — project profile`, "");
320
+ out.push("_Auto-generated by `repomem scan`. Do not edit by hand — regenerate instead._", "");
321
+ section(out, "Stack", profile.stack);
322
+ section(out, "Commands", profile.commands);
323
+ section(out, "Entry points", profile.entryPoints);
324
+ section(out, "Layout", profile.layout);
325
+ section(out, "CI", profile.ci);
326
+ section(out, "Conventions", profile.conventions);
327
+ section(out, "Churn hotspots", profile.hotspots);
328
+ if (out.length <= 4)
329
+ out.push("_Nothing detected — this may not be a code project._", "");
330
+ return out.join("\n").trimEnd() + "\n";
331
+ }
332
+ /** Scan and write .repomem/project.md. Returns the profile, or null if uninitialised. */
333
+ function writeProfile(projectRoot) {
334
+ if (!(0, file_store_js_1.isInitialized)(projectRoot))
335
+ return null;
336
+ const profile = scanProject(projectRoot);
337
+ const text = renderProfile(profile, (0, config_js_1.loadConfig)(projectRoot).project);
338
+ fs.writeFileSync(path.join((0, file_store_js_1.getRepomemRoot)(projectRoot), exports.PROFILE_FILENAME), text, "utf8");
339
+ return profile;
340
+ }
341
+ /** The written profile, or null when it has not been generated yet. */
342
+ function readProfile(projectRoot) {
343
+ return readText(path.join((0, file_store_js_1.getRepomemRoot)(projectRoot), exports.PROFILE_FILENAME));
344
+ }
345
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/store/profile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4PA,kCA2BC;AASD,sCAaC;AAGD,oCAMC;AAGD,kCAEC;AA3TD;;;;;;;;;;;GAWG;AACH,uCAAyB;AACzB,2CAA6B;AAE7B,mDAAiD;AACjD,mDAAgE;AAChE,qCAA2C;AAE9B,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAE7C,6DAA6D;AAC7D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU;IACtE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IACpE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK;CACrD,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,IA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C,CAAC;AAC5E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mem-context.d.ts","sourceRoot":"","sources":["../../src/tools/mem-context.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0EpC,eAAO,MAAM,UAAU,EAAE,OAoGxB,CAAC"}
1
+ {"version":3,"file":"mem-context.d.ts","sourceRoot":"","sources":["../../src/tools/mem-context.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuKpC,eAAO,MAAM,UAAU,EAAE,OA+LxB,CAAC"}