orangeslice 2.4.0-beta.1 → 2.4.1-beta.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.
package/README.md CHANGED
@@ -58,13 +58,23 @@ yarn add orangeslice
58
58
  import { integrations, skills } from "orangeslice";
59
59
 
60
60
  // Connect a third-party service (opens browser for OAuth)
61
- const hubspot = await integrations.connect("hubspot");
61
+ await integrations.connect("hubspot");
62
+
63
+ // Execute integration methods directly
64
+ const contact = await integrations.hubspot.createContact({
65
+ properties: { email: "john@acme.com", firstname: "John" }
66
+ });
67
+ await integrations.instantly.addLeadsToCampaign({
68
+ campaignId: "abc-123",
69
+ leads: [{ email: "lead@company.com" }]
70
+ });
71
+ await integrations.slack.chatPostMessage({ channel: "#leads", text: "New lead!" });
62
72
 
63
73
  // List connected integrations
64
74
  const { integrations: list } = await integrations.list();
65
75
 
66
76
  // Create a knowledge skill
67
- await skills.create({ name: "ICP", content: "B2B SaaS, 50-500 employees..." });
77
+ await skills.create({ title: "ICP", description: "Ideal customer profile criteria", content: "B2B SaaS, 50-500 employees..." });
68
78
  ```
69
79
 
70
80
  ## Public API (services-first)
package/dist/cli.js CHANGED
@@ -208,6 +208,8 @@ Do not call a service before reading its documentation.
208
208
 
209
209
  ## Integration & Skill Management
210
210
  - To connect a third-party service, use \`integrations.connect(provider)\`. This opens the browser for OAuth (HubSpot, Salesforce, Attio, Gmail, Slack) or prompts for an API key (Instantly, HeyReach).
211
+ - To execute integration methods, use \`integrations.<provider>.<method>(args)\` — e.g. \`integrations.hubspot.createContact({...})\`, \`integrations.instantly.addLeadsToCampaign({...})\`.
212
+ - **Always read the per-method docs** at \`./integrations/<provider>/<method>.md\` before calling any integration method. Do not guess parameters.
211
213
  - To list connected integrations, use \`integrations.list()\`.
212
214
  - To manage knowledge skills (ICP descriptions, templates, etc.), use \`skills.create/list/update/delete\`.
213
215
  - Read \`./services/integrations/index.md\` and \`./services/skills/index.md\` for full API details.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { configure } from "./api";
2
2
  export type { OrangesliceConfig } from "./api";
3
3
  export { integrations } from "./integrations";
4
- export type { Integration, IntegrationProvider, IntegrationListParams, IntegrationCreateParams, IntegrationUpdateParams, IntegrationConnectOptions } from "./integrations";
4
+ export type { Integration, IntegrationProvider, IntegrationListParams, IntegrationCreateParams, IntegrationUpdateParams, IntegrationConnectOptions, IntegrationExecuteOptions } from "./integrations";
5
5
  export { skills } from "./skills";
6
6
  export type { Skill, SkillListParams, SkillCreateParams, SkillUpdateParams } from "./skills";
7
7
  export { findCareersPage, scrapeCareersPage } from "./careers";
@@ -110,6 +110,15 @@ export declare const services: {
110
110
  delete: (id: string) => Promise<{
111
111
  success: boolean;
112
112
  }>;
113
+ execute: (provider: import("./integrations").IntegrationProvider, method: string, ...args: unknown[]) => Promise<unknown>;
114
+ } & {
115
+ readonly hubspot: Record<string, (...args: unknown[]) => Promise<unknown>>;
116
+ readonly salesforce: Record<string, (...args: unknown[]) => Promise<unknown>>;
117
+ readonly attio: Record<string, (...args: unknown[]) => Promise<unknown>>;
118
+ readonly gmail: Record<string, (...args: unknown[]) => Promise<unknown>>;
119
+ readonly slack: Record<string, (...args: unknown[]) => Promise<unknown>>;
120
+ readonly instantly: Record<string, (...args: unknown[]) => Promise<unknown>>;
121
+ readonly heyreach: Record<string, (...args: unknown[]) => Promise<unknown>>;
113
122
  };
114
123
  skills: {
115
124
  list: (opts?: import("./skills").SkillListParams) => Promise<{
@@ -7,6 +7,10 @@
7
7
  * // Connect an OAuth provider (opens browser)
8
8
  * const hubspot = await integrations.connect("hubspot");
9
9
  *
10
+ * // Execute integration methods
11
+ * await integrations.hubspot.createContact({ properties: { email: "j@acme.com" } });
12
+ * await integrations.instantly.addLeadsToCampaign({ campaignId: "abc", leads: [...] });
13
+ *
10
14
  * // List connected integrations
11
15
  * const { integrations: list } = await integrations.list();
12
16
  *
@@ -46,7 +50,11 @@ export interface IntegrationUpdateParams {
46
50
  export interface IntegrationConnectOptions {
47
51
  noBrowser?: boolean;
48
52
  }
49
- export declare const integrations: {
53
+ export interface IntegrationExecuteOptions {
54
+ spreadsheetId?: string;
55
+ integrationId?: string;
56
+ }
57
+ declare const integrationsBase: {
50
58
  connect: (provider: IntegrationProvider, opts?: IntegrationConnectOptions) => Promise<Integration>;
51
59
  list: (opts?: IntegrationListParams) => Promise<{
52
60
  integrations: Integration[];
@@ -57,4 +65,15 @@ export declare const integrations: {
57
65
  delete: (id: string) => Promise<{
58
66
  success: boolean;
59
67
  }>;
68
+ execute: (provider: IntegrationProvider, method: string, ...args: unknown[]) => Promise<unknown>;
69
+ };
70
+ export declare const integrations: typeof integrationsBase & {
71
+ readonly hubspot: Record<string, (...args: unknown[]) => Promise<unknown>>;
72
+ readonly salesforce: Record<string, (...args: unknown[]) => Promise<unknown>>;
73
+ readonly attio: Record<string, (...args: unknown[]) => Promise<unknown>>;
74
+ readonly gmail: Record<string, (...args: unknown[]) => Promise<unknown>>;
75
+ readonly slack: Record<string, (...args: unknown[]) => Promise<unknown>>;
76
+ readonly instantly: Record<string, (...args: unknown[]) => Promise<unknown>>;
77
+ readonly heyreach: Record<string, (...args: unknown[]) => Promise<unknown>>;
60
78
  };
79
+ export {};
@@ -8,6 +8,10 @@
8
8
  * // Connect an OAuth provider (opens browser)
9
9
  * const hubspot = await integrations.connect("hubspot");
10
10
  *
11
+ * // Execute integration methods
12
+ * await integrations.hubspot.createContact({ properties: { email: "j@acme.com" } });
13
+ * await integrations.instantly.addLeadsToCampaign({ campaignId: "abc", leads: [...] });
14
+ *
11
15
  * // List connected integrations
12
16
  * const { integrations: list } = await integrations.list();
13
17
  *
@@ -94,14 +98,46 @@ async function connectIntegration(provider, opts) {
94
98
  }
95
99
  throw new Error(`[orangeslice] integrations.connect: Timed out waiting for authorization.`);
96
100
  }
101
+ function executeMethod(provider, method, args, opts) {
102
+ return (0, api_1.post)("/execute/integration", {
103
+ provider,
104
+ method,
105
+ args,
106
+ ...(opts?.spreadsheetId ? { spreadsheetId: opts.spreadsheetId } : {}),
107
+ ...(opts?.integrationId ? { integrationId: opts.integrationId } : {})
108
+ });
109
+ }
110
+ const PROVIDER_NAMES = new Set(["hubspot", "salesforce", "attio", "gmail", "slack", "instantly", "heyreach"]);
111
+ const CRUD_KEYS = new Set(["connect", "list", "get", "create", "update", "delete", "execute"]);
112
+ function createProviderProxy(provider) {
113
+ return new Proxy({}, {
114
+ get(_target, prop) {
115
+ if (typeof prop !== "string")
116
+ return undefined;
117
+ return (...args) => executeMethod(provider, prop, args);
118
+ }
119
+ });
120
+ }
97
121
  // ---------------------------------------------------------------------------
98
- // CRUD (via batch-service)
122
+ // CRUD + Execute (via batch-service)
99
123
  // ---------------------------------------------------------------------------
100
- exports.integrations = {
124
+ const integrationsBase = {
101
125
  connect: (provider, opts) => connectIntegration(provider, opts),
102
126
  list: (opts) => (0, api_1.post)("/ctx/integrations/list", (opts ?? {})),
103
127
  get: (id) => (0, api_1.post)("/ctx/integrations/get", { id }),
104
128
  create: (opts) => (0, api_1.post)("/ctx/integrations/create", opts),
105
129
  update: (id, fields) => (0, api_1.post)("/ctx/integrations/update", { id, ...fields }),
106
- delete: (id) => (0, api_1.post)("/ctx/integrations/delete", { id })
130
+ delete: (id) => (0, api_1.post)("/ctx/integrations/delete", { id }),
131
+ execute: (provider, method, ...args) => executeMethod(provider, method, args)
107
132
  };
133
+ exports.integrations = new Proxy(integrationsBase, {
134
+ get(target, prop) {
135
+ if (typeof prop !== "string")
136
+ return undefined;
137
+ if (CRUD_KEYS.has(prop))
138
+ return target[prop];
139
+ if (PROVIDER_NAMES.has(prop))
140
+ return createProviderProxy(prop);
141
+ return target[prop];
142
+ }
143
+ });
@@ -10,6 +10,6 @@
10
10
  - **scrape**: website scraper, sitemap scraper
11
11
  - **web**: SERP
12
12
  - **predictLeads**: company intelligence datasets (financing events, technologies, products, job openings, news, and related company data). Use these as prospecting/enrichment signals, not source-of-truth validation for whether a known company is hiring right now.
13
- - **integrations**: connect and manage third-party integrations (HubSpot, Salesforce, Attio, Gmail, Slack, Instantly, HeyReach). Use `integrations.connect(provider)` to open the browser OAuth flow from a script, or `integrations.create(...)` for API-key providers.
13
+ - **integrations**: connect, manage, and **execute** third-party integrations (HubSpot, Salesforce, Attio, Gmail, Slack, Instantly, HeyReach). Use `integrations.connect(provider)` to connect, then `integrations.<provider>.<method>(args)` to execute methods (e.g. `integrations.hubspot.createContact({...})`). Read per-method docs at `./integrations/<provider>/<method>.md` before calling.
14
14
  - **skills**: create and manage knowledge skills — reusable knowledge snippets (ICP, templates, product info) that guide AI agents.
15
15
  - **guides**: agent notes & operational docs (see [Error Handling Cheatsheet](../error-handling-cheatsheet.md))
@@ -1,10 +1,10 @@
1
1
  ---
2
- description: Connect and manage third-party integrations (HubSpot, Salesforce, Attio, Gmail, Slack, Instantly, HeyReach)
2
+ description: Connect, manage, and execute third-party integrations (HubSpot, Salesforce, Attio, Gmail, Slack, Instantly, HeyReach)
3
3
  ---
4
4
 
5
- # integrations — Integration Management
5
+ # integrations — Integration Management & Execution
6
6
 
7
- Connect, list, and manage third-party service integrations. Supports both OAuth providers (HubSpot, Salesforce, Attio, Gmail, Slack) and API-key providers (Instantly, HeyReach).
7
+ Connect third-party services, manage integration records, and **execute integration methods** directly. Supports both OAuth providers (HubSpot, Salesforce, Attio, Gmail, Slack) and API-key providers (Instantly, HeyReach).
8
8
 
9
9
  ## Quick start
10
10
 
@@ -12,21 +12,27 @@ Connect, list, and manage third-party service integrations. Supports both OAuth
12
12
  import { integrations } from "orangeslice";
13
13
 
14
14
  // Connect an OAuth provider (opens browser for authorization)
15
- const hubspot = await integrations.connect("hubspot");
16
- console.log(`Connected: ${hubspot.displayName}`);
15
+ await integrations.connect("hubspot");
17
16
 
18
- // List all connected integrations
19
- const { integrations: list } = await integrations.list();
20
- console.log(list.map(i => `${i.provider}: ${i.displayName}`));
17
+ // Execute integration methods directly
18
+ const contact = await integrations.hubspot.createContact({
19
+ properties: { email: "john@acme.com", firstname: "John" }
20
+ });
21
21
 
22
- // Connect an API-key provider programmatically (no browser)
23
- await integrations.create({
24
- provider: "instantly",
25
- apiKey: "inst_abc123...",
26
- displayName: "My Instantly"
22
+ const campaigns = await integrations.instantly.listCampaigns();
23
+
24
+ await integrations.slack.chatPostMessage({
25
+ channel: "#leads",
26
+ text: "New lead: john@acme.com"
27
27
  });
28
+
29
+ // List all connected integrations
30
+ const { integrations: list } = await integrations.list();
31
+ console.log(list.map((i) => `${i.provider}: ${i.displayName}`));
28
32
  ```
