@bubblelab/bubble-core 0.1.142 → 0.1.143
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/dist/bubble-bundle.d.ts +174 -111
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +9 -1
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubbles/service-bubble/agi-inc.d.ts +120 -120
- package/dist/bubbles/service-bubble/ai-agent.d.ts +70 -70
- package/dist/bubbles/service-bubble/airtable.d.ts +170 -170
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +2 -2
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +8 -8
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +2 -2
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +22 -22
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-detail.d.ts +38 -38
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +52 -52
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +6 -6
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +12 -12
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +12 -12
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +126 -126
- package/dist/bubbles/service-bubble/apify/apify.d.ts +30 -30
- package/dist/bubbles/service-bubble/ashby/ashby.d.ts +62 -62
- package/dist/bubbles/service-bubble/ashby/ashby.schema.d.ts +2 -2
- package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +39 -32
- package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/browserbase/browserbase.js +66 -3
- package/dist/bubbles/service-bubble/browserbase/browserbase.js.map +1 -1
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts +44 -1
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js +19 -0
- package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js.map +1 -1
- package/dist/bubbles/service-bubble/confluence/confluence.d.ts +26 -26
- package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +90 -90
- package/dist/bubbles/service-bubble/eleven-labs.d.ts +24 -24
- package/dist/bubbles/service-bubble/firecrawl.d.ts +316 -316
- package/dist/bubbles/service-bubble/followupboss.d.ts +148 -148
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts +16 -16
- package/dist/bubbles/service-bubble/github.d.ts +88 -88
- package/dist/bubbles/service-bubble/gmail.d.ts +587 -587
- package/dist/bubbles/service-bubble/google-calendar.d.ts +28 -28
- package/dist/bubbles/service-bubble/google-drive.d.ts +98 -98
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +30 -30
- package/dist/bubbles/service-bubble/http.d.ts +22 -22
- package/dist/bubbles/service-bubble/insforge-db.d.ts +8 -8
- package/dist/bubbles/service-bubble/jira/jira.d.ts +68 -68
- package/dist/bubbles/service-bubble/jira/jira.schema.d.ts +36 -36
- package/dist/bubbles/service-bubble/notion/notion.d.ts +348 -348
- package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +8 -8
- package/dist/bubbles/service-bubble/postgresql.d.ts +8 -8
- package/dist/bubbles/service-bubble/resend.d.ts +32 -32
- package/dist/bubbles/service-bubble/salesforce/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/salesforce/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/index.js +4 -0
- package/dist/bubbles/service-bubble/salesforce/index.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.d.ts +1331 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.js +618 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.d.ts +1445 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.js +609 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.d.ts +87 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.js +181 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/slack/slack.d.ts +684 -684
- package/dist/bubbles/service-bubble/storage.d.ts +20 -20
- package/dist/bubbles/service-bubble/stripe/stripe.d.ts +111 -111
- package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts +28 -28
- package/dist/bubbles/service-bubble/telegram.d.ts +108 -108
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts +16 -16
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +8 -8
- package/dist/bubbles/tool-bubble/browser-tools/_shared/schema.d.ts +126 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/schema.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/schema.js +34 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/schema.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/utils.d.ts +22 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/utils.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/utils.js +57 -0
- package/dist/bubbles/tool-bubble/browser-tools/_shared/utils.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/index.d.ts +5 -0
- package/dist/bubbles/tool-bubble/browser-tools/index.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/index.js +5 -0
- package/dist/bubbles/tool-bubble/browser-tools/index.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/index.d.ts +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/index.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/index.js +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/index.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.d.ts +158 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.js +33 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.d.ts +161 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.js +310 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/index.d.ts +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/index.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/index.js +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/index.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/schema.d.ts +165 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/schema.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/schema.js +45 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/schema.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/tool.d.ts +171 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/tool.js +364 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-connection/tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/index.d.ts +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/index.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/index.js +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/index.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/schema.d.ts +160 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/schema.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/schema.js +24 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/schema.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/tool.d.ts +160 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/tool.js +334 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-received-invitations/tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/index.d.ts +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/index.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/index.js +3 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/index.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/schema.d.ts +152 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/schema.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/schema.js +23 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/schema.js.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/tool.d.ts +155 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/tool.js +233 -0
- package/dist/bubbles/tool-bubble/browser-tools/linkedin-sent-invitations/tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +10 -10
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +16 -16
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/linkedin-connection-tool/linkedin-connection-tool.d.ts +2 -2
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +416 -416
- package/dist/bubbles/tool-bubble/list-capabilities-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/people-search-tool.d.ts +10 -10
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +56 -56
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts +128 -128
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +2 -2
- package/dist/bubbles/tool-bubble/yc-scraper-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts +34 -34
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +12 -12
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +50 -50
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +16 -16
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +60 -60
- package/dist/bubbles.json +668 -70
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
3
|
+
export declare const AcceptedInvitationInfoSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
6
|
+
mutual_connections: z.ZodOptional<z.ZodString>;
|
|
7
|
+
profile_url: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
headline?: string | undefined;
|
|
11
|
+
profile_url?: string | undefined;
|
|
12
|
+
mutual_connections?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
name: string;
|
|
15
|
+
headline?: string | undefined;
|
|
16
|
+
profile_url?: string | undefined;
|
|
17
|
+
mutual_connections?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type AcceptedInvitationInfo = z.infer<typeof AcceptedInvitationInfoSchema>;
|
|
20
|
+
export declare const LinkedInAcceptInvitationsToolParamsSchema: z.ZodObject<{
|
|
21
|
+
operation: z.ZodLiteral<"accept_invitations">;
|
|
22
|
+
count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
23
|
+
credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
|
|
24
|
+
proxy: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"none">;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
type: "none";
|
|
28
|
+
}, {
|
|
29
|
+
type: "none";
|
|
30
|
+
}>, z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"browserbase">;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
type: "browserbase";
|
|
34
|
+
}, {
|
|
35
|
+
type: "browserbase";
|
|
36
|
+
}>, z.ZodObject<{
|
|
37
|
+
type: z.ZodLiteral<"custom">;
|
|
38
|
+
proxy: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
server: z.ZodString;
|
|
41
|
+
username: z.ZodOptional<z.ZodString>;
|
|
42
|
+
password: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
id: string;
|
|
45
|
+
server: string;
|
|
46
|
+
password?: string | undefined;
|
|
47
|
+
username?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
id: string;
|
|
50
|
+
server: string;
|
|
51
|
+
password?: string | undefined;
|
|
52
|
+
username?: string | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
type: "custom";
|
|
56
|
+
proxy: {
|
|
57
|
+
id: string;
|
|
58
|
+
server: string;
|
|
59
|
+
password?: string | undefined;
|
|
60
|
+
username?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
type: "custom";
|
|
64
|
+
proxy: {
|
|
65
|
+
id: string;
|
|
66
|
+
server: string;
|
|
67
|
+
password?: string | undefined;
|
|
68
|
+
username?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
}>]>>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
operation: "accept_invitations";
|
|
73
|
+
count: number;
|
|
74
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
75
|
+
proxy?: {
|
|
76
|
+
type: "none";
|
|
77
|
+
} | {
|
|
78
|
+
type: "browserbase";
|
|
79
|
+
} | {
|
|
80
|
+
type: "custom";
|
|
81
|
+
proxy: {
|
|
82
|
+
id: string;
|
|
83
|
+
server: string;
|
|
84
|
+
password?: string | undefined;
|
|
85
|
+
username?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
} | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
operation: "accept_invitations";
|
|
90
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
91
|
+
count?: number | undefined;
|
|
92
|
+
proxy?: {
|
|
93
|
+
type: "none";
|
|
94
|
+
} | {
|
|
95
|
+
type: "browserbase";
|
|
96
|
+
} | {
|
|
97
|
+
type: "custom";
|
|
98
|
+
proxy: {
|
|
99
|
+
id: string;
|
|
100
|
+
server: string;
|
|
101
|
+
password?: string | undefined;
|
|
102
|
+
username?: string | undefined;
|
|
103
|
+
};
|
|
104
|
+
} | undefined;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const LinkedInAcceptInvitationsToolResultSchema: z.ZodObject<{
|
|
107
|
+
operation: z.ZodLiteral<"accept_invitations">;
|
|
108
|
+
success: z.ZodBoolean;
|
|
109
|
+
accepted: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
headline: z.ZodOptional<z.ZodString>;
|
|
112
|
+
mutual_connections: z.ZodOptional<z.ZodString>;
|
|
113
|
+
profile_url: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
name: string;
|
|
116
|
+
headline?: string | undefined;
|
|
117
|
+
profile_url?: string | undefined;
|
|
118
|
+
mutual_connections?: string | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
name: string;
|
|
121
|
+
headline?: string | undefined;
|
|
122
|
+
profile_url?: string | undefined;
|
|
123
|
+
mutual_connections?: string | undefined;
|
|
124
|
+
}>, "many">>;
|
|
125
|
+
accepted_count: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
skipped_count: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
message: z.ZodOptional<z.ZodString>;
|
|
128
|
+
error: z.ZodString;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
error: string;
|
|
131
|
+
success: boolean;
|
|
132
|
+
operation: "accept_invitations";
|
|
133
|
+
message?: string | undefined;
|
|
134
|
+
accepted?: {
|
|
135
|
+
name: string;
|
|
136
|
+
headline?: string | undefined;
|
|
137
|
+
profile_url?: string | undefined;
|
|
138
|
+
mutual_connections?: string | undefined;
|
|
139
|
+
}[] | undefined;
|
|
140
|
+
accepted_count?: number | undefined;
|
|
141
|
+
skipped_count?: number | undefined;
|
|
142
|
+
}, {
|
|
143
|
+
error: string;
|
|
144
|
+
success: boolean;
|
|
145
|
+
operation: "accept_invitations";
|
|
146
|
+
message?: string | undefined;
|
|
147
|
+
accepted?: {
|
|
148
|
+
name: string;
|
|
149
|
+
headline?: string | undefined;
|
|
150
|
+
profile_url?: string | undefined;
|
|
151
|
+
mutual_connections?: string | undefined;
|
|
152
|
+
}[] | undefined;
|
|
153
|
+
accepted_count?: number | undefined;
|
|
154
|
+
skipped_count?: number | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
export type LinkedInAcceptInvitationsToolParamsInput = z.input<typeof LinkedInAcceptInvitationsToolParamsSchema>;
|
|
157
|
+
export type LinkedInAcceptInvitationsToolResult = z.output<typeof LinkedInAcceptInvitationsToolResultSchema>;
|
|
158
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAOvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQpD,CAAC;AAEH,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAC5D,OAAO,yCAAyC,CACjD,CAAC;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,yCAAyC,CACjD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
3
|
+
import { ProxyChoiceSchema } from '../_shared/schema.js';
|
|
4
|
+
export const AcceptedInvitationInfoSchema = z.object({
|
|
5
|
+
name: z
|
|
6
|
+
.string()
|
|
7
|
+
.describe('Full name of the person whose invitation was accepted'),
|
|
8
|
+
headline: z.string().optional().describe('Professional headline/tagline'),
|
|
9
|
+
mutual_connections: z.string().optional().describe('Mutual connections info'),
|
|
10
|
+
profile_url: z.string().optional().describe('LinkedIn profile URL'),
|
|
11
|
+
});
|
|
12
|
+
export const LinkedInAcceptInvitationsToolParamsSchema = z.object({
|
|
13
|
+
operation: z.literal('accept_invitations'),
|
|
14
|
+
count: z
|
|
15
|
+
.number()
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(100)
|
|
18
|
+
.optional()
|
|
19
|
+
.default(5)
|
|
20
|
+
.describe('Number of invitations to accept (default: 5, max: 100)'),
|
|
21
|
+
credentials: z.record(z.nativeEnum(CredentialType), z.string()).optional(),
|
|
22
|
+
proxy: ProxyChoiceSchema.optional(),
|
|
23
|
+
});
|
|
24
|
+
export const LinkedInAcceptInvitationsToolResultSchema = z.object({
|
|
25
|
+
operation: z.literal('accept_invitations'),
|
|
26
|
+
success: z.boolean(),
|
|
27
|
+
accepted: z.array(AcceptedInvitationInfoSchema).optional(),
|
|
28
|
+
accepted_count: z.number().optional(),
|
|
29
|
+
skipped_count: z.number().optional(),
|
|
30
|
+
message: z.string().optional(),
|
|
31
|
+
error: z.string(),
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../src/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,CAAC,uDAAuD,CAAC;IACpE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IACzE,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAC7E,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CACpE,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC1C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC1E,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,QAAQ,EAAE;IAC1D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { ToolBubble } from '../../../../types/tool-bubble-class.js';
|
|
2
|
+
import type { BubbleContext } from '../../../../types/bubble.js';
|
|
3
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
4
|
+
import { type LinkedInAcceptInvitationsToolParamsInput, type LinkedInAcceptInvitationsToolResult } from './schema.js';
|
|
5
|
+
export declare class LinkedInAcceptInvitationsTool<T extends LinkedInAcceptInvitationsToolParamsInput = LinkedInAcceptInvitationsToolParamsInput> extends ToolBubble<T, LinkedInAcceptInvitationsToolResult> {
|
|
6
|
+
static readonly bubbleName: "linkedin-accept-invitations-tool";
|
|
7
|
+
static readonly schema: import("zod").ZodObject<{
|
|
8
|
+
operation: import("zod").ZodLiteral<"accept_invitations">;
|
|
9
|
+
count: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
10
|
+
credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
|
|
11
|
+
proxy: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{
|
|
12
|
+
type: import("zod").ZodLiteral<"none">;
|
|
13
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
14
|
+
type: "none";
|
|
15
|
+
}, {
|
|
16
|
+
type: "none";
|
|
17
|
+
}>, import("zod").ZodObject<{
|
|
18
|
+
type: import("zod").ZodLiteral<"browserbase">;
|
|
19
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
20
|
+
type: "browserbase";
|
|
21
|
+
}, {
|
|
22
|
+
type: "browserbase";
|
|
23
|
+
}>, import("zod").ZodObject<{
|
|
24
|
+
type: import("zod").ZodLiteral<"custom">;
|
|
25
|
+
proxy: import("zod").ZodObject<{
|
|
26
|
+
id: import("zod").ZodString;
|
|
27
|
+
server: import("zod").ZodString;
|
|
28
|
+
username: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
31
|
+
id: string;
|
|
32
|
+
server: string;
|
|
33
|
+
password?: string | undefined;
|
|
34
|
+
username?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
id: string;
|
|
37
|
+
server: string;
|
|
38
|
+
password?: string | undefined;
|
|
39
|
+
username?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
42
|
+
type: "custom";
|
|
43
|
+
proxy: {
|
|
44
|
+
id: string;
|
|
45
|
+
server: string;
|
|
46
|
+
password?: string | undefined;
|
|
47
|
+
username?: string | undefined;
|
|
48
|
+
};
|
|
49
|
+
}, {
|
|
50
|
+
type: "custom";
|
|
51
|
+
proxy: {
|
|
52
|
+
id: string;
|
|
53
|
+
server: string;
|
|
54
|
+
password?: string | undefined;
|
|
55
|
+
username?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
}>]>>;
|
|
58
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
59
|
+
operation: "accept_invitations";
|
|
60
|
+
count: number;
|
|
61
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
62
|
+
proxy?: {
|
|
63
|
+
type: "none";
|
|
64
|
+
} | {
|
|
65
|
+
type: "browserbase";
|
|
66
|
+
} | {
|
|
67
|
+
type: "custom";
|
|
68
|
+
proxy: {
|
|
69
|
+
id: string;
|
|
70
|
+
server: string;
|
|
71
|
+
password?: string | undefined;
|
|
72
|
+
username?: string | undefined;
|
|
73
|
+
};
|
|
74
|
+
} | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
operation: "accept_invitations";
|
|
77
|
+
credentials?: Partial<Record<CredentialType, string>> | undefined;
|
|
78
|
+
count?: number | undefined;
|
|
79
|
+
proxy?: {
|
|
80
|
+
type: "none";
|
|
81
|
+
} | {
|
|
82
|
+
type: "browserbase";
|
|
83
|
+
} | {
|
|
84
|
+
type: "custom";
|
|
85
|
+
proxy: {
|
|
86
|
+
id: string;
|
|
87
|
+
server: string;
|
|
88
|
+
password?: string | undefined;
|
|
89
|
+
username?: string | undefined;
|
|
90
|
+
};
|
|
91
|
+
} | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
static readonly resultSchema: import("zod").ZodObject<{
|
|
94
|
+
operation: import("zod").ZodLiteral<"accept_invitations">;
|
|
95
|
+
success: import("zod").ZodBoolean;
|
|
96
|
+
accepted: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
97
|
+
name: import("zod").ZodString;
|
|
98
|
+
headline: import("zod").ZodOptional<import("zod").ZodString>;
|
|
99
|
+
mutual_connections: import("zod").ZodOptional<import("zod").ZodString>;
|
|
100
|
+
profile_url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
101
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
102
|
+
name: string;
|
|
103
|
+
headline?: string | undefined;
|
|
104
|
+
profile_url?: string | undefined;
|
|
105
|
+
mutual_connections?: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
name: string;
|
|
108
|
+
headline?: string | undefined;
|
|
109
|
+
profile_url?: string | undefined;
|
|
110
|
+
mutual_connections?: string | undefined;
|
|
111
|
+
}>, "many">>;
|
|
112
|
+
accepted_count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
113
|
+
skipped_count: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
114
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
115
|
+
error: import("zod").ZodString;
|
|
116
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
117
|
+
operation: "accept_invitations";
|
|
118
|
+
error: string;
|
|
119
|
+
success: boolean;
|
|
120
|
+
message?: string | undefined;
|
|
121
|
+
accepted?: {
|
|
122
|
+
name: string;
|
|
123
|
+
headline?: string | undefined;
|
|
124
|
+
profile_url?: string | undefined;
|
|
125
|
+
mutual_connections?: string | undefined;
|
|
126
|
+
}[] | undefined;
|
|
127
|
+
accepted_count?: number | undefined;
|
|
128
|
+
skipped_count?: number | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
operation: "accept_invitations";
|
|
131
|
+
error: string;
|
|
132
|
+
success: boolean;
|
|
133
|
+
message?: string | undefined;
|
|
134
|
+
accepted?: {
|
|
135
|
+
name: string;
|
|
136
|
+
headline?: string | undefined;
|
|
137
|
+
profile_url?: string | undefined;
|
|
138
|
+
mutual_connections?: string | undefined;
|
|
139
|
+
}[] | undefined;
|
|
140
|
+
accepted_count?: number | undefined;
|
|
141
|
+
skipped_count?: number | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
static readonly shortDescription = "Accept top N LinkedIn connection invitations";
|
|
144
|
+
static readonly longDescription = "Navigates to the LinkedIn invitation manager page and accepts the top N received connection invitations. Returns info about each accepted invitation.";
|
|
145
|
+
static readonly alias = "linkedin-accept-invitations";
|
|
146
|
+
static readonly type = "tool";
|
|
147
|
+
private sessionId;
|
|
148
|
+
private contextId;
|
|
149
|
+
private cookies;
|
|
150
|
+
constructor(params?: T, context?: BubbleContext);
|
|
151
|
+
protected chooseCredential(): string | undefined;
|
|
152
|
+
private stepStartBrowserSession;
|
|
153
|
+
private stepNavigateToInvitationManager;
|
|
154
|
+
private stepWaitForInvitationsPage;
|
|
155
|
+
private stepAcceptTopInvitations;
|
|
156
|
+
private stepEndBrowserSession;
|
|
157
|
+
private evaluate;
|
|
158
|
+
private detectIPAddress;
|
|
159
|
+
performAction(): Promise<LinkedInAcceptInvitationsToolResult>;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../../src/bubbles/tool-bubble/browser-tools/linkedin-accept-invitations/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAKjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAGL,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,EAEzC,MAAM,aAAa,CAAC;AAErB,qBAAa,6BAA6B,CACxC,CAAC,SACC,wCAAwC,GAAG,wCAAwC,CACrF,SAAQ,UAAU,CAAC,CAAC,EAAE,mCAAmC,CAAC;IAC1D,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAG,kCAAkC,CAAU;IACzE,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA6C;IACnE,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA6C;IACzE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,kDACiB;IACjD,MAAM,CAAC,QAAQ,CAAC,eAAe,2JAC2H;IAC1J,MAAM,CAAC,QAAQ,CAAC,KAAK,iCAAiC;IACtD,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAE9B,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,OAAO,CAA4B;gBAGzC,MAAM,GAAE,CAA4C,EACpD,OAAO,CAAC,EAAE,aAAa;IAKzB,SAAS,CAAC,gBAAgB,IAAI,MAAM,GAAG,SAAS;YAOlC,uBAAuB;YAgCvB,+BAA+B;YAkB/B,0BAA0B;YAqB1B,wBAAwB;YAkLxB,qBAAqB;YAYrB,QAAQ;YAaR,eAAe;IAiBvB,aAAa,IAAI,OAAO,CAAC,mCAAmC,CAAC;CA+BpE"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { ToolBubble } from '../../../../types/tool-bubble-class.js';
|
|
2
|
+
import { BrowserBaseBubble, } from '../../../service-bubble/browserbase/index.js';
|
|
3
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
4
|
+
import { parseBrowserSessionData, buildProxyConfig } from '../_shared/utils.js';
|
|
5
|
+
import { LinkedInAcceptInvitationsToolParamsSchema, LinkedInAcceptInvitationsToolResultSchema, } from './schema.js';
|
|
6
|
+
export class LinkedInAcceptInvitationsTool extends ToolBubble {
|
|
7
|
+
static bubbleName = 'linkedin-accept-invitations-tool';
|
|
8
|
+
static schema = LinkedInAcceptInvitationsToolParamsSchema;
|
|
9
|
+
static resultSchema = LinkedInAcceptInvitationsToolResultSchema;
|
|
10
|
+
static shortDescription = 'Accept top N LinkedIn connection invitations';
|
|
11
|
+
static longDescription = 'Navigates to the LinkedIn invitation manager page and accepts the top N received connection invitations. Returns info about each accepted invitation.';
|
|
12
|
+
static alias = 'linkedin-accept-invitations';
|
|
13
|
+
static type = 'tool';
|
|
14
|
+
sessionId = null;
|
|
15
|
+
contextId = null;
|
|
16
|
+
cookies = null;
|
|
17
|
+
constructor(params = { operation: 'accept_invitations' }, context) {
|
|
18
|
+
super(params, context);
|
|
19
|
+
}
|
|
20
|
+
chooseCredential() {
|
|
21
|
+
const { credentials } = this.params;
|
|
22
|
+
return credentials?.[CredentialType.LINKEDIN_CRED];
|
|
23
|
+
}
|
|
24
|
+
async stepStartBrowserSession() {
|
|
25
|
+
if (this.sessionId)
|
|
26
|
+
return;
|
|
27
|
+
const sessionData = parseBrowserSessionData(this.chooseCredential());
|
|
28
|
+
if (sessionData) {
|
|
29
|
+
this.contextId = sessionData.contextId;
|
|
30
|
+
this.cookies = sessionData.cookies;
|
|
31
|
+
}
|
|
32
|
+
const proxyConfig = buildProxyConfig(this.params.proxy);
|
|
33
|
+
const browserbase = new BrowserBaseBubble({
|
|
34
|
+
operation: 'start_session',
|
|
35
|
+
context_id: this.contextId || undefined,
|
|
36
|
+
cookies: this.cookies || undefined,
|
|
37
|
+
credentials: this.params.credentials,
|
|
38
|
+
stealth: { solveCaptchas: true },
|
|
39
|
+
timeout_seconds: 600,
|
|
40
|
+
...proxyConfig,
|
|
41
|
+
}, this.context, 'startsession');
|
|
42
|
+
const result = await browserbase.action();
|
|
43
|
+
if (!result.data.success || !result.data.session_id) {
|
|
44
|
+
throw new Error(result.data.error || 'Failed to start browser session');
|
|
45
|
+
}
|
|
46
|
+
this.sessionId = result.data.session_id;
|
|
47
|
+
if (result.data.context_id)
|
|
48
|
+
this.contextId = result.data.context_id;
|
|
49
|
+
console.log(`[AcceptInvitations] Session started: ${this.sessionId}`);
|
|
50
|
+
const ip = await this.detectIPAddress();
|
|
51
|
+
if (ip)
|
|
52
|
+
console.log(`[AcceptInvitations] Browser IP: ${ip}`);
|
|
53
|
+
}
|
|
54
|
+
async stepNavigateToInvitationManager() {
|
|
55
|
+
if (!this.sessionId)
|
|
56
|
+
throw new Error('No active session');
|
|
57
|
+
const browserbase = new BrowserBaseBubble({
|
|
58
|
+
operation: 'navigate',
|
|
59
|
+
session_id: this.sessionId,
|
|
60
|
+
url: 'https://www.linkedin.com/mynetwork/invitation-manager/',
|
|
61
|
+
wait_until: 'domcontentloaded',
|
|
62
|
+
timeout: 30000,
|
|
63
|
+
}, this.context, 'navigate');
|
|
64
|
+
const result = await browserbase.action();
|
|
65
|
+
if (!result.data.success)
|
|
66
|
+
throw new Error(result.data.error || 'Navigation failed');
|
|
67
|
+
}
|
|
68
|
+
async stepWaitForInvitationsPage() {
|
|
69
|
+
const checkScript = `(() => {
|
|
70
|
+
const buttons = document.querySelectorAll('button');
|
|
71
|
+
let hasAcceptButton = false;
|
|
72
|
+
for (const btn of buttons) {
|
|
73
|
+
if ((btn.innerText || btn.textContent || '').trim().toLowerCase() === 'accept') {
|
|
74
|
+
hasAcceptButton = true;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const peopleLabel = document.body.innerText.match(/People\\s*\\(\\d+\\)/i);
|
|
79
|
+
return hasAcceptButton || !!peopleLabel;
|
|
80
|
+
})()`;
|
|
81
|
+
for (let attempt = 1; attempt <= 15; attempt++) {
|
|
82
|
+
const found = await this.evaluate(checkScript);
|
|
83
|
+
if (found)
|
|
84
|
+
return true;
|
|
85
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
async stepAcceptTopInvitations(count) {
|
|
90
|
+
const accepted = [];
|
|
91
|
+
let skipped = 0;
|
|
92
|
+
const TEMP_ID = '__bubblelab_accept_target__';
|
|
93
|
+
for (let i = 0; i < count; i++) {
|
|
94
|
+
// Step 1: Find first visible Accept button, extract card info, tag it with a temp ID
|
|
95
|
+
const extractResult = (await this.evaluate(`
|
|
96
|
+
(() => {
|
|
97
|
+
// Clean up any previous temp ID
|
|
98
|
+
const prev = document.getElementById('${TEMP_ID}');
|
|
99
|
+
if (prev) prev.removeAttribute('id');
|
|
100
|
+
|
|
101
|
+
const acceptButtons = Array.from(document.querySelectorAll('button')).filter(btn => {
|
|
102
|
+
const text = (btn.innerText || btn.textContent || '').trim().toLowerCase();
|
|
103
|
+
return text === 'accept' && btn.offsetParent !== null && !btn.disabled;
|
|
104
|
+
});
|
|
105
|
+
if (acceptButtons.length === 0) return { done: true, buttonCount: 0 };
|
|
106
|
+
|
|
107
|
+
const acceptBtn = acceptButtons[0];
|
|
108
|
+
|
|
109
|
+
// Tag the button with a temp ID so Puppeteer can click it precisely
|
|
110
|
+
acceptBtn.id = '${TEMP_ID}';
|
|
111
|
+
|
|
112
|
+
// Scroll the button into view
|
|
113
|
+
acceptBtn.scrollIntoView({ block: 'center', behavior: 'instant' });
|
|
114
|
+
|
|
115
|
+
// Walk up to find the invitation card container
|
|
116
|
+
let container = acceptBtn.parentElement;
|
|
117
|
+
for (let j = 0; j < 10 && container; j++) {
|
|
118
|
+
const text = container.innerText || '';
|
|
119
|
+
const hasProfileLink = !!container.querySelector('a[href*="/in/"]');
|
|
120
|
+
const hasTimeText = !!(text.match(/\\d+\\s+(hour|day|week|month|minute|second)s?\\s+ago/i) || text.match(/Yesterday/i));
|
|
121
|
+
if (hasProfileLink && hasTimeText) break;
|
|
122
|
+
container = container.parentElement;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
let name = '';
|
|
126
|
+
let headline = '';
|
|
127
|
+
let mutual_connections = '';
|
|
128
|
+
let profile_url = '';
|
|
129
|
+
|
|
130
|
+
if (container) {
|
|
131
|
+
const links = container.querySelectorAll('a[href*="/in/"]');
|
|
132
|
+
for (const link of links) {
|
|
133
|
+
const href = link.getAttribute('href') || '';
|
|
134
|
+
if (href.includes('/in/')) {
|
|
135
|
+
profile_url = href.startsWith('http') ? href : 'https://www.linkedin.com' + href;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
for (const link of links) {
|
|
140
|
+
const linkText = (link.innerText || link.textContent || '').trim();
|
|
141
|
+
if (linkText && linkText.length > 1 && linkText.length < 100) {
|
|
142
|
+
name = linkText;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (!name) {
|
|
147
|
+
const spans = container.querySelectorAll('span');
|
|
148
|
+
for (const span of spans) {
|
|
149
|
+
const spanText = (span.innerText || span.textContent || '').trim();
|
|
150
|
+
if (spanText && spanText.length > 2 && spanText.length < 50 &&
|
|
151
|
+
!spanText.includes('Accept') && !spanText.includes('Ignore') &&
|
|
152
|
+
!spanText.includes('mutual') && !spanText.includes('ago') &&
|
|
153
|
+
!spanText.includes('Yesterday')) {
|
|
154
|
+
name = spanText;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const containerText = container.innerText || '';
|
|
161
|
+
const mutualMatch = containerText.match(/(.+?(?:mutual connection|mutual connections))/i);
|
|
162
|
+
if (mutualMatch) mutual_connections = mutualMatch[0].trim();
|
|
163
|
+
|
|
164
|
+
const lines = containerText.split('\\n').map(l => l.trim()).filter(l => l);
|
|
165
|
+
let nameLineIdx = -1, endLineIdx = -1;
|
|
166
|
+
for (let k = 0; k < lines.length; k++) {
|
|
167
|
+
if (lines[k] === name) nameLineIdx = k;
|
|
168
|
+
if (endLineIdx === -1 && (
|
|
169
|
+
lines[k].match(/\\d+\\s+(hour|day|week|month|minute|second)s?\\s+ago/i) ||
|
|
170
|
+
lines[k].match(/Yesterday/i) ||
|
|
171
|
+
lines[k].match(/mutual connection/i)
|
|
172
|
+
)) endLineIdx = k;
|
|
173
|
+
}
|
|
174
|
+
if (nameLineIdx >= 0 && endLineIdx > nameLineIdx + 1) {
|
|
175
|
+
headline = lines.slice(nameLineIdx + 1, endLineIdx)
|
|
176
|
+
.filter(l => l.toLowerCase() !== 'accept' && l.toLowerCase() !== 'ignore' && l.length > 3)
|
|
177
|
+
.join(' ').trim();
|
|
178
|
+
}
|
|
179
|
+
if (!headline) {
|
|
180
|
+
for (const line of lines) {
|
|
181
|
+
if (line === name || line.toLowerCase() === 'accept' || line.toLowerCase() === 'ignore' ||
|
|
182
|
+
line.match(/\\d+\\s+(hour|day|week|month|minute|second)s?\\s+ago/i) ||
|
|
183
|
+
line.match(/Yesterday/i) || line.match(/mutual connection/i) ||
|
|
184
|
+
line.match(/^People\\s*\\(/i) || line.match(/^Message$/i)) continue;
|
|
185
|
+
if (line.length > 10 && line.length < 300) { headline = line; break; }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
done: false,
|
|
192
|
+
buttonCount: acceptButtons.length,
|
|
193
|
+
info: {
|
|
194
|
+
name: name || 'Unknown',
|
|
195
|
+
headline: headline || undefined,
|
|
196
|
+
mutual_connections: mutual_connections || undefined,
|
|
197
|
+
profile_url: profile_url || undefined,
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
})()
|
|
201
|
+
`));
|
|
202
|
+
if (extractResult.done) {
|
|
203
|
+
console.log(`[AcceptInvitations] No more invitations to accept after ${accepted.length}`);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
const prevButtonCount = extractResult.buttonCount;
|
|
207
|
+
// Step 2: Click the tagged button using BrowserBase (Puppeteer trusted click)
|
|
208
|
+
if (!this.sessionId)
|
|
209
|
+
throw new Error('No active session');
|
|
210
|
+
const clickBubble = new BrowserBaseBubble({
|
|
211
|
+
operation: 'click',
|
|
212
|
+
session_id: this.sessionId,
|
|
213
|
+
selector: `#${TEMP_ID}`,
|
|
214
|
+
wait_for_navigation: false,
|
|
215
|
+
timeout: 5000,
|
|
216
|
+
}, this.context, 'clickaccept');
|
|
217
|
+
const clickResult = await clickBubble.action();
|
|
218
|
+
if (!clickResult.data.success) {
|
|
219
|
+
console.log(`[AcceptInvitations] Click failed for invitation ${i + 1}, skipping`);
|
|
220
|
+
skipped++;
|
|
221
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (extractResult.info) {
|
|
225
|
+
accepted.push(extractResult.info);
|
|
226
|
+
console.log(`[AcceptInvitations] Accepted ${i + 1}/${count}: ${extractResult.info.name}`);
|
|
227
|
+
}
|
|
228
|
+
// Step 3: Wait for DOM to update — poll until Accept button count decreases
|
|
229
|
+
const MAX_WAIT_POLLS = 15;
|
|
230
|
+
for (let poll = 0; poll < MAX_WAIT_POLLS; poll++) {
|
|
231
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
232
|
+
const currentCount = (await this.evaluate(`
|
|
233
|
+
Array.from(document.querySelectorAll('button')).filter(btn => {
|
|
234
|
+
const text = (btn.innerText || btn.textContent || '').trim().toLowerCase();
|
|
235
|
+
return text === 'accept' && btn.offsetParent !== null && !btn.disabled;
|
|
236
|
+
}).length
|
|
237
|
+
`));
|
|
238
|
+
if (currentCount < prevButtonCount)
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return { accepted, skipped };
|
|
243
|
+
}
|
|
244
|
+
async stepEndBrowserSession() {
|
|
245
|
+
if (!this.sessionId)
|
|
246
|
+
return;
|
|
247
|
+
const browserbase = new BrowserBaseBubble({ operation: 'end_session', session_id: this.sessionId }, this.context, 'endsession');
|
|
248
|
+
await browserbase.action();
|
|
249
|
+
console.log(`[AcceptInvitations] Session ended: ${this.sessionId}`);
|
|
250
|
+
this.sessionId = null;
|
|
251
|
+
}
|
|
252
|
+
async evaluate(script) {
|
|
253
|
+
if (!this.sessionId)
|
|
254
|
+
throw new Error('No active session');
|
|
255
|
+
const browserbase = new BrowserBaseBubble({ operation: 'evaluate', session_id: this.sessionId, script }, this.context, 'evaluate');
|
|
256
|
+
const result = await browserbase.action();
|
|
257
|
+
if (!result.data.success)
|
|
258
|
+
throw new Error(result.data.error || 'Evaluation failed');
|
|
259
|
+
return result.data.result;
|
|
260
|
+
}
|
|
261
|
+
async detectIPAddress() {
|
|
262
|
+
if (!this.sessionId)
|
|
263
|
+
return null;
|
|
264
|
+
try {
|
|
265
|
+
return (await this.evaluate(`
|
|
266
|
+
(async () => {
|
|
267
|
+
try {
|
|
268
|
+
const r = await fetch('https://api.ipify.org?format=json');
|
|
269
|
+
const d = await r.json();
|
|
270
|
+
return d.ip;
|
|
271
|
+
} catch { return null; }
|
|
272
|
+
})()
|
|
273
|
+
`));
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
async performAction() {
|
|
280
|
+
const count = this.params.count ?? 5;
|
|
281
|
+
try {
|
|
282
|
+
await this.stepStartBrowserSession();
|
|
283
|
+
await this.stepNavigateToInvitationManager();
|
|
284
|
+
const pageReady = await this.stepWaitForInvitationsPage();
|
|
285
|
+
if (!pageReady)
|
|
286
|
+
console.log('[AcceptInvitations] Page slow to load, continuing');
|
|
287
|
+
const { accepted, skipped } = await this.stepAcceptTopInvitations(count);
|
|
288
|
+
return {
|
|
289
|
+
operation: 'accept_invitations',
|
|
290
|
+
success: true,
|
|
291
|
+
accepted,
|
|
292
|
+
accepted_count: accepted.length,
|
|
293
|
+
skipped_count: skipped,
|
|
294
|
+
message: `Accepted ${accepted.length} invitation(s)${skipped > 0 ? `, skipped ${skipped}` : ''}`,
|
|
295
|
+
error: '',
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
return {
|
|
300
|
+
operation: 'accept_invitations',
|
|
301
|
+
success: false,
|
|
302
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
finally {
|
|
306
|
+
await this.stepEndBrowserSession();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=tool.js.map
|