@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.
- package/README.md +18 -21
- package/README.zh-CN.md +33 -36
- 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
|
|
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
|
|
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
|
-
##
|
|
10
|
+
## Core Features
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
##
|
|
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
|
|
22
|
+
Do not load this alongside another `pi-web-access` wrapper to avoid duplicate tool registrations.
|
|
28
23
|
|
|
29
|
-
##
|
|
24
|
+
## Usage
|
|
30
25
|
|
|
31
|
-
The model
|
|
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
|
|
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
|
-
##
|
|
48
|
+
## Context Footprint Benchmark
|
|
54
49
|
|
|
55
|
-
With only this extension enabled, its recurring model
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
> **
|
|
4
|
-
>
|
|
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)
|
|
8
|
+
基于 [`pi-web-access`](https://github.com/nicobailon/pi-web-access) 的精简封装。在完整保留上游网络检索能力的同时,将原本分散的 4 个工具整合成单一紧凑接口,大幅节省 Prompt 空间。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 核心特性
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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` |
|
|
32
|
+
| `op` 操作 | 说明 | `input` 输入 |
|
|
38
33
|
| --- | --- | --- |
|
|
39
|
-
| `search` |
|
|
40
|
-
| `check` |
|
|
41
|
-
| `fetch` |
|
|
42
|
-
| `get` |
|
|
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
|
-
|
|
46
|
+
如需使用高级参数或批量操作,请将 JSON 对象序列化后作为 `input` 字符串传入。仅在需要查看完整上游 Schema 时调用 `help`。
|
|
52
47
|
|
|
53
|
-
##
|
|
48
|
+
## 初始化上下文占用对比
|
|
54
49
|
|
|
55
|
-
|
|
50
|
+
单独启用本扩展时,注入到模型初始上下文中的 Token 占用实测如下:
|
|
56
51
|
|
|
57
|
-
| 模型可见工具 | Lean |
|
|
52
|
+
| 模型可见工具 | Lean 精简版 | 原版 `pi-web-access@0.22.0` |
|
|
58
53
|
| --- | ---: | ---: |
|
|
59
|
-
| Facade / 搜索 | `web_access
|
|
60
|
-
| 来源核验 |
|
|
61
|
-
|
|
|
62
|
-
| 结果续取 |
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Lean Pi web access
|
|
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"
|