imperium-crawl 2.1.0 → 2.2.0

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.
Files changed (48) hide show
  1. package/README.md +32 -75
  2. package/dist/cli-tui.d.ts +1 -1
  3. package/dist/cli-tui.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/config.d.ts +0 -11
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +0 -18
  9. package/dist/config.js.map +1 -1
  10. package/dist/formatters.d.ts +2 -2
  11. package/dist/formatters.js +2 -2
  12. package/dist/index.js +6 -28
  13. package/dist/index.js.map +1 -1
  14. package/dist/recipes/index.d.ts.map +1 -1
  15. package/dist/recipes/index.js +2 -0
  16. package/dist/recipes/index.js.map +1 -1
  17. package/dist/recipes/influencer-content-scout.json +14 -0
  18. package/dist/skills/manager.d.ts +1 -1
  19. package/dist/skills/manager.d.ts.map +1 -1
  20. package/dist/social/ai-fallback.d.ts +1 -1
  21. package/dist/social/ai-fallback.d.ts.map +1 -1
  22. package/dist/social/ai-fallback.js +19 -0
  23. package/dist/social/ai-fallback.js.map +1 -1
  24. package/dist/social/types.d.ts +33 -2
  25. package/dist/social/types.d.ts.map +1 -1
  26. package/dist/social/types.js +1 -1
  27. package/dist/tools/index.d.ts.map +1 -1
  28. package/dist/tools/index.js +2 -0
  29. package/dist/tools/index.js.map +1 -1
  30. package/dist/tools/instagram.d.ts +51 -0
  31. package/dist/tools/instagram.d.ts.map +1 -0
  32. package/dist/tools/instagram.js +462 -0
  33. package/dist/tools/instagram.js.map +1 -0
  34. package/dist/tools/interact.d.ts +4 -4
  35. package/dist/tools/interact.js +1 -1
  36. package/dist/tools/interact.js.map +1 -1
  37. package/dist/tools/manifest.d.ts +0 -1
  38. package/dist/tools/manifest.d.ts.map +1 -1
  39. package/dist/tools/manifest.js +8 -1
  40. package/dist/tools/manifest.js.map +1 -1
  41. package/dist/tools/run-skill.d.ts +10 -4
  42. package/dist/tools/run-skill.d.ts.map +1 -1
  43. package/dist/tools/run-skill.js +340 -18
  44. package/dist/tools/run-skill.js.map +1 -1
  45. package/dist/utils/fetcher.d.ts.map +1 -1
  46. package/dist/utils/fetcher.js +1 -3
  47. package/dist/utils/fetcher.js.map +1 -1
  48. package/package.json +3 -9
