happyskills 0.41.0 → 0.42.0
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/commands/search.js +26 -16
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.42.0] - 2026-05-05
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Surface the new server-side cluster info from API v2.6.0 in `search` output. Human output gains a `+N similar` chip in the result meta line (alongside match quality, stars, and quality tier) when the row represents a duplicate cluster. JSON output gains two additive fields per result: `similar_count` (integer) and `similar_repos` (array of cluster members, each with a per-member `similarity` score). Internal refactor: extracted `to_smart_json()` so cluster members serialise with the same shape as top-level results.
|
|
14
|
+
|
|
10
15
|
## [0.41.0] - 2026-05-04
|
|
11
16
|
|
|
12
17
|
### Added
|
package/package.json
CHANGED
package/src/commands/search.js
CHANGED
|
@@ -79,7 +79,8 @@ const format_smart_result = (item, index) => {
|
|
|
79
79
|
const star_str = `★ ${stars}`
|
|
80
80
|
const quality_str = tier ? tier.color(tier.label) : ''
|
|
81
81
|
const match_str = match ? match.color(match.label) : ''
|
|
82
|
-
const
|
|
82
|
+
const similar_str = item.similar_count ? `+${item.similar_count} similar` : ''
|
|
83
|
+
const meta_parts = [match_str, star_str, quality_str, similar_str].filter(Boolean).join(' · ')
|
|
83
84
|
|
|
84
85
|
const num = ` ${String(index + 1).padStart(2)}. `
|
|
85
86
|
const name_and_meta = `${bold(name)}${meta_parts ? ` ${dim(meta_parts)}` : ''}`
|
|
@@ -94,6 +95,24 @@ const format_smart_result = (item, index) => {
|
|
|
94
95
|
return lines.join('\n')
|
|
95
96
|
}
|
|
96
97
|
|
|
98
|
+
const to_smart_json = (item) => ({
|
|
99
|
+
skill: `${item.workspace_slug}/${item.name}`,
|
|
100
|
+
type: item.type || 'skill',
|
|
101
|
+
description: item.description || '',
|
|
102
|
+
version: item.latest_version || item.version || '-',
|
|
103
|
+
visibility: item.visibility || 'public',
|
|
104
|
+
workspace_slug: item.workspace_slug,
|
|
105
|
+
stars: item.star_count || 0,
|
|
106
|
+
quality_score: item.quality_score != null ? item.quality_score : null,
|
|
107
|
+
quality_tier: get_quality_tier_name(item.quality_score),
|
|
108
|
+
relevance_score: item.relevance_score != null ? item.relevance_score : null,
|
|
109
|
+
match_quality: item.match_quality || null,
|
|
110
|
+
tags: item.tags || [],
|
|
111
|
+
download_count: item.download_count || 0,
|
|
112
|
+
created_at: item.created_at,
|
|
113
|
+
updated_at: item.updated_at,
|
|
114
|
+
})
|
|
115
|
+
|
|
97
116
|
const run_smart_search = (args, query, options) => catch_errors('Smart search failed', async () => {
|
|
98
117
|
const limit = parseInt(args.flags.limit)
|
|
99
118
|
const capped_limit = Math.min(Math.max(limit, 1), 50)
|
|
@@ -132,21 +151,12 @@ const run_smart_search = (args, query, options) => catch_errors('Smart search fa
|
|
|
132
151
|
|
|
133
152
|
if (args.flags.json) {
|
|
134
153
|
const mapped = items.map(item => ({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
stars: item.star_count || 0,
|
|
142
|
-
quality_score: item.quality_score != null ? item.quality_score : null,
|
|
143
|
-
quality_tier: get_quality_tier_name(item.quality_score),
|
|
144
|
-
relevance_score: item.relevance_score != null ? item.relevance_score : null,
|
|
145
|
-
match_quality: item.match_quality || null,
|
|
146
|
-
tags: item.tags || [],
|
|
147
|
-
download_count: item.download_count || 0,
|
|
148
|
-
created_at: item.created_at,
|
|
149
|
-
updated_at: item.updated_at,
|
|
154
|
+
...to_smart_json(item),
|
|
155
|
+
similar_count: item.similar_count || 0,
|
|
156
|
+
similar_repos: (item.similar_repos || []).map(member => ({
|
|
157
|
+
...to_smart_json(member),
|
|
158
|
+
similarity: member.similarity != null ? member.similarity : null,
|
|
159
|
+
})),
|
|
150
160
|
}))
|
|
151
161
|
const data = { query, mode: 'smart', results: mapped, count: mapped.length }
|
|
152
162
|
if (match_notice) data.match_notice = match_notice
|