cortico-world-surfing 0.3.2 → 0.4.1
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/AGENTS.md +33 -0
- package/CHANGELOG.md +13 -0
- package/README.md +357 -12
- package/THIRD_PARTY_NOTICES.md +33 -0
- package/describe.json +56 -110
- package/dist/page-engine.mjs +5 -0
- package/dist/webui.js +1002 -41
- package/package.json +4 -3
- package/src/ENV_PROMPT.md +46 -4
- package/src/address-ranges.ts +20 -0
- package/src/config.ts +50 -5
- package/src/definition.ts +1 -1
- package/src/network.ts +36 -13
- package/src/sites.ts +135 -0
- package/src/snapshots.ts +22 -13
- package/src/webui/client.ts +102 -27
- package/src/world.ts +66 -42
- package/src/secret-file.ts +0 -24
package/AGENTS.md
CHANGED
|
@@ -10,3 +10,36 @@ Before changing this world extension, read [Cortico extension contracts](https:/
|
|
|
10
10
|
- Build the engine bundle in an isolated copy while a deployed bot uses this checkout. Use fake deployments and scripted models for verification.
|
|
11
11
|
- Stage explicit paths and make local Conventional Commits. Push, publish and submit maintainer requests only when the user asks.
|
|
12
12
|
- For tag changes, certification, superseding packages or appeals, follow the [index request format](https://github.com/Pal-AI-Lab/cortico-extensions#readme). Certification requires a maintainer review.
|
|
13
|
+
- Avoid unnecessary secondary labels and descriptions. Let the layout do the explaining.
|
|
14
|
+
|
|
15
|
+
### AI slop checklist
|
|
16
|
+
|
|
17
|
+
Review UI copy, prompts, documentation, code comments, commit messages and reports to the
|
|
18
|
+
operator sentence by sentence.
|
|
19
|
+
Prefer deleting redundant prose. Preserve factual content in documentation; trace vague claims to
|
|
20
|
+
their implementation and state the actual behavior. Keep comments only when they explain facts
|
|
21
|
+
that cannot be inferred from the code.
|
|
22
|
+
|
|
23
|
+
- [ ] **Obvious information**: Remove common knowledge and instructions evident from the UI.
|
|
24
|
+
- [ ] **UI narration**: Remove descriptions of cards, groups, buttons and layout. Show state in
|
|
25
|
+
status labels.
|
|
26
|
+
- [ ] **Long narratives**: Reduce "this happens here, so you can..." to the necessary behavior,
|
|
27
|
+
condition or result.
|
|
28
|
+
- [ ] **Manufactured contrast**: Remove "not A but B", rhetorical turns introduced with dashes and
|
|
29
|
+
emphasis that serve no actual distinction.
|
|
30
|
+
- [ ] **Jargon and metaphors**: Use ordinary words for concrete objects and actions. Define necessary
|
|
31
|
+
terms before using them and follow the project's naming conventions.
|
|
32
|
+
- [ ] **Vague actions**: State what an operation changes and when it takes effect. Replace phrases
|
|
33
|
+
such as "touches the disk" or "finishes up" with the actual behavior.
|
|
34
|
+
- [ ] **Hype and reassurance**: Remove praise for the implementation, subjective modifiers such as
|
|
35
|
+
"quietly" or "reliably", and unsupported assurances such as "rest assured".
|
|
36
|
+
- [ ] **Incident history**: Remove accounts of incidents, fixes, defenses of old designs and
|
|
37
|
+
precautionary lectures. Express constraints that still apply as current rules.
|
|
38
|
+
- [ ] **Layer boundaries**: Keep platform details in their World. Shared entry points do not describe
|
|
39
|
+
the internal behavior of a particular World, Persona or bot.
|
|
40
|
+
- [ ] **Misplaced information**: Put information needed for operation in the UI, contracts at
|
|
41
|
+
interfaces, architecture in modules or their documentation, and history in git.
|
|
42
|
+
- [ ] **Repeated explanations**: State each fact only where needed. Check duplicate copy and other
|
|
43
|
+
language versions during cleanup.
|
|
44
|
+
- [ ] **Accuracy after editing**: Verify retained behavior, conditions, units and boundaries.
|
|
45
|
+
Necessary consequences, error causes and recovery steps must remain accurate and specific.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1 - 2026-11-13
|
|
4
|
+
|
|
5
|
+
- Save the Microlink API key directly in the Surfing panel. The compact password field clears after saving, and leaving it empty preserves the existing key.
|
|
6
|
+
|
|
7
|
+
## 0.4.0 - 2026-11-06
|
|
8
|
+
|
|
9
|
+
- Add `surfing_search_all`, which searches Bilibili, Tieba, Moegirlpedia and Baidu Baike in parallel and returns short results. Open numbered results and further Tieba results with `surfing_read_page`. The WebUI has a switch for each source and a per-source result limit.
|
|
10
|
+
- Merge `surfing_read_bili_info` and `surfing_read_bili_comments` into `surfing_read_bili`. The old tool names are removed; pass `mode: "info"` or `mode: "comments"` instead.
|
|
11
|
+
- Add nbnhhsh abbreviation lookup as the fifth `surfing_search_all` source. It is on by default, including for existing configs without the new setting, and sends every letter and digit fragment of the query to nbnhhsh; turn it off in the site search settings.
|
|
12
|
+
- Add a proxy compatibility mode for Clash-style fake-IP DNS, off by default. When on, reads accept common IPv4 and IPv6 proxy address ranges and optional custom ranges, and the proxy decides the real destination, which can include local or private services. Blocked reads to common proxy ranges explain where to enable the mode.
|
|
13
|
+
- Restore the previous value when saving a setting from the WebUI fails.
|
|
14
|
+
- Expand the environment prompt with guidance on source choice, looking up unfamiliar terms, recording how a group uses them and joining game chat. Parts of it derive from `cortico-world-learn-alont1`; the MIT notice ships in `THIRD_PARTY_NOTICES.md`.
|
|
15
|
+
|
|
3
16
|
## 0.3.2 - 2026-11-03
|
|
4
17
|
|
|
5
18
|
- Use Microlink to render pages when local Chromium is unavailable, with an optional API key and keyless requests.
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<!-- Owner: package.json, src/definition.ts, src/world.ts, src/ENV_PROMPT.md, src/network.ts, src/bili.ts, src/microlink.ts, src/webui/client.ts -->
|
|
1
|
+
<!-- Owner: package.json, src/definition.ts, src/world.ts, src/ENV_PROMPT.md, src/network.ts, src/bili.ts, src/sites.ts, src/microlink.ts, src/webui/client.ts -->
|
|
2
2
|
# 网上冲浪
|
|
3
3
|
|
|
4
|
-
让 Cortico 阅读公开网页、B
|
|
4
|
+
让 Cortico 阅读公开网页、B站视频简介、字幕和评论,在 B站、贴吧和百科中查找材料,查询字母或数字缩写的候选释义,并根据读到的内容回答问题。发送链接或BV号即可使用,B站读取均使用匿名请求。
|
|
5
5
|
|
|
6
6
|
## 能做什么
|
|
7
7
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
- **阅读B站视频**:读取人工或AI字幕,保留时间范围,支持视频分P和 b23.tv 短链。
|
|
10
10
|
- **阅读简介和评论**:读取视频简介、分P目录、热门或最新评论,以及指定评论的楼中楼回复。
|
|
11
11
|
- **搜索视频**:按关键词查找视频,也可以搜索“关键词 梗知识”来了解梗或概念。
|
|
12
|
+
- **站点搜索**:同时查 B站、贴吧、萌娘百科和百度百科,并查询字母或数字缩写的候选释义,返回短材料和可继续打开的编号。通用网页搜索不在此范围,由模型已有的网页搜索工具处理。
|
|
12
13
|
|
|
13
14
|
可与 learn 学习扩展配合,将读到的梗或概念交给学习工具记录。
|
|
14
15
|
|
|
@@ -30,19 +31,14 @@
|
|
|
30
31
|
|
|
31
32
|
无需 API Key 即可使用 Microlink 后备。配置 Key 后使用认证接口及该 Key 的额度;Key 仅发送给 Microlink,不进入模型回执。
|
|
32
33
|
|
|
33
|
-
在网上冲浪的「配置」页找到「Microlink
|
|
34
|
-
|
|
35
|
-
```dotenv
|
|
36
|
-
CORTICO_SURFING_MICROLINK_API_KEY=
|
|
37
|
-
```
|
|
34
|
+
在网上冲浪的「配置」页找到「Microlink 远程渲染」。
|
|
38
35
|
|
|
39
36
|
取得免费 Key 的步骤:
|
|
40
37
|
|
|
41
38
|
1. 打开 [Microlink 注册页](https://dashboard.microlink.io/signup),注册账号并登录,无需购买付费套餐。
|
|
42
39
|
2. 在控制台左侧选择「Overview」,点击「Usage」标签。
|
|
43
40
|
3. 点击「Development」标签右上角的「…」,复制 API Key。
|
|
44
|
-
4. 将 Key
|
|
45
|
-
5. 点击「刷新密钥状态」,状态变为「API Key 已配置」。下次远程读取使用新 Key;清空值并保存可恢复免 Key 调用。
|
|
41
|
+
4. 将 Key 粘贴到 Microlink API Key 输入框并保存,下次远程读取即使用新 Key。
|
|
46
42
|
|
|
47
43
|
免 Key 和免费 Key 的额度不同,当前限制见 [Microlink 额度说明](https://microlink.io/docs/api/basics/rate-limit)。额度耗尽或访问失败时,回执说明原因;已有短静态正文仍返回,并标明未取得完整渲染内容。
|
|
48
44
|
|
|
@@ -68,14 +64,239 @@ QQ 分享卡片中的来源、标题和链接会进入消息正文。需要阅
|
|
|
68
64
|
|
|
69
65
|
## 简介与评论
|
|
70
66
|
|
|
71
|
-
`
|
|
67
|
+
`surfing_read_bili` 用 `mode` 选择材料,每次读取一种。目标均可为 `bvid`、`aid` 或视频 `url`,支持 b23.tv 短链。
|
|
68
|
+
|
|
69
|
+
默认 `mode: "subtitles"` 读字幕,`cid` 选择分P:
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
surfing_read_bili({ bvid: "BVxxxxxxxxxx" })
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
视频:“破防”是什么意思?
|
|
77
|
+
P1:正片;UP主:示例UP主;人工字幕(中文)
|
|
78
|
+
|
|
79
|
+
[00:00–00:30] 今天我们聊聊“破防”这个词……
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`mode: "info"` 读简介、标题、UP主和分P目录,不请求字幕:
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
surfing_read_bili({ bvid: "BVxxxxxxxxxx", mode: "info" })
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
视频简介:“破防”是什么意思?
|
|
90
|
+
BV: BVxxxxxxxxxx;UP主:示例UP主
|
|
91
|
+
|
|
92
|
+
从游戏语境到日常表达,聊聊“破防”的几种用法。
|
|
93
|
+
P1:正片(cid: 10001)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`mode: "comments"` 读评论原文、作者、发布时间、点赞数与评论 ID(`rpid`):
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
surfing_read_bili({ bvid: "BVxxxxxxxxxx", mode: "comments", sort: "hot" })
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
视频评论:“破防”是什么意思?
|
|
104
|
+
BV: BVxxxxxxxxxx;热门评论;含楼中楼预览
|
|
105
|
+
|
|
106
|
+
评论 rpid: 20001;作者:示例评论者;赞:12;楼中楼:1;2026-11-05T00:00:00.000Z
|
|
107
|
+
我现在说破防,更多是在自嘲。
|
|
108
|
+
|
|
109
|
+
续读 cursor: comments_demo_cursor
|
|
110
|
+
```
|
|
72
111
|
|
|
73
112
|
- 评论默认按热门排序,`sort: "time"` 改为最新排序。
|
|
74
|
-
-
|
|
75
|
-
- 返回 `cursor`
|
|
113
|
+
- 主评论中包含平台返回的楼中楼预览;`surfing_read_bili({ bvid, mode: "comments", root: "20001" })` 继续读取该评论下的回复,此时不传 `sort`。
|
|
114
|
+
- 返回 `cursor` 时,沿用原目标、`mode`、排序和 `root` 续读。先读完当前缓存内容,再按需请求平台后续批次;重放同一游标返回同一份已缓存材料。
|
|
115
|
+
- `cid` 只用于字幕,`sort` 和 `root` 只用于评论。
|
|
116
|
+
|
|
117
|
+
原 `surfing_read_bili_info`、`surfing_read_bili_comments` 已并入本工具,分别改传 `mode: "info"`、`mode: "comments"`。
|
|
76
118
|
|
|
77
119
|
每批评论在调用时取得,平台排序与可见范围可能变化。回执中的楼中楼预览只覆盖平台返回的片段;评论区关闭、评论删除或平台拒绝匿名访问时返回具体原因。
|
|
78
120
|
|
|
121
|
+
## 站点搜索
|
|
122
|
+
|
|
123
|
+
`surfing_search_all` 只接受 `query` 和可选的 `sources`,来源为 `bili`、`tieba`、`moegirl`、`baike`、`nbnhhsh`。各来源并行查询一次,全部免费、免 API Key、无需登录。来源的能力有重叠:想看一个词实际怎么用,贴吧的讨论和 B站视频的字幕、评论都可以作为材料。以下示例中的标题、BV号和引用均为示意。
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
surfing_search_all({ query: "破防" })
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
「破防」
|
|
131
|
+
pageRef: search_demo_1
|
|
132
|
+
|
|
133
|
+
【B站】
|
|
134
|
+
· “破防”是什么意思?|示例UP主|02:35|BVxxxxxxxxxx
|
|
135
|
+
|
|
136
|
+
【贴吧】
|
|
137
|
+
· (示例游戏吧)这关把我打破防了 [L1]
|
|
138
|
+
试了好多次,终于过了。
|
|
139
|
+
更多贴吧结果 [L2]
|
|
140
|
+
|
|
141
|
+
【萌娘百科】
|
|
142
|
+
破防:破防是个游戏术语,也是网络用语。 [L3]
|
|
143
|
+
|
|
144
|
+
【百度百科】
|
|
145
|
+
破防:网络流行语,是破除防御的简称。 [L4]
|
|
146
|
+
|
|
147
|
+
【缩写释义】未识别到字母或数字缩写。
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
B站候选把 BV号交给 `surfing_read_bili`,不返回搜索游标。想继续搜 B站时,先调用 `surfing_search_bili({ query })`,再用它自己回执中的 `cursor` 续搜,`surfing_search_all` 不提供这个 `cursor`。其余结果的编号只在所属 `pageRef` 内有效,新回执不改变旧回执中编号的含义。
|
|
151
|
+
|
|
152
|
+
**只查部分来源**
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
surfing_search_all({ query: "破防", sources: ["tieba"] })
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
「破防」
|
|
160
|
+
pageRef: tieba_demo_1
|
|
161
|
+
|
|
162
|
+
【贴吧】
|
|
163
|
+
· (示例游戏吧)这关把我打破防了 [L1]
|
|
164
|
+
试了好多次,终于过了。
|
|
165
|
+
更多贴吧结果 [L2]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**查字母或数字缩写**
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
surfing_search_all({ query: "YYDS nbnhhsh zzzzqwertyxyz", sources: ["nbnhhsh"] })
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
「YYDS nbnhhsh zzzzqwertyxyz」
|
|
176
|
+
|
|
177
|
+
【缩写释义】
|
|
178
|
+
yyds:永远滴神、音乐大师、以一当十、阴阳大师、永远单身(共47个,显示前5个)
|
|
179
|
+
nbnhhsh:能不能好好说话
|
|
180
|
+
zzzzqwertyxyz:无匹配
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
`query` 里连续两位以上的字母或数字会转成小写、去重,一次发给 [nbnhhsh](https://github.com/itorr/nbnhhsh)(能不能好好说话)的公开接口。发送的是全部字母和数字片段,不只是缩写,也包括数字和 BV号;不想发送时在配置中关闭这个来源。
|
|
184
|
+
|
|
185
|
+
每个缩写按上游顺序显示前几个候选,条数由“每源显示条数”决定,有截断时标明总数。上游没有确切释义、只给出联想结果时显示为 `abc:可能是 候选甲、候选乙`。候选由网友贡献,多义时需要结合上下文判断。这个来源只返回文本,没有 `[L#]` 编号。示例中的候选取自某次真实查询,上游内容会变化。
|
|
186
|
+
|
|
187
|
+
**打开帖子或词条原文**
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
surfing_read_page({ pageRef: "search_demo_1", linkId: "L1" })
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
网页:这关把我打破防了
|
|
195
|
+
pageRef: article_demo_1
|
|
196
|
+
|
|
197
|
+
试了好多次,终于过了。这次换了打法……
|
|
198
|
+
|
|
199
|
+
续读 cursor: article_demo_cursor
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
这是普通网页回执,后续用 `surfing_read_page({ pageRef: "article_demo_1", cursor: "article_demo_cursor" })` 续读。贴吧编号打开公开的移动版帖子页 `tieba.baidu.com/mo/m?kz=<帖子ID>`,百度百科编号打开接口返回的移动版词条页。
|
|
203
|
+
|
|
204
|
+
**继续贴吧结果**
|
|
205
|
+
|
|
206
|
+
```js
|
|
207
|
+
surfing_read_page({ pageRef: "search_demo_1", linkId: "L2" })
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
「破防」· 贴吧
|
|
212
|
+
pageRef: tieba_demo_2
|
|
213
|
+
|
|
214
|
+
· (示例游戏吧)终于通关了,昨天差点破防 [L1]
|
|
215
|
+
最后一次尝试成功了。
|
|
216
|
+
更多贴吧结果 [L2]
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
只推进贴吧,先显示已取得但未展示的帖子,用完后才请求贴吧下一页。这批的编号改用新的 `pageRef`。重放同一编号返回同一批结果。没有后续时不再列出“更多贴吧结果”。
|
|
220
|
+
|
|
221
|
+
**其他回执**
|
|
222
|
+
|
|
223
|
+
| 情况 | 回执 |
|
|
224
|
+
| --- | --- |
|
|
225
|
+
| 单个来源失败,其他来源照常返回 | `【萌娘百科】访问受限。` |
|
|
226
|
+
| 该来源没有匹配 | `【贴吧】未找到匹配结果。` |
|
|
227
|
+
| 贴吧上游下一页为空 | `【贴吧】没有更多结果。` |
|
|
228
|
+
| 指定了配置中关闭的来源 | `【萌娘百科】已在配置中关闭。` |
|
|
229
|
+
| `query` 里没有两位以上的字母或数字,不发送请求 | `【缩写释义】未识别到字母或数字缩写。` |
|
|
230
|
+
| 某个片段没有释义 | `zzzzqwertyxyz:无匹配` |
|
|
231
|
+
| 缩写释义已在配置中关闭 | `【缩写释义】已在配置中关闭。` |
|
|
232
|
+
| 引用过期或服务重启 | `[tool failed] 引用已到期或被释放,请重新读取或搜索。` |
|
|
233
|
+
|
|
234
|
+
只有 B站候选、缩写候选或没有可打开的条目时,回执开头不带 `pageRef`。
|
|
235
|
+
|
|
236
|
+
**配置**
|
|
237
|
+
|
|
238
|
+
在配置页的「站点搜索」调整,下次调用生效。
|
|
239
|
+
|
|
240
|
+
- **来源开关**:点击“萌娘百科”取消选中后,`surfing_search_all({ query: "破防" })` 的回执没有【萌娘百科】分组,也不向该站发送请求,后续编号顺延。指定 `sources: ["moegirl"]` 时回执为 `【萌娘百科】已在配置中关闭。`。再次点击后恢复。`surfing_search_bili` 不受 B站开关影响。
|
|
241
|
+
- **每源显示条数**:默认5条,范围1到10条,作用于 B站、贴吧和每个缩写的候选数。改为2后,贴吧回执只列两条帖子,“更多贴吧结果”从第3条继续,不跳到上游下一页:
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
【贴吧】
|
|
245
|
+
· (示例游戏吧)这关把我打破防了 [L1]
|
|
246
|
+
· (示例游戏吧)终于通关了,昨天差点破防 [L2]
|
|
247
|
+
更多贴吧结果 [L3]
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
百科只给词条摘要和原文编号,不做远端分页。
|
|
251
|
+
|
|
252
|
+
**回执超出单次返回上限**
|
|
253
|
+
|
|
254
|
+
返回上限较小而材料较长时,回执末尾带续读 `cursor`:
|
|
255
|
+
|
|
256
|
+
```text
|
|
257
|
+
「破防」
|
|
258
|
+
pageRef: search_demo_1
|
|
259
|
+
|
|
260
|
+
【B站】
|
|
261
|
+
· “破防”是什么意思?|示例UP主|02:35|BVxxxxxxxxxx
|
|
262
|
+
|
|
263
|
+
【贴吧】
|
|
264
|
+
· (示例游戏吧)这关把我打破防了 [L1]
|
|
265
|
+
|
|
266
|
+
续读 cursor: search_demo_cursor
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```js
|
|
270
|
+
surfing_read_page({ pageRef: "search_demo_1", cursor: "search_demo_cursor" })
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
```text
|
|
274
|
+
「破防」
|
|
275
|
+
pageRef: search_demo_1
|
|
276
|
+
|
|
277
|
+
· (示例游戏吧)终于通关了,昨天差点破防 [L2]
|
|
278
|
+
更多贴吧结果 [L3]
|
|
279
|
+
|
|
280
|
+
【百度百科】
|
|
281
|
+
破防:网络流行语,是破除防御的简称。 [L4]
|
|
282
|
+
|
|
283
|
+
【缩写释义】未识别到字母或数字缩写。
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`cursor` 只续读这份已取得的回执,不发起新的搜索。编号不变,要推进贴吧搜索时打开“更多贴吧结果”的 `[L#]`。
|
|
287
|
+
|
|
288
|
+
回执开头没有 `pageRef` 时,放不下的部分由末尾同时给出 `pageRef` 和 `cursor`,用同样的方式续读:
|
|
289
|
+
|
|
290
|
+
```text
|
|
291
|
+
「yyds xswl ……」
|
|
292
|
+
|
|
293
|
+
【缩写释义】
|
|
294
|
+
yyds:永远滴神、音乐大师、以一当十、阴阳大师、永远单身(共47个,显示前5个)
|
|
295
|
+
|
|
296
|
+
pageRef: abbr_demo_1
|
|
297
|
+
续读 cursor: abbr_demo_cursor
|
|
298
|
+
```
|
|
299
|
+
|
|
79
300
|
## 字幕重试
|
|
80
301
|
|
|
81
302
|
本次未取得字幕时,默认额外重试2次,分别等待1秒、2秒。在配置页可调整重试次数和首次等待时间,后续等待时间逐次翻倍;次数设为0关闭重试。所有尝试共用单次读取超时。
|
|
@@ -101,11 +322,135 @@ QQ 分享卡片中的来源、标题和链接会进入消息正文。需要阅
|
|
|
101
322
|
- 网页需通过公开域名访问;不支持账号登录、本机地址或IP地址。正文需要登录或验证码时,可能只能取得页面提示。
|
|
102
323
|
- 视频内容来自可访问的字幕。重试后仍未取得字幕时会说明本次读取失败,无法据此判断视频没有字幕或声音。
|
|
103
324
|
- 网页阅读返回正文,暂不提取PDF、图片、音频或视频画面。
|
|
325
|
+
- 萌娘百科条目页目前对本扩展的阅读器返回 Cloudflare 验证页,编号打开时回执为“网页未允许本次公开读取。”。`surfing_search_all` 中的摘要来自官方接口,不受影响。
|
|
326
|
+
- 萌娘百科和百度百科按词条名精确查询,不是全文搜索。贴吧跨页可能出现上游重复帖子。
|
|
104
327
|
- QQ 分享卡片缺少链接时,来源为 B站或哔哩哔哩且有标题,可按标题搜索并核对候选;来源无法确定时,需提供 BV号或视频链接,或明确要求按标题在 B站搜索。
|
|
105
328
|
|
|
329
|
+
## 使用 Clash 等代理时
|
|
330
|
+
|
|
331
|
+
如果读取网页或 B站时看到下面的提示,说明域名解析到了代理常用的虚拟地址:
|
|
332
|
+
|
|
333
|
+
```text
|
|
334
|
+
[tool failed] 这个网址解析到了代理常用的虚拟地址,所以没有读取。如果正在使用 Clash 等代理,可以在网上冲浪设置中开启代理兼容模式后重试。
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
代理的 fake-ip 模式会让域名先解析到一个虚拟地址,再由代理连接真实网站。Surfing 默认只读取解析到公网地址的网址,所以在连接前就停下了,网站本身可能是正常的。下面的示例均为示意。
|
|
338
|
+
|
|
339
|
+
**开启代理兼容模式**
|
|
340
|
+
|
|
341
|
+
在网上冲浪的配置面板找到“代理”,打开“代理兼容模式”开关。开关变为开启并显示“已保存:代理兼容模式”就完成了,无需重启,下次读取生效。
|
|
342
|
+
|
|
343
|
+
开启后,实际访问哪里由代理决定,可能包括本机或内网服务。请只在信任当前代理时开启。
|
|
344
|
+
|
|
345
|
+
然后重新读取。回执和平时一样,不会多出代理信息:
|
|
346
|
+
|
|
347
|
+
```js
|
|
348
|
+
surfing_read_page({ url: "https://example.org/article" })
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
```text
|
|
352
|
+
网页:示例文章
|
|
353
|
+
pageRef: article_demo_1
|
|
354
|
+
|
|
355
|
+
这是文章正文……
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
兼容模式也适用于网页的脚本加载和现有渲染流程,包括本机 Chromium 和 Microlink。
|
|
359
|
+
|
|
360
|
+
**搜索后打开原文**
|
|
361
|
+
|
|
362
|
+
所有读取工具共用这个开关,调用时不需要额外参数。站点搜索和编号原文的用法不变:
|
|
363
|
+
|
|
364
|
+
```js
|
|
365
|
+
surfing_search_all({ query: "破防", sources: ["tieba"] })
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
```text
|
|
369
|
+
「破防」
|
|
370
|
+
pageRef: tieba_demo_1
|
|
371
|
+
|
|
372
|
+
【贴吧】
|
|
373
|
+
· (示例游戏吧)这关把我打破防了 [L1]
|
|
374
|
+
试了好多次,终于过了。
|
|
375
|
+
更多贴吧结果 [L2]
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
```js
|
|
379
|
+
surfing_read_page({ pageRef: "tieba_demo_1", linkId: "L1" })
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
```text
|
|
383
|
+
网页:这关把我打破防了
|
|
384
|
+
pageRef: article_demo_2
|
|
385
|
+
|
|
386
|
+
试了好多次,终于过了。这次换了打法……
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
**B站字幕和短链**
|
|
390
|
+
|
|
391
|
+
BV号、长链和 b23.tv 短链的用法不变,回执见[简介与评论](#简介与评论):
|
|
392
|
+
|
|
393
|
+
```js
|
|
394
|
+
surfing_read_bili({ url: "https://b23.tv/example" })
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**内置地址范围**
|
|
398
|
+
|
|
399
|
+
内置的常见地址范围是下面三段,普通用户不用填写:
|
|
400
|
+
|
|
401
|
+
```text
|
|
402
|
+
198.18.0.0/15
|
|
403
|
+
fdfe:dcba:9876::/64
|
|
404
|
+
2001:2::/48
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
同时解析到 IPv4 和 IPv6 虚拟地址时,优先连接 IPv4;只有 IPv6 时连接 IPv6。
|
|
408
|
+
|
|
409
|
+
**遇到其他内网地址**
|
|
410
|
+
|
|
411
|
+
开启后,只要解析结果里有不在上述范围内的内网或保留地址,这次读取仍会被拒绝,每次跳转也会重新检查:
|
|
412
|
+
|
|
413
|
+
```text
|
|
414
|
+
[tool failed] 这个网址解析到了未放行的内网或保留地址,所以没有读取。只有确认这是你改过的代理地址池时,才需要把它加入自定义地址范围;否则请检查网址和代理设置。
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
这个网址也可能真的指向内网,不要只为了让读取通过就添加地址。
|
|
418
|
+
|
|
419
|
+
**自定义地址范围**
|
|
420
|
+
|
|
421
|
+
只有改过代理的地址池才需要这一步,比如 mihomo 的 `fake-ip-range` 或 `fake-ip-range6`。展开“高级设置”,在“自定义地址范围(可选)”中每行填一个范围,离开输入框时保存:
|
|
422
|
+
|
|
423
|
+
```text
|
|
424
|
+
172.19.0.0/16
|
|
425
|
+
fd00:1234::/64
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
这些范围是对内置范围的补充,只在代理兼容模式开启时生效。填写的范围有多大,放行的地址就有多少,例如 `10.0.0.0/8` 会放行整段内网。
|
|
429
|
+
|
|
430
|
+
写错时不会保存,面板会指出是哪一行:
|
|
431
|
+
|
|
432
|
+
```text
|
|
433
|
+
自定义地址范围第 2 行无法识别:172.19.0.0。每行填一个范围,例如 172.19.0.0/16 或 fd00:1234::/64。
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
**关闭**
|
|
437
|
+
|
|
438
|
+
再次点击开关将其关闭,下次读取恢复默认规则。已填写的自定义范围会保留,但不再生效。
|
|
439
|
+
|
|
440
|
+
**这个模式解决不了的问题**
|
|
441
|
+
|
|
442
|
+
- 网站要求登录或验证时,仍然读不到,例如回执显示“网页未允许本次公开读取。”。
|
|
443
|
+
- 代理连不上目标网站时,读取仍会失败或超时。
|
|
444
|
+
- 网址本身的限制不变,仍不能直接读取 `localhost`、内网域名或 IP 地址。
|
|
445
|
+
|
|
446
|
+
**不开启的替代做法**
|
|
447
|
+
|
|
448
|
+
也可以改代理配置,让 DNS 返回真实地址。将 `dns.enhanced-mode` 改为 `redir-host`;或者保留 fake-ip,在 `fake-ip-filter-mode: blacklist` 下把要读取的域名加入 `fake-ip-filter`。搜索、跳转和字幕可能用到其他域名,它们也需要返回真实地址。配置含义见 [mihomo DNS 文档](https://wiki.metacubex.one/config/dns/)。修改后重新加载代理配置再重试。
|
|
449
|
+
|
|
106
450
|
## 许可
|
|
107
451
|
|
|
108
452
|
MIT License,见 [LICENSE](LICENSE)。
|
|
453
|
+
内置环境提示词的部分内容与设计借鉴自 [cortico-world-learn-alont1](https://www.npmjs.com/package/cortico-world-learn-alont1)(MIT),并针对 Surfing 的工具与阅读流程进行了调整。上游版权及许可声明见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|
|
109
454
|
|
|
110
455
|
## Cortico 0.2.1
|
|
111
456
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## cortico-world-learn-alont1
|
|
4
|
+
|
|
5
|
+
- 来源:https://www.npmjs.com/package/cortico-world-learn-alont1
|
|
6
|
+
- 参考版本:0.1.16
|
|
7
|
+
- 许可证:MIT
|
|
8
|
+
- 使用范围:`src/ENV_PROMPT.md` 的部分提示词内容与设计借鉴自该插件,
|
|
9
|
+
并针对 Surfing 的工具接口和阅读流程进行了修改。
|
|
10
|
+
|
|
11
|
+
以下保留上游版权及许可声明:
|
|
12
|
+
|
|
13
|
+
MIT License
|
|
14
|
+
|
|
15
|
+
Copyright (c) 2026 alont1
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
in the Software without restriction, including without limitation the rights
|
|
20
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
furnished to do so, subject to the following conditions:
|
|
23
|
+
|
|
24
|
+
The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
copies or substantial portions of the Software.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
SOFTWARE.
|