prior-cli 1.1.0 → 1.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.
Files changed (2) hide show
  1. package/lib/tools.js +8 -6
  2. package/package.json +1 -1
package/lib/tools.js CHANGED
@@ -160,13 +160,15 @@ const TOOLS = {
160
160
  };
161
161
  },
162
162
 
163
- async web_search({ query }) {
163
+ async web_search({ query }, { token }) {
164
164
  if (!query) throw new Error('"query" is required');
165
- const GOOGLE_API_KEY = 'AIzaSyBqXIej44zdtIxCqmWGqx2Ge7g2kMkSm50';
166
- const SEARCH_ENGINE_ID = '84085043e8c9a44cb';
167
- const url = `https://www.googleapis.com/customsearch/v1?key=${GOOGLE_API_KEY}&cx=${SEARCH_ENGINE_ID}&q=${encodeURIComponent(query)}&num=6`;
168
- const res = await fetch(url, { timeout: 15000 });
169
- if (!res.ok) throw new Error(`Google Search API error: HTTP ${res.status}`);
165
+ const res = await fetch(`${CLI_BASE}/api/web-search`, {
166
+ method: 'POST',
167
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
168
+ body: JSON.stringify({ query }),
169
+ timeout: 15000,
170
+ });
171
+ if (!res.ok) throw new Error(`Web search error: HTTP ${res.status}`);
170
172
  const data = await res.json();
171
173
  if (!data.items || !data.items.length) return { output: 'No results found.', summary: '0 results' };
172
174
  const results = data.items.map(item => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prior-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Prior Network AI — command-line interface",
5
5
  "bin": {
6
6
  "prior": "bin/prior.js"