@saleem11kh/repomem 0.1.1 → 0.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +212 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +335 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/config/config.d.ts +24 -0
  8. package/dist/config/config.d.ts.map +1 -0
  9. package/dist/config/config.js +100 -0
  10. package/dist/config/config.js.map +1 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +75 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/store/file-store.d.ts +83 -0
  16. package/dist/store/file-store.d.ts.map +1 -0
  17. package/dist/store/file-store.js +509 -0
  18. package/dist/store/file-store.js.map +1 -0
  19. package/dist/store/remote.d.ts +30 -0
  20. package/dist/store/remote.d.ts.map +1 -0
  21. package/dist/store/remote.js +118 -0
  22. package/dist/store/remote.js.map +1 -0
  23. package/dist/tools/mem-context.d.ts +3 -0
  24. package/dist/tools/mem-context.d.ts.map +1 -0
  25. package/dist/tools/mem-context.js +93 -0
  26. package/dist/tools/mem-context.js.map +1 -0
  27. package/dist/tools/mem-get.d.ts +3 -0
  28. package/dist/tools/mem-get.d.ts.map +1 -0
  29. package/dist/tools/mem-get.js +57 -0
  30. package/dist/tools/mem-get.js.map +1 -0
  31. package/dist/tools/mem-handoff.d.ts +3 -0
  32. package/dist/tools/mem-handoff.d.ts.map +1 -0
  33. package/dist/tools/mem-handoff.js +72 -0
  34. package/dist/tools/mem-handoff.js.map +1 -0
  35. package/dist/tools/mem-prime.d.ts +3 -0
  36. package/dist/tools/mem-prime.d.ts.map +1 -0
  37. package/dist/tools/mem-prime.js +48 -0
  38. package/dist/tools/mem-prime.js.map +1 -0
  39. package/dist/tools/mem-save.d.ts +5 -0
  40. package/dist/tools/mem-save.d.ts.map +1 -0
  41. package/dist/tools/mem-save.js +103 -0
  42. package/dist/tools/mem-save.js.map +1 -0
  43. package/dist/tools/mem-search.d.ts +3 -0
  44. package/dist/tools/mem-search.d.ts.map +1 -0
  45. package/dist/tools/mem-search.js +50 -0
  46. package/dist/tools/mem-search.js.map +1 -0
  47. package/dist/tools/util.d.ts +18 -0
  48. package/dist/tools/util.d.ts.map +1 -0
  49. package/dist/tools/util.js +42 -0
  50. package/dist/tools/util.js.map +1 -0
  51. package/package.json +25 -4
