@skillsgate/tui 0.1.12 → 0.1.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.
@@ -6,6 +6,7 @@ import { useKeyboard } from "@opentui/react"
6
6
  import { useStore, useDispatch } from "../store/context.js"
7
7
  import { useSkillActions } from "../data/use-skill-actions.js"
8
8
  import { ConfirmDialog } from "../components/confirm-dialog.js"
9
+ import { fetchSkillContent } from "../data/api-client.js"
9
10
  import { colors, agentBadges as badgeMap } from "../utils/colors.js"
10
11
  import { agents } from "../../../cli/src/core/agents.js"
11
12
 
@@ -75,19 +76,15 @@ export function SkillDetailView() {
75
76
  return
76
77
  }
77
78
 
78
- // Catalog skill: fetch content from API
79
- const githubUrl = skill.metadata?.githubUrl as string | undefined
80
- const urlPath = skill.metadata?.urlPath as string | undefined
81
- if (githubUrl || urlPath) {
79
+ // Catalog skill: fetch SKILL.md content from GitHub
80
+ const source = skill.metadata?.source as string | undefined
81
+ const skillId = skill.metadata?.skillId as string | undefined
82
+ if (source && skillId) {
82
83
  setContentLoading(true)
83
- const detailPath = urlPath
84
- ? `/api/v1/skills/detail?path=${encodeURIComponent(urlPath)}`
85
- : `/api/v1/skills/detail?path=${encodeURIComponent(skill.name)}`
86
- fetch(`https://api.skillsgate.ai${detailPath}`)
87
- .then(res => res.ok ? res.json() : null)
88
- .then((data: any) => {
89
- if (data?.content) {
90
- setContent(stripFrontmatter(data.content))
84
+ fetchSkillContent(source, skillId)
85
+ .then((md) => {
86
+ if (md) {
87
+ setContent(stripFrontmatter(md))
91
88
  } else {
92
89
  setContent(skill.description || "(No content available)")
93
90
  }
@@ -424,8 +421,12 @@ export function SkillDetailView() {
424
421
  <text>{" "}</text>
425
422
 
426
423
  {/* Description */}
427
- <text fg={colors.text}>{skill.description}</text>
428
- <text>{" "}</text>
424
+ {skill.description ? (
425
+ <>
426
+ <text fg={colors.text}>{skill.description}</text>
427
+ <text>{" "}</text>
428
+ </>
429
+ ) : null}
429
430
 
430
431
  {/* Source */}
431
432
  <text fg={colors.textDim}>Source</text>
package/tmp.json ADDED
File without changes