monacloud-mcp 0.10.5 → 0.10.7

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/config.d.ts CHANGED
@@ -15,4 +15,5 @@ export type Config = {
15
15
  monapayLinkPath: string;
16
16
  vibecloudLinkPath: string;
17
17
  };
18
+ export declare const DEFAULT_TEMPLATES_URL = "https://raw.githubusercontent.com/themonagroup/mona-agent-templates/main";
18
19
  export declare function readConfig(env?: NodeJS.ProcessEnv): Config;
package/dist/config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { homedir } from 'node:os';
2
2
  import { join } from 'node:path';
3
3
  const cleanBaseUrl = (value) => value.replace(/\/+$/, '');
4
+ export const DEFAULT_TEMPLATES_URL = 'https://raw.githubusercontent.com/themonagroup/mona-agent-templates/main';
4
5
  export function readConfig(env = process.env) {
5
6
  const configDir = env.MONACLOUD_CONFIG_DIR
6
7
  || join(env.XDG_CONFIG_HOME || join(homedir(), '.config'), 'monacloud');
@@ -17,9 +18,10 @@ export function readConfig(env = process.env) {
17
18
  tokenFile: join(configDir, 'token.json'),
18
19
  linksFile: join(configDir, 'links.json'),
19
20
  templatesDir: env.MONACLOUD_TEMPLATES_DIR || join(homedir(), 'monacloud', 'templates'),
20
- templatesUrl: env.MONACLOUD_TEMPLATES_URL
21
- ? cleanBaseUrl(env.MONACLOUD_TEMPLATES_URL)
22
- : undefined,
21
+ // Catalog công khai mona-agent-templates (19/09/2026). Đặt MONACLOUD_TEMPLATES_URL="" để tắt remote (chỉ built-in/local).
22
+ templatesUrl: env.MONACLOUD_TEMPLATES_URL === undefined
23
+ ? DEFAULT_TEMPLATES_URL
24
+ : (env.MONACLOUD_TEMPLATES_URL ? cleanBaseUrl(env.MONACLOUD_TEMPLATES_URL) : undefined),
23
25
  monapayLinkPath: env.MONAPAY_LINK_PATH || '/api/v1/client/oauth/mona-id/link',
24
26
  vibecloudLinkPath: env.VIBECLOUD_LINK_PATH || '/api/auth/monaid/link',
25
27
  };
package/dist/templates.js CHANGED
@@ -11,7 +11,7 @@ const BUILTIN = [
11
11
  { slug: 'tro-giang-academy', name: 'Trợ giảng Academy', description: 'Trợ giảng cho academy của giảng viên.', products: ['mona.academy', 'MONA AI'] },
12
12
  ];
13
13
  const allowedSlug = /^[a-z0-9][a-z0-9-]{0,79}$/;
14
- const standardFiles = ['README.md', 'AGENTS.md', 'tools.json', 'deploy.md', 'CHECKLIST.md'];
14
+ const standardFiles = ['README.md', 'AGENTS.md', 'SOUL.md', 'IDENTITY.md', 'tools.json', 'deploy.md', 'CHECKLIST.md'];
15
15
  async function directoryExists(path) {
16
16
  try {
17
17
  return (await readdir(path, { withFileTypes: true })).length >= 0;
@@ -62,8 +62,14 @@ export class TemplateCatalog {
62
62
  return { source: this.config.templatesDir, templates };
63
63
  }
64
64
  if (this.config.templatesUrl) {
65
- const remote = await requestJson(`${this.config.templatesUrl}/catalog.json`, { fetchImpl: this.fetchImpl });
66
- return { source: this.config.templatesUrl, templates: Array.isArray(remote.templates) ? remote.templates : [] };
65
+ try {
66
+ const remote = await requestJson(`${this.config.templatesUrl}/catalog.json`, { fetchImpl: this.fetchImpl });
67
+ return { source: this.config.templatesUrl, templates: Array.isArray(remote.templates) ? remote.templates : [] };
68
+ }
69
+ catch (error) {
70
+ // Không có mạng / GitHub lỗi: rơi về catalog built-in, nói rõ nguồn để AI không tưởng đủ.
71
+ return { source: `built-in-wave-1-catalog (remote không đọc được: ${error.message})`, templates: BUILTIN };
72
+ }
67
73
  }
68
74
  return { source: 'built-in-wave-1-catalog', templates: BUILTIN };
69
75
  }
@@ -91,17 +97,31 @@ export class TemplateCatalog {
91
97
  if (skillsEntry) {
92
98
  const skillFiles = await readdir(join(directory, 'skills'), { withFileTypes: true });
93
99
  for (const file of skillFiles) {
94
- if (!file.isFile() || !/\.(md|json|txt)$/i.test(file.name))
95
- continue;
96
- const content = await readFile(join(directory, 'skills', file.name), 'utf8');
97
- files[`skills/${file.name}`] = content;
100
+ if (file.isFile() && /\.(md|json|txt)$/i.test(file.name)) {
101
+ files[`skills/${file.name}`] = await readFile(join(directory, 'skills', file.name), 'utf8');
102
+ }
103
+ else if (file.isDirectory() && allowedSlug.test(file.name)) {
104
+ // Chuẩn OpenClaw: skills/<ten>/SKILL.md
105
+ const skillMd = await readOptional(join(directory, 'skills', file.name, 'SKILL.md'));
106
+ if (skillMd !== undefined)
107
+ files[`skills/${file.name}/SKILL.md`] = skillMd;
108
+ }
98
109
  }
99
110
  }
100
111
  return { slug, source: directory, files };
101
112
  }
102
113
  if (this.config.templatesUrl) {
103
- const remote = await requestJson(`${this.config.templatesUrl}/templates/${encodeURIComponent(slug)}.json`, { fetchImpl: this.fetchImpl });
104
- return { slug, source: this.config.templatesUrl, ...remote };
114
+ try {
115
+ const remote = await requestJson(`${this.config.templatesUrl}/templates/${encodeURIComponent(slug)}.json`, { fetchImpl: this.fetchImpl });
116
+ return { slug, source: this.config.templatesUrl, ...remote };
117
+ }
118
+ catch (error) {
119
+ const builtin = BUILTIN.find((entry) => entry.slug === slug);
120
+ if (!builtin) {
121
+ throw new CloudError('template_not_found', `Không đọc được template ${slug} từ catalog công khai (${error.message}).`, 'Kiểm mạng hoặc gọi agent_templates_list; catalog: https://github.com/themonagroup/mona-agent-templates');
122
+ }
123
+ return { ...builtin, source: `built-in-wave-1-catalog (remote không đọc được)`, status: 'catalog_only' };
124
+ }
105
125
  }
106
126
  const template = BUILTIN.find((entry) => entry.slug === slug);
107
127
  if (!template) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monacloud-mcp",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "description": "MCP server for MONA Cloud — deploy apps (Vercel alternative), Supabase-compatible Postgres/Auth/Storage bases (Supabase alternative), VND wallet, MONA Pay & Mail — for AI agents (Claude, Cursor, Codex) in Vietnam.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://monacloud.vn",
@@ -26,7 +26,16 @@
26
26
  "codex",
27
27
  "postgres",
28
28
  "deploy",
29
- "vibecoder"
29
+ "vibecoder",
30
+ "domain",
31
+ "domains",
32
+ "ten-mien",
33
+ "vn-domain",
34
+ "vietnam-domain",
35
+ "buy-domain",
36
+ "domain-registrar",
37
+ "vercel-domains-alternative",
38
+ "gemini"
30
39
  ],
31
40
  "type": "module",
32
41
  "bin": {
@@ -59,5 +68,6 @@
59
68
  "@types/node": "^26.4.0",
60
69
  "@types/qrcode": "^1.5.6",
61
70
  "typescript": "^7.0.2"
62
- }
71
+ },
72
+ "mcpName": "io.github.themonagroup/monacloud-mcp"
63
73
  }