@memrosetta/cli 0.4.7 → 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 (43) hide show
  1. package/dist/chunk-2MO65JLK.js +139 -0
  2. package/dist/chunk-5PH2RDAS.js +750 -0
  3. package/dist/chunk-IKIJVRHU.js +16 -0
  4. package/dist/chunk-PMQKXYS6.js +752 -0
  5. package/dist/chunk-SYPVELIW.js +64 -0
  6. package/dist/chunk-TSA67QME.js +56 -0
  7. package/dist/chunk-UKGD7QXV.js +81 -0
  8. package/dist/chunk-UOT33X3Q.js +750 -0
  9. package/dist/chunk-VR3TRSC7.js +148 -0
  10. package/dist/clear-HNVVALWL.js +39 -0
  11. package/dist/compress-VZJHSVJK.js +33 -0
  12. package/dist/count-WRCFIWWS.js +24 -0
  13. package/dist/enforce-PHO4L7C2.js +381 -0
  14. package/dist/feedback-JXSKOFRS.js +51 -0
  15. package/dist/feedback-O6NKG46O.js +51 -0
  16. package/dist/hooks/enforce-claude-code.js +119 -0
  17. package/dist/hooks/on-prompt.js +9 -5
  18. package/dist/hooks/on-stop.js +8 -4
  19. package/dist/index.js +22 -16
  20. package/dist/ingest-JWLBIFEI.js +97 -0
  21. package/dist/init-ARU2CIOH.js +205 -0
  22. package/dist/init-C2MCDVWL.js +205 -0
  23. package/dist/init-LIWL7Y3H.js +205 -0
  24. package/dist/init-VUJX3RRW.js +205 -0
  25. package/dist/invalidate-QPOV2E5U.js +40 -0
  26. package/dist/invalidate-VUHHNZUX.js +40 -0
  27. package/dist/maintain-UUZ76QET.js +37 -0
  28. package/dist/relate-MIOQYWTI.js +57 -0
  29. package/dist/relate-TEZ3GIIY.js +57 -0
  30. package/dist/reset-HQFOMYVP.js +129 -0
  31. package/dist/reset-OVU4A575.js +129 -0
  32. package/dist/reset-T6DPQCWI.js +129 -0
  33. package/dist/reset-WMDSMCAR.js +129 -0
  34. package/dist/search-IXV43G2C.js +48 -0
  35. package/dist/status-BLHKHB34.js +184 -0
  36. package/dist/status-CNGR7YDV.js +184 -0
  37. package/dist/status-IHYARQXU.js +184 -0
  38. package/dist/store-DTN3PTFQ.js +101 -0
  39. package/dist/store-V7I5RJ6Y.js +101 -0
  40. package/dist/sync-EHYMBZHE.js +542 -0
  41. package/dist/sync-UJBD7575.js +542 -0
  42. package/dist/working-memory-CH524PJA.js +53 -0
  43. package/package.json +6 -5
