@hulistmi/hulistmi 1.0.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.
- package/LICENSE.md +22 -0
- package/README.md +289 -0
- package/bin/hulistmi.mjs +21 -0
- package/package.json +73 -0
- package/public/SKILL.md +26 -0
- package/public/_headers +3 -0
- package/public/favicon.svg +5 -0
- package/public/index.html +47 -0
- package/public/llms.txt +28 -0
- package/public/robots.txt +6 -0
- package/public/sitemap.xml +6 -0
- package/public/webmcp.js +3 -0
- package/src/cli.ts +67 -0
- package/src/index.ts +260 -0
- package/src/lib/catalog.ts +113 -0
- package/src/lib/cli-endpoints.ts +62 -0
- package/src/lib/documents.ts +164 -0
- package/src/lib/fetch.ts +165 -0
- package/src/lib/guides/fetch.ts +8 -0
- package/src/lib/guides/index.ts +3 -0
- package/src/lib/guides/render.ts +13 -0
- package/src/lib/guides/types.ts +5 -0
- package/src/lib/mcp.ts +119 -0
- package/src/lib/rate-limit.ts +27 -0
- package/src/lib/reference/fetch.ts +8 -0
- package/src/lib/reference/index.ts +3 -0
- package/src/lib/reference/render.ts +13 -0
- package/src/lib/reference/types.ts +5 -0
- package/src/lib/render.ts +216 -0
- package/src/lib/search.ts +81 -0
- package/src/lib/skill.ts +100 -0
- package/src/lib/types.ts +18 -0
- package/src/lib/upstream-contract.json +103 -0
- package/src/lib/upstream-contract.ts +3 -0
- package/src/lib/url.ts +50 -0
- package/src/lib/webmcp.ts +19 -0
- package/wrangler.jsonc +18 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 NSHipster (https://nshipster.com) — Original work (sosumi.ai)
|
|
4
|
+
Copyright (c) 2026 hulistmi.ai — Derivative work
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# hulistmi.ai
|
|
2
|
+
|
|
3
|
+
Making HarmonyOS docs AI-readable.
|
|
4
|
+
|
|
5
|
+
> The `hulistmi.ai` domain is aspirational.
|
|
6
|
+
> The service is currently available at
|
|
7
|
+
> [`https://hulistmi-ai.y6vd2dkjgb.workers.dev`](https://hulistmi-ai.y6vd2dkjgb.workers.dev).
|
|
8
|
+
|
|
9
|
+
[hulistmi-ai.y6vd2dkjgb.workers.dev](https://hulistmi-ai.y6vd2dkjgb.workers.dev)
|
|
10
|
+
provides HarmonyOS developer documentation in an AI-readable format
|
|
11
|
+
by converting web-rendered pages into Markdown.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### HTTP API
|
|
16
|
+
|
|
17
|
+
Replace `developer.huawei.com/consumer/en/doc/` with `hulistmi-ai.y6vd2dkjgb.workers.dev/`
|
|
18
|
+
in any HarmonyOS documentation URL:
|
|
19
|
+
|
|
20
|
+
**Original:**
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
https://developer.huawei.com/consumer/en/doc/harmonyos-guides/start-overview
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**AI-readable:**
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
https://hulistmi-ai.y6vd2dkjgb.workers.dev/consumer/en/doc/harmonyos-guides/start-overview
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This works for all HarmonyOS guides and API reference documentation.
|
|
33
|
+
|
|
34
|
+
Search is also supported:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
https://hulistmi-ai.y6vd2dkjgb.workers.dev/search?q=UIAbility
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
And you can browse the full documentation catalog:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
https://hulistmi-ai.y6vd2dkjgb.workers.dev/catalog?catalogName=harmonyos-guides&language=en
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> Only English (`en`) documentation is currently supported.
|
|
47
|
+
|
|
48
|
+
### MCP Integration
|
|
49
|
+
|
|
50
|
+
Hulistmi's MCP server supports Streamable HTTP transport.
|
|
51
|
+
Configure your MCP client to connect to `https://hulistmi-ai.y6vd2dkjgb.workers.dev/mcp`.
|
|
52
|
+
|
|
53
|
+
If your client requires stdio transport,
|
|
54
|
+
you can proxy over stdio using `mcp-remote`:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"hulistmi": {
|
|
60
|
+
"command": "npx",
|
|
61
|
+
"args": ["-y", "mcp-remote", "https://hulistmi-ai.y6vd2dkjgb.workers.dev/mcp"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Available Tools
|
|
68
|
+
|
|
69
|
+
- `searchHarmonyOSDocumentation` - Searches HarmonyOS developer documentation
|
|
70
|
+
- Parameters: `query` (string)
|
|
71
|
+
- Returns structured results with titles, URLs, and descriptions
|
|
72
|
+
|
|
73
|
+
- `fetchHarmonyOSDocumentation` - Fetches a HarmonyOS documentation page as Markdown
|
|
74
|
+
- Parameters: `path` (string) — Documentation path (e.g., `/consumer/en/doc/harmonyos-guides/start-overview`)
|
|
75
|
+
- Returns content as Markdown
|
|
76
|
+
|
|
77
|
+
- `fetchHarmonyOSCatalog` - Fetches a HarmonyOS documentation catalog tree
|
|
78
|
+
- Parameters: `catalogName` ("harmonyos-guides" | "harmonyos-references"), `depth` (number, optional)
|
|
79
|
+
- Returns the catalog as a Markdown listing
|
|
80
|
+
|
|
81
|
+
### WebMCP
|
|
82
|
+
|
|
83
|
+
Hulistmi also supports the WebMCP protocol.
|
|
84
|
+
The manifest is available at:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
https://hulistmi-ai.y6vd2dkjgb.workers.dev/webmcp/manifest.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### CLI
|
|
91
|
+
|
|
92
|
+
Hulistmi provides a CLI that complements MCP:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx @hulistmi/hulistmi fetch https://developer.huawei.com/consumer/en/doc/harmonyos-guides/start-overview
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If you use it regularly, install once:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm i -g @hulistmi/hulistmi
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Then use `hulistmi` directly:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
hulistmi fetch https://developer.huawei.com/consumer/en/doc/harmonyos-guides/start-overview
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Short paths work too:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
hulistmi fetch /consumer/en/doc/harmonyos-guides/start-overview
|
|
114
|
+
hulistmi fetch harmonyos-guides/start-overview
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Search documentation:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
hulistmi search UIAbility
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Run a local server from the published package:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
hulistmi serve
|
|
127
|
+
hulistmi serve --port 8787
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
By default, output is plain text / Markdown.
|
|
131
|
+
Use JSON output for scripts:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
hulistmi fetch /consumer/en/doc/harmonyos-guides/start-overview --json
|
|
135
|
+
hulistmi search UIAbility --json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### AI Agent Skill
|
|
139
|
+
|
|
140
|
+
Want your AI coding assistant to use Hulistmi consistently?
|
|
141
|
+
Use the hosted skill file:
|
|
142
|
+
[`https://hulistmi-ai.y6vd2dkjgb.workers.dev/SKILL.md`](https://hulistmi-ai.y6vd2dkjgb.workers.dev/SKILL.md)
|
|
143
|
+
|
|
144
|
+
Spec-compliant clients can also install it with:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx skills add https://hulistmi-ai.y6vd2dkjgb.workers.dev
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Self-Hosting
|
|
151
|
+
|
|
152
|
+
This project is designed to be easily run on your own machine
|
|
153
|
+
or deployed to a hosting provider.
|
|
154
|
+
|
|
155
|
+
Hulistmi.ai is currently hosted by
|
|
156
|
+
[Cloudflare Workers](https://workers.cloudflare.com).
|
|
157
|
+
|
|
158
|
+
> The application is built with Hono,
|
|
159
|
+
> making it compatible with various runtimes.
|
|
160
|
+
>
|
|
161
|
+
> See the [Hono docs](https://hono.dev/docs/getting-started/basic)
|
|
162
|
+
> for more information about deploying to different platforms.
|
|
163
|
+
|
|
164
|
+
### Prerequisites
|
|
165
|
+
|
|
166
|
+
- Node.js 20+
|
|
167
|
+
- npm
|
|
168
|
+
|
|
169
|
+
### Quick Start
|
|
170
|
+
|
|
171
|
+
1. **Clone the repository:**
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
git clone https://github.com/hulistmi/hulistmi.ai.git
|
|
175
|
+
cd hulistmi.ai
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
2. **Install dependencies:**
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm install
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
3. **Start development server:**
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm run dev
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Once the application is up and running, press the <kbd>b</kbd>
|
|
191
|
+
to open the URL in your browser.
|
|
192
|
+
|
|
193
|
+
To configure MCP clients to use your development server,
|
|
194
|
+
replace `hulistmi.ai` with the local server address
|
|
195
|
+
(`http://localhost:8787` by default).
|
|
196
|
+
|
|
197
|
+
## Development
|
|
198
|
+
|
|
199
|
+
### Testing
|
|
200
|
+
|
|
201
|
+
This project uses [vitest](https://vitest.dev)
|
|
202
|
+
for unit and integration testing.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
npm run test # Watch mode
|
|
206
|
+
npm run test:run # Run tests once
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
> When running the CLI through npm scripts during local development,
|
|
210
|
+
> use `-s` (`--silent`)
|
|
211
|
+
> to suppress npm's script preamble so output pipes cleanly:
|
|
212
|
+
>
|
|
213
|
+
> ```bash
|
|
214
|
+
> npm run -s cli -- fetch /consumer/en/doc/harmonyos-guides/start-overview | bat -l md
|
|
215
|
+
> ```
|
|
216
|
+
|
|
217
|
+
### Code Quality
|
|
218
|
+
|
|
219
|
+
This project uses [Biome](https://biomejs.dev/)
|
|
220
|
+
for code formatting, linting, and import organization.
|
|
221
|
+
|
|
222
|
+
- `npm run format` - Format all code files
|
|
223
|
+
- `npm run lint` - Lint and fix code issues
|
|
224
|
+
- `npm run check` - Format, lint, and organize imports (recommended)
|
|
225
|
+
- `npm run check:ci` - Check code without making changes (for CI)
|
|
226
|
+
|
|
227
|
+
### Editor Integration
|
|
228
|
+
|
|
229
|
+
For the best development experience, install the Biome extension for your editor:
|
|
230
|
+
|
|
231
|
+
- [VSCode](https://marketplace.visualstudio.com/items?itemName=biomejs.biome)
|
|
232
|
+
- [Vim/Neovim](https://github.com/biomejs/biome/tree/main/editors/vim)
|
|
233
|
+
- [Emacs](https://github.com/biomejs/biome/tree/main/editors/emacs)
|
|
234
|
+
|
|
235
|
+
### Cloudflare Workers
|
|
236
|
+
|
|
237
|
+
Whenever you update your `wrangler.jsonc` or change your Worker bindings,
|
|
238
|
+
be sure to re-run:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
npm run cf-typegen
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Publishing
|
|
245
|
+
|
|
246
|
+
Publishing is handled by `.github/workflows/release.yml`.
|
|
247
|
+
|
|
248
|
+
- Trigger: pushed tags matching `v*` or manual dispatch with `tag`
|
|
249
|
+
- Release step: `gh release create "$TAG_NAME" --generate-notes`
|
|
250
|
+
- Publish auth: npm trusted publishing via OIDC (`id-token: write`)
|
|
251
|
+
- Publish command: `npm publish --provenance --access public`
|
|
252
|
+
|
|
253
|
+
> **Before first use:** configure npm OIDC for the `@hulistmi` scope
|
|
254
|
+
> in your npm account settings under "Access Tokens" → "Publish OIDC Token".
|
|
255
|
+
> Set the `registry-url` to match your npm registry.
|
|
256
|
+
> Alternatively, you can publish manually with `npm publish`.
|
|
257
|
+
|
|
258
|
+
## Acknowledgements
|
|
259
|
+
|
|
260
|
+
hulistmi.ai is based on [sosumi.ai](https://sosumi.ai) by [NSHipster](https://nshipster.com) ([MIT](https://github.com/NSHipster/sosumi.ai/blob/main/LICENSE.md)).
|
|
261
|
+
|
|
262
|
+
## License
|
|
263
|
+
|
|
264
|
+
This project is available under the MIT license.
|
|
265
|
+
See the [LICENSE](LICENSE.md) file for more info.
|
|
266
|
+
|
|
267
|
+
## Legal
|
|
268
|
+
|
|
269
|
+
This is an unofficial,
|
|
270
|
+
independent project and is not affiliated with or endorsed by Huawei Technologies Co., Ltd.
|
|
271
|
+
"HarmonyOS" and related marks are trademarks of Huawei Technologies Co., Ltd.
|
|
272
|
+
|
|
273
|
+
This service is an accessibility-first,
|
|
274
|
+
on-demand renderer.
|
|
275
|
+
It converts a single HarmonyOS documentation page to Markdown only when requested by a user.
|
|
276
|
+
It does not crawl, spider, or bulk download;
|
|
277
|
+
it does not attempt to bypass authentication or security;
|
|
278
|
+
and it implements rate limiting to avoid imposing unreasonable load.
|
|
279
|
+
|
|
280
|
+
Content is fetched transiently and may be cached briefly to improve performance.
|
|
281
|
+
No permanent archives are maintained.
|
|
282
|
+
All copyrights and other rights in the underlying content remain with Huawei Technologies Co., Ltd.
|
|
283
|
+
Each page links back to the original source.
|
|
284
|
+
|
|
285
|
+
Your use of this service must comply with Huawei's Terms of Use and applicable law.
|
|
286
|
+
You are solely responsible for how you access and use Huawei's content through this tool.
|
|
287
|
+
Do not use this service to circumvent technical measures or for redistribution.
|
|
288
|
+
|
|
289
|
+
|
package/bin/hulistmi.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const packageRoot = resolve(scriptDir, "..");
|
|
9
|
+
const cliPath = resolve(packageRoot, "src/cli.ts");
|
|
10
|
+
|
|
11
|
+
const child = spawn(
|
|
12
|
+
process.execPath,
|
|
13
|
+
["--import", "tsx/esm", cliPath, ...process.argv.slice(2)],
|
|
14
|
+
{
|
|
15
|
+
cwd: packageRoot,
|
|
16
|
+
stdio: "inherit",
|
|
17
|
+
shell: process.platform === "win32",
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hulistmi/hulistmi",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Making HarmonyOS docs AI-readable",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "hulistmi.ai",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/hulistmi/hulistmi.ai"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"harmonyos",
|
|
13
|
+
"huawei",
|
|
14
|
+
"arkts",
|
|
15
|
+
"arkui",
|
|
16
|
+
"documentation",
|
|
17
|
+
"mcp",
|
|
18
|
+
"cli",
|
|
19
|
+
"markdown",
|
|
20
|
+
"ai"
|
|
21
|
+
],
|
|
22
|
+
"preferGlobal": true,
|
|
23
|
+
"homepage": "https://hulistmi.ai",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/hulistmi/hulistmi.ai/issues"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20.18.1"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"bin",
|
|
33
|
+
"src",
|
|
34
|
+
"public",
|
|
35
|
+
"wrangler.jsonc",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE.md"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"bin": {
|
|
43
|
+
"hulistmi": "bin/hulistmi.mjs"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"dev": "wrangler dev",
|
|
47
|
+
"deploy": "wrangler deploy --minify",
|
|
48
|
+
"cli": "node ./bin/hulistmi.mjs",
|
|
49
|
+
"cf-typegen": "wrangler types --env-interface CloudflareBindings",
|
|
50
|
+
"test": "vitest",
|
|
51
|
+
"test:run": "vitest run",
|
|
52
|
+
"format": "biome check --write --linter-enabled=false .",
|
|
53
|
+
"lint": "biome check --formatter-enabled=false .",
|
|
54
|
+
"check": "biome check --write .",
|
|
55
|
+
"check:ci": "biome check ."
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@hono/mcp": "^0.1.2",
|
|
59
|
+
"@modelcontextprotocol/sdk": "^1.17.4",
|
|
60
|
+
"cheerio": "^1.2.0",
|
|
61
|
+
"hono": "^4.9.4",
|
|
62
|
+
"tsx": "^4.22.4",
|
|
63
|
+
"zod": "^3",
|
|
64
|
+
"zod-to-json-schema": "^3.25.2"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@biomejs/biome": "2.2.2",
|
|
68
|
+
"@cloudflare/vitest-pool-workers": "^0.12.18",
|
|
69
|
+
"@vitest/ui": "^3.2.4",
|
|
70
|
+
"vitest": "^3.2.4",
|
|
71
|
+
"wrangler": "^4.32.0"
|
|
72
|
+
}
|
|
73
|
+
}
|
package/public/SKILL.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hulistmi
|
|
3
|
+
description: Use when fetching or searching HarmonyOS developer documentation in AI-readable Markdown.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# hulistmi
|
|
7
|
+
|
|
8
|
+
Use hulistmi-ai.y6vd2dkjgb.workers.dev to fetch and search HarmonyOS developer documentation in AI-readable Markdown.
|
|
9
|
+
|
|
10
|
+
## HTTP API
|
|
11
|
+
|
|
12
|
+
- `GET /consumer/en/doc/harmonyos-guides/<path>`
|
|
13
|
+
- `GET /consumer/en/doc/harmonyos-references/<path>`
|
|
14
|
+
- `GET /search?q=<query>`
|
|
15
|
+
- `GET /catalog?catalogName=harmonyos-guides&language=en`
|
|
16
|
+
|
|
17
|
+
## MCP Tools
|
|
18
|
+
|
|
19
|
+
- `searchHarmonyOSDocumentation`
|
|
20
|
+
- `fetchHarmonyOSDocumentation`
|
|
21
|
+
- `fetchHarmonyOSCatalog`
|
|
22
|
+
|
|
23
|
+
## CLI
|
|
24
|
+
|
|
25
|
+
- `hulistmi search UIAbility --json`
|
|
26
|
+
- `hulistmi fetch /consumer/en/doc/harmonyos-guides/start-overview`
|
package/public/_headers
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>hulistmi-ai.y6vd2dkjgb.workers.dev</title>
|
|
7
|
+
<link rel="icon" href="/favicon.svg" />
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
margin: 0;
|
|
11
|
+
font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
|
|
12
|
+
color: #111827;
|
|
13
|
+
background: #f8fafc;
|
|
14
|
+
}
|
|
15
|
+
main {
|
|
16
|
+
max-width: 880px;
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
padding: 56px 24px;
|
|
19
|
+
}
|
|
20
|
+
h1 {
|
|
21
|
+
font-size: 42px;
|
|
22
|
+
margin: 0 0 12px;
|
|
23
|
+
}
|
|
24
|
+
p, li {
|
|
25
|
+
line-height: 1.65;
|
|
26
|
+
}
|
|
27
|
+
code {
|
|
28
|
+
background: #e5e7eb;
|
|
29
|
+
padding: 2px 5px;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
33
|
+
</head>
|
|
34
|
+
<body>
|
|
35
|
+
<main>
|
|
36
|
+
<h1>hulistmi-ai.y6vd2dkjgb.workers.dev</h1>
|
|
37
|
+
<p>AI-readable HarmonyOS documentation through HTTP, CLI, MCP, WebMCP, and agent skill discovery.</p>
|
|
38
|
+
<ul>
|
|
39
|
+
<li><code>/consumer/en/doc/harmonyos-guides/start-overview</code></li>
|
|
40
|
+
<li><code>/consumer/en/doc/harmonyos-references/js-apis-app-ability-uiability</code></li>
|
|
41
|
+
<li><code>/search?q=UIAbility</code></li>
|
|
42
|
+
<li><code>/catalog?catalogName=harmonyos-guides&language=en</code></li>
|
|
43
|
+
</ul>
|
|
44
|
+
<p>hulistmi-ai.y6vd2dkjgb.workers.dev is unofficial, on-demand, transient, and not a redistribution channel.</p>
|
|
45
|
+
</main>
|
|
46
|
+
</body>
|
|
47
|
+
</html>
|
package/public/llms.txt
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# hulistmi-ai.y6vd2dkjgb.workers.dev
|
|
2
|
+
|
|
3
|
+
## HTTP API
|
|
4
|
+
|
|
5
|
+
- Fetch guide Markdown: `GET /consumer/en/doc/harmonyos-guides/<path>`
|
|
6
|
+
- Fetch reference Markdown: `GET /consumer/en/doc/harmonyos-references/<path>`
|
|
7
|
+
- Search: `GET /search?q=<query>`
|
|
8
|
+
- Catalog: `GET /catalog?catalogName=harmonyos-guides&language=en`
|
|
9
|
+
|
|
10
|
+
## MCP Integration
|
|
11
|
+
|
|
12
|
+
- Endpoint: `https://hulistmi-ai.y6vd2dkjgb.workers.dev/mcp`
|
|
13
|
+
- WebMCP manifest: `https://hulistmi-ai.y6vd2dkjgb.workers.dev/webmcp/manifest.json`
|
|
14
|
+
- Tools: `searchHarmonyOSDocumentation`, `fetchHarmonyOSDocumentation`, `fetchHarmonyOSCatalog`
|
|
15
|
+
|
|
16
|
+
## CLI
|
|
17
|
+
|
|
18
|
+
- Package: `@hulistmi/hulistmi`
|
|
19
|
+
- Binary: `hulistmi`
|
|
20
|
+
|
|
21
|
+
## AI Agent Skill
|
|
22
|
+
|
|
23
|
+
- Skill: `https://hulistmi-ai.y6vd2dkjgb.workers.dev/SKILL.md`
|
|
24
|
+
- Well-known skill: `https://hulistmi-ai.y6vd2dkjgb.workers.dev/.well-known/agent-skills/hulistmi/SKILL.md`
|
|
25
|
+
|
|
26
|
+
## Notice
|
|
27
|
+
|
|
28
|
+
hulistmi-ai.y6vd2dkjgb.workers.dev is unofficial, on-demand, transient, not an archive, not a bulk mirror, not a redistribution channel, and not a bypass mechanism for Huawei access controls.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
2
|
+
<url><loc>https://hulistmi-ai.y6vd2dkjgb.workers.dev/</loc></url>
|
|
3
|
+
<url><loc>https://hulistmi-ai.y6vd2dkjgb.workers.dev/bot</loc></url>
|
|
4
|
+
<url><loc>https://hulistmi-ai.y6vd2dkjgb.workers.dev/SKILL.md</loc></url>
|
|
5
|
+
<url><loc>https://hulistmi-ai.y6vd2dkjgb.workers.dev/llms.txt</loc></url>
|
|
6
|
+
</urlset>
|
package/public/webmcp.js
ADDED
package/src/cli.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import {
|
|
3
|
+
parseCliArgs,
|
|
4
|
+
resolveFetchEndpoint,
|
|
5
|
+
resolveSearchEndpoint,
|
|
6
|
+
} from "./lib/cli-endpoints";
|
|
7
|
+
import { fetchHarmonyOSCatalog, renderCatalogMarkdown } from "./lib/catalog";
|
|
8
|
+
import { fetchGuidePageData, renderGuideMarkdown } from "./lib/guides";
|
|
9
|
+
import { fetchReferencePageData, renderReferenceMarkdown } from "./lib/reference";
|
|
10
|
+
import { renderSearchMarkdown, searchHarmonyOSDocs } from "./lib/search";
|
|
11
|
+
import { splitDocsPath } from "./lib/url";
|
|
12
|
+
|
|
13
|
+
export async function main(argv = process.argv.slice(2)): Promise<void> {
|
|
14
|
+
const args = parseCliArgs(argv);
|
|
15
|
+
if (args.command === "search") {
|
|
16
|
+
const result = await searchHarmonyOSDocs(args.query);
|
|
17
|
+
const output = args.json
|
|
18
|
+
? JSON.stringify(result, null, 2)
|
|
19
|
+
: renderSearchMarkdown(result);
|
|
20
|
+
process.stdout.write(`${output}\n`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (args.command === "fetch") {
|
|
24
|
+
const endpoint = resolveFetchEndpoint(args.input);
|
|
25
|
+
const DOC_PREFIX = "/consumer/en/doc/";
|
|
26
|
+
if (!endpoint.startsWith(DOC_PREFIX))
|
|
27
|
+
throw new Error(`Unsupported fetch endpoint: ${endpoint}`);
|
|
28
|
+
const { catalogName, pagePath } = splitDocsPath(
|
|
29
|
+
endpoint.slice(DOC_PREFIX.length),
|
|
30
|
+
);
|
|
31
|
+
const sourceUrl = `https://developer.huawei.com/consumer/en/doc/${catalogName}/${pagePath}`;
|
|
32
|
+
if (catalogName === "harmonyos-guides") {
|
|
33
|
+
const data = await fetchGuidePageData(pagePath);
|
|
34
|
+
const content = renderGuideMarkdown(data, pagePath);
|
|
35
|
+
const output = args.json
|
|
36
|
+
? JSON.stringify({ url: sourceUrl, content }, null, 2)
|
|
37
|
+
: content;
|
|
38
|
+
process.stdout.write(`${output}\n`);
|
|
39
|
+
} else {
|
|
40
|
+
const data = await fetchReferencePageData(pagePath);
|
|
41
|
+
const content = renderReferenceMarkdown(data, pagePath);
|
|
42
|
+
const output = args.json
|
|
43
|
+
? JSON.stringify({ url: sourceUrl, content }, null, 2)
|
|
44
|
+
: content;
|
|
45
|
+
process.stdout.write(`${output}\n`);
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (args.command === "serve") {
|
|
50
|
+
const child = spawn(
|
|
51
|
+
"npm",
|
|
52
|
+
["run", "dev", "--", "--port", String(args.port ?? 8787)],
|
|
53
|
+
{ stdio: "inherit" },
|
|
54
|
+
);
|
|
55
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
61
|
+
main().catch((error) => {
|
|
62
|
+
console.error(
|
|
63
|
+
`hulistmi: ${error instanceof Error ? error.message : String(error)}`,
|
|
64
|
+
);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
});
|
|
67
|
+
}
|