@elizaos/plugin-web-search 0.1.8-alpha.1 → 0.1.9
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 +2 -2
- package/README.MD +23 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +225 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -31
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Shaw Walters, aka Moon aka @lalalune
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.MD
CHANGED
|
@@ -28,7 +28,7 @@ TAVILY_API_KEY=your_api_key # Required: API key for search service
|
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
31
|
-
Import and register the plugin in your Eliza configuration
|
|
31
|
+
Import and register the plugin in your Eliza configuration.
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
34
|
import { webSearchPlugin } from "@elizaos/plugin-web-search";
|
|
@@ -39,6 +39,28 @@ export default {
|
|
|
39
39
|
};
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
**Custom Usage**
|
|
43
|
+
If you want custom usage, for example, twitter-client to search the web before posting a tweet, you can also import the webSearchService and use it directly. Here's how you can do it:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
// packages/client-twitter/src/post.ts
|
|
47
|
+
const webSearchService = new WebSearchService();
|
|
48
|
+
await webSearchService.initialize(runtime);
|
|
49
|
+
const latestNews = await webSearchService.search(
|
|
50
|
+
"latest news on AI Agents",
|
|
51
|
+
// searchOptions
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const state = await this.runtime.composeState(
|
|
55
|
+
{ } // memory,
|
|
56
|
+
{ // additional keys
|
|
57
|
+
latestNews: latestNews,
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
// Then modify the tweet template to include the {{latestNews}} and however you need
|
|
62
|
+
```
|
|
63
|
+
|
|
42
64
|
## Features
|
|
43
65
|
|
|
44
66
|
### Web Search
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// src/actions/webSearch.ts
|
|
2
|
+
import {
|
|
3
|
+
elizaLogger
|
|
4
|
+
} from "@elizaos/core";
|
|
5
|
+
import { encodingForModel } from "js-tiktoken";
|
|
6
|
+
|
|
7
|
+
// src/services/webSearchService.ts
|
|
8
|
+
import {
|
|
9
|
+
Service,
|
|
10
|
+
ServiceType
|
|
11
|
+
} from "@elizaos/core";
|
|
12
|
+
import { tavily } from "@tavily/core";
|
|
13
|
+
var WebSearchService = class _WebSearchService extends Service {
|
|
14
|
+
tavilyClient;
|
|
15
|
+
async initialize(_runtime) {
|
|
16
|
+
const apiKey = _runtime.getSetting("TAVILY_API_KEY");
|
|
17
|
+
if (!apiKey) {
|
|
18
|
+
throw new Error("TAVILY_API_KEY is not set");
|
|
19
|
+
}
|
|
20
|
+
this.tavilyClient = tavily({ apiKey });
|
|
21
|
+
}
|
|
22
|
+
getInstance() {
|
|
23
|
+
return _WebSearchService.getInstance();
|
|
24
|
+
}
|
|
25
|
+
static get serviceType() {
|
|
26
|
+
return ServiceType.WEB_SEARCH;
|
|
27
|
+
}
|
|
28
|
+
async search(query, options) {
|
|
29
|
+
try {
|
|
30
|
+
const response = await this.tavilyClient.search(query, {
|
|
31
|
+
includeAnswer: options?.includeAnswer || true,
|
|
32
|
+
maxResults: options?.limit || 3,
|
|
33
|
+
topic: options?.type || "general",
|
|
34
|
+
searchDepth: options?.searchDepth || "basic",
|
|
35
|
+
includeImages: options?.includeImages || false,
|
|
36
|
+
days: options?.days || 3
|
|
37
|
+
});
|
|
38
|
+
return response;
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error("Web search error:", error);
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/actions/webSearch.ts
|
|
47
|
+
var DEFAULT_MAX_WEB_SEARCH_TOKENS = 4e3;
|
|
48
|
+
var DEFAULT_MODEL_ENCODING = "gpt-3.5-turbo";
|
|
49
|
+
function getTotalTokensFromString(str, encodingName = DEFAULT_MODEL_ENCODING) {
|
|
50
|
+
const encoding = encodingForModel(encodingName);
|
|
51
|
+
return encoding.encode(str).length;
|
|
52
|
+
}
|
|
53
|
+
function MaxTokens(data, maxTokens = DEFAULT_MAX_WEB_SEARCH_TOKENS) {
|
|
54
|
+
if (getTotalTokensFromString(data) >= maxTokens) {
|
|
55
|
+
return data.slice(0, maxTokens);
|
|
56
|
+
}
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
var webSearch = {
|
|
60
|
+
name: "WEB_SEARCH",
|
|
61
|
+
similes: [
|
|
62
|
+
"SEARCH_WEB",
|
|
63
|
+
"INTERNET_SEARCH",
|
|
64
|
+
"LOOKUP",
|
|
65
|
+
"QUERY_WEB",
|
|
66
|
+
"FIND_ONLINE",
|
|
67
|
+
"SEARCH_ENGINE",
|
|
68
|
+
"WEB_LOOKUP",
|
|
69
|
+
"ONLINE_SEARCH",
|
|
70
|
+
"FIND_INFORMATION"
|
|
71
|
+
],
|
|
72
|
+
suppressInitialMessage: true,
|
|
73
|
+
description: "Perform a web search to find information related to the message.",
|
|
74
|
+
// eslint-disable-next-line
|
|
75
|
+
validate: async (runtime, message) => {
|
|
76
|
+
const tavilyApiKeyOk = !!runtime.getSetting("TAVILY_API_KEY");
|
|
77
|
+
return tavilyApiKeyOk;
|
|
78
|
+
},
|
|
79
|
+
handler: async (runtime, message, state, options, callback) => {
|
|
80
|
+
elizaLogger.log("Composing state for message:", message);
|
|
81
|
+
state = await runtime.composeState(message);
|
|
82
|
+
const userId = runtime.agentId;
|
|
83
|
+
elizaLogger.log("User ID:", userId);
|
|
84
|
+
const webSearchPrompt = message.content.text;
|
|
85
|
+
elizaLogger.log("web search prompt received:", webSearchPrompt);
|
|
86
|
+
const webSearchService = new WebSearchService();
|
|
87
|
+
await webSearchService.initialize(runtime);
|
|
88
|
+
const searchResponse = await webSearchService.search(
|
|
89
|
+
webSearchPrompt
|
|
90
|
+
);
|
|
91
|
+
if (searchResponse && searchResponse.results.length) {
|
|
92
|
+
const responseList = searchResponse.answer ? `${searchResponse.answer}${Array.isArray(searchResponse.results) && searchResponse.results.length > 0 ? `
|
|
93
|
+
|
|
94
|
+
For more details, you can check out these resources:
|
|
95
|
+
${searchResponse.results.map(
|
|
96
|
+
(result, index) => `${index + 1}. [${result.title}](${result.url})`
|
|
97
|
+
).join("\n")}` : ""}` : "";
|
|
98
|
+
callback({
|
|
99
|
+
text: MaxTokens(responseList, DEFAULT_MAX_WEB_SEARCH_TOKENS)
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
elizaLogger.error("search failed or returned no data.");
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
examples: [
|
|
106
|
+
[
|
|
107
|
+
{
|
|
108
|
+
user: "{{user1}}",
|
|
109
|
+
content: {
|
|
110
|
+
text: "Find the latest news about SpaceX launches."
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
user: "{{agentName}}",
|
|
115
|
+
content: {
|
|
116
|
+
text: "Here is the latest news about SpaceX launches:",
|
|
117
|
+
action: "WEB_SEARCH"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
{
|
|
123
|
+
user: "{{user1}}",
|
|
124
|
+
content: {
|
|
125
|
+
text: "Can you find details about the iPhone 16 release?"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
user: "{{agentName}}",
|
|
130
|
+
content: {
|
|
131
|
+
text: "Here are the details I found about the iPhone 16 release:",
|
|
132
|
+
action: "WEB_SEARCH"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
{
|
|
138
|
+
user: "{{user1}}",
|
|
139
|
+
content: {
|
|
140
|
+
text: "What is the schedule for the next FIFA World Cup?"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
user: "{{agentName}}",
|
|
145
|
+
content: {
|
|
146
|
+
text: "Here is the schedule for the next FIFA World Cup:",
|
|
147
|
+
action: "WEB_SEARCH"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
{
|
|
153
|
+
user: "{{user1}}",
|
|
154
|
+
content: { text: "Check the latest stock price of Tesla." }
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
user: "{{agentName}}",
|
|
158
|
+
content: {
|
|
159
|
+
text: "Here is the latest stock price of Tesla I found:",
|
|
160
|
+
action: "WEB_SEARCH"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
{
|
|
166
|
+
user: "{{user1}}",
|
|
167
|
+
content: {
|
|
168
|
+
text: "What are the current trending movies in the US?"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
user: "{{agentName}}",
|
|
173
|
+
content: {
|
|
174
|
+
text: "Here are the current trending movies in the US:",
|
|
175
|
+
action: "WEB_SEARCH"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
{
|
|
181
|
+
user: "{{user1}}",
|
|
182
|
+
content: {
|
|
183
|
+
text: "What is the latest score in the NBA finals?"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
user: "{{agentName}}",
|
|
188
|
+
content: {
|
|
189
|
+
text: "Here is the latest score from the NBA finals:",
|
|
190
|
+
action: "WEB_SEARCH"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
[
|
|
195
|
+
{
|
|
196
|
+
user: "{{user1}}",
|
|
197
|
+
content: { text: "When is the next Apple keynote event?" }
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
user: "{{agentName}}",
|
|
201
|
+
content: {
|
|
202
|
+
text: "Here is the information about the next Apple keynote event:",
|
|
203
|
+
action: "WEB_SEARCH"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
]
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// src/index.ts
|
|
211
|
+
var webSearchPlugin = {
|
|
212
|
+
name: "webSearch",
|
|
213
|
+
description: "Search the web and get news",
|
|
214
|
+
actions: [webSearch],
|
|
215
|
+
evaluators: [],
|
|
216
|
+
providers: [],
|
|
217
|
+
services: [new WebSearchService()],
|
|
218
|
+
clients: []
|
|
219
|
+
};
|
|
220
|
+
var index_default = webSearchPlugin;
|
|
221
|
+
export {
|
|
222
|
+
index_default as default,
|
|
223
|
+
webSearchPlugin
|
|
224
|
+
};
|
|
225
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/actions/webSearch.ts","../src/services/webSearchService.ts","../src/index.ts"],"sourcesContent":["import {\n type Action,\n type HandlerCallback,\n type IAgentRuntime,\n type Memory,\n type State,\n elizaLogger\n} from \"@elizaos/core\";\nimport { encodingForModel, type TiktokenModel } from \"js-tiktoken\";\nimport { WebSearchService } from \"../services/webSearchService\";\nimport type { SearchResult } from \"../types\";\n\nconst DEFAULT_MAX_WEB_SEARCH_TOKENS = 4000;\nconst DEFAULT_MODEL_ENCODING = \"gpt-3.5-turbo\";\n\nfunction getTotalTokensFromString(\n str: string,\n encodingName: TiktokenModel = DEFAULT_MODEL_ENCODING\n) {\n const encoding = encodingForModel(encodingName);\n return encoding.encode(str).length;\n}\n\nfunction MaxTokens(\n data: string,\n maxTokens: number = DEFAULT_MAX_WEB_SEARCH_TOKENS\n): string {\n if (getTotalTokensFromString(data) >= maxTokens) {\n return data.slice(0, maxTokens);\n }\n return data;\n}\n\nexport const webSearch: Action = {\n name: \"WEB_SEARCH\",\n similes: [\n \"SEARCH_WEB\",\n \"INTERNET_SEARCH\",\n \"LOOKUP\",\n \"QUERY_WEB\",\n \"FIND_ONLINE\",\n \"SEARCH_ENGINE\",\n \"WEB_LOOKUP\",\n \"ONLINE_SEARCH\",\n \"FIND_INFORMATION\",\n ],\n suppressInitialMessage: true,\n description:\n \"Perform a web search to find information related to the message.\",\n // eslint-disable-next-line\n validate: async (runtime: IAgentRuntime, message: Memory) => {\n const tavilyApiKeyOk = !!runtime.getSetting(\"TAVILY_API_KEY\");\n\n return tavilyApiKeyOk;\n },\n handler: async (\n runtime: IAgentRuntime,\n message: Memory,\n state: State,\n options: any,\n callback: HandlerCallback\n ) => {\n elizaLogger.log(\"Composing state for message:\", message);\n state = (await runtime.composeState(message)) as State;\n const userId = runtime.agentId;\n elizaLogger.log(\"User ID:\", userId);\n\n const webSearchPrompt = message.content.text;\n elizaLogger.log(\"web search prompt received:\", webSearchPrompt);\n\n const webSearchService = new WebSearchService();\n await webSearchService.initialize(runtime);\n const searchResponse = await webSearchService.search(\n webSearchPrompt,\n );\n\n if (searchResponse && searchResponse.results.length) {\n const responseList = searchResponse.answer\n ? `${searchResponse.answer}${\n Array.isArray(searchResponse.results) &&\n searchResponse.results.length > 0\n ? `\\n\\nFor more details, you can check out these resources:\\n${searchResponse.results\n .map(\n (result: SearchResult, index: number) =>\n `${index + 1}. [${result.title}](${result.url})`\n )\n .join(\"\\n\")}`\n : \"\"\n }`\n : \"\";\n\n callback({\n text: MaxTokens(responseList, DEFAULT_MAX_WEB_SEARCH_TOKENS),\n });\n } else {\n elizaLogger.error(\"search failed or returned no data.\");\n }\n },\n examples: [\n [\n {\n user: \"{{user1}}\",\n content: {\n text: \"Find the latest news about SpaceX launches.\",\n },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here is the latest news about SpaceX launches:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n [\n {\n user: \"{{user1}}\",\n content: {\n text: \"Can you find details about the iPhone 16 release?\",\n },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here are the details I found about the iPhone 16 release:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n [\n {\n user: \"{{user1}}\",\n content: {\n text: \"What is the schedule for the next FIFA World Cup?\",\n },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here is the schedule for the next FIFA World Cup:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n [\n {\n user: \"{{user1}}\",\n content: { text: \"Check the latest stock price of Tesla.\" },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here is the latest stock price of Tesla I found:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n [\n {\n user: \"{{user1}}\",\n content: {\n text: \"What are the current trending movies in the US?\",\n },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here are the current trending movies in the US:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n [\n {\n user: \"{{user1}}\",\n content: {\n text: \"What is the latest score in the NBA finals?\",\n },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here is the latest score from the NBA finals:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n [\n {\n user: \"{{user1}}\",\n content: { text: \"When is the next Apple keynote event?\" },\n },\n {\n user: \"{{agentName}}\",\n content: {\n text: \"Here is the information about the next Apple keynote event:\",\n action: \"WEB_SEARCH\",\n },\n },\n ],\n ],\n} as Action;","import {\n Service,\n type IAgentRuntime,\n ServiceType,\n} from \"@elizaos/core\";\nimport { tavily } from \"@tavily/core\";\nimport type { IWebSearchService, SearchOptions, SearchResponse } from \"../types\";\n\nexport type TavilyClient = ReturnType<typeof tavily>; // declaring manually because original package does not export its types\n\nexport class WebSearchService extends Service implements IWebSearchService {\n public tavilyClient: TavilyClient\n\n async initialize(_runtime: IAgentRuntime): Promise<void> {\n const apiKey = _runtime.getSetting(\"TAVILY_API_KEY\") as string;\n if (!apiKey) {\n throw new Error(\"TAVILY_API_KEY is not set\");\n }\n this.tavilyClient = tavily({ apiKey });\n }\n\n getInstance(): IWebSearchService {\n return WebSearchService.getInstance();\n }\n\n static get serviceType(): ServiceType {\n return ServiceType.WEB_SEARCH;\n }\n\n async search(\n query: string,\n options?: SearchOptions,\n ): Promise<SearchResponse> {\n try {\n const response = await this.tavilyClient.search(query, {\n includeAnswer: options?.includeAnswer || true,\n maxResults: options?.limit || 3,\n topic: options?.type || \"general\",\n searchDepth: options?.searchDepth || \"basic\",\n includeImages: options?.includeImages || false,\n days: options?.days || 3,\n });\n\n return response;\n } catch (error) {\n console.error(\"Web search error:\", error);\n throw error;\n }\n }\n}\n","import { webSearch } from \"./actions/webSearch\";\nimport type { Plugin } from \"@elizaos/core\";\nimport { WebSearchService } from \"./services/webSearchService\";\n\nexport const webSearchPlugin: Plugin = {\n name: \"webSearch\",\n description: \"Search the web and get news\",\n actions: [webSearch],\n evaluators: [],\n providers: [],\n services: [new WebSearchService()],\n clients: [],\n};\n\nexport default webSearchPlugin;\n"],"mappings":";AAAA;AAAA,EAMI;AAAA,OACG;AACP,SAAS,wBAA4C;;;ACRrD;AAAA,EACI;AAAA,EAEA;AAAA,OACG;AACP,SAAS,cAAc;AAKhB,IAAM,mBAAN,MAAM,0BAAyB,QAAqC;AAAA,EAChE;AAAA,EAEP,MAAM,WA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N,aAAa;AAAA,EACb,SAAS,CAAC,SAAS;AAAA,EACnB,YAAY,CAAC;AAAA,EACb,WAAW,CAAC;AAAA,EACZ,UAAU,CAAC,IAAI,iBAAiB,CAAC;AAAA,EACjC,SAAS,CAAC;AACd;AAEA,IAAO,gBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
"name": "@elizaos/plugin-web-search",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"@elizaos/source": "./src/index.ts",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@elizaos/core": "0.1.9",
|
|
23
|
+
"@tavily/core": "^0.0.2",
|
|
24
|
+
"js-tiktoken": "1.0.15",
|
|
25
|
+
"tsup": "8.3.5"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup --format esm --dts",
|
|
29
|
+
"dev": "tsup --format esm --dts --watch",
|
|
30
|
+
"lint": "eslint --fix --cache ."
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"whatwg-url": "7.1.0"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "ffa4c1dcdacc096d5b451f246b53fbaa266b0f64"
|
|
33
36
|
}
|