File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ func Call(input CallToolRequest) (CallToolResult, error) {
25
25
return reply (input .Params .Arguments .(map [string ]any ))
26
26
case "latest_mentions" :
27
27
return latestMentions (input .Params .Arguments .(map [string ]any ))
28
+ case "search" :
29
+ return search (input .Params .Arguments .(map [string ]any ))
28
30
case "get_thread" :
29
31
return getThread (input .Params .Arguments .(map [string ]any ))
30
32
default :
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ func getThread(args map[string]any) (CallToolResult, error) {
74
74
if ! ok {
75
75
return callToolError ("missing uri" ), nil
76
76
}
77
+ // allow web URIs and conver them to AT URIs
78
+ uri = webUriToAT (uri )
79
+ pdk .Log (pdk .LogInfo , fmt .Sprintf ("uri: %s" , uri ))
77
80
depth , ok := args ["depth" ].(int )
78
81
if ! ok {
79
82
depth = 6
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ func reply(args map[string]any) (CallToolResult, error) {
37
37
// - https://bsky.app/profile/<DID>/post/<RKEY>
38
38
// - at://<DID>/app.bsky.feed.post/<RKEY>
39
39
func webUriToAT (uri string ) string {
40
- if strings . HasPrefix ( uri , "https://bsky.app/profile/" ) {
41
- parts := strings . Split ( uri , "/" )
42
- return fmt . Sprintf ( "at://%s/app.bsky.feed.post/%s" , parts [ 3 ], parts [ 5 ])
40
+ uriParts , err := parseURI ( uri )
41
+ if err != nil {
42
+ return uri
43
43
}
44
- return uri
44
+ return fmt . Sprintf ( "at://%s/app.bsky.feed.post/%s" , uriParts . Repo , uriParts . Rkey )
45
45
}
46
46
47
47
type UriParts struct {
You can’t perform that action at this time.
0 commit comments