lumnisai 0.5.20 → 0.5.22
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/index.cjs +152 -0
- package/dist/index.d.cts +496 -11
- package/dist/index.d.mts +496 -11
- package/dist/index.d.ts +496 -11
- package/dist/index.mjs +152 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -663,6 +663,21 @@ class CampaignsResource {
|
|
|
663
663
|
`/campaigns/${encodeURIComponent(campaignId)}/prospects/${encodeURIComponent(prospectId)}`
|
|
664
664
|
);
|
|
665
665
|
}
|
|
666
|
+
/**
|
|
667
|
+
* Transfer prospects from this campaign into another campaign owned by
|
|
668
|
+
* the same user. Omit prospectIds to transfer every prospect.
|
|
669
|
+
*
|
|
670
|
+
* In-flight actions are cancelled and the prospect is re-evaluated under
|
|
671
|
+
* the target campaign's playbook; its action history and email threads
|
|
672
|
+
* follow it. Prospects already present in the target are skipped and
|
|
673
|
+
* reported with a reason.
|
|
674
|
+
*/
|
|
675
|
+
async transferProspects(campaignId, request) {
|
|
676
|
+
return this.http.post(
|
|
677
|
+
`/campaigns/${encodeURIComponent(campaignId)}/prospects/transfer`,
|
|
678
|
+
request
|
|
679
|
+
);
|
|
680
|
+
}
|
|
666
681
|
/**
|
|
667
682
|
* Remove a prospect from a campaign.
|
|
668
683
|
*/
|
|
@@ -3044,6 +3059,75 @@ class ResponsesResource {
|
|
|
3044
3059
|
if (!Array.isArray(validationOnlyCriteria))
|
|
3045
3060
|
throw new ValidationError("criteria_classification missing or invalid validation_only_criteria");
|
|
3046
3061
|
}
|
|
3062
|
+
_validateCompetitorPostEngagementParams(params) {
|
|
3063
|
+
const company = this._getParamValue(params, "company", "company");
|
|
3064
|
+
const competitors = this._getParamValue(params, "competitors", "competitors");
|
|
3065
|
+
const engagementTypes = this._getParamValue(
|
|
3066
|
+
params,
|
|
3067
|
+
"engagementTypes",
|
|
3068
|
+
"engagement_types"
|
|
3069
|
+
);
|
|
3070
|
+
const hasCompany = typeof company === "string" && company.trim().length > 0;
|
|
3071
|
+
const hasCompetitors = Array.isArray(competitors) && competitors.length > 0;
|
|
3072
|
+
if (hasCompany === hasCompetitors) {
|
|
3073
|
+
throw new ValidationError(
|
|
3074
|
+
"Provide exactly one of `company` or `competitors` for competitor_post_engagement."
|
|
3075
|
+
);
|
|
3076
|
+
}
|
|
3077
|
+
if (engagementTypes !== void 0) {
|
|
3078
|
+
if (!Array.isArray(engagementTypes) || engagementTypes.length === 0) {
|
|
3079
|
+
throw new ValidationError("engagementTypes must contain at least one value");
|
|
3080
|
+
}
|
|
3081
|
+
const validTypes = ["reactor", "commenter"];
|
|
3082
|
+
for (const type of engagementTypes) {
|
|
3083
|
+
if (!validTypes.includes(type)) {
|
|
3084
|
+
throw new ValidationError(
|
|
3085
|
+
`Invalid engagementTypes value: ${String(type)}. Expected 'reactor' and/or 'commenter'.`
|
|
3086
|
+
);
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
const limit = this._getParamValue(params, "limit", "limit");
|
|
3091
|
+
if (limit !== void 0 && (limit < 1 || limit > 1e3)) {
|
|
3092
|
+
throw new ValidationError("limit must be between 1 and 1000 for competitor_post_engagement");
|
|
3093
|
+
}
|
|
3094
|
+
const maxCompetitors = this._getParamValue(params, "maxCompetitors", "max_competitors");
|
|
3095
|
+
if (maxCompetitors !== void 0 && (maxCompetitors < 1 || maxCompetitors > 50)) {
|
|
3096
|
+
throw new ValidationError("maxCompetitors must be between 1 and 50");
|
|
3097
|
+
}
|
|
3098
|
+
const maxExecsPerTarget = this._getParamValue(
|
|
3099
|
+
params,
|
|
3100
|
+
"maxExecsPerTarget",
|
|
3101
|
+
"max_execs_per_target"
|
|
3102
|
+
);
|
|
3103
|
+
if (maxExecsPerTarget !== void 0 && (maxExecsPerTarget < 1 || maxExecsPerTarget > 20)) {
|
|
3104
|
+
throw new ValidationError("maxExecsPerTarget must be between 1 and 20");
|
|
3105
|
+
}
|
|
3106
|
+
const maxPostsPerTarget = this._getParamValue(
|
|
3107
|
+
params,
|
|
3108
|
+
"maxPostsPerTarget",
|
|
3109
|
+
"max_posts_per_target"
|
|
3110
|
+
);
|
|
3111
|
+
if (maxPostsPerTarget !== void 0 && (maxPostsPerTarget < 1 || maxPostsPerTarget > 20)) {
|
|
3112
|
+
throw new ValidationError("maxPostsPerTarget must be between 1 and 20");
|
|
3113
|
+
}
|
|
3114
|
+
const maxReactorsPerPost = this._getParamValue(
|
|
3115
|
+
params,
|
|
3116
|
+
"maxReactorsPerPost",
|
|
3117
|
+
"max_reactors_per_post"
|
|
3118
|
+
);
|
|
3119
|
+
if (maxReactorsPerPost !== void 0 && (maxReactorsPerPost < 1 || maxReactorsPerPost > 5e3)) {
|
|
3120
|
+
throw new ValidationError("maxReactorsPerPost must be between 1 and 5000");
|
|
3121
|
+
}
|
|
3122
|
+
const maxCommentsPerPost = this._getParamValue(
|
|
3123
|
+
params,
|
|
3124
|
+
"maxCommentsPerPost",
|
|
3125
|
+
"max_comments_per_post"
|
|
3126
|
+
);
|
|
3127
|
+
if (maxCommentsPerPost !== void 0 && (maxCommentsPerPost < 1 || maxCommentsPerPost > 100)) {
|
|
3128
|
+
throw new ValidationError("maxCommentsPerPost must be between 1 and 100");
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3047
3131
|
_validateCriteriaParams(params, specializedAgent) {
|
|
3048
3132
|
if (!params)
|
|
3049
3133
|
return;
|
|
@@ -3142,6 +3226,8 @@ class ResponsesResource {
|
|
|
3142
3226
|
);
|
|
3143
3227
|
}
|
|
3144
3228
|
}
|
|
3229
|
+
if (specializedAgent === "competitor_post_engagement")
|
|
3230
|
+
this._validateCompetitorPostEngagementParams(rawParams);
|
|
3145
3231
|
}
|
|
3146
3232
|
_validateFileReference(uri) {
|
|
3147
3233
|
if (uri.startsWith("artifact_"))
|
|
@@ -3411,6 +3497,72 @@ class ResponsesResource {
|
|
|
3411
3497
|
}
|
|
3412
3498
|
return this.create(request);
|
|
3413
3499
|
}
|
|
3500
|
+
/**
|
|
3501
|
+
* Score people who reacted to or commented on competitor LinkedIn posts.
|
|
3502
|
+
*
|
|
3503
|
+
* **Discovery mode** — pass `company`: ReAct discovers competitors (Exa +
|
|
3504
|
+
* optional Firecrawl + Fiber validation), engagement-ranks them, extracts
|
|
3505
|
+
* engagers from top posts, scores against the persona prompt.
|
|
3506
|
+
*
|
|
3507
|
+
* **Explicit mode** — pass `competitors`: skips discovery, uses your list.
|
|
3508
|
+
*
|
|
3509
|
+
* Requires `FIBER_API_KEY` + `CRUSTDATA_API_KEY`. `FIRECRAWL_API_KEY` is
|
|
3510
|
+
* optional but improves discovery quality on ambiguous domains.
|
|
3511
|
+
*
|
|
3512
|
+
* @param query - Persona prompt in messages (e.g. "VP Sales at mid-market SaaS…")
|
|
3513
|
+
* @param options - Exactly one of `company` or `competitors` is required
|
|
3514
|
+
* @returns Response; poll with `get()` then read `structuredResponse` as
|
|
3515
|
+
* {@link CompetitorPostEngagementOutput}. See `src/types/competitor-post-engagement.ts`
|
|
3516
|
+
* for the full agent reference (pipeline, API keys, engagementData shape, costs).
|
|
3517
|
+
*/
|
|
3518
|
+
async competitorPostEngagement(query, options) {
|
|
3519
|
+
const hasCompany = typeof options.company === "string" && options.company.trim().length > 0;
|
|
3520
|
+
const hasCompetitors = Array.isArray(options.competitors) && options.competitors.length > 0;
|
|
3521
|
+
if (hasCompany === hasCompetitors) {
|
|
3522
|
+
throw new ValidationError(
|
|
3523
|
+
"Provide exactly one of `company` or `competitors` for competitorPostEngagement."
|
|
3524
|
+
);
|
|
3525
|
+
}
|
|
3526
|
+
const request = {
|
|
3527
|
+
messages: [{ role: "user", content: query }],
|
|
3528
|
+
specializedAgent: "competitor_post_engagement"
|
|
3529
|
+
};
|
|
3530
|
+
const params = {};
|
|
3531
|
+
if (options.company)
|
|
3532
|
+
params.company = options.company;
|
|
3533
|
+
if (options.competitors)
|
|
3534
|
+
params.competitors = options.competitors;
|
|
3535
|
+
if (options.companyContext)
|
|
3536
|
+
params.companyContext = options.companyContext;
|
|
3537
|
+
if (options.companyExamples)
|
|
3538
|
+
params.companyExamples = options.companyExamples;
|
|
3539
|
+
if (options.limit !== void 0)
|
|
3540
|
+
params.limit = options.limit;
|
|
3541
|
+
if (options.postsDateRange)
|
|
3542
|
+
params.postsDateRange = options.postsDateRange;
|
|
3543
|
+
if (options.engagementTypes)
|
|
3544
|
+
params.engagementTypes = options.engagementTypes;
|
|
3545
|
+
if (options.includeCompanyPosts !== void 0)
|
|
3546
|
+
params.includeCompanyPosts = options.includeCompanyPosts;
|
|
3547
|
+
if (options.includeExecPosts !== void 0)
|
|
3548
|
+
params.includeExecPosts = options.includeExecPosts;
|
|
3549
|
+
if (options.excludeCompetitorEmployees !== void 0)
|
|
3550
|
+
params.excludeCompetitorEmployees = options.excludeCompetitorEmployees;
|
|
3551
|
+
if (options.execTitles)
|
|
3552
|
+
params.execTitles = options.execTitles;
|
|
3553
|
+
if (options.maxCompetitors !== void 0)
|
|
3554
|
+
params.maxCompetitors = options.maxCompetitors;
|
|
3555
|
+
if (options.maxExecsPerTarget !== void 0)
|
|
3556
|
+
params.maxExecsPerTarget = options.maxExecsPerTarget;
|
|
3557
|
+
if (options.maxPostsPerTarget !== void 0)
|
|
3558
|
+
params.maxPostsPerTarget = options.maxPostsPerTarget;
|
|
3559
|
+
if (options.maxReactorsPerPost !== void 0)
|
|
3560
|
+
params.maxReactorsPerPost = options.maxReactorsPerPost;
|
|
3561
|
+
if (options.maxCommentsPerPost !== void 0)
|
|
3562
|
+
params.maxCommentsPerPost = options.maxCommentsPerPost;
|
|
3563
|
+
request.specializedAgentParams = params;
|
|
3564
|
+
return this.create(request);
|
|
3565
|
+
}
|
|
3414
3566
|
}
|
|
3415
3567
|
|
|
3416
3568
|
class SequencesResource {
|