ht-skills 0.2.13 → 0.2.14
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/lib/cli.js +14 -3
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -451,6 +451,15 @@ function parseSpec(spec) {
|
|
|
451
451
|
return { slug, version: version || null };
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
+
function encodeSkillPathForUrl(pathValue) {
|
|
455
|
+
return String(pathValue || "")
|
|
456
|
+
.split("/")
|
|
457
|
+
.map((segment) => segment.trim())
|
|
458
|
+
.filter(Boolean)
|
|
459
|
+
.map((segment) => encodeURIComponent(segment))
|
|
460
|
+
.join("/");
|
|
461
|
+
}
|
|
462
|
+
|
|
454
463
|
function normalizeSkillSpecs(rawSpecs, { source = "install" } = {}) {
|
|
455
464
|
const values = Array.isArray(rawSpecs) ? rawSpecs : [rawSpecs];
|
|
456
465
|
const result = [];
|
|
@@ -1843,13 +1852,15 @@ async function cmdPublish(flags, deps = {}) {
|
|
|
1843
1852
|
preview_token: preview.preview_token,
|
|
1844
1853
|
archive_name: archiveName,
|
|
1845
1854
|
};
|
|
1846
|
-
const
|
|
1847
|
-
result.publication?.
|
|
1855
|
+
const skillPath = String(
|
|
1856
|
+
result.publication?.pathSlug
|
|
1857
|
+
|| result.publication?.slug
|
|
1848
1858
|
|| result.publication?.manifest?.slug
|
|
1849
1859
|
|| preview.manifest?.slug
|
|
1850
1860
|
|| "",
|
|
1851
1861
|
).trim();
|
|
1852
|
-
const
|
|
1862
|
+
const encodedSkillPath = encodeSkillPathForUrl(skillPath);
|
|
1863
|
+
const skillUrl = encodedSkillPath ? `${registry}/skills/${encodedSkillPath}` : null;
|
|
1853
1864
|
summaryPayload.skill_url = skillUrl;
|
|
1854
1865
|
|
|
1855
1866
|
if (ui) {
|