@gopherhole/cli 0.1.10 → 0.1.12

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/dist/index.js CHANGED
@@ -1107,7 +1107,11 @@ ${chalk_1.default.bold('Examples:')}
1107
1107
  if (options.limit)
1108
1108
  params.set('limit', options.limit);
1109
1109
  log('GET /discover/agents?' + params.toString());
1110
- const res = await fetch(`${API_URL}/discover/agents?${params}`);
1110
+ const sessionId = config.get('sessionId');
1111
+ const headers = {};
1112
+ if (sessionId)
1113
+ headers['X-Session-ID'] = sessionId;
1114
+ const res = await fetch(`${API_URL}/discover/agents?${params}`, { headers });
1111
1115
  const data = await res.json();
1112
1116
  spinner.stop();
1113
1117
  if (data.agents.length === 0) {
@@ -1180,7 +1184,11 @@ discover
1180
1184
  .action(async () => {
1181
1185
  const spinner = (0, ora_1.default)('Fetching featured agents...').start();
1182
1186
  try {
1183
- const res = await fetch(`${API_URL}/discover/featured`);
1187
+ const sessionId = config.get('sessionId');
1188
+ const headers = {};
1189
+ if (sessionId)
1190
+ headers['X-Session-ID'] = sessionId;
1191
+ const res = await fetch(`${API_URL}/discover/featured`, { headers });
1184
1192
  const data = await res.json();
1185
1193
  spinner.stop();
1186
1194
  if (data.featured.length === 0) {
@@ -1213,7 +1221,11 @@ ${chalk_1.default.bold('Example:')}
1213
1221
  const spinner = (0, ora_1.default)('Fetching agent info...').start();
1214
1222
  try {
1215
1223
  log('GET /discover/agents/' + agentId);
1216
- const res = await fetch(`${API_URL}/discover/agents/${agentId}`);
1224
+ const sessionId = config.get('sessionId');
1225
+ const headers = {};
1226
+ if (sessionId)
1227
+ headers['X-Session-ID'] = sessionId;
1228
+ const res = await fetch(`${API_URL}/discover/agents/${agentId}`, { headers });
1217
1229
  if (!res.ok) {
1218
1230
  throw new Error('Agent not found');
1219
1231
  }
@@ -1338,7 +1350,11 @@ ${chalk_1.default.bold('Example:')}
1338
1350
  .action(async (options) => {
1339
1351
  const spinner = (0, ora_1.default)('Fetching top agents...').start();
1340
1352
  try {
1341
- const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`);
1353
+ const sessionId = config.get('sessionId');
1354
+ const headers = {};
1355
+ if (sessionId)
1356
+ headers['X-Session-ID'] = sessionId;
1357
+ const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`, { headers });
1342
1358
  const data = await res.json();
1343
1359
  spinner.stop();
1344
1360
  console.log(chalk_1.default.bold('\nšŸ† Top Rated Agents:\n'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gopherhole/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "GopherHole CLI - Connect AI agents to the world",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -1225,7 +1225,10 @@ ${chalk.bold('Examples:')}
1225
1225
  if (options.limit) params.set('limit', options.limit);
1226
1226
 
1227
1227
  log('GET /discover/agents?' + params.toString());
1228
- const res = await fetch(`${API_URL}/discover/agents?${params}`);
1228
+ const sessionId = config.get('sessionId') as string | undefined;
1229
+ const headers: Record<string, string> = {};
1230
+ if (sessionId) headers['X-Session-ID'] = sessionId;
1231
+ const res = await fetch(`${API_URL}/discover/agents?${params}`, { headers });
1229
1232
  const data = await res.json();
1230
1233
  spinner.stop();
1231
1234
 
@@ -1304,7 +1307,10 @@ discover
1304
1307
  const spinner = ora('Fetching featured agents...').start();
1305
1308
 
1306
1309
  try {
1307
- const res = await fetch(`${API_URL}/discover/featured`);
1310
+ const sessionId = config.get('sessionId') as string | undefined;
1311
+ const headers: Record<string, string> = {};
1312
+ if (sessionId) headers['X-Session-ID'] = sessionId;
1313
+ const res = await fetch(`${API_URL}/discover/featured`, { headers });
1308
1314
  const data = await res.json();
1309
1315
  spinner.stop();
1310
1316
 
@@ -1340,7 +1346,10 @@ ${chalk.bold('Example:')}
1340
1346
 
1341
1347
  try {
1342
1348
  log('GET /discover/agents/' + agentId);
1343
- const res = await fetch(`${API_URL}/discover/agents/${agentId}`);
1349
+ const sessionId = config.get('sessionId') as string | undefined;
1350
+ const headers: Record<string, string> = {};
1351
+ if (sessionId) headers['X-Session-ID'] = sessionId;
1352
+ const res = await fetch(`${API_URL}/discover/agents/${agentId}`, { headers });
1344
1353
  if (!res.ok) {
1345
1354
  throw new Error('Agent not found');
1346
1355
  }
@@ -1472,7 +1481,10 @@ ${chalk.bold('Example:')}
1472
1481
  const spinner = ora('Fetching top agents...').start();
1473
1482
 
1474
1483
  try {
1475
- const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`);
1484
+ const sessionId = config.get('sessionId') as string | undefined;
1485
+ const headers: Record<string, string> = {};
1486
+ if (sessionId) headers['X-Session-ID'] = sessionId;
1487
+ const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`, { headers });
1476
1488
  const data = await res.json();
1477
1489
  spinner.stop();
1478
1490