@elevasis/sdk 1.14.0 → 1.15.0
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 +32 -0
- package/dist/index.js +76 -5
- package/dist/test-utils/index.d.ts +32 -0
- package/dist/test-utils/index.js +2 -0
- package/dist/worker/index.js +1 -0
- package/package.json +2 -2
- package/reference/claude-config/rules/agent-start-here.md +235 -235
- package/reference/claude-config/rules/organization-os.md +103 -103
- package/reference/claude-config/rules/platform.md +1 -1
- package/reference/claude-config/rules/ui.md +204 -204
- package/reference/claude-config/rules/vibe.md +208 -208
- package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +2 -0
- package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -0
- package/reference/scaffold/index.mdx +67 -67
- package/reference/scaffold/recipes/customize-crm-actions.md +433 -408
- package/reference/scaffold/recipes/extend-lead-gen.md +28 -30
- package/reference/scaffold/recipes/index.md +41 -41
- package/reference/scaffold/reference/contracts.md +979 -967
- package/reference/scaffold/ui/customization.md +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -40481,7 +40481,7 @@ function wrapAction(commandName, fn) {
|
|
|
40481
40481
|
// package.json
|
|
40482
40482
|
var package_default = {
|
|
40483
40483
|
name: "@elevasis/sdk",
|
|
40484
|
-
version: "1.
|
|
40484
|
+
version: "1.15.0",
|
|
40485
40485
|
description: "SDK for building Elevasis organization resources",
|
|
40486
40486
|
type: "module",
|
|
40487
40487
|
bin: {
|
package/dist/index.d.ts
CHANGED
|
@@ -4332,6 +4332,11 @@ declare const DealSchemas: {
|
|
|
4332
4332
|
reason: z.ZodOptional<z.ZodString>;
|
|
4333
4333
|
expectedUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
4334
4334
|
}, z.core.$strict>;
|
|
4335
|
+
TransitionDealStateRequest: z.ZodObject<{
|
|
4336
|
+
stateKey: z.ZodString;
|
|
4337
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
4338
|
+
expectedUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
4339
|
+
}, z.core.$strict>;
|
|
4335
4340
|
ExecuteActionParams: z.ZodObject<{
|
|
4336
4341
|
dealId: z.ZodString;
|
|
4337
4342
|
actionKey: z.ZodString;
|
|
@@ -4527,6 +4532,18 @@ declare const DealSchemas: {
|
|
|
4527
4532
|
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
4528
4533
|
}, z.core.$strip>>;
|
|
4529
4534
|
};
|
|
4535
|
+
/**
|
|
4536
|
+
* Terminal row-level status for one lead-gen processing stage.
|
|
4537
|
+
* Missing key still means not attempted; legacy boolean `true` is normalized
|
|
4538
|
+
* to `success` by the API reader during rollout.
|
|
4539
|
+
*/
|
|
4540
|
+
declare const ProcessingStageStatusSchema: z.ZodEnum<{
|
|
4541
|
+
error: "error";
|
|
4542
|
+
success: "success";
|
|
4543
|
+
skipped: "skipped";
|
|
4544
|
+
no_result: "no_result";
|
|
4545
|
+
}>;
|
|
4546
|
+
type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
|
|
4530
4547
|
|
|
4531
4548
|
/**
|
|
4532
4549
|
* Lead Service Types
|
|
@@ -4882,6 +4899,7 @@ interface UpdateCompanyStageParams {
|
|
|
4882
4899
|
listId: string;
|
|
4883
4900
|
companyId: string;
|
|
4884
4901
|
stage: string;
|
|
4902
|
+
status?: ProcessingStageStatus;
|
|
4885
4903
|
executionId?: string;
|
|
4886
4904
|
}
|
|
4887
4905
|
interface UpdateContactStageParams {
|
|
@@ -4889,8 +4907,18 @@ interface UpdateContactStageParams {
|
|
|
4889
4907
|
listId: string;
|
|
4890
4908
|
contactId: string;
|
|
4891
4909
|
stage: string;
|
|
4910
|
+
status?: ProcessingStageStatus;
|
|
4892
4911
|
executionId?: string;
|
|
4893
4912
|
}
|
|
4913
|
+
interface AddCompaniesToListParams {
|
|
4914
|
+
organizationId: string;
|
|
4915
|
+
listId: string;
|
|
4916
|
+
companyIds: string[];
|
|
4917
|
+
}
|
|
4918
|
+
interface AddCompaniesToListResult {
|
|
4919
|
+
added: number;
|
|
4920
|
+
alreadyExisted: number;
|
|
4921
|
+
}
|
|
4894
4922
|
interface RecordListExecutionParams {
|
|
4895
4923
|
organizationId: string;
|
|
4896
4924
|
listId: string;
|
|
@@ -7664,6 +7692,10 @@ type LeadToolMap = {
|
|
|
7664
7692
|
params: Omit<AddContactsToListParams, 'organizationId'>;
|
|
7665
7693
|
result: AddContactsToListResult;
|
|
7666
7694
|
};
|
|
7695
|
+
addCompaniesToList: {
|
|
7696
|
+
params: Omit<AddCompaniesToListParams, 'organizationId'>;
|
|
7697
|
+
result: AddCompaniesToListResult;
|
|
7698
|
+
};
|
|
7667
7699
|
updateCompanyStage: {
|
|
7668
7700
|
params: Omit<UpdateCompanyStageParams, 'organizationId'>;
|
|
7669
7701
|
result: void;
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,77 @@ var ToolingError = class extends ExecutionError {
|
|
|
37
37
|
this.details = details;
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
+
var ModelIdSchema = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "IDs must be lowercase and use -, _, or . separators");
|
|
41
|
+
var LabelSchema = z.string().trim().min(1).max(120);
|
|
42
|
+
var DescriptionSchema = z.string().trim().min(1).max(2e3);
|
|
43
|
+
var ColorTokenSchema = z.string().trim().min(1).max(50);
|
|
44
|
+
var IconNameSchema = z.string().trim().min(1).max(80);
|
|
45
|
+
z.string().trim().startsWith("/").max(300);
|
|
46
|
+
var ReferenceIdsSchema = z.array(ModelIdSchema).default([]);
|
|
47
|
+
var DisplayMetadataSchema = z.object({
|
|
48
|
+
label: LabelSchema,
|
|
49
|
+
description: DescriptionSchema.optional(),
|
|
50
|
+
color: ColorTokenSchema.optional(),
|
|
51
|
+
icon: IconNameSchema.optional()
|
|
52
|
+
});
|
|
53
|
+
var TechStackEntrySchema = z.object({
|
|
54
|
+
/** Name of the external platform (e.g. "HubSpot", "Stripe", "Notion"). */
|
|
55
|
+
platform: z.string().trim().min(1).max(200),
|
|
56
|
+
/** Free-form description of what this integration is used for. */
|
|
57
|
+
purpose: z.string().trim().min(1).max(500),
|
|
58
|
+
/**
|
|
59
|
+
* Health of the credential backing this integration.
|
|
60
|
+
* - configured: credential present and valid
|
|
61
|
+
* - pending: not yet set up
|
|
62
|
+
* - expired: credential existed but has lapsed
|
|
63
|
+
* - missing: expected but not present
|
|
64
|
+
*/
|
|
65
|
+
credentialStatus: z.enum(["configured", "pending", "expired", "missing"]),
|
|
66
|
+
/**
|
|
67
|
+
* Whether this integration is the primary system of record for its domain
|
|
68
|
+
* (e.g. HubSpot is SoR for contacts). Defaults to false.
|
|
69
|
+
*/
|
|
70
|
+
isSystemOfRecord: z.boolean().default(false)
|
|
71
|
+
});
|
|
72
|
+
DisplayMetadataSchema.extend({
|
|
73
|
+
id: ModelIdSchema,
|
|
74
|
+
resourceId: z.string().trim().min(1).max(255),
|
|
75
|
+
resourceType: z.enum(["workflow", "agent", "trigger", "integration", "external", "human_checkpoint"]),
|
|
76
|
+
featureIds: ReferenceIdsSchema,
|
|
77
|
+
entityIds: ReferenceIdsSchema,
|
|
78
|
+
surfaceIds: ReferenceIdsSchema,
|
|
79
|
+
capabilityIds: ReferenceIdsSchema,
|
|
80
|
+
/** Optional tech-stack metadata for external-SaaS integrations. */
|
|
81
|
+
techStack: TechStackEntrySchema.optional()
|
|
82
|
+
});
|
|
83
|
+
var SalesStageSemanticClassSchema = z.enum(["open", "active", "nurturing", "closed_won", "closed_lost"]);
|
|
84
|
+
var SalesStageSchema = DisplayMetadataSchema.extend({
|
|
85
|
+
id: ModelIdSchema,
|
|
86
|
+
order: z.number().int().min(0),
|
|
87
|
+
semanticClass: SalesStageSemanticClassSchema,
|
|
88
|
+
surfaceIds: ReferenceIdsSchema,
|
|
89
|
+
resourceIds: ReferenceIdsSchema
|
|
90
|
+
});
|
|
91
|
+
var SalesPipelineSchema = z.object({
|
|
92
|
+
id: ModelIdSchema,
|
|
93
|
+
label: z.string().trim().min(1).max(120),
|
|
94
|
+
description: DescriptionSchema.optional(),
|
|
95
|
+
entityId: ModelIdSchema,
|
|
96
|
+
stages: z.array(SalesStageSchema).min(1)
|
|
97
|
+
});
|
|
98
|
+
z.object({
|
|
99
|
+
entityId: ModelIdSchema,
|
|
100
|
+
defaultPipelineId: ModelIdSchema,
|
|
101
|
+
pipelines: z.array(SalesPipelineSchema).min(1)
|
|
102
|
+
});
|
|
103
|
+
var CRM_DISCOVERY_REPLIED_STATE = {
|
|
104
|
+
stateKey: "discovery_replied"};
|
|
105
|
+
var CRM_DISCOVERY_LINK_SENT_STATE = {
|
|
106
|
+
stateKey: "discovery_link_sent"};
|
|
107
|
+
var CRM_DISCOVERY_NUDGING_STATE = {
|
|
108
|
+
stateKey: "discovery_nudging"};
|
|
109
|
+
var CRM_DISCOVERY_BOOKING_CANCELLED_STATE = {
|
|
110
|
+
stateKey: "discovery_booking_cancelled"};
|
|
40
111
|
|
|
41
112
|
// ../core/src/platform/registry/reserved.ts
|
|
42
113
|
var RESERVED_RESOURCE_IDS = /* @__PURE__ */ new Set(["command-center-assistant"]);
|
|
@@ -3763,26 +3834,26 @@ var DEFAULT_CRM_ACTIONS = [
|
|
|
3763
3834
|
{
|
|
3764
3835
|
key: "send_reply",
|
|
3765
3836
|
label: "Send Reply",
|
|
3766
|
-
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key ===
|
|
3837
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey || deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
|
|
3767
3838
|
workflowId: "crm-send-reply-workflow",
|
|
3768
3839
|
payloadSchema: SendReplyActionPayloadSchema
|
|
3769
3840
|
},
|
|
3770
3841
|
{
|
|
3771
3842
|
key: "send_link",
|
|
3772
3843
|
label: "Send Booking Link",
|
|
3773
|
-
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key ===
|
|
3844
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey,
|
|
3774
3845
|
workflowId: "crm-send-booking-link-workflow"
|
|
3775
3846
|
},
|
|
3776
3847
|
{
|
|
3777
3848
|
key: "send_nudge",
|
|
3778
3849
|
label: "Send Nudge",
|
|
3779
|
-
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key ===
|
|
3850
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey || deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
|
|
3780
3851
|
workflowId: "crm-send-nudge-workflow"
|
|
3781
3852
|
},
|
|
3782
3853
|
{
|
|
3783
3854
|
key: "mark_no_show",
|
|
3784
3855
|
label: "Mark No-Show",
|
|
3785
|
-
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key ===
|
|
3856
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
|
|
3786
3857
|
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
3787
3858
|
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
3788
3859
|
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
@@ -3791,7 +3862,7 @@ var DEFAULT_CRM_ACTIONS = [
|
|
|
3791
3862
|
{
|
|
3792
3863
|
key: "rebook",
|
|
3793
3864
|
label: "Rebook",
|
|
3794
|
-
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key ===
|
|
3865
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey,
|
|
3795
3866
|
workflowId: "crm-rebook-workflow"
|
|
3796
3867
|
}
|
|
3797
3868
|
];
|
|
@@ -4113,6 +4113,11 @@ declare const DealSchemas: {
|
|
|
4113
4113
|
reason: z.ZodOptional<z.ZodString>;
|
|
4114
4114
|
expectedUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
4115
4115
|
}, z.core.$strict>;
|
|
4116
|
+
TransitionDealStateRequest: z.ZodObject<{
|
|
4117
|
+
stateKey: z.ZodString;
|
|
4118
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
4119
|
+
expectedUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
4120
|
+
}, z.core.$strict>;
|
|
4116
4121
|
ExecuteActionParams: z.ZodObject<{
|
|
4117
4122
|
dealId: z.ZodString;
|
|
4118
4123
|
actionKey: z.ZodString;
|
|
@@ -4308,6 +4313,18 @@ declare const DealSchemas: {
|
|
|
4308
4313
|
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
4309
4314
|
}, z.core.$strip>>;
|
|
4310
4315
|
};
|
|
4316
|
+
/**
|
|
4317
|
+
* Terminal row-level status for one lead-gen processing stage.
|
|
4318
|
+
* Missing key still means not attempted; legacy boolean `true` is normalized
|
|
4319
|
+
* to `success` by the API reader during rollout.
|
|
4320
|
+
*/
|
|
4321
|
+
declare const ProcessingStageStatusSchema: z.ZodEnum<{
|
|
4322
|
+
error: "error";
|
|
4323
|
+
success: "success";
|
|
4324
|
+
skipped: "skipped";
|
|
4325
|
+
no_result: "no_result";
|
|
4326
|
+
}>;
|
|
4327
|
+
type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
|
|
4311
4328
|
|
|
4312
4329
|
/**
|
|
4313
4330
|
* Lead Service Types
|
|
@@ -4663,6 +4680,7 @@ interface UpdateCompanyStageParams {
|
|
|
4663
4680
|
listId: string;
|
|
4664
4681
|
companyId: string;
|
|
4665
4682
|
stage: string;
|
|
4683
|
+
status?: ProcessingStageStatus;
|
|
4666
4684
|
executionId?: string;
|
|
4667
4685
|
}
|
|
4668
4686
|
interface UpdateContactStageParams {
|
|
@@ -4670,8 +4688,18 @@ interface UpdateContactStageParams {
|
|
|
4670
4688
|
listId: string;
|
|
4671
4689
|
contactId: string;
|
|
4672
4690
|
stage: string;
|
|
4691
|
+
status?: ProcessingStageStatus;
|
|
4673
4692
|
executionId?: string;
|
|
4674
4693
|
}
|
|
4694
|
+
interface AddCompaniesToListParams {
|
|
4695
|
+
organizationId: string;
|
|
4696
|
+
listId: string;
|
|
4697
|
+
companyIds: string[];
|
|
4698
|
+
}
|
|
4699
|
+
interface AddCompaniesToListResult {
|
|
4700
|
+
added: number;
|
|
4701
|
+
alreadyExisted: number;
|
|
4702
|
+
}
|
|
4675
4703
|
interface RecordListExecutionParams {
|
|
4676
4704
|
organizationId: string;
|
|
4677
4705
|
listId: string;
|
|
@@ -7376,6 +7404,10 @@ type LeadToolMap = {
|
|
|
7376
7404
|
params: Omit<AddContactsToListParams, 'organizationId'>;
|
|
7377
7405
|
result: AddContactsToListResult;
|
|
7378
7406
|
};
|
|
7407
|
+
addCompaniesToList: {
|
|
7408
|
+
params: Omit<AddCompaniesToListParams, 'organizationId'>;
|
|
7409
|
+
result: AddCompaniesToListResult;
|
|
7410
|
+
};
|
|
7379
7411
|
updateCompanyStage: {
|
|
7380
7412
|
params: Omit<UpdateCompanyStageParams, 'organizationId'>;
|
|
7381
7413
|
result: void;
|
package/dist/test-utils/index.js
CHANGED
|
@@ -6716,6 +6716,7 @@ createAdapter("acqDb", [
|
|
|
6716
6716
|
"updateList",
|
|
6717
6717
|
"deleteList",
|
|
6718
6718
|
"addContactsToList",
|
|
6719
|
+
"addCompaniesToList",
|
|
6719
6720
|
"updateCompanyStage",
|
|
6720
6721
|
"updateContactStage",
|
|
6721
6722
|
// Company operations
|
|
@@ -24229,6 +24230,7 @@ var mockAcqDb = (overrides) => createMockAdapter(
|
|
|
24229
24230
|
"updateList",
|
|
24230
24231
|
"deleteList",
|
|
24231
24232
|
"addContactsToList",
|
|
24233
|
+
"addCompaniesToList",
|
|
24232
24234
|
"updateCompanyStage",
|
|
24233
24235
|
"updateContactStage",
|
|
24234
24236
|
"createCompany",
|
package/dist/worker/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"tsup": "^8.0.0",
|
|
51
51
|
"typescript": "5.9.2",
|
|
52
52
|
"zod": "^4.1.0",
|
|
53
|
-
"@repo/core": "0.
|
|
53
|
+
"@repo/core": "0.15.0",
|
|
54
54
|
"@repo/typescript-config": "0.0.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|