zero-ai 1.0.72 → 1.0.74

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 (45) hide show
  1. package/.r2mo/.obsidian/app.json +1 -0
  2. package/.r2mo/.obsidian/appearance.json +10 -0
  3. package/.r2mo/.obsidian/community-plugins.json +7 -0
  4. package/.r2mo/.obsidian/core-plugins.json +33 -0
  5. package/.r2mo/.obsidian/plugins/dataview/main.js +20876 -0
  6. package/.r2mo/.obsidian/plugins/dataview/manifest.json +11 -0
  7. package/.r2mo/.obsidian/plugins/dataview/styles.css +141 -0
  8. package/.r2mo/.obsidian/plugins/obsidian-excalidraw-plugin/data.json +815 -0
  9. package/.r2mo/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +10 -0
  10. package/.r2mo/.obsidian/plugins/obsidian-excalidraw-plugin/manifest.json +12 -0
  11. package/.r2mo/.obsidian/plugins/obsidian-excalidraw-plugin/styles.css +1 -0
  12. package/.r2mo/.obsidian/plugins/obsidian-kanban/main.js +153 -0
  13. package/.r2mo/.obsidian/plugins/obsidian-kanban/manifest.json +11 -0
  14. package/.r2mo/.obsidian/plugins/obsidian-kanban/styles.css +1 -0
  15. package/.r2mo/.obsidian/plugins/obsidian-plantuml/main.js +7732 -0
  16. package/.r2mo/.obsidian/plugins/obsidian-plantuml/manifest.json +10 -0
  17. package/.r2mo/.obsidian/plugins/obsidian-plantuml/styles.css +38 -0
  18. package/.r2mo/.obsidian/plugins/obsidian-tasks-plugin/main.js +504 -0
  19. package/.r2mo/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +12 -0
  20. package/.r2mo/.obsidian/plugins/obsidian-tasks-plugin/styles.css +1 -0
  21. package/.r2mo/.obsidian/snippets/body-font.css +9 -0
  22. package/.r2mo/.obsidian/themes/Comfort/manifest.json +11 -0
  23. package/.r2mo/.obsidian/themes/Comfort/theme.css +218 -0
  24. package/.r2mo/.obsidian/themes/Primary/manifest.json +9 -0
  25. package/.r2mo/.obsidian/themes/Primary/theme.css +3878 -0
  26. package/.r2mo/.obsidian/themes/Retro Windows/manifest.json +7 -0
  27. package/.r2mo/.obsidian/themes/Retro Windows/theme.css +582 -0
  28. package/.r2mo/.obsidian/themes/RetroOS 98/manifest.json +9 -0
  29. package/.r2mo/.obsidian/themes/RetroOS 98/theme.css +2566 -0
  30. package/.r2mo/.obsidian/themes/Serenity/manifest.json +7 -0
  31. package/.r2mo/.obsidian/themes/Serenity/theme.css +7258 -0
  32. package/.r2mo/.obsidian/themes/W95/manifest.json +8 -0
  33. package/.r2mo/.obsidian/themes/W95/theme.css +768 -0
  34. package/.r2mo/.obsidian/types.json +28 -0
  35. package/.r2mo/task/task-001.md +12 -0
  36. package/.r2mo/task/thread +1 -0
  37. package/package.json +1 -1
  38. package/src/commander/{perm.json → ex-perm.json} +3 -3
  39. package/src/commander-ai/{fn.perm.js → fn.ex.perm.js} +35 -11
  40. package/src/commander-ai/fn.random.md5.js +9 -0
  41. package/src/commander-ai/fn.source.app.js +9 -0
  42. package/src/commander-ai/fn.source.front.js +9 -0
  43. package/src/commander-ai/fn.source.spring.js +9 -0
  44. package/src/commander-ai/fn.source.zero.js +9 -0
  45. package/src/commander-ai/index.js +2 -2