29
33
 
34
+ **Important**: Read the per-method docs at `./integrations/<provider>/<method>.md` for available methods, parameters, and response shapes. Do not invent methods.
35
+
30
36
  ## Methods
31
37
 
32
38
  ### `integrations.connect(provider, opts?)`
@@ -36,6 +42,7 @@ Opens the user's browser to complete OAuth authorization (or API key entry for I
36
42
  This is the recommended way to connect any integration from a script or agent.
37
43
 
38
44
  **Parameters:**
45
+
39
46
  - `provider` — One of: `"hubspot"`, `"salesforce"`, `"attio"`, `"gmail"`, `"slack"`, `"instantly"`, `"heyreach"`
40
47
  - `opts.noBrowser` — If `true`, prints the URL instead of auto-opening the browser
41
48
 
@@ -51,6 +58,7 @@ const salesforce = await integrations.connect("salesforce");
51
58
  List connected integrations for the current account.
52
59
 
53
60
  **Parameters:**
61
+
54
62
  - `opts.spreadsheetId` — Filter to a specific spreadsheet's integrations
55
63
  - `opts.provider` — Filter by provider name
56
64
 
@@ -72,6 +80,7 @@ Get a single integration by ID.
72
80
  Programmatically create an API-key integration without opening a browser. Only works for API-key providers (`instantly`, `heyreach`). For OAuth providers, use `connect()` instead.
