bereach-openclaw 1.5.0-beta.3 → 1.5.0-beta.4
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/node_modules/@bereach/tools/package.json +22 -0
- package/node_modules/@bereach/tools/src/cache-types.ts +105 -0
- package/node_modules/@bereach/tools/src/definitions.ts +2034 -0
- package/node_modules/@bereach/tools/src/enforcement-helpers.ts +97 -0
- package/node_modules/@bereach/tools/src/enforcement-rules.ts +57 -0
- package/node_modules/@bereach/tools/src/enforcement-types.ts +312 -0
- package/node_modules/@bereach/tools/src/index.ts +40 -0
- package/node_modules/@bereach/tools/src/parse-utils.ts +96 -0
- package/node_modules/@bereach/tools/src/types.ts +10 -0
- package/node_modules/@bereach/tools/src/utils.ts +75 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -1
- package/skills/bereach/SKILL.md +2 -2
- package/skills/bereach/sub/lead-gen.md +35 -27
- package/src/commands/connector.ts +53 -13
- package/src/commands/setup.ts +1 -1
- package/src/connector/manager.ts +28 -1
- package/src/connector-cli.ts +11 -0
- package/src/hooks/cache.ts +26 -100
- package/src/hooks/detect-task-mode.ts +66 -0
- package/src/hooks/enforcement-rules.ts +2 -59
- package/src/hooks/lifecycle.ts +17 -3
- package/src/hooks/tracking.ts +19 -9
- package/src/hooks/types.ts +27 -366
- package/src/hooks/utils.ts +14 -71
- package/src/tools/definitions.ts +5 -2039
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bereach/tools",
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Shared BeReach tool definitions — JSON Schema, used by both OpenClaw and MCP server.",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.ts",
|
|
8
|
+
"./enforcement-types": "./src/enforcement-types.ts",
|
|
9
|
+
"./enforcement-rules": "./src/enforcement-rules.ts",
|
|
10
|
+
"./enforcement-helpers": "./src/enforcement-helpers.ts",
|
|
11
|
+
"./utils": "./src/utils.ts",
|
|
12
|
+
"./cache-types": "./src/cache-types.ts",
|
|
13
|
+
"./parse-utils": "./src/parse-utils.ts"
|
|
14
|
+
},
|
|
15
|
+
"files": ["src/"],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"typecheck": "tsc --noEmit"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"typescript": "^6.0.2"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared cache type interfaces for BeReach API data.
|
|
3
|
+
* Extracted from plugins/openclaw/src/hooks/cache.ts — interfaces only.
|
|
4
|
+
*
|
|
5
|
+
* Cache implementation (module-level Map, getOrFetch, fetchSnapshot)
|
|
6
|
+
* stays in each consumer (OpenClaw uses module cache, MCP uses DO SQL).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { DbCampaign } from "./enforcement-types.js";
|
|
10
|
+
|
|
11
|
+
export interface CachedCredits {
|
|
12
|
+
current: number;
|
|
13
|
+
limit: number | null;
|
|
14
|
+
remaining: number | null;
|
|
15
|
+
isUnlimited: boolean;
|
|
16
|
+
percentage: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Rate limits come from the API with workspace multiplier already applied.
|
|
21
|
+
* Base limits x multiplier (x1, x3, x5 depending on plan/account warming).
|
|
22
|
+
* These protect against LinkedIn internal limits / account bans.
|
|
23
|
+
*/
|
|
24
|
+
export interface CachedLimits {
|
|
25
|
+
multiplier: number;
|
|
26
|
+
limits: Record<
|
|
27
|
+
string,
|
|
28
|
+
{
|
|
29
|
+
daily: { current: number; limit: number; remaining: number } | null;
|
|
30
|
+
weekly?: { current: number; limit: number; remaining: number } | null;
|
|
31
|
+
multiplier?: number;
|
|
32
|
+
}
|
|
33
|
+
>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface CachedPipeline {
|
|
37
|
+
contact: number;
|
|
38
|
+
lead: number;
|
|
39
|
+
qualified: number;
|
|
40
|
+
approved: number;
|
|
41
|
+
rejected: number;
|
|
42
|
+
total: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ContextEntry {
|
|
46
|
+
type: string;
|
|
47
|
+
label: string | null;
|
|
48
|
+
content: string;
|
|
49
|
+
scope: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CachedAccount {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string | null;
|
|
55
|
+
plan: string;
|
|
56
|
+
headline: string | null;
|
|
57
|
+
isUnlimited: boolean;
|
|
58
|
+
creditsLimit: number;
|
|
59
|
+
creditsCount: number;
|
|
60
|
+
isCurrent?: boolean;
|
|
61
|
+
simulateWrites?: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface SessionMeta {
|
|
65
|
+
lastSessionAt: string | null;
|
|
66
|
+
lastProfileRefreshAt: string | null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface OnboardingState {
|
|
70
|
+
completed?: boolean;
|
|
71
|
+
icpConfirmed?: boolean;
|
|
72
|
+
quickWinDone?: boolean;
|
|
73
|
+
completedAt?: string;
|
|
74
|
+
phase?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface RecentEvent {
|
|
78
|
+
id: string;
|
|
79
|
+
type: string;
|
|
80
|
+
campaignId?: string;
|
|
81
|
+
campaignName?: string;
|
|
82
|
+
summary: string;
|
|
83
|
+
metadata: Record<string, unknown>;
|
|
84
|
+
timestamp: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface CacheStore {
|
|
88
|
+
credits: CachedCredits | null;
|
|
89
|
+
limits: CachedLimits | null;
|
|
90
|
+
pipeline: CachedPipeline | null;
|
|
91
|
+
contexts: ContextEntry[];
|
|
92
|
+
pendingDrafts: number;
|
|
93
|
+
failedDrafts: number;
|
|
94
|
+
unreadDMs: number;
|
|
95
|
+
pendingSentInvitations: number;
|
|
96
|
+
activeAccount: CachedAccount | null;
|
|
97
|
+
accounts: CachedAccount[];
|
|
98
|
+
leadGenState: Record<string, unknown> | null;
|
|
99
|
+
outreachState: Record<string, unknown> | null;
|
|
100
|
+
activeCampaigns: DbCampaign[];
|
|
101
|
+
campaignChecks: Record<string, string>;
|
|
102
|
+
sessionMeta: SessionMeta | null;
|
|
103
|
+
onboardingState: OnboardingState | null;
|
|
104
|
+
recentEvents: RecentEvent[];
|
|
105
|
+
}
|