Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/upstream-registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,38 @@
}
}
}
],
"skills": [
{
"namespace": "com.xquik",
"name": "tweetclaw",
"description": "Search tweets, scrape tweet replies, post tweets and replies, export followers, manage media, monitor tweets, deliver webhooks, run giveaway draws, and use direct messages from OpenClaw with approval-aware X/Twitter workflows.",
"version": "1.6.32",
"status": "active",
"title": "TweetClaw",
"license": "MIT",
"compatibility": "OpenClaw 2026.6.1 or newer with the TweetClaw plugin installed from npm.",
"allowedTools": [
"explore",
"tweetclaw"
],
"repository": {
"url": "https://github.com/Xquik-dev/tweetclaw",
"type": "git"
},
"packages": [
{
"registryType": "git",
"url": "https://github.com/Xquik-dev/tweetclaw",
"commit": "7113d9e534a94f8279438b1373f741343c39523a",
"subfolder": "skills/tweetclaw"
}
],
"metadata": {
"npmPackage": "@xquik/tweetclaw",
"openclawInstall": "openclaw plugins install npm:@xquik/tweetclaw"
}
}
]
}
}
19 changes: 19 additions & 0 deletions internal/sources/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,15 @@ func TestExampleFiles(t *testing.T) {
name string
filename string
expectedServers int
expectedSkills int
validateServerName func(*testing.T, *toolhivetypes.UpstreamRegistry)
validateSkillName func(*testing.T, *toolhivetypes.UpstreamRegistry)
}{
{
name: "upstream-registry.json",
filename: "upstream-registry.json",
expectedServers: 12,
expectedSkills: 1,
validateServerName: func(t *testing.T, reg *toolhivetypes.UpstreamRegistry) {
t.Helper()
// Verify some expected servers are present
Expand All @@ -294,6 +297,17 @@ func TestExampleFiles(t *testing.T) {
assert.True(t, serverNames[name], "Expected server %s not found", name)
}
},
validateSkillName: func(t *testing.T, reg *toolhivetypes.UpstreamRegistry) {
t.Helper()
require.Len(t, reg.Data.Skills, 1)
skill := reg.Data.Skills[0]
assert.Equal(t, "com.xquik", skill.Namespace)
assert.Equal(t, "tweetclaw", skill.Name)
require.NotEmpty(t, skill.Packages)
assert.Equal(t, "git", skill.Packages[0].RegistryType)
assert.Equal(t, "7113d9e534a94f8279438b1373f741343c39523a", skill.Packages[0].Commit)
assert.Equal(t, "skills/tweetclaw", skill.Packages[0].Subfolder)
},
},
}

Expand All @@ -315,6 +329,8 @@ func TestExampleFiles(t *testing.T) {
// Verify expected server count
assert.Len(t, reg.Data.Servers, tt.expectedServers,
"Example file %s has unexpected server count", tt.filename)
assert.Len(t, reg.Data.Skills, tt.expectedSkills,
"Example file %s has unexpected skill count", tt.filename)

// Verify all servers have required fields
for i, server := range reg.Data.Servers {
Expand All @@ -330,6 +346,9 @@ func TestExampleFiles(t *testing.T) {
if tt.validateServerName != nil {
tt.validateServerName(t, reg)
}
if tt.validateSkillName != nil {
tt.validateSkillName(t, reg)
}

// Verify metadata is present
assert.NotEmpty(t, reg.Version, "Example file %s has no version", tt.filename)
Expand Down