@sellable/mcp 0.1.200 → 0.1.201
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/tools/navigation.d.ts +2 -0
- package/dist/tools/navigation.js +13 -16
- package/package.json +1 -1
|
@@ -38,6 +38,8 @@ type WorkflowTableMessageStats = {
|
|
|
38
38
|
type NavigationDebugPayload = Record<string, unknown>;
|
|
39
39
|
export declare function logNavigationDebug(event: string, payload?: NavigationDebugPayload, campaignId?: string | null): void;
|
|
40
40
|
type CreateCampaignStepId = "campaign-created" | "pick-provider" | "provider-search" | "confirm-lead-list" | "filter-rules" | "messages" | "settings" | "sequence" | "send" | "running";
|
|
41
|
+
export type GeneratedMessageApprovalGateMissing = "generatedMessages" | "approvedGeneratedMessage";
|
|
42
|
+
export declare function getGeneratedMessageApprovalGateMissing(stats?: WorkflowTableMessageStats | null, statsChecked?: boolean): GeneratedMessageApprovalGateMissing[];
|
|
41
43
|
export declare const navigationToolDefinitions: {
|
|
42
44
|
name: string;
|
|
43
45
|
description: string;
|
package/dist/tools/navigation.js
CHANGED
|
@@ -251,12 +251,9 @@ function getApprovedGeneratedMessageCount(stats) {
|
|
|
251
251
|
return null;
|
|
252
252
|
return stats.approvedCount ?? null;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
export function getGeneratedMessageApprovalGateMissing(stats, statsChecked = false) {
|
|
255
255
|
const missing = [];
|
|
256
|
-
if (
|
|
257
|
-
missing.push("approvedMessageTemplate");
|
|
258
|
-
}
|
|
259
|
-
if (statsChecked && hasApprovedMessageTemplate(campaign)) {
|
|
256
|
+
if (statsChecked) {
|
|
260
257
|
const generatedCount = getGeneratedMessageCount(stats) ?? 0;
|
|
261
258
|
const approvedCount = getApprovedGeneratedMessageCount(stats) ?? 0;
|
|
262
259
|
if (generatedCount <= 0) {
|
|
@@ -266,6 +263,10 @@ function checkMessages(campaign, stats, statsChecked = false) {
|
|
|
266
263
|
missing.push("approvedGeneratedMessage");
|
|
267
264
|
}
|
|
268
265
|
}
|
|
266
|
+
return missing;
|
|
267
|
+
}
|
|
268
|
+
function checkMessages(stats, statsChecked = false) {
|
|
269
|
+
const missing = getGeneratedMessageApprovalGateMissing(stats, statsChecked);
|
|
269
270
|
return { stepId: "messages", missing };
|
|
270
271
|
}
|
|
271
272
|
function checkSettings(campaign) {
|
|
@@ -541,7 +542,7 @@ export function computeCampaignNavigationStateFromCampaign(campaign, options) {
|
|
|
541
542
|
}
|
|
542
543
|
const evaluateTailState = shouldEvaluateTailState(campaign);
|
|
543
544
|
if (evaluateTailState) {
|
|
544
|
-
checks.push(checkMessages(
|
|
545
|
+
checks.push(checkMessages(options.messageStats ?? null, options.messageStatsChecked === true), checkSettings(campaign), checkSequence(campaign));
|
|
545
546
|
}
|
|
546
547
|
let computedStep = "campaign-created";
|
|
547
548
|
let blockedAt = null;
|
|
@@ -564,11 +565,9 @@ export function computeCampaignNavigationStateFromCampaign(campaign, options) {
|
|
|
564
565
|
computedStep = isRunningCampaign(campaign) ? "running" : "send";
|
|
565
566
|
}
|
|
566
567
|
const stepForHeadless = blockedAt ?? computedStep;
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
!hasApprovedMessageTemplate(campaign);
|
|
571
|
-
const waitingOnGeneratedMessageApproval = blockedAt === "messages" && hasApprovedMessageTemplate(campaign);
|
|
568
|
+
const waitingOnGeneratedMessageApproval = blockedAt === "messages" &&
|
|
569
|
+
(missing.includes("generatedMessages") ||
|
|
570
|
+
missing.includes("approvedGeneratedMessage"));
|
|
572
571
|
const expectedHeadlessStep = stepForHeadless === "campaign-created"
|
|
573
572
|
? "create-offer"
|
|
574
573
|
: stepForHeadless === "provider-search"
|
|
@@ -576,11 +575,9 @@ export function computeCampaignNavigationStateFromCampaign(campaign, options) {
|
|
|
576
575
|
: stepForHeadless === "filter-rules"
|
|
577
576
|
? "create-icp-rubric"
|
|
578
577
|
: stepForHeadless === "messages"
|
|
579
|
-
?
|
|
580
|
-
? "
|
|
581
|
-
:
|
|
582
|
-
? "auto-execute-messaging"
|
|
583
|
-
: "messages"
|
|
578
|
+
? waitingOnGeneratedMessageApproval
|
|
579
|
+
? "auto-execute-messaging"
|
|
580
|
+
: "messages"
|
|
584
581
|
: stepForHeadless === "settings"
|
|
585
582
|
? "settings"
|
|
586
583
|
: stepForHeadless === "sequence"
|