momo-ai 1.0.19 → 1.0.21

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 (109) hide show
  1. package/.claude/skills/algorithmic-art/LICENSE.txt +202 -0
  2. package/.claude/skills/algorithmic-art/SKILL.md +405 -0
  3. package/.claude/skills/algorithmic-art/templates/generator_template.js +223 -0
  4. package/.claude/skills/algorithmic-art/templates/viewer.html +599 -0
  5. package/.claude/skills/r2mo-rad-lain/PROMPT.md +281 -0
  6. package/.claude/skills/r2mo-rad-lain/README.md +192 -0
  7. package/.claude/skills/r2mo-rad-lain/SKILL.md +412 -0
  8. package/.claude/skills/r2mo-rad-lain/examples/argument-parsing.js +154 -0
  9. package/.claude/skills/r2mo-rad-lain/examples/file-operations.js +182 -0
  10. package/.claude/skills/r2mo-rad-lain/file-utils-api.md +281 -0
  11. package/.claude/skills/r2mo-rad-lain/menu-api.md +187 -0
  12. package/.claude/skills/r2mo-rad-lain/scripts/file-utils.js +223 -0
  13. package/.claude/skills/r2mo-rad-lain/scripts/menu.js +289 -0
  14. package/.claude/skills/r2mo-rad-lain/scripts/yaml-parser.js +209 -0
  15. package/.claude/skills/r2mo-rad-lain/templates/command.json.template +13 -0
  16. package/.claude/skills/r2mo-rad-lain/templates/executor.js.template +32 -0
  17. package/.claude/skills/r2mo-rad-lain/templates/interactive-menu.js.template +221 -0
  18. package/.cursor/mcp.json +17 -0
  19. package/.obsidian/app.json +1 -0
  20. package/.obsidian/appearance.json +4 -0
  21. package/.obsidian/community-plugins.json +4 -0
  22. package/.obsidian/core-plugins.json +33 -0
  23. package/.obsidian/plugins/ai-agent/main.js +98495 -0
  24. package/.obsidian/plugins/ai-agent/manifest.json +11 -0
  25. package/.obsidian/plugins/ai-agent/styles.css +806 -0
  26. package/.obsidian/plugins/dataview/main.js +20876 -0
  27. package/.obsidian/plugins/dataview/manifest.json +11 -0
  28. package/.obsidian/plugins/dataview/styles.css +141 -0
  29. package/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +10 -0
  30. package/.obsidian/plugins/obsidian-excalidraw-plugin/manifest.json +12 -0
  31. package/.obsidian/plugins/obsidian-excalidraw-plugin/styles.css +1 -0
  32. package/.obsidian/plugins/templater-obsidian/main.js +45 -0
  33. package/.obsidian/plugins/templater-obsidian/manifest.json +11 -0
  34. package/.obsidian/plugins/templater-obsidian/styles.css +226 -0
  35. package/.obsidian/plugins/terminal/main.js +200 -0
  36. package/.obsidian/plugins/terminal/manifest.json +14 -0
  37. package/.obsidian/plugins/terminal/styles.css +32 -0
  38. package/.obsidian/themes/AnuPpuccin/manifest.json +7 -0
  39. package/.obsidian/themes/AnuPpuccin/theme.css +9080 -0
  40. package/.obsidian/themes/Things/manifest.json +7 -0
  41. package/.obsidian/themes/Things/theme.css +1628 -0
  42. package/.obsidian/workspace.json +196 -0
  43. package/README.md +10 -123
  44. package/docs/images/logo.jpeg +0 -0
  45. package/install.sh +1 -0
  46. package/package.json +6 -2
  47. package/skills/r2mo-rad-lain/SKILL.md +101 -0
  48. package/src/_agent/trae/momo-datamodel.json +2 -1
  49. package/src/_agent/trae/momo-module-req.json +2 -1
  50. package/src/_agent/trae/momo-system-req.json +2 -1
  51. package/src/_agent/trae/momo-task.json +2 -1
  52. package/src/_agent/trae/momo-taskplan.json +2 -1
  53. package/src/_mcp/skills-server.mjs +70 -0
  54. package/src/_skill/repositories.json +16 -0
  55. package/src/_template/LAIN/.momo/advanced/refer.json +0 -4
  56. package/src/commander/help.json +5 -0
  57. package/src/commander/mcp.json +13 -0
  58. package/src/commander/open.json +8 -2
  59. package/src/commander/skills.json +20 -0
  60. package/src/executor/executeEnv.js +48 -38
  61. package/src/executor/executeHelp.js +77 -16
  62. package/src/executor/executeInit.js +203 -149
  63. package/src/executor/executeMcp.js +290 -0
  64. package/src/executor/executeOpen.js +144 -125
  65. package/src/executor/executeSkills.js +747 -0
  66. package/src/executor/index.js +5 -39
  67. package/src/momo.js +2 -1
  68. package/src/utils/momo-args.js +39 -0
  69. package/src/utils/momo-file-utils.js +75 -0
  70. package/src/utils/momo-menu.js +54 -0
  71. package/src/commander/actor.json +0 -12
  72. package/src/commander/actors.json +0 -6
  73. package/src/commander/add.json +0 -12
  74. package/src/commander/agent.json +0 -12
  75. package/src/commander/agentcfg.json +0 -5
  76. package/src/commander/archive.json +0 -12
  77. package/src/commander/commit.json +0 -12
  78. package/src/commander/console.json +0 -7
  79. package/src/commander/lain.json +0 -7
  80. package/src/commander/list.json +0 -7
  81. package/src/commander/plan.json +0 -12
  82. package/src/commander/project.json +0 -12
  83. package/src/commander/pull.json +0 -6
  84. package/src/commander/push.json +0 -6
  85. package/src/commander/repo.json +0 -18
  86. package/src/commander/run.json +0 -18
  87. package/src/commander/show.json +0 -12
  88. package/src/commander/tasks.json +0 -18
  89. package/src/commander/unlock.json +0 -6
  90. package/src/commander/validate.json +0 -12
  91. package/src/executor/executeActor.js +0 -133
  92. package/src/executor/executeActors.js +0 -58
  93. package/src/executor/executeAdd.js +0 -307
  94. package/src/executor/executeAgent.js +0 -224
  95. package/src/executor/executeAgentCfg.js +0 -195
  96. package/src/executor/executeArchive.js +0 -124
  97. package/src/executor/executeCommit.js +0 -202
  98. package/src/executor/executeConsole.js +0 -142
  99. package/src/executor/executeList.js +0 -133
  100. package/src/executor/executePlan.js +0 -164
  101. package/src/executor/executeProject.js +0 -312
  102. package/src/executor/executePull.js +0 -127
  103. package/src/executor/executePush.js +0 -243
  104. package/src/executor/executeRepo.js +0 -238
  105. package/src/executor/executeRun.js +0 -644
  106. package/src/executor/executeShow.js +0 -164
  107. package/src/executor/executeTasks.js +0 -384
  108. package/src/executor/executeUnlock.js +0 -110
  109. package/src/executor/executeValidate.js +0 -210
