@aaione/ai-page-dive
v0.1.5
Published
PageDive native messaging host — 零依赖薄壳,桥接 Chrome 扩展与本机 AI CLI(claude / codex)
Readme
ai-page-dive (host)
PageDive 的本机组件(Native Messaging host):桥接 Chrome 扩展与本机已装的 AI CLI(claude / codex),零依赖纯 Node 薄壳。内容只在本机处理,不经过任何服务器。
安装
本机组件服务于「AI PageDive」Chrome 扩展;扩展经 Chrome 应用商店分发(上架后此处补直链)。
需要 macOS + Chrome + Node.js >= 18(终端没有 npm?先 brew install node 或用 nvm 装 Node),以及本机已装并登录的 claude 或 codex CLI。
# 两条分开跑:&& 拼接时第一条失败会静默吞掉第二条(r66 low,拆行失败各自可见)
npm i -g @aaione/[email protected]
ai-page-dive install --ext-id <扩展ID>install 幂等:写 NM host manifest(~/Library/Application Support/Google/Chrome/NativeMessagingHosts/)+ 探测本机 CLI。扩展端的 Onboarding 页会给出完整命令(含扩展 ID)。
自动注册(postinstall)
npm i -g 安装完成后会尝试自动注册 NM host(仅 macOS + 非 root + 检测到 Chrome 数据目录时;失败静默降级,绝不影响安装成功)。注册后许可名单(allowed_origins)为空属预期——回到扩展面板,按提示执行一条登记命令即可。设 PAGEDIVE_SKIP_POSTINSTALL=1 可跳过自动注册。pnpm 全局安装默认不执行安装钩子,请手动跑 install。
用法
装好后打开 Chrome 扩展 AI PageDive 的侧边栏即可,无需再管本包。
- 总结模式(workflow):
~/.ai-page-dive/workflows/<name>/WORKFLOW.md(内置 deep / humanize / paper / product-audit / quick 五档,用户目录可 shadow 同名内置) - 技能(skill):
~/.ai-page-dive/skills/<name>/SKILL.md - 历史记录:
~/.ai-page-dive/history/
卸载
- Chrome 移除扩展(
chrome://extensions内移除) - 终端
ai-page-dive uninstall清理本机组件注册(NM manifest + wrapper) npm uninstall -g @aaione/ai-page-dive移除包本身。顺序不可反——包删掉后命令出口就没了;npm ≥7 全局卸载不执行钩子,不会自动清注册
本机数据 ~/.ai-page-dive/(历史 / workflow / 附件)默认保留,确认不再需要时手动删除即可。
排障
- 扩展横幅报『本机组件未就绪 / 本机组件版本过低 / 本机组件有新版本』→ 重跑面板给出的安装命令(幂等)
ai-page-dive: command not found→ 自定义过 npm 全局前缀,可执行文件不在 PATH:把$(npm prefix -g)/bin加入 PATH(zsh 例:在~/.zshrc加一行export PATH="$(npm prefix -g)/bin:$PATH"后source ~/.zshrc),再重跑上方登记命令- 想完全重置:按上面 1-2 步卸干净后重装
开发
本包是 ai-page-dive monorepo 的 packages/host。pnpm build 后 node dist/index.js --stdio 直接可跑。
审计:npm 包内 dist/*.js 即本组件全部运行时代码——零依赖纯 Node、CI 断言 ≤2200 行,可直接逐行阅读;安装钩子在 package.json 内为一行明文。隐私全文亦随包分发(PRIVACY.md,仓库根副本同源)。
Privacy Policy / 隐私政策
Last updated: 2026-11-01
PageDive("AI PageDive" Chrome 扩展及其本机组件)按以下方式处理数据。核心承诺:PageDive 没有服务器——你的网页内容只在扩展与本机 CLI 之间流转,不经我们中转,也不被我们存储。(CLI 与其模型服务如何通信由该 CLI 自身的隐私政策决定,见下。)
English Summary
PageDive has no servers, no accounts, and no API keys. When you click "summarize", the extension extracts the current page's content — along with a visible-viewport screenshot (follow-up turns also attach a page-snapshot of the page text) — and sends it via Chrome Native Messaging directly to an AI CLI (claude / codex) installed and logged in on your own machine, where it is written to a per-task temp file (deleted the moment the task ends; crash leftovers are swept the next time you run a task, for files older than an hour) for that CLI to read; the CLI runs in a stable working directory (~/.ai-page-dive/agent-workspace/, kept long-term as the anchor for follow-up questions in the same session; attachments you add are symlinked there and swept by the next task — page content itself never lands in this directory). We never transmit, intermediate, or store your content: no telemetry, no analytics, no crash reports. History, workflows, skills, and any attachments you attach (persisted under ~/.ai-page-dive/attachments/ for history restoration) live under ~/.ai-page-dive/ on your machine. Follow-up session state stays in Chrome session storage (cleared on browser restart); panel preferences (ambience, reading size, chosen workflow, enabled skills, history limit) and an in-flight task pointer are kept in the extension's own local storage on your machine (pd-* keys — UI preferences only, no page content). When probing available CLIs, PageDive reads (only) the default-model field from your CLI's local config file (claude: the model key or the env.ANTHROPIC_MODEL key in ~/.claude/settings.json; codex: the model key in ~/.codex/config.toml) to display the default model — read-only, best-effort, nothing else parsed or sent anywhere. Note that the CLI you invoke keeps its own session transcripts of what it processes (e.g. claude under ~/.claude/projects/) — that is the CLI's built-in behavior, governed by its own privacy policy and outside PageDive's control. Outbound exits beyond the CLI itself are all click-initiated (r98: the earlier "only outbound exit is sharing" claim was inaccurate): sharing (Settings → "Share", opens your chosen platform's share page with this product's link and name), links that open the npm package page or a feedback email draft, and Chrome's own keyboard-shortcuts page — never any background navigation. How your CLI communicates with its model service is governed by that CLI's own privacy policy (claude → Anthropic, codex → OpenAI). The optional "always allow reading" host permission is off by default and granted only by explicit user action.
数据处理
- 网页正文与元数据:扩展在你点击总结时提取当前页正文(Readability),经 Chrome Native Messaging 传给本机组件,写入本机临时文件供本机 AI CLI 读取。全程在本机完成。
- 可视区截图与页面快照(自动附带):点击总结时自动附带当前页可视区截图(JPEG,预算内压缩),追问轮还会附带页面快照文本——与正文同走一条 Native Messaging 链路、同样写入本机临时文件随任务终局清理,不经任何服务器。
- 你的输入与附件:同样只在本机处理(附件为文本 ≤512KB/个 或 图片 ≤500KB/个,图片以 base64 传输)。
- AI CLI:PageDive 以子进程方式调用你本机已安装且已登录的官方 CLI(claude / codex)。CLI 与其模型服务之间的通信遵循该 CLI 自身的服务条款与隐私政策;PageDive 不接触、不存储、不代理任何凭证或流量,也永不对你的 CLI 用量收费。
- CLI 本地配置读取(只读):探测可用 CLI 时读取其本地配置文件的默认模型字段(claude:
~/.claude/settings.json的model或其中env.ANTHROPIC_MODEL;codex:~/.codex/config.toml的model)以在界面显示默认模型——仅默认模型一义的两个取值路径,best-effort;不解析其余内容,也不向任何地方回传。 - 分享出口(用户主动):设置页「分享给朋友」在你点击时,把本产品的链接与名称带至你所选平台的分享页(如微博/X,新标签打开);除此之外不经手任何数据,分享内容也与你总结过的网页无关。
存储位置(全部在本机)
- 总结历史 / workflow / 技能:
~/.ai-page-dive/ - 附件(持久化,历史恢复可追溯):
~/.ai-page-dive/attachments/ - CLI 工作目录(会话 cwd 锚点 + 附件软链):
~/.ai-page-dive/agent-workspace/——固定工作区,追问会话的恢复锚点,长期保留、不随任务清理;附件软链由下次任务启动时补扫,正文不落此目录(正文临时文件在系统临时目录,随任务终局删除) - CLI 运行临时文件:系统临时目录
/tmp/pagedive/(任务结束即删;异常退出的残留在你下次总结时被兜底清扫回收——清 1 小时前的旧文件,无定时机制) - 追问会话状态:Chrome storage(session 域,浏览器重启即清)
- 面板偏好与在跑任务指针(localStorage / storage.local,持久落盘于本机扩展存储):氛围/字号档、所选 workflow、技能启用列表、历史保留条数等
pd-*键——均为产品 UI 偏好,不含网页内容
你所选 CLI 自身的落盘(PageDive 之外)
claude CLI 会把它经手的会话转录(含被总结的网页正文)写入其自身目录(如 ~/.claude/projects/);codex 亦会在其自身数据目录留存会话记录(以其官方文档为准)。这是 CLI 的内置行为——PageDive 不创建、不读取、不清理这些文件;查看或清除请参考对应 CLI 的官方文档。
我们不做的
- 没有 PageDive 服务器:无账号、无登录、无 API key
- 不收集任何遥测、分析数据或崩溃报告
- 不向任何第三方出售或传输你的数据
权限用途
| 权限 | 用途 |
|---|---|
| activeTab / scripting | 你点击时提取当前页正文(仅该页;无常驻 <all_urls> 访问——可选读取权限默认关闭,见本表末行) |
| sidePanel | 侧边栏界面 |
| nativeMessaging | 与本机组件进程间通信 |
| storage | 追问会话恢复(session 域,浏览器重启即清)+ 面板偏好与在跑任务指针的本地持久存储(localStorage / storage.local,仅 UI 偏好与任务指针,不含网页内容) |
| optional_host_permissions(可选读取) | 默认关闭;仅当你在授权出错提示气泡中开启「始终允许读取网页」并经 Chrome 确认后授予。授予后对任意普通页面放行读取(免逐页手势重授权);可在 chrome://extensions 随时收回 |
联系
邮箱:[email protected](npm maintainer 同源)· https://www.npmjs.com/package/@aaione/ai-page-dive