@@ -0,0 +1,28 @@
1
+ {
2
+ "types": {
3
+ "aliases": "aliases",
4
+ "cssclasses": "multitext",
5
+ "tags": "tags",
6
+ "TQ_explain": "checkbox",
7
+ "TQ_extra_instructions": "text",
8
+ "TQ_short_mode": "checkbox",
9
+ "TQ_show_backlink": "checkbox",
10
+ "TQ_show_cancelled_date": "checkbox",
11
+ "TQ_show_created_date": "checkbox",
12
+ "TQ_show_depends_on": "checkbox",
13
+ "TQ_show_done_date": "checkbox",
14
+ "TQ_show_due_date": "checkbox",
15
+ "TQ_show_edit_button": "checkbox",
16
+ "TQ_show_id": "checkbox",
17
+ "TQ_show_on_completion": "checkbox",
18
+ "TQ_show_postpone_button": "checkbox",
19
+ "TQ_show_priority": "checkbox",
20
+ "TQ_show_recurrence_rule": "checkbox",
21
+ "TQ_show_scheduled_date": "checkbox",
22
+ "TQ_show_start_date": "checkbox",
23
+ "TQ_show_tags": "checkbox",
24
+ "TQ_show_task_count": "checkbox",
25
+ "TQ_show_tree": "checkbox",
26
+ "TQ_show_urgency": "checkbox"
27
+ }
28
+ }
@@ -0,0 +1,12 @@
1
+ ---
2
+ runAt: 2026-02-12.22-47-18
3
+ title: 开发 ai ex-res 命令
4
+ ---
5
+
6
+ # 任务
7
+
8
+ 开发 `ai ex-res` 命令对已经开发好的 API 进行授权,此命令为固定命令,要完成全套执行操作,系统重启后要保证权限生效,且命令必须拥有幂等性。
9
+
10
+ ### 基础输入
11
+
12
+ - 固定角色ID(授权到角色即可):`e501b47a-c08b-4c83-b12b-95ad82873e96`
@@ -0,0 +1 @@
1
+ 5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zero-ai",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "Zero Ecotope AI",
5
5
  "main": "src/ai.js",