@@ -0,0 +1,37 @@
1
+ import {
2
+ optionalOption
3
+ } from "./chunk-SYPVELIW.js";
4
+ import {
5
+ getEngine
6
+ } from "./chunk-VAVUPQZA.js";
7
+ import {
8
+ output
9
+ } from "./chunk-ET6TNQOJ.js";
10
+ import {
11
+ getDefaultUserId
12
+ } from "./chunk-SEPYQK3J.js";
13
+
14
+ // src/commands/maintain.ts
15
+ async function run(options) {
16
+ const { args, format, db, noEmbeddings } = options;
17
+ const userId = optionalOption(args, "--user") ?? getDefaultUserId();
18
+ const engine = await getEngine({ db, noEmbeddings });
19
+ const result = await engine.maintain(userId);
20
+ if (format === "text") {
21
+ process.stdout.write(`Maintenance completed for user: ${userId}
22
+ `);
23
+ process.stdout.write(` Activation scores updated: ${result.activationUpdated}
24
+ `);
25
+ process.stdout.write(` Tiers updated: ${result.tiersUpdated}
26
+ `);
27
+ process.stdout.write(` Groups compressed: ${result.compressed}
28
+ `);
29
+ process.stdout.write(` Memories archived: ${result.removed}
30
+ `);
31
+ return;
32
+ }
33
+ output({ userId, ...result }, format);
34
+ }
35
+ export {
36
+ run
37
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ buildRelationCreatedOp,
3
+ openCliSyncContext
4
+ } from "./chunk-2MO65JLK.js";
5
+ import {
6
+ optionalOption,
7
+ requireOption
8
+ } from "./chunk-NU5ZJJXP.js";
9
+ import {
10
+ getEngine,
11
+ resolveDbPath
12
+ } from "./chunk-VAVUPQZA.js";
13
+ import {
14
+ output,
15
+ outputError
16
+ } from "./chunk-ET6TNQOJ.js";
17
+ import "./chunk-SEPYQK3J.js";
18
+
19
+ // src/commands/relate.ts
20
+ var VALID_RELATION_TYPES = /* @__PURE__ */ new Set([
21
+ "updates",
22
+ "extends",
23
+ "derives",
24
+ "contradicts",
25
+ "supports"
26
+ ]);
27
+ async function run(options) {
28
+ const { args, format, db, noEmbeddings } = options;
29
+ const src = requireOption(args, "--src", "source memory ID");
30
+ const dst = requireOption(args, "--dst", "destination memory ID");
31
+ const relationType = requireOption(args, "--type", "relation type");
32
+ const reason = optionalOption(args, "--reason");
33
+ if (!VALID_RELATION_TYPES.has(relationType)) {
34
+ outputError(
35
+ `Invalid relation type: ${relationType}. Must be one of: updates, extends, derives, contradicts, supports`,
36
+ format
37
+ );
38
+ process.exitCode = 1;
39
+ return;
40
+ }
41
+ const engine = await getEngine({ db, noEmbeddings });
42
+ const relation = await engine.relate(
43
+ src,
44
+ dst,
45
+ relationType,
46
+ reason
47
+ );
48
+ const sync = await openCliSyncContext(resolveDbPath(db));
49
+ if (sync.enabled) {
50
+ sync.enqueue(buildRelationCreatedOp(sync, relation));
51
+ sync.close();
52
+ }
53
+ output(relation, format);
54
+ }
55
+ export {
56
+ run
57
+ };
@@ -0,0 +1,57 @@
1
+ import {
2
+ buildRelationCreatedOp,
3
+ openCliSyncContext
4
+ } from "./chunk-2MO65JLK.js";
5
+ import {
6
+ optionalOption,
7
+ requireOption
8
+ } from "./chunk-SYPVELIW.js";
9
+ import {
10
+ getEngine,
11
+ resolveDbPath
12
+ } from "./chunk-VAVUPQZA.js";
13
+ import {
14
+ output,
15
+ outputError
16
+ } from "./chunk-ET6TNQOJ.js";
17
+ import "./chunk-SEPYQK3J.js";
18
+
19
+ // src/commands/relate.ts
20
+ var VALID_RELATION_TYPES = /* @__PURE__ */ new Set([
21
+ "updates",
22
+ "extends",
23
+ "derives",
24
+ "contradicts",
25
+ "supports"
26
+ ]);
27
+ async function run(options) {
28
+ const { args, format, db, noEmbeddings } = options;
29
+ const src = requireOption(args, "--src", "source memory ID");
30
+ const dst = requireOption(args, "--dst", "destination memory ID");
31
+ const relationType = requireOption(args, "--type", "relation type");
32
+ const reason = optionalOption(args, "--reason");
33
+ if (!VALID_RELATION_TYPES.has(relationType)) {
34
+ outputError(
35
+ `Invalid relation type: ${relationType}. Must be one of: updates, extends, derives, contradicts, supports`,
36
+ format
37
+ );
38
+ process.exitCode = 1;
39
+ return;
40
+ }
41
+ const engine = await getEngine({ db, noEmbeddings });
42
+ const relation = await engine.relate(
43
+ src,
44
+ dst,
45
+ relationType,
46
+ reason
47
+ );
48
+ const sync = await openCliSyncContext(resolveDbPath(db));
49
+ if (sync.enabled) {
50
+ sync.enqueue(buildRelationCreatedOp(sync, relation));
51
+ sync.close();
52
+ }
53
+ output(relation, format);
54
+ }
55
+ export {
56
+ run
57
+ };
@@ -0,0 +1,129 @@
1
+ import {
2
+ removeAgentsMdSection,
3
+ removeClaudeCodeHooks,
4
+ removeClaudeMdSection,
5
+ removeCodexMCP,
6
+ removeCursorMCP,
7
+ removeCursorRulesSection,
8
+ removeGeminiMCP,
9
+ removeGeminiMdSection,
10
+ removeGenericMCP
11
+ } from "./chunk-5PH2RDAS.js";
12
+ import {
13
+ hasFlag
14
+ } from "./chunk-SYPVELIW.js";
15
+ import {
16
+ output
17
+ } from "./chunk-ET6TNQOJ.js";
18
+
19
+ // src/commands/reset.ts
20
+ async function run(options) {
21
+ const { args, format } = options;
22
+ const wantClaudeCode = hasFlag(args, "--claude-code");
23
+ const wantCursor = hasFlag(args, "--cursor");
24
+ const wantCodex = hasFlag(args, "--codex");
25
+ const wantGemini = hasFlag(args, "--gemini");
26
+ const wantMCP = hasFlag(args, "--mcp");
27
+ const wantAll = hasFlag(args, "--all");
28
+ const noFlags = !wantClaudeCode && !wantCursor && !wantCodex && !wantGemini && !wantMCP && !wantAll;
29
+ if (noFlags) {
30
+ const msg = "Usage: memrosetta reset [--claude-code] [--cursor] [--codex] [--gemini] [--mcp] [--all]\n\nFlags:\n --claude-code Remove Claude Code hooks, MCP, and CLAUDE.md section\n --cursor Remove Cursor MCP configuration\n --codex Remove Codex MCP configuration and AGENTS.md section\n --gemini Remove Gemini MCP configuration and GEMINI.md section\n --mcp Remove generic MCP configuration (~/.mcp.json)\n --all Remove all integrations\n";
31
+ if (format === "text") {
32
+ process.stdout.write(msg);
33
+ } else {
34
+ output({ error: "No flags specified. Use --claude-code, --cursor, --codex, --gemini, --mcp, or --all." }, format);
35
+ }
36
+ return;
37
+ }
38
+ const result = {
39
+ removed: {
40
+ claudeCodeHooks: false,
41
+ claudeMd: false,
42
+ mcp: false,
43
+ cursor: false,
44
+ cursorRules: false,
45
+ codex: false,
46
+ agentsMd: false,
47
+ gemini: false,
48
+ geminiMd: false
49
+ }
50
+ };
51
+ if (wantClaudeCode || wantAll) {
52
+ const hooksRemoved = removeClaudeCodeHooks();
53
+ const mdRemoved = removeClaudeMdSection();
54
+ const mcpRemoved = removeGenericMCP();
55
+ result.removed.claudeCodeHooks = hooksRemoved;
56
+ result.removed.claudeMd = mdRemoved;
57
+ if (!wantMCP) {
58
+ result.removed.mcp = mcpRemoved;
59
+ }
60
+ }
61
+ if (wantCursor || wantAll) {
62
+ const removed = removeCursorMCP();
63
+ result.removed.cursor = removed;
64
+ const rulesRemoved = removeCursorRulesSection();
65
+ result.removed.cursorRules = rulesRemoved;
66
+ }
67
+ if (wantCodex || wantAll) {
68
+ const removed = removeCodexMCP();
69
+ result.removed.codex = removed;
70
+ const mdRemoved = removeAgentsMdSection();
71
+ result.removed.agentsMd = mdRemoved;
72
+ }
73
+ if (wantGemini || wantAll) {
74
+ const removed = removeGeminiMCP();
75
+ result.removed.gemini = removed;
76
+ const mdRemoved = removeGeminiMdSection();
77
+ result.removed.geminiMd = mdRemoved;
78
+ }
79
+ if (wantMCP || wantAll) {
80
+ const removed = removeGenericMCP();
81
+ result.removed.mcp = removed;
82
+ }
83
+ if (format === "text") {
84
+ printTextOutput(result);
85
+ return;
86
+ }
87
+ output(result, format);
88
+ }
89
+ function printTextOutput(result) {
90
+ const w = (s) => process.stdout.write(s);
91
+ const removed = result.removed;
92
+ if (removed.claudeCodeHooks) {
93
+ w("Removed Claude Code hooks from ~/.claude/settings.json\n");
94
+ }
95
+ if (removed.claudeMd) {
96
+ w("Removed MemRosetta section from ~/.claude/CLAUDE.md\n");
97
+ }
98
+ if (removed.mcp) {
99
+ w("Removed MCP server from ~/.mcp.json\n");
100
+ }
101
+ if (removed.cursor) {
102
+ w("Removed Cursor MCP from ~/.cursor/mcp.json\n");
103
+ }
104
+ if (removed.cursorRules) {
105
+ w("Removed MemRosetta section from ~/.cursorrules\n");
106
+ }
107
+ if (removed.codex) {
108
+ w("Removed Codex MCP from ~/.codex/config.toml\n");
109
+ }
110
+ if (removed.agentsMd) {
111
+ w("Removed MemRosetta section from AGENTS.md\n");
112
+ }
113
+ if (removed.gemini) {
114
+ w("Removed Gemini MCP from ~/.gemini/settings.json\n");
115
+ }
116
+ if (removed.geminiMd) {
117
+ w("Removed MemRosetta section from GEMINI.md\n");
118
+ }
119
+ const anyRemoved = removed.claudeCodeHooks || removed.claudeMd || removed.mcp || removed.cursor || removed.cursorRules || removed.codex || removed.agentsMd || removed.gemini || removed.geminiMd;
120
+ if (!anyRemoved) {
121
+ w("Nothing to remove (no integrations were configured).\n");
122
+ }
123
+ w(
124
+ "\nNote: ~/.memrosetta/ directory preserved. Delete manually if needed:\n rm -rf ~/.memrosetta\n"
125
+ );
126
+ }
127
+ export {
128
+ run
129
+ };
@@ -0,0 +1,129 @@
1
+ import {
2
+ removeAgentsMdSection,
3
+ removeClaudeCodeHooks,
4
+ removeClaudeMdSection,
5
+ removeCodexMCP,
6
+ removeCursorMCP,
7
+ removeCursorRulesSection,
8
+ removeGeminiMCP,
9
+ removeGeminiMdSection,
10
+ removeGenericMCP
11
+ } from "./chunk-PMQKXYS6.js";
12
+ import {
13
+ hasFlag
14
+ } from "./chunk-SYPVELIW.js";
15
+ import {
16
+ output
17
+ } from "./chunk-ET6TNQOJ.js";
18
+
19
+ // src/commands/reset.ts
20
+ async function run(options) {
21
+ const { args, format } = options;
22
+ const wantClaudeCode = hasFlag(args, "--claude-code");
23
+ const wantCursor = hasFlag(args, "--cursor");
24
+ const wantCodex = hasFlag(args, "--codex");
25
+ const wantGemini = hasFlag(args, "--gemini");
26
+ const wantMCP = hasFlag(args, "--mcp");
27
+ const wantAll = hasFlag(args, "--all");
28
+ const noFlags = !wantClaudeCode && !wantCursor && !wantCodex && !wantGemini && !wantMCP && !wantAll;
29
+ if (noFlags) {
30
+ const msg = "Usage: memrosetta reset [--claude-code] [--cursor] [--codex] [--gemini] [--mcp] [--all]\n\nFlags:\n --claude-code Remove Claude Code hooks, MCP, and CLAUDE.md section\n --cursor Remove Cursor MCP configuration\n --codex Remove Codex MCP configuration and AGENTS.md section\n --gemini Remove Gemini MCP configuration and GEMINI.md section\n --mcp Remove generic MCP configuration (~/.mcp.json)\n --all Remove all integrations\n";
31
+ if (format === "text") {
32
+ process.stdout.write(msg);
33
+ } else {
34
+ output({ error: "No flags specified. Use --claude-code, --cursor, --codex, --gemini, --mcp, or --all." }, format);
35
+ }
36
+ return;
37
+ }
38
+ const result = {
39
+ removed: {
40
+ claudeCodeHooks: false,
41
+ claudeMd: false,
42
+ mcp: false,
43
+ cursor: false,
44
+ cursorRules: false,
45
+ codex: false,
46
+ agentsMd: false,
47
+ gemini: false,
48
+ geminiMd: false
49
+ }
50
+ };
51
+ if (wantClaudeCode || wantAll) {
52
+ const hooksRemoved = removeClaudeCodeHooks();
53
+ const mdRemoved = removeClaudeMdSection();
54
+ const mcpRemoved = removeGenericMCP();
55
+ result.removed.claudeCodeHooks = hooksRemoved;
56
+ result.removed.claudeMd = mdRemoved;
57
+ if (!wantMCP) {
58
+ result.removed.mcp = mcpRemoved;
59
+ }
60
+ }
61
+ if (wantCursor || wantAll) {
62
+ const removed = removeCursorMCP();
63
+ result.removed.cursor = removed;
64
+ const rulesRemoved = removeCursorRulesSection();
65
+ result.removed.cursorRules = rulesRemoved;
66
+ }
67
+ if (wantCodex || wantAll) {
68
+ const removed = removeCodexMCP();
69
+ result.removed.codex = removed;
70
+ const mdRemoved = removeAgentsMdSection();
71
+ result.removed.agentsMd = mdRemoved;
72
+ }
73
+ if (wantGemini || wantAll) {
74
+ const removed = removeGeminiMCP();
75
+ result.removed.gemini = removed;
76
+ const mdRemoved = removeGeminiMdSection();
77
+ result.removed.geminiMd = mdRemoved;
78
+ }
79
+ if (wantMCP || wantAll) {
80
+ const removed = removeGenericMCP();
81
+ result.removed.mcp = removed;
82
+ }
83
+ if (format === "text") {
84
+ printTextOutput(result);
85
+ return;
86
+ }
87
+ output(result, format);
88
+ }
89
+ function printTextOutput(result) {
90
+ const w = (s) => process.stdout.write(s);
91
+ const removed = result.removed;
92
+ if (removed.claudeCodeHooks) {
93
+ w("Removed Claude Code hooks from ~/.claude/settings.json\n");
94
+ }
95
+ if (removed.claudeMd) {
96
+ w("Removed MemRosetta section from ~/.claude/CLAUDE.md\n");
97
+ }
98
+ if (removed.mcp) {
99
+ w("Removed MCP server from ~/.mcp.json\n");
100
+ }
101
+ if (removed.cursor) {
102
+ w("Removed Cursor MCP from ~/.cursor/mcp.json\n");
103
+ }
104
+ if (removed.cursorRules) {
105
+ w("Removed MemRosetta section from ~/.cursorrules\n");
106
+ }
107
+ if (removed.codex) {
108
+ w("Removed Codex MCP from ~/.codex/config.toml\n");
109
+ }
110
+ if (removed.agentsMd) {
111
+ w("Removed MemRosetta section from AGENTS.md\n");
112
+ }
113
+ if (removed.gemini) {
114
+ w("Removed Gemini MCP from ~/.gemini/settings.json\n");
115
+ }
116
+ if (removed.geminiMd) {
117
+ w("Removed MemRosetta section from GEMINI.md\n");
118
+ }
119
+ const anyRemoved = removed.claudeCodeHooks || removed.claudeMd || removed.mcp || removed.cursor || removed.cursorRules || removed.codex || removed.agentsMd || removed.gemini || removed.geminiMd;
120
+ if (!anyRemoved) {
121
+ w("Nothing to remove (no integrations were configured).\n");
122
+ }
123
+ w(
124
+ "\nNote: ~/.memrosetta/ directory preserved. Delete manually if needed:\n rm -rf ~/.memrosetta\n"
125
+ );
126
+ }
127
+ export {
128
+ run
129
+ };
@@ -0,0 +1,129 @@
1
+ import {
2
+ removeAgentsMdSection,
3
+ removeClaudeCodeHooks,
4
+ removeClaudeMdSection,
5
+ removeCodexMCP,
6
+ removeCursorMCP,
7
+ removeCursorRulesSection,
8
+ removeGeminiMCP,
9
+ removeGeminiMdSection,
10
+ removeGenericMCP
11
+ } from "./chunk-IS4IKWPL.js";
12
+ import {
13
+ hasFlag
14
+ } from "./chunk-SYPVELIW.js";
15
+ import {
16
+ output
17
+ } from "./chunk-ET6TNQOJ.js";
18
+
19
+ // src/commands/reset.ts
20
+ async function run(options) {
21
+ const { args, format } = options;
22
+ const wantClaudeCode = hasFlag(args, "--claude-code");
23
+ const wantCursor = hasFlag(args, "--cursor");
24
+ const wantCodex = hasFlag(args, "--codex");
25
+ const wantGemini = hasFlag(args, "--gemini");
26
+ const wantMCP = hasFlag(args, "--mcp");
27
+ const wantAll = hasFlag(args, "--all");
28
+ const noFlags = !wantClaudeCode && !wantCursor && !wantCodex && !wantGemini && !wantMCP && !wantAll;
29
+ if (noFlags) {
30
+ const msg = "Usage: memrosetta reset [--claude-code] [--cursor] [--codex] [--gemini] [--mcp] [--all]\n\nFlags:\n --claude-code Remove Claude Code hooks, MCP, and CLAUDE.md section\n --cursor Remove Cursor MCP configuration\n --codex Remove Codex MCP configuration and AGENTS.md section\n --gemini Remove Gemini MCP configuration and GEMINI.md section\n --mcp Remove generic MCP configuration (~/.mcp.json)\n --all Remove all integrations\n";
31
+ if (format === "text") {
32
+ process.stdout.write(msg);
33
+ } else {
34
+ output({ error: "No flags specified. Use --claude-code, --cursor, --codex, --gemini, --mcp, or --all." }, format);
35
+ }
36
+ return;
37
+ }
38
+ const result = {
39
+ removed: {
40
+ claudeCodeHooks: false,
41
+ claudeMd: false,
42
+ mcp: false,
43
+ cursor: false,
44
+ cursorRules: false,
45
+ codex: false,
46
+ agentsMd: false,
47
+ gemini: false,
48
+ geminiMd: false
49
+ }
50
+ };
51
+ if (wantClaudeCode || wantAll) {
52
+ const hooksRemoved = removeClaudeCodeHooks();
53
+ const mdRemoved = removeClaudeMdSection();
54
+ const mcpRemoved = removeGenericMCP();
55
+ result.removed.claudeCodeHooks = hooksRemoved;
56
+ result.removed.claudeMd = mdRemoved;
57
+ if (!wantMCP) {
58
+ result.removed.mcp = mcpRemoved;
59
+ }
60
+ }
61
+ if (wantCursor || wantAll) {
62
+ const removed = removeCursorMCP();
63
+ result.removed.cursor = removed;
64
+ const rulesRemoved = removeCursorRulesSection();
65
+ result.removed.cursorRules = rulesRemoved;
66
+ }
67
+ if (wantCodex || wantAll) {
68
+ const removed = removeCodexMCP();
69
+ result.removed.codex = removed;
70
+ const mdRemoved = removeAgentsMdSection();
71
+ result.removed.agentsMd = mdRemoved;
72
+ }
73
+ if (wantGemini || wantAll) {
74
+ const removed = removeGeminiMCP();
75
+ result.removed.gemini = removed;
76
+ const mdRemoved = removeGeminiMdSection();
77
+ result.removed.geminiMd = mdRemoved;
78
+ }
79
+ if (wantMCP || wantAll) {
80
+ const removed = removeGenericMCP();
81
+ result.removed.mcp = removed;
82
+ }
83
+ if (format === "text") {
84
+ printTextOutput(result);
85
+ return;
86
+ }
87
+ output(result, format);
88
+ }
89
+ function printTextOutput(result) {
90
+ const w = (s) => process.stdout.write(s);
91
+ const removed = result.removed;
92
+ if (removed.claudeCodeHooks) {
93
+ w("Removed Claude Code hooks from ~/.claude/settings.json\n");
94
+ }
95
+ if (removed.claudeMd) {
96
+ w("Removed MemRosetta section from ~/.claude/CLAUDE.md\n");
97
+ }
98
+ if (removed.mcp) {
99
+ w("Removed MCP server from ~/.mcp.json\n");
100
+ }
101
+ if (removed.cursor) {
102
+ w("Removed Cursor MCP from ~/.cursor/mcp.json\n");
103
+ }
104
+ if (removed.cursorRules) {
105
+ w("Removed MemRosetta section from ~/.cursorrules\n");
106
+ }
107
+ if (removed.codex) {
108
+ w("Removed Codex MCP from ~/.codex/config.toml\n");
109
+ }
110
+ if (removed.agentsMd) {
111
+ w("Removed MemRosetta section from AGENTS.md\n");
112
+ }
113
+ if (removed.gemini) {
114
+ w("Removed Gemini MCP from ~/.gemini/settings.json\n");
115
+ }
116
+ if (removed.geminiMd) {
117
+ w("Removed MemRosetta section from GEMINI.md\n");
118
+ }
119
+ const anyRemoved = removed.claudeCodeHooks || removed.claudeMd || removed.mcp || removed.cursor || removed.cursorRules || removed.codex || removed.agentsMd || removed.gemini || removed.geminiMd;
120
+ if (!anyRemoved) {
121
+ w("Nothing to remove (no integrations were configured).\n");
122
+ }
123
+ w(
124
+ "\nNote: ~/.memrosetta/ directory preserved. Delete manually if needed:\n rm -rf ~/.memrosetta\n"
125
+ );
126
+ }
127
+ export {
128
+ run
129
+ };
@@ -0,0 +1,129 @@
1
+ import {
2
+ removeAgentsMdSection,
3
+ removeClaudeCodeHooks,
4
+ removeClaudeMdSection,
5
+ removeCodexMCP,
6
+ removeCursorMCP,
7
+ removeCursorRulesSection,
8
+ removeGeminiMCP,
9
+ removeGeminiMdSection,
10
+ removeGenericMCP
11
+ } from "./chunk-UOT33X3Q.js";
12
+ import {
13
+ hasFlag
14
+ } from "./chunk-SYPVELIW.js";
15
+ import {
16
+ output
17
+ } from "./chunk-ET6TNQOJ.js";
18
+
19
+ // src/commands/reset.ts
20
+ async function run(options) {
21
+ const { args, format } = options;
22
+ const wantClaudeCode = hasFlag(args, "--claude-code");
23
+ const wantCursor = hasFlag(args, "--cursor");
24
+ const wantCodex = hasFlag(args, "--codex");
25
+ const wantGemini = hasFlag(args, "--gemini");
26
+ const wantMCP = hasFlag(args, "--mcp");
27
+ const wantAll = hasFlag(args, "--all");
28
+ const noFlags = !wantClaudeCode && !wantCursor && !wantCodex && !wantGemini && !wantMCP && !wantAll;
29
+ if (noFlags) {
30
+ const msg = "Usage: memrosetta reset [--claude-code] [--cursor] [--codex] [--gemini] [--mcp] [--all]\n\nFlags:\n --claude-code Remove Claude Code hooks, MCP, and CLAUDE.md section\n --cursor Remove Cursor MCP configuration\n --codex Remove Codex MCP configuration and AGENTS.md section\n --gemini Remove Gemini MCP configuration and GEMINI.md section\n --mcp Remove generic MCP configuration (~/.mcp.json)\n --all Remove all integrations\n";
31
+ if (format === "text") {
32
+ process.stdout.write(msg);
33
+ } else {
34
+ output({ error: "No flags specified. Use --claude-code, --cursor, --codex, --gemini, --mcp, or --all." }, format);
35
+ }
36
+ return;
37
+ }
38
+ const result = {
39
+ removed: {
40
+ claudeCodeHooks: false,
41
+ claudeMd: false,
42
+ mcp: false,
43
+ cursor: false,
44
+ cursorRules: false,
45
+ codex: false,
46
+ agentsMd: false,
47
+ gemini: false,
48
+ geminiMd: false
49
+ }
50
+ };
51
+ if (wantClaudeCode || wantAll) {
52
+ const hooksRemoved = removeClaudeCodeHooks();
53
+ const mdRemoved = removeClaudeMdSection();
54
+ const mcpRemoved = removeGenericMCP();
55
+ result.removed.claudeCodeHooks = hooksRemoved;
56
+ result.removed.claudeMd = mdRemoved;
57
+ if (!wantMCP) {
58
+ result.removed.mcp = mcpRemoved;
59
+ }
60
+ }
61
+ if (wantCursor || wantAll) {
62
+ const removed = removeCursorMCP();
63
+ result.removed.cursor = removed;
64
+ const rulesRemoved = removeCursorRulesSection();
65
+ result.removed.cursorRules = rulesRemoved;
66
+ }
67
+ if (wantCodex || wantAll) {
68
+ const removed = removeCodexMCP();
69
+ result.removed.codex = removed;
70
+ const mdRemoved = removeAgentsMdSection();
71
+ result.removed.agentsMd = mdRemoved;
72
+ }
73
+ if (wantGemini || wantAll) {
74
+ const removed = removeGeminiMCP();
75
+ result.removed.gemini = removed;
76
+ const mdRemoved = removeGeminiMdSection();
77
+ result.removed.geminiMd = mdRemoved;
78
+ }
79
+ if (wantMCP || wantAll) {
80
+ const removed = removeGenericMCP();
81
+ result.removed.mcp = removed;
82
+ }
83
+ if (format === "text") {
84
+ printTextOutput(result);
85
+ return;
86
+ }
87
+ output(result, format);
88
+ }
89
+ function printTextOutput(result) {
90
+ const w = (s) => process.stdout.write(s);
91
+ const removed = result.removed;
92
+ if (removed.claudeCodeHooks) {
93
+ w("Removed Claude Code hooks from ~/.claude/settings.json\n");
94
+ }
95
+ if (removed.claudeMd) {
96
+ w("Removed MemRosetta section from ~/.claude/CLAUDE.md\n");
97
+ }
98
+ if (removed.mcp) {
99
+ w("Removed MCP server from ~/.mcp.json\n");
100
+ }
101
+ if (removed.cursor) {
102
+ w("Removed Cursor MCP from ~/.cursor/mcp.json\n");
103
+ }
104
+ if (removed.cursorRules) {
105
+ w("Removed MemRosetta section from ~/.cursorrules\n");
106
+ }
107
+ if (removed.codex) {
108
+ w("Removed Codex MCP from ~/.codex/config.toml\n");
109
+ }
110
+ if (removed.agentsMd) {
111
+ w("Removed MemRosetta section from AGENTS.md\n");
112
+ }
113
+ if (removed.gemini) {
114
+ w("Removed Gemini MCP from ~/.gemini/settings.json\n");
115
+ }
116
+ if (removed.geminiMd) {
117
+ w("Removed MemRosetta section from GEMINI.md\n");
118
+ }
119
+ const anyRemoved = removed.claudeCodeHooks || removed.claudeMd || removed.mcp || removed.cursor || removed.cursorRules || removed.codex || removed.agentsMd || removed.gemini || removed.geminiMd;
120
+ if (!anyRemoved) {
121
+ w("Nothing to remove (no integrations were configured).\n");
122
+ }
123
+ w(
124
+ "\nNote: ~/.memrosetta/ directory preserved. Delete manually if needed:\n rm -rf ~/.memrosetta\n"
125
+ );
126
+ }
127
+ export {
128
+ run
129
+ };