@@ -1 +1 @@
1
- {"version":3,"file":"ai-fallback.js","sourceRoot":"","sources":["../../src/social/ai-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAUlD,mCAAmC;AAEnC,MAAM,cAAc,GAAiC;IACnD,gBAAgB,EAAE,iNAAiN;IACnO,eAAe,EAAE,wOAAwO;IACzP,kBAAkB,EAAE,uHAAuH;IAC3I,oBAAoB,EAAE,mEAAmE;IACzF,iBAAiB,EAAE,+IAA+I;IAClK,eAAe,EAAE,0LAA0L;IAC3M,cAAc,EAAE,kMAAkM;IAClN,iBAAiB,EAAE,yLAAyL;IAC5M,kBAAkB,EAAE,qIAAqI;CAC1J,CAAC;AAEF,+BAA+B;AAE/B,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAI,IAKzC;IACC,IAAI,CAAC,gBAAgB,EAAE;QAAE,OAAO,IAAI,CAAC;IAErC,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,IAAI,OAAe,CAAC;IAEpB,IAAI,IAAI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,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrG,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,KAAK;QACrC,cAAc,EAAE,GAAG,CAAC,cAAc,IAAI,SAAS;QAC/C,eAAe,EAAE,CAAC;QAClB,YAAY,EAAE,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,SAAS,QAAQ,CAAC,GAAY;IAC5B,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IAClC,MAAM,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Shared types for social media tools (YouTube, Reddit).
2
+ * Shared types for social media tools (YouTube, Reddit, Instagram).
3
3
  */
4
4
  export interface SocialVideo {
5
5
  id: string;
@@ -48,8 +48,39 @@ export interface SocialProfile {
48
48
  }
49
49
  export interface SocialSearchResult<T> {
50
50
  query?: string;
51
- platform: "youtube" | "reddit";
51
+ platform: "youtube" | "reddit" | "instagram";
52
52
  results: T[];
53
53
  total?: number;
54
54
  }
55
+ export interface InstagramProfile extends SocialProfile {
56
+ username: string;
57
+ followers: number;
58
+ following: number;
59
+ posts_count: number;
60
+ is_business: boolean;
61
+ business_email?: string;
62
+ engagement_rate: number;
63
+ recent_posts: InstagramPost[];
64
+ }
65
+ export interface InstagramPost {
66
+ id: string;
67
+ url: string;
68
+ likes: number;
69
+ comments: number;
70
+ caption?: string;
71
+ timestamp: string;
72
+ is_video: boolean;
73
+ }
74
+ export interface InstagramDiscoverResult {
75
+ query: string;
76
+ location?: string;
77
+ filters: {
78
+ min_followers: number;
79
+ max_followers: number;
80
+ min_engagement: number;
81
+ };
82
+ profiles: InstagramProfile[];
83
+ total_scanned: number;
84
+ total_matched: number;
85
+ }
55
86
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/social/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,a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5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC;IAClF,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Shared types for social media tools (YouTube, Reddit).
2
+ * Shared types for social media tools (YouTube, Reddit, Instagram).
3
3
  */
4
4
  export {};
5
5
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAElB,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CACzH;AAED,eAAO,MAAM,QAAQ,EAAE,cAAc,EAkCpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAElB,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;CACzH;AAED,eAAO,MAAM,QAAQ,EAAE,cAAc,EAmCpC,CAAC"}
@@ -23,6 +23,7 @@ import * as jobStatus from "./job-status.js";
23
23
  import * as deleteJob from "./delete-job.js";
24
24
  import * as youtube from "./youtube.js";
25
25
  import * as reddit from "./reddit.js";
26
+ import * as instagram from "./instagram.js";
26
27
  export const allTools = [
27
28
  // Scraping tools (no API key needed)
28
29
  scrape,
@@ -57,5 +58,6 @@ export const allTools = [
57
58
  // Social media tools (no API key needed)
58
59
  youtube,
59
60
  reddit,
61
+ instagram,
60
62
  ];
61
63
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,K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AAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAU5C,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,qCAAqC;IACrC,MAAwB;IACxB,KAAuB;IACvB,GAAqB;IACrB,OAAyB;IACzB,WAA6B;IAC7B,UAA4B;IAC5B,sCAAsC;IACtC,MAAwB;IACxB,UAA4B;IAC5B,WAA6B;IAC7B,WAA6B;IAC7B,eAAe;IACf,WAA6B;IAC7B,QAA0B;IAC1B,UAA4B;IAC5B,sDAAsD;IACtD,YAA8B;IAC9B,QAA0B;IAC1B,gBAAkC;IAClC,oCAAoC;IACpC,SAA2B;IAC3B,kDAAkD;IAClD,QAA0B;IAC1B,QAA0B;IAC1B,mBAAmB;IACnB,WAA6B;IAC7B,QAA0B;IAC1B,SAA2B;IAC3B,SAA2B;IAC3B,yCAAyC;IACzC,OAAyB;IACzB,MAAwB;IACxB,SAA2B;CAC5B,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ export declare const name = "instagram";
3
+ export declare const description = "Search Instagram profiles, get profile details with engagement metrics, and discover influencers by niche/location. Search/discover require BRAVE_API_KEY.";
4
+ export declare const schema: z.ZodObject<{
5
+ action: z.ZodEnum<["search", "profile", "discover"]>;
6
+ query: z.ZodOptional<z.ZodString>;
7
+ location: z.ZodOptional<z.ZodString>;
8
+ niche: z.ZodOptional<z.ZodString>;
9
+ username: z.ZodOptional<z.ZodString>;
10
+ usernames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
+ min_followers: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
12
+ max_followers: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
13
+ min_engagement: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
14
+ max_days_since_post: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
15
+ limit: z.ZodDefault<z.ZodNumber>;
16
+ sort: z.ZodDefault<z.ZodEnum<["engagement", "followers"]>>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ action: "search" | "profile" | "discover";
19
+ sort: "engagement" | "followers";
20
+ limit: number;
21
+ username?: string | undefined;
22
+ query?: string | undefined;
23
+ location?: string | undefined;
24
+ niche?: string | undefined;
25
+ usernames?: string[] | undefined;
26
+ min_followers?: number | undefined;
27
+ max_followers?: number | undefined;
28
+ min_engagement?: number | undefined;
29
+ max_days_since_post?: number | undefined;
30
+ }, {
31
+ action: "search" | "profile" | "discover";
32
+ username?: string | undefined;
33
+ sort?: "engagement" | "followers" | undefined;
34
+ query?: string | undefined;
35
+ limit?: number | undefined;
36
+ location?: string | undefined;
37
+ niche?: string | undefined;
38
+ usernames?: string[] | undefined;
39
+ min_followers?: number | undefined;
40
+ max_followers?: number | undefined;
41
+ min_engagement?: number | undefined;
42
+ max_days_since_post?: number | undefined;
43
+ }>;
44
+ export type InstagramInput = z.infer<typeof schema>;
45
+ export declare function execute(input: InstagramInput): Promise<{
46
+ content: {
47
+ type: "text";
48
+ text: string;
49
+ }[];
50
+ }>;
51
+ //# sourceMappingURL=instagram.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../src/tools/instagram.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,IAAI,cAAc,CAAC;AAEhC,eAAO,MAAM,WAAW,+JACsI,CAAC;AAI/J,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBjB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAsbpD,wBAAsB,OAAO,CAAC,KAAK,EAAE,cAAc;;;;;GAgElD"}
@@ -0,0 +1,462 @@
1
+ import { z } from "zod";
2
+ import { smartFetch } from "../stealth/index.js";
3
+ import { issueRequest } from "../brave-api/index.js";
4
+ import { hasBraveApiKey } from "../config.js";
5
+ import { MAX_QUERY_LENGTH, MAX_ITEMS } from "../constants.js";
6
+ import { parseCompactNumber, sanitizeText, extractScriptJson } from "../social/parsers.js";
7
+ export const name = "instagram";
8
+ export const description = "Search Instagram profiles, get profile details with engagement metrics, and discover influencers by niche/location. Search/discover require BRAVE_API_KEY.";
9
+ const ActionEnum = z.enum(["search", "profile", "discover"]);
10
+ export const schema = z.object({
11
+ action: ActionEnum.describe("Action: search (find profiles), profile (get details), discover (full pipeline)"),
12
+ // search + discover
13
+ query: z.string().max(MAX_QUERY_LENGTH).optional().describe("Search query (for action: search)"),
14
+ location: z.string().max(200).optional().describe("Location filter, e.g. 'beograd', 'new york'"),
15
+ niche: z.string().max(500).optional().describe("Niche/industry for discovery, e.g. 'travel hotel', 'food'"),
16
+ // profile
17
+ username: z.string().max(200).optional().describe("Single username (for action: profile)"),
18
+ usernames: z.array(z.string().max(200)).max(100).optional().describe("Multiple usernames (for action: profile)"),
19
+ // filters (discover)
20
+ min_followers: z.number().min(0).default(1000).optional().describe("Minimum followers (discover filter)"),
21
+ max_followers: z.number().min(0).default(80000).optional().describe("Maximum followers (discover filter)"),
22
+ min_engagement: z.number().min(0).default(3).optional().describe("Minimum engagement rate % (discover filter)"),
23
+ max_days_since_post: z.number().min(1).default(30).optional().describe("Max days since last post (discover filter)"),
24
+ // general
25
+ limit: z.number().min(1).max(MAX_ITEMS).default(20).describe("Max results to return"),
26
+ sort: z.enum(["engagement", "followers"]).default("engagement").describe("Sort order for results"),
27
+ });
28
+ // ── Constants ──
29
+ const IG_API_BASE = "https://i.instagram.com/api/v1";
30
+ const IG_APP_ID = "936619743392459";
31
+ const IG_USER_AGENT = "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1";
32
+ // Paths that are NOT user profiles
33
+ const NON_PROFILE_PATHS = new Set([
34
+ "explore", "accounts", "about", "legal", "privacy", "terms",
35
+ "developer", "reels", "stories", "p", "reel", "tv", "direct",
36
+ "directory", "web", "challenge", "emails", "session", "nametag",
37
+ "lite", "ar", "creators", "branded_content", "shopping",
38
+ ]);
39
+ // ── Helpers ──
40
+ function sleep(ms) {
41
+ return new Promise((r) => setTimeout(r, ms));
42
+ }
43
+ function extractUsernamesFromUrls(urls) {
44
+ const usernames = new Set();
45
+ const usernameRegex = /instagram\.com\/([a-zA-Z0-9_.]{1,30})\/?(?:\?|$|#|\/)/;
46
+ for (const url of urls) {
47
+ const match = usernameRegex.exec(url);
48
+ if (match) {
49
+ const username = match[1].toLowerCase();
50
+ if (!NON_PROFILE_PATHS.has(username)) {
51
+ usernames.add(username);
52
+ }
53
+ }
54
+ }
55
+ return Array.from(usernames);
56
+ }
57
+ // ── Search via Brave ──
58
+ async function searchProfiles(query, location, limit = 20) {
59
+ if (!hasBraveApiKey()) {
60
+ throw new Error("BRAVE_API_KEY is required for instagram search/discover. Set it in your environment or run: imperium-crawl setup");
61
+ }
62
+ // Build search queries — no quotes around terms for broader results
63
+ const baseQuery = `site:instagram.com ${query}`;
64
+ const locationSuffix = location ? ` ${location}` : "";
65
+ const excludes = ' -"/p/" -"/reel/" -"/explore/"';
66
+ // Build multiple query variations to gather more profiles
67
+ const queries = [
68
+ `${baseQuery}${locationSuffix}${excludes}`,
69
+ ];
70
+ // Add variation queries for discover (when we need more results)
71
+ if (limit > 20) {
72
+ queries.push(`site:instagram.com ${query} influencer${locationSuffix}${excludes}`);
73
+ queries.push(`site:instagram.com ${query} blogger${locationSuffix}${excludes}`);
74
+ queries.push(`site:instagram.com ${query} content creator${locationSuffix}${excludes}`);
75
+ queries.push(`site:instagram.com ${query} guide${locationSuffix}${excludes}`);
76
+ }
77
+ const allUrls = [];
78
+ for (const q of queries) {
79
+ try {
80
+ const data = await issueRequest(process.env.BRAVE_API_KEY, "/web/search", {
81
+ q,
82
+ count: 20,
83
+ });
84
+ const results = data?.web?.results || [];
85
+ allUrls.push(...results.map((r) => r.url).filter(Boolean));
86
+ }
87
+ catch {
88
+ // Rate limit or other error — continue with what we have
89
+ }
90
+ // Respect Brave rate limit (Free: 1 req/sec)
91
+ if (queries.indexOf(q) < queries.length - 1) {
92
+ await sleep(1500);
93
+ }
94
+ // Stop if we have enough unique usernames
95
+ if (extractUsernamesFromUrls(allUrls).length >= limit * 2)
96
+ break;
97
+ }
98
+ return extractUsernamesFromUrls(allUrls);
99
+ }
100
+ // ── Profile Fetch — Dual Strategy ──
101
+ /** Strategy 1: Instagram internal API (fast, but rate-limited) */
102
+ async function fetchProfileViaApi(username) {
103
+ const res = await fetch(`${IG_API_BASE}/users/web_profile_info/?username=${encodeURIComponent(username)}`, {
104
+ headers: {
105
+ "x-ig-app-id": IG_APP_ID,
106
+ "User-Agent": IG_USER_AGENT,
107
+ Accept: "*/*",
108
+ },
109
+ signal: AbortSignal.timeout(15_000),
110
+ });
111
+ if (res.status === 429)
112
+ return null; // Signal to try fallback
113
+ if (!res.ok)
114
+ return null;
115
+ let data;
116
+ try {
117
+ data = await res.json();
118
+ }
119
+ catch {
120
+ return null;
121
+ }
122
+ if (data?.status === "fail" || !data?.data?.user)
123
+ return null;
124
+ return parseApiUser(data.data.user, username);
125
+ }
126
+ /** Strategy 2: Web scrape profile page — requires browser (level 3) for IG */
127
+ async function fetchProfileViaWeb(username) {
128
+ try {
129
+ const result = await smartFetch(`https://www.instagram.com/${encodeURIComponent(username)}/`, {
130
+ forceLevel: 3,
131
+ });
132
+ // Try embedded JSON first (older IG layouts)
133
+ const jsonData = extractScriptJson(result.html, "__additionalDataLoaded")
134
+ ?? extractScriptJson(result.html, "__initialData");
135
+ if (jsonData) {
136
+ const user = jsonData?.graphql?.user
137
+ ?? jsonData?.data?.user
138
+ ?? jsonData?.user;
139
+ if (user && (user.edge_followed_by || user.follower_count)) {
140
+ return parseProfileData(user, username);
141
+ }
142
+ }
143
+ // Fallback: extract from meta tags (works on current IG layout)
144
+ const metaData = extractProfileFromMeta(result.html, username);
145
+ if (metaData) {
146
+ return parseProfileData(metaData, username);
147
+ }
148
+ return null;
149
+ }
150
+ catch {
151
+ return null;
152
+ }
153
+ }
154
+ /** Extract profile data from meta tags — works on current IG layout.
155
+ * OG description format: "298M Followers, 243 Following, 1,614 Posts - See Instagram photos..." */
156
+ function extractProfileFromMeta(html, username) {
157
+ // Match og:description — try multiple patterns
158
+ const descMatch = html.match(/og:description[^>]*content="([^"]+)"/i)
159
+ ?? html.match(/og:description[^>]*content='([^']+)'/i)
160
+ ?? html.match(/<meta\s+name="description"\s+content="([^"]+)"/i);
161
+ if (!descMatch)
162
+ return null;
163
+ const desc = descMatch[1];
164
+ const followersMatch = desc.match(/([\d,.]+[KMB]?)\s*Followers/i);
165
+ const followingMatch = desc.match(/([\d,.]+[KMB]?)\s*Following/i);
166
+ const postsMatch = desc.match(/([\d,.]+[KMB]?)\s*Posts/i);
167
+ if (!followersMatch)
168
+ return null;
169
+ const followers = parseCompactNumber(followersMatch[1]);
170
+ const following = parseCompactNumber(followingMatch?.[1] || "0");
171
+ const posts = parseCompactNumber(postsMatch?.[1] || "0");
172
+ // Extract name from title: "Name (@username) • Instagram photos and videos"
173
+ const titleMatch = html.match(/<title>\s*([^<]+)/);
174
+ let name = username;
175
+ if (titleMatch) {
176
+ // Clean: remove " • Instagram..." suffix, extract before (@username)
177
+ let raw = titleMatch[1].replace(/\s*[•·|]\s*Instagram.*/i, "").trim();
178
+ const parenIdx = raw.indexOf("(@");
179
+ if (parenIdx > 0)
180
+ raw = raw.substring(0, parenIdx).trim();
181
+ if (raw)
182
+ name = raw;
183
+ }
184
+ // Extract bio from description after stats
185
+ // Format: "1,614 Posts - See Instagram photos and videos from Nike (@nike)"
186
+ // Or with bio: "1,614 Posts - Bio text here. See Instagram photos..."
187
+ let bio = "";
188
+ const afterPosts = desc.match(/Posts\s*[-–]\s*(.+)/i);
189
+ if (afterPosts) {
190
+ let rawBio = afterPosts[1];
191
+ // Remove "See Instagram photos and videos from Name (@username)" boilerplate
192
+ rawBio = rawBio.replace(/See Instagram photos and videos from .+$/i, "").trim();
193
+ // Remove trailing (@username) fragments
194
+ rawBio = rawBio.replace(/\(@?[\w.]+\)\s*$/, "").trim();
195
+ bio = sanitizeText(rawBio).substring(0, 1000);
196
+ }
197
+ return {
198
+ full_name: name,
199
+ biography: bio,
200
+ edge_followed_by: { count: isNaN(followers) ? 0 : followers },
201
+ edge_follow: { count: isNaN(following) ? 0 : following },
202
+ edge_owner_to_timeline_media: { count: isNaN(posts) ? 0 : posts, edges: [] },
203
+ is_private: false,
204
+ is_verified: html.includes('"is_verified":true'),
205
+ is_business_account: html.includes('"is_business_account":true') || html.includes('"is_professional_account":true'),
206
+ };
207
+ }
208
+ /** Parse user data from API response format */
209
+ function parseApiUser(user, username) {
210
+ if (user.is_private)
211
+ return null;
212
+ const followers = user.edge_followed_by?.count ?? 0;
213
+ const following = user.edge_follow?.count ?? 0;
214
+ const postsCount = user.edge_owner_to_timeline_media?.count ?? 0;
215
+ const edges = user.edge_owner_to_timeline_media?.edges ?? [];
216
+ const recentPosts = extractRecentPosts(edges);
217
+ const engagementRate = calcEngagement(followers, recentPosts);
218
+ return {
219
+ name: user.full_name || username,
220
+ username,
221
+ url: `https://www.instagram.com/${username}/`,
222
+ description: (user.biography || "").substring(0, 1000),
223
+ avatar: user.profile_pic_url_hd || user.profile_pic_url,
224
+ verified: user.is_verified ?? false,
225
+ followers,
226
+ following,
227
+ posts_count: postsCount,
228
+ is_business: user.is_business_account ?? user.is_professional_account ?? false,
229
+ business_email: user.business_email || undefined,
230
+ engagement_rate: engagementRate,
231
+ recent_posts: recentPosts,
232
+ };
233
+ }
234
+ /** Parse user data from web scrape (similar structure, slightly different fields) */
235
+ function parseProfileData(user, username) {
236
+ if (user.is_private)
237
+ return null;
238
+ const followers = user.edge_followed_by?.count ?? user.follower_count ?? 0;
239
+ const following = user.edge_follow?.count ?? user.following_count ?? 0;
240
+ const postsCount = user.edge_owner_to_timeline_media?.count ?? user.media_count ?? 0;
241
+ const edges = user.edge_owner_to_timeline_media?.edges ?? [];
242
+ const recentPosts = extractRecentPosts(edges);
243
+ const engagementRate = calcEngagement(followers, recentPosts);
244
+ return {
245
+ name: user.full_name || username,
246
+ username,
247
+ url: `https://www.instagram.com/${username}/`,
248
+ description: (user.biography || "").substring(0, 1000),
249
+ avatar: user.profile_pic_url_hd || user.profile_pic_url,
250
+ verified: user.is_verified ?? false,
251
+ followers,
252
+ following,
253
+ posts_count: postsCount,
254
+ is_business: user.is_business_account ?? user.is_professional_account ?? false,
255
+ business_email: user.business_email || undefined,
256
+ engagement_rate: engagementRate,
257
+ recent_posts: recentPosts,
258
+ };
259
+ }
260
+ function extractRecentPosts(edges) {
261
+ const posts = [];
262
+ for (let i = 0; i < Math.min(edges.length, 3); i++) {
263
+ const node = edges[i]?.node;
264
+ if (!node)
265
+ continue;
266
+ posts.push({
267
+ id: node.id || node.shortcode || "",
268
+ url: node.shortcode ? `https://www.instagram.com/p/${node.shortcode}/` : "",
269
+ likes: node.edge_liked_by?.count ?? node.edge_media_preview_like?.count ?? 0,
270
+ comments: node.edge_media_to_comment?.count ?? 0,
271
+ caption: sanitizeText(node.edge_media_to_caption?.edges?.[0]?.node?.text || "").substring(0, 500),
272
+ timestamp: node.taken_at_timestamp
273
+ ? new Date(node.taken_at_timestamp * 1000).toISOString()
274
+ : "",
275
+ is_video: node.is_video ?? false,
276
+ });
277
+ }
278
+ return posts;
279
+ }
280
+ function calcEngagement(followers, posts) {
281
+ if (followers <= 0 || posts.length === 0)
282
+ return 0;
283
+ const total = posts.reduce((sum, p) => sum + p.likes + p.comments, 0);
284
+ return Math.round((total / posts.length / followers) * 100 * 100) / 100;
285
+ }
286
+ /** Main fetch with fallback chain: API → Web → Meta tags */
287
+ async function fetchProfile(username) {
288
+ // Try API first (fastest)
289
+ try {
290
+ const profile = await fetchProfileViaApi(username);
291
+ if (profile)
292
+ return profile;
293
+ }
294
+ catch {
295
+ // API failed, try web fallback
296
+ }
297
+ // Fallback: web scrape profile page
298
+ try {
299
+ const profile = await fetchProfileViaWeb(username);
300
+ if (profile)
301
+ return profile;
302
+ }
303
+ catch {
304
+ // Web also failed
305
+ }
306
+ return null;
307
+ }
308
+ // ── Batch Profile Fetch ──
309
+ async function fetchProfiles(usernames, onProgress) {
310
+ const profiles = [];
311
+ let stoppedEarly = false;
312
+ let consecutiveNulls = 0;
313
+ for (let i = 0; i < usernames.length; i++) {
314
+ if (onProgress)
315
+ onProgress(i + 1, usernames.length, usernames[i]);
316
+ const profile = await fetchProfile(usernames[i]);
317
+ profiles.push(profile);
318
+ if (profile) {
319
+ consecutiveNulls = 0;
320
+ }
321
+ else {
322
+ consecutiveNulls++;
323
+ // 5 consecutive nulls likely means rate limiting — stop early
324
+ if (consecutiveNulls >= 5) {
325
+ process.stderr.write(`\n⚠️ ${consecutiveNulls} consecutive failures after ${i + 1}/${usernames.length} profiles. Likely rate-limited. Returning partial results.\n`);
326
+ stoppedEarly = true;
327
+ break;
328
+ }
329
+ }
330
+ // Rate limit: 1.5 req/sec between calls
331
+ if (i < usernames.length - 1) {
332
+ await sleep(1500);
333
+ }
334
+ }
335
+ return { profiles, stopped_early: stoppedEarly };
336
+ }
337
+ // ── Discover Pipeline ──
338
+ async function discoverInfluencers(input) {
339
+ const niche = input.niche || input.query || "";
340
+ if (!niche) {
341
+ throw new Error("niche or query is required for discover action");
342
+ }
343
+ const minFollowers = input.min_followers ?? 1000;
344
+ const maxFollowers = input.max_followers ?? 80000;
345
+ const minEngagement = input.min_engagement ?? 3;
346
+ const maxDaysSincePost = input.max_days_since_post ?? 30;
347
+ const limit = input.limit;
348
+ // Phase 1: Search for usernames
349
+ process.stderr.write(`🔍 Searching Instagram profiles for "${niche}"${input.location ? ` in ${input.location}` : ""}...\n`);
350
+ const usernames = await searchProfiles(niche, input.location, limit * 3);
351
+ if (usernames.length === 0) {
352
+ return {
353
+ query: niche,
354
+ location: input.location,
355
+ filters: { min_followers: minFollowers, max_followers: maxFollowers, min_engagement: minEngagement },
356
+ profiles: [],
357
+ total_scanned: 0,
358
+ total_matched: 0,
359
+ };
360
+ }
361
+ process.stderr.write(`📋 Found ${usernames.length} potential profiles. Fetching details...\n`);
362
+ // Phase 2: Fetch profiles with rate limiting
363
+ const { profiles: rawProfiles, stopped_early } = await fetchProfiles(usernames, (current, total, username) => {
364
+ process.stderr.write(` Fetching profile ${current}/${total}: @${username}...\r`);
365
+ });
366
+ process.stderr.write("\n");
367
+ // Phase 3: Filter
368
+ const cutoffDate = new Date();
369
+ cutoffDate.setDate(cutoffDate.getDate() - maxDaysSincePost);
370
+ const filtered = rawProfiles.filter((p) => {
371
+ if (!p)
372
+ return false;
373
+ if (p.followers < minFollowers || p.followers > maxFollowers)
374
+ return false;
375
+ if (p.engagement_rate < minEngagement)
376
+ return false;
377
+ // Check recency of last post
378
+ if (p.recent_posts.length > 0) {
379
+ const lastPost = p.recent_posts[0];
380
+ if (lastPost.timestamp && new Date(lastPost.timestamp) < cutoffDate)
381
+ return false;
382
+ }
383
+ return true;
384
+ });
385
+ // Phase 4: Sort
386
+ const sorted = filtered.sort((a, b) => input.sort === "followers"
387
+ ? b.followers - a.followers
388
+ : b.engagement_rate - a.engagement_rate);
389
+ const result = sorted.slice(0, limit);
390
+ if (stopped_early) {
391
+ process.stderr.write(`⚠️ Results may be incomplete due to rate limiting.\n`);
392
+ }
393
+ process.stderr.write(`✅ Found ${result.length} influencers matching criteria.\n`);
394
+ return {
395
+ query: niche,
396
+ location: input.location,
397
+ filters: { min_followers: minFollowers, max_followers: maxFollowers, min_engagement: minEngagement },
398
+ profiles: result,
399
+ total_scanned: rawProfiles.length,
400
+ total_matched: result.length,
401
+ };
402
+ }
403
+ // ── Execute ──
404
+ export async function execute(input) {
405
+ try {
406
+ let result;
407
+ switch (input.action) {
408
+ case "search": {
409
+ if (!input.query) {
410
+ return { content: [{ type: "text", text: JSON.stringify({ error: "query is required for search action" }) }] };
411
+ }
412
+ const usernames = await searchProfiles(input.query, input.location, input.limit);
413
+ result = {
414
+ query: input.query,
415
+ location: input.location,
416
+ platform: "instagram",
417
+ usernames,
418
+ count: usernames.length,
419
+ };
420
+ break;
421
+ }
422
+ case "profile": {
423
+ const targets = input.usernames?.length ? input.usernames : (input.username ? [input.username] : []);
424
+ if (targets.length === 0) {
425
+ return { content: [{ type: "text", text: JSON.stringify({ error: "username or usernames is required for profile action" }) }] };
426
+ }
427
+ if (targets.length === 1) {
428
+ const profile = await fetchProfile(targets[0]);
429
+ result = profile || { error: `Could not fetch profile for @${targets[0]}. Account may be private or not found.` };
430
+ }
431
+ else {
432
+ const { profiles, stopped_early } = await fetchProfiles(targets, (current, total, username) => {
433
+ process.stderr.write(` Fetching profile ${current}/${total}: @${username}...\r`);
434
+ });
435
+ process.stderr.write("\n");
436
+ const successful = profiles.filter((p) => p !== null);
437
+ result = {
438
+ profiles: successful,
439
+ total_requested: targets.length,
440
+ total_fetched: successful.length,
441
+ failed: targets.filter((_, i) => profiles[i] === null),
442
+ stopped_early,
443
+ };
444
+ }
445
+ break;
446
+ }
447
+ case "discover": {
448
+ result = await discoverInfluencers(input);
449
+ break;
450
+ }
451
+ }
452
+ return {
453
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
454
+ };
455
+ }
456
+ catch (err) {
457
+ return {
458
+ content: [{ type: "text", text: JSON.stringify({ error: err instanceof Error ? err.message : String(err) }) }],
459
+ };
460
+ }
461
+ }
462
+ //# sourceMappingURL=instagram.js.map