@gopherhole/cli 0.1.10 → 0.1.11

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) {
@@ -1213,7 +1217,11 @@ ${chalk_1.default.bold('Example:')}
1213
1217
  const spinner = (0, ora_1.default)('Fetching agent info...').start();
1214
1218
  try {
1215
1219
  log('GET /discover/agents/' + agentId);
1216
- const res = await fetch(`${API_URL}/discover/agents/${agentId}`);
1220
+ const sessionId = config.get('sessionId');
1221
+ const headers = {};
1222
+ if (sessionId)
1223
+ headers['X-Session-ID'] = sessionId;
1224
+ const res = await fetch(`${API_URL}/discover/agents/${agentId}`, { headers });
1217
1225
  if (!res.ok) {
1218
1226
  throw new Error('Agent not found');
1219
1227
  }
@@ -1338,7 +1346,11 @@ ${chalk_1.default.bold('Example:')}
1338
1346
  .action(async (options) => {
1339
1347
  const spinner = (0, ora_1.default)('Fetching top agents...').start();
1340
1348
  try {
1341
- const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`);
1349
+ const sessionId = config.get('sessionId');
1350
+ const headers = {};
1351
+ if (sessionId)
1352
+ headers['X-Session-ID'] = sessionId;
1353
+ const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`, { headers });
1342
1354
  const data = await res.json();
1343
1355
  spinner.stop();
1344
1356
  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.11",
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
 
@@ -1340,7 +1343,10 @@ ${chalk.bold('Example:')}
1340
1343
 
1341
1344
  try {
1342
1345
  log('GET /discover/agents/' + agentId);
1343
- const res = await fetch(`${API_URL}/discover/agents/${agentId}`);
1346
+ const sessionId = config.get('sessionId') as string | undefined;
1347
+ const headers: Record<string, string> = {};
1348
+ if (sessionId) headers['X-Session-ID'] = sessionId;
1349
+ const res = await fetch(`${API_URL}/discover/agents/${agentId}`, { headers });
1344
1350
  if (!res.ok) {
1345
1351
  throw new Error('Agent not found');
1346
1352
  }
@@ -1472,7 +1478,10 @@ ${chalk.bold('Example:')}
1472
1478
  const spinner = ora('Fetching top agents...').start();
1473
1479
 
1474
1480
  try {
1475
- const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`);
1481
+ const sessionId = config.get('sessionId') as string | undefined;
1482
+ const headers: Record<string, string> = {};
1483
+ if (sessionId) headers['X-Session-ID'] = sessionId;
1484
+ const res = await fetch(`${API_URL}/discover/agents?sort=rating&limit=${options.limit}`, { headers });
1476
1485
  const data = await res.json();
1477
1486
  spinner.stop();
1478
1487