@ssk_dev/pi-web-access-lean 0.22.0 → 0.22.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.
Files changed (3) hide show
  1. package/README.md +18 -21
  2. package/README.zh-CN.md +33 -36
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,34 +1,29 @@
1
1
  # @ssk_dev/pi-web-access-lean
2
2
 
3
- > **Lean Pi web access plugin, same functionality 141 initialization tokens, 94% fewer than the original.**
3
+ > **Lean Pi web access extension with identical features: 141 initialization tokens, 94% lighter than original.**
4
4
  > [See my full setup for Pi](https://github.com/kunkun9527/my-lean-pi-setup)
5
5
 
6
6
  [简体中文](README.zh-CN.md)
7
7
 
8
- A token-lean Pi facade over [`pi-web-access`](https://github.com/nicobailon/pi-web-access). It keeps the complete upstream web runtime while presenting one compact model-facing schema.
8
+ A lightweight Pi wrapper for [`pi-web-access`](https://github.com/nicobailon/pi-web-access). It preserves the full upstream web search and browsing engine while compressing four separate tools into a single, compact tool schema.
9
9
 
10
- ## What it keeps
10
+ ## Core Features
11
11
 
12
- - Web search and result continuation.
13
- - Source and claim checking.
14
- - URL fetching and upstream provider behavior.
15
- - Complete advanced operation schemas, disclosed locally through `help` only when needed.
12
+ * Full upstream capabilities: Web search, result pagination, source verification, and page fetching all work as intended.
13
+ * Unified tool interface: Consolidates `web_search`, `source_check`, `fetch_content`, and `get_search_content` under one `web_access` tool.
14
+ * Minimal prompt overhead: Everyday operations use concise string inputs. Detailed schemas and advanced parameters stay out of the prompt until queried via `help`.
16
15
 
17
- ## Why it is lean
18
-
19
- Instead of exposing four detailed provider-facing tools on every request, the wrapper routes them through one `web_access` tool. Simple calls use a short string; advanced parameters remain available as JSON without keeping every operation schema in the prompt.
20
-
21
- ## Install
16
+ ## Installation
22
17
 
23
18
  ```bash
24
19
  pi install npm:@ssk_dev/pi-web-access-lean
25
20
  ```
26
21
 
27
- Do not load another `pi-web-access` wrapper at the same time, or web tools may be registered twice.
22
+ Do not load this alongside another `pi-web-access` wrapper to avoid duplicate tool registrations.
28
23
 
29
- ## Use
24
+ ## Usage
30
25
 
31
- The model sees one tool:
26
+ The model interacts with a single tool:
32
27
 
33
28
  ```text
34
29
  web_access
@@ -48,11 +43,11 @@ Simple example:
48
43
  { "op": "search", "input": "Pi coding agent extensions" }
49
44
  ```
50
45
 
51
- For batch or advanced parameters, pass a JSON object encoded as the `input` string. Use `help` only when the complete upstream schema is required.
46
+ For batch or advanced parameters, pass a JSON object encoded as the `input` string. Use `help` only when you need the complete upstream schema.
52
47
 
53
- ## Measured initialization footprint
48
+ ## Context Footprint Benchmark
54
49
 
55
- With only this extension enabled, its recurring model-facing initialization contribution is:
50
+ With only this extension enabled, its recurring initialization overhead in the model context is:
56
51
 
57
52
  | Model-facing tool | Lean | Upstream `pi-web-access@0.22.0` |
58
53
  | --- | ---: | ---: |
@@ -62,11 +57,13 @@ With only this extension enabled, its recurring model-facing initialization cont
62
57
  | Result continuation | Included in facade | `get_search_content`: 393 |
63
58
  | **Total** | **141** | **2,376** |
64
59
 
65
- That is **2,235 fewer tokens (94.1%)** than the pinned upstream extension. The measurement used Pi 0.84.4 and `pi-context-view@0.4.3` in a fresh isolated session, excluding Pi built-in tools, skills, context files, messages, and unrelated extensions. Context View estimates text as `ceil(characters / 4)`, so these are reproducible context-footprint estimates rather than exact GPT tokenizer counts. Runtime-only UI and slash commands are not included because they are not sent to the model.
60
+ This saves **2,235 tokens (94.1%)** compared to the pinned upstream package.
61
+
62
+ The benchmark was measured on Pi 0.84.4 with `pi-context-view@0.4.3` in a fresh isolated session, excluding built-in tools, skills, context files, and unrelated extensions. Context View estimates tokens as `ceil(characters / 4)`. Pure runtime UI elements and slash commands are excluded as they are not sent to the model.
66
63
 
67
64
  ## Versions
68
65
 
69
- The upstream runtime is pinned to `pi-web-access@0.22.0`.
66
+ Upstream runtime is pinned to `pi-web-access@0.22.0`.
70
67
 
71
68
  ## Development
72
69
 
@@ -75,6 +72,6 @@ npm ci
75
72
  npm run check
76
73
  ```
77
74
 
78
- ## License and upstream
75
+ ## License
79
76
 
80
77
  MIT. This project wraps the MIT-licensed [`pi-web-access`](https://github.com/nicobailon/pi-web-access).
package/README.zh-CN.md CHANGED
@@ -1,22 +1,17 @@
1
1
  # @ssk_dev/pi-web-access-lean
2
2
 
3
- > **Lean Pi web access 插件,功能相同:141 个初始化 tokens,较原插件减少 94%。**
4
- > **整套配置:** [查看 Pi Lean Setup](https://github.com/kunkun9527/my-lean-pi-setup)
3
+ > **Pi 联网扩展精简版,保留全部功能,仅需 141 初始化 Token,相比原版减少 94%。**
4
+ > **完整配置参考:** [查看 Pi Lean Setup](https://github.com/kunkun9527/my-lean-pi-setup)
5
5
 
6
6
  [English](README.md)
7
7
 
8
- [`pi-web-access`](https://github.com/nicobailon/pi-web-access) token 精简版 Pi facade。它保留完整的上游联网运行时,同时只向模型提供一个紧凑 schema。
8
+ 基于 [`pi-web-access`](https://github.com/nicobailon/pi-web-access) 的精简封装。在完整保留上游网络检索能力的同时,将原本分散的 4 个工具整合成单一紧凑接口,大幅节省 Prompt 空间。
9
9
 
10
- ## 保留的能力
10
+ ## 核心特性
11
11
 
12
- - 网页搜索和结果续取。
13
- - 来源与事实声明核验。
14
- - URL 抓取和上游供应商行为。
15
- - 完整高级操作 schema,仅在需要时通过 `help` 在本地披露。
16
-
17
- ## 为什么更精简
18
-
19
- 包装层不再让每次请求都携带四个详细的模型可见工具,而是通过一个 `web_access` 工具路由这些能力。简单调用只使用短字符串;高级参数仍可通过 JSON 使用,无需长期把每个操作 schema 放入提示词。
12
+ * 保留全部联网功能:支持网页搜索、结果翻页续取、事实与来源核验、网页全文抓取。
13
+ * 统一工具入口:将 `web_search`、`source_check`、`fetch_content` 和 `get_search_content` 整合为一个 `web_access` 工具。
14
+ * 按需展开高级选项:日常查询只需传入简短字符串;复杂参数可传 JSON,完整 Schema 仅在调用 `help` 时按需提供,避免常驻占用上下文。
20
15
 
21
16
  ## 安装
22
17
 
@@ -24,57 +19,59 @@
24
19
  pi install npm:@ssk_dev/pi-web-access-lean
25
20
  ```
26
21
 
27
- 不要同时加载另一个 `pi-web-access` 包装层,否则联网工具可能被重复注册。
22
+ 请勿与其它 `pi-web-access` 包装扩展同时加载,以防重复注册工具。
28
23
 
29
- ## 使用
24
+ ## 使用方法
30
25
 
31
- 模型只看到一个工具:
26
+ 模型仅会看到一个工具:
32
27
 
33
28
  ```text
34
29
  web_access
35
30
  ```
36
31
 
37
- | `op` | 作用 | `input` |
32
+ | `op` 操作 | 说明 | `input` 输入 |
38
33
  | --- | --- | --- |
39
- | `search` | 搜索网页 | 查询字符串 |
40
- | `check` | 核验声明或来源 | 声明字符串 |
41
- | `fetch` | 抓取 URL | URL 字符串 |
42
- | `get` | 续取已保存结果 | Response ID |
43
- | `help` | 显示完整参数 | 操作名称 |
34
+ | `search` | 网页搜索 | 查询关键词字符串 |
35
+ | `check` | 事实或来源核验 | 待核验内容字符串 |
36
+ | `fetch` | 抓取网页内容 | 目标 URL 字符串 |
37
+ | `get` | 续取已缓存结果 | 对应的 Response ID |
38
+ | `help` | 查看完整参数说明 | 目标操作名称 |
44
39
 
45
- 简单示例:
40
+ 基础调用示例:
46
41
 
47
42
  ```json
48
43
  { "op": "search", "input": "Pi coding agent extensions" }
49
44
  ```
50
45
 
51
- 批量或高级参数应把 JSON 对象编码为 `input` 字符串。仅在需要完整上游 schema 时使用 `help`。
46
+ 如需使用高级参数或批量操作,请将 JSON 对象序列化后作为 `input` 字符串传入。仅在需要查看完整上游 Schema 时调用 `help`。
52
47
 
53
- ## 实测初始化上下文占用
48
+ ## 初始化上下文占用对比
54
49
 
55
- 仅启用本扩展时,它持续贡献给模型的初始化上下文为:
50
+ 单独启用本扩展时,注入到模型初始上下文中的 Token 占用实测如下:
56
51
 
57
- | 模型可见工具 | Lean | 上游 `pi-web-access@0.22.0` |
52
+ | 模型可见工具 | Lean 精简版 | 原版 `pi-web-access@0.22.0` |
58
53
  | --- | ---: | ---: |
59
- | Facade / 搜索 | `web_access`:141 | `web_search`:994 |
60
- | 来源核验 | 已包含在 facade 中 | `source_check`:413 |
61
- | 内容抓取 | 已包含在 facade 中 | `fetch_content`:576 |
62
- | 结果续取 | 已包含在 facade 中 | `get_search_content`:393 |
54
+ | Facade / 搜索 | `web_access`: 141 | `web_search`: 994 |
55
+ | 来源核验 | 已收敛至统一工具中 | `source_check`: 413 |
56
+ | 网页抓取 | 已收敛至统一工具中 | `fetch_content`: 576 |
57
+ | 结果续取 | 已收敛至统一工具中 | `get_search_content`: 393 |
63
58
  | **合计** | **141** | **2,376** |
64
59
 
65
- 相比固定版本的上游扩展,减少 **2,235 tokens(94.1%)**。测量使用 Pi 0.84.4 和 `pi-context-view@0.4.3`,在全新隔离会话中只启用目标扩展,并排除 Pi 内置工具、skills、context files、消息及无关扩展。Context View 按 `ceil(字符数 / 4)` 估算,因此这些是可复现的上下文占用估值,不是 GPT tokenizer 的精确计数。未计入不会发送给模型的纯运行时 UI 和 slash commands。
60
+ 相比固定版本的上游扩展,初始开销减少了 **2,235 tokens(94.1%)**。
61
+
62
+ 测试环境为 Pi 0.84.4 与 `pi-context-view@0.4.3` 独立会话,排除了 Pi 内置工具、Skills、上下文文件与无关扩展。Context View 按 `ceil(字符数 / 4)` 估算。未计入不会发送给模型的纯运行时 UI 与 Slash 命令。
66
63
 
67
- ## 版本
64
+ ## 版本说明
68
65
 
69
- 上游运行时固定为 `pi-web-access@0.22.0`。
66
+ 上游运行时锁定为 `pi-web-access@0.22.0`。
70
67
 
71
- ## 开发
68
+ ## 本地开发
72
69
 
73
70
  ```bash
74
71
  npm ci
75
72
  npm run check
76
73
  ```
77
74
 
78
- ## 许可证与上游
75
+ ## 开源协议与致谢
79
76
 
80
- MIT。本项目包装了采用 MIT 许可证的 [`pi-web-access`](https://github.com/nicobailon/pi-web-access)。
77
+ MIT 协议。本项目封装自采用 MIT 协议的 [`pi-web-access`](https://github.com/nicobailon/pi-web-access)。
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ssk_dev/pi-web-access-lean",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "type": "module",
5
- "description": "Lean Pi web access plugin, same functionality — 141 initialization tokens, 94% fewer than the original.",
5
+ "description": "Lean Pi web access extension, same functionality — 141 initialization tokens, 94% fewer than the original.",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
8
8
  "access": "public"