npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cortico-world-learn-alont1

v0.1.1

Published

联网学习 World:遇到不懂的词自己上网查(B站/贴吧/萌娘百科),提炼出用法再记;也能记人和关系

Readme

cortico-world-learn-alont1

联网学习 World:遇到不懂的词,模型自己上网查,读完提炼出用法再记下来。也能记人和关系。

这套的关键是那道分界

常见的做法是"扫消息 → 切词 → 统计 → 自动存词典"。效果差的根因不是不够勤,是学错了东西:

| 问题 | 具体 | |---|---| | 切词产生垃圾 | 中文没法靠字数切分,「的了是我你」这种噪点大量混入 | | 学的不是群里的话 | 小模型解释出来的是词典释义:「破防是游戏术语,指破坏防御」 | | 没有语境 | 背下释义也不会用——群里说「破防」多半是自嘲调侃,不是真防御被破坏 | | 自动入库 | 搜索结果直接存,没人判断对不对,错了也删不掉 |

这套换了两个前提:

1. 模型自己决定学什么 —— 搜索是工具,不是后台任务。 遇到听不懂的才查。环境提示词里明确写了「别装懂,也别猜」。

2. 搜到的只是材料,不落库。 learn_search 返回原始材料(B站标题/贴吧帖子/萌百释义),并明确告诉它 「以上是原始材料,还没记住」。要它读完、提炼出「在你们这儿怎么用」, 再调 learn_note 存。

这道分界是整套的关键。自动存搜索结果 = 又变回词典。

三个免密钥的源

Cortico 内建的 websearch 需要 BRAVE_API_KEY(付费),而这套用的是公开接口:

| 源 | 给什么 | 为什么好 | |---|---|---| | B站搜索 API | 视频标题 | 视频标题就是真实用法,能看出语气和语境 | | 贴吧移动版 | 帖子标题+摘要 | 黑话的源头。返回的是 JSON,字段在 data.post_list | | 萌娘百科 | 词条释义 | ACG 用语最准 |

为什么不用通用搜索:Bing 遇到「破防」这种词会返回单字字典页,五种写法结果一样,没用。 三个源里任何一个挂了都不影响其它源。

实测「破防」返回的材料长这样:

【B站】相关标题:
· 姚PD唯独这次没惯着白鹿,她直接破防到忘记表情管理
【贴吧】真实帖子:
· (三角洲行动吧)单挑把同事打破防了
  现在已经一天没说话,啥图也不打了就去普通模式挂机钓鱼去了
· (流放之路2吧)后续来了,我已破防
【萌娘百科】释义:...

这些是用法,不是「破坏防御」。

装

控制台「扩展」页搜 cortico-world,或者:

cd extensions
corepack pnpm add --ignore-workspace cortico-world-learn-alont1

--ignore-workspace 不能省:少了它 pnpm 会把 extensions/ 当成仓库工作区的一员。

开

部署的 config.json:

{ "worlds": { "learn": { "enabled": true } } }

重启后控制台应见 World: learn。

四个工具

| 工具 | 干什么 | 会不会写库 | |---|---|---| | learn_search | 上网查词,返回原始材料 | ❌ 不写 | | learn_note | 记一条(词 或 人) | ✅ 写 | | learn_recall | 翻学过什么 | ❌ 不写 | | learn_forget | 删记错的 | ✅ 写 |

learn_note 的参数里 usage 字段是重点——「在你们这儿怎么用」。 环境提示词里反复强调了这点,并给了对错示范:

❌ 破防:心理防线被击破
✅ 他们群说「破防」大多是调侃,输了游戏或被戳到痛处,带点自嘲,不是真的生气

看和改

cat "<部署目录>/data/learn.json"
{
  "version": 1,
  "notes": [
    { "kind": "term", "key": "破防", "meaning": "…", "usage": "…",
      "from": "B站+贴吧+萌娘百科", "at": "2026-09-19T04:05:00+08:00" },
    { "kind": "person", "key": "10001", "meaning": "…", "usage": "…", "from": "…", "at": "…" }
  ]
}
  • kind: "term" 是词/梗,"person" 是人(键用账号 id,别用昵称——昵称会改)
  • 存满了按 maxNotes 丢最旧的
  • 同一个 key 再记会覆盖,不会攒重复

最近学的会注入系统前缀(injectCount 控制条数),所以学到就能用,不用每次查。

调

| 旋钮 | 默认 | 说明 | |---|---|---| | maxNotes | 120 | 最多存几条,超了丢最旧的 | | injectCount | 12 | 前缀里放几条。太多挤上下文 | | searchTimeoutMs | 15000 | 单源超时,各源独立 | | resultsPerSource | 8 | 每源取几条,太多会淹没有效信息 |

排错

它查了但没记 看环境提示词里「搞懂了才记,没懂就说不认识」那段。如果老是不记, 可以在 ENV_PROMPT.md 里把要求写得更硬。

记的东西还是像词典 usage 字段没填或者填成了释义。这是模型行为问题,改 ENV_PROMPT.md 里的示范,或在 learn_note 的 usage 描述里加更强的示例。

搜不到 看回执里「试过的源」那行——哪个源挂了会标出来。 贴吧偶尔会改接口(返回 HTML 而不是 JSON),sources.ts 里留了 HTML 兜底解析。

前缀里没有 learn 段 检查 console() 有没有声明 promptDocs 且 role: 'envPrompt'。 漏了这个,World 挂上了但提示词不出现,而且不报错。

和 websearch 的关系

内建的 websearch world 是给通用网页搜索用的(要 Brave key)。 这个扩展是专为中文网络用语做的:换了源、加了「提炼才算学会」的分界、 能把学到的沉淀成长期记忆。两个可以并存,互不冲突。

开发

corepack pnpm install
corepack pnpm typecheck

"type": "module" 是硬要求。契约版本 cortico.api 是 4。

许可

MIT