harmony-build 0.2.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 (72) hide show
  1. package/README.md +265 -0
  2. package/dist/packages/arkanalyzer-mcp/src/index.d.ts +5 -0
  3. package/dist/packages/arkanalyzer-mcp/src/index.js +220 -0
  4. package/dist/packages/arkanalyzer-mcp/src/index.js.map +1 -0
  5. package/dist/packages/arkcheck-mcp/src/index.d.ts +5 -0
  6. package/dist/packages/arkcheck-mcp/src/index.js +160 -0
  7. package/dist/packages/arkcheck-mcp/src/index.js.map +1 -0
  8. package/dist/packages/arkcheck-mcp/src/rules.d.ts +15 -0
  9. package/dist/packages/arkcheck-mcp/src/rules.js +90 -0
  10. package/dist/packages/arkcheck-mcp/src/rules.js.map +1 -0
  11. package/dist/packages/dev-mcp/src/hvigor-bridge.d.ts +31 -0
  12. package/dist/packages/dev-mcp/src/hvigor-bridge.js +179 -0
  13. package/dist/packages/dev-mcp/src/hvigor-bridge.js.map +1 -0
  14. package/dist/packages/dev-mcp/src/index.d.ts +5 -0
  15. package/dist/packages/dev-mcp/src/index.js +256 -0
  16. package/dist/packages/dev-mcp/src/index.js.map +1 -0
  17. package/dist/packages/dev-mcp/src/log-stream.d.ts +56 -0
  18. package/dist/packages/dev-mcp/src/log-stream.js +147 -0
  19. package/dist/packages/dev-mcp/src/log-stream.js.map +1 -0
  20. package/dist/packages/harmony-knowledge-mcp/src/index.d.ts +5 -0
  21. package/dist/packages/harmony-knowledge-mcp/src/index.js +164 -0
  22. package/dist/packages/harmony-knowledge-mcp/src/index.js.map +1 -0
  23. package/dist/packages/hdc-mcp/src/hdc-runner.d.ts +32 -0
  24. package/dist/packages/hdc-mcp/src/hdc-runner.js +60 -0
  25. package/dist/packages/hdc-mcp/src/hdc-runner.js.map +1 -0
  26. package/dist/packages/hdc-mcp/src/index.d.ts +5 -0
  27. package/dist/packages/hdc-mcp/src/index.js +155 -0
  28. package/dist/packages/hdc-mcp/src/index.js.map +1 -0
  29. package/dist/packages/hvigor-mcp/src/index.d.ts +5 -0
  30. package/dist/packages/hvigor-mcp/src/index.js +300 -0
  31. package/dist/packages/hvigor-mcp/src/index.js.map +1 -0
  32. package/dist/packages/hvigor-mcp/src/log-parser.d.ts +28 -0
  33. package/dist/packages/hvigor-mcp/src/log-parser.js +65 -0
  34. package/dist/packages/hvigor-mcp/src/log-parser.js.map +1 -0
  35. package/dist/packages/mcp-common/src/entry.d.ts +1 -0
  36. package/dist/packages/mcp-common/src/entry.js +22 -0
  37. package/dist/packages/mcp-common/src/entry.js.map +1 -0
  38. package/dist/packages/mcp-common/src/errors.d.ts +13 -0
  39. package/dist/packages/mcp-common/src/errors.js +23 -0
  40. package/dist/packages/mcp-common/src/errors.js.map +1 -0
  41. package/dist/packages/mcp-common/src/index.d.ts +6 -0
  42. package/dist/packages/mcp-common/src/index.js +7 -0
  43. package/dist/packages/mcp-common/src/index.js.map +1 -0
  44. package/dist/packages/mcp-common/src/logger.d.ts +11 -0
  45. package/dist/packages/mcp-common/src/logger.js +32 -0
  46. package/dist/packages/mcp-common/src/logger.js.map +1 -0
  47. package/dist/packages/mcp-common/src/mcp-helpers.d.ts +41 -0
  48. package/dist/packages/mcp-common/src/mcp-helpers.js +94 -0
  49. package/dist/packages/mcp-common/src/mcp-helpers.js.map +1 -0
  50. package/dist/packages/mcp-common/src/safe-exec.d.ts +23 -0
  51. package/dist/packages/mcp-common/src/safe-exec.js +74 -0
  52. package/dist/packages/mcp-common/src/safe-exec.js.map +1 -0
  53. package/dist/packages/mcp-common/src/sandbox.d.ts +31 -0
  54. package/dist/packages/mcp-common/src/sandbox.js +96 -0
  55. package/dist/packages/mcp-common/src/sandbox.js.map +1 -0
  56. package/dist/packages/profiler-mcp/src/index.d.ts +5 -0
  57. package/dist/packages/profiler-mcp/src/index.js +148 -0
  58. package/dist/packages/profiler-mcp/src/index.js.map +1 -0
  59. package/dist/packages/profiler-mcp/src/trace-analyzer.d.ts +38 -0
  60. package/dist/packages/profiler-mcp/src/trace-analyzer.js +95 -0
  61. package/dist/packages/profiler-mcp/src/trace-analyzer.js.map +1 -0
  62. package/dist/src/index.d.ts +17 -0
  63. package/dist/src/index.js +61 -0
  64. package/dist/src/index.js.map +1 -0
  65. package/dist/src/server/handlers.d.ts +11 -0
  66. package/dist/src/server/handlers.js +33 -0
  67. package/dist/src/server/handlers.js.map +1 -0
  68. package/dist/src/server/tools.d.ts +23 -0
  69. package/dist/src/server/tools.js +57 -0
  70. package/dist/src/server/tools.js.map +1 -0
  71. package/package.json +54 -0
  72. package//345/217/221/345/270/203/346/214/207/345/215/227.md +45 -0
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * harmony-build MCP Server 入口
4
+ *
5
+ * 把 7 个独立的 harmony-* MCP server(hdc / hvigor / profiler /
6
+ * arkanalyzer / arkcheck / knowledge / dev)合并成 1 个进程 + 1 个 stdio 连接。
7
+ *
8
+ * 工具名加 `<namespace>_` 前缀避免冲突,例如:
9
+ * - hdc_list_devices / hdc_install_hap
10
+ * - hvigor_build_hap / hvigor_clean
11
+ * - dev_run_app / dev_start_log_stream
12
+ * - profiler_capture_trace / profiler_cold_start_breakdown
13
+ * - arkanalyzer_find_references / arkanalyzer_list_components
14
+ * - arkcheck_lint_project / arkcheck_list_rules
15
+ * - knowledge_search_kb / knowledge_read_doc
16
+ */
17
+ export {};
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * harmony-build MCP Server 入口
4
+ *
5
+ * 把 7 个独立的 harmony-* MCP server(hdc / hvigor / profiler /
6
+ * arkanalyzer / arkcheck / knowledge / dev)合并成 1 个进程 + 1 个 stdio 连接。
7
+ *
8
+ * 工具名加 `<namespace>_` 前缀避免冲突,例如:
9
+ * - hdc_list_devices / hdc_install_hap
10
+ * - hvigor_build_hap / hvigor_clean
11
+ * - dev_run_app / dev_start_log_stream
12
+ * - profiler_capture_trace / profiler_cold_start_breakdown
13
+ * - arkanalyzer_find_references / arkanalyzer_list_components
14
+ * - arkcheck_lint_project / arkcheck_list_rules
15
+ * - knowledge_search_kb / knowledge_read_doc
16
+ */
17
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
18
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
19
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
20
+ import { readFileSync } from "node:fs";
21
+ import { fileURLToPath } from "node:url";
22
+ import { dirname, join } from "node:path";
23
+ import { toolDefinitions } from "./server/tools.js";
24
+ import { handleToolCall } from "./server/handlers.js";
25
+ const __filename = fileURLToPath(import.meta.url);
26
+ const __dirname = dirname(__filename);
27
+ // 兼容两种布局:
28
+ // 1) 源码: src/index.ts → ../package.json
29
+ // 2) 产物: dist/src/index.js → ../../package.json
30
+ function loadVersion() {
31
+ for (const rel of ["../package.json", "../../package.json"]) {
32
+ try {
33
+ const pkg = JSON.parse(readFileSync(join(__dirname, rel), "utf-8"));
34
+ if (pkg?.version)
35
+ return pkg.version;
36
+ }
37
+ catch {
38
+ /* try next */
39
+ }
40
+ }
41
+ return "0.0.0";
42
+ }
43
+ const VERSION = loadVersion();
44
+ const server = new Server({ name: "harmony-build", version: VERSION }, { capabilities: { tools: {} } });
45
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
46
+ tools: toolDefinitions,
47
+ }));
48
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
49
+ const { name, arguments: args } = request.params;
50
+ return handleToolCall(name, (args ?? {}));
51
+ });
52
+ async function main() {
53
+ const transport = new StdioServerTransport();
54
+ await server.connect(transport);
55
+ console.error(`[harmony-build] v${VERSION} started on stdio · ${toolDefinitions.length} tools`);
56
+ }
57
+ main().catch((error) => {
58
+ console.error("[harmony-build] Fatal error:", error);
59
+ process.exit(1);
60
+ });
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts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E,EAAE,EAAE,EAAE,CAChC,CAAC;AAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAC5D,KAAK,EAAE,eAAe;CACvB,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAChE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IACjD,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAA4B,CAAC,CAAC;AACvE,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CACX,oBAAoB,OAAO,uBAAuB,eAAe,CAAC,MAAM,QAAQ,CACjF,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;IACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * harmony-build MCP 工具调度
3
+ *
4
+ * 把请求按工具名转发给对应子包的 handler,并按 MCP 协议返回 text content。
5
+ */
6
+ export declare function handleToolCall(name: string, args: Record<string, unknown>): Promise<{
7
+ content: {
8
+ type: "text";
9
+ text: string;
10
+ }[];
11
+ }>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * harmony-build MCP 工具调度
3
+ *
4
+ * 把请求按工具名转发给对应子包的 handler,并按 MCP 协议返回 text content。
5
+ */
6
+ import { toolMap } from "./tools.js";
7
+ import { toErrorPayload } from "../../packages/mcp-common/src/errors.js";
8
+ function ok(data) {
9
+ return {
10
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
11
+ };
12
+ }
13
+ function fail(payload) {
14
+ return {
15
+ isError: true,
16
+ content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
17
+ };
18
+ }
19
+ export async function handleToolCall(name, args) {
20
+ const tool = toolMap.get(name);
21
+ if (!tool) {
22
+ return fail({ code: "UNKNOWN_TOOL", message: `unknown tool: ${name}` });
23
+ }
24
+ try {
25
+ const parsed = tool.schema.parse(args ?? {});
26
+ const data = await tool.handler(parsed);
27
+ return ok(data);
28
+ }
29
+ catch (err) {
30
+ return fail(toErrorPayload(err));
31
+ }
32
+ }
33
+ //# sourceMappingURL=handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../../src/server/handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,SAAS,EAAE,CAAC,IAAa;IACvB,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,OAA6D;IACzE,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC7E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAY,EACZ,IAA6B;IAE7B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,iBAAiB,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * harmony-build 聚合 MCP 工具定义
3
+ *
4
+ * 复用 7 个子包导出的 tools 数组(hdc / hvigor / profiler / arkanalyzer /
5
+ * arkcheck / knowledge / dev),每个工具名加 `<namespace>_` 前缀避免冲突。
6
+ *
7
+ * 工具实现 100% 来自子包,零代码重复。
8
+ */
9
+ import { z } from "zod";
10
+ import type { ToolDef } from "../../packages/mcp-common/src/index.js";
11
+ /**
12
+ * 聚合所有子包工具,加 namespace 前缀,避免重名。
13
+ * 返回带 zod schema 的 ToolDef 数组,供 handler 使用。
14
+ */
15
+ export declare function buildAggregatedTools(): ToolDef<z.ZodObject<z.ZodRawShape>>[];
16
+ /** 仅供 MCP ListTools 用的精简版(含 JSON Schema)。 */
17
+ export declare const toolDefinitions: {
18
+ name: string;
19
+ description: string;
20
+ inputSchema: Record<string, unknown>;
21
+ }[];
22
+ /** 给 handlers 使用的全名 → ToolDef 映射。 */
23
+ export declare const toolMap: Map<string, ToolDef<z.ZodObject<z.ZodRawShape>>>;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * harmony-build 聚合 MCP 工具定义
3
+ *
4
+ * 复用 7 个子包导出的 tools 数组(hdc / hvigor / profiler / arkanalyzer /
5
+ * arkcheck / knowledge / dev),每个工具名加 `<namespace>_` 前缀避免冲突。
6
+ *
7
+ * 工具实现 100% 来自子包,零代码重复。
8
+ */
9
+ import * as hdc from "../../packages/hdc-mcp/src/index.js";
10
+ import * as hvigor from "../../packages/hvigor-mcp/src/index.js";
11
+ import * as profiler from "../../packages/profiler-mcp/src/index.js";
12
+ import * as arkanalyzer from "../../packages/arkanalyzer-mcp/src/index.js";
13
+ import * as arkcheck from "../../packages/arkcheck-mcp/src/index.js";
14
+ import * as knowledge from "../../packages/harmony-knowledge-mcp/src/index.js";
15
+ import * as dev from "../../packages/dev-mcp/src/index.js";
16
+ import { zodToJsonSchema } from "../../packages/mcp-common/src/mcp-helpers.js";
17
+ const SUBS = [
18
+ hdc,
19
+ hvigor,
20
+ profiler,
21
+ arkanalyzer,
22
+ arkcheck,
23
+ knowledge,
24
+ dev,
25
+ ];
26
+ /**
27
+ * 聚合所有子包工具,加 namespace 前缀,避免重名。
28
+ * 返回带 zod schema 的 ToolDef 数组,供 handler 使用。
29
+ */
30
+ export function buildAggregatedTools() {
31
+ const aggregated = [];
32
+ const seen = new Set();
33
+ for (const sub of SUBS) {
34
+ for (const t of sub.tools) {
35
+ const name = `${sub.NAMESPACE}_${t.name}`;
36
+ if (seen.has(name))
37
+ continue;
38
+ seen.add(name);
39
+ aggregated.push({
40
+ name,
41
+ description: `[${sub.NAMESPACE}] ${t.description}`,
42
+ schema: t.schema,
43
+ handler: t.handler,
44
+ });
45
+ }
46
+ }
47
+ return aggregated;
48
+ }
49
+ /** 仅供 MCP ListTools 用的精简版(含 JSON Schema)。 */
50
+ export const toolDefinitions = buildAggregatedTools().map((t) => ({
51
+ name: t.name,
52
+ description: t.description,
53
+ inputSchema: zodToJsonSchema(t.schema),
54
+ }));
55
+ /** 给 handlers 使用的全名 → ToolDef 映射。 */
56
+ export const toolMap = new Map(buildAggregatedTools().map((t) => [t.name, t]));
57
+ //# sourceMappingURL=tools.js.map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aACnB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChE,IAAI,EAAE,CAAC,CAAC,IAAI;IACZ,WAAW,EAAE,CAAC,CAAC,WAAW;IAC1B,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC;CACvC,CAAC,CAAC,CAAC;AAEJ,qCAAqC;AACrC,MAAM,CAAC,MAAM,OAAO,GAAqD,IAAI,GAAG,CAC9E,oBAAoB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAC/C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "harmony-build",
3
+ "version": "0.2.0",
4
+ "description": "HarmonyOS Toolchain MCP Server (all-in-one) - 30+ tools across hdc / hvigor / profiler / arkanalyzer / arkcheck / knowledge / dev",
5
+ "type": "module",
6
+ "bin": {
7
+ "harmony-build": "./dist/src/index.js",
8
+ "harmony-build-mcp": "./dist/src/index.js"
9
+ },
10
+ "main": "dist/src/index.js",
11
+ "files": [
12
+ "dist",
13
+ "package.json",
14
+ "README.md",
15
+ "发布指南.md"
16
+ ],
17
+ "workspaces": [
18
+ "packages/*"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "build:workspaces": "npm run build -w @harmony-mcp/common && npm run build --workspaces --if-present --include-workspace-root=false",
23
+ "clean": "rm -rf dist && npm run clean --workspaces --if-present",
24
+ "demo": "node demo/run-demo.mjs",
25
+ "install:joycode": "node scripts/install-joycode.mjs",
26
+ "prepublishOnly": "npm run clean && npm run build",
27
+ "start": "node dist/src/index.js"
28
+ },
29
+ "dependencies": {
30
+ "@modelcontextprotocol/sdk": "^1.0.0",
31
+ "zod": "^3.23.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^20.11.0",
35
+ "typescript": "^5.5.0"
36
+ },
37
+ "engines": {
38
+ "node": ">=18"
39
+ },
40
+ "keywords": [
41
+ "mcp",
42
+ "harmonyos",
43
+ "arkts",
44
+ "ai-agent",
45
+ "hdc",
46
+ "hvigor",
47
+ "profiler",
48
+ "deveco"
49
+ ],
50
+ "license": "Apache-2.0",
51
+ "publishConfig": {
52
+ "access": "public"
53
+ }
54
+ }
@@ -0,0 +1,45 @@
1
+ ---
2
+ inclusion: manual
3
+ ---
4
+
5
+ # bmall-mcp 发布流程
6
+
7
+ ## 发布步骤
8
+
9
+ 1. **更新版本号**
10
+ - 修改 `package.json` 中的 `version` 字段
11
+ - 版本号规则:`major.minor.patch`(如 1.4.3)
12
+
13
+ 2. **更新 Changelog**
14
+ - 在 `README.md` 的 Changelog 部分最上方添加新版本记录
15
+ - 格式:`### vX.X.X (YYYY-MM-DD)`
16
+ - 列出本次更新的功能/修复(使用 ✅ 标记)
17
+
18
+ 3. **构建项目**
19
+ ```bash
20
+ npm run build
21
+ ```
22
+
23
+ 4. **提交代码**
24
+ ```bash
25
+ git add -A
26
+ git commit -m "chore: 发布 vX.X.X"
27
+ git push
28
+ ```
29
+
30
+ 5. **发布到 npm**
31
+ ```bash
32
+ npm publish --registry https://registry.npmjs.org/
33
+ ```
34
+
35
+ ## 版本号规则
36
+
37
+ - **patch** (x.x.1): 修复 bug、小优化
38
+ - **minor** (x.1.0): 新增功能、向后兼容
39
+ - **major** (1.0.0): 破坏性变更
40
+
41
+ ## 注意事项
42
+
43
+ - 发布前确保所有改动已测试
44
+ - Changelog 描述要清晰简洁
45
+ - 必须使用官方源发布:`--registry https://registry.npmjs.org/`