73
81
 
74
82
  **Parameters:**
83
+
75
84
  - `opts.provider` — `"instantly"` or `"heyreach"`
76
85
  - `opts.apiKey` — The provider API key
77
86
  - `opts.displayName` — Optional display name
@@ -85,6 +94,7 @@ Programmatically create an API-key integration without opening a browser. Only w
85
94
  Update an existing integration.
86
95
 
87
96
  **Parameters:**
97
+
88
98
  - `fields.apiKey` — New API key
89
99
  - `fields.displayName` — New display name
90
100
  - `fields.isActive` — Enable/disable
@@ -98,31 +108,95 @@ Delete an integration by ID.
98
108
 
99
109
  **Returns:** `{ success: boolean }`
100
110
 
111
+ ## Executing integration methods
112
+
113
+ Once an integration is connected, call its methods directly via `integrations.<provider>.<method>(args)`.
114
+
115
+ ```typescript
116
+ // HubSpot
117
+ const contact = await integrations.hubspot.createContact({
118
+ properties: { email: "jane@acme.com", firstname: "Jane" }
119
+ });
120
+ const companies = await integrations.hubspot.searchCompanies({
121
+ filterGroups: [{ filters: [{ propertyName: "domain", operator: "EQ", value: "acme.com" }] }]
122
+ });
123
+
124
+ // Instantly
125
+ await integrations.instantly.addLeadsToCampaign({
126
+ campaignId: "abc-123",
127
+ leads: [{ email: "lead@company.com", firstName: "Lead" }]
128
+ });
129
+ const campaigns = await integrations.instantly.listCampaigns();
130
+
131
+ // Slack
132
+ await integrations.slack.chatPostMessage({ channel: "#sales", text: "New deal closed!" });
133
+ const channels = await integrations.slack.conversationsList();
134
+
135
+ // Gmail
136
+ await integrations.gmail.sendEmail({
137
+ to: "prospect@company.com",
138
+ subject: "Following up",
139
+ body: "Hi, just wanted to check in..."
140
+ });
141
+
142
+ // Attio
143
+ await integrations.attio.createRecord({
144
+ objectSlug: "companies",
145
+ data: { values: { name: [{ value: "Acme Corp" }] } }
146
+ });
147
+
148
+ // Salesforce
149
+ await integrations.salesforce.createRecord({
150
+ objectType: "Contact",
151
+ fields: { Email: "new@example.com", LastName: "Smith" }
152
+ });
153
+
154
+ // HeyReach
155
+ await integrations.heyreach.addLeadsToList({
156
+ listId: "list-123",
157
+ leads: [{ linkedinUrl: "https://linkedin.com/in/johndoe" }]
158
+ });
159
+ ```
160
+
161
+ ### `integrations.execute(provider, method, ...args)`
162
+
163
+ Explicit dispatch for dynamic provider/method names:
164
+
165
+ ```typescript
166
+ const provider = "hubspot";
167
+ const method = "searchContacts";
168
+ const result = await integrations.execute(provider, method, { query: "acme" });
169
+ ```
170
+
171
+ ### Per-method documentation
172
+
173
+ Every provider method is documented at `./integrations/<provider>/<method>.md`. **Always read the method docs before calling** to get the correct parameter shapes and response types.
174
+
101
175
  ## Integration object
