huaweicloud-devkit 0.1.21 → 0.1.24

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 (67) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +169 -169
  4. package/bin/setup.cjs +7 -7
  5. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  6. package/integrations/opencode/opencode.json +14 -14
  7. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +30 -30
  8. package/package.json +43 -43
  9. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
  10. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -1
  11. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
  12. package/plugins/huaweicloud-core/.mcp.json +13 -13
  13. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  14. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +88 -88
  15. package/plugins/huaweicloud-core/safety/policy.json +85 -85
  16. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +144 -144
  17. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  18. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  19. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
  20. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +73 -73
  21. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +1 -1
  22. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  23. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  24. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
  25. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
  26. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
  27. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +131 -131
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +98 -96
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +28 -28
  31. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -132
  33. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  36. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  37. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  38. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
  39. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  40. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  41. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +118 -118
  42. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
  43. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  44. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +181 -181
  45. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  46. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +78 -78
  47. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
  48. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
  49. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  50. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  51. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -47
  52. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  53. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +127 -127
  54. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  55. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +93 -93
  56. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  57. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
  58. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
  59. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +46 -46
  60. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  61. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  62. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  63. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
  64. package/plugins/huaweicloud-core/src/mcp-server.mjs +93 -93
  65. package/plugins/huaweicloud-core/src/safety-policy.mjs +289 -289
  66. package/plugins/huaweicloud-core/src/setup-cli.mjs +874 -869
  67. package/plugins/huaweicloud-core/src/tools.mjs +677 -677
