dsh-moli 1.0.0 → 1.0.2
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/README.md +37 -1
- package/README.zh.md +32 -1
- package/index.js +22 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
# dsh-moli
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-moli)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
3
6
|
Expose a locally installed [Moli](https://github.com/lexmount/moli) (`moli.exe`, a Rust headless
|
|
4
7
|
browser for AI agents) as **DeepSeek Harness tools**, so an agent can call it instead of shelling out.
|
|
5
8
|
|
|
6
9
|
English | [中文](README.zh.md)
|
|
7
10
|
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Published on npm as [`dsh-moli`](https://www.npmjs.com/package/dsh-moli):
|
|
14
|
+
|
|
15
|
+
```powershell
|
|
16
|
+
dsh plugin --profile web add dsh-moli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
That is the recommended route: it resolves through the npm registry, so it also works where GitHub
|
|
20
|
+
is slow or unreachable, and DSH's install dialog can fall back to a regional mirror. Installing
|
|
21
|
+
straight from the repository works too, and needs GitHub to be reachable:
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
dsh plugin --profile web add github:27painter/dsh-moli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Either way, restart DSH, then check the engine and fetch a page:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
moli_probe
|
|
31
|
+
moli_fetch url=https://example.com dump=markdown
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Moli itself is a separate download. `moli_probe` reports whether it is present, and
|
|
35
|
+
`moli_probe action=install` can fetch it. See [Installation](#installation).
|
|
36
|
+
|
|
8
37
|
## What it provides
|
|
9
38
|
|
|
10
39
|
| Tool | Purpose |
|
|
@@ -53,6 +82,13 @@ The plugin is installed into a DSH profile. Pick the route that matches your mac
|
|
|
53
82
|
|
|
54
83
|
Nothing else to fetch. The plugin finds `moli.exe` on its own and both tools work immediately.
|
|
55
84
|
|
|
85
|
+
```powershell
|
|
86
|
+
dsh plugin --profile web add dsh-moli
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Install from the repository instead if you prefer tracking the source, or if the registry is
|
|
90
|
+
unreachable for you:
|
|
91
|
+
|
|
56
92
|
```powershell
|
|
57
93
|
dsh plugin --profile web add github:27painter/dsh-moli
|
|
58
94
|
```
|
|
@@ -64,7 +100,7 @@ Restart DSH, then confirm with `moli_probe`.
|
|
|
64
100
|
Install the plugin the same way, restart, then let it fetch Moli for you:
|
|
65
101
|
|
|
66
102
|
```powershell
|
|
67
|
-
dsh plugin --profile web add
|
|
103
|
+
dsh plugin --profile web add dsh-moli
|
|
68
104
|
# restart DSH, then call:
|
|
69
105
|
moli_probe action=install
|
|
70
106
|
```
|
package/README.zh.md
CHANGED
|
@@ -4,6 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
[English](README.md) | 中文
|
|
6
6
|
|
|
7
|
+
## 快速开始
|
|
8
|
+
|
|
9
|
+
已发布到 npm:[`dsh-moli`](https://www.npmjs.com/package/dsh-moli)
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
dsh plugin --profile web add dsh-moli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**推荐走这条**:它经 npm registry 解析,所以在 GitHub 慢或不通的网络里照样能装,而且 DSH 的安装对话框能
|
|
16
|
+
回退到国内镜像。直接从仓库装也可以,但需要 GitHub 可达:
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
dsh plugin --profile web add github:27painter/dsh-moli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
两种方式都要重启 DSH,然后自检并抓一个页面:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
moli_probe
|
|
26
|
+
moli_fetch url=https://example.com dump=markdown
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Moli 本体是另外下载的。`moli_probe` 会报告它是否在场,`moli_probe action=install` 可以替你拉取。
|
|
30
|
+
详见[安装](#安装)。
|
|
31
|
+
|
|
7
32
|
## 与 Moli 官方 agent skill 的关系
|
|
8
33
|
|
|
9
34
|
Moli 仓库自带官方 agent skill:[`moli-webfetch`](https://github.com/lexmount/moli/tree/main/skills/moli-webfetch)、
|
|
@@ -48,6 +73,12 @@ moli_fetch url=https://example.com dump=pdf writeTo=/绝对路径/a.pdf
|
|
|
48
73
|
|
|
49
74
|
不需要再装别的东西。插件自己会找到 `moli.exe`,两个工具立即可用。
|
|
50
75
|
|
|
76
|
+
```powershell
|
|
77
|
+
dsh plugin --profile web add dsh-moli
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
若你更想跟踪源码,或 registry 对你不可达,改从仓库装:
|
|
81
|
+
|
|
51
82
|
```powershell
|
|
52
83
|
dsh plugin --profile web add github:27painter/dsh-moli
|
|
53
84
|
```
|
|
@@ -59,7 +90,7 @@ dsh plugin --profile web add github:27painter/dsh-moli
|
|
|
59
90
|
同样方式装插件、重启,然后让它替你把 Moli 拉下来:
|
|
60
91
|
|
|
61
92
|
```powershell
|
|
62
|
-
dsh plugin --profile web add
|
|
93
|
+
dsh plugin --profile web add dsh-moli
|
|
63
94
|
# 重启 DSH,然后调用:
|
|
64
95
|
moli_probe action=install
|
|
65
96
|
```
|
package/index.js
CHANGED
|
@@ -27,7 +27,17 @@ const DEFAULTS = {
|
|
|
27
27
|
insecureTls: true,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Parameter schema of `moli_fetch`.
|
|
32
|
+
*
|
|
33
|
+
* The two schema layers follow DIFFERENT rules, which is easy to get wrong:
|
|
34
|
+
* - A parameter spec uses the author DSL, where a property-level `required: true`
|
|
35
|
+
* is correct. `parameterSchemaSpecToJsonSchema` hoists it into an object-level
|
|
36
|
+
* `required` array and strips the flag.
|
|
37
|
+
* - A raw output schema is validated as-is, so `required` there must already be an
|
|
38
|
+
* object-level array of names. A property-level `required: true` makes the
|
|
39
|
+
* registry reject the whole tool with `JsonSchemaError`.
|
|
40
|
+
*/
|
|
31
41
|
const FETCH_PARAMETERS = {
|
|
32
42
|
url: { type: 'string', required: true, description: 'Absolute http:// or https:// URL to fetch.' },
|
|
33
43
|
dump: {
|
|
@@ -65,13 +75,20 @@ const FETCH_PARAMETERS = {
|
|
|
65
75
|
cookieFile: { type: 'string', description: 'Netscape/curl cookie-jar file to send.' },
|
|
66
76
|
};
|
|
67
77
|
|
|
78
|
+
/**
|
|
79
|
+
* `required` is an object-level array of property names in the registry's schema
|
|
80
|
+
* subset for a RAW schema. A property-level `required: true` belongs to the
|
|
81
|
+
* parameter DSL instead; here it makes the registry reject the tool.
|
|
82
|
+
*/
|
|
83
|
+
|
|
68
84
|
/** Result schema of `moli_fetch`; only `ok` and `url` are always present. */
|
|
69
85
|
const FETCH_OUTPUT_SCHEMA = {
|
|
70
86
|
type: 'object',
|
|
71
87
|
additionalProperties: true,
|
|
88
|
+
required: ['ok', 'url'],
|
|
72
89
|
properties: {
|
|
73
|
-
ok: { type: 'boolean'
|
|
74
|
-
url: { type: 'string'
|
|
90
|
+
ok: { type: 'boolean' },
|
|
91
|
+
url: { type: 'string' },
|
|
75
92
|
kind: { type: 'string', enum: ['text', 'binary'] },
|
|
76
93
|
dump: { type: 'string' },
|
|
77
94
|
content: { type: 'string' },
|
|
@@ -93,8 +110,9 @@ const FETCH_OUTPUT_SCHEMA = {
|
|
|
93
110
|
const PROBE_OUTPUT_SCHEMA = {
|
|
94
111
|
type: 'object',
|
|
95
112
|
additionalProperties: true,
|
|
113
|
+
required: ['installed'],
|
|
96
114
|
properties: {
|
|
97
|
-
installed: { type: 'boolean'
|
|
115
|
+
installed: { type: 'boolean' },
|
|
98
116
|
exe: { type: 'string' },
|
|
99
117
|
version: { type: 'string' },
|
|
100
118
|
httpsOk: { type: 'boolean' },
|
package/package.json
CHANGED