6
6
  "bin": {
@@ -1,8 +1,8 @@
1
1
  {
2
- "executor": "executePerm",
2
+ "executor": "executeExPerm",
3
3
  "description": "按参考角色复制权限到指定角色(-r 为角色 NAME 或 CODE)",
4
- "command": "perm",
4
+ "command": "ex-perm",
5
5
  "options": [
6
- {"name": "role", "alias": "r", "description": "角色名或角色 code,对应 S_ROLE.NAME 或 S_ROLE.CODE", "required": true}
6
+ {"name": "role", "alias": "r", "description": "角色名或角色 code,对应 S_ROLE.NAME 或 S_ROLE.CODE"}
7
7
  ]
8
8
  }
@@ -7,12 +7,13 @@ const REF_ROLE_ID = "e501b47a-c08b-4c83-b12b-95ad82873e96";
7
7
  const REQUIRED_ENV_KEYS = ["Z_DB_TYPE", "Z_DBS_INSTANCE", "Z_DB_APP_USER", "Z_DB_APP_PASS"];
8
8
 
9
9
  /**
10
- * 从 pom.xml 读取根 artifactId(第一个 <artifactId>)
10
+ * 从 pom.xml 读取当前项目的 artifactId(排除 <parent> 内的)
11
11
  */
12
12
  function getArtifactIdFromPom(cwd) {
13
13
  const pomPath = path.resolve(cwd, "pom.xml");
14
14
  if (!fs.existsSync(pomPath)) return null;
15
- const content = fs.readFileSync(pomPath, "utf-8");
15
+ let content = fs.readFileSync(pomPath, "utf-8");
16
+ content = content.replace(/<parent>[\s\S]*?<\/parent>/i, "");
16
17
  const m = content.match(/<artifactId>([^<]+)<\/artifactId>/);
17
18
  return m ? m[1].trim() : null;
18
19
  }
@@ -34,15 +35,26 @@ function loadAppEnv(filePath) {
34
35
  }
35
36
 
36
37
  /**
37
- * 解析 .r2mo/app.env 路径:ONE 用当前目录,DPA 备选为 {artifactId}-api/.r2mo/app.env
38
+ * 解析 .r2mo/app.env 路径:
39
+ * ONE:当前目录 .r2mo/app.env
40
+ * DPA:{id}-api/.r2mo/app.env,id 来自 pom.xml 或当前目录名
41
+ * 支持两种布局:api 在项目内 (cwd/{id}-api) 或 与项目并列 (cwd/../{id}-api)
38
42
  */
39
43
  function resolveAppEnvPath(cwd) {
40
44
  const primary = path.resolve(cwd, ".r2mo", "app.env");
41
45
  if (fs.existsSync(primary)) return primary;
42
- const artifactId = getArtifactIdFromPom(cwd);
46
+
47
+ let artifactId = getArtifactIdFromPom(cwd);
48
+ if (!artifactId) {
49
+ const base = path.basename(cwd);
50
+ if (base && base !== ".") artifactId = base;
51
+ }
43
52
  if (artifactId) {
44
- const dpaPath = path.resolve(cwd, `${artifactId}-api`, ".r2mo", "app.env");
45
- if (fs.existsSync(dpaPath)) return dpaPath;
53
+ const apiDir = `${artifactId}-api`;
54
+ const nested = path.resolve(cwd, apiDir, ".r2mo", "app.env");
55
+ if (fs.existsSync(nested)) return nested;
56
+ const sibling = path.resolve(cwd, "..", apiDir, ".r2mo", "app.env");
57
+ if (fs.existsSync(sibling)) return sibling;
46
58
  }
47
59
  return null;
48
60
  }
@@ -52,18 +64,30 @@ module.exports = async (options) => {
52
64
  const parsed = Ut.parseArgument(options);
53
65
  const roleInput = parsed.role;
54
66
  if (!roleInput || !String(roleInput).trim()) {
55
- Ec.error("请使用 -r 指定角色(NAME 或 CODE)");
56
- Ec.info("示例:ai perm -r 管理员 或 ai perm -r ADMIN");
67
+ Ec.error("缺少必需参数:角色(NAME 或 CODE)");
68
+ Ec.info("参数格式:");
69
+ Ec.info(" -r <角色> 或 --role <角色>");
70
+ Ec.info("示例:");
71
+ Ec.info(" ai ex-perm -r 管理员");
72
+ Ec.info(" ai ex-perm --role ADMIN");
57
73
  process.exit(1);
58
74
  }
59
75
 
60
- Ec.execute(`ai perm:目标角色(-r)= ${roleInput}`);
76
+ Ec.execute(`ai ex-perm:目标角色(-r / --role)= ${roleInput}`);
61
77
 
62
78
  const cwd = process.cwd();
63
79
  const appEnvPath = resolveAppEnvPath(cwd);
64
80
  if (!appEnvPath) {
65
- Ec.error(".r2mo/app.env 不存在;DPA 架构下也未找到 {id}-api/.r2mo/app.env(id 来自当前 pom.xml)");
66
- Ec.info("请确认:1) 当前目录为项目根 2) DPA 项目下存在 pom.xml 且存在 {artifactId}-api/.r2mo/app.env");
81
+ const tried = [path.resolve(cwd, ".r2mo", "app.env")];
82
+ const id = getArtifactIdFromPom(cwd) || path.basename(cwd);
83
+ if (id) {
84
+ tried.push(path.resolve(cwd, `${id}-api`, ".r2mo", "app.env"));
85
+ tried.push(path.resolve(cwd, "..", `${id}-api`, ".r2mo", "app.env"));
86
+ }
87
+ Ec.error(".r2mo/app.env 不存在;DPA 下也未找到 {id}-api/.r2mo/app.env");
88
+ Ec.info("已尝试路径(id=" + (id || "未解析") + "):");
89
+ tried.forEach((p) => Ec.info(` - ${p}`));
90
+ Ec.info("请确认:1) 在项目根执行 2) 存在 .r2mo/app.env 或 {id}-api/.r2mo/app.env(嵌套或与项目并列)");
67
91
  process.exit(1);
68
92
  }
69
93
  loadAppEnv(appEnvPath);
@@ -10,6 +10,15 @@ module.exports = (options) => {
10
10
  * 基本信息
11
11
  */
12
12
  const input = parsed.input;
13
+ if (!input || !String(input).trim()) {
14
+ Ec.error("缺少必需参数:加密输入字符串");
15
+ Ec.info("参数格式:");
16
+ Ec.info(" -i <字符串> 或 --input <字符串>");
17
+ Ec.info("示例:");
18
+ Ec.info(" ai md5 -i smaveapp");
19
+ Ec.info(" ai md5 --input smaveapp");
20
+ process.exit(1);
21
+ }
13
22
  const platform = os.platform();
14
23
  Ec.info(`当前操作系统:${platform}`);
15
24
 
@@ -9,6 +9,15 @@ module.exports = (options) => {
9
9
  /*
10
10
  * 基本信息验证
11
11
  */
12
+ if (!parsed.name || !String(parsed.name).trim()) {
13
+ Ec.error("缺少必需参数:应用名称");
14
+ Ec.info("参数格式:");
15
+ Ec.info(" -n <名称> 或 --name <名称>");
16
+ Ec.info("示例:");
17
+ Ec.info(" ai app -n my-app");
18
+ Ec.info(" ai app --name my-app");
19
+ process.exit(1);
20
+ }
12
21
  if (!Ut.nameValid(parsed.name)) {
13
22
  Ec.error("应用名称只能包含字母、数字、点(.)和短横线(-),且不能以数字、点(.)或短横线(-)开头!");
14
23
  process.exit(1);
@@ -10,6 +10,15 @@ module.exports = (options) => {
10
10
  }
11
11
  // 第二步:检查 vertx-ui
12
12
  const target = parsed.name;
13
+ if (!target || !String(target).trim()) {
14
+ Ec.error("缺少必需参数:前端项目名称");
15
+ Ec.info("参数格式:");
16
+ Ec.info(" -n <名称> 或 --name <名称>");
17
+ Ec.info("示例:");
18
+ Ec.info(" ai web -n my-web");
19
+ Ec.info(" ai web --name my-web");
20
+ process.exit(1);
21
+ }
13
22
  Ec.info(`工程构建目录:${target}`);
14
23
  const cmd = `git clone https://gitee.com/silentbalanceyh/scaffold-ui.git ${target}`;
15
24
  child.execSync(cmd, {stdio: 'inherit'});
@@ -13,6 +13,15 @@ module.exports = async (options) => {
13
13
  /*
14
14
  * 基本信息验证
15
15
  */
16
+ if (!parsed.name || !String(parsed.name).trim()) {
17
+ Ec.error("缺少必需参数:应用名称");
18
+ Ec.info("参数格式:");
19
+ Ec.info(" -n <名称> 或 --name <名称>");
20
+ Ec.info("示例:");
21
+ Ec.info(" ai spring -n my-app");
22
+ Ec.info(" ai spring --name my-app");
23
+ process.exit(1);
24
+ }
16
25
  if (!Ut.nameValid(parsed.name)) {
17
26
  Ec.error("应用名称只能包含字母、数字、点(.)和短横线(-),且不能以数字、点(.)或短横线(-)开头!");
18
27
  process.exit(1);
@@ -13,6 +13,15 @@ module.exports = async (options) => {
13
13
  /*
14
14
  * 基本信息验证
15
15
  */
16
+ if (!parsed.name || !String(parsed.name).trim()) {
17
+ Ec.error("缺少必需参数:应用名称");
18
+ Ec.info("参数格式:");
19
+ Ec.info(" -n <名称> 或 --name <名称>");
20
+ Ec.info("示例:");
21
+ Ec.info(" ai zero -n my-app");
22
+ Ec.info(" ai zero --name my-app");
23
+ process.exit(1);
24
+ }
16
25
  if (!Ut.nameValid(parsed.name)) {
17
26
  Ec.error("应用名称只能包含字母、数字、点(.)和短横线(-),且不能以数字、点(.)或短横线(-)开头!");
18
27
  process.exit(1);
@@ -8,7 +8,7 @@ const executeWeb = require('./fn.source.front');
8
8
  const executeSpring = require('./fn.source.spring');
9
9
  const executeZero = require('./fn.source.zero');
10
10
  const executeApply = require('./fn.source.apply');
11
- const executePerm = require('./fn.perm');
11
+ const executeExPerm = require('./fn.ex.perm');
12
12
  const exported = {
13
13
  executeUuid, // ai uuid
14
14
  executeString, // ai str
@@ -22,7 +22,7 @@ const exported = {
22
22
  executeZero, // ai zero
23
23
  // Cursor 规则安装
24
24
  executeApply, // ai apply
25
- executePerm, // ai perm
25
+ executeExPerm, // ai ex-perm
26
26
  };
27
27
  module.exports = exported;
28
28
  /**