@elevasis/sdk 1.12.0 → 1.13.1
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/cli.cjs +1 -1
- package/dist/index.d.ts +287 -55
- package/dist/index.js +62 -117
- package/dist/test-utils/index.d.ts +275 -15
- package/dist/test-utils/index.js +10 -1
- package/dist/worker/index.js +10 -1
- package/package.json +1 -1
- package/reference/claude-config/rules/agent-start-here.md +13 -7
- package/reference/claude-config/rules/organization-os.md +10 -6
- package/reference/claude-config/rules/platform.md +2 -1
- package/reference/claude-config/rules/ui.md +8 -6
- package/reference/claude-config/rules/vibe.md +11 -5
- package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +1 -5
- package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +110 -0
- package/reference/packages/ui/src/test-utils/README.md +2 -0
- package/reference/scaffold/index.mdx +8 -5
- package/reference/scaffold/recipes/customize-crm-actions.md +411 -0
- package/reference/scaffold/recipes/extend-crm.md +255 -0
- package/reference/scaffold/recipes/extend-lead-gen.md +297 -0
- package/reference/scaffold/recipes/index.md +20 -11
- package/reference/scaffold/reference/contracts.md +2612 -0
- package/reference/scaffold/ui/customization.md +4 -0
package/dist/index.js
CHANGED
|
@@ -3716,50 +3716,6 @@ var DealCreatedEventSchema = z.object({
|
|
|
3716
3716
|
type: z.literal("deal_created"),
|
|
3717
3717
|
timestamp: z.string().datetime()
|
|
3718
3718
|
});
|
|
3719
|
-
var ReplyReceivedEventSchema = z.object({
|
|
3720
|
-
type: z.literal("reply_received"),
|
|
3721
|
-
timestamp: z.string().datetime(),
|
|
3722
|
-
messageId: z.string().optional(),
|
|
3723
|
-
source: z.string().optional()
|
|
3724
|
-
});
|
|
3725
|
-
var ReplySentToLeadEventSchema = z.object({
|
|
3726
|
-
type: z.literal("reply_sent_to_lead"),
|
|
3727
|
-
timestamp: z.string().datetime(),
|
|
3728
|
-
messageId: z.string().optional(),
|
|
3729
|
-
source: z.string().optional()
|
|
3730
|
-
});
|
|
3731
|
-
var BookingNudgeSentEventSchema = z.object({
|
|
3732
|
-
type: z.literal("booking_nudge_sent"),
|
|
3733
|
-
timestamp: z.string().datetime(),
|
|
3734
|
-
followupDay: z.number()
|
|
3735
|
-
});
|
|
3736
|
-
var ReminderSentEventSchema = z.object({
|
|
3737
|
-
type: z.literal("reminder_sent"),
|
|
3738
|
-
timestamp: z.string().datetime(),
|
|
3739
|
-
followupDay: z.number().optional()
|
|
3740
|
-
});
|
|
3741
|
-
var BookingCancelledEventSchema = z.object({
|
|
3742
|
-
type: z.literal("booking_cancelled"),
|
|
3743
|
-
timestamp: z.string().datetime(),
|
|
3744
|
-
reason: z.string().optional()
|
|
3745
|
-
});
|
|
3746
|
-
var DiscoverySubmittedEventSchema = z.object({
|
|
3747
|
-
type: z.literal("discovery_submitted"),
|
|
3748
|
-
timestamp: z.string().datetime()
|
|
3749
|
-
});
|
|
3750
|
-
var MovedToNurturingEventSchema = z.object({
|
|
3751
|
-
type: z.literal("moved_to_nurturing"),
|
|
3752
|
-
timestamp: z.string().datetime()
|
|
3753
|
-
});
|
|
3754
|
-
var NoShowEventSchema = z.object({
|
|
3755
|
-
type: z.literal("no_show"),
|
|
3756
|
-
timestamp: z.string().datetime()
|
|
3757
|
-
});
|
|
3758
|
-
var FollowupEmailSentEventSchema = z.object({
|
|
3759
|
-
type: z.literal("followup_email_sent"),
|
|
3760
|
-
timestamp: z.string().datetime(),
|
|
3761
|
-
followupDay: z.number().optional()
|
|
3762
|
-
});
|
|
3763
3719
|
var ActivityEventSchema = z.discriminatedUnion("type", [
|
|
3764
3720
|
StageChangeEventSchema,
|
|
3765
3721
|
StateChangeEventSchema,
|
|
@@ -3768,82 +3724,71 @@ var ActivityEventSchema = z.discriminatedUnion("type", [
|
|
|
3768
3724
|
ApprovalResolvedEventSchema,
|
|
3769
3725
|
ApprovalStaleEventSchema,
|
|
3770
3726
|
TaskCreatedEventSchema,
|
|
3771
|
-
DealCreatedEventSchema
|
|
3772
|
-
ReplyReceivedEventSchema,
|
|
3773
|
-
ReplySentToLeadEventSchema,
|
|
3774
|
-
BookingNudgeSentEventSchema,
|
|
3775
|
-
ReminderSentEventSchema,
|
|
3776
|
-
BookingCancelledEventSchema,
|
|
3777
|
-
DiscoverySubmittedEventSchema,
|
|
3778
|
-
MovedToNurturingEventSchema,
|
|
3779
|
-
NoShowEventSchema,
|
|
3780
|
-
FollowupEmailSentEventSchema
|
|
3727
|
+
DealCreatedEventSchema
|
|
3781
3728
|
]);
|
|
3782
3729
|
|
|
3783
3730
|
// ../core/src/business/acquisition/derive-actions.ts
|
|
3784
|
-
var
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
}
|
|
3797
|
-
|
|
3798
|
-
key:
|
|
3799
|
-
label:
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
}
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
}
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
}
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
return closingActions();
|
|
3842
|
-
case "closed_won":
|
|
3843
|
-
case "closed_lost":
|
|
3844
|
-
case "nurturing":
|
|
3845
|
-
return [];
|
|
3731
|
+
var DEFAULT_CRM_ACTIONS = [
|
|
3732
|
+
{
|
|
3733
|
+
key: "move_to_proposal",
|
|
3734
|
+
label: "Move to Proposal",
|
|
3735
|
+
isAvailableFor: (deal) => deal.stage_key === "interested",
|
|
3736
|
+
workflowId: "move_to_proposal-workflow"
|
|
3737
|
+
},
|
|
3738
|
+
{
|
|
3739
|
+
key: "move_to_closing",
|
|
3740
|
+
label: "Move to Closing",
|
|
3741
|
+
isAvailableFor: (deal) => deal.stage_key === "proposal",
|
|
3742
|
+
workflowId: "move_to_closing-workflow"
|
|
3743
|
+
},
|
|
3744
|
+
{
|
|
3745
|
+
key: "move_to_closed_won",
|
|
3746
|
+
label: "Close Won",
|
|
3747
|
+
isAvailableFor: (deal) => deal.stage_key === "closing",
|
|
3748
|
+
workflowId: "move_to_closed_won-workflow"
|
|
3749
|
+
},
|
|
3750
|
+
{
|
|
3751
|
+
key: "move_to_closed_lost",
|
|
3752
|
+
label: "Close Lost",
|
|
3753
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
|
|
3754
|
+
workflowId: "move_to_closed_lost-workflow"
|
|
3755
|
+
},
|
|
3756
|
+
{
|
|
3757
|
+
key: "move_to_nurturing",
|
|
3758
|
+
label: "Move to Nurturing",
|
|
3759
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
|
|
3760
|
+
workflowId: "move_to_nurturing-workflow"
|
|
3761
|
+
},
|
|
3762
|
+
{
|
|
3763
|
+
key: "send_link",
|
|
3764
|
+
label: "Send Booking Link",
|
|
3765
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_replied",
|
|
3766
|
+
workflowId: "crm-send-booking-link-workflow"
|
|
3767
|
+
},
|
|
3768
|
+
{
|
|
3769
|
+
key: "send_nudge",
|
|
3770
|
+
label: "Send Nudge",
|
|
3771
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === "discovery_link_sent" || deal.state_key === "discovery_nudging"),
|
|
3772
|
+
workflowId: "crm-send-nudge-workflow"
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
key: "mark_no_show",
|
|
3776
|
+
label: "Mark No-Show",
|
|
3777
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_nudging",
|
|
3778
|
+
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
3779
|
+
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
3780
|
+
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
3781
|
+
workflowId: "mark_no_show-workflow"
|
|
3782
|
+
},
|
|
3783
|
+
{
|
|
3784
|
+
key: "rebook",
|
|
3785
|
+
label: "Rebook",
|
|
3786
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_booking_cancelled",
|
|
3787
|
+
workflowId: "crm-rebook-workflow"
|
|
3846
3788
|
}
|
|
3789
|
+
];
|
|
3790
|
+
function deriveActions(deal, actions = DEFAULT_CRM_ACTIONS) {
|
|
3791
|
+
return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
|
|
3847
3792
|
}
|
|
3848
3793
|
|
|
3849
|
-
export { ActivityEventSchema, ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions };
|
|
3794
|
+
export { ActivityEventSchema, DEFAULT_CRM_ACTIONS, ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions };
|