opencode-search 1.0.0 → 1.1.0-next.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.
Files changed (129) hide show
  1. package/README.md +27 -27
  2. package/dist/{search.d.ts → search.d.mts} +1 -2
  3. package/dist/search.mjs +947 -0
  4. package/package.json +22 -16
  5. package/dist/package.json +0 -68
  6. package/dist/search.d.ts.map +0 -1
  7. package/dist/search.js +0 -20
  8. package/dist/search.js.map +0 -1
  9. package/dist/src/cache.d.ts +0 -3
  10. package/dist/src/cache.d.ts.map +0 -1
  11. package/dist/src/cache.js +0 -43
  12. package/dist/src/cache.js.map +0 -1
  13. package/dist/src/format.d.ts +0 -20
  14. package/dist/src/format.d.ts.map +0 -1
  15. package/dist/src/format.js +0 -46
  16. package/dist/src/format.js.map +0 -1
  17. package/dist/src/html.d.ts +0 -8
  18. package/dist/src/html.d.ts.map +0 -1
  19. package/dist/src/html.js +0 -28
  20. package/dist/src/html.js.map +0 -1
  21. package/dist/src/normalize-blurb.d.ts +0 -2
  22. package/dist/src/normalize-blurb.d.ts.map +0 -1
  23. package/dist/src/normalize-blurb.js +0 -21
  24. package/dist/src/normalize-blurb.js.map +0 -1
  25. package/dist/src/opencode/notify.d.ts +0 -10
  26. package/dist/src/opencode/notify.d.ts.map +0 -1
  27. package/dist/src/opencode/notify.js +0 -8
  28. package/dist/src/opencode/notify.js.map +0 -1
  29. package/dist/src/parse-results.d.ts +0 -2
  30. package/dist/src/parse-results.d.ts.map +0 -1
  31. package/dist/src/parse-results.js +0 -20
  32. package/dist/src/parse-results.js.map +0 -1
  33. package/dist/src/providers/brave-search.d.ts +0 -4
  34. package/dist/src/providers/brave-search.d.ts.map +0 -1
  35. package/dist/src/providers/brave-search.js +0 -29
  36. package/dist/src/providers/brave-search.js.map +0 -1
  37. package/dist/src/providers/bsky-search.d.ts +0 -31
  38. package/dist/src/providers/bsky-search.d.ts.map +0 -1
  39. package/dist/src/providers/bsky-search.js +0 -61
  40. package/dist/src/providers/bsky-search.js.map +0 -1
  41. package/dist/src/providers/ddg-search.d.ts +0 -7
  42. package/dist/src/providers/ddg-search.d.ts.map +0 -1
  43. package/dist/src/providers/ddg-search.js +0 -88
  44. package/dist/src/providers/ddg-search.js.map +0 -1
  45. package/dist/src/providers/gnews-search.d.ts +0 -9
  46. package/dist/src/providers/gnews-search.d.ts.map +0 -1
  47. package/dist/src/providers/gnews-search.js +0 -50
  48. package/dist/src/providers/gnews-search.js.map +0 -1
  49. package/dist/src/providers/mdn-search.d.ts +0 -22
  50. package/dist/src/providers/mdn-search.d.ts.map +0 -1
  51. package/dist/src/providers/mdn-search.js +0 -59
  52. package/dist/src/providers/mdn-search.js.map +0 -1
  53. package/dist/src/providers/rfc-search.d.ts +0 -9
  54. package/dist/src/providers/rfc-search.d.ts.map +0 -1
  55. package/dist/src/providers/rfc-search.js +0 -38
  56. package/dist/src/providers/rfc-search.js.map +0 -1
  57. package/dist/src/providers/w3c-search.d.ts +0 -6
  58. package/dist/src/providers/w3c-search.d.ts.map +0 -1
  59. package/dist/src/providers/w3c-search.js +0 -42
  60. package/dist/src/providers/w3c-search.js.map +0 -1
  61. package/dist/src/providers/whatwg-search.d.ts +0 -8
  62. package/dist/src/providers/whatwg-search.d.ts.map +0 -1
  63. package/dist/src/providers/whatwg-search.js +0 -31
  64. package/dist/src/providers/whatwg-search.js.map +0 -1
  65. package/dist/src/providers/wiki-search.d.ts +0 -25
  66. package/dist/src/providers/wiki-search.d.ts.map +0 -1
  67. package/dist/src/providers/wiki-search.js +0 -50
  68. package/dist/src/providers/wiki-search.js.map +0 -1
  69. package/dist/src/renderers.d.ts +0 -18
  70. package/dist/src/renderers.d.ts.map +0 -1
  71. package/dist/src/renderers.js +0 -43
  72. package/dist/src/renderers.js.map +0 -1
  73. package/dist/src/safe.d.ts +0 -13
  74. package/dist/src/safe.d.ts.map +0 -1
  75. package/dist/src/safe.js +0 -17
  76. package/dist/src/safe.js.map +0 -1
  77. package/dist/src/search.d.ts +0 -13
  78. package/dist/src/search.d.ts.map +0 -1
  79. package/dist/src/search.js +0 -336
  80. package/dist/src/search.js.map +0 -1
  81. package/dist/src/strategies.d.ts +0 -13
  82. package/dist/src/strategies.d.ts.map +0 -1
  83. package/dist/src/strategies.js +0 -48
  84. package/dist/src/strategies.js.map +0 -1
  85. package/dist/src/user-agent.d.ts +0 -2
  86. package/dist/src/user-agent.d.ts.map +0 -1
  87. package/dist/src/user-agent.js +0 -3
  88. package/dist/src/user-agent.js.map +0 -1
  89. package/dist/src/v1-message.d.ts +0 -2
  90. package/dist/src/v1-message.d.ts.map +0 -1
  91. package/dist/src/v1-message.js +0 -11
  92. package/dist/src/v1-message.js.map +0 -1
  93. package/search.ts +0 -22
  94. package/src/cache.test.ts +0 -14
  95. package/src/cache.ts +0 -61
  96. package/src/format.test.ts +0 -175
  97. package/src/format.ts +0 -72
  98. package/src/html.ts +0 -39
  99. package/src/normalize-blurb.test.ts +0 -67
  100. package/src/normalize-blurb.ts +0 -22
  101. package/src/opencode/notify.ts +0 -16
  102. package/src/parse-results.test.ts +0 -75
  103. package/src/parse-results.ts +0 -22
  104. package/src/providers/brave-search.ts +0 -39
  105. package/src/providers/bsky-search.test.ts +0 -16
  106. package/src/providers/bsky-search.ts +0 -88
  107. package/src/providers/ddg-search.test.ts +0 -15
  108. package/src/providers/ddg-search.ts +0 -117
  109. package/src/providers/gnews-search.ts +0 -72
  110. package/src/providers/mdn-search.test.ts +0 -17
  111. package/src/providers/mdn-search.ts +0 -83
  112. package/src/providers/rfc-search.test.ts +0 -31
  113. package/src/providers/rfc-search.ts +0 -61
  114. package/src/providers/w3c-search.test.ts +0 -22
  115. package/src/providers/w3c-search.ts +0 -67
  116. package/src/providers/whatwg-search.test.ts +0 -21
  117. package/src/providers/whatwg-search.ts +0 -55
  118. package/src/providers/wiki-search.test.ts +0 -16
  119. package/src/providers/wiki-search.ts +0 -72
  120. package/src/renderers.test.ts +0 -263
  121. package/src/renderers.ts +0 -62
  122. package/src/safe.test.ts +0 -87
  123. package/src/safe.ts +0 -27
  124. package/src/search.ts +0 -401
  125. package/src/strategies.test.ts +0 -92
  126. package/src/strategies.ts +0 -62
  127. package/src/user-agent.ts +0 -3
  128. package/src/v1-message.test.ts +0 -17
  129. package/src/v1-message.ts +0 -10
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  An [OpenCode](https://opencode.ai) plugin that gives your agent access to DuckDuckGo, Brave, Google News, Wikipedia, Bluesky, MDN Web Docs, and the IETF, W3C and WHATWG specifications.
4
4
 
5
- <img width="776" height="393" alt="image" src="https://github.com/user-attachments/assets/7b9c0776-94a9-4184-9541-1f3bf8d9bcaa" />
5
+ <img width="776" height="393" alt="OpenCode running wiki_search for pumpkins and listing three Wikipedia results" src="docs/screenshot.svg" />
6
6
 
7
7
  ## What this adds over OpenCode's built-in tools
8
8
 
@@ -75,39 +75,39 @@ Search Google News for recent articles. Returns headline, publisher, and publica
75
75
 
76
76
  Search Bluesky posts via the AT Protocol. Returns posts with author handle, text, and engagement counts (likes, reposts, replies).
77
77
 
78
- | Parameter | Type | Required | Description |
79
- | --------- | ------ | -------- | ------------------------------ |
80
- | `query` | string | yes | |
81
- | `limit` | number | no | Number of results to return |
82
- | `sort` | string | no | Sort order: `top` or `latest` |
78
+ | Parameter | Type | Required | Description |
79
+ | --------- | ------ | -------- | ----------------------------- |
80
+ | `query` | string | yes | |
81
+ | `limit` | number | no | Number of results to return |
82
+ | `sort` | string | no | Sort order: `top` or `latest` |
83
83
 
84
84
  ### wiki_search
85
85
 
86
86
  Search Wikipedia articles using the MediaWiki REST API. Returns structured results with title, description, excerpt, and a direct link to the article. No API key required.
87
87
 
88
- | Parameter | Type | Required | Description |
89
- | --------- | ------ | -------- | ---------------------------------- |
90
- | `query` | string | yes | |
91
- | `limit` | number | no | Number of results (1-100) |
88
+ | Parameter | Type | Required | Description |
89
+ | --------- | ------ | -------- | ------------------------- |
90
+ | `query` | string | yes | |
91
+ | `limit` | number | no | Number of results (1-100) |
92
92
 
93
93
  ### mdn_search
94
94
 
95
95
  Search MDN Web Docs. Returns documentation pages for web technologies with title, URL, and summary. No API key required.
96
96
 
97
- | Parameter | Type | Required | Description |
98
- | --------- | ------ | -------- | ---------------------------------- |
99
- | `query` | string | yes | |
100
- | `limit` | number | no | Number of results to return |
101
- | `page` | number | no | Page number for pagination |
97
+ | Parameter | Type | Required | Description |
98
+ | --------- | ------ | -------- | --------------------------- |
99
+ | `query` | string | yes | |
100
+ | `limit` | number | no | Number of results to return |
101
+ | `page` | number | no | Page number for pagination |
102
102
 
103
103
  ### rfc_search
104
104
 
105
105
  Search IETF RFCs by title via the [Datatracker API](https://datatracker.ietf.org/api/). Returns RFC number, title, date, and abstract. No API key required.
106
106
 
107
- | Parameter | Type | Required | Description |
108
- | --------- | ------ | -------- | ---------------------------------- |
109
- | `query` | string | yes | |
110
- | `limit` | number | no | Number of results (default 20) |
107
+ | Parameter | Type | Required | Description |
108
+ | --------- | ------ | -------- | ------------------------------ |
109
+ | `query` | string | yes | |
110
+ | `limit` | number | no | Number of results (default 20) |
111
111
 
112
112
  Matches on title only, so a query is a phrase from the RFC's name rather than its body.
113
113
 
@@ -115,10 +115,10 @@ Matches on title only, so a query is a phrase from the RFC's name rather than it
115
115
 
116
116
  Search W3C specifications by title via the [W3C API](https://api.w3.org/). Returns the spec title and URL. No API key required.
117
117
 
118
- | Parameter | Type | Required | Description |
119
- | --------- | ------ | -------- | ---------------------------------- |
120
- | `query` | string | yes | |
121
- | `limit` | number | no | Number of results (default 20) |
118
+ | Parameter | Type | Required | Description |
119
+ | --------- | ------ | -------- | ------------------------------ |
120
+ | `query` | string | yes | |
121
+ | `limit` | number | no | Number of results (default 20) |
122
122
 
123
123
  The W3C API accepts a `q` parameter and ignores it — a real query and a nonsense string both return all 1713 specifications. So the full index is fetched, two pages of 1000, and filtered here. Titles only; the API exposes no abstracts.
124
124
 
@@ -126,9 +126,9 @@ The W3C API accepts a `q` parameter and ignores it — a real query and a nonsen
126
126
 
127
127
  Search WHATWG living standards. Returns the standard name, URL, and description. No API key required.
128
128
 
129
- | Parameter | Type | Required | Description |
130
- | --------- | ------ | -------- | ---------------------------------- |
131
- | `query` | string | yes | |
132
- | `limit` | number | no | Number of results (default 20) |
129
+ | Parameter | Type | Required | Description |
130
+ | --------- | ------ | -------- | ------------------------------ |
131
+ | `query` | string | yes | |
132
+ | `limit` | number | no | Number of results (default 20) |
133
133
 
134
134
  WHATWG publishes its whole index as one small JSON file and offers no search endpoint, so matching happens here across names and descriptions. There are only 27 standards, so expect few results.
@@ -1,3 +1,2 @@
1
1
  declare const _default: import("@opencode/plugin/promise/plugin").Plugin;
2
- export default _default;
3
- //# sourceMappingURL=search.d.ts.map
2
+ export { _default as default };