@workskills/getskill 1.1.2 → 1.1.4

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/index.js +8 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -362,7 +362,7 @@ async function searchSkills(keyword, options = {}) {
362
362
  limit = 20
363
363
  } = options;
364
364
 
365
- const url = `${BASE_URL}/repo/search?sort=${sort}&order=${order}&q=${encodeURIComponent(keyword)}&page=${page}&limit=${limit}`;
365
+ const url = `${BASE_URL}/api/v1/repos/search?q=${encodeURIComponent(keyword)}&sort=${sort}&order=${order}&page=${page}&limit=${limit}`;
366
366
 
367
367
  try {
368
368
  const response = await request(url, { timeout: 15000 });
@@ -408,15 +408,15 @@ async function searchSkills(keyword, options = {}) {
408
408
  }
409
409
 
410
410
  // 提取需要的字段
411
+ // 新 API 数据直接在根层级,不再嵌套在 repository 中
411
412
  return result.data.map(item => {
412
- const repo = item.repository || {};
413
413
  return {
414
- name: repo.full_name || '',
415
- full_name: repo.full_name || '',
416
- description: repo.description || '',
417
- html_url: repo.html_url || '',
418
- git_url: repo.html_url ? `${repo.html_url}.git` : '',
419
- clone_url: repo.clone_url || ''
414
+ name: item.full_name || item.name || '',
415
+ full_name: item.full_name || '',
416
+ description: item.description || '',
417
+ html_url: item.html_url || '',
418
+ git_url: item.clone_url || (item.html_url ? `${item.html_url}.git` : ''),
419
+ clone_url: item.clone_url || ''
420
420
  };
421
421
  }).filter(item => item.full_name); // 过滤掉没有 full_name 的项
422
422
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workskills/getskill",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Search, install, and update OpenClaw skills with automatic Git integration and configurable API endpoint",
5
5
  "main": "index.js",
6
6
  "bin": {