opencode-search-plugin 1.1.0 → 2.0.0
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 -16
- package/README.zh-CN.md +18 -16
- package/index.ts +12 -11
- package/package.json +1 -1
- package/plugins/anysearch-search.ts +4 -1
- package/plugins/brave-search.ts +4 -1
- package/plugins/jina-search.ts +4 -1
- package/plugins/keenable-search.ts +4 -1
- package/plugins/linkup-search.ts +4 -1
- package/plugins/metaso-search.ts +4 -1
- package/plugins/querit-search.ts +4 -1
- package/plugins/serpapi-search.ts +4 -1
- package/plugins/serper-search.ts +4 -1
- package/plugins/youcom-search.ts +4 -1
package/README.md
CHANGED
|
@@ -14,12 +14,12 @@ This repository adds plugins for ten more of them, taking the pool from five pro
|
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
|
-
Three equivalent ways to install; pick one. **npm is recommended**: a version published to the registry is immutable, so a pinned `@
|
|
17
|
+
Three equivalent ways to install; pick one. **npm is recommended**: a version published to the registry is immutable, so a pinned `@2.0.0` always installs the same bytes, whereas a GitHub tag can in principle be moved by a maintainer to point at a different commit. The first two install the same complete package (all ten); use the third for one or two files only.
|
|
18
18
|
|
|
19
19
|
### 1. From npm (recommended)
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
# add @
|
|
22
|
+
# add @2.0.0 to pin
|
|
23
23
|
opencode plugin add opencode-search-plugin
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -35,7 +35,7 @@ or declare it in `opencode.json(c)`:
|
|
|
35
35
|
### 2. From GitHub
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
# add #
|
|
38
|
+
# add #v2.0.0 to pin
|
|
39
39
|
opencode plugin add github:guotree/opencode-search-plugin
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -74,7 +74,7 @@ Loading the package registers all ten, but a provider without a key never joins
|
|
|
74
74
|
"plugins": [
|
|
75
75
|
{
|
|
76
76
|
"package": "opencode-search-plugin",
|
|
77
|
-
"options": { "disable": ["serper", "serpapi", "youcom"] }
|
|
77
|
+
"options": { "disable": ["osp-serper", "osp-serpapi", "osp-youcom"] }
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
}
|
|
@@ -93,7 +93,7 @@ opencode plugin update github:guotree/opencode-search-plugin
|
|
|
93
93
|
opencode plugin update
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
The target is the specifier that was configured: an npm install is named by its package name, a GitHub install answers only to its `github:` form — naming it by its bare package name fails with `Plugin is not configured`. Run `opencode plugin check` first to see what is outdated. An install without a pinned version follows new releases; a pinned one — `@
|
|
96
|
+
The target is the specifier that was configured: an npm install is named by its package name, a GitHub install answers only to its `github:` form — naming it by its bare package name fails with `Plugin is not configured`. Run `opencode plugin check` first to see what is outdated. An install without a pinned version follows new releases; a pinned one — `@2.0.0` on npm, `#v2.0.0` on GitHub — stays on its pin until you re-run `plugin add` with a newer pin or edit the specifier in `opencode.json(c)`. A locally copied file is upgraded by copying the new version over the old one.
|
|
97
97
|
|
|
98
98
|
## Uninstall
|
|
99
99
|
|
|
@@ -123,22 +123,24 @@ Once keys are in place, pick how OpenCode chooses among them:
|
|
|
123
123
|
{ "websearch": { "provider": "random" } }
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
`random` spreads queries across every bound provider. Set it to a specific ID such as `"brave"` to pin one, or `false` to turn web search off.
|
|
126
|
+
`random` spreads queries across every bound provider. Set it to a specific ID such as `"osp-brave"` to pin one, or `false` to turn web search off.
|
|
127
127
|
|
|
128
128
|
## Providers
|
|
129
129
|
|
|
130
|
+
Every ID below carries an `osp-` prefix — this package's namespace. OpenCode's own providers register bare vendor names (`exa`, `tavily`), and a vendor's official plugin would do the same, so the prefix is what keeps those entries from colliding with ours — both in the websearch pool and in the `/connect` table, where credentials are keyed by integration ID. Use the prefixed form verbatim in `websearch.provider` and in `disable`.
|
|
131
|
+
|
|
130
132
|
| Provider | ID | Key (env / `/connect`) | Anonymous | Notes |
|
|
131
133
|
| --- | --- | --- | --- | --- |
|
|
132
|
-
| AnySearch | `anysearch` | `ANYSEARCH_API_KEY` | yes | Free tier per IP; intent router, `cn`/`intl` zones |
|
|
133
|
-
| Brave Search | `brave` | `BRAVE_SEARCH_API_KEY` | no | Independent index, 20 results max |
|
|
134
|
-
| Jina | `jina` | `JINA_API_KEY` | no | Page content is opt-in because it is token-billed |
|
|
135
|
-
| Keenable | `keenable` | `KEENABLE_API_KEY` | yes | 100,000 requests a month with a key; keyless tier is per IP |
|
|
136
|
-
| Linkup | `linkup` | `LINKUP_API_KEY` | no | `flash`/`fast`/`standard`/`deep` reasoning depth |
|
|
137
|
-
| Metaso | `metaso` | `METASO_API_KEY` | no | Billed per search, not per result |
|
|
138
|
-
| Querit | `querit` | `QUERIT_API_KEY` | no | Falls back to sentence matches when a snippet is missing |
|
|
139
|
-
| SerpApi | `serpapi` | `SERPAPI_API_KEY` | no | Google via SerpApi; also has its own free 1-hour server cache |
|
|
140
|
-
| Serper | `serper` | `SERPER_API_KEY` | no | Google via Serper; billed per query in credits |
|
|
141
|
-
| You.com | `youcom` | `YDC_API_KEY` | no | Web and news merged; extraction modes |
|
|
134
|
+
| AnySearch | `osp-anysearch` | `ANYSEARCH_API_KEY` | yes | Free tier per IP; intent router, `cn`/`intl` zones |
|
|
135
|
+
| Brave Search | `osp-brave` | `BRAVE_SEARCH_API_KEY` | no | Independent index, 20 results max |
|
|
136
|
+
| Jina | `osp-jina` | `JINA_API_KEY` | no | Page content is opt-in because it is token-billed |
|
|
137
|
+
| Keenable | `osp-keenable` | `KEENABLE_API_KEY` | yes | 100,000 requests a month with a key; keyless tier is per IP |
|
|
138
|
+
| Linkup | `osp-linkup` | `LINKUP_API_KEY` | no | `flash`/`fast`/`standard`/`deep` reasoning depth |
|
|
139
|
+
| Metaso | `osp-metaso` | `METASO_API_KEY` | no | Billed per search, not per result |
|
|
140
|
+
| Querit | `osp-querit` | `QUERIT_API_KEY` | no | Falls back to sentence matches when a snippet is missing |
|
|
141
|
+
| SerpApi | `osp-serpapi` | `SERPAPI_API_KEY` | no | Google via SerpApi; also has its own free 1-hour server cache |
|
|
142
|
+
| Serper | `osp-serper` | `SERPER_API_KEY` | no | Google via Serper; billed per query in credits |
|
|
143
|
+
| You.com | `osp-youcom` | `YDC_API_KEY` | no | Web and news merged; extraction modes |
|
|
142
144
|
|
|
143
145
|
## Configuration
|
|
144
146
|
|
package/README.zh-CN.md
CHANGED
|
@@ -14,12 +14,12 @@ OpenCode v2 内置了五个网页搜索 provider:`exa`、`firecrawl`、`parall
|
|
|
14
14
|
|
|
15
15
|
## 安装
|
|
16
16
|
|
|
17
|
-
三种方式等价,任选其一。**推荐 npm**:已发布到 registry 的版本不可变,固定 `@
|
|
17
|
+
三种方式等价,任选其一。**推荐 npm**:已发布到 registry 的版本不可变,固定 `@2.0.0` 后每次安装都拿到同一份字节;GitHub 的 tag 在理论上可以被维护者移动、指向别的 commit。前两种装的是同一个完整包(十个全有),只想用一两个就用第三种。
|
|
18
18
|
|
|
19
19
|
### 1. 从 npm 安装(推荐)
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
# 追加 @
|
|
22
|
+
# 追加 @2.0.0 可固定到该版本
|
|
23
23
|
opencode plugin add opencode-search-plugin
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -35,7 +35,7 @@ opencode plugin add opencode-search-plugin
|
|
|
35
35
|
### 2. 从 GitHub 安装
|
|
36
36
|
|
|
37
37
|
```sh
|
|
38
|
-
# 追加 #
|
|
38
|
+
# 追加 #v2.0.0 可固定到该 tag
|
|
39
39
|
opencode plugin add github:guotree/opencode-search-plugin
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -74,7 +74,7 @@ opencode plugin add github:guotree/opencode-search-plugin
|
|
|
74
74
|
"plugins": [
|
|
75
75
|
{
|
|
76
76
|
"package": "opencode-search-plugin",
|
|
77
|
-
"options": { "disable": ["serper", "serpapi", "youcom"] }
|
|
77
|
+
"options": { "disable": ["osp-serper", "osp-serpapi", "osp-youcom"] }
|
|
78
78
|
}
|
|
79
79
|
]
|
|
80
80
|
}
|
|
@@ -93,7 +93,7 @@ opencode plugin update github:guotree/opencode-search-plugin
|
|
|
93
93
|
opencode plugin update
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
升级目标用的是配置时的说明符:npm 安装用包名,GitHub 安装只认自己的 `github:` 形式——用裸包名会报 `Plugin is not configured`。先跑 `opencode plugin check` 查看有哪些过期。未固定版本的安装会跟上新版本;固定过的——npm 形式的 `@
|
|
96
|
+
升级目标用的是配置时的说明符:npm 安装用包名,GitHub 安装只认自己的 `github:` 形式——用裸包名会报 `Plugin is not configured`。先跑 `opencode plugin check` 查看有哪些过期。未固定版本的安装会跟上新版本;固定过的——npm 形式的 `@2.0.0`、GitHub 形式的 `#v2.0.0`——会停在原地,直到你用新 pin 重新执行 `plugin add`,或直接修改 `opencode.json(c)` 里的说明符。本地复制的文件则用新版本覆盖旧文件来升级。
|
|
97
97
|
|
|
98
98
|
## 卸载
|
|
99
99
|
|
|
@@ -123,22 +123,24 @@ AnySearch 和 Keenable 是例外。两家都有匿名层级,因此始终注册
|
|
|
123
123
|
{ "websearch": { "provider": "random" } }
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
`random` 会把查询分散到所有已绑定的 provider。填具体 ID(例如 `"brave"`)则固定用某一家,填 `false` 则完全关闭网页搜索。
|
|
126
|
+
`random` 会把查询分散到所有已绑定的 provider。填具体 ID(例如 `"osp-brave"`)则固定用某一家,填 `false` 则完全关闭网页搜索。
|
|
127
127
|
|
|
128
128
|
## 支持的服务
|
|
129
129
|
|
|
130
|
+
下表每个 ID 都带 `osp-` 前缀——这是本包的命名空间。OpenCode 内置 provider 用的是裸厂商名(`exa`、`tavily`),厂商自己的插件也会注册裸名(Keenable 就已经有一个),所以前缀是避免撞名的唯一保障:既避开搜索池里的重复,也避开 `/connect` 里按 integration ID 存凭据的那张表。在 `websearch.provider` 和 `disable` 里请原样使用带前缀的 ID。
|
|
131
|
+
|
|
130
132
|
| 服务 | ID | 密钥(环境变量 / `/connect`) | 匿名可用 | 说明 |
|
|
131
133
|
| --- | --- | --- | --- | --- |
|
|
132
|
-
| AnySearch | `anysearch` | `ANYSEARCH_API_KEY` | 是 | 按 IP 的免费额度;意图路由,`cn` / `intl` 分区 |
|
|
133
|
-
| Brave Search | `brave` | `BRAVE_SEARCH_API_KEY` | 否 | 独立索引,最多 20 条结果 |
|
|
134
|
-
| Jina | `jina` | `JINA_API_KEY` | 否 | 页面正文按 token 计费,因此默认不取 |
|
|
135
|
-
| Keenable | `keenable` | `KEENABLE_API_KEY` | 是 | 有 key 每月 100,000 次免费请求;无 key 层级按 IP 限速 |
|
|
136
|
-
| Linkup | `linkup` | `LINKUP_API_KEY` | 否 | `flash` / `fast` / `standard` / `deep` 四档推理深度 |
|
|
137
|
-
| Metaso | `metaso` | `METASO_API_KEY` | 否 | 按次搜索计费,不按结果条数 |
|
|
138
|
-
| Querit | `querit` | `QUERIT_API_KEY` | 否 | 摘要缺失时回退到句子级匹配 |
|
|
139
|
-
| SerpApi | `serpapi` | `SERPAPI_API_KEY` | 否 | 经 SerpApi 调用 Google;另有其自带的免费 1 小时服务端缓存 |
|
|
140
|
-
| Serper | `serper` | `SERPER_API_KEY` | 否 | 经 Serper 调用 Google;按查询消耗积分计费 |
|
|
141
|
-
| You.com | `youcom` | `YDC_API_KEY` | 否 | 网页与新闻结果合并;多种正文抽取模式 |
|
|
134
|
+
| AnySearch | `osp-anysearch` | `ANYSEARCH_API_KEY` | 是 | 按 IP 的免费额度;意图路由,`cn` / `intl` 分区 |
|
|
135
|
+
| Brave Search | `osp-brave` | `BRAVE_SEARCH_API_KEY` | 否 | 独立索引,最多 20 条结果 |
|
|
136
|
+
| Jina | `osp-jina` | `JINA_API_KEY` | 否 | 页面正文按 token 计费,因此默认不取 |
|
|
137
|
+
| Keenable | `osp-keenable` | `KEENABLE_API_KEY` | 是 | 有 key 每月 100,000 次免费请求;无 key 层级按 IP 限速 |
|
|
138
|
+
| Linkup | `osp-linkup` | `LINKUP_API_KEY` | 否 | `flash` / `fast` / `standard` / `deep` 四档推理深度 |
|
|
139
|
+
| Metaso | `osp-metaso` | `METASO_API_KEY` | 否 | 按次搜索计费,不按结果条数 |
|
|
140
|
+
| Querit | `osp-querit` | `QUERIT_API_KEY` | 否 | 摘要缺失时回退到句子级匹配 |
|
|
141
|
+
| SerpApi | `osp-serpapi` | `SERPAPI_API_KEY` | 否 | 经 SerpApi 调用 Google;另有其自带的免费 1 小时服务端缓存 |
|
|
142
|
+
| Serper | `osp-serper` | `SERPER_API_KEY` | 否 | 经 Serper 调用 Google;按查询消耗积分计费 |
|
|
143
|
+
| You.com | `osp-youcom` | `YDC_API_KEY` | 否 | 网页与新闻结果合并;多种正文抽取模式 |
|
|
142
144
|
|
|
143
145
|
## 配置
|
|
144
146
|
|
package/index.ts
CHANGED
|
@@ -22,19 +22,20 @@ type ProviderEffect = (ctx: Plugin.Context) => Effect.Effect<void, never, Scope.
|
|
|
22
22
|
*
|
|
23
23
|
* The key of each entry is the websearch provider ID -- the one that appears in
|
|
24
24
|
* `/api/websearch/provider`, in `websearch.provider`, and in the `disable`
|
|
25
|
-
* option below. Renaming one would strand existing configuration.
|
|
25
|
+
* option below. Renaming one would strand existing configuration. Each is
|
|
26
|
+
* prefixed `osp-` to namespace it to this package; see CONTRIBUTING.md.
|
|
26
27
|
*/
|
|
27
28
|
const PROVIDERS: ReadonlyArray<readonly [id: string, run: ProviderEffect]> = [
|
|
28
|
-
["anysearch", anysearch],
|
|
29
|
-
["brave", brave],
|
|
30
|
-
["jina", jina],
|
|
31
|
-
["keenable", keenable],
|
|
32
|
-
["linkup", linkup],
|
|
33
|
-
["metaso", metaso],
|
|
34
|
-
["querit", querit],
|
|
35
|
-
["serpapi", serpapi],
|
|
36
|
-
["serper", serper],
|
|
37
|
-
["youcom", youcom],
|
|
29
|
+
["osp-anysearch", anysearch],
|
|
30
|
+
["osp-brave", brave],
|
|
31
|
+
["osp-jina", jina],
|
|
32
|
+
["osp-keenable", keenable],
|
|
33
|
+
["osp-linkup", linkup],
|
|
34
|
+
["osp-metaso", metaso],
|
|
35
|
+
["osp-querit", querit],
|
|
36
|
+
["osp-serpapi", serpapi],
|
|
37
|
+
["osp-serper", serper],
|
|
38
|
+
["osp-youcom", youcom],
|
|
38
39
|
]
|
|
39
40
|
|
|
40
41
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-search-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Ten self-contained websearch provider plugins for OpenCode v2: AnySearch, Brave, Jina, Keenable, Linkup, Metaso, Querit, SerpApi, Serper and You.com.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,10 @@ const AnySearchResponse = Schema.Struct({
|
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
30
|
-
|
|
30
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
31
|
+
// vendor plugin's own entry are bare vendor names, so `anysearch` would collide
|
|
32
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
33
|
+
const ID = "osp-anysearch"
|
|
31
34
|
|
|
32
35
|
// AnySearch returns no publication date, so results carry an empty time record.
|
|
33
36
|
function toResult(item: {
|
package/plugins/brave-search.ts
CHANGED
|
@@ -21,7 +21,10 @@ const BraveResponse = Schema.Struct({
|
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
24
|
-
|
|
24
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
25
|
+
// vendor plugin's own entry are bare vendor names, so `brave` would collide
|
|
26
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
27
|
+
const ID = "osp-brave"
|
|
25
28
|
|
|
26
29
|
function envInt(name: string, fallback: number): number {
|
|
27
30
|
const raw = (process.env[name] ?? "").trim()
|
package/plugins/jina-search.ts
CHANGED
|
@@ -21,7 +21,10 @@ const JinaResponse = Schema.Struct({
|
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
24
|
-
|
|
24
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
25
|
+
// vendor plugin's own entry are bare vendor names, so `jina` would collide
|
|
26
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
27
|
+
const ID = "osp-jina"
|
|
25
28
|
|
|
26
29
|
// Jina returns no publication date on search hits, so results carry an empty
|
|
27
30
|
// time record rather than a parsed one.
|
|
@@ -23,7 +23,10 @@ const KeenableResponse = Schema.Struct({
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
26
|
-
|
|
26
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
27
|
+
// vendor plugin's own entry are bare vendor names, so `keenable` would collide
|
|
28
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
29
|
+
const ID = "osp-keenable"
|
|
27
30
|
|
|
28
31
|
// Keenable returns ISO 8601 timestamps, which the parser below accepts as-is.
|
|
29
32
|
// See https://serpapi.com/blog/how-to-parse-dates-from-google-search/
|
package/plugins/linkup-search.ts
CHANGED
|
@@ -18,7 +18,10 @@ const LinkupResponse = Schema.Struct({
|
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
21
|
-
|
|
21
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
22
|
+
// vendor plugin's own entry are bare vendor names, so `linkup` would collide
|
|
23
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
24
|
+
const ID = "osp-linkup"
|
|
22
25
|
|
|
23
26
|
function toResult(item: typeof LinkupResult.Type) {
|
|
24
27
|
return {
|
package/plugins/metaso-search.ts
CHANGED
|
@@ -16,7 +16,10 @@ const MetasoResponse = Schema.Struct({
|
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
19
|
-
|
|
19
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
20
|
+
// vendor plugin's own entry are bare vendor names, so `metaso` would collide
|
|
21
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
22
|
+
const ID = "osp-metaso"
|
|
20
23
|
|
|
21
24
|
function envInt(name: string, fallback: number): number {
|
|
22
25
|
const raw = (process.env[name] ?? "").trim()
|
package/plugins/querit-search.ts
CHANGED
|
@@ -24,7 +24,10 @@ const QueritResponse = Schema.Struct({
|
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
27
|
-
|
|
27
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
28
|
+
// vendor plugin's own entry are bare vendor names, so `querit` would collide
|
|
29
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
30
|
+
const ID = "osp-querit"
|
|
28
31
|
|
|
29
32
|
// search_id is documented as both a string and an integer, so read it loosely
|
|
30
33
|
// rather than letting a strict decode reject an otherwise good response.
|
|
@@ -19,7 +19,10 @@ const SerpApiResponse = Schema.Struct({
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
22
|
-
|
|
22
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
23
|
+
// vendor plugin's own entry are bare vendor names, so `serpapi` would collide
|
|
24
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
25
|
+
const ID = "osp-serpapi"
|
|
23
26
|
|
|
24
27
|
function envInt(name: string, fallback: number): number {
|
|
25
28
|
const raw = (process.env[name] ?? "").trim()
|
package/plugins/serper-search.ts
CHANGED
|
@@ -19,7 +19,10 @@ const SerperResponse = Schema.Struct({
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
22
|
-
|
|
22
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
23
|
+
// vendor plugin's own entry are bare vendor names, so `serper` would collide
|
|
24
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
25
|
+
const ID = "osp-serper"
|
|
23
26
|
|
|
24
27
|
function envInt(name: string, fallback: number): number {
|
|
25
28
|
const raw = (process.env[name] ?? "").trim()
|
package/plugins/youcom-search.ts
CHANGED
|
@@ -40,7 +40,10 @@ const YouResponse = Schema.Struct({
|
|
|
40
40
|
type YouHit = typeof YouResult.Type
|
|
41
41
|
|
|
42
42
|
// The /connect integration ID, and the websearch provider ID it binds to.
|
|
43
|
-
|
|
43
|
+
// The `osp-` prefix is this package's namespace: OpenCode's built-ins and a
|
|
44
|
+
// vendor plugin's own entry are bare vendor names, so `youcom` would collide
|
|
45
|
+
// with them, and with the opencode.db row keyed by integration ID.
|
|
46
|
+
const ID = "osp-youcom"
|
|
44
47
|
|
|
45
48
|
function envInt(name: string, fallback: number): number {
|
|
46
49
|
const raw = (process.env[name] ?? "").trim()
|