lancer-shared 1.2.49 → 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 +69 -42
- package/dist/schemas/logger/log-event.d.ts +86 -1
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -12071,52 +12071,52 @@ const generateLeadCountsRequestSchema = z.object({
|
|
|
12071
12071
|
|
|
12072
12072
|
const LogEventTypeEnum = z.enum([
|
|
12073
12073
|
// Scraper Events
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12074
|
+
"scraperStarted",
|
|
12075
|
+
"scraperCompleted",
|
|
12076
|
+
"jobScraped",
|
|
12077
|
+
"jobScrapeFailed",
|
|
12078
|
+
"jobsIndexed",
|
|
12079
|
+
"jobDuplicateSkipped",
|
|
12080
|
+
"scraperFailed",
|
|
12081
|
+
"jobActivityScraped",
|
|
12082
|
+
"jobActivityScrapeFailed",
|
|
12083
|
+
"leadStatusCheckFailed",
|
|
12084
|
+
"leadStatusUpdated",
|
|
12085
12085
|
// Feed Scraper Events
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
|
|
12089
|
-
|
|
12086
|
+
"feedScrapeStarted",
|
|
12087
|
+
"feedScrapeCompleted",
|
|
12088
|
+
"feedScrapeFailed",
|
|
12089
|
+
"jobListingScraped",
|
|
12090
12090
|
// Job Sync & Campaign Matching
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
|
|
12091
|
+
"jobSyncPublished",
|
|
12092
|
+
"jobSyncReceived",
|
|
12093
|
+
"leadsCreatedAndSynced",
|
|
12094
12094
|
// Suitability Events
|
|
12095
|
-
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12095
|
+
"suitabilityPending",
|
|
12096
|
+
"suitabilityProcessing",
|
|
12097
|
+
"suitabilityComplete",
|
|
12098
|
+
"suitabilityFailed",
|
|
12099
|
+
"manualSuitabilityAnalyzed",
|
|
12100
12100
|
// Proposal Events
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12101
|
+
"proposalProcessing",
|
|
12102
|
+
"proposalComplete",
|
|
12103
|
+
"proposalFailed",
|
|
12104
|
+
"manualProposalGenerated",
|
|
12105
12105
|
// Bidding Events
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12106
|
+
"biddingProcessing",
|
|
12107
|
+
"biddingComplete",
|
|
12108
|
+
"biddingFailed",
|
|
12109
|
+
"biddingSkipped",
|
|
12110
|
+
"biddingPending",
|
|
12111
|
+
"biddingRetry",
|
|
12112
|
+
"biddingInsufficientConnects",
|
|
12113
|
+
"biddingWarningAlert",
|
|
12114
12114
|
// System/Generic Events
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12115
|
+
"errorLogged",
|
|
12116
|
+
"cloudTaskRetry",
|
|
12117
|
+
"manualLeadEdited",
|
|
12118
|
+
"leadArchived",
|
|
12119
|
+
"auditTrailLogged",
|
|
12120
12120
|
]);
|
|
12121
12121
|
const logEventSchema = z.object({
|
|
12122
12122
|
// The type of event (use a z.enum if possible)
|
|
@@ -12124,7 +12124,7 @@ const logEventSchema = z.object({
|
|
|
12124
12124
|
// The service that triggered the event
|
|
12125
12125
|
source: z.string(), // e.g. "lancer-agents", "lancer-bidding"
|
|
12126
12126
|
// Optional: Allow logging non-lead events in the future
|
|
12127
|
-
resourceType: z.string().default(
|
|
12127
|
+
resourceType: z.string().default("lead"), // e.g. "lead", "campaign", "user"
|
|
12128
12128
|
// ID of the resource (primary entity affected)
|
|
12129
12129
|
resourceId: z.string().nullable(), // fallback if leadId is not applicable
|
|
12130
12130
|
// Lead-level metadata
|
|
@@ -12174,7 +12174,7 @@ const biddingFailedEventMetadata = objectType({
|
|
|
12174
12174
|
error: z.any(),
|
|
12175
12175
|
});
|
|
12176
12176
|
const userAccountBiddingExceptionEventMetadata = objectType({
|
|
12177
|
-
errorType: z.enum([
|
|
12177
|
+
errorType: z.enum(["insufficientConnects", "proposalFormWarningAlert"]),
|
|
12178
12178
|
context: z.string().optional(),
|
|
12179
12179
|
});
|
|
12180
12180
|
const lancerBiddingExceptionEventMetadata = objectType({
|
|
@@ -12195,6 +12195,31 @@ const leadStatusEventMetadata = objectType({
|
|
|
12195
12195
|
.optional(),
|
|
12196
12196
|
reason: z.string().optional(),
|
|
12197
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
|
+
});
|
|
12198
12223
|
|
|
12199
12224
|
const usageEventTypeEnum = LogEventTypeEnum.extract([
|
|
12200
12225
|
"suitabilityComplete",
|
|
@@ -13759,6 +13784,7 @@ exports.planSchema = planSchema;
|
|
|
13759
13784
|
exports.planStripeMetadataSchema = planStripeMetadataSchema;
|
|
13760
13785
|
exports.portfolioSchema = portfolioSchema;
|
|
13761
13786
|
exports.projectDurationEnum = projectDurationEnum;
|
|
13787
|
+
exports.proposalCompleteEventMetadataSchema = proposalCompleteEventMetadataSchema;
|
|
13762
13788
|
exports.proposalErrorAlertException = proposalErrorAlertException;
|
|
13763
13789
|
exports.proposalFormWarningAlertException = proposalFormWarningAlertException;
|
|
13764
13790
|
exports.proposalSchema = proposalSchema;
|
|
@@ -13798,6 +13824,7 @@ exports.subscriptionSourceEnum = subscriptionSourceEnum;
|
|
|
13798
13824
|
exports.subscriptionStatusEnum = subscriptionStatusEnum;
|
|
13799
13825
|
exports.subscriptionStripeMetadataItemSchema = subscriptionStripeMetadataItemSchema;
|
|
13800
13826
|
exports.subscriptionStripeMetadataSchema = subscriptionStripeMetadataSchema;
|
|
13827
|
+
exports.suitabilityCompleteEventMetadataSchema = suitabilityCompleteEventMetadataSchema;
|
|
13801
13828
|
exports.suitabilityRatingSchema = suitabilityRatingSchema;
|
|
13802
13829
|
exports.systemPromptSchema = systemPromptSchema;
|
|
13803
13830
|
exports.systemSchema = systemSchema;
|
|
@@ -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>;
|