102
176
 
103
177
  ```typescript
104
178
  {
105
- id: string;
106
- provider: string; // "hubspot", "salesforce", etc.
107
- displayName: string; // "HubSpot portal acme.hubspot.com"
108
- isActive: boolean;
109
- hasApiKey: boolean; // true if API key is set (key itself is never returned)
110
- hasOauthToken: boolean; // true if OAuth token is set
111
- createdAt: string;
112
- updatedAt: string;
113
- scope: "account" | "spreadsheet";
114
- spreadsheetId: string | null;
179
+ id: string;
180
+ provider: string; // "hubspot", "salesforce", etc.
181
+ displayName: string; // "HubSpot portal acme.hubspot.com"
182
+ isActive: boolean;
183
+ hasApiKey: boolean; // true if API key is set (key itself is never returned)
184
+ hasOauthToken: boolean; // true if OAuth token is set
185
+ createdAt: string;
186
+ updatedAt: string;
187
+ scope: "account" | "spreadsheet";
188
+ spreadsheetId: string | null;
115
189
  }
116
190
  ```
117
191
 
118
192
  ## Supported providers
119
193
 
120
- | Provider | Auth Type | Connect method |
121
- | ----------- | --------- | ---------------------- |
122
- | HubSpot | OAuth | `connect("hubspot")` |
123
- | Salesforce | OAuth | `connect("salesforce")`|
124
- | Attio | OAuth | `connect("attio")` |
125
- | Gmail | OAuth | `connect("gmail")` |
126
- | Slack | OAuth | `connect("slack")` |
127
- | Instantly | API Key | `connect("instantly")` or `create(...)` |
128
- | HeyReach | API Key | `connect("heyreach")` or `create(...)` |
194
+ | Provider | Auth Type | Connect method |
195
+ | ---------- | --------- | --------------------------------------- |
196
+ | HubSpot | OAuth | `connect("hubspot")` |
197
+ | Salesforce | OAuth | `connect("salesforce")` |
198
+ | Attio | OAuth | `connect("attio")` |
199
+ | Gmail | OAuth | `connect("gmail")` |
200
+ | Slack | OAuth | `connect("slack")` |
201
+ | Instantly | API Key | `connect("instantly")` or `create(...)` |
202
+ | HeyReach | API Key | `connect("heyreach")` or `create(...)` |
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
1
  {
2
- "name": "orangeslice",
3
- "version": "2.4.0-beta.1",
4
- "description": "B2B LinkedIn database prospector - 1.15B profiles, 85M companies",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "orangeslice": "dist/cli.js"
9
- },
10
- "files": [
11
- "dist",
12
- "docs",
13
- "README.md"
14
- ],
15
- "scripts": {
16
- "sync-docs": "node scripts/sync-docs.mjs",
17
- "build": "tsc",
18
- "prepublishOnly": "npm run sync-docs && npm run build"
19
- },
20
- "keywords": [
21
- "b2b",
22
- "rate-limit",
23
- "ai-agent",
24
- "linkedin",
25
- "sales-agent",
26
- "claude-code",
27
- "cursor",
28
- "mcp"
29
- ],
30
- "author": "",
31
- "license": "MIT",
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/kishansripada/npx-orangeslice.git"
35
- },
36
- "devDependencies": {
37
- "@types/node": "^25.1.0",
38
- "typescript": "^5.9.3"
39
- }
2
+ "name": "orangeslice",
3
+ "version": "2.4.1-beta.0",
4
+ "description": "B2B LinkedIn database prospector - 1.15B profiles, 85M companies",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "orangeslice": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "docs",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "sync-docs": "node scripts/sync-docs.mjs",
17
+ "build": "tsc",
18
+ "prepublishOnly": "npm run sync-docs && npm run build"
19
+ },
20
+ "keywords": [
21
+ "b2b",
22
+ "rate-limit",
23
+ "ai-agent",
24
+ "linkedin",
25
+ "sales-agent",
26
+ "claude-code",
27
+ "cursor",
28
+ "mcp"
29
+ ],
30
+ "author": "",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/kishansripada/npx-orangeslice.git"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^25.1.0",
38
+ "typescript": "^5.9.3"
39
+ }
40
40
  }