@repomem/memory 0.1.3 → 0.1.4
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/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -78
- package/dist/cli.js.map +1 -1
- package/dist/scaffold.d.ts +18 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +95 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/setup/spec.d.ts.map +1 -1
- package/dist/setup/spec.js +17 -0
- package/dist/setup/spec.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAiEH,wBAAsB,GAAG,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDjF"}
|
package/dist/cli.js
CHANGED
|
@@ -9,19 +9,14 @@
|
|
|
9
9
|
*
|
|
10
10
|
* `validate` exits non-zero on any error so it can gate pre-commit and CI.
|
|
11
11
|
*/
|
|
12
|
-
import { promises as fs } from "node:fs";
|
|
13
12
|
import { existsSync, realpathSync } from "node:fs";
|
|
14
|
-
import path from "node:path";
|
|
15
13
|
import { fileURLToPath } from "node:url";
|
|
16
|
-
import { ENTRY_TYPES, TYPE_DIRS } from "./schema.js";
|
|
17
14
|
import { resolveMemoryRoot } from "./store.js";
|
|
18
15
|
import { validateRoot, formatReport } from "./validate.js";
|
|
16
|
+
import { scaffoldMemory } from "./scaffold.js";
|
|
19
17
|
import { main as startServer } from "./index.js";
|
|
20
18
|
import { runSetup } from "@repomem/core";
|
|
21
19
|
import { repomemSpec } from "./setup/spec.js";
|
|
22
|
-
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
23
|
-
// Templates ship alongside dist/ at the package root: dist/cli.js -> ../templates
|
|
24
|
-
const TEMPLATES_DIR = path.resolve(here, "..", "templates");
|
|
25
20
|
function out(message) {
|
|
26
21
|
process.stdout.write(message + "\n");
|
|
27
22
|
}
|
|
@@ -37,78 +32,8 @@ function parseFlag(argv, name) {
|
|
|
37
32
|
function hasFlag(argv, name) {
|
|
38
33
|
return argv.includes(name);
|
|
39
34
|
}
|
|
40
|
-
const MEMORY_README = `# Memory
|
|
41
|
-
|
|
42
|
-
This folder is your repository's shared memory, read and extended by AI tools
|
|
43
|
-
through the \`repomem-memory\` MCP server.
|
|
44
|
-
|
|
45
|
-
Each entry is a markdown file with structured frontmatter, organized by type:
|
|
46
|
-
|
|
47
|
-
- \`decisions/\` — choices made and why
|
|
48
|
-
- \`conventions/\` — rules the team follows
|
|
49
|
-
- \`limitations/\` — known constraints and gotchas
|
|
50
|
-
- \`learnings/\` — lessons worth remembering
|
|
51
|
-
- \`contexts/\` — project and module-level context (what things are and why)
|
|
52
|
-
|
|
53
|
-
## How it works
|
|
54
|
-
|
|
55
|
-
AI tools **propose** new entries as drafts (\`status: draft\`). A human reviews
|
|
56
|
-
and **accepts** them in the same pull request as the related change. Entries are
|
|
57
|
-
versioned with git — no external database.
|
|
58
|
-
|
|
59
|
-
Run \`npx --package @repomem/memory repomem-memory validate\` to check entries before committing.
|
|
60
|
-
|
|
61
|
-
See \`templates/\` for a starting point for each entry type.
|
|
62
|
-
`;
|
|
63
35
|
async function cmdInit(root) {
|
|
64
|
-
|
|
65
|
-
const skipped = [];
|
|
66
|
-
async function ensureDir(dir) {
|
|
67
|
-
if (existsSync(dir)) {
|
|
68
|
-
skipped.push(dir);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
await fs.mkdir(dir, { recursive: true });
|
|
72
|
-
created.push(dir);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
await ensureDir(root);
|
|
76
|
-
for (const type of ENTRY_TYPES) {
|
|
77
|
-
await ensureDir(path.join(root, TYPE_DIRS[type]));
|
|
78
|
-
}
|
|
79
|
-
// README (never overwrite).
|
|
80
|
-
const readme = path.join(root, "README.md");
|
|
81
|
-
if (existsSync(readme)) {
|
|
82
|
-
skipped.push(readme);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
await fs.writeFile(readme, MEMORY_README, "utf8");
|
|
86
|
-
created.push(readme);
|
|
87
|
-
}
|
|
88
|
-
// Templates (never overwrite individual files).
|
|
89
|
-
const destTemplates = path.join(root, "templates");
|
|
90
|
-
await ensureDir(destTemplates);
|
|
91
|
-
for (const type of ENTRY_TYPES) {
|
|
92
|
-
const src = path.join(TEMPLATES_DIR, `${type}.md`);
|
|
93
|
-
const dest = path.join(destTemplates, `${type}.md`);
|
|
94
|
-
if (existsSync(dest)) {
|
|
95
|
-
skipped.push(dest);
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const content = await fs.readFile(src, "utf8");
|
|
100
|
-
await fs.writeFile(dest, content, "utf8");
|
|
101
|
-
created.push(dest);
|
|
102
|
-
}
|
|
103
|
-
catch {
|
|
104
|
-
err(`warning: template not found: ${src}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
out(`Initialized memory at ${root}`);
|
|
108
|
-
if (created.length)
|
|
109
|
-
out(` created:\n${created.map((c) => ` + ${c}`).join("\n")}`);
|
|
110
|
-
if (skipped.length)
|
|
111
|
-
out(` already present (left untouched):\n${skipped.map((c) => ` = ${c}`).join("\n")}`);
|
|
36
|
+
await scaffoldMemory(root, { out, err });
|
|
112
37
|
return 0;
|
|
113
38
|
}
|
|
114
39
|
async function cmdValidate(root) {
|
|
@@ -133,7 +58,7 @@ function usage() {
|
|
|
133
58
|
" repomem-memory serve [--root <dir>] Start the MCP server over stdio (default for agents)",
|
|
134
59
|
" repomem-memory init [--root <dir>] Scaffold the memory/ folder and templates",
|
|
135
60
|
" repomem-memory validate [--root <dir>] Validate entries (frontmatter, refs, secrets)",
|
|
136
|
-
" repomem-memory setup --agent <name> Install skills, hooks and MCP config
|
|
61
|
+
" repomem-memory setup --agent <name> Install skills, hooks and MCP config (also scaffolds memory/; --no-init to skip)",
|
|
137
62
|
"",
|
|
138
63
|
"Root resolution: --root > MEMORY_ROOT env > <git root>/.repomem/memory",
|
|
139
64
|
"setup root resolution: --root > REPOMEM_REPO_ROOT env > <git root>",
|
|
@@ -152,6 +77,7 @@ export async function run(argv = process.argv.slice(2)) {
|
|
|
152
77
|
agent: parseFlag(argv, "--agent"),
|
|
153
78
|
rootFlag: parseFlag(argv, "--root"),
|
|
154
79
|
force: hasFlag(argv, "--force"),
|
|
80
|
+
skipPostSetup: hasFlag(argv, "--no-init"),
|
|
155
81
|
}, { out, err });
|
|
156
82
|
}
|
|
157
83
|
// `serve` starts the MCP server over stdio. This is what agents invoke
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9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P,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scaffold.ts — create the reviewable `memory/` folder structure.
|
|
3
|
+
*
|
|
4
|
+
* Shared by the `init` CLI command and by the setup `postSetup` hook, so that
|
|
5
|
+
* configuring the memory server also scaffolds its content. Every operation is
|
|
6
|
+
* idempotent and never overwrites an existing file.
|
|
7
|
+
*/
|
|
8
|
+
import type { SetupIo } from "@repomem/core";
|
|
9
|
+
/**
|
|
10
|
+
* Scaffold the memory folder at `root`: type subdirectories, a README, and the
|
|
11
|
+
* entry templates. Idempotent: existing files are left untouched. Returns the
|
|
12
|
+
* created/skipped paths so callers can print a report.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scaffoldMemory(root: string, io: SetupIo): Promise<{
|
|
15
|
+
created: string[];
|
|
16
|
+
skipped: string[];
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AA+B7C;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,OAAO,GACV,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoDnD"}
|
package/dist/scaffold.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scaffold.ts — create the reviewable `memory/` folder structure.
|
|
3
|
+
*
|
|
4
|
+
* Shared by the `init` CLI command and by the setup `postSetup` hook, so that
|
|
5
|
+
* configuring the memory server also scaffolds its content. Every operation is
|
|
6
|
+
* idempotent and never overwrites an existing file.
|
|
7
|
+
*/
|
|
8
|
+
import { promises as fs } from "node:fs";
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { ENTRY_TYPES, TYPE_DIRS } from "./schema.js";
|
|
13
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
// Templates ship alongside dist/ at the package root: dist/scaffold.js -> ../templates
|
|
15
|
+
const TEMPLATES_DIR = path.resolve(here, "..", "templates");
|
|
16
|
+
const MEMORY_README = `# Memory
|
|
17
|
+
|
|
18
|
+
This folder is your repository's shared memory, read and extended by AI tools
|
|
19
|
+
through the \`repomem-memory\` MCP server.
|
|
20
|
+
|
|
21
|
+
Each entry is a markdown file with structured frontmatter, organized by type:
|
|
22
|
+
|
|
23
|
+
- \`decisions/\` — choices made and why
|
|
24
|
+
- \`conventions/\` — rules the team follows
|
|
25
|
+
- \`limitations/\` — known constraints and gotchas
|
|
26
|
+
- \`learnings/\` — lessons worth remembering
|
|
27
|
+
- \`contexts/\` — project and module-level context (what things are and why)
|
|
28
|
+
|
|
29
|
+
## How it works
|
|
30
|
+
|
|
31
|
+
AI tools **propose** new entries as drafts (\`status: draft\`). A human reviews
|
|
32
|
+
and **accepts** them in the same pull request as the related change. Entries are
|
|
33
|
+
versioned with git — no external database.
|
|
34
|
+
|
|
35
|
+
Run \`npx --package @repomem/memory repomem-memory validate\` to check entries before committing.
|
|
36
|
+
|
|
37
|
+
See \`templates/\` for a starting point for each entry type.
|
|
38
|
+
`;
|
|
39
|
+
/**
|
|
40
|
+
* Scaffold the memory folder at `root`: type subdirectories, a README, and the
|
|
41
|
+
* entry templates. Idempotent: existing files are left untouched. Returns the
|
|
42
|
+
* created/skipped paths so callers can print a report.
|
|
43
|
+
*/
|
|
44
|
+
export async function scaffoldMemory(root, io) {
|
|
45
|
+
const created = [];
|
|
46
|
+
const skipped = [];
|
|
47
|
+
async function ensureDir(dir) {
|
|
48
|
+
if (existsSync(dir)) {
|
|
49
|
+
skipped.push(dir);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
await fs.mkdir(dir, { recursive: true });
|
|
53
|
+
created.push(dir);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
await ensureDir(root);
|
|
57
|
+
for (const type of ENTRY_TYPES) {
|
|
58
|
+
await ensureDir(path.join(root, TYPE_DIRS[type]));
|
|
59
|
+
}
|
|
60
|
+
// README (never overwrite).
|
|
61
|
+
const readme = path.join(root, "README.md");
|
|
62
|
+
if (existsSync(readme)) {
|
|
63
|
+
skipped.push(readme);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
await fs.writeFile(readme, MEMORY_README, "utf8");
|
|
67
|
+
created.push(readme);
|
|
68
|
+
}
|
|
69
|
+
// Templates (never overwrite individual files).
|
|
70
|
+
const destTemplates = path.join(root, "templates");
|
|
71
|
+
await ensureDir(destTemplates);
|
|
72
|
+
for (const type of ENTRY_TYPES) {
|
|
73
|
+
const src = path.join(TEMPLATES_DIR, `${type}.md`);
|
|
74
|
+
const dest = path.join(destTemplates, `${type}.md`);
|
|
75
|
+
if (existsSync(dest)) {
|
|
76
|
+
skipped.push(dest);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const content = await fs.readFile(src, "utf8");
|
|
81
|
+
await fs.writeFile(dest, content, "utf8");
|
|
82
|
+
created.push(dest);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
io.err(`warning: template not found: ${src}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
io.out(`Initialized memory at ${root}`);
|
|
89
|
+
if (created.length)
|
|
90
|
+
io.out(` created:\n${created.map((c) => ` + ${c}`).join("\n")}`);
|
|
91
|
+
if (skipped.length)
|
|
92
|
+
io.out(` already present (left untouched):\n${skipped.map((c) => ` = ${c}`).join("\n")}`);
|
|
93
|
+
return { created, skipped };
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@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C,CAAC;QAChD,CAAC;IACH,CAAC;IAED,EAAE,CAAC,GAAG,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;IACxC,IAAI,OAAO,CAAC,MAAM;QAAE,EAAE,CAAC,GAAG,CAAC,eAAe,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzF,IAAI,OAAO,CAAC,MAAM;QAChB,EAAE,CAAC,GAAG,CAAC,wCAAwC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
|
package/dist/setup/spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/setup/spec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/setup/spec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAW,MAAM,eAAe,CAAC;AAmB7D,oDAAoD;AACpD,eAAO,MAAM,WAAW,EAAE,cAiCzB,CAAC"}
|
package/dist/setup/spec.js
CHANGED
|
@@ -7,10 +7,22 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { scaffoldMemory } from "../scaffold.js";
|
|
10
11
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
11
12
|
// dist/setup/spec.js -> ../../assets (package root holds `assets/`)
|
|
12
13
|
const ASSETS_DIR = path.resolve(here, "..", "..", "assets");
|
|
13
14
|
const KIRO_ASSETS = path.join(ASSETS_DIR, "kiro");
|
|
15
|
+
/**
|
|
16
|
+
* Resolve where the memory folder should be scaffolded during setup.
|
|
17
|
+
* `MEMORY_ROOT` wins if set; otherwise it lives at `<repoRoot>/.repomem/memory`,
|
|
18
|
+
* mirroring the server's own root discovery.
|
|
19
|
+
*/
|
|
20
|
+
function memoryRootFor(repoRoot) {
|
|
21
|
+
const env = process.env.MEMORY_ROOT;
|
|
22
|
+
if (env && env.trim() !== "")
|
|
23
|
+
return path.resolve(env);
|
|
24
|
+
return path.join(repoRoot, ".repomem", "memory");
|
|
25
|
+
}
|
|
14
26
|
/** The spec repomem contributes to a Kiro setup. */
|
|
15
27
|
export const repomemSpec = {
|
|
16
28
|
serverName: "repomem-memory",
|
|
@@ -40,5 +52,10 @@ export const repomemSpec = {
|
|
|
40
52
|
agentHooks: {
|
|
41
53
|
agentSpawn: [{ command: ".kiro/hooks/repomem-validate.sh" }],
|
|
42
54
|
},
|
|
55
|
+
// After the agent files are installed, scaffold the reviewable memory/
|
|
56
|
+
// folder so `setup` initialises content too (idempotent; never overwrites).
|
|
57
|
+
postSetup: async (repoRoot, io) => {
|
|
58
|
+
await scaffoldMemory(memoryRootFor(repoRoot), io);
|
|
59
|
+
},
|
|
43
60
|
};
|
|
44
61
|
//# sourceMappingURL=spec.js.map
|
package/dist/setup/spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/setup/spec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/setup/spec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MA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AAQ,EAAE,iBAAiB,CAAC;SAC5D;KACF;IACD,WAAW,EAAE;QACX;YACE,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,qBAAqB,CAAC;SAChE;KACF;IACD,UAAU,EAAE;QACV,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;KAC7D;IACD,uEAAuE;IACvE,4EAA4E;IAC5E,SAAS,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAW,EAAiB,EAAE;QAChE,MAAM,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repomem/memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Your repo's memory, available to every AI tool your team uses. A local MCP server that turns a memory/ folder into searchable shared context.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Nicolás Rickert",
|