linkedin-automation-cli 1.0.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/.env.example +12 -0
- package/.github/workflows/ci.yml +66 -0
- package/.github/workflows/publish.yml +48 -0
- package/.husky/pre-commit +6 -0
- package/.prettierignore +4 -0
- package/.prettierrc +10 -0
- package/AGENTS.md +294 -0
- package/CHANGELOG.md +40 -0
- package/GIT_RELEASE.md +167 -0
- package/LICENSE +21 -0
- package/Makefile +30 -0
- package/NPM_PUBLISHING.md +230 -0
- package/PYEOF +0 -0
- package/README.md +295 -0
- package/TESTING-GUIDE.md +151 -0
- package/cmd/linkedin/main.go +9 -0
- package/dist/agent/action-executor.d.ts +81 -0
- package/dist/agent/action-executor.d.ts.map +1 -0
- package/dist/agent/action-executor.js +170 -0
- package/dist/agent/action-executor.js.map +1 -0
- package/dist/agent/action-executor.test.d.ts +2 -0
- package/dist/agent/action-executor.test.d.ts.map +1 -0
- package/dist/agent/action-executor.test.js +366 -0
- package/dist/agent/action-executor.test.js.map +1 -0
- package/dist/agent/claude-client.d.ts +74 -0
- package/dist/agent/claude-client.d.ts.map +1 -0
- package/dist/agent/claude-client.js +314 -0
- package/dist/agent/claude-client.js.map +1 -0
- package/dist/agent/claude-client.test.d.ts +2 -0
- package/dist/agent/claude-client.test.d.ts.map +1 -0
- package/dist/agent/claude-client.test.js +590 -0
- package/dist/agent/claude-client.test.js.map +1 -0
- package/dist/agent/dom-extractor.d.ts +50 -0
- package/dist/agent/dom-extractor.d.ts.map +1 -0
- package/dist/agent/dom-extractor.js +374 -0
- package/dist/agent/dom-extractor.js.map +1 -0
- package/dist/agent/dom-extractor.test.d.ts +7 -0
- package/dist/agent/dom-extractor.test.d.ts.map +1 -0
- package/dist/agent/dom-extractor.test.js +504 -0
- package/dist/agent/dom-extractor.test.js.map +1 -0
- package/dist/agent/extension-client.d.ts +75 -0
- package/dist/agent/extension-client.d.ts.map +1 -0
- package/dist/agent/extension-client.js +245 -0
- package/dist/agent/extension-client.js.map +1 -0
- package/dist/agent/index.d.ts +8 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +16 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/page-agent.d.ts +76 -0
- package/dist/agent/page-agent.d.ts.map +1 -0
- package/dist/agent/page-agent.js +236 -0
- package/dist/agent/page-agent.js.map +1 -0
- package/dist/agent/types.d.ts +236 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +37 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/cli/agent-commands.d.ts +3 -0
- package/dist/cli/agent-commands.d.ts.map +1 -0
- package/dist/cli/agent-commands.js +250 -0
- package/dist/cli/agent-commands.js.map +1 -0
- package/dist/cli/auth.d.ts +3 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +288 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/company.d.ts +3 -0
- package/dist/cli/company.d.ts.map +1 -0
- package/dist/cli/company.js +55 -0
- package/dist/cli/company.js.map +1 -0
- package/dist/cli/connection.d.ts +3 -0
- package/dist/cli/connection.d.ts.map +1 -0
- package/dist/cli/connection.js +79 -0
- package/dist/cli/connection.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +17 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/messages.d.ts +3 -0
- package/dist/cli/messages.d.ts.map +1 -0
- package/dist/cli/messages.js +268 -0
- package/dist/cli/messages.js.map +1 -0
- package/dist/cli/profile.d.ts +3 -0
- package/dist/cli/profile.d.ts.map +1 -0
- package/dist/cli/profile.js +81 -0
- package/dist/cli/profile.js.map +1 -0
- package/dist/cli/profile.test.d.ts +2 -0
- package/dist/cli/profile.test.d.ts.map +1 -0
- package/dist/cli/profile.test.js +15 -0
- package/dist/cli/profile.test.js.map +1 -0
- package/dist/cli/reply.d.ts +3 -0
- package/dist/cli/reply.d.ts.map +1 -0
- package/dist/cli/reply.js +129 -0
- package/dist/cli/reply.js.map +1 -0
- package/dist/core/audit.d.ts +17 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +121 -0
- package/dist/core/audit.js.map +1 -0
- package/dist/core/audit.test.d.ts +2 -0
- package/dist/core/audit.test.d.ts.map +1 -0
- package/dist/core/audit.test.js +142 -0
- package/dist/core/audit.test.js.map +1 -0
- package/dist/core/browser-cookies.d.ts +19 -0
- package/dist/core/browser-cookies.d.ts.map +1 -0
- package/dist/core/browser-cookies.js +181 -0
- package/dist/core/browser-cookies.js.map +1 -0
- package/dist/core/browser.d.ts +50 -0
- package/dist/core/browser.d.ts.map +1 -0
- package/dist/core/browser.js +318 -0
- package/dist/core/browser.js.map +1 -0
- package/dist/core/config.d.ts +20 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +103 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/config.test.d.ts +2 -0
- package/dist/core/config.test.d.ts.map +1 -0
- package/dist/core/config.test.js +111 -0
- package/dist/core/config.test.js.map +1 -0
- package/dist/core/storage.d.ts +19 -0
- package/dist/core/storage.d.ts.map +1 -0
- package/dist/core/storage.js +124 -0
- package/dist/core/storage.js.map +1 -0
- package/dist/core/storage.test.d.ts +2 -0
- package/dist/core/storage.test.d.ts.map +1 -0
- package/dist/core/storage.test.js +142 -0
- package/dist/core/storage.test.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/linkedin/auth.d.ts +22 -0
- package/dist/linkedin/auth.d.ts.map +1 -0
- package/dist/linkedin/auth.js +167 -0
- package/dist/linkedin/auth.js.map +1 -0
- package/dist/linkedin/company-extractor.d.ts +36 -0
- package/dist/linkedin/company-extractor.d.ts.map +1 -0
- package/dist/linkedin/company-extractor.js +211 -0
- package/dist/linkedin/company-extractor.js.map +1 -0
- package/dist/linkedin/company-extractor.test.d.ts +2 -0
- package/dist/linkedin/company-extractor.test.d.ts.map +1 -0
- package/dist/linkedin/company-extractor.test.js +52 -0
- package/dist/linkedin/company-extractor.test.js.map +1 -0
- package/dist/linkedin/connector.d.ts +45 -0
- package/dist/linkedin/connector.d.ts.map +1 -0
- package/dist/linkedin/connector.js +245 -0
- package/dist/linkedin/connector.js.map +1 -0
- package/dist/linkedin/message-sender.d.ts +32 -0
- package/dist/linkedin/message-sender.d.ts.map +1 -0
- package/dist/linkedin/message-sender.js +112 -0
- package/dist/linkedin/message-sender.js.map +1 -0
- package/dist/linkedin/messages.d.ts +78 -0
- package/dist/linkedin/messages.d.ts.map +1 -0
- package/dist/linkedin/messages.js +745 -0
- package/dist/linkedin/messages.js.map +1 -0
- package/dist/linkedin/profile.d.ts +37 -0
- package/dist/linkedin/profile.d.ts.map +1 -0
- package/dist/linkedin/profile.js +268 -0
- package/dist/linkedin/profile.js.map +1 -0
- package/dist/linkedin/profile.test.d.ts +2 -0
- package/dist/linkedin/profile.test.d.ts.map +1 -0
- package/dist/linkedin/profile.test.js +68 -0
- package/dist/linkedin/profile.test.js.map +1 -0
- package/dist/linkedin/reply.d.ts +21 -0
- package/dist/linkedin/reply.d.ts.map +1 -0
- package/dist/linkedin/reply.js +76 -0
- package/dist/linkedin/reply.js.map +1 -0
- package/dist/linkedin/selector-engine.d.ts +69 -0
- package/dist/linkedin/selector-engine.d.ts.map +1 -0
- package/dist/linkedin/selector-engine.js +339 -0
- package/dist/linkedin/selector-engine.js.map +1 -0
- package/dist/linkedin/selector-engine.test.d.ts +2 -0
- package/dist/linkedin/selector-engine.test.d.ts.map +1 -0
- package/dist/linkedin/selector-engine.test.js +135 -0
- package/dist/linkedin/selector-engine.test.js.map +1 -0
- package/dist/linkedin/selectors.d.ts +65 -0
- package/dist/linkedin/selectors.d.ts.map +1 -0
- package/dist/linkedin/selectors.js +261 -0
- package/dist/linkedin/selectors.js.map +1 -0
- package/dist/templates/engine.d.ts +37 -0
- package/dist/templates/engine.d.ts.map +1 -0
- package/dist/templates/engine.js +215 -0
- package/dist/templates/engine.js.map +1 -0
- package/dist/templates/engine.test.d.ts +2 -0
- package/dist/templates/engine.test.d.ts.map +1 -0
- package/dist/templates/engine.test.js +212 -0
- package/dist/templates/engine.test.js.map +1 -0
- package/dist/templates/index.d.ts +2 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +7 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/types/index.d.ts +113 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.test.d.ts +2 -0
- package/dist/types/index.test.d.ts.map +1 -0
- package/dist/types/index.test.js +90 -0
- package/dist/types/index.test.js.map +1 -0
- package/dist/utils/paths.d.ts +8 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +68 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +22 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +57 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/retry.d.ts +18 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +49 -0
- package/dist/utils/retry.js.map +1 -0
- package/docs/connection-command.md +52 -0
- package/docs/plans/2025-03-03-linkedin-cli-design.md +280 -0
- package/docs/plans/2025-03-03-linkedin-cli-implementation-plan.md +2087 -0
- package/docs/plans/2025-03-03-linkedin-cli-implementation.md +2420 -0
- package/docs/plans/2026-02-19-linkedin-connection-feature.md +596 -0
- package/docs/plans/2026-02-28-messages-send-feature.md +480 -0
- package/docs/plans/2026-02-28-messages-show-design.md +243 -0
- package/docs/plans/2026-03-03-linkedin-cli-oss-publishing-design.md +394 -0
- package/docs/plans/2026-03-03-linkedin-cli-oss-publishing-plan.md +1592 -0
- package/docs/superpowers/plans/2026-03-13-linkedin-automation-resilience-migration.md +425 -0
- package/docs/superpowers/plans/2026-03-13-playwright-fara-migration.md +1112 -0
- package/docs/superpowers/plans/2026-03-14-page-agent-plan.md +1598 -0
- package/docs/superpowers/plans/2026-03-15-company-profile-extraction.md +591 -0
- package/docs/superpowers/plans/2026-03-15-profile-extraction-plan.md +943 -0
- package/docs/superpowers/specs/2026-03-14-company-profile-extraction-design.md +371 -0
- package/docs/superpowers/specs/2026-03-14-page-agent-design.md +385 -0
- package/docs/superpowers/specs/2026-03-15-profile-extraction-design.md +409 -0
- package/eslint.config.mjs +58 -0
- package/go.mod +9 -0
- package/go.sum +10 -0
- package/import-cookies.js +376 -0
- package/internal/cmd/actions.go +123 -0
- package/internal/cmd/auth.go +108 -0
- package/internal/cmd/connect.go +42 -0
- package/internal/cmd/message.go +44 -0
- package/internal/cmd/people.go +454 -0
- package/internal/cmd/profiles.go +121 -0
- package/internal/cmd/root.go +89 -0
- package/internal/cmd/sequence.go +192 -0
- package/internal/config/config.go +187 -0
- package/internal/config/config_test.go +121 -0
- package/internal/config/profile.go +65 -0
- package/internal/linkedin/navigator.go +195 -0
- package/internal/linkedin/selectors.go +39 -0
- package/internal/linkedin/validator.go +69 -0
- package/internal/pinchtab/client.go +183 -0
- package/internal/pinchtab/client_test.go +67 -0
- package/internal/pinchtab/types.go +50 -0
- package/internal/ratelimit/limiter.go +115 -0
- package/internal/ratelimit/limits.go +32 -0
- package/package.json +67 -0
- package/release.sh +66 -0
- package/scripts/debug-linkedin.js +156 -0
- package/scripts/debug-login.js +193 -0
- package/scripts/extract-from-edge.js +96 -0
- package/scripts/import-cookies.js +101 -0
- package/scripts/poc-show-data.js +205 -0
- package/scripts/proof-of-access.js +87 -0
- package/scripts/prove-connection.js +110 -0
- package/scripts/show-linkedin-data.js +173 -0
- package/src/agent/action-executor.test.ts +464 -0
- package/src/agent/action-executor.ts +203 -0
- package/src/agent/claude-client.test.ts +707 -0
- package/src/agent/claude-client.ts +422 -0
- package/src/agent/dom-extractor.test.ts +574 -0
- package/src/agent/dom-extractor.ts +437 -0
- package/src/agent/extension-client.ts +306 -0
- package/src/agent/index.ts +28 -0
- package/src/agent/page-agent.ts +292 -0
- package/src/agent/types.ts +288 -0
- package/src/cli/agent-commands.ts +274 -0
- package/src/cli/auth.ts +343 -0
- package/src/cli/company.ts +66 -0
- package/src/cli/connection.ts +89 -0
- package/src/cli/index.ts +7 -0
- package/src/cli/messages.ts +338 -0
- package/src/cli/profile.test.ts +14 -0
- package/src/cli/profile.ts +95 -0
- package/src/cli/reply.ts +110 -0
- package/src/core/audit.test.ts +134 -0
- package/src/core/audit.ts +98 -0
- package/src/core/browser-cookies.ts +203 -0
- package/src/core/browser.ts +304 -0
- package/src/core/config.test.ts +90 -0
- package/src/core/config.ts +81 -0
- package/src/core/storage.test.ts +129 -0
- package/src/core/storage.ts +100 -0
- package/src/index.ts +70 -0
- package/src/linkedin/auth.ts +218 -0
- package/src/linkedin/company-extractor.test.ts +58 -0
- package/src/linkedin/company-extractor.ts +222 -0
- package/src/linkedin/connector.ts +336 -0
- package/src/linkedin/message-sender.ts +141 -0
- package/src/linkedin/messages.ts +894 -0
- package/src/linkedin/profile.test.ts +79 -0
- package/src/linkedin/profile.ts +314 -0
- package/src/linkedin/reply.ts +96 -0
- package/src/linkedin/selector-engine.test.ts +167 -0
- package/src/linkedin/selector-engine.ts +393 -0
- package/src/linkedin/selectors.ts +268 -0
- package/src/templates/defaults/followup.txt +14 -0
- package/src/templates/defaults/meeting.txt +16 -0
- package/src/templates/defaults/welcome.txt +14 -0
- package/src/templates/engine.test.ts +228 -0
- package/src/templates/engine.ts +208 -0
- package/src/templates/index.ts +1 -0
- package/src/types/index.test.ts +94 -0
- package/src/types/index.ts +143 -0
- package/src/types/sql.js.d.ts +23 -0
- package/src/utils/paths.ts +33 -0
- package/src/utils/rate-limiter.ts +75 -0
- package/src/utils/retry.ts +78 -0
- package/test-cli.sh +85 -0
- package/test-real-data.sh +97 -0
- package/tsconfig.json +23 -0
- package/vitest.config.ts +35 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude API Client Module
|
|
3
|
+
*
|
|
4
|
+
* Client for interacting with the Claude API via Dashscope.
|
|
5
|
+
* Sends DOM representations and receives action plans for web automation.
|
|
6
|
+
*/
|
|
7
|
+
import { type ActionPlan, type DOMRepresentation, type ActionContext, type ClaudeClientConfig } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown when the Claude API request fails
|
|
10
|
+
*/
|
|
11
|
+
export declare class ClaudeAPIError extends Error {
|
|
12
|
+
readonly statusCode?: number | undefined;
|
|
13
|
+
readonly responseBody?: string | undefined;
|
|
14
|
+
constructor(message: string, statusCode?: number | undefined, responseBody?: string | undefined);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Error thrown when the response cannot be parsed
|
|
18
|
+
*/
|
|
19
|
+
export declare class ClaudeParseError extends Error {
|
|
20
|
+
readonly rawResponse?: string | undefined;
|
|
21
|
+
constructor(message: string, rawResponse?: string | undefined);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Client for interacting with the Claude API
|
|
25
|
+
*/
|
|
26
|
+
export declare class ClaudeClient {
|
|
27
|
+
private readonly config;
|
|
28
|
+
constructor(config: ClaudeClientConfig);
|
|
29
|
+
/**
|
|
30
|
+
* Generates an action plan based on the current DOM state and context
|
|
31
|
+
*/
|
|
32
|
+
generateActionPlan(dom: DOMRepresentation, context: ActionContext): Promise<ActionPlan>;
|
|
33
|
+
/**
|
|
34
|
+
* Builds the system and user messages for the API request
|
|
35
|
+
*/
|
|
36
|
+
private buildMessages;
|
|
37
|
+
/**
|
|
38
|
+
* Builds the system prompt explaining the agent role and JSON format
|
|
39
|
+
*/
|
|
40
|
+
private buildSystemPrompt;
|
|
41
|
+
/**
|
|
42
|
+
* Builds the user prompt with goal, DOM, and previous actions
|
|
43
|
+
*/
|
|
44
|
+
private buildUserPrompt;
|
|
45
|
+
/**
|
|
46
|
+
* Makes the API call to Claude
|
|
47
|
+
*/
|
|
48
|
+
private makeAPICall;
|
|
49
|
+
/**
|
|
50
|
+
* Parses the API response into an ActionPlan
|
|
51
|
+
*/
|
|
52
|
+
private parseResponse;
|
|
53
|
+
/**
|
|
54
|
+
* Extracts JSON from a string that may contain markdown or extra text
|
|
55
|
+
*/
|
|
56
|
+
private extractJSON;
|
|
57
|
+
/**
|
|
58
|
+
* Validates and transforms the raw plan into a proper ActionPlan
|
|
59
|
+
*/
|
|
60
|
+
private validateAndTransformPlan;
|
|
61
|
+
/**
|
|
62
|
+
* Transforms a raw action into a properly typed Action
|
|
63
|
+
*/
|
|
64
|
+
private transformAction;
|
|
65
|
+
/**
|
|
66
|
+
* Validates and returns a valid status
|
|
67
|
+
*/
|
|
68
|
+
private validateStatus;
|
|
69
|
+
/**
|
|
70
|
+
* Creates an error action plan
|
|
71
|
+
*/
|
|
72
|
+
private createErrorPlan;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=claude-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-client.d.ts","sourceRoot":"","sources":["../../src/agent/claude-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,UAAU,EAGf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACxB,MAAM,SAAS,CAAC;AASjB;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;aAGrB,UAAU,CAAC,EAAE,MAAM;aACnB,YAAY,CAAC,EAAE,MAAM;gBAFrC,OAAO,EAAE,MAAM,EACC,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,YAAY,CAAC,EAAE,MAAM,YAAA;CAKxC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;aAGvB,WAAW,CAAC,EAAE,MAAM;gBADpC,OAAO,EAAE,MAAM,EACC,WAAW,CAAC,EAAE,MAAM,YAAA;CAKvC;AA8DD;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;gBAE1C,MAAM,EAAE,kBAAkB;IAQtC;;OAEG;IACG,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAM7F;;OAEG;IACH,OAAO,CAAC,aAAa;IAarB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkCzB;;OAEG;IACH,OAAO,CAAC,eAAe;IA0BvB;;OAEG;YACW,WAAW;IA0CzB;;OAEG;IACH,OAAO,CAAC,aAAa;IAuBrB;;OAEG;IACH,OAAO,CAAC,WAAW;IAqBnB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAqBhC;;OAEG;IACH,OAAO,CAAC,eAAe;IA0DvB;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;IACH,OAAO,CAAC,eAAe;CASxB"}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Claude API Client Module
|
|
4
|
+
*
|
|
5
|
+
* Client for interacting with the Claude API via Dashscope.
|
|
6
|
+
* Sends DOM representations and receives action plans for web automation.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ClaudeClient = exports.ClaudeParseError = exports.ClaudeAPIError = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Default configuration values
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_BASE_URL = 'https://coding.dashscope.aliyuncs.com/apps/anthropic/v1';
|
|
14
|
+
const DEFAULT_MODEL = 'qwen3.5-plus';
|
|
15
|
+
const DEFAULT_MAX_TOKENS = 4096;
|
|
16
|
+
/**
|
|
17
|
+
* Error thrown when the Claude API request fails
|
|
18
|
+
*/
|
|
19
|
+
class ClaudeAPIError extends Error {
|
|
20
|
+
statusCode;
|
|
21
|
+
responseBody;
|
|
22
|
+
constructor(message, statusCode, responseBody) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.statusCode = statusCode;
|
|
25
|
+
this.responseBody = responseBody;
|
|
26
|
+
this.name = 'ClaudeAPIError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ClaudeAPIError = ClaudeAPIError;
|
|
30
|
+
/**
|
|
31
|
+
* Error thrown when the response cannot be parsed
|
|
32
|
+
*/
|
|
33
|
+
class ClaudeParseError extends Error {
|
|
34
|
+
rawResponse;
|
|
35
|
+
constructor(message, rawResponse) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.rawResponse = rawResponse;
|
|
38
|
+
this.name = 'ClaudeParseError';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ClaudeParseError = ClaudeParseError;
|
|
42
|
+
/**
|
|
43
|
+
* Client for interacting with the Claude API
|
|
44
|
+
*/
|
|
45
|
+
class ClaudeClient {
|
|
46
|
+
config;
|
|
47
|
+
constructor(config) {
|
|
48
|
+
this.config = {
|
|
49
|
+
apiKey: config.apiKey,
|
|
50
|
+
baseUrl: config.baseUrl || DEFAULT_BASE_URL,
|
|
51
|
+
model: config.model || DEFAULT_MODEL,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Generates an action plan based on the current DOM state and context
|
|
56
|
+
*/
|
|
57
|
+
async generateActionPlan(dom, context) {
|
|
58
|
+
const messages = this.buildMessages(dom, context);
|
|
59
|
+
const response = await this.makeAPICall(messages);
|
|
60
|
+
return this.parseResponse(response);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Builds the system and user messages for the API request
|
|
64
|
+
*/
|
|
65
|
+
buildMessages(dom, context) {
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
role: 'system',
|
|
69
|
+
content: this.buildSystemPrompt(),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
role: 'user',
|
|
73
|
+
content: this.buildUserPrompt(dom, context),
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Builds the system prompt explaining the agent role and JSON format
|
|
79
|
+
*/
|
|
80
|
+
buildSystemPrompt() {
|
|
81
|
+
return `You are a web automation agent specialized in LinkedIn interactions.
|
|
82
|
+
|
|
83
|
+
Your task is to analyze a DOM representation of a web page and determine the next action(s) to take to accomplish a goal.
|
|
84
|
+
|
|
85
|
+
RULES:
|
|
86
|
+
1. Respond ONLY with valid JSON. No markdown, no explanations outside JSON.
|
|
87
|
+
2. The JSON must match this structure:
|
|
88
|
+
{
|
|
89
|
+
"reasoning": "string explaining your thought process",
|
|
90
|
+
"expectedOutcome": "string describing what should happen after these actions",
|
|
91
|
+
"actions": [
|
|
92
|
+
{
|
|
93
|
+
"type": "click|type|wait|navigate",
|
|
94
|
+
"description": "human-readable description of the action",
|
|
95
|
+
...action-specific fields
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
AVAILABLE ACTIONS:
|
|
101
|
+
- click: { type: "click", elementId: "string", description: "string" }
|
|
102
|
+
- type: { type: "type", elementId: "string", text: "string", description: "string" }
|
|
103
|
+
- wait: { type: "wait", durationMs: number, description: "string" }
|
|
104
|
+
- navigate: { type: "navigate", url: "string", description: "string" }
|
|
105
|
+
|
|
106
|
+
GUIDELINES:
|
|
107
|
+
- Use element IDs from the provided DOM. Only reference elements that exist.
|
|
108
|
+
- Break complex tasks into sequential actions.
|
|
109
|
+
- Wait after actions that trigger page changes or loading.
|
|
110
|
+
- If the goal is already achieved, return an empty actions array with appropriate reasoning.
|
|
111
|
+
- If stuck or unable to proceed, explain why in the reasoning field.`;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Builds the user prompt with goal, DOM, and previous actions
|
|
115
|
+
*/
|
|
116
|
+
buildUserPrompt(dom, context) {
|
|
117
|
+
const previousActionsText = context.previousActions.length > 0
|
|
118
|
+
? context.previousActions
|
|
119
|
+
.map((action, index) => `${index + 1}. ${action.action.type}: ${action.action.description} (${action.success ? 'success' : 'failed'}${action.error ? ` - ${action.error}` : ''})`)
|
|
120
|
+
.join('\n')
|
|
121
|
+
: 'None';
|
|
122
|
+
return `Goal: ${context.goal}
|
|
123
|
+
|
|
124
|
+
Current page DOM:
|
|
125
|
+
\`\`\`json
|
|
126
|
+
${JSON.stringify(dom, null, 2)}
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
Previous actions taken:
|
|
130
|
+
${previousActionsText}
|
|
131
|
+
|
|
132
|
+
Retry count: ${context.retryCount}
|
|
133
|
+
|
|
134
|
+
What action(s) should be taken next? Respond with the JSON action plan.`;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Makes the API call to Claude
|
|
138
|
+
*/
|
|
139
|
+
async makeAPICall(messages) {
|
|
140
|
+
const url = `${this.config.baseUrl}/messages`;
|
|
141
|
+
const body = {
|
|
142
|
+
model: this.config.model,
|
|
143
|
+
max_tokens: DEFAULT_MAX_TOKENS,
|
|
144
|
+
messages,
|
|
145
|
+
};
|
|
146
|
+
let response;
|
|
147
|
+
try {
|
|
148
|
+
response = await fetch(url, {
|
|
149
|
+
method: 'POST',
|
|
150
|
+
headers: {
|
|
151
|
+
'Content-Type': 'application/json',
|
|
152
|
+
Authorization: `Bearer ${this.config.apiKey}`,
|
|
153
|
+
},
|
|
154
|
+
body: JSON.stringify(body),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
throw new ClaudeAPIError(`Failed to connect to Claude API: ${error instanceof Error ? error.message : String(error)}`);
|
|
159
|
+
}
|
|
160
|
+
if (!response.ok) {
|
|
161
|
+
const responseBody = await response.text();
|
|
162
|
+
throw new ClaudeAPIError(`Claude API error: ${response.status} ${response.statusText}`, response.status, responseBody);
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
return (await response.json());
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
throw new ClaudeAPIError(`Failed to parse Claude API response: ${error instanceof Error ? error.message : String(error)}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Parses the API response into an ActionPlan
|
|
173
|
+
*/
|
|
174
|
+
parseResponse(response) {
|
|
175
|
+
const content = response.content.find((c) => c.type === 'text');
|
|
176
|
+
if (!content) {
|
|
177
|
+
return this.createErrorPlan('No text content in Claude response');
|
|
178
|
+
}
|
|
179
|
+
const jsonText = this.extractJSON(content.text);
|
|
180
|
+
if (!jsonText) {
|
|
181
|
+
return this.createErrorPlan('Could not extract JSON from response');
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
const raw = JSON.parse(jsonText);
|
|
185
|
+
return this.validateAndTransformPlan(raw);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
return this.createErrorPlan(`Failed to parse action plan JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Extracts JSON from a string that may contain markdown or extra text
|
|
193
|
+
*/
|
|
194
|
+
extractJSON(text) {
|
|
195
|
+
// Try to find JSON in code blocks
|
|
196
|
+
const codeBlockMatch = text.match(/```(?:json)?\s*([\s\S]*?)\s*```/);
|
|
197
|
+
if (codeBlockMatch) {
|
|
198
|
+
return codeBlockMatch[1].trim();
|
|
199
|
+
}
|
|
200
|
+
// Try to find JSON between curly braces
|
|
201
|
+
const jsonMatch = text.match(/\{[\s\S]*\}/);
|
|
202
|
+
if (jsonMatch) {
|
|
203
|
+
return jsonMatch[0].trim();
|
|
204
|
+
}
|
|
205
|
+
// If the text looks like it starts with JSON, return it as-is
|
|
206
|
+
if (text.trim().startsWith('{')) {
|
|
207
|
+
return text.trim();
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Validates and transforms the raw plan into a proper ActionPlan
|
|
213
|
+
*/
|
|
214
|
+
validateAndTransformPlan(raw) {
|
|
215
|
+
const actions = [];
|
|
216
|
+
if (raw.actions && Array.isArray(raw.actions)) {
|
|
217
|
+
for (const rawAction of raw.actions) {
|
|
218
|
+
const action = this.transformAction(rawAction);
|
|
219
|
+
if (action) {
|
|
220
|
+
actions.push(action);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
reasoning: raw.reasoning || 'No reasoning provided',
|
|
226
|
+
expectedOutcome: raw.expectedOutcome || 'No expected outcome provided',
|
|
227
|
+
actions,
|
|
228
|
+
status: this.validateStatus(raw.status),
|
|
229
|
+
error: raw.error,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Transforms a raw action into a properly typed Action
|
|
234
|
+
*/
|
|
235
|
+
transformAction(rawAction) {
|
|
236
|
+
const description = rawAction.description || 'No description provided';
|
|
237
|
+
switch (rawAction.type) {
|
|
238
|
+
case 'click': {
|
|
239
|
+
if (!rawAction.elementId) {
|
|
240
|
+
console.warn('Click action missing elementId');
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
type: 'click',
|
|
245
|
+
elementId: rawAction.elementId,
|
|
246
|
+
description,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
case 'type': {
|
|
250
|
+
if (!rawAction.elementId || rawAction.text === undefined) {
|
|
251
|
+
console.warn('Type action missing elementId or text');
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
type: 'type',
|
|
256
|
+
elementId: rawAction.elementId,
|
|
257
|
+
text: rawAction.text,
|
|
258
|
+
description,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
case 'wait': {
|
|
262
|
+
if (rawAction.durationMs === undefined) {
|
|
263
|
+
console.warn('Wait action missing durationMs, using default 1000ms');
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
type: 'wait',
|
|
267
|
+
durationMs: rawAction.durationMs || 1000,
|
|
268
|
+
description,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
case 'navigate': {
|
|
272
|
+
if (!rawAction.url) {
|
|
273
|
+
console.warn('Navigate action missing url');
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
type: 'navigate',
|
|
278
|
+
url: rawAction.url,
|
|
279
|
+
description,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
default:
|
|
283
|
+
console.warn(`Unknown action type: ${rawAction.type}`);
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Validates and returns a valid status
|
|
289
|
+
*/
|
|
290
|
+
validateStatus(status) {
|
|
291
|
+
const validStatuses = [
|
|
292
|
+
'pending',
|
|
293
|
+
'in_progress',
|
|
294
|
+
'completed',
|
|
295
|
+
'failed',
|
|
296
|
+
'cancelled',
|
|
297
|
+
];
|
|
298
|
+
return status && validStatuses.includes(status) ? status : 'pending';
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Creates an error action plan
|
|
302
|
+
*/
|
|
303
|
+
createErrorPlan(message) {
|
|
304
|
+
return {
|
|
305
|
+
reasoning: 'Failed to generate action plan',
|
|
306
|
+
expectedOutcome: 'No actions can be taken due to error',
|
|
307
|
+
actions: [],
|
|
308
|
+
status: 'failed',
|
|
309
|
+
error: message,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
exports.ClaudeClient = ClaudeClient;
|
|
314
|
+
//# sourceMappingURL=claude-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-client.js","sourceRoot":"","sources":["../../src/agent/claude-client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAWH;;GAEG;AACH,MAAM,gBAAgB,GAAG,yDAAyD,CAAC;AACnF,MAAM,aAAa,GAAG,cAAc,CAAC;AACrC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC;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,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,OAAO;SACf,CAAC;IACJ,CAAC;CACF;AApTD,oCAoTC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-client.test.d.ts","sourceRoot":"","sources":["../../src/agent/claude-client.test.ts"],"names":[],"mappings":""}
|