@@ -0,0 +1,13 @@
1
+ {
2
+ "executor": "execute{{CommandName}}",
3
+ "description": "{{description}}",
4
+ "command": "{{command}}",
5
+ "options": [
6
+ {
7
+ "name": "{{optionName}}",
8
+ "alias": "{{optionAlias}}",
9
+ "description": "{{optionDescription}}",
10
+ "type": "string"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,32 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const Ec = require('../epic');
4
+ const fsAsync = require('fs').promises;
5
+
6
+ /**
7
+ * {{description}}
8
+ * @param {Array} options 命令选项配置
9
+ */
10
+ module.exports = async (options) => {
11
+ try {
12
+ // 参数解析
13
+ const parsed = Ec.parseArgument(options);
14
+
15
+ // 获取参数值(支持 --name 和 -n 两种形式)
16
+ // const paramValue = parsed.param || parsed.p;
17
+
18
+ // TODO: 实现业务逻辑
19
+ Ec.waiting('正在执行 {{command}} 命令...');
20
+
21
+ // 示例:文件操作
22
+ // const projectDir = process.cwd();
23
+ // const targetPath = path.join(projectDir, 'target');
24
+
25
+ // 成功退出
26
+ Ec.info('✅ {{command}} 命令执行成功!');
27
+ process.exit(0);
28
+ } catch (error) {
29
+ Ec.error(`❌ 执行过程中发生错误: ${error.message}`);
30
+ process.exit(1);
31
+ }
32
+ };
@@ -0,0 +1,221 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const Ec = require('../epic');
4
+ const fsAsync = require('fs').promises;
5
+ const readline = require('readline');
6
+
7
+ /**
8
+ * 交互式多选菜单
9
+ * @param {Array} items 菜单项列表 [{ name, description, ... }]
10
+ * @param {string} title 菜单标题
11
+ * @returns {Promise<Object>} { indices: 选中索引, items: 选中项 }
12
+ */
13
+ const _createSelectMenu = (items, title = '选择菜单') => {
14
+ return new Promise((resolve) => {
15
+ const selected = new Array(items.length).fill(false);
16
+ let cursor = 0;
17
+
18
+ // 计算最大名称长度用于对齐
19
+ const maxNameLen = Math.max(...items.map(i => i.name.length), 4);
20
+
21
+ const render = () => {
22
+ // 清屏并移动到顶部
23
+ process.stdout.write('\x1B[2J\x1B[0f');
24
+
25
+ console.log('');
26
+ console.log('[Momo AI]'.blue.bold + ` ====== ${title} ======`.blue);
27
+ console.log('');
28
+
29
+ items.forEach((item, index) => {
30
+ const isActive = index === cursor;
31
+ const checkbox = selected[index] ? '[✓]'.green : '[ ]';
32
+ const pointer = isActive ? '▸'.cyan : ' ';
33
+ const name = item.name.padEnd(maxNameLen);
34
+
35
+ if (isActive) {
36
+ console.log(` ${pointer} ${checkbox} ${name.cyan.bold}`);
37
+ } else {
38
+ console.log(` ${pointer} ${checkbox} ${name.cyan}`);
39
+ }
40
+ if (item.description) {
41
+ console.log(` ${item.description.gray}`);
42
+ }
43
+ });
44
+
45
+ console.log('');
46
+ console.log(' ─────────────────────────────────────────────────'.gray);
47
+ console.log(' ↑/↓ 移动 │ 空格 选择/取消 │ a 全选 │ n 清空 │ 回车 确认 │ q 退出'.gray);
48
+ console.log('');
49
+
50
+ const selectedCount = selected.filter(s => s).length;
51
+ if (selectedCount > 0) {
52
+ console.log(` 已选择 ${selectedCount} 项`.green);
53
+ } else {
54
+ console.log(' 未选择任何项'.yellow);
55
+ }
56
+ };
57
+
58
+ const getSelectedResult = () => {
59
+ const indices = [];
60
+ const selectedItems = [];
61
+ selected.forEach((sel, idx) => {
62
+ if (sel) {
63
+ indices.push(idx);
64
+ selectedItems.push(items[idx]);
65
+ }
66
+ });
67
+ return { indices, items: selectedItems };
68
+ };
69
+
70
+ // 启用原始模式
71
+ readline.emitKeypressEvents(process.stdin);
72
+ if (process.stdin.isTTY) {
73
+ process.stdin.setRawMode(true);
74
+ }
75
+
76
+ render();
77
+
78
+ const onKeypress = (str, key) => {
79
+ if (!key) return;
80
+
81
+ // Ctrl+C 退出
82
+ if (key.ctrl && key.name === 'c') {
83
+ process.stdin.setRawMode(false);
84
+ process.stdin.removeListener('keypress', onKeypress);
85
+ process.exit(0);
86
+ }
87
+
88
+ // q 或 ESC 退出
89
+ if (key.name === 'q' || key.name === 'escape') {
90
+ process.stdin.setRawMode(false);
91
+ process.stdin.removeListener('keypress', onKeypress);
92
+ process.stdout.write('\x1B[2J\x1B[0f');
93
+ resolve({ indices: [], items: [] });
94
+ return;
95
+ }
96
+
97
+ // 上移
98
+ if (key.name === 'up') {
99
+ cursor = cursor > 0 ? cursor - 1 : items.length - 1;
100
+ render();
101
+ return;
102
+ }
103
+
104
+ // 下移
105
+ if (key.name === 'down') {
106
+ cursor = cursor < items.length - 1 ? cursor + 1 : 0;
107
+ render();
108
+ return;
109
+ }
110
+
111
+ // 空格切换选中
112
+ if (key.name === 'space') {
113
+ selected[cursor] = !selected[cursor];
114
+ render();
115
+ return;
116
+ }
117
+
118
+ // a 全选
119
+ if (key.name === 'a') {
120
+ selected.fill(true);
121
+ render();
122
+ return;
123
+ }
124
+
125
+ // n 清空选择
126
+ if (key.name === 'n') {
127
+ selected.fill(false);
128
+ render();
129
+ return;
130
+ }
131
+
132
+ // 回车确认
133
+ if (key.name === 'return') {
134
+ const result = getSelectedResult();
135
+
136
+ if (result.indices.length === 0) {
137
+ // 没有选择,继续显示菜单
138
+ render();
139
+ return;
140
+ }
141
+
142
+ process.stdin.setRawMode(false);
143
+ process.stdin.removeListener('keypress', onKeypress);
144
+
145
+ // 清屏显示选中结果
146
+ process.stdout.write('\x1B[2J\x1B[0f');
147
+ console.log('');
148
+ console.log('[Momo AI]'.blue.bold + ' 已选择:');
149
+ console.log('');
150
+ result.items.forEach(item => {
151
+ console.log(` ✓ ${item.name}`.green);
152
+ });
153
+ console.log('');
154
+
155
+ resolve(result);
156
+ return;
157
+ }
158
+ };
159
+
160
+ process.stdin.on('keypress', onKeypress);
161
+ });
162
+ };
163
+
164
+ /**
165
+ * 带确认的交互式选择
166
+ * @param {Array} items 菜单项列表
167
+ * @param {string} title 菜单标题
168
+ * @returns {Promise<Array>} 选中的项
169
+ */
170
+ const _selectWithConfirm = async (items, title) => {
171
+ // 第一步:菜单选择
172
+ const result = await _createSelectMenu(items, title);
173
+
174
+ if (result.indices.length === 0) {
175
+ return [];
176
+ }
177
+
178
+ // 第二步:确认
179
+ const answer = await Ec.ask('确认选择?(y/N): ');
180
+ if (answer.trim().toLowerCase() === 'y' || answer.trim().toLowerCase() === 'yes') {
181
+ return result.items;
182
+ } else {
183
+ Ec.waiting('已取消');
184
+ return [];
185
+ }
186
+ };
187
+
188
+ // ============================================================
189
+ // 主执行器
190
+ // ============================================================
191
+
192
+ module.exports = async (options) => {
193
+ try {
194
+ // 示例数据
195
+ const items = [
196
+ { name: 'item-1', description: '第一个选项' },
197
+ { name: 'item-2', description: '第二个选项' },
198
+ { name: 'item-3', description: '第三个选项' },
199
+ ];
200
+
201
+ // 使用交互式菜单
202
+ const selected = await _selectWithConfirm(items, '示例菜单');
203
+
204
+ if (selected.length === 0) {
205
+ Ec.waiting('未选择任何项,退出');
206
+ process.exit(0);
207
+ }
208
+
209
+ // 处理选中的项
210
+ Ec.info(`选择了 ${selected.length} 项`);
211
+ selected.forEach(item => {
212
+ Ec.waiting(` - ${item.name}`);
213
+ });
214
+
215
+ Ec.info('✅ 执行成功!');
216
+ process.exit(0);
217
+ } catch (error) {
218
+ Ec.error(`❌ 执行过程中发生错误: ${error.message}`);
219
+ process.exit(1);
220
+ }
221
+ };
@@ -0,0 +1,17 @@
1
+ {
2
+ "mcpServers": {
3
+ "momo-skills": {
4
+ "command": "node",
5
+ "args": [
6
+ "/Users/lang/zero-cloud/app-zero/r2mo-matrix/r2mo-lain/.r2mo/mcpserver/skills-server.mjs"
7
+ ],
8
+ "env": {
9
+ "NODE_ENV": "production",
10
+ "MOMO_PROJECT_SKILLS_DIR": "/Users/lang/zero-cloud/app-zero/r2mo-matrix/r2mo-lain/.claude/skills",
11
+ "MOMO_GLOBAL_SKILLS_DIR": "/Users/lang/.claude/skills"
12
+ },
13
+ "disabled": false,
14
+ "alwaysAllow": []
15
+ }
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,4 @@
1
+ {
2
+ "theme": "moonstone",
3
+ "cssTheme": "AnuPpuccin"
4
+ }
@@ -0,0 +1,4 @@
1
+ [
2
+ "ai-agent",
3
+ "templater-obsidian"
4
+ ]
@@ -0,0 +1,33 @@
1
+ {
2
+ "file-explorer": true,
3
+ "global-search": true,
4
+ "switcher": true,
5
+ "graph": true,
6
+ "backlink": true,
7
+ "canvas": true,
8
+ "outgoing-link": true,
9
+ "tag-pane": true,
10
+ "footnotes": false,
11
+ "properties": true,
12
+ "page-preview": true,
13
+ "daily-notes": true,
14
+ "templates": true,
15
+ "note-composer": true,
16
+ "command-palette": true,
17
+ "slash-command": false,
18
+ "editor-status": true,
19
+ "bookmarks": true,
20
+ "markdown-importer": false,
21
+ "zk-prefixer": false,
22
+ "random-note": false,
23
+ "outline": true,
24
+ "word-count": true,
25
+ "slides": false,
26
+ "audio-recorder": false,
27
+ "workspaces": false,
28
+ "file-recovery": true,
29
+ "publish": false,
30
+ "sync": true,
31
+ "bases": true,
32
+ "webviewer": false
33
+ }