pi-devin-search 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-devin-search contributors
4
+ Copyright (c) 2026 Piwin contributors (adapted protocol portions)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,24 @@
1
+ dsh-devin-search is independent of DeepSeek Harness, Devin/Windsurf and piwin.
2
+
3
+ Protocol field numbers, role encoding, OAuth endpoint/PKCE conventions and
4
+ completion message design were adapted from these MIT-licensed piwin sources:
5
+ packages/agent-host/src/devin/oauth.ts
6
+ packages/tools-web/src/devin-search-provider.ts
7
+ packages/host-runtime/src/code-search/backends/windsurf-protobuf.ts
8
+ packages/host-runtime/src/code-search/backends/windsurf-protocol.ts
9
+ packages/host-runtime/src/code-search/completion-port.ts
10
+ Copyright (c) 2026 Piwin contributors. See LICENSE for the MIT permission notice.
11
+
12
+ The implementation is a smaller independent client with strict framing,
13
+ bounded IO and an allowlisted local search loop. It imports no piwin package
14
+ and reads no piwin credential file. DSH service integration was checked against
15
+ DeepSeek Harness 0.2.1-alpha.1, reference commit
16
+ 5badb15009ae1756c3afe0ae0cef1faafc290ccc (MIT).
17
+
18
+ Offline fixtures do not establish compatibility with a live provider, account
19
+ entitlements, service availability, prices, or continued authorization.
20
+
21
+
22
+ pi-devin-search bundles the search, OAuth, and local-workspace core from this repository into dist/extension.js.
23
+ It does not bundle DeepSeek Harness, Cordis, or a desktop UI. Host packages @earendil-works/pi-coding-agent and
24
+ @earendil-works/pi-ai stay external. Credential storage is plugin-owned and is not a DSH credential file.
package/README.md CHANGED
@@ -1,3 +1,85 @@
1
- # Temporary Holding Version
1
+ # pi-devin-search
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 适用于 [Pi Coding Agent](https://pi.dev) 的原生扩展,提供基于 Devin 官方接口的联网搜索(`web_search`)与本地代码库只读检索(`code_search`)。
4
+
5
+ 本扩展独立运行于 Pi CLI 环境,无需图形界面支持,不依赖 DeepSeek Harness 运行时。
6
+
7
+ ## 功能特性
8
+
9
+ - **联网搜索 (`web_search`)**:通过 Devin 服务检索公开互联网信息并返回结构化引用来源。
10
+ - **本地代码检索 (`code_search`)**:受控只读代码检索,在当前工作区(cwd)内执行有界结构化搜索,支持代码库定位。
11
+ - **标准认证体系**:基于 PKCE 协议实现授权码登录,凭据在本地严格隔离存储。
12
+ - **细粒度工具控制**:支持按需独立启用或禁用特定搜索工具。
13
+
14
+ ## 安装指南
15
+
16
+ ### 从 npm 安装(推荐)
17
+
18
+ 在 Pi 终端中执行:
19
+
20
+ ```bash
21
+ pi install npm:pi-devin-search
22
+ ```
23
+
24
+ ### 本地路径安装(开发与调试)
25
+
26
+ 指定扩展包本地路径安装:
27
+
28
+ ```bash
29
+ pi install /path/to/dsh-plugin-devin/packages/pi-devin-search
30
+ ```
31
+
32
+ 或在单次会话中临时加载:
33
+
34
+ ```bash
35
+ pi -e /path/to/dsh-plugin-devin/packages/pi-devin-search/dist/extension.js
36
+ ```
37
+
38
+ ## 命令与认证
39
+
40
+ 扩展注册了以下交互管理命令:
41
+
42
+ | 命令 | 说明 |
43
+ | :--- | :--- |
44
+ | `/devin-login` | 发起 PKCE 授权流程。获取授权码后在专用交互输入框中提交。 |
45
+ | `/devin-login local` | 本机环境专用:通过本地临时回调(`127.0.0.1`)完成登录。 |
46
+ | `/devin-status` | 查看当前会话状态及有效期(脱敏展示,不输出敏感令牌)。 |
47
+ | `/devin-settings` | 交互式查看并调整工具启用状态。 |
48
+ | `/devin-settings web on\|off` | 开启或禁用 `web_search` 工具。 |
49
+ | `/devin-settings code on\|off` | 开启或禁用 `code_search` 工具。 |
50
+ | `/devin-logout` | 取消在途请求并删除本地持久化凭据。 |
51
+ | `/devin-cancel` | 取消等待中的登录交互流程。 |
52
+
53
+ > **安全须知**:请勿将授权码直接附加在命令参数或输入在对话内容中。系统会在独立安全的输入界面中接收授权码。
54
+
55
+ ## 工具行为与运行约束
56
+
57
+ - **默认状态**:初次安装或登录后,`web_search` 与 `code_search` 默认均为开启状态。
58
+ - **启动白名单 (`--tools`) 兼容说明**:
59
+ 若启动 Pi 时显式指定了 `--tools` 过滤参数,Pi 将基于全局白名单过滤所有工具(含扩展工具)。此时必须将所需工具显式加入参数,例如:
60
+ ```bash
61
+ pi --tools read,web_search,code_search
62
+ ```
63
+ 修改启动参数需完全重启 Pi 进程生效(`/reload` 不会变更进程级参数白名单)。
64
+ - **代码检索安全沙箱**:
65
+ - 检索范围严格限定在启动 Pi 时的当前工作目录(cwd)以内,禁止跨目录逃逸。
66
+ - 严格遵守目录内 `.gitignore` 规则,自动跳过敏感配置文件(如 `.env`、密钥凭据及私钥证书)与大型二进制文件。
67
+ - 所有工具调用均为只读模式(`readOnlyHint: true`),不具备文件写入与系统命令执行权限。
68
+
69
+ ## 凭据存储与隐私
70
+
71
+ - **存储路径**:`<getAgentDir()>/devin-search/credentials.json`
72
+ - **文件权限**:采用 POSIX `0600` 严格权限模式。不读取 Pi 系统自带的 `auth.json`,与宿主其他凭据完全解耦。
73
+ - **配置持久化**:用户功能配置独立持久化于 `devin-search/settings.json`。
74
+
75
+ ---
76
+
77
+ ## 友情链接
78
+
79
+ [Linux.Do](https://linux.do) — 新的理想型社区
80
+
81
+ ---
82
+
83
+ ### License
84
+
85
+ [MIT](./LICENSE) — 所有源码、会话记录与凭证默认存储于用户本地,尊重代码主权与数据隐私。