@@ -0,0 +1,100 @@
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.CONFIG_FILENAME = void 0;
37
+ exports.findProjectRoot = findProjectRoot;
38
+ exports.loadConfig = loadConfig;
39
+ exports.deriveProjectName = deriveProjectName;
40
+ const fs = __importStar(require("fs"));
41
+ const path = __importStar(require("path"));
42
+ exports.CONFIG_FILENAME = "repomem.config.json";
43
+ const DEFAULT_CONFIG = {
44
+ project: "unknown-project",
45
+ linked: [],
46
+ };
47
+ /**
48
+ * Walk up from `start` looking for repomem.config.json or a .repomem/ dir.
49
+ * Returns the directory that contains them, or `start` if none found.
50
+ */
51
+ function findProjectRoot(start = process.cwd()) {
52
+ let dir = path.resolve(start);
53
+ // Stop at filesystem root.
54
+ for (;;) {
55
+ if (fs.existsSync(path.join(dir, exports.CONFIG_FILENAME)) ||
56
+ fs.existsSync(path.join(dir, ".repomem"))) {
57
+ return dir;
58
+ }
59
+ const parent = path.dirname(dir);
60
+ if (parent === dir)
61
+ return path.resolve(start);
62
+ dir = parent;
63
+ }
64
+ }
65
+ /**
66
+ * Load repomem.config.json from the project root. Falls back to a default
67
+ * config (project name derived from package.json or directory name) when the
68
+ * file is missing or malformed — never throws.
69
+ */
70
+ function loadConfig(projectRoot = findProjectRoot()) {
71
+ const configPath = path.join(projectRoot, exports.CONFIG_FILENAME);
72
+ try {
73
+ const raw = fs.readFileSync(configPath, "utf8");
74
+ const parsed = JSON.parse(raw);
75
+ return {
76
+ project: parsed.project || deriveProjectName(projectRoot),
77
+ workspace: parsed.workspace,
78
+ linked: Array.isArray(parsed.linked) ? parsed.linked : [],
79
+ };
80
+ }
81
+ catch {
82
+ return { ...DEFAULT_CONFIG, project: deriveProjectName(projectRoot) };
83
+ }
84
+ }
85
+ /** Derive a project name from package.json `name`, else the directory name. */
86
+ function deriveProjectName(projectRoot) {
87
+ try {
88
+ const pkgRaw = fs.readFileSync(path.join(projectRoot, "package.json"), "utf8");
89
+ const pkg = JSON.parse(pkgRaw);
90
+ if (pkg.name) {
91
+ // Strip npm scope for a friendlier label.
92
+ return pkg.name.replace(/^@[^/]+\//, "");
93
+ }
94
+ }
95
+ catch {
96
+ /* ignore */
97
+ }
98
+ return path.basename(projectRoot);
99
+ }
100
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,0CAcC;AAOD,gCAaC;AAGD,8CAYC;AA1ED,uCAAyB;AACzB,2CAA6B;AAahB,QAAA,eAAe,GAAG,qBAAqB,CAAC;AAErD,MAAM,cAAc,GAAkB;IACpC,OAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,EAAE;CACX,CAAC;AAEF;;;GAGG;AACH,SAAgB,eAAe,CAAC,QAAgB,OAAO,CAAC,GAAG,EAAE;IAC3D,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,2BAA2B;IAC3B,SAAS,CAAC;QACR,IACE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAe,CAAC,CAAC;YAC9C,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EACzC,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/C,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAAC,cAAsB,eAAe,EAAE;IAChE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,uBAAe,CAAC,CAAC;IAC3D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA2B,CAAC;QACzD,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,iBAAiB,CAAC,WAAW,CAAC;YACzD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;SAC1D,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC;IACxE,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,SAAgB,iBAAiB,CAAC,WAAmB;IACnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;QAC/E,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAsB,CAAC;QACpD,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,0CAA0C;YAC1C,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,YAAY;IACd,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Build and start the repomem MCP server over stdio. */
2
+ export declare function startServer(): Promise<void>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4BA,yDAAyD;AACzD,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAgDjD"}
package/dist/index.js ADDED
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startServer = startServer;
4
+ const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
5
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
6
+ const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
7
+ const config_js_1 = require("./config/config.js");
8
+ const mem_save_js_1 = require("./tools/mem-save.js");
9
+ const mem_search_js_1 = require("./tools/mem-search.js");
10
+ const mem_context_js_1 = require("./tools/mem-context.js");
11
+ const mem_handoff_js_1 = require("./tools/mem-handoff.js");
12
+ const mem_get_js_1 = require("./tools/mem-get.js");
13
+ const mem_prime_js_1 = require("./tools/mem-prime.js");
14
+ const TOOLS = [
15
+ mem_save_js_1.memSave,
16
+ mem_search_js_1.memSearch,
17
+ mem_context_js_1.memContext,
18
+ mem_handoff_js_1.memHandoff,
19
+ mem_get_js_1.memGet,
20
+ mem_prime_js_1.memPrime,
21
+ ];
22
+ const TOOL_MAP = new Map(TOOLS.map((t) => [t.name, t]));
23
+ const VERSION = "0.3.0";
24
+ /** Build and start the repomem MCP server over stdio. */
25
+ async function startServer() {
26
+ const server = new index_js_1.Server({ name: "repomem", version: VERSION }, {
27
+ capabilities: { tools: {} },
28
+ instructions: "Git-native memory for AI coding agents. Memory lives in .repomem/ in the " +
29
+ "repo, commits with the code, and travels to teammates. Call mem_context at " +
30
+ "the start of a session (it returns summaries — expand any entry with " +
31
+ "mem_get), mem_save to capture decisions/patterns/issues, mem_search to " +
32
+ "recall, and mem_handoff to close out a session. On a project new to " +
33
+ "repomem, call mem_prime once to bootstrap memory from existing docs.",
34
+ });
35
+ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
36
+ tools: TOOLS.map((t) => ({
37
+ name: t.name,
38
+ description: t.description,
39
+ inputSchema: t.inputSchema,
40
+ })),
41
+ }));
42
+ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
43
+ const tool = TOOL_MAP.get(request.params.name);
44
+ if (!tool) {
45
+ return {
46
+ content: [{ type: "text", text: `✖ Unknown tool: ${request.params.name}` }],
47
+ isError: true,
48
+ };
49
+ }
50
+ const args = (request.params.arguments ?? {});
51
+ try {
52
+ const text = tool.handler(args, (0, config_js_1.findProjectRoot)());
53
+ return { content: [{ type: "text", text }] };
54
+ }
55
+ catch (err) {
56
+ const message = err instanceof Error ? err.message : String(err);
57
+ return {
58
+ content: [{ type: "text", text: `✖ ${tool.name} failed: ${message}` }],
59
+ isError: true,
60
+ };
61
+ }
62
+ });
63
+ const transport = new stdio_js_1.StdioServerTransport();
64
+ await server.connect(transport);
65
+ // Stderr is safe to log to; stdout is reserved for the MCP protocol.
66
+ console.error(`repomem MCP server v${VERSION} ready (stdio).`);
67
+ }
68
+ // Run directly when invoked as a script (not when imported by the CLI router).
69
+ if (require.main === module) {
70
+ startServer().catch((err) => {
71
+ console.error("repomem failed to start:", err);
72
+ process.exit(1);
73
+ });
74
+ }
75
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AA6BA,kCAgDC;AA7ED,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAE5C,kDAAqD;AAErD,qDAA8C;AAC9C,yDAAkD;AAClD,2DAAoD;AACpD,2DAAoD;AACpD,mDAA4C;AAC5C,uDAAgD;AAEhD,MAAM,KAAK,GAAc;IACvB,qBAAO;IACP,yBAAS;IACT,2BAAU;IACV,2BAAU;IACV,mBAAM;IACN,uBAAQ;CACT,CAAC;AACF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAExD,MAAM,OAAO,GAAG,OAAO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AAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAC/C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,YAAY,OAAO,EAAE,EAAE,CAAC;gBACtE,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,qEAAqE;IACrE,OAAO,CAAC,KAAK,CAAC,uBAAuB,OAAO,iBAAiB,CAAC,CAAC;AACjE,CAAC;AAED,+EAA+E;AAC/E,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { RepomemConfig } from "../config/config.js";
2
+ import { RemoteRef } from "./remote.js";
3
+ export type MemoryType = "decisions" | "sessions" | "patterns" | "issues";
4
+ export declare const MEMORY_TYPES: MemoryType[];
5
+ export declare const REPOMEM_DIR = ".repomem";
6
+ export declare const INDEX_FILENAME = "REPOMEM.md";
7
+ export interface SearchResult {
8
+ file: string;
9
+ scope: string;
10
+ title: string;
11
+ excerpt: string;
12
+ score: number;
13
+ related: string[];
14
+ }
15
+ /** Absolute path to the .repomem/ dir for a given project root. */
16
+ export declare function getRepomemRoot(projectRoot?: string): string;
17
+ /** True if .repomem/ exists at the project root. */
18
+ export declare function isInitialized(projectRoot?: string): boolean;
19
+ /**
20
+ * List relative file paths (from .repomem/) of a given memory type, sorted
21
+ * newest-first by filename. Returns [] when uninitialised or empty.
22
+ */
23
+ export declare function listFiles(type: MemoryType, projectRoot?: string): string[];
24
+ /** Read a memory file by type + filename. Returns null when missing. */
25
+ export declare function readFile(type: MemoryType, filename: string, projectRoot?: string): string | null;
26
+ /**
27
+ * Write (or append) a memory file. Creates the type dir if needed.
28
+ * Returns the absolute path written.
29
+ */
30
+ export declare function writeFile(type: MemoryType, filename: string, content: string, opts?: {
31
+ append?: boolean;
32
+ }, projectRoot?: string): string;
33
+ /**
34
+ * A one-line summary for an entry: the `summary:` front-matter field, else the
35
+ * first prose line of the body, else the title. Used by mem_context and
36
+ * mem_search to surface entries cheaply (progressive disclosure).
37
+ */
38
+ export declare function summaryOf(raw: string, filename: string): string;
39
+ /** Extract `[[wikilink]]` targets from a memory's raw text (order-preserving, deduped). */
40
+ export declare function parseLinks(raw: string): string[];
41
+ export interface ResolvedLink {
42
+ type: MemoryType;
43
+ filename: string;
44
+ title: string;
45
+ }
46
+ /**
47
+ * Resolve a `[[target]]` to a memory file. Matches an exact filename, an exact
48
+ * slug (date-stripped), or a unique slug substring. Returns null when unresolved.
49
+ */
50
+ export declare function resolveLink(target: string, projectRoot?: string): ResolvedLink | null;
51
+ /** Resolve all `[[wikilinks]]` in a file to their target entries (unresolved dropped). */
52
+ export declare function relatedOf(raw: string, projectRoot?: string): ResolvedLink[];
53
+ /**
54
+ * Gather existing project docs (CLAUDE.md, AGENTS.md, README, docs/**.md) so an
55
+ * agent can bootstrap memory for a project that already has lots of context.
56
+ * Each doc is capped to keep the priming payload bounded.
57
+ */
58
+ export declare function readProjectDocs(projectRoot?: string, perFileCap?: number, maxFiles?: number): {
59
+ rel: string;
60
+ text: string;
61
+ }[];
62
+ /**
63
+ * Search the current repo and, when `includeLinked`, all linked repos and the
64
+ * workspace declared in repomem.config.json. Returns max 10 results, ranked.
65
+ */
66
+ export declare function searchFiles(query: string, projectRoot?: string): SearchResult[];
67
+ /** Cache root for a pulled remote repo — a project-root-shaped dir under .repomem/.cache/. */
68
+ export declare function remoteCacheRoot(projectRoot: string, r: RemoteRef): string;
69
+ export declare function searchAllRepos(query: string, projectRoot?: string, config?: RepomemConfig): SearchResult[];
70
+ /**
71
+ * Parse a `repomem sync` export bundle and write its files back into .repomem/.
72
+ * The inverse of the CLI's export format — used for airgapped transfer. Returns
73
+ * the list of `type/filename` entries written. Existing files are overwritten.
74
+ */
75
+ export declare function importBundle(text: string, projectRoot?: string): string[];
76
+ /** Counts of each memory type — used by `status` and the index. */
77
+ export declare function counts(projectRoot?: string): Record<MemoryType, number>;
78
+ /**
79
+ * Regenerate REPOMEM.md — a human- and agent-readable index of everything in
80
+ * .repomem/. Returns the absolute path written, or null when uninitialised.
81
+ */
82
+ export declare function generateIndex(projectRoot?: string): string | null;
83
+ //# sourceMappingURL=file-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-store.d.ts","sourceRoot":"","sources":["../../src/store/file-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+B,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAA2B,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE1E,eAAO,MAAM,YAAY,EAAE,UAAU,EAKpC,CAAC;AAEF,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,eAAO,MAAM,cAAc,eAAe,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB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