@apitap/core 1.8.2 → 1.9.1

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.
@@ -0,0 +1,469 @@
1
+ // src/skill/github.ts
2
+ import { execFileSync as _execFileSync } from 'node:child_process';
3
+ import { resolveAndValidateUrl as _resolveAndValidateUrl } from './ssrf.js';
4
+ // ─── Token resolution ─────────────────────────────────────────────────────────
5
+ // Indirection so tests can inject a fake without patching non-configurable
6
+ // built-in module exports.
7
+ let _execFileSyncImpl = _execFileSync;
8
+ /**
9
+ * Override the execFileSync implementation — for testing only.
10
+ * Returns the previous implementation so callers can restore it.
11
+ */
12
+ export function _setExecFileSync(impl) {
13
+ const prev = _execFileSyncImpl;
14
+ _execFileSyncImpl = impl;
15
+ return prev;
16
+ }
17
+ let cachedToken; // undefined = not yet resolved
18
+ /** Reset token cache — for testing only. */
19
+ export function resetTokenCache() {
20
+ cachedToken = undefined;
21
+ }
22
+ /**
23
+ * Resolve a GitHub token. Tries gh CLI first, then GITHUB_TOKEN env var.
24
+ * Caches the result (even null) for the session.
25
+ */
26
+ export async function resolveGitHubToken() {
27
+ if (cachedToken !== undefined)
28
+ return cachedToken;
29
+ try {
30
+ cachedToken = _execFileSyncImpl('gh', ['auth', 'token'], { timeout: 2000 })
31
+ .toString()
32
+ .trim();
33
+ if (!cachedToken) {
34
+ // gh returned empty output — treat as failure
35
+ throw new Error('empty token');
36
+ }
37
+ }
38
+ catch {
39
+ cachedToken = process.env.GITHUB_TOKEN ?? null;
40
+ }
41
+ if (cachedToken === null) {
42
+ console.error("Warning: No GitHub token found — rate limited to 60 req/hr. " +
43
+ "Run 'gh auth login' or set GITHUB_TOKEN.");
44
+ }
45
+ return cachedToken;
46
+ }
47
+ const MAX_RESPONSE_SIZE = 10 * 1024 * 1024; // 10 MB
48
+ /**
49
+ * Fetch a GitHub API path and return parsed JSON plus rate-limit metadata.
50
+ * Throws with a descriptive message on HTTP errors and size overruns.
51
+ */
52
+ export async function githubFetch(path, token) {
53
+ const url = `https://api.github.com${path}`;
54
+ const headers = {
55
+ Accept: 'application/vnd.github+json',
56
+ 'User-Agent': 'apitap-import',
57
+ };
58
+ if (token) {
59
+ headers['Authorization'] = `Bearer ${token}`;
60
+ }
61
+ const response = await fetch(url, {
62
+ headers,
63
+ signal: AbortSignal.timeout(30_000),
64
+ });
65
+ // Parse rate limit before checking status (available even on error responses).
66
+ const rateLimit = {
67
+ remaining: parseInt(response.headers.get('x-ratelimit-remaining') ?? '0', 10),
68
+ limit: parseInt(response.headers.get('x-ratelimit-limit') ?? '0', 10),
69
+ resetAt: new Date(parseInt(response.headers.get('x-ratelimit-reset') ?? '0', 10) * 1000),
70
+ };
71
+ if (!response.ok) {
72
+ if (response.status === 403 && rateLimit.remaining === 0) {
73
+ const err = new Error(`GitHub API rate limit exhausted. Resets at ${rateLimit.resetAt.toLocaleTimeString()}.` +
74
+ ` Run 'gh auth login' for higher limits.`);
75
+ err.status = 403;
76
+ throw err;
77
+ }
78
+ if (response.status === 429) {
79
+ const retryAfter = response.headers.get('retry-after');
80
+ const waitMsg = retryAfter ? ` Retry after ${retryAfter}s.` : '';
81
+ const err = new Error(`GitHub secondary rate limit hit.${waitMsg}`);
82
+ err.status = 429;
83
+ err.retryAfter = retryAfter ? parseInt(retryAfter, 10) : undefined;
84
+ throw err;
85
+ }
86
+ const err = new Error(`GitHub API ${response.status} ${response.statusText} for ${path}`);
87
+ err.status = response.status;
88
+ throw err;
89
+ }
90
+ // Size check via Content-Length header (fast path, avoids reading body).
91
+ const contentLength = response.headers.get('content-length');
92
+ if (contentLength && parseInt(contentLength, 10) > MAX_RESPONSE_SIZE) {
93
+ throw new Error(`GitHub API response too large: ${contentLength} bytes (limit: ${MAX_RESPONSE_SIZE})`);
94
+ }
95
+ const text = await response.text();
96
+ if (text.length > MAX_RESPONSE_SIZE) {
97
+ throw new Error(`GitHub API response body too large: ${text.length} bytes (limit: ${MAX_RESPONSE_SIZE})`);
98
+ }
99
+ return { data: JSON.parse(text), rateLimit };
100
+ }
101
+ // ─── Template domain normalizer ───────────────────────────────────────────────
102
+ /**
103
+ * Strips leading `{var}.` template segments from a domain name.
104
+ * e.g. "{region}.api.example.com" → "api.example.com"
105
+ */
106
+ export function normalizeTemplatedDomain(domain) {
107
+ let d = domain;
108
+ while (d.startsWith('{')) {
109
+ const next = d.replace(/^\{[^}]+\}\./, '');
110
+ if (next === d)
111
+ break; // malformed template — stop
112
+ d = next;
113
+ }
114
+ return d;
115
+ }
116
+ /**
117
+ * Pre-process spec's server URLs to normalize templated domains.
118
+ * Mutates the spec object in place — intentional, called before convertOpenAPISpec() consumes it.
119
+ */
120
+ export function normalizeSpecServerUrls(spec) {
121
+ if (!spec.servers)
122
+ return;
123
+ for (const server of spec.servers) {
124
+ if (!server.url || !server.url.includes('{'))
125
+ continue;
126
+ try {
127
+ const url = new URL(server.url);
128
+ url.hostname = normalizeTemplatedDomain(url.hostname);
129
+ server.url = url.toString();
130
+ }
131
+ catch {
132
+ // URL with leading template like https://{region}.sentry.io fails new URL()
133
+ const match = server.url.match(/^(https?:\/\/)([^/]+)(.*)/);
134
+ if (match) {
135
+ const normalized = normalizeTemplatedDomain(match[2]);
136
+ server.url = match[1] + normalized + match[3];
137
+ }
138
+ }
139
+ }
140
+ }
141
+ /** Repos not pushed to in 3 years are considered stale. */
142
+ const STALE_THRESHOLD_MS = 3 * 365 * 24 * 60 * 60 * 1000;
143
+ /**
144
+ * Run results through the metadata filter pipeline.
145
+ * Skips forks, archived repos, stale repos (>3 years, unless includeStale),
146
+ * and repos below the minStars threshold.
147
+ */
148
+ export function filterResults(results, options) {
149
+ const passed = [];
150
+ const skips = [];
151
+ for (const result of results) {
152
+ if (result.isFork) {
153
+ skips.push({ repo: result.repoFullName, reason: 'fork' });
154
+ continue;
155
+ }
156
+ if (result.isArchived) {
157
+ skips.push({ repo: result.repoFullName, reason: 'archived' });
158
+ continue;
159
+ }
160
+ if (!options.includeStale) {
161
+ const pushedMs = new Date(result.pushedAt).getTime();
162
+ if (Date.now() - pushedMs > STALE_THRESHOLD_MS) {
163
+ const pushedDate = new Date(result.pushedAt).toISOString().slice(0, 10);
164
+ skips.push({ repo: result.repoFullName, reason: `stale, last push ${pushedDate}` });
165
+ continue;
166
+ }
167
+ }
168
+ if (options.minStars !== undefined && result.stars < options.minStars) {
169
+ skips.push({ repo: result.repoFullName, reason: `${result.stars} stars, below --min-stars ${options.minStars}` });
170
+ continue;
171
+ }
172
+ passed.push(result);
173
+ }
174
+ return { passed, skips };
175
+ }
176
+ // ─── Org Scan — Hybrid: Code Search + Name-Heuristic Probe ───────────────────
177
+ export const SPEC_FILENAMES = ['openapi.json', 'openapi.yaml', 'swagger.json', 'swagger.yaml'];
178
+ // Repo name patterns that likely contain OpenAPI specs
179
+ const SPEC_REPO_PATTERNS = /(?:api-spec|api-schema|openapi|swagger|rest-api|api-schemas|openapi-spec)/i;
180
+ // Max repo pages to fetch for name-heuristic scan (100 repos/page)
181
+ const MAX_REPO_PAGES = 3;
182
+ /**
183
+ * Hybrid org scan: code search results UNION name-heuristic matches.
184
+ *
185
+ * Code search (GitHub /search/code) is unreliable — GitHub doesn't index all
186
+ * files, so repos like cloudflare/api-schemas are invisible to it. The
187
+ * name-heuristic pass lists the org's repos (sorted by stars, capped at 300)
188
+ * and probes repos whose names match API-spec patterns for spec files.
189
+ *
190
+ * Both sources dedup by htmlUrl before returning.
191
+ */
192
+ export async function searchOrgSpecs(org, token) {
193
+ const allItems = [];
194
+ const seen = new Set();
195
+ // ── Phase 1: Code search (may return sparse results) ──────────────────────
196
+ // Sequential queries — GitHub's code search has a secondary rate limit
197
+ // of 30 req/min (authenticated). Parallel fan-out risks immediate 403.
198
+ for (const filename of SPEC_FILENAMES) {
199
+ const q = encodeURIComponent(`filename:${filename} org:${org}`);
200
+ let response;
201
+ try {
202
+ response = await githubFetch(`/search/code?q=${q}&per_page=100`, token);
203
+ }
204
+ catch (err) {
205
+ if (err.status === 422) {
206
+ throw new Error(`GitHub org '${org}' not found.`);
207
+ }
208
+ // Code search rate limit or other transient error — continue to
209
+ // name-heuristic phase rather than failing entirely.
210
+ if (err.status === 403 || err.status === 429)
211
+ break;
212
+ throw err;
213
+ }
214
+ for (const item of response.data.items ?? []) {
215
+ const htmlUrl = item.html_url;
216
+ if (seen.has(htmlUrl))
217
+ continue;
218
+ seen.add(htmlUrl);
219
+ const repo = item.repository;
220
+ allItems.push({
221
+ owner: repo.owner?.login ?? org,
222
+ repo: repo.name,
223
+ repoFullName: repo.full_name,
224
+ filePath: item.path,
225
+ htmlUrl,
226
+ specUrl: `https://raw.githubusercontent.com/${repo.full_name}/${repo.default_branch ?? 'main'}/${item.path}`,
227
+ stars: repo.stargazers_count ?? 0,
228
+ isFork: repo.fork ?? false,
229
+ isArchived: repo.archived ?? false,
230
+ pushedAt: repo.pushed_at ?? '',
231
+ description: repo.description ?? '',
232
+ });
233
+ }
234
+ }
235
+ // ── Phase 2: Name-heuristic probe ─────────────────────────────────────────
236
+ // List org repos (sorted by stars, up to 300), find those whose names
237
+ // match API-spec patterns, probe each for spec files via contents API.
238
+ const probed = new Set(); // repos already found by code search
239
+ for (const item of allItems)
240
+ probed.add(item.repoFullName);
241
+ for (let page = 1; page <= MAX_REPO_PAGES; page++) {
242
+ let repos;
243
+ try {
244
+ const { data } = await githubFetch(`/orgs/${org}/repos?per_page=100&sort=stars&direction=desc&page=${page}`, token);
245
+ repos = data;
246
+ }
247
+ catch {
248
+ break; // org listing failed — we already have code search results
249
+ }
250
+ if (!Array.isArray(repos) || repos.length === 0)
251
+ break;
252
+ for (const repo of repos) {
253
+ const fullName = repo.full_name;
254
+ if (probed.has(fullName))
255
+ continue;
256
+ if (!SPEC_REPO_PATTERNS.test(repo.name))
257
+ continue;
258
+ probed.add(fullName);
259
+ const specs = await probeForSpecs(repo.owner?.login ?? org, repo.name, token);
260
+ for (const spec of specs) {
261
+ if (seen.has(spec.htmlUrl))
262
+ continue;
263
+ seen.add(spec.htmlUrl);
264
+ allItems.push({
265
+ owner: repo.owner?.login ?? org,
266
+ repo: repo.name,
267
+ repoFullName: fullName,
268
+ filePath: spec.path,
269
+ htmlUrl: spec.htmlUrl,
270
+ specUrl: `https://raw.githubusercontent.com/${fullName}/${repo.default_branch ?? 'main'}/${spec.path}`,
271
+ stars: repo.stargazers_count ?? 0,
272
+ isFork: repo.fork ?? false,
273
+ isArchived: repo.archived ?? false,
274
+ pushedAt: repo.pushed_at ?? '',
275
+ description: repo.description ?? '',
276
+ });
277
+ }
278
+ }
279
+ }
280
+ // Rank: stars desc, then path depth asc (shallower = more likely canonical)
281
+ allItems.sort((a, b) => {
282
+ if (b.stars !== a.stars)
283
+ return b.stars - a.stars;
284
+ const depthA = a.filePath.split('/').length;
285
+ const depthB = b.filePath.split('/').length;
286
+ return depthA - depthB;
287
+ });
288
+ return allItems;
289
+ }
290
+ // ─── Topic Search — Repo Discovery + Spec Probing ─────────────────────────────
291
+ export const CANONICAL_TOPICS = ['openapi-specification', 'openapi', 'openapi3', 'swagger-api'];
292
+ const PROBE_DIRS = ['', 'api', 'spec', 'docs'];
293
+ async function probeForSpecs(owner, repo, token) {
294
+ const found = [];
295
+ for (const dir of PROBE_DIRS) {
296
+ const contentsPath = dir
297
+ ? `/repos/${owner}/${repo}/contents/${dir}`
298
+ : `/repos/${owner}/${repo}/contents`;
299
+ try {
300
+ const { data } = await githubFetch(contentsPath, token);
301
+ if (!Array.isArray(data))
302
+ continue;
303
+ for (const entry of data) {
304
+ if (SPEC_FILENAMES.includes(entry.name)) {
305
+ found.push({
306
+ path: entry.path,
307
+ htmlUrl: entry.html_url,
308
+ });
309
+ }
310
+ }
311
+ }
312
+ catch {
313
+ // Directory doesn't exist or 404 — continue to next
314
+ continue;
315
+ }
316
+ // If we found specs in this dir, don't probe deeper
317
+ if (found.length > 0)
318
+ break;
319
+ }
320
+ return found;
321
+ }
322
+ export async function searchTopicSpecs(topics, token, options) {
323
+ // Fan out topic queries in parallel — repository search has more
324
+ // generous secondary rate limits than code search.
325
+ const responses = await Promise.all(topics.map(topic => githubFetch(`/search/repositories?q=${encodeURIComponent(`topic:${topic}`)}&sort=stars&order=desc&per_page=100`, token)));
326
+ // Dedup by full_name
327
+ const seen = new Set();
328
+ const repos = [];
329
+ for (const { data } of responses) {
330
+ for (const item of data.items ?? []) {
331
+ if (seen.has(item.full_name))
332
+ continue;
333
+ seen.add(item.full_name);
334
+ if (item.stargazers_count < options.minStars)
335
+ continue;
336
+ if (options.query) {
337
+ const q = options.query.toLowerCase();
338
+ const name = (item.name ?? '').toLowerCase();
339
+ const desc = (item.description ?? '').toLowerCase();
340
+ if (!name.includes(q) && !desc.includes(q))
341
+ continue;
342
+ }
343
+ repos.push({
344
+ owner: item.owner?.login,
345
+ repo: item.name,
346
+ fullName: item.full_name,
347
+ stars: item.stargazers_count ?? 0,
348
+ isFork: item.fork ?? false,
349
+ isArchived: item.archived ?? false,
350
+ pushedAt: item.pushed_at ?? '',
351
+ description: item.description ?? '',
352
+ defaultBranch: item.default_branch ?? 'main',
353
+ });
354
+ }
355
+ }
356
+ // Probe each repo for spec files
357
+ const results = [];
358
+ for (const repo of repos) {
359
+ const specs = await probeForSpecs(repo.owner, repo.repo, token);
360
+ for (const spec of specs) {
361
+ results.push({
362
+ owner: repo.owner,
363
+ repo: repo.repo,
364
+ repoFullName: repo.fullName,
365
+ filePath: spec.path,
366
+ htmlUrl: spec.htmlUrl,
367
+ specUrl: `https://raw.githubusercontent.com/${repo.fullName}/${repo.defaultBranch}/${spec.path}`,
368
+ stars: repo.stars,
369
+ isFork: repo.isFork,
370
+ isArchived: repo.isArchived,
371
+ pushedAt: repo.pushedAt,
372
+ description: repo.description,
373
+ });
374
+ }
375
+ }
376
+ // Sort by stars desc
377
+ results.sort((a, b) => b.stars - a.stars);
378
+ return results;
379
+ }
380
+ // ─── Spec content predicates ──────────────────────────────────────────────────
381
+ /**
382
+ * Returns true if the spec has a usable server URL —
383
+ * either OpenAPI 3.x `servers[0].url` or Swagger 2.0 `host`.
384
+ */
385
+ export function hasServerUrl(spec) {
386
+ if (spec.host)
387
+ return true;
388
+ if (Array.isArray(spec.servers) && spec.servers.length > 0 && spec.servers[0].url) {
389
+ return true;
390
+ }
391
+ return false;
392
+ }
393
+ // ─── SSRF DI hook ─────────────────────────────────────────────────────────────
394
+ // Indirection so tests can inject a fake resolveAndValidateUrl without network.
395
+ let _resolveAndValidateUrlImpl = _resolveAndValidateUrl;
396
+ /**
397
+ * Override the resolveAndValidateUrl implementation — for testing only.
398
+ * Returns the previous implementation so callers can restore it.
399
+ */
400
+ export function _setResolveAndValidateUrl(impl) {
401
+ const prev = _resolveAndValidateUrlImpl;
402
+ _resolveAndValidateUrlImpl = impl;
403
+ return prev;
404
+ }
405
+ // ─── Spec content fetching ────────────────────────────────────────────────────
406
+ const MAX_SPEC_SIZE = 10 * 1024 * 1024; // 10 MB
407
+ /**
408
+ * Fetch an OpenAPI spec from raw.githubusercontent.com.
409
+ * Uses direct fetch() — does NOT use githubFetch() since this is a different host.
410
+ * raw.githubusercontent.com requests do not count against the GitHub API rate limit.
411
+ * Auth token is sent to raw.githubusercontent.com (GitHub-controlled domain) for private repo support.
412
+ */
413
+ export async function fetchGitHubSpec(specUrl, token) {
414
+ const ssrf = await _resolveAndValidateUrlImpl(specUrl);
415
+ if (!ssrf.safe) {
416
+ throw new Error(`SSRF check failed for spec URL ${specUrl}: ${ssrf.reason}`);
417
+ }
418
+ const headers = { 'User-Agent': 'apitap-import' };
419
+ if (token) {
420
+ headers['Authorization'] = `Bearer ${token}`;
421
+ }
422
+ const response = await fetch(specUrl, {
423
+ headers,
424
+ signal: AbortSignal.timeout(30_000),
425
+ });
426
+ if (!response.ok) {
427
+ throw new Error(`HTTP ${response.status} ${response.statusText} for ${specUrl}`);
428
+ }
429
+ const contentLength = response.headers.get('content-length');
430
+ if (contentLength && parseInt(contentLength, 10) > MAX_SPEC_SIZE) {
431
+ throw new Error(`Spec too large: ${contentLength} bytes (limit: ${MAX_SPEC_SIZE})`);
432
+ }
433
+ const text = await response.text();
434
+ if (text.length > MAX_SPEC_SIZE) {
435
+ throw new Error(`Spec body too large: ${text.length} bytes`);
436
+ }
437
+ // Try JSON first, then YAML
438
+ try {
439
+ return JSON.parse(text);
440
+ }
441
+ catch {
442
+ const yaml = await import('js-yaml');
443
+ const parsed = yaml.load(text);
444
+ if (typeof parsed !== 'object' || parsed === null) {
445
+ throw new Error(`Invalid JSON/YAML from ${specUrl}`);
446
+ }
447
+ return parsed;
448
+ }
449
+ }
450
+ /** Placeholder domains that indicate a spec is not pointing at a real API. */
451
+ const PLACEHOLDER_HOSTS = ['localhost', '127.0.0.1', 'example.com', 'petstore.swagger.io'];
452
+ /**
453
+ * Returns true if the spec's server URL points at localhost, a loopback address,
454
+ * or a well-known placeholder domain (example.com, petstore.swagger.io).
455
+ */
456
+ export function isLocalhostSpec(spec) {
457
+ const urls = [];
458
+ if (spec.host) {
459
+ urls.push(spec.host);
460
+ }
461
+ if (Array.isArray(spec.servers)) {
462
+ for (const server of spec.servers) {
463
+ if (server.url)
464
+ urls.push(server.url);
465
+ }
466
+ }
467
+ return urls.some(u => PLACEHOLDER_HOSTS.some(ph => u.includes(ph)));
468
+ }
469
+ //# sourceMappingURL=github.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/skill/github.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE5E,iFAAiF;AAEjF,2EAA2E;AAC3E,2BAA2B;AAC3B,IAAI,iBAAiB,GAAyB,aAAa,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA0B;IACzD,MAAM,IAAI,GAAG,iBAAiB,CAAC;IAC/B,iBAAiB,GAAG,IAAI,CAAC;IACzB,OAAO,IAAI,C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CAAC,EAAE,CACnB,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAC7C,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apitap/core",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "Intercept web API traffic during browsing. Generate portable skill files so AI agents can call APIs directly instead of scraping.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",