prior-cli 1.1.0 → 1.1.2
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/bin/prior.js +1 -1
- package/lib/tools.js +10 -8
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -538,7 +538,7 @@ async function startChat(opts = {}) {
|
|
|
538
538
|
banner();
|
|
539
539
|
console.log(DIVIDER);
|
|
540
540
|
console.log(c.brand(' Prior AI') + c.muted(' · ') + c.muted(`@${user}`));
|
|
541
|
-
|
|
541
|
+
console.log(c.ok(' ◉') + c.muted(' Agent mode ') + c.dim('· file web shell image prior-network'));
|
|
542
542
|
console.log(DIVIDER);
|
|
543
543
|
console.log('');
|
|
544
544
|
return loop();
|
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
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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 => {
|
|
@@ -260,7 +262,7 @@ const TOOLS = {
|
|
|
260
262
|
},
|
|
261
263
|
|
|
262
264
|
async prior_feed({}, { token }) {
|
|
263
|
-
const res = await fetch(`${PRIOR_BASE}/network/api/
|
|
265
|
+
const res = await fetch(`${PRIOR_BASE}/network/api/feed`, {
|
|
264
266
|
headers: token ? { Authorization: `Bearer ${token}` } : {},
|
|
265
267
|
timeout: 8000,
|
|
266
268
|
});
|
|
@@ -279,7 +281,7 @@ const TOOLS = {
|
|
|
279
281
|
},
|
|
280
282
|
|
|
281
283
|
async prior_profile({}, { token }) {
|
|
282
|
-
const res = await fetch(`${PRIOR_BASE}/network/api/profile`, {
|
|
284
|
+
const res = await fetch(`${PRIOR_BASE}/network/api/user/profile`, {
|
|
283
285
|
headers: token ? { Authorization: `Bearer ${token}` } : {},
|
|
284
286
|
timeout: 8000,
|
|
285
287
|
});
|