opencode-search 1.0.0-next.1 → 1.0.0-next.11
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 +39 -24
- package/REMOVED.md +13 -3
- package/dist/package.json +18 -20
- package/dist/search.js +1 -1
- package/dist/src/providers/gnews-search.d.ts +1 -1
- package/dist/src/providers/gnews-search.d.ts.map +1 -1
- package/dist/src/providers/gnews-search.js +5 -3
- package/dist/src/providers/gnews-search.js.map +1 -1
- package/dist/src/providers/rfc-search.d.ts +9 -0
- package/dist/src/providers/rfc-search.d.ts.map +1 -0
- package/dist/src/providers/rfc-search.js +38 -0
- package/dist/src/providers/rfc-search.js.map +1 -0
- package/dist/src/providers/w3c-search.d.ts +6 -0
- package/dist/src/providers/w3c-search.d.ts.map +1 -0
- package/dist/src/providers/w3c-search.js +42 -0
- package/dist/src/providers/w3c-search.js.map +1 -0
- package/dist/src/providers/whatwg-search.d.ts +8 -0
- package/dist/src/providers/whatwg-search.d.ts.map +1 -0
- package/dist/src/providers/whatwg-search.js +31 -0
- package/dist/src/providers/whatwg-search.js.map +1 -0
- package/dist/src/renderers.d.ts +6 -2
- package/dist/src/renderers.d.ts.map +1 -1
- package/dist/src/renderers.js +14 -8
- package/dist/src/renderers.js.map +1 -1
- package/dist/src/search.d.ts +3 -1
- package/dist/src/search.d.ts.map +1 -1
- package/dist/src/search.js +162 -68
- package/dist/src/search.js.map +1 -1
- package/package.json +18 -20
- package/search.ts +22 -0
- package/src/cache.test.ts +14 -0
- package/src/cache.ts +61 -0
- package/src/format.test.ts +175 -0
- package/src/format.ts +72 -0
- package/src/html.ts +39 -0
- package/src/normalize-blurb.test.ts +67 -0
- package/src/normalize-blurb.ts +22 -0
- package/src/opencode/notify.ts +16 -0
- package/src/parse-results.test.ts +75 -0
- package/src/parse-results.ts +22 -0
- package/src/providers/brave-search.ts +39 -0
- package/src/providers/bsky-search.test.ts +16 -0
- package/src/providers/bsky-search.ts +88 -0
- package/src/providers/ddg-search.test.ts +15 -0
- package/src/providers/ddg-search.ts +117 -0
- package/src/providers/gnews-search.ts +72 -0
- package/src/providers/mdn-search.test.ts +17 -0
- package/src/providers/mdn-search.ts +83 -0
- package/src/providers/rfc-search.test.ts +31 -0
- package/src/providers/rfc-search.ts +61 -0
- package/src/providers/w3c-search.test.ts +22 -0
- package/src/providers/w3c-search.ts +67 -0
- package/src/providers/whatwg-search.test.ts +21 -0
- package/src/providers/whatwg-search.ts +55 -0
- package/src/providers/wiki-search.test.ts +16 -0
- package/src/providers/wiki-search.ts +72 -0
- package/src/renderers.test.ts +263 -0
- package/src/renderers.ts +62 -0
- package/src/safe.test.ts +87 -0
- package/src/safe.ts +27 -0
- package/src/search.ts +401 -0
- package/src/strategies.test.ts +92 -0
- package/src/strategies.ts +62 -0
- package/src/user-agent.ts +3 -0
- package/src/v1-message.test.ts +17 -0
- package/src/v1-message.ts +10 -0
- package/dist/src/providers/standard-search.d.ts +0 -18
- package/dist/src/providers/standard-search.d.ts.map +0 -1
- package/dist/src/providers/standard-search.js +0 -61
- package/dist/src/providers/standard-search.js.map +0 -1
package/dist/src/search.js
CHANGED
|
@@ -5,15 +5,18 @@ import { bskySearch } from "./providers/bsky-search.js";
|
|
|
5
5
|
import { ddgSearch } from "./providers/ddg-search.js";
|
|
6
6
|
import { gnewsSearch } from "./providers/gnews-search.js";
|
|
7
7
|
import { mdnSearch } from "./providers/mdn-search.js";
|
|
8
|
-
import {
|
|
8
|
+
import { rfcSearch } from "./providers/rfc-search.js";
|
|
9
|
+
import { w3cSearch } from "./providers/w3c-search.js";
|
|
10
|
+
import { whatwgSearch } from "./providers/whatwg-search.js";
|
|
9
11
|
import { wikiSearch } from "./providers/wiki-search.js";
|
|
10
|
-
import { renderBskyPost, renderDdgResult, renderGnewsItem, renderMdnDoc,
|
|
12
|
+
import { renderBskyPost, renderDdgResult, renderGnewsItem, renderMdnDoc, renderRfc, renderW3c, renderWhatwg, renderWebResult, renderWikiPage, } from "./renderers.js";
|
|
11
13
|
import { safeAsync } from "./safe.js";
|
|
12
14
|
const postResult = async (context, ctx, text) => {
|
|
13
15
|
await safeAsync(() => sendResult({ context, sessionID: ctx.sessionID, text }));
|
|
14
16
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
// No `output` field: declaring one without a matching output schema in the tool definition makes
|
|
18
|
+
// OpenCode reject the result.
|
|
19
|
+
const textOutput = (text) => ({
|
|
17
20
|
content: [{ type: 'text', text }],
|
|
18
21
|
});
|
|
19
22
|
const isRecord = (value) => (typeof value === 'object' && value !== null && !Array.isArray(value));
|
|
@@ -38,14 +41,18 @@ const queryArg = {
|
|
|
38
41
|
additionalProperties: false,
|
|
39
42
|
};
|
|
40
43
|
export const createDdgSearchTool = (context) => ({
|
|
41
|
-
name: '
|
|
42
|
-
description:
|
|
44
|
+
name: 'ddg_search',
|
|
45
|
+
description: [
|
|
46
|
+
'Search the web with DuckDuckGo when you need current information from the internet.',
|
|
47
|
+
'Use for general web queries: products, people, events, how-tos, anything not covered by a more specific tool.',
|
|
48
|
+
'Returns titles, URLs and snippets.',
|
|
49
|
+
].join(' '),
|
|
43
50
|
input: queryArg,
|
|
44
51
|
async execute(input, ctx) {
|
|
45
52
|
const query = stringField(input, 'query');
|
|
46
53
|
const { data, error } = await safeAsync(() => ddgSearch(query));
|
|
47
54
|
if (error)
|
|
48
|
-
return textOutput(
|
|
55
|
+
return textOutput('DuckDuckGo search failed: ' + error.message);
|
|
49
56
|
const formatted = formatResults({
|
|
50
57
|
label: 'DuckDuckGo results',
|
|
51
58
|
items: data,
|
|
@@ -53,18 +60,22 @@ export const createDdgSearchTool = (context) => ({
|
|
|
53
60
|
renderItem: renderDdgResult,
|
|
54
61
|
});
|
|
55
62
|
await postResult(context, ctx, formatted);
|
|
56
|
-
return textOutput(
|
|
63
|
+
return textOutput(formatted);
|
|
57
64
|
},
|
|
58
65
|
});
|
|
59
66
|
export const createBraveSearchTool = (context) => ({
|
|
60
|
-
name: '
|
|
61
|
-
description:
|
|
67
|
+
name: 'brave_search',
|
|
68
|
+
description: [
|
|
69
|
+
'Search the web with Brave when you need current information from the internet.',
|
|
70
|
+
'The most reliable general web search here; prefer it over ddg_search when either would do.',
|
|
71
|
+
'Returns titles, URLs and snippets.',
|
|
72
|
+
].join(' '),
|
|
62
73
|
input: queryArg,
|
|
63
74
|
async execute(input, ctx) {
|
|
64
75
|
const query = stringField(input, 'query');
|
|
65
76
|
const { data, error } = await safeAsync(() => braveSearch(query));
|
|
66
77
|
if (error)
|
|
67
|
-
return textOutput(
|
|
78
|
+
return textOutput('Brave search failed: ' + error.message);
|
|
68
79
|
const formatted = formatResults({
|
|
69
80
|
label: 'Brave results',
|
|
70
81
|
items: data,
|
|
@@ -72,14 +83,15 @@ export const createBraveSearchTool = (context) => ({
|
|
|
72
83
|
renderItem: renderWebResult,
|
|
73
84
|
});
|
|
74
85
|
await postResult(context, ctx, formatted);
|
|
75
|
-
return textOutput(
|
|
86
|
+
return textOutput(formatted);
|
|
76
87
|
},
|
|
77
88
|
});
|
|
78
89
|
export const createBskySearchTool = (context) => ({
|
|
79
|
-
name: '
|
|
90
|
+
name: 'bsky_search',
|
|
80
91
|
description: [
|
|
81
|
-
'Search Bluesky posts
|
|
82
|
-
'
|
|
92
|
+
'Search Bluesky posts for what people are saying about a topic right now.',
|
|
93
|
+
'Use for public reaction, discussion and opinion, not for documentation or reference material.',
|
|
94
|
+
'Returns author handle, post text, and like, repost and reply counts.',
|
|
83
95
|
].join(' '),
|
|
84
96
|
input: {
|
|
85
97
|
type: 'object',
|
|
@@ -97,7 +109,7 @@ export const createBskySearchTool = (context) => ({
|
|
|
97
109
|
const sort = stringField(input, 'sort') || undefined;
|
|
98
110
|
const { data, error } = await safeAsync(() => (bskySearch({ query, limit, sort })));
|
|
99
111
|
if (error)
|
|
100
|
-
return textOutput(
|
|
112
|
+
return textOutput('Bluesky search failed: ' + error.message);
|
|
101
113
|
const formatted = formatResults({
|
|
102
114
|
label: 'Bluesky results',
|
|
103
115
|
items: data.posts,
|
|
@@ -107,48 +119,16 @@ export const createBskySearchTool = (context) => ({
|
|
|
107
119
|
renderItem: renderBskyPost,
|
|
108
120
|
});
|
|
109
121
|
await postResult(context, ctx, formatted);
|
|
110
|
-
return textOutput(
|
|
122
|
+
return textOutput(formatted);
|
|
111
123
|
},
|
|
112
124
|
});
|
|
113
|
-
export const
|
|
114
|
-
name: '
|
|
125
|
+
export const createWikiSearchTool = (context) => ({
|
|
126
|
+
name: 'wiki_search',
|
|
115
127
|
description: [
|
|
116
|
-
'
|
|
117
|
-
'
|
|
128
|
+
'Look up a subject on Wikipedia for background, definitions and general reference.',
|
|
129
|
+
'Use when the question is about what something IS rather than what is happening with it.',
|
|
130
|
+
'Returns page titles, descriptions and excerpts.',
|
|
118
131
|
].join(' '),
|
|
119
|
-
input: {
|
|
120
|
-
type: 'object',
|
|
121
|
-
properties: {
|
|
122
|
-
query: { type: 'string', description: 'The search query' },
|
|
123
|
-
limit: { type: 'number', description: 'Maximum number of results to return' },
|
|
124
|
-
offset: { type: 'number', description: 'Number of results to skip' },
|
|
125
|
-
},
|
|
126
|
-
required: ['query'],
|
|
127
|
-
additionalProperties: false,
|
|
128
|
-
},
|
|
129
|
-
async execute(input, ctx) {
|
|
130
|
-
const query = stringField(input, 'query');
|
|
131
|
-
const limit = numberField(input, 'limit');
|
|
132
|
-
const offset = numberField(input, 'offset');
|
|
133
|
-
const { data, error } = await safeAsync(() => (standardSearch({ query, limit, offset })));
|
|
134
|
-
if (error)
|
|
135
|
-
return textOutput({ error: error.message }, 'Standard.site search failed: ' + error.message);
|
|
136
|
-
const total = Number(data.totalResults) || data.documents.length;
|
|
137
|
-
const formatted = formatResults({
|
|
138
|
-
label: 'Standard.site results',
|
|
139
|
-
items: data.documents,
|
|
140
|
-
total,
|
|
141
|
-
limit,
|
|
142
|
-
offset,
|
|
143
|
-
renderItem: renderStandardDoc,
|
|
144
|
-
});
|
|
145
|
-
await postResult(context, ctx, formatted);
|
|
146
|
-
return textOutput({ results: data.documents, total }, 'Search results displayed in chat.');
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
export const createWikiSearchTool = (context) => ({
|
|
150
|
-
name: 'wiki-search',
|
|
151
|
-
description: 'Search Wikipedia articles. Returns page titles, descriptions, and excerpts.',
|
|
152
132
|
input: {
|
|
153
133
|
type: 'object',
|
|
154
134
|
properties: {
|
|
@@ -163,7 +143,7 @@ export const createWikiSearchTool = (context) => ({
|
|
|
163
143
|
const limit = numberField(input, 'limit');
|
|
164
144
|
const { data, error } = await safeAsync(() => (wikiSearch({ query, limit })));
|
|
165
145
|
if (error)
|
|
166
|
-
return textOutput(
|
|
146
|
+
return textOutput('Wikipedia search failed: ' + error.message);
|
|
167
147
|
const formatted = formatResults({
|
|
168
148
|
label: 'Wikipedia results',
|
|
169
149
|
items: data.pages,
|
|
@@ -173,22 +153,31 @@ export const createWikiSearchTool = (context) => ({
|
|
|
173
153
|
renderItem: renderWikiPage,
|
|
174
154
|
});
|
|
175
155
|
await postResult(context, ctx, formatted);
|
|
176
|
-
return textOutput(
|
|
156
|
+
return textOutput(formatted);
|
|
177
157
|
},
|
|
178
158
|
});
|
|
179
159
|
export const createGnewsSearchTool = (context) => ({
|
|
180
|
-
name: '
|
|
160
|
+
name: 'gnews_search',
|
|
181
161
|
description: [
|
|
182
|
-
'Search Google News for recent
|
|
162
|
+
'Search Google News for recent news coverage of a topic.',
|
|
183
163
|
'News and tech media only — not general web search, and not documentation.',
|
|
184
|
-
'Links are news.google.com redirect URLs, not publisher URLs.',
|
|
164
|
+
'Links are news.google.com redirect URLs that only open in a browser, not publisher URLs.',
|
|
185
165
|
].join(' '),
|
|
186
|
-
input:
|
|
166
|
+
input: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
properties: {
|
|
169
|
+
query: { type: 'string', description: 'The search query' },
|
|
170
|
+
limit: { type: 'number', description: 'Maximum number of results to return (default 20)' },
|
|
171
|
+
},
|
|
172
|
+
required: ['query'],
|
|
173
|
+
additionalProperties: false,
|
|
174
|
+
},
|
|
187
175
|
async execute(input, ctx) {
|
|
188
176
|
const query = stringField(input, 'query');
|
|
189
|
-
const
|
|
177
|
+
const limit = numberField(input, 'limit');
|
|
178
|
+
const { data, error } = await safeAsync(() => gnewsSearch(query, limit));
|
|
190
179
|
if (error)
|
|
191
|
-
return textOutput(
|
|
180
|
+
return textOutput('Google News search failed: ' + error.message);
|
|
192
181
|
const formatted = formatResults({
|
|
193
182
|
label: 'Google News results',
|
|
194
183
|
items: data,
|
|
@@ -196,12 +185,16 @@ export const createGnewsSearchTool = (context) => ({
|
|
|
196
185
|
renderItem: renderGnewsItem,
|
|
197
186
|
});
|
|
198
187
|
await postResult(context, ctx, formatted);
|
|
199
|
-
return textOutput(
|
|
188
|
+
return textOutput(formatted);
|
|
200
189
|
},
|
|
201
190
|
});
|
|
202
191
|
export const createMdnSearchTool = (context) => ({
|
|
203
|
-
name: '
|
|
204
|
-
description:
|
|
192
|
+
name: 'mdn_search',
|
|
193
|
+
description: [
|
|
194
|
+
'Look up web platform documentation on MDN: JavaScript, CSS, HTML, and browser APIs.',
|
|
195
|
+
'Use for how a web API behaves, its syntax, parameters or browser support.',
|
|
196
|
+
'Returns documentation pages with titles, URLs and summaries.',
|
|
197
|
+
].join(' '),
|
|
205
198
|
input: {
|
|
206
199
|
type: 'object',
|
|
207
200
|
properties: {
|
|
@@ -218,7 +211,7 @@ export const createMdnSearchTool = (context) => ({
|
|
|
218
211
|
const page = numberField(input, 'page');
|
|
219
212
|
const { data, error } = await safeAsync(() => (mdnSearch({ query, limit, page })));
|
|
220
213
|
if (error)
|
|
221
|
-
return textOutput(
|
|
214
|
+
return textOutput('MDN search failed: ' + error.message);
|
|
222
215
|
const formatted = formatResults({
|
|
223
216
|
label: 'MDN Web Docs results',
|
|
224
217
|
items: data.documents,
|
|
@@ -227,7 +220,106 @@ export const createMdnSearchTool = (context) => ({
|
|
|
227
220
|
renderItem: renderMdnDoc,
|
|
228
221
|
});
|
|
229
222
|
await postResult(context, ctx, formatted);
|
|
230
|
-
return textOutput(
|
|
223
|
+
return textOutput(formatted);
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
export const createRfcSearchTool = (context) => ({
|
|
227
|
+
name: 'rfc_search',
|
|
228
|
+
description: [
|
|
229
|
+
'Look up an IETF RFC by number or title.',
|
|
230
|
+
'Accepts a number like 9421, RFC9421 or \'rfc 9421\' for a direct lookup, or words from the title to search.',
|
|
231
|
+
'Use for internet protocol specifications: HTTP, TCP, TLS, DNS, email, and so on.',
|
|
232
|
+
'Returns the RFC number, title, date, abstract, and a link to the full text.',
|
|
233
|
+
].join(' '),
|
|
234
|
+
input: {
|
|
235
|
+
type: 'object',
|
|
236
|
+
properties: {
|
|
237
|
+
query: { type: 'string', description: "An RFC number like 9421 or 'RFC9421', or words from the title" },
|
|
238
|
+
limit: { type: 'number', description: 'Maximum number of results to return (default 20)' },
|
|
239
|
+
},
|
|
240
|
+
required: ['query'],
|
|
241
|
+
additionalProperties: false,
|
|
242
|
+
},
|
|
243
|
+
async execute(input, ctx) {
|
|
244
|
+
const query = stringField(input, 'query');
|
|
245
|
+
const limit = numberField(input, 'limit');
|
|
246
|
+
const { data, error } = await safeAsync(() => rfcSearch(query, limit));
|
|
247
|
+
if (error)
|
|
248
|
+
return textOutput('RFC search failed: ' + error.message);
|
|
249
|
+
const formatted = formatResults({
|
|
250
|
+
label: 'RFC results',
|
|
251
|
+
items: data,
|
|
252
|
+
total: data.length,
|
|
253
|
+
renderItem: renderRfc,
|
|
254
|
+
});
|
|
255
|
+
await postResult(context, ctx, formatted);
|
|
256
|
+
return textOutput(formatted);
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
export const createW3cSearchTool = (context) => ({
|
|
260
|
+
name: 'w3c_search',
|
|
261
|
+
description: [
|
|
262
|
+
'Look up a W3C specification by words in its title.',
|
|
263
|
+
'Use for web standards W3C publishes: CSS, WCAG accessibility, SVG, WebRTC, and similar.',
|
|
264
|
+
'Matches titles only, so query the spec name rather than a concept inside it.',
|
|
265
|
+
'Returns the specification title and URL.',
|
|
266
|
+
].join(' '),
|
|
267
|
+
input: {
|
|
268
|
+
type: 'object',
|
|
269
|
+
properties: {
|
|
270
|
+
query: { type: 'string', description: 'The search query' },
|
|
271
|
+
limit: { type: 'number', description: 'Maximum number of results to return (default 20)' },
|
|
272
|
+
},
|
|
273
|
+
required: ['query'],
|
|
274
|
+
additionalProperties: false,
|
|
275
|
+
},
|
|
276
|
+
async execute(input, ctx) {
|
|
277
|
+
const query = stringField(input, 'query');
|
|
278
|
+
const limit = numberField(input, 'limit');
|
|
279
|
+
const { data, error } = await safeAsync(() => w3cSearch(query, limit));
|
|
280
|
+
if (error)
|
|
281
|
+
return textOutput('W3C search failed: ' + error.message);
|
|
282
|
+
const formatted = formatResults({
|
|
283
|
+
label: 'W3C results',
|
|
284
|
+
items: data,
|
|
285
|
+
total: data.length,
|
|
286
|
+
renderItem: renderW3c,
|
|
287
|
+
});
|
|
288
|
+
await postResult(context, ctx, formatted);
|
|
289
|
+
return textOutput(formatted);
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
export const createWhatwgSearchTool = (context) => ({
|
|
293
|
+
name: 'whatwg_search',
|
|
294
|
+
description: [
|
|
295
|
+
'Look up a WHATWG living standard such as HTML, DOM, Fetch, URL or Streams.',
|
|
296
|
+
'Use for the current web platform specs WHATWG maintains, which supersede older W3C versions.',
|
|
297
|
+
'There are only 27 standards, so expect few results.',
|
|
298
|
+
'Returns the standard name, URL and description.',
|
|
299
|
+
].join(' '),
|
|
300
|
+
input: {
|
|
301
|
+
type: 'object',
|
|
302
|
+
properties: {
|
|
303
|
+
query: { type: 'string', description: 'The search query' },
|
|
304
|
+
limit: { type: 'number', description: 'Maximum number of results to return (default 20)' },
|
|
305
|
+
},
|
|
306
|
+
required: ['query'],
|
|
307
|
+
additionalProperties: false,
|
|
308
|
+
},
|
|
309
|
+
async execute(input, ctx) {
|
|
310
|
+
const query = stringField(input, 'query');
|
|
311
|
+
const limit = numberField(input, 'limit');
|
|
312
|
+
const { data, error } = await safeAsync(() => whatwgSearch(query, limit));
|
|
313
|
+
if (error)
|
|
314
|
+
return textOutput('WHATWG search failed: ' + error.message);
|
|
315
|
+
const formatted = formatResults({
|
|
316
|
+
label: 'WHATWG results',
|
|
317
|
+
items: data,
|
|
318
|
+
total: data.length,
|
|
319
|
+
renderItem: renderWhatwg,
|
|
320
|
+
});
|
|
321
|
+
await postResult(context, ctx, formatted);
|
|
322
|
+
return textOutput(formatted);
|
|
231
323
|
},
|
|
232
324
|
});
|
|
233
325
|
export const createSearchTools = (context) => [
|
|
@@ -236,7 +328,9 @@ export const createSearchTools = (context) => [
|
|
|
236
328
|
createDdgSearchTool(context),
|
|
237
329
|
createGnewsSearchTool(context),
|
|
238
330
|
createMdnSearchTool(context),
|
|
239
|
-
|
|
331
|
+
createRfcSearchTool(context),
|
|
332
|
+
createW3cSearchTool(context),
|
|
333
|
+
createWhatwgSearchTool(context),
|
|
240
334
|
createWikiSearchTool(context),
|
|
241
335
|
];
|
|
242
336
|
//# sourceMappingURL=search.js.map
|
package/dist/src/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,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SAAS,CAAC,CAAA;IAC9B,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAuB,EAAe,EAAE,CAAC;IACzE,qBAAqB,CAAC,OAAO,CAAC;IAC9B,oBAAoB,CAAC,OAAO,CAAC;IAC7B,mBAAmB,CAAC,OAAO,CAAC;IAC5B,qBAAqB,CAAC,OAAO,CAAC;IAC9B,mBAAmB,CAAC,OAAO,CAAC;IAC5B,mBAAmB,CAAC,OAAO,CAAC;IAC5B,mBAAmB,CAAC,OAAO,CAAC;IAC5B,sBAAsB,CAAC,OAAO,CAAC;IAC/B,oBAAoB,CAAC,OAAO,CAAC;CAC9B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-search",
|
|
3
|
-
"version": "1.0.0-next.
|
|
4
|
-
"description": "OpenCode plugin that provides web search tools using DuckDuckGo, Brave, Google News, Wikipedia, Bluesky,
|
|
3
|
+
"version": "1.0.0-next.11",
|
|
4
|
+
"description": "OpenCode plugin that provides web search tools using DuckDuckGo, Brave, Google News, Wikipedia, Bluesky, MDN Web Docs, and the IETF, W3C and WHATWG specifications.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"atproto",
|
|
7
|
+
"bluesky",
|
|
8
|
+
"brave",
|
|
9
|
+
"duckduckgo",
|
|
10
|
+
"google-news",
|
|
11
|
+
"ietf",
|
|
12
|
+
"mdn",
|
|
6
13
|
"opencode",
|
|
7
14
|
"opencode-plugin",
|
|
8
15
|
"plugin",
|
|
16
|
+
"rfc",
|
|
9
17
|
"search",
|
|
18
|
+
"specifications",
|
|
19
|
+
"w3c",
|
|
10
20
|
"web-search",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"google-news",
|
|
14
|
-
"wikipedia",
|
|
15
|
-
"mdn",
|
|
16
|
-
"bluesky",
|
|
17
|
-
"atproto",
|
|
18
|
-
"standard-site"
|
|
21
|
+
"whatwg",
|
|
22
|
+
"wikipedia"
|
|
19
23
|
],
|
|
20
24
|
"homepage": "https://github.com/whaaaley/opencode-search#readme",
|
|
21
25
|
"bugs": {
|
|
@@ -38,6 +42,8 @@
|
|
|
38
42
|
"types": "./dist/search.d.ts",
|
|
39
43
|
"files": [
|
|
40
44
|
"dist/",
|
|
45
|
+
"src/",
|
|
46
|
+
"search.ts",
|
|
41
47
|
"README.md",
|
|
42
48
|
"REMOVED.md",
|
|
43
49
|
"LICENSE"
|
|
@@ -45,26 +51,18 @@
|
|
|
45
51
|
"scripts": {
|
|
46
52
|
"build": "npm run clean && tsc",
|
|
47
53
|
"clean": "rm -rf dist",
|
|
48
|
-
"
|
|
54
|
+
"prepare": "npm run build",
|
|
49
55
|
"test": "bun test",
|
|
50
56
|
"typecheck": "tsc --noEmit"
|
|
51
57
|
},
|
|
52
58
|
"dependencies": {
|
|
59
|
+
"@opencode/plugin": "2.0.10",
|
|
53
60
|
"jsdom": "26.1.0",
|
|
54
61
|
"zod": "4.1.8"
|
|
55
62
|
},
|
|
56
63
|
"devDependencies": {
|
|
57
|
-
"@opencode/plugin": "2.0.10",
|
|
58
64
|
"@types/bun": "1.3.9",
|
|
59
65
|
"@types/jsdom": "27.0.0",
|
|
60
66
|
"typescript": "5.9.3"
|
|
61
|
-
},
|
|
62
|
-
"peerDependencies": {
|
|
63
|
-
"@opencode/plugin": ">=2.0.0"
|
|
64
|
-
},
|
|
65
|
-
"peerDependenciesMeta": {
|
|
66
|
-
"@opencode/plugin": {
|
|
67
|
-
"optional": true
|
|
68
|
-
}
|
|
69
67
|
}
|
|
70
68
|
}
|
package/search.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createSearchTools } from './src/search.ts'
|
|
2
|
+
import { safeAsync } from './src/safe.ts'
|
|
3
|
+
import { V1_MESSAGE } from './src/v1-message.ts'
|
|
4
|
+
|
|
5
|
+
// Under OpenCode 1 this package is absent or exports no Plugin.define.
|
|
6
|
+
// A dynamic import makes that catchable, so the failure can be a message instead of a stack trace.
|
|
7
|
+
const { data: plugin, error } = await safeAsync(() => import('@opencode/plugin'))
|
|
8
|
+
|
|
9
|
+
if (error || typeof plugin.Plugin?.define !== 'function') {
|
|
10
|
+
throw new Error(V1_MESSAGE, { cause: error ?? new Error('Plugin.define is not exported') })
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default plugin.Plugin.define({
|
|
14
|
+
id: 'opencode-search',
|
|
15
|
+
setup: async (ctx) => {
|
|
16
|
+
await ctx.tool.transform((tools) => {
|
|
17
|
+
for (const definition of createSearchTools(ctx)) {
|
|
18
|
+
tools.add(definition)
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
},
|
|
22
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test'
|
|
2
|
+
import { get, set } from './cache.ts'
|
|
3
|
+
|
|
4
|
+
describe('cache', () => {
|
|
5
|
+
it('stores and retrieves data', async () => {
|
|
6
|
+
const testKey = 'test:cache-key'
|
|
7
|
+
const testData = { foo: 'bar', nested: { value: 123 } }
|
|
8
|
+
|
|
9
|
+
await set(testKey, testData)
|
|
10
|
+
const result = await get(testKey)
|
|
11
|
+
|
|
12
|
+
expect(result).toEqual(testData)
|
|
13
|
+
})
|
|
14
|
+
})
|
package/src/cache.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'node:fs/promises'
|
|
2
|
+
import { dirname, join } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import { safe, safeAsync } from './safe.ts'
|
|
5
|
+
|
|
6
|
+
const CACHE_FILE = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '.cache')
|
|
7
|
+
const CACHE_DURATION = 7 * 24 * 60 * 60 * 1000 // 7 days
|
|
8
|
+
|
|
9
|
+
type CacheEntry = {
|
|
10
|
+
data: unknown
|
|
11
|
+
timestamp: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type CacheStore = Record<string, CacheEntry>
|
|
15
|
+
|
|
16
|
+
let store: CacheStore = {}
|
|
17
|
+
let loaded = false
|
|
18
|
+
|
|
19
|
+
const loadCache = async () => {
|
|
20
|
+
if (loaded) return
|
|
21
|
+
|
|
22
|
+
const { data } = await safeAsync(() => readFile(CACHE_FILE, 'utf-8'))
|
|
23
|
+
|
|
24
|
+
if (data) {
|
|
25
|
+
const { data: parsed } = safe(() => JSON.parse(data) as CacheStore)
|
|
26
|
+
store = parsed ?? {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
loaded = true
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const saveCache = async () => {
|
|
33
|
+
await writeFile(CACHE_FILE, JSON.stringify(store, null, 2))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const get = async <T = unknown>(key: string): Promise<T | null> => {
|
|
37
|
+
await loadCache()
|
|
38
|
+
|
|
39
|
+
const entry = store[key]
|
|
40
|
+
if (!entry) return null
|
|
41
|
+
|
|
42
|
+
const age = Date.now() - entry.timestamp
|
|
43
|
+
if (age > CACHE_DURATION) {
|
|
44
|
+
delete store[key]
|
|
45
|
+
await saveCache()
|
|
46
|
+
return null
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return entry.data as T
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const set = async (key: string, data: unknown): Promise<void> => {
|
|
53
|
+
await loadCache()
|
|
54
|
+
|
|
55
|
+
store[key] = {
|
|
56
|
+
data,
|
|
57
|
+
timestamp: Date.now(),
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
await saveCache()
|
|
61
|
+
}
|