@@ -1,93 +1,93 @@
1
- #!/usr/bin/env node
2
- import { stdin, stdout } from 'node:process';
3
- import { TOOL_DEFINITIONS, callTool } from './tools.mjs';
4
-
5
- let buffer = Buffer.alloc(0);
6
-
7
- stdin.on('data', (chunk) => {
8
- buffer = Buffer.concat([buffer, chunk]);
9
- readFrames();
10
- });
11
-
12
- function readFrames() {
13
- while (true) {
14
- const headerEnd = buffer.indexOf('\r\n\r\n');
15
- if (headerEnd === -1) return;
16
- const header = buffer.subarray(0, headerEnd).toString('utf8');
17
- const match = header.match(/Content-Length:\s*(\d+)/i);
18
- if (!match) {
19
- buffer = Buffer.alloc(0);
20
- return;
21
- }
22
- const length = Number(match[1]);
23
- const bodyStart = headerEnd + 4;
24
- const bodyEnd = bodyStart + length;
25
- if (buffer.length < bodyEnd) return;
26
- const body = buffer.subarray(bodyStart, bodyEnd).toString('utf8');
27
- buffer = buffer.subarray(bodyEnd);
28
- void handleMessage(JSON.parse(body));
29
- }
30
- }
31
-
32
- async function handleMessage(message) {
33
- if (!Object.hasOwn(message, 'id')) {
34
- if (message.method === 'notifications/initialized') return;
35
- return;
36
- }
37
- try {
38
- const result = await dispatch(message.method, message.params || {});
39
- writeMessage({ jsonrpc: '2.0', id: message.id, result });
40
- } catch (error) {
41
- writeMessage({
42
- jsonrpc: '2.0',
43
- id: message.id,
44
- error: {
45
- code: -32603,
46
- message: error.message,
47
- },
48
- });
49
- }
50
- }
51
-
52
- async function dispatch(method, params) {
53
- if (method === 'initialize') {
54
- return {
55
- protocolVersion: params.protocolVersion || '2024-11-05',
56
- capabilities: {
57
- tools: {},
58
- },
59
- serverInfo: {
60
- name: 'huaweicloud-devkit',
61
- version: '0.1.0',
62
- },
63
- };
64
- }
65
-
66
- if (method === 'tools/list') {
67
- return { tools: TOOL_DEFINITIONS };
68
- }
69
-
70
- if (method === 'tools/call') {
71
- const result = await callTool(params.name, params.arguments || {});
72
- return {
73
- content: [
74
- {
75
- type: 'text',
76
- text: JSON.stringify(result, null, 2),
77
- },
78
- ],
79
- isError: false,
80
- };
81
- }
82
-
83
- if (method === 'resources/list') {
84
- return { resources: [] };
85
- }
86
-
87
- throw new Error(`Unsupported method: ${method}`);
88
- }
89
-
90
- function writeMessage(message) {
91
- const json = JSON.stringify(message);
92
- stdout.write(`Content-Length: ${Buffer.byteLength(json, 'utf8')}\r\n\r\n${json}`);
93
- }
1
+ #!/usr/bin/env node
2
+ import { stdin, stdout } from 'node:process';
3
+ import { TOOL_DEFINITIONS, callTool } from './tools.mjs';
4
+
5
+ let buffer = Buffer.alloc(0);
6
+
7
+ stdin.on('data', (chunk) => {
8
+ buffer = Buffer.concat([buffer, chunk]);
9
+ readFrames();
10
+ });
11
+
12
+ function readFrames() {
13
+ while (true) {
14
+ const headerEnd = buffer.indexOf('\r\n\r\n');
15
+ if (headerEnd === -1) return;
16
+ const header = buffer.subarray(0, headerEnd).toString('utf8');
17
+ const match = header.match(/Content-Length:\s*(\d+)/i);
18
+ if (!match) {
19
+ buffer = Buffer.alloc(0);
20
+ return;
21
+ }
22
+ const length = Number(match[1]);
23
+ const bodyStart = headerEnd + 4;
24
+ const bodyEnd = bodyStart + length;
25
+ if (buffer.length < bodyEnd) return;
26
+ const body = buffer.subarray(bodyStart, bodyEnd).toString('utf8');
27
+ buffer = buffer.subarray(bodyEnd);
28
+ void handleMessage(JSON.parse(body));
29
+ }
30
+ }
31
+
32
+ async function handleMessage(message) {
33
+ if (!Object.hasOwn(message, 'id')) {
34
+ if (message.method === 'notifications/initialized') return;
35
+ return;
36
+ }
37
+ try {
38
+ const result = await dispatch(message.method, message.params || {});
39
+ writeMessage({ jsonrpc: '2.0', id: message.id, result });
40
+ } catch (error) {
41
+ writeMessage({
42
+ jsonrpc: '2.0',
43
+ id: message.id,
44
+ error: {
45
+ code: -32603,
46
+ message: error.message,
47
+ },
48
+ });
49
+ }
50
+ }
51
+
52
+ async function dispatch(method, params) {
53
+ if (method === 'initialize') {
54
+ return {
55
+ protocolVersion: params.protocolVersion || '2024-11-05',
56
+ capabilities: {
57
+ tools: {},
58
+ },
59
+ serverInfo: {
60
+ name: 'huaweicloud-devkit',
61
+ version: '0.1.0',
62
+ },
63
+ };
64
+ }
65
+
66
+ if (method === 'tools/list') {
67
+ return { tools: TOOL_DEFINITIONS };
68
+ }
69
+
70
+ if (method === 'tools/call') {
71
+ const result = await callTool(params.name, params.arguments || {});
72
+ return {
73
+ content: [
74
+ {
75
+ type: 'text',
76
+ text: JSON.stringify(result, null, 2),
77
+ },
78
+ ],
79
+ isError: false,
80
+ };
81
+ }
82
+
83
+ if (method === 'resources/list') {
84
+ return { resources: [] };
85
+ }
86
+
87
+ throw new Error(`Unsupported method: ${method}`);
88
+ }
89
+
90
+ function writeMessage(message) {
91
+ const json = JSON.stringify(message);
92
+ stdout.write(`Content-Length: ${Buffer.byteLength(json, 'utf8')}\r\n\r\n${json}`);
93
+ }