lancer-shared 1.2.48 → 1.2.50
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/bundle.cjs.js
CHANGED
|
@@ -6590,10 +6590,12 @@ const ROUTES = {
|
|
|
6590
6590
|
BASE: "agent",
|
|
6591
6591
|
SCRAPE_UPWORK_PROFILE: "agent/scrape-upwork-profile",
|
|
6592
6592
|
GENERATE_DEFAULT_AI_CONFIG: "agent/generate-ai-config",
|
|
6593
|
-
// TEST_AI_CONFIG: 'agent/test-ai-config',
|
|
6594
6593
|
TEST_SUITABILITY: "agent/test-suitability",
|
|
6595
6594
|
TEST_PROPOSAL: "agent/test-proposal",
|
|
6596
6595
|
TEST_SYSTEM_PROMPTS: "agent/test-system-prompts",
|
|
6596
|
+
ANALYZE_LEAD: "agent/analyze-lead",
|
|
6597
|
+
GENERATE_PROPOSAL: "agent/generate-proposal",
|
|
6598
|
+
BID: "agent/bid",
|
|
6597
6599
|
},
|
|
6598
6600
|
PLANS: {
|
|
6599
6601
|
BASE: "plans",
|
|
@@ -12069,52 +12071,52 @@ const generateLeadCountsRequestSchema = z.object({
|
|
|
12069
12071
|
|
|
12070
12072
|
const LogEventTypeEnum = z.enum([
|
|
12071
12073
|
// Scraper Events
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12074
|
+
"scraperStarted",
|
|
12075
|
+
"scraperCompleted",
|
|
12076
|
+
"jobScraped",
|
|
12077
|
+
"jobScrapeFailed",
|
|
12078
|
+
"jobsIndexed",
|
|
12079
|
+
"jobDuplicateSkipped",
|
|
12080
|
+
"scraperFailed",
|
|
12081
|
+
"jobActivityScraped",
|
|
12082
|
+
"jobActivityScrapeFailed",
|
|
12083
|
+
"leadStatusCheckFailed",
|
|
12084
|
+
"leadStatusUpdated",
|
|
12083
12085
|
// Feed Scraper Events
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
12087
|
-
|
|
12086
|
+
"feedScrapeStarted",
|
|
12087
|
+
"feedScrapeCompleted",
|
|
12088
|
+
"feedScrapeFailed",
|
|
12089
|
+
"jobListingScraped",
|
|
12088
12090
|
// Job Sync & Campaign Matching
|
|
12089
|
-
|
|
12090
|
-
|
|
12091
|
-
|
|
12091
|
+
"jobSyncPublished",
|
|
12092
|
+
"jobSyncReceived",
|
|
12093
|
+
"leadsCreatedAndSynced",
|
|
12092
12094
|
// Suitability Events
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
12097
|
-
|
|
12095
|
+
"suitabilityPending",
|
|
12096
|
+
"suitabilityProcessing",
|
|
12097
|
+
"suitabilityComplete",
|
|
12098
|
+
"suitabilityFailed",
|
|
12099
|
+
"manualSuitabilityAnalyzed",
|
|
12098
12100
|
// Proposal Events
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12101
|
+
"proposalProcessing",
|
|
12102
|
+
"proposalComplete",
|
|
12103
|
+
"proposalFailed",
|
|
12104
|
+
"manualProposalGenerated",
|
|
12103
12105
|
// Bidding Events
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12106
|
+
"biddingProcessing",
|
|
12107
|
+
"biddingComplete",
|
|
12108
|
+
"biddingFailed",
|
|
12109
|
+
"biddingSkipped",
|
|
12110
|
+
"biddingPending",
|
|
12111
|
+
"biddingRetry",
|
|
12112
|
+
"biddingInsufficientConnects",
|
|
12113
|
+
"biddingWarningAlert",
|
|
12112
12114
|
// System/Generic Events
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12115
|
+
"errorLogged",
|
|
12116
|
+
"cloudTaskRetry",
|
|
12117
|
+
"manualLeadEdited",
|
|
12118
|
+
"leadArchived",
|
|
12119
|
+
"auditTrailLogged",
|
|
12118
12120
|
]);
|
|
12119
12121
|
const logEventSchema = z.object({
|
|
12120
12122
|
// The type of event (use a z.enum if possible)
|
|
@@ -12122,7 +12124,7 @@ const logEventSchema = z.object({
|
|
|
12122
12124
|
// The service that triggered the event
|
|
12123
12125
|
source: z.string(), // e.g. "lancer-agents", "lancer-bidding"
|
|
12124
12126
|
// Optional: Allow logging non-lead events in the future
|
|
12125
|
-
resourceType: z.string().default(
|
|
12127
|
+
resourceType: z.string().default("lead"), // e.g. "lead", "campaign", "user"
|
|
12126
12128
|
// ID of the resource (primary entity affected)
|
|
12127
12129
|
resourceId: z.string().nullable(), // fallback if leadId is not applicable
|
|
12128
12130
|
// Lead-level metadata
|
|
@@ -12172,7 +12174,7 @@ const biddingFailedEventMetadata = objectType({
|
|
|
12172
12174
|
error: z.any(),
|
|
12173
12175
|
});
|
|
12174
12176
|
const userAccountBiddingExceptionEventMetadata = objectType({
|
|
12175
|
-
errorType: z.enum([
|
|
12177
|
+
errorType: z.enum(["insufficientConnects", "proposalFormWarningAlert"]),
|
|
12176
12178
|
context: z.string().optional(),
|
|
12177
12179
|
});
|
|
12178
12180
|
const lancerBiddingExceptionEventMetadata = objectType({
|
|
@@ -12193,6 +12195,31 @@ const leadStatusEventMetadata = objectType({
|
|
|
12193
12195
|
.optional(),
|
|
12194
12196
|
reason: z.string().optional(),
|
|
12195
12197
|
});
|
|
12198
|
+
const suitabilityCompleteEventMetadataSchema = objectType({
|
|
12199
|
+
suitabilityRating: z.number(),
|
|
12200
|
+
suitabilityReason: z.string(),
|
|
12201
|
+
agentStatus: z.string(),
|
|
12202
|
+
model: z.string(),
|
|
12203
|
+
provider: z.string(),
|
|
12204
|
+
promptTokens: z.number(),
|
|
12205
|
+
completionTokens: z.number(),
|
|
12206
|
+
messages: z.array(objectType({
|
|
12207
|
+
role: z.enum(["user", "assistant", "system"]),
|
|
12208
|
+
content: z.string(),
|
|
12209
|
+
})),
|
|
12210
|
+
});
|
|
12211
|
+
const proposalCompleteEventMetadataSchema = objectType({
|
|
12212
|
+
agentStatus: z.string(),
|
|
12213
|
+
proposal: z.string(),
|
|
12214
|
+
model: z.string(),
|
|
12215
|
+
provider: z.string(),
|
|
12216
|
+
promptTokens: z.number(),
|
|
12217
|
+
completionTokens: z.number(),
|
|
12218
|
+
messages: z.array(objectType({
|
|
12219
|
+
role: z.enum(["user", "assistant", "system"]),
|
|
12220
|
+
content: z.string(),
|
|
12221
|
+
})),
|
|
12222
|
+
});
|
|
12196
12223
|
|
|
12197
12224
|
const usageEventTypeEnum = LogEventTypeEnum.extract([
|
|
12198
12225
|
"suitabilityComplete",
|
|
@@ -13757,6 +13784,7 @@ exports.planSchema = planSchema;
|
|
|
13757
13784
|
exports.planStripeMetadataSchema = planStripeMetadataSchema;
|
|
13758
13785
|
exports.portfolioSchema = portfolioSchema;
|
|
13759
13786
|
exports.projectDurationEnum = projectDurationEnum;
|
|
13787
|
+
exports.proposalCompleteEventMetadataSchema = proposalCompleteEventMetadataSchema;
|
|
13760
13788
|
exports.proposalErrorAlertException = proposalErrorAlertException;
|
|
13761
13789
|
exports.proposalFormWarningAlertException = proposalFormWarningAlertException;
|
|
13762
13790
|
exports.proposalSchema = proposalSchema;
|
|
@@ -13796,6 +13824,7 @@ exports.subscriptionSourceEnum = subscriptionSourceEnum;
|
|
|
13796
13824
|
exports.subscriptionStatusEnum = subscriptionStatusEnum;
|
|
13797
13825
|
exports.subscriptionStripeMetadataItemSchema = subscriptionStripeMetadataItemSchema;
|
|
13798
13826
|
exports.subscriptionStripeMetadataSchema = subscriptionStripeMetadataSchema;
|
|
13827
|
+
exports.suitabilityCompleteEventMetadataSchema = suitabilityCompleteEventMetadataSchema;
|
|
13799
13828
|
exports.suitabilityRatingSchema = suitabilityRatingSchema;
|
|
13800
13829
|
exports.systemPromptSchema = systemPromptSchema;
|
|
13801
13830
|
exports.systemSchema = systemSchema;
|
|
@@ -177,6 +177,9 @@ export declare const ROUTES: {
|
|
|
177
177
|
readonly TEST_SUITABILITY: "agent/test-suitability";
|
|
178
178
|
readonly TEST_PROPOSAL: "agent/test-proposal";
|
|
179
179
|
readonly TEST_SYSTEM_PROMPTS: "agent/test-system-prompts";
|
|
180
|
+
readonly ANALYZE_LEAD: "agent/analyze-lead";
|
|
181
|
+
readonly GENERATE_PROPOSAL: "agent/generate-proposal";
|
|
182
|
+
readonly BID: "agent/bid";
|
|
180
183
|
};
|
|
181
184
|
readonly PLANS: {
|
|
182
185
|
readonly BASE: "plans";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
export declare const LogEventTypeEnum: z.ZodEnum<["scraperStarted", "scraperCompleted", "jobScraped", "jobScrapeFailed", "jobsIndexed", "jobDuplicateSkipped", "scraperFailed", "jobActivityScraped", "jobActivityScrapeFailed", "leadStatusCheckFailed", "leadStatusUpdated", "feedScrapeStarted", "feedScrapeCompleted", "feedScrapeFailed", "jobListingScraped", "jobSyncPublished", "jobSyncReceived", "leadsCreatedAndSynced", "suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "proposalProcessing", "proposalComplete", "proposalFailed", "manualProposalGenerated", "biddingProcessing", "biddingComplete", "biddingFailed", "biddingSkipped", "biddingPending", "biddingRetry", "biddingInsufficientConnects", "biddingWarningAlert", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged"]>;
|
|
3
3
|
export declare const logEventSchema: z.ZodObject<{
|
|
4
4
|
type: z.ZodEnum<["scraperStarted", "scraperCompleted", "jobScraped", "jobScrapeFailed", "jobsIndexed", "jobDuplicateSkipped", "scraperFailed", "jobActivityScraped", "jobActivityScrapeFailed", "leadStatusCheckFailed", "leadStatusUpdated", "feedScrapeStarted", "feedScrapeCompleted", "feedScrapeFailed", "jobListingScraped", "jobSyncPublished", "jobSyncReceived", "leadsCreatedAndSynced", "suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "proposalProcessing", "proposalComplete", "proposalFailed", "manualProposalGenerated", "biddingProcessing", "biddingComplete", "biddingFailed", "biddingSkipped", "biddingPending", "biddingRetry", "biddingInsufficientConnects", "biddingWarningAlert", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged"]>;
|
|
@@ -331,3 +331,88 @@ export type FeedScrapeCompletedEventMetadata = z.infer<typeof feedScrapeComplete
|
|
|
331
331
|
export type BiddingCompletedEventMetadata = z.infer<typeof biddingCompletedEventMetadata>;
|
|
332
332
|
export type BiddingFailedEventMetadata = z.infer<typeof biddingFailedEventMetadata>;
|
|
333
333
|
export type LeadStatusEventMetadata = z.infer<typeof leadStatusEventMetadata>;
|
|
334
|
+
export declare const suitabilityCompleteEventMetadataSchema: z.ZodObject<{
|
|
335
|
+
suitabilityRating: z.ZodNumber;
|
|
336
|
+
suitabilityReason: z.ZodString;
|
|
337
|
+
agentStatus: z.ZodString;
|
|
338
|
+
model: z.ZodString;
|
|
339
|
+
provider: z.ZodString;
|
|
340
|
+
promptTokens: z.ZodNumber;
|
|
341
|
+
completionTokens: z.ZodNumber;
|
|
342
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
343
|
+
role: z.ZodEnum<["user", "assistant", "system"]>;
|
|
344
|
+
content: z.ZodString;
|
|
345
|
+
}, "strip", z.ZodTypeAny, {
|
|
346
|
+
role: "user" | "assistant" | "system";
|
|
347
|
+
content: string;
|
|
348
|
+
}, {
|
|
349
|
+
role: "user" | "assistant" | "system";
|
|
350
|
+
content: string;
|
|
351
|
+
}>, "many">;
|
|
352
|
+
}, "strip", z.ZodTypeAny, {
|
|
353
|
+
suitabilityRating: number;
|
|
354
|
+
suitabilityReason: string;
|
|
355
|
+
agentStatus: string;
|
|
356
|
+
model: string;
|
|
357
|
+
provider: string;
|
|
358
|
+
promptTokens: number;
|
|
359
|
+
completionTokens: number;
|
|
360
|
+
messages: {
|
|
361
|
+
role: "user" | "assistant" | "system";
|
|
362
|
+
content: string;
|
|
363
|
+
}[];
|
|
364
|
+
}, {
|
|
365
|
+
suitabilityRating: number;
|
|
366
|
+
suitabilityReason: string;
|
|
367
|
+
agentStatus: string;
|
|
368
|
+
model: string;
|
|
369
|
+
provider: string;
|
|
370
|
+
promptTokens: number;
|
|
371
|
+
completionTokens: number;
|
|
372
|
+
messages: {
|
|
373
|
+
role: "user" | "assistant" | "system";
|
|
374
|
+
content: string;
|
|
375
|
+
}[];
|
|
376
|
+
}>;
|
|
377
|
+
export type SuitabilityCompleteEventMetadata = z.infer<typeof suitabilityCompleteEventMetadataSchema>;
|
|
378
|
+
export declare const proposalCompleteEventMetadataSchema: z.ZodObject<{
|
|
379
|
+
agentStatus: z.ZodString;
|
|
380
|
+
proposal: z.ZodString;
|
|
381
|
+
model: z.ZodString;
|
|
382
|
+
provider: z.ZodString;
|
|
383
|
+
promptTokens: z.ZodNumber;
|
|
384
|
+
completionTokens: z.ZodNumber;
|
|
385
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
386
|
+
role: z.ZodEnum<["user", "assistant", "system"]>;
|
|
387
|
+
content: z.ZodString;
|
|
388
|
+
}, "strip", z.ZodTypeAny, {
|
|
389
|
+
role: "user" | "assistant" | "system";
|
|
390
|
+
content: string;
|
|
391
|
+
}, {
|
|
392
|
+
role: "user" | "assistant" | "system";
|
|
393
|
+
content: string;
|
|
394
|
+
}>, "many">;
|
|
395
|
+
}, "strip", z.ZodTypeAny, {
|
|
396
|
+
agentStatus: string;
|
|
397
|
+
model: string;
|
|
398
|
+
provider: string;
|
|
399
|
+
promptTokens: number;
|
|
400
|
+
completionTokens: number;
|
|
401
|
+
messages: {
|
|
402
|
+
role: "user" | "assistant" | "system";
|
|
403
|
+
content: string;
|
|
404
|
+
}[];
|
|
405
|
+
proposal: string;
|
|
406
|
+
}, {
|
|
407
|
+
agentStatus: string;
|
|
408
|
+
model: string;
|
|
409
|
+
provider: string;
|
|
410
|
+
promptTokens: number;
|
|
411
|
+
completionTokens: number;
|
|
412
|
+
messages: {
|
|
413
|
+
role: "user" | "assistant" | "system";
|
|
414
|
+
content: string;
|
|
415
|
+
}[];
|
|
416
|
+
proposal: string;
|
|
417
|
+
}>;
|
|
418
|
+
export type ProposalCompleteEventMetadata = z.infer<typeof proposalCompleteEventMetadataSchema>;
|