socialtap 0.0.1 → 1.453.19
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/LICENSE +21 -0
- package/README.md +508 -2
- package/dist/agents.d.ts +55 -0
- package/dist/agents.js +179 -0
- package/dist/ai.d.ts +14 -0
- package/dist/ai.js +35 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +6 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +325 -0
- package/dist/client.d.ts +99 -0
- package/dist/client.js +136 -0
- package/dist/commands.d.ts +46 -0
- package/dist/commands.js +2975 -0
- package/dist/constants.d.ts +134 -0
- package/dist/constants.js +46 -0
- package/dist/core.d.ts +169 -0
- package/dist/core.js +315 -0
- package/dist/error.d.ts +97 -0
- package/dist/error.js +103 -0
- package/dist/errors.d.ts +232 -0
- package/dist/errors.js +237 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +12 -0
- package/dist/models.d.ts +6980 -0
- package/dist/models.js +3 -0
- package/dist/resources.d.ts +12698 -0
- package/dist/resources.js +3585 -0
- package/dist/tooldefs.d.ts +9 -0
- package/dist/tooldefs.js +3925 -0
- package/dist/tools.d.ts +39 -0
- package/dist/tools.js +66 -0
- package/dist/webhooks.d.ts +34 -0
- package/dist/webhooks.js +76 -0
- package/package.json +33 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Divergent Ventures LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,509 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Code generated by engine/cmd/gensdk (make gen) from catalog/catalog.gen.json; DO NOT EDIT. -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# SocialTap for TypeScript
|
|
4
|
+
|
|
5
|
+
Social media scraper API. Any link in. Clean JSON out. Generated from the SocialTap catalog (version 1.453.19); docs: https://socialtap.dev/docs.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Not published to npm yet: install it from source, a checkout of the SocialTap repository (this directory is
|
|
10
|
+
`sdk/typescript`).
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
(cd sdk/typescript && npm ci && npm run build)
|
|
14
|
+
npm install ./sdk/typescript # from your project, with the path to the checkout
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Zero runtime dependencies (`fetch`); Node 20.3+, Deno, Bun and Cloudflare Workers (server-side: the API key is a secret). ESM only. Params and
|
|
18
|
+
models use the API's snake_case names; SDK objects (options, `credits`, errors) are camelCase.
|
|
19
|
+
|
|
20
|
+
Nothing is invented (ADR 0007): `null` means unknown. With `fields`, results are typed `PartialModel<T>` (every member may
|
|
21
|
+
be absent). A 2xx that is not the API's envelope (no `data`, not JSON) throws `APIDecodeError`; a `retry-after` longer than
|
|
22
|
+
`MAX_RETRY_AFTER_S` throws `RetryAfterExceededError` instead of retrying early. Results keep the API's objects as sent,
|
|
23
|
+
members this version doesn't model included. `Event` is a union narrowed by `type`; a job item's `params` are typed by its `endpoint`.
|
|
24
|
+
|
|
25
|
+
## Authenticate
|
|
26
|
+
|
|
27
|
+
The client reads your API key from `SOCIALTAP_API_KEY`, or takes it as an option. Requests send it in the
|
|
28
|
+
`x-api-key` header.
|
|
29
|
+
|
|
30
|
+
## First call: Public TikTok profile and follower counts
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { SocialTap } from "socialtap";
|
|
34
|
+
|
|
35
|
+
const client = new SocialTap(); // apiKey defaults to process.env.SOCIALTAP_API_KEY
|
|
36
|
+
|
|
37
|
+
const res = await client.tiktok.profile.get({ handle: "nasa" });
|
|
38
|
+
console.log(res.data);
|
|
39
|
+
console.log(res.credits.charged, res.meta.request_id);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`data` is a `Profile` (example response, truncated):
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"approximate_fields": [],
|
|
47
|
+
"avatar_url": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e5143212a59c09a008bf50f487d54d1f~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=9640\u0026refresh_token=29840d4e\u0026x-expires=4070908800\u0026x-signature=SCRUBBED\u0026t=4d5b0474\u0026ps=13740610\u0026shp=a5d48078\u0026shcp=81f88b70\u0026idc=useast5",
|
|
48
|
+
"banner_url": null,
|
|
49
|
+
"bio": "Making the seemingly impossible, possible.✨",
|
|
50
|
+
"category": null,
|
|
51
|
+
"country_code": "US",
|
|
52
|
+
"created_at": "2026-07-20T15:55:49Z",
|
|
53
|
+
"display_name": "NASA",
|
|
54
|
+
"external_links": [
|
|
55
|
+
{
|
|
56
|
+
"title": null,
|
|
57
|
+
"url": "https://science.nasa.gov/feature/artemis-ii-preliminary-lunar-science-report"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"id": "7664638705177150477",
|
|
61
|
+
"is_private": false,
|
|
62
|
+
"is_verified": true,
|
|
63
|
+
"location": null,
|
|
64
|
+
"metrics": {
|
|
65
|
+
"follower_count": 2152843,
|
|
66
|
+
"following_count": 23,
|
|
67
|
+
"post_count": 62,
|
|
68
|
+
"total_like_count": 11486661,
|
|
69
|
+
"total_view_count": null
|
|
70
|
+
},
|
|
71
|
+
"platform": "tiktok",
|
|
72
|
+
"platform_specific": {
|
|
73
|
+
"tiktok": {
|
|
74
|
+
"display_name_changed_at": "2026-07-20T15:58:00Z",
|
|
75
|
+
"friend_count": 17,
|
|
76
|
+
"is_business_account": false,
|
|
77
|
+
"is_shop_seller": false,
|
|
78
|
+
"language": "en",
|
|
79
|
+
"liked_post_count": null,
|
|
80
|
+
"sec_uid": "MS4wLjABAAAAU9BRVzC8oCaegVnia8IbqWhPb_-dbU7s00Y3wS1_Nx8g5RUaYvyXrpejgjdxTwd6"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"type": "organization",
|
|
84
|
+
"unknown_fields": [],
|
|
85
|
+
"url": "https://www.tiktok.com/@nasa",
|
|
86
|
+
"username": "nasa"
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Every result also carries the envelope `meta` (request ID, source, cache status, fetch time) and `credits`
|
|
91
|
+
(charged by this request, and the balance after it when the API reports it). Failed requests and cache hits are free.
|
|
92
|
+
|
|
93
|
+
## Endpoints
|
|
94
|
+
|
|
95
|
+
| endpoint | method | cost |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| `bluesky.comments` | `client.bluesky.comments.list()` | 1 credit |
|
|
98
|
+
| `bluesky.post` | `client.bluesky.post.get()` | 1 credit |
|
|
99
|
+
| `bluesky.posts` | `client.bluesky.posts.list()` | 1 credit |
|
|
100
|
+
| `bluesky.profile` | `client.bluesky.profile.get()` | 1 credit; 1 credit |
|
|
101
|
+
| `bluesky.search_posts` | `client.bluesky.searchPosts.list()` | 1 credit |
|
|
102
|
+
| `facebook.ad` | `client.facebook.ad.get()` | 1 credit |
|
|
103
|
+
| `facebook.ad_transcript` | `client.facebook.adTranscript.get()` | 2 credits + 2 per started minute of media |
|
|
104
|
+
| `facebook.ads` | `client.facebook.ads.list()` | 1 credit |
|
|
105
|
+
| `facebook.comments` | `client.facebook.comments.list()` | 1 credit |
|
|
106
|
+
| `facebook.engagement` | `client.facebook.engagement.get()` | 1 credit |
|
|
107
|
+
| `facebook.event` | `client.facebook.event.get()` | 1 credit |
|
|
108
|
+
| `facebook.events` | `client.facebook.events.list()` | 1 credit |
|
|
109
|
+
| `facebook.group` | `client.facebook.group.get()` | 1 credit |
|
|
110
|
+
| `facebook.group_posts` | `client.facebook.groupPosts.list()` | 1 credit |
|
|
111
|
+
| `facebook.listing` | `client.facebook.listing.get()` | 1 credit; 1 credit |
|
|
112
|
+
| `facebook.photos` | `client.facebook.photos.list()` | 1 credit |
|
|
113
|
+
| `facebook.place_events` | `client.facebook.placeEvents.list()` | 1 credit |
|
|
114
|
+
| `facebook.post` | `client.facebook.post.get()` | 1 credit |
|
|
115
|
+
| `facebook.posts` | `client.facebook.posts.list()` | 1 credit |
|
|
116
|
+
| `facebook.profile` | `client.facebook.profile.get()` | 1 credit |
|
|
117
|
+
| `facebook.reels` | `client.facebook.reels.list()` | 1 credit |
|
|
118
|
+
| `facebook.replies` | `client.facebook.replies.list()` | 1 credit |
|
|
119
|
+
| `facebook.search_ads` | `client.facebook.searchAds.list()` | 1 credit |
|
|
120
|
+
| `facebook.search_advertisers` | `client.facebook.searchAdvertisers.list()` | 1 credit |
|
|
121
|
+
| `facebook.search_events` | `client.facebook.searchEvents.list()` | 1 credit |
|
|
122
|
+
| `facebook.search_groups` | `client.facebook.searchGroups.list()` | 1 credit + 1 per result filled in |
|
|
123
|
+
| `facebook.search_listings` | `client.facebook.searchListings.list()` | 1 credit; 1 credit |
|
|
124
|
+
| `facebook.search_places` | `client.facebook.searchPlaces.list()` | 1 credit |
|
|
125
|
+
| `facebook.search_posts` | `client.facebook.searchPosts.list()` | 1 credit + 1 per result filled in |
|
|
126
|
+
| `facebook.search_profiles` | `client.facebook.searchProfiles.list()` | 1 credit + 1 per result filled in |
|
|
127
|
+
| `facebook.transcript` | `client.facebook.transcript.get()` | 1 credit; 2 credits + 2 per started minute of media |
|
|
128
|
+
| `google.ad` | `client.google.ad.get()` | 1 credit |
|
|
129
|
+
| `google.ads` | `client.google.ads.list()` | 1 credit |
|
|
130
|
+
| `google.advertiser` | `client.google.advertiser.get()` | 1 credit |
|
|
131
|
+
| `google.search_ads` | `client.google.searchAds.list()` | 1 credit |
|
|
132
|
+
| `google.search_advertisers` | `client.google.searchAdvertisers.list()` | 1 credit |
|
|
133
|
+
| `google.search_suggestions` | `client.google.searchSuggestions.list()` | 1 credit |
|
|
134
|
+
| `instagram.comment` | `client.instagram.comment.get()` | 1 credit |
|
|
135
|
+
| `instagram.comments` | `client.instagram.comments.list()` | 1 credit |
|
|
136
|
+
| `instagram.embed` | `client.instagram.embed.get()` | 1 credit; 1 credit |
|
|
137
|
+
| `instagram.engagement` | `client.instagram.engagement.get()` | 1 credit |
|
|
138
|
+
| `instagram.hashtag` | `client.instagram.hashtag.get()` | 1 credit |
|
|
139
|
+
| `instagram.hashtag_posts` | `client.instagram.hashtagPosts.list()` | 1 credit; 1 credit |
|
|
140
|
+
| `instagram.highlights` | `client.instagram.highlights.list()` | 1 credit |
|
|
141
|
+
| `instagram.place` | `client.instagram.place.get()` | 1 credit |
|
|
142
|
+
| `instagram.place_posts` | `client.instagram.placePosts.list()` | 1 credit |
|
|
143
|
+
| `instagram.playlist_stories` | `client.instagram.playlistStories.list()` | 1 credit |
|
|
144
|
+
| `instagram.post` | `client.instagram.post.get()` | 1 credit |
|
|
145
|
+
| `instagram.posts` | `client.instagram.posts.list()` | 1 credit |
|
|
146
|
+
| `instagram.profile` | `client.instagram.profile.get()` | 1 credit |
|
|
147
|
+
| `instagram.reels` | `client.instagram.reels.list()` | 1 credit |
|
|
148
|
+
| `instagram.search_hashtags` | `client.instagram.searchHashtags.list()` | 1 credit |
|
|
149
|
+
| `instagram.search_places` | `client.instagram.searchPlaces.list()` | 1 credit + 1 per result filled in |
|
|
150
|
+
| `instagram.search_posts` | `client.instagram.searchPosts.list()` | 1 credit; 1 credit |
|
|
151
|
+
| `instagram.search_profiles` | `client.instagram.searchProfiles.list()` | 1 credit + 1 per result filled in |
|
|
152
|
+
| `instagram.search_sounds` | `client.instagram.searchSounds.list()` | 1 credit + 1 per result filled in |
|
|
153
|
+
| `instagram.search_suggestions` | `client.instagram.searchSuggestions.list()` | 1 credit |
|
|
154
|
+
| `instagram.similar_profiles` | `client.instagram.similarProfiles.list()` | 1 credit |
|
|
155
|
+
| `instagram.sound` | `client.instagram.sound.get()` | 1 credit |
|
|
156
|
+
| `instagram.sound_posts` | `client.instagram.soundPosts.list()` | 1 credit |
|
|
157
|
+
| `instagram.story` | `client.instagram.story.get()` | 1 credit |
|
|
158
|
+
| `instagram.topic` | `client.instagram.topic.get()` | 1 credit |
|
|
159
|
+
| `instagram.transcript` | `client.instagram.transcript.get()` | 1 credit; 2 credits + 2 per started minute of media |
|
|
160
|
+
| `instagram.trending_posts` | `client.instagram.trendingPosts.list()` | 1 credit; 1 credit |
|
|
161
|
+
| `instagram.username` | `client.instagram.username.get()` | 1 credit |
|
|
162
|
+
| `kick.post` | `client.kick.post.get()` | 1 credit; 1 credit |
|
|
163
|
+
| `kick.transcript` | `client.kick.transcript.get()` | 2 credits + 2 per started minute of media |
|
|
164
|
+
| `komi.page` | `client.komi.page.get()` | 1 credit |
|
|
165
|
+
| `kwai.post` | `client.kwai.post.get()` | 1 credit |
|
|
166
|
+
| `kwai.posts` | `client.kwai.posts.list()` | 1 credit |
|
|
167
|
+
| `kwai.profile` | `client.kwai.profile.get()` | 1 credit |
|
|
168
|
+
| `linkbio.profile` | `client.linkbio.profile.get()` | 1 credit |
|
|
169
|
+
| `linkedin.ad` | `client.linkedin.ad.get()` | 1 credit |
|
|
170
|
+
| `linkedin.post` | `client.linkedin.post.get()` | 1 credit |
|
|
171
|
+
| `linkedin.profile` | `client.linkedin.profile.get()` | 1 credit |
|
|
172
|
+
| `linkedin.search_ads` | `client.linkedin.searchAds.list()` | 1 credit |
|
|
173
|
+
| `linkedin.search_posts` | `client.linkedin.searchPosts.list()` | 1 credit + 1 per result filled in |
|
|
174
|
+
| `linkedin.search_profiles` | `client.linkedin.searchProfiles.list()` | 1 credit + 1 per result filled in |
|
|
175
|
+
| `linkme.profile` | `client.linkme.profile.get()` | 1 credit; 1 credit |
|
|
176
|
+
| `linktree.profile` | `client.linktree.profile.get()` | 1 credit |
|
|
177
|
+
| `pillar.page` | `client.pillar.page.get()` | 1 credit |
|
|
178
|
+
| `reddit.comments` | `client.reddit.comments.list()` | 1 credit |
|
|
179
|
+
| `reddit.engagement` | `client.reddit.engagement.get()` | 1 credit |
|
|
180
|
+
| `reddit.post` | `client.reddit.post.get()` | 1 credit |
|
|
181
|
+
| `reddit.posts` | `client.reddit.posts.list()` | 1 credit |
|
|
182
|
+
| `reddit.profile` | `client.reddit.profile.get()` | 1 credit |
|
|
183
|
+
| `reddit.profile_comments` | `client.reddit.profileComments.list()` | 1 credit |
|
|
184
|
+
| `reddit.search_comments` | `client.reddit.searchComments.list()` | 1 credit |
|
|
185
|
+
| `reddit.search_posts` | `client.reddit.searchPosts.list()` | 1 credit |
|
|
186
|
+
| `reddit.search_profiles` | `client.reddit.searchProfiles.list()` | 1 credit |
|
|
187
|
+
| `reddit.search_subreddits` | `client.reddit.searchSubreddits.list()` | 1 credit |
|
|
188
|
+
| `reddit.subreddit` | `client.reddit.subreddit.get()` | 1 credit |
|
|
189
|
+
| `reddit.subreddit_posts` | `client.reddit.subredditPosts.list()` | 1 credit |
|
|
190
|
+
| `reddit.transcript` | `client.reddit.transcript.get()` | 1 credit; 2 credits + 2 per started minute of media |
|
|
191
|
+
| `rumble.comments` | `client.rumble.comments.list()` | 1 credit |
|
|
192
|
+
| `rumble.engagement` | `client.rumble.engagement.get()` | 1 credit |
|
|
193
|
+
| `rumble.post` | `client.rumble.post.get()` | 1 credit |
|
|
194
|
+
| `rumble.posts` | `client.rumble.posts.list()` | 1 credit |
|
|
195
|
+
| `rumble.profile` | `client.rumble.profile.get()` | 1 credit |
|
|
196
|
+
| `rumble.search_posts` | `client.rumble.searchPosts.list()` | 1 credit |
|
|
197
|
+
| `rumble.transcript` | `client.rumble.transcript.get()` | 1 credit; 2 credits + 2 per started minute of media |
|
|
198
|
+
| `snapchat.comments` | `client.snapchat.comments.list()` | 1 credit |
|
|
199
|
+
| `snapchat.profile` | `client.snapchat.profile.get()` | 1 credit |
|
|
200
|
+
| `snapchat.spotlight` | `client.snapchat.spotlight.get()` | 1 credit |
|
|
201
|
+
| `soundcloud.artist` | `client.soundcloud.artist.get()` | 1 credit; 1 credit |
|
|
202
|
+
| `soundcloud.track` | `client.soundcloud.track.get()` | 1 credit; 1 credit |
|
|
203
|
+
| `soundcloud.tracks` | `client.soundcloud.tracks.list()` | 1 credit; 1 credit |
|
|
204
|
+
| `telegram.channel` | `client.telegram.channel.get()` | 1 credit |
|
|
205
|
+
| `telegram.channel_posts` | `client.telegram.channelPosts.list()` | 1 credit |
|
|
206
|
+
| `telegram.post` | `client.telegram.post.get()` | 1 credit |
|
|
207
|
+
| `telegram.search_channels` | `client.telegram.searchChannels.list()` | 1 credit + 1 per result filled in |
|
|
208
|
+
| `threads.comments` | `client.threads.comments.list()` | 1 credit; 1 credit |
|
|
209
|
+
| `threads.post` | `client.threads.post.get()` | 1 credit; 1 credit |
|
|
210
|
+
| `threads.posts` | `client.threads.posts.list()` | 1 credit; 1 credit |
|
|
211
|
+
| `threads.profile` | `client.threads.profile.get()` | 1 credit; 1 credit |
|
|
212
|
+
| `threads.search_posts` | `client.threads.searchPosts.list()` | 1 credit; 1 credit |
|
|
213
|
+
| `threads.search_profiles` | `client.threads.searchProfiles.list()` | 1 credit |
|
|
214
|
+
| `tiktok.ad` | `client.tiktok.ad.get()` | 1 credit |
|
|
215
|
+
| `tiktok.comment` | `client.tiktok.comment.get()` | 1 credit |
|
|
216
|
+
| `tiktok.comments` | `client.tiktok.comments.list()` | 1 credit |
|
|
217
|
+
| `tiktok.download` | `client.tiktok.download.get()` | 1 credit; 1 credit |
|
|
218
|
+
| `tiktok.effect` | `client.tiktok.effect.get()` | 1 credit |
|
|
219
|
+
| `tiktok.effect_posts` | `client.tiktok.effectPosts.list()` | 1 credit |
|
|
220
|
+
| `tiktok.engagement` | `client.tiktok.engagement.get()` | 1 credit |
|
|
221
|
+
| `tiktok.hashtag` | `client.tiktok.hashtag.get()` | 1 credit |
|
|
222
|
+
| `tiktok.liked_posts` | `client.tiktok.likedPosts.list()` | 1 credit |
|
|
223
|
+
| `tiktok.live` | `client.tiktok.live.get()` | 1 credit |
|
|
224
|
+
| `tiktok.place_posts` | `client.tiktok.placePosts.list()` | 1 credit |
|
|
225
|
+
| `tiktok.playlist_posts` | `client.tiktok.playlistPosts.list()` | 1 credit |
|
|
226
|
+
| `tiktok.playlists` | `client.tiktok.playlists.list()` | 1 credit |
|
|
227
|
+
| `tiktok.post` | `client.tiktok.post.get()` | 1 credit |
|
|
228
|
+
| `tiktok.posts` | `client.tiktok.posts.list()` | 1 credit |
|
|
229
|
+
| `tiktok.profile` | `client.tiktok.profile.get()` | 1 credit |
|
|
230
|
+
| `tiktok.replies` | `client.tiktok.replies.list()` | 1 credit |
|
|
231
|
+
| `tiktok.search_ads` | `client.tiktok.searchAds.list()` | 1 credit |
|
|
232
|
+
| `tiktok.search_hashtags` | `client.tiktok.searchHashtags.list()` | 1 credit + 1 per result filled in |
|
|
233
|
+
| `tiktok.search_posts` | `client.tiktok.searchPosts.list()` | 1 credit |
|
|
234
|
+
| `tiktok.search_profiles` | `client.tiktok.searchProfiles.list()` | 1 credit + 1 per result filled in |
|
|
235
|
+
| `tiktok.search_sounds` | `client.tiktok.searchSounds.list()` | 1 credit + 1 per result filled in |
|
|
236
|
+
| `tiktok.search_top` | `client.tiktok.searchTop.list()` | 1 credit + 1 per result filled in |
|
|
237
|
+
| `tiktok.sound` | `client.tiktok.sound.get()` | 1 credit |
|
|
238
|
+
| `tiktok.sound_posts` | `client.tiktok.soundPosts.list()` | 1 credit |
|
|
239
|
+
| `tiktok.top_ads` | `client.tiktok.topAds.list()` | 1 credit |
|
|
240
|
+
| `tiktok.top_posts` | `client.tiktok.topPosts.list()` | 1 credit |
|
|
241
|
+
| `tiktok.transcript` | `client.tiktok.transcript.get()` | 1 credit; 2 credits + 2 per started minute of media |
|
|
242
|
+
| `tiktok.trending_hashtags` | `client.tiktok.trendingHashtags.list()` | 1 credit |
|
|
243
|
+
| `tiktok.trending_posts` | `client.tiktok.trendingPosts.list()` | 1 credit |
|
|
244
|
+
| `tiktokshop.product` | `client.tiktokshop.product.get()` | 1 credit |
|
|
245
|
+
| `tiktokshop.products` | `client.tiktokshop.products.list()` | 1 credit |
|
|
246
|
+
| `tiktokshop.reviews` | `client.tiktokshop.reviews.list()` | 1 credit |
|
|
247
|
+
| `tiktokshop.search_products` | `client.tiktokshop.searchProducts.list()` | 1 credit; 1 credit |
|
|
248
|
+
| `truthsocial.post` | `client.truthsocial.post.get()` | 1 credit |
|
|
249
|
+
| `truthsocial.posts` | `client.truthsocial.posts.list()` | 1 credit |
|
|
250
|
+
| `truthsocial.profile` | `client.truthsocial.profile.get()` | 1 credit |
|
|
251
|
+
| `twitch.profile` | `client.twitch.profile.get()` | 1 credit |
|
|
252
|
+
| `twitch.schedule` | `client.twitch.schedule.list()` | 1 credit |
|
|
253
|
+
| `twitch.transcript` | `client.twitch.transcript.get()` | 2 credits + 2 per started minute of media |
|
|
254
|
+
| `twitch.video` | `client.twitch.video.get()` | 1 credit |
|
|
255
|
+
| `twitch.videos` | `client.twitch.videos.list()` | 1 credit |
|
|
256
|
+
| `x.community` | `client.x.community.get()` | 1 credit |
|
|
257
|
+
| `x.post` | `client.x.post.get()` | 1 credit |
|
|
258
|
+
| `x.profile` | `client.x.profile.get()` | 1 credit |
|
|
259
|
+
| `x.search_communities` | `client.x.searchCommunities.list()` | 1 credit + 1 per result filled in |
|
|
260
|
+
| `x.search_hashtags` | `client.x.searchHashtags.list()` | 1 credit |
|
|
261
|
+
| `x.search_posts` | `client.x.searchPosts.list()` | 1 credit + 1 per result filled in |
|
|
262
|
+
| `x.search_profiles` | `client.x.searchProfiles.list()` | 1 credit + 1 per result filled in |
|
|
263
|
+
| `youtube.comments` | `client.youtube.comments.list()` | 1 credit |
|
|
264
|
+
| `youtube.engagement` | `client.youtube.engagement.get()` | 1 credit |
|
|
265
|
+
| `youtube.post` | `client.youtube.post.get()` | 1 credit; 1 credit |
|
|
266
|
+
| `youtube.posts` | `client.youtube.posts.list()` | 1 credit |
|
|
267
|
+
| `youtube.profile` | `client.youtube.profile.get()` | 1 credit |
|
|
268
|
+
| `youtube.transcript` | `client.youtube.transcript.get()` | 1 credit; 2 credits + 2 per started minute of media |
|
|
269
|
+
|
|
270
|
+
## Errors
|
|
271
|
+
|
|
272
|
+
Every API error is an `APIError` subclass named after its code, with `status`, `code`, `retryable`, `remediation`,
|
|
273
|
+
`requestId` and `creditsCharged` (0: errors are free). Codes this SDK version doesn't know arrive as a plain
|
|
274
|
+
`APIError` with their `code`; no response at all is an `APIConnectionError` (`APITimeoutError` for timeouts).
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
import { APIError, NotFoundError } from "socialtap";
|
|
278
|
+
|
|
279
|
+
try {
|
|
280
|
+
await client.tiktok.profile.get({ handle: "nasa" });
|
|
281
|
+
} catch (err) {
|
|
282
|
+
if (err instanceof NotFoundError) {
|
|
283
|
+
// Check the URL or ID; do not retry.
|
|
284
|
+
} else if (err instanceof APIError) {
|
|
285
|
+
console.error(err.code, err.status, err.retryable, err.remediation, err.requestId);
|
|
286
|
+
} else throw err;
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
| code | class | status | retried |
|
|
291
|
+
|---|---|---|---|
|
|
292
|
+
| `invalid_input` | `InvalidInputError` | 400 | no |
|
|
293
|
+
| `invalid_cursor` | `InvalidCursorError` | 400 | no |
|
|
294
|
+
| `unauthorized` | `UnauthorizedError` | 401 | no |
|
|
295
|
+
| `forbidden` | `ForbiddenError` | 403 | no |
|
|
296
|
+
| `insufficient_credits` | `InsufficientCreditsError` | 402 | no |
|
|
297
|
+
| `spend_limit_reached` | `SpendLimitReachedError` | 402 | no |
|
|
298
|
+
| `rate_limited` | `RateLimitedError` | 429 | yes |
|
|
299
|
+
| `method_not_allowed` | `MethodNotAllowedError` | 405 | no |
|
|
300
|
+
| `endpoint_retired` | `EndpointRetiredError` | 410 | no |
|
|
301
|
+
| `idempotency_key_reused` | `IdempotencyKeyReusedError` | 422 | no |
|
|
302
|
+
| `idempotency_key_in_progress` | `IdempotencyKeyInProgressError` | 409 | yes |
|
|
303
|
+
| `job_not_found` | `JobNotFoundError` | 404 | no |
|
|
304
|
+
| `unknown_endpoint` | `UnknownEndpointError` | 404 | no |
|
|
305
|
+
| `not_found` | `NotFoundError` | 404 | no |
|
|
306
|
+
| `private_or_unavailable` | `PrivateOrUnavailableError` | 403 | no |
|
|
307
|
+
| `no_transcript` | `NoTranscriptError` | 404 | no |
|
|
308
|
+
| `no_live` | `NoLiveError` | 404 | no |
|
|
309
|
+
| `no_media` | `NoMediaError` | 404 | no |
|
|
310
|
+
| `upstream_blocked` | `UpstreamBlockedError` | 503 | yes |
|
|
311
|
+
| `upstream_error` | `UpstreamError` | 502 | yes |
|
|
312
|
+
| `overloaded` | `OverloadedError` | 503 | yes |
|
|
313
|
+
| `internal` | `InternalError` | 500 | yes |
|
|
314
|
+
|
|
315
|
+
## Retries and timeouts
|
|
316
|
+
|
|
317
|
+
Retryable failures (the codes above, connection errors, timeouts) are retried 2 times by default with
|
|
318
|
+
exponential backoff and jitter, honoring `retry-after`. A GET retry sends `max_age` set to the seconds since the first
|
|
319
|
+
attempt: if the first response was lost in transit, the retry is served free from the cache. Timeouts are per
|
|
320
|
+
attempt (default 300 s). Both are client and per-request options.
|
|
321
|
+
|
|
322
|
+
## Pagination
|
|
323
|
+
|
|
324
|
+
List endpoints return one page (`data`, `page.has_more`, `page.next_cursor`). `iterate()` returns a `Paginator` (`for await` over items, `.byPage()` for pages)
|
|
325
|
+
with two guards, `maxPages` and `maxCredits`; afterwards `pagesFetched`, `creditsCharged`, `stopReason` (`"end"`, or the guard that
|
|
326
|
+
stopped it) and `endReason` (the API's `page.end_reason`) say what happened.
|
|
327
|
+
Each page is checked against its catalog price before it is fetched, and an empty page with `has_more` is not the end.
|
|
328
|
+
|
|
329
|
+
```ts
|
|
330
|
+
const items = client.bluesky.comments.iterate({ url: "https://bsky.app/profile/atproto.com/post/3moduzldxr22q" }, { maxPages: 10, maxCredits: 100 });
|
|
331
|
+
for await (const item of items) {
|
|
332
|
+
console.log(item);
|
|
333
|
+
}
|
|
334
|
+
console.log(items.pagesFetched, items.creditsCharged, items.stopReason, items.endReason);
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Account, API keys, jobs, webhooks and events
|
|
338
|
+
|
|
339
|
+
The gateway's own routes (account, usage, credit ledger, API keys, jobs, webhook endpoints, events) are free and
|
|
340
|
+
have methods too, named from their operation IDs (`<noun>.<verb>`, or `<noun>.<sub>.<verb>` for a sub-resource). They
|
|
341
|
+
answer the same envelope (`data`, `meta`, `credits`) with their own `meta`; cursor-paged list routes have `iterate` like
|
|
342
|
+
list endpoints. Every POST sends an `idempotency-key` header (yours, or a new UUID kept for the call's retries), so it is
|
|
343
|
+
retried like a GET and a retry never repeats the work; `replayed` says when the API answered from an earlier request
|
|
344
|
+
with the same key, and `status` is 202 when accepted work continues. Each route needs a key with the scope below (a key
|
|
345
|
+
never gets a scope its creator lacks).
|
|
346
|
+
|
|
347
|
+
```ts
|
|
348
|
+
const res = await client.account.get();
|
|
349
|
+
console.log(res.data, res.meta.request_id);
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
| operation | method | scope |
|
|
353
|
+
|---|---|---|
|
|
354
|
+
| `account.get` | `client.account.get()` | `account:read` |
|
|
355
|
+
| `account.update` | `client.account.update(body)` | `admin` |
|
|
356
|
+
| `usage.list` | `client.usage.list(params)` | `account:read` |
|
|
357
|
+
| `usage.rate.list` | `client.usage.rate.list(params)` | `account:read` |
|
|
358
|
+
| `credit_transactions.list` | `client.creditTransactions.list(params)` | `account:read` |
|
|
359
|
+
| `billing.checkout.get` | `client.billing.checkout.get(id)` | `account:read` |
|
|
360
|
+
| `billing.auto_topup.get` | `client.billing.autoTopup.get()` | `account:read` |
|
|
361
|
+
| `requests.list` | `client.requests.list(params)` | `account:read` |
|
|
362
|
+
| `requests.get` | `client.requests.get(id)` | `account:read` |
|
|
363
|
+
| `requests.get_response` | `client.requests.getResponse(id)` | `account:read` |
|
|
364
|
+
| `api_keys.create` | `client.apiKeys.create(body)` | `admin` |
|
|
365
|
+
| `api_keys.list` | `client.apiKeys.list(params)` | `account:read` |
|
|
366
|
+
| `api_keys.get` | `client.apiKeys.get(id)` | `account:read` |
|
|
367
|
+
| `api_keys.update` | `client.apiKeys.update(id, body)` | `admin` |
|
|
368
|
+
| `api_keys.rotate_secret` | `client.apiKeys.rotateSecret(id, body)` | `admin` |
|
|
369
|
+
| `api_keys.revoke` | `client.apiKeys.revoke(id)` | `admin` |
|
|
370
|
+
| `jobs.create` | `client.jobs.create(body, params)` | `jobs` |
|
|
371
|
+
| `jobs.list` | `client.jobs.list(params)` | `jobs:read` |
|
|
372
|
+
| `jobs.get` | `client.jobs.get(id, params)` | `jobs:read` |
|
|
373
|
+
| `jobs.results.list` | `client.jobs.results.list(id, params)` | `jobs:read` |
|
|
374
|
+
| `jobs.cancel` | `client.jobs.cancel(id)` | `jobs` |
|
|
375
|
+
| `webhook_endpoints.create` | `client.webhookEndpoints.create(body)` | `admin` |
|
|
376
|
+
| `webhook_endpoints.list` | `client.webhookEndpoints.list(params)` | `account:read` |
|
|
377
|
+
| `webhook_endpoints.get` | `client.webhookEndpoints.get(id)` | `account:read` |
|
|
378
|
+
| `webhook_endpoints.update` | `client.webhookEndpoints.update(id, body)` | `admin` |
|
|
379
|
+
| `webhook_endpoints.delete` | `client.webhookEndpoints.delete(id)` | `admin` |
|
|
380
|
+
| `webhook_endpoints.rotate_secret` | `client.webhookEndpoints.rotateSecret(id, body)` | `admin` |
|
|
381
|
+
| `webhook_endpoints.test` | `client.webhookEndpoints.test(id)` | `admin` |
|
|
382
|
+
| `webhook_endpoints.deliveries.list` | `client.webhookEndpoints.deliveries.list(id, params)` | `account:read` |
|
|
383
|
+
| `events.list` | `client.events.list(params)` | `account:read` |
|
|
384
|
+
| `events.get` | `client.events.get(id)` | `account:read` |
|
|
385
|
+
| `events.redeliver` | `client.events.redeliver(id, body)` | `admin` |
|
|
386
|
+
| `notification_preferences.get` | `client.notificationPreferences.get()` | `account:read` |
|
|
387
|
+
| `notification_preferences.update` | `client.notificationPreferences.update(body)` | `admin` |
|
|
388
|
+
|
|
389
|
+
### Jobs and webhooks
|
|
390
|
+
|
|
391
|
+
Many requests (or one long list walk) run as a background job at the synchronous prices; failed items are
|
|
392
|
+
free. The create-and-wait helper creates one, long-polls it until it ends and returns every result; one Idempotency-Key
|
|
393
|
+
covers the create's retries, so a retry never runs a job twice. Webhook deliveries are signed per Standard Webhooks:
|
|
394
|
+
verify the raw body with your endpoint's secret before trusting it, and deduplicate on the event ID.
|
|
395
|
+
|
|
396
|
+
```ts
|
|
397
|
+
const { job, results } = await client.jobs.createAndWait({ requests: [{ custom_id: "row-1", endpoint: "tiktok.profile", params: { handle: "nasa" } }] });
|
|
398
|
+
for (const r of results) console.log(r.custom_id, r.status, r.error?.code);
|
|
399
|
+
|
|
400
|
+
// A webhook delivery: the raw body, the request headers, your endpoint's secret.
|
|
401
|
+
const event = await client.webhooks.verify(rawBody, request.headers, process.env.SOCIALTAP_WEBHOOK_SECRET!);
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
## Tools for AI agents
|
|
405
|
+
|
|
406
|
+
The SDK hands the SocialTap MCP server's tools to a model: each tool's name, description (its price
|
|
407
|
+
and rules included) and input JSON Schema, and a call that sends one stateless MCP request with your key. A tool
|
|
408
|
+
behaves exactly as it does for an MCP client: concise results (`detail: "full"` for every field), `next_cursor` to
|
|
409
|
+
continue, and failures returned as the tool's output (`error` with `retryable` and `remediation`) so the model can
|
|
410
|
+
act on them. Transport failures raise as for any request, and tools that may be repeated are retried.
|
|
411
|
+
|
|
412
|
+
```ts
|
|
413
|
+
// The Vercel AI SDK (ai is an optional peer dependency): every tool, or socialtapTools({ tools: [...] }).
|
|
414
|
+
import { generateText, stepCountIs } from "ai";
|
|
415
|
+
import { socialtapTools } from "socialtap/ai";
|
|
416
|
+
|
|
417
|
+
// model: any AI SDK model; prompt: the task. The model calls the tools, the SDK runs them with your key.
|
|
418
|
+
const { text } = await generateText({ model, tools: socialtapTools(), stopWhen: stepCountIs(5), prompt });
|
|
419
|
+
|
|
420
|
+
// Any other tool-calling API: hand TOOLS (name, description, inputSchema) to the model, run its calls with callTool.
|
|
421
|
+
import { SocialTap, TOOLS, callTool } from "socialtap";
|
|
422
|
+
|
|
423
|
+
const r = await callTool(new SocialTap(), "find_endpoint", { query: "Public TikTok profile and follower counts" });
|
|
424
|
+
console.log(r.isError, r.output);
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
| tool | what it does |
|
|
428
|
+
|---|---|
|
|
429
|
+
| `get_ad` | Get an ad |
|
|
430
|
+
| `get_ad_transcript` | Get an ad transcript |
|
|
431
|
+
| `get_comment` | Get a comment |
|
|
432
|
+
| `get_community` | Get a community |
|
|
433
|
+
| `get_download` | Get a download |
|
|
434
|
+
| `get_effect` | Get an effect |
|
|
435
|
+
| `get_embed` | Get an embed |
|
|
436
|
+
| `get_engagement` | Get an engagement |
|
|
437
|
+
| `get_event` | Get an event |
|
|
438
|
+
| `get_hashtag` | Get a hashtag |
|
|
439
|
+
| `get_live` | Get a live |
|
|
440
|
+
| `get_place` | Get a place |
|
|
441
|
+
| `get_post` | Get a post |
|
|
442
|
+
| `get_product` | Get a product |
|
|
443
|
+
| `get_profile` | Get a profile |
|
|
444
|
+
| `get_sound` | Get a sound |
|
|
445
|
+
| `get_story` | Get a story |
|
|
446
|
+
| `get_topic` | Get a topic |
|
|
447
|
+
| `get_transcript` | Get a transcript |
|
|
448
|
+
| `get_username` | Get a username |
|
|
449
|
+
| `list_ads` | List ads |
|
|
450
|
+
| `list_channel_posts` | List channel posts |
|
|
451
|
+
| `list_comments` | List comments |
|
|
452
|
+
| `list_community_posts` | List community posts |
|
|
453
|
+
| `list_effect_posts` | List effect posts |
|
|
454
|
+
| `list_events` | List events |
|
|
455
|
+
| `list_hashtag_posts` | List hashtag posts |
|
|
456
|
+
| `list_highlights` | List highlights |
|
|
457
|
+
| `list_liked_posts` | List liked posts |
|
|
458
|
+
| `list_photos` | List photos |
|
|
459
|
+
| `list_place_events` | List place events |
|
|
460
|
+
| `list_place_posts` | List place posts |
|
|
461
|
+
| `list_playlist_posts` | List playlist posts |
|
|
462
|
+
| `list_playlist_stories` | List playlist stories |
|
|
463
|
+
| `list_playlists` | List playlists |
|
|
464
|
+
| `list_posts` | List posts |
|
|
465
|
+
| `list_products` | List products |
|
|
466
|
+
| `list_profile_comments` | List profile comments |
|
|
467
|
+
| `list_reels` | List reels |
|
|
468
|
+
| `list_replies` | List replies |
|
|
469
|
+
| `list_reviews` | List reviews |
|
|
470
|
+
| `list_schedule` | List schedule |
|
|
471
|
+
| `list_similar_profiles` | List similar profiles |
|
|
472
|
+
| `list_sound_posts` | List sound posts |
|
|
473
|
+
| `list_top_ads` | List top ads |
|
|
474
|
+
| `list_top_posts` | List top posts |
|
|
475
|
+
| `list_tracks` | List tracks |
|
|
476
|
+
| `list_trending_hashtags` | List trending hashtags |
|
|
477
|
+
| `list_trending_posts` | List trending posts |
|
|
478
|
+
| `list_videos` | List videos |
|
|
479
|
+
| `search` | Search ads and advertisers and channels and comments and communities and events and groups and hashtags and places and posts and products and profiles and sounds and suggestions and top |
|
|
480
|
+
| `find_endpoint` | Find an endpoint |
|
|
481
|
+
| `search_docs` | Search the docs |
|
|
482
|
+
| `read_doc` | Read a docs page |
|
|
483
|
+
| `get_account` | Get account balance |
|
|
484
|
+
| `create_job` | Create a background job |
|
|
485
|
+
| `get_job` | Get a background job |
|
|
486
|
+
| `list_job_results` | List a job's results |
|
|
487
|
+
|
|
488
|
+
## CLI
|
|
489
|
+
|
|
490
|
+
The package's bin: every endpoint as a command (JSON on stdout; a list walk with `--all` prints one item per
|
|
491
|
+
line), the agent tools, and `init`, which sets up coding agents.
|
|
492
|
+
|
|
493
|
+
```sh
|
|
494
|
+
npx socialtap tiktok profile --handle nasa
|
|
495
|
+
npx socialtap endpoints # every command, its params and price
|
|
496
|
+
npx socialtap tool find_endpoint '{"query":"Public TikTok profile and follower counts"}'
|
|
497
|
+
npx socialtap init # Claude Code, Codex, Cursor, Gemini CLI: the Agent Skill + the MCP server
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
`init` installs the Agent Skill the site publishes (its discovery index, digest checked) into each agent's user
|
|
501
|
+
skills directory and registers the MCP server with your key (`--api-key`, or `SOCIALTAP_API_KEY`) in each agent's own user
|
|
502
|
+
config: Claude Code through `claude mcp add-json`, Codex's `config.toml`, Cursor's `mcp.json`, Gemini CLI's
|
|
503
|
+
`settings.json`. It sets up every agent it finds (`--agent <id>` to choose) and is safe to run again.
|
|
504
|
+
|
|
505
|
+
## Versioning
|
|
506
|
+
|
|
507
|
+
The version is derived from the API contract: major = API version, minor = the number of public contract facts
|
|
508
|
+
(it grows with every additive change), patch = generator revision. This package is generated: report issues, don't
|
|
509
|
+
edit it.
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type AgentId = "claude" | "codex" | "cursor" | "gemini";
|
|
2
|
+
/** What the installers touch: the user's home, their environment, subprocesses and the network. */
|
|
3
|
+
export interface SetupEnv {
|
|
4
|
+
home: string;
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
/** Runs a program; rejects with code ENOENT when it isn't installed. */
|
|
7
|
+
run(cmd: string, args: readonly string[]): Promise<{
|
|
8
|
+
code: number;
|
|
9
|
+
stdout: string;
|
|
10
|
+
stderr: string;
|
|
11
|
+
}>;
|
|
12
|
+
fetch: typeof fetch;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The MCP server to register: its name in configs, its URL and the API key sent as a bearer token. Without a key, the
|
|
16
|
+
* agent signs its person in with their browser the first time a tool needs it (OAuth).
|
|
17
|
+
*/
|
|
18
|
+
export interface McpServer {
|
|
19
|
+
name: string;
|
|
20
|
+
url: string;
|
|
21
|
+
key?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Skill {
|
|
24
|
+
name: string;
|
|
25
|
+
content: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Agent {
|
|
28
|
+
id: AgentId;
|
|
29
|
+
name: string;
|
|
30
|
+
/** Whether the agent is set up for this user (its config directory exists). */
|
|
31
|
+
detect(env: SetupEnv): boolean;
|
|
32
|
+
/** The user-level skills directory it reads. */
|
|
33
|
+
skillsDir(env: SetupEnv): string;
|
|
34
|
+
/** Registers the server in its user config (replacing an earlier entry of that name); returns what changed. */
|
|
35
|
+
addMcp(env: SetupEnv, server: McpServer): Promise<string>;
|
|
36
|
+
}
|
|
37
|
+
export declare const AGENTS: readonly Agent[];
|
|
38
|
+
/**
|
|
39
|
+
* The skills the site publishes: its Agent Skills discovery index (agentskills.io, schema 0.2.0), each SKILL.md
|
|
40
|
+
* fetched and checked against the index's sha256 digest.
|
|
41
|
+
*/
|
|
42
|
+
export declare function fetchSkills(env: SetupEnv, origin: string, indexPath: string): Promise<Skill[]>;
|
|
43
|
+
/** Writes each skill to <dir>/<name>/SKILL.md; returns the files written. */
|
|
44
|
+
export declare function writeSkills(dir: string, skills: readonly Skill[]): Promise<string[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Replaces TOML table `name` (and its sub-tables `name.*`) with `lines`, or appends it. Line-based: a table runs from
|
|
47
|
+
* its header to the next table header, which is how config.toml is written.
|
|
48
|
+
*/
|
|
49
|
+
export declare function setTomlTable(text: string, name: string, lines: readonly string[]): string;
|
|
50
|
+
/** Runs a program (the Claude Code CLI) and collects its output. */
|
|
51
|
+
export declare function runProgram(cmd: string, args: readonly string[]): Promise<{
|
|
52
|
+
code: number;
|
|
53
|
+
stdout: string;
|
|
54
|
+
stderr: string;
|
|
55
|
+
}>;
|