@synap-core/workspace-templates 0.38.1 → 0.40.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/automations/lead-reply-engaged.automation.json +62 -0
- package/automations/lead-reply-engaged.catalog.json +13 -0
- package/automations/lead-sent-outreach.automation.json +60 -0
- package/automations/lead-sent-outreach.catalog.json +13 -0
- package/capabilities/media-download.capability.json +2 -1
- package/capabilities/media-ffmpeg.capability.json +2 -1
- package/capabilities/media-matte.capability.json +2 -1
- package/capabilities/media-transcribe.capability.json +2 -1
- package/dist/{define-YL-hIPcn.d.ts → define-C0Iizc2r.d.ts} +36 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.js +231 -63
- package/dist/index.js.map +1 -1
- package/dist/wire.d.ts +1 -1
- package/package.json +1 -1
- package/src/crm-messages-cadence.template.test.ts +13 -1
- package/src/crm.yaml +34 -40
- package/src/foundation.yaml +53 -8
- package/src/index.ts +1 -0
- package/src/lead-automations.test.ts +104 -0
- package/src/lifecycle-declarations.test.ts +109 -0
- package/src/lifecycle-waits.parity.test.ts +91 -0
- package/src/templates.ts +166 -62
- package/src/types.ts +23 -0
- package/src/validate.ts +87 -0
package/dist/index.js
CHANGED
|
@@ -13421,7 +13421,7 @@ var DATA = {
|
|
|
13421
13421
|
"values": {
|
|
13422
13422
|
"commercialStage": "negotiating",
|
|
13423
13423
|
"value": 12e3,
|
|
13424
|
-
"
|
|
13424
|
+
"nextAction": "Send revised quote Thu"
|
|
13425
13425
|
}
|
|
13426
13426
|
},
|
|
13427
13427
|
{
|
|
@@ -13429,7 +13429,7 @@ var DATA = {
|
|
|
13429
13429
|
"values": {
|
|
13430
13430
|
"commercialStage": "proposed",
|
|
13431
13431
|
"value": 6e3,
|
|
13432
|
-
"
|
|
13432
|
+
"nextAction": "Follow up on proposal Mon"
|
|
13433
13433
|
}
|
|
13434
13434
|
},
|
|
13435
13435
|
{
|
|
@@ -13437,7 +13437,7 @@ var DATA = {
|
|
|
13437
13437
|
"values": {
|
|
13438
13438
|
"commercialStage": "draft",
|
|
13439
13439
|
"value": 2800,
|
|
13440
|
-
"
|
|
13440
|
+
"nextAction": "Discovery call Wed"
|
|
13441
13441
|
}
|
|
13442
13442
|
},
|
|
13443
13443
|
{
|
|
@@ -13445,7 +13445,7 @@ var DATA = {
|
|
|
13445
13445
|
"values": {
|
|
13446
13446
|
"commercialStage": "won",
|
|
13447
13447
|
"value": 18e3,
|
|
13448
|
-
"
|
|
13448
|
+
"nextAction": "Kick-off next week"
|
|
13449
13449
|
}
|
|
13450
13450
|
},
|
|
13451
13451
|
{
|
|
@@ -13593,18 +13593,6 @@ var DATA = {
|
|
|
13593
13593
|
"valueType": "date",
|
|
13594
13594
|
"inputType": "date"
|
|
13595
13595
|
},
|
|
13596
|
-
{
|
|
13597
|
-
"slug": "nextFollowUpDate",
|
|
13598
|
-
"label": "Next follow-up date",
|
|
13599
|
-
"valueType": "date",
|
|
13600
|
-
"inputType": "date"
|
|
13601
|
-
},
|
|
13602
|
-
{
|
|
13603
|
-
"slug": "nextStep",
|
|
13604
|
-
"label": "Next step",
|
|
13605
|
-
"valueType": "string",
|
|
13606
|
-
"inputType": "textarea"
|
|
13607
|
-
},
|
|
13608
13596
|
{
|
|
13609
13597
|
"slug": "notes",
|
|
13610
13598
|
"label": "Notes",
|
|
@@ -13698,18 +13686,6 @@ var DATA = {
|
|
|
13698
13686
|
"valueType": "date",
|
|
13699
13687
|
"inputType": "date"
|
|
13700
13688
|
},
|
|
13701
|
-
{
|
|
13702
|
-
"slug": "nextFollowUpDate",
|
|
13703
|
-
"label": "Next follow-up date",
|
|
13704
|
-
"valueType": "date",
|
|
13705
|
-
"inputType": "date"
|
|
13706
|
-
},
|
|
13707
|
-
{
|
|
13708
|
-
"slug": "nextStep",
|
|
13709
|
-
"label": "Next step",
|
|
13710
|
-
"valueType": "string",
|
|
13711
|
-
"inputType": "textarea"
|
|
13712
|
-
},
|
|
13713
13689
|
{
|
|
13714
13690
|
"slug": "notes",
|
|
13715
13691
|
"label": "Notes",
|
|
@@ -13732,18 +13708,45 @@ var DATA = {
|
|
|
13732
13708
|
"key": "draft",
|
|
13733
13709
|
"label": "Meeting booked",
|
|
13734
13710
|
"category": "open",
|
|
13735
|
-
"stuckAfterDays": 14
|
|
13711
|
+
"stuckAfterDays": 14,
|
|
13712
|
+
"requires": [
|
|
13713
|
+
{
|
|
13714
|
+
"kind": "property",
|
|
13715
|
+
"blockerKey": "no_next_step",
|
|
13716
|
+
"label": "A next step with a date",
|
|
13717
|
+
"property": "nextActionAt",
|
|
13718
|
+
"owner": "you"
|
|
13719
|
+
}
|
|
13720
|
+
]
|
|
13736
13721
|
},
|
|
13737
13722
|
{
|
|
13738
13723
|
"key": "proposed",
|
|
13739
13724
|
"label": "Proposal sent",
|
|
13740
13725
|
"category": "active",
|
|
13741
|
-
"stuckAfterDays": 14
|
|
13726
|
+
"stuckAfterDays": 14,
|
|
13727
|
+
"requires": [
|
|
13728
|
+
{
|
|
13729
|
+
"kind": "property",
|
|
13730
|
+
"blockerKey": "no_next_step",
|
|
13731
|
+
"label": "A next step with a date",
|
|
13732
|
+
"property": "nextActionAt",
|
|
13733
|
+
"owner": "you"
|
|
13734
|
+
}
|
|
13735
|
+
]
|
|
13742
13736
|
},
|
|
13743
13737
|
{
|
|
13744
13738
|
"key": "negotiating",
|
|
13745
13739
|
"category": "active",
|
|
13746
|
-
"stuckAfterDays": 14
|
|
13740
|
+
"stuckAfterDays": 14,
|
|
13741
|
+
"requires": [
|
|
13742
|
+
{
|
|
13743
|
+
"kind": "property",
|
|
13744
|
+
"blockerKey": "no_next_step",
|
|
13745
|
+
"label": "A next step with a date",
|
|
13746
|
+
"property": "nextActionAt",
|
|
13747
|
+
"owner": "you"
|
|
13748
|
+
}
|
|
13749
|
+
]
|
|
13747
13750
|
},
|
|
13748
13751
|
{
|
|
13749
13752
|
"key": "won",
|
|
@@ -13814,11 +13817,17 @@ var DATA = {
|
|
|
13814
13817
|
"inputType": "date"
|
|
13815
13818
|
},
|
|
13816
13819
|
{
|
|
13817
|
-
"slug": "
|
|
13818
|
-
"label": "Next
|
|
13820
|
+
"slug": "nextAction",
|
|
13821
|
+
"label": "Next action",
|
|
13819
13822
|
"valueType": "string",
|
|
13820
13823
|
"inputType": "textarea"
|
|
13821
13824
|
},
|
|
13825
|
+
{
|
|
13826
|
+
"slug": "nextActionAt",
|
|
13827
|
+
"label": "Next action at",
|
|
13828
|
+
"valueType": "date",
|
|
13829
|
+
"inputType": "date"
|
|
13830
|
+
},
|
|
13822
13831
|
{
|
|
13823
13832
|
"slug": "description",
|
|
13824
13833
|
"label": "Notes",
|
|
@@ -13979,12 +13988,6 @@ var DATA = {
|
|
|
13979
13988
|
"valueType": "date",
|
|
13980
13989
|
"inputType": "date"
|
|
13981
13990
|
},
|
|
13982
|
-
{
|
|
13983
|
-
"slug": "nextActionAt",
|
|
13984
|
-
"label": "Next action at",
|
|
13985
|
-
"valueType": "date",
|
|
13986
|
-
"inputType": "date"
|
|
13987
|
-
},
|
|
13988
13991
|
{
|
|
13989
13992
|
"slug": "nextAction",
|
|
13990
13993
|
"label": "Next action",
|
|
@@ -14519,7 +14522,8 @@ var DATA = {
|
|
|
14519
14522
|
"commercialStage",
|
|
14520
14523
|
"value",
|
|
14521
14524
|
"closeDate",
|
|
14522
|
-
"
|
|
14525
|
+
"nextAction",
|
|
14526
|
+
"nextActionAt"
|
|
14523
14527
|
]
|
|
14524
14528
|
}
|
|
14525
14529
|
},
|
|
@@ -14583,6 +14587,7 @@ var DATA = {
|
|
|
14583
14587
|
"starters": [
|
|
14584
14588
|
"A useful first pipeline is deliberately small. A deal's stages are the sale only \u2014 draft, proposed, negotiating, won, lost; who is worth pursuing at all is the lead's qualification, not a deal stage. Keep the template's stages unless the user's real process needs a different view.\n",
|
|
14585
14589
|
"Populate the workspace with live work, not a perfect historical archive: propose the three to five opportunities the user is actively trying to move, then add the companies and people needed to understand those deals.\n",
|
|
14590
|
+
"An import creates people and companies, never leads: the lead role is a qualification decision a person makes, one record at a time. Prefer a lead on the company, with the founder as the contact; add a person lead only when no company is known. Each lead carries one next action with a date (nextAction, nextActionAt), the same pair a deal carries.\n",
|
|
14586
14591
|
'Every active deal needs one observable next step with a date. If the next step is "follow up" or "keep warm", help turn it into a specific action such as "send the revised proposal Thursday" before capturing it.\n'
|
|
14587
14592
|
],
|
|
14588
14593
|
"blindSpots": [
|
|
@@ -14602,8 +14607,7 @@ var DATA = {
|
|
|
14602
14607
|
"website",
|
|
14603
14608
|
"industry",
|
|
14604
14609
|
"companySize",
|
|
14605
|
-
"source"
|
|
14606
|
-
"nextStep"
|
|
14610
|
+
"source"
|
|
14607
14611
|
]
|
|
14608
14612
|
},
|
|
14609
14613
|
{
|
|
@@ -14615,8 +14619,7 @@ var DATA = {
|
|
|
14615
14619
|
"email",
|
|
14616
14620
|
"jobTitle",
|
|
14617
14621
|
"company",
|
|
14618
|
-
"source"
|
|
14619
|
-
"nextFollowUpDate"
|
|
14622
|
+
"source"
|
|
14620
14623
|
]
|
|
14621
14624
|
},
|
|
14622
14625
|
{
|
|
@@ -14628,7 +14631,8 @@ var DATA = {
|
|
|
14628
14631
|
"commercialStage",
|
|
14629
14632
|
"value",
|
|
14630
14633
|
"closeDate",
|
|
14631
|
-
"
|
|
14634
|
+
"nextAction",
|
|
14635
|
+
"nextActionAt"
|
|
14632
14636
|
]
|
|
14633
14637
|
}
|
|
14634
14638
|
],
|
|
@@ -14771,7 +14775,7 @@ var DATA = {
|
|
|
14771
14775
|
{
|
|
14772
14776
|
"name": "CRM Hygiene",
|
|
14773
14777
|
"description": "Always-on maintenance \u2014 enriches stale contacts/companies and flags stalled deals. Every change is proposed for your review, never auto-applied.",
|
|
14774
|
-
"goalTemplate": "You are the CRM hygiene maintenance agent, running unattended on a daily schedule. Keep the pipeline healthy in two passes, and remember: EVERY change you make is a proposal for the user to review, so be precise and never fabricate.\nPass 1 \u2014 Enrich stale records. Find `person` and `company` records that are missing key fields (e.g. industry, companySize, location, jobTitle, email, website) or whose `lastContactDate` is old. For each, fill in what you can verify from existing pod data and public sources (use the enrichment tools you are granted); leave a field blank rather than guess. Do not touch records that are already complete and current.\nPass 2 \u2014 Flag stalled deals. Find `deal` records with no activity for a while or stuck in the same `commercialStage` past the stage's stuck threshold (14 days in Meeting booked, Proposal sent or negotiating). For each stalled deal, propose a concise `
|
|
14778
|
+
"goalTemplate": "You are the CRM hygiene maintenance agent, running unattended on a daily schedule. Keep the pipeline healthy in two passes, and remember: EVERY change you make is a proposal for the user to review, so be precise and never fabricate.\nPass 1 \u2014 Enrich stale records. Find `person` and `company` records that are missing key fields (e.g. industry, companySize, location, jobTitle, email, website) or whose `lastContactDate` is old. For each, fill in what you can verify from existing pod data and public sources (use the enrichment tools you are granted); leave a field blank rather than guess. Do not touch records that are already complete and current.\nPass 2 \u2014 Flag stalled deals. Find `deal` records with no activity for a while or stuck in the same `commercialStage` past the stage's stuck threshold (14 days in Meeting booked, Proposal sent or negotiating). For each stalled deal, propose a concise `nextAction` (and its `nextActionAt`) to unblock it and note why it looks stalled. Do not advance a deal's stage on its behalf \u2014 surface the risk and a recommended action for the human to decide.\nSkip anything already healthy. If nothing needs attention, do nothing.",
|
|
14775
14779
|
"schedule": {
|
|
14776
14780
|
"cron": "0 8 * * *",
|
|
14777
14781
|
"enabled": true
|
|
@@ -15204,7 +15208,7 @@ var DATA = {
|
|
|
15204
15208
|
{
|
|
15205
15209
|
"name": "Draft a first message",
|
|
15206
15210
|
"description": "Draft one personal first message for a lead, citing its buying signal or a past exchange, in the person's language, as a proposed message in their channel for a person to approve; the agent never sends.",
|
|
15207
|
-
"goalTemplate": `Draft the first message to the lead {lead} on {channel}. READ: the lead's score fields (icpScore, buyingSignal, buyingSignalSource, qualificationNotes) as they are, never rescoring them; its channels, past messages and notes in the pod; and the outreach campaign given ({campaign}), if any: its value proposition and call to action are the angle. WHO: a person lead is written to directly; for a company lead, write to the person who decides there (from the pod, else its public decider), and when no decider is known ask the person who to write to. DRAFT: one first message on channel {channel}, in the campaign's angle when one is given. DRAFT RULES: each draft is one proposed message in the channel of the person it is written to, filed through the pod's send door: run messaging.send with to = that person's entity id (for a company lead, its decider: when that person is not in the pod, create them through the entity door with only their own fields, such as name, role and LinkedIn URL, never the company's website, domain or email), text = the message, and provider linkedin or email. Read their channel first (synap_get_channel, mode person) for what was already said. The pod files it for a person to review in that channel; it goes out only once they approve it. Never call a tool's own send verb (Unipile, Gmail), never create an outreach touch, a note or a task holding the message, and never use synap_capture for it. Never send. A LinkedIn message is drafted whatever their reach: the pod holds a draft to someone who is not a connection yet, shows it with the next step and lets it go out once they connect, so never hold a draft back for want of a connection. Draft it, then, in this order: (1) a person with no linkedinUrl: find their profile with linkedin_find_profile (their full name and company); on a match, propose its linkedinUrl and linkedinProviderId on the person for a person to approve; on none or several, ask the person to choose among its candidates (the process "Find their LinkedIn" does this for one lead). (2) Read their linkedinConnection, which only the pod writes (never set it or linkedinInvitedAt): connected, nothing more; none or not set, ask to connect with linkedin_send_invite (it refuses someone already connected or already invited: then nothing more); pending, the draft waits for them; ignored, draft by email instead when they have an email address. While the draft waits for them to connect, set the lead's nextAction to "Wait for <name> to accept the LinkedIn request" and its nextActionAt 7 days later. An email message needs none of this. RULES: follow the rules this process follows, in order: Voice, then By kind of lead (the first row that fits the lead; a given campaign's angle comes first). A rule shown as not available is left out: say so. Draft one message only: a person reviews it in the channel, edits it if needed and approves it. NEXT ACTION: set the lead's nextAction to "Send the first message to <name> on LinkedIn" ("Send the first message to <name> by email" on email), naming the person written to, and its nextActionAt to today. Never move the lead's stage while drafting. SENT: once the message is sent, follow the cadence, so "Follow up on leads in outreach" drafts the next one. CADENCE: when a message is sent (a person approved its proposed message, so it is an outbound message in the channel), set its lead's lastContactedAt to the sent day, count the messages sent to the lead (the outbound messages in its channels, read with synap_get_channel mode person: for a company lead, the channels of the person written to there), and set the lead's next action: after the first message, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days; after the first follow-up, nextAction "Follow up with <name> a last time if no reply" and nextActionAt the sent day + 7 days; after the second follow-up, nextAction "No reply after two follow-ups: nurture or drop <name>" and nextActionAt the sent day + 7 days, and when that date passes with no reply, "Follow up on leads in outreach" proposes nurturing. Never a third follow-up. Propose moving a lead at
|
|
15211
|
+
"goalTemplate": `Draft the first message to the lead {lead} on {channel}. READ: the lead's score fields (icpScore, buyingSignal, buyingSignalSource, qualificationNotes) as they are, never rescoring them; its channels, past messages and notes in the pod; and the outreach campaign given ({campaign}), if any: its value proposition and call to action are the angle. WHO: a person lead is written to directly; for a company lead, write to the person who decides there (from the pod, else its public decider), and when no decider is known ask the person who to write to. DRAFT: one first message on channel {channel}, in the campaign's angle when one is given. DRAFT RULES: each draft is one proposed message in the channel of the person it is written to, filed through the pod's send door: run messaging.send with to = that person's entity id (for a company lead, its decider: when that person is not in the pod, create them through the entity door with only their own fields, such as name, role and LinkedIn URL, never the company's website, domain or email), text = the message, and provider linkedin or email. Read their channel first (synap_get_channel, mode person) for what was already said. The pod files it for a person to review in that channel; it goes out only once they approve it. Never call a tool's own send verb (Unipile, Gmail), never create an outreach touch, a note or a task holding the message, and never use synap_capture for it. Never send. A LinkedIn message is drafted whatever their reach: the pod holds a draft to someone who is not a connection yet, shows it with the next step and lets it go out once they connect, so never hold a draft back for want of a connection. Draft it, then, in this order: (1) a person with no linkedinUrl: find their profile with linkedin_find_profile (their full name and company); on a match, propose its linkedinUrl and linkedinProviderId on the person for a person to approve; on none or several, ask the person to choose among its candidates (the process "Find their LinkedIn" does this for one lead). (2) Read their linkedinConnection, which only the pod writes (never set it or linkedinInvitedAt): connected, nothing more; none or not set, ask to connect with linkedin_send_invite (it refuses someone already connected or already invited: then nothing more); pending, the draft waits for them; ignored, draft by email instead when they have an email address. While the draft waits for them to connect, set the lead's nextAction to "Wait for <name> to accept the LinkedIn request" and its nextActionAt 7 days later. An email message needs none of this. RULES: follow the rules this process follows, in order: Voice, then By kind of lead (the first row that fits the lead; a given campaign's angle comes first). A rule shown as not available is left out: say so. Draft one message only: a person reviews it in the channel, edits it if needed and approves it. NEXT ACTION: set the lead's nextAction to "Send the first message to <name> on LinkedIn" ("Send the first message to <name> by email" on email), naming the person written to, and its nextActionAt to today. Never move the lead's stage while drafting. SENT: once the message is sent, follow the cadence, so "Follow up on leads in outreach" drafts the next one. CADENCE: when a message is sent (a person approved its proposed message, so it is an outbound message in the channel), set its lead's lastContactedAt to the sent day, count the messages sent to the lead (the outbound messages in its channels, read with synap_get_channel mode person: for a company lead, the channels of the person written to there), and set the lead's next action: after the first message, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days; after the first follow-up, nextAction "Follow up with <name> a last time if no reply" and nextActionAt the sent day + 7 days; after the second follow-up, nextAction "No reply after two follow-ups: nurture or drop <name>" and nextActionAt the sent day + 7 days, and when that date passes with no reply, "Follow up on leads in outreach" proposes nurturing. Never a third follow-up. Propose moving a lead at qualified to outreach through the status door, with its expected status. A reply stops the cadence: a reply is an inbound message after our last outbound one in the channel, and "Follow up on leads in outreach" reads it and proposes the next step.`,
|
|
15208
15212
|
"subjectProfile": {
|
|
15209
15213
|
"profileSlug": "lead"
|
|
15210
15214
|
},
|
|
@@ -15313,7 +15317,7 @@ var DATA = {
|
|
|
15313
15317
|
"key": "send",
|
|
15314
15318
|
"name": "Person sends",
|
|
15315
15319
|
"category": "completed",
|
|
15316
|
-
"goal": `The person reviews the proposed message in the channel, edits it if needed and approves it, and the pod sends it; then set the lead's lastContactedAt to the sent day, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days, and propose moving a
|
|
15320
|
+
"goal": `The person reviews the proposed message in the channel, edits it if needed and approves it, and the pod sends it; then set the lead's lastContactedAt to the sent day, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days, and propose moving a qualified lead to outreach.`,
|
|
15317
15321
|
"gate": {
|
|
15318
15322
|
"kind": "human"
|
|
15319
15323
|
},
|
|
@@ -15515,7 +15519,7 @@ var DATA = {
|
|
|
15515
15519
|
{
|
|
15516
15520
|
"name": "Follow up on leads in outreach",
|
|
15517
15521
|
"description": "Each weekday, read the channels of the leads in outreach; summarise a reply and propose the next step, or, when the follow-up is due with no reply, draft the next message in the angle of its outreach campaign as a proposed message for a person to approve; the agent never sends.",
|
|
15518
|
-
"goalTemplate": `Follow up on the leads in outreach. For each, read its channels (synap_get_channel, mode person: for a company lead, the channels of the person who decides there) and its notes. A REPLY is an inbound message after our last outbound one in a channel. With a reply, draft nothing: summarise it for a person; when they show interest, propose the next step (prepare the free estimate, "Prepare a pre-sale estimate", or book a meeting) and propose moving the lead to engaged; when they decline, propose nurturing or disqualified with their reason (in disqualificationReason). Unless you propose dropping them, write the next step on the lead as nextAction, one imperative line, and nextActionAt, the date they named or today. Never open a deal and never answer the reply yourself; a person does. With no reply, and only when the lead's next action date is today or past and no proposed message to it is still waiting, draft the next message, to the lead (for a company, the person who decides there) and in the angle of the lead's outreach campaign: follow its value proposition and call to action. With no campaign and no By kind of lead row that fits, ask the person which campaign. Draft at most two follow-ups per lead: a lead already sent two follow-ups gets no draft, never a third follow-up; when its last date passes in silence, propose moving it to nurturing through the status door, with its expected status. DRAFT RULES: each draft is one proposed message in the channel of the person it is written to, filed through the pod's send door: run messaging.send with to = that person's entity id (for a company lead, its decider: when that person is not in the pod, create them through the entity door with only their own fields, such as name, role and LinkedIn URL, never the company's website, domain or email), text = the message, and provider linkedin or email. Read their channel first (synap_get_channel, mode person) for what was already said. The pod files it for a person to review in that channel; it goes out only once they approve it. Never call a tool's own send verb (Unipile, Gmail), never create an outreach touch, a note or a task holding the message, and never use synap_capture for it. Never send. A LinkedIn message is drafted whatever their reach: the pod holds a draft to someone who is not a connection yet, shows it with the next step and lets it go out once they connect, so never hold a draft back for want of a connection. Draft it, then, in this order: (1) a person with no linkedinUrl: find their profile with linkedin_find_profile (their full name and company); on a match, propose its linkedinUrl and linkedinProviderId on the person for a person to approve; on none or several, ask the person to choose among its candidates (the process "Find their LinkedIn" does this for one lead). (2) Read their linkedinConnection, which only the pod writes (never set it or linkedinInvitedAt): connected, nothing more; none or not set, ask to connect with linkedin_send_invite (it refuses someone already connected or already invited: then nothing more); pending, the draft waits for them; ignored, draft by email instead when they have an email address. While the draft waits for them to connect, set the lead's nextAction to "Wait for <name> to accept the LinkedIn request" and its nextActionAt 7 days later. An email message needs none of this. RULES: follow the rules this process follows, in order: Voice, then By kind of lead (the first row that fits the lead; a given campaign's angle comes first). A rule shown as not available is left out: say so. For each draft, set the lead's \`nextAction\` to send it (e.g. "Send the drafted message to Ana on LinkedIn") and \`nextActionAt\` to today. The person reviews each proposed message in its channel, edits it if needed and approves it; the agent never sends. CADENCE: when a message is sent (a person approved its proposed message, so it is an outbound message in the channel), set its lead's lastContactedAt to the sent day, count the messages sent to the lead (the outbound messages in its channels, read with synap_get_channel mode person: for a company lead, the channels of the person written to there), and set the lead's next action: after the first message, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days; after the first follow-up, nextAction "Follow up with <name> a last time if no reply" and nextActionAt the sent day + 7 days; after the second follow-up, nextAction "No reply after two follow-ups: nurture or drop <name>" and nextActionAt the sent day + 7 days, and when that date passes with no reply, "Follow up on leads in outreach" proposes nurturing. Never a third follow-up. Propose moving a lead at
|
|
15522
|
+
"goalTemplate": `Follow up on the leads in outreach. For each, read its channels (synap_get_channel, mode person: for a company lead, the channels of the person who decides there) and its notes. A REPLY is an inbound message after our last outbound one in a channel. With a reply, draft nothing: summarise it for a person; when they show interest, propose the next step (prepare the free estimate, "Prepare a pre-sale estimate", or book a meeting) and propose moving the lead to engaged; when they decline, propose nurturing or disqualified with their reason (in disqualificationReason). Unless you propose dropping them, write the next step on the lead as nextAction, one imperative line, and nextActionAt, the date they named or today. Never open a deal and never answer the reply yourself; a person does. With no reply, and only when the lead's next action date is today or past and no proposed message to it is still waiting, draft the next message, to the lead (for a company, the person who decides there) and in the angle of the lead's outreach campaign: follow its value proposition and call to action. With no campaign and no By kind of lead row that fits, ask the person which campaign. Draft at most two follow-ups per lead: a lead already sent two follow-ups gets no draft, never a third follow-up; when its last date passes in silence, propose moving it to nurturing through the status door, with its expected status. DRAFT RULES: each draft is one proposed message in the channel of the person it is written to, filed through the pod's send door: run messaging.send with to = that person's entity id (for a company lead, its decider: when that person is not in the pod, create them through the entity door with only their own fields, such as name, role and LinkedIn URL, never the company's website, domain or email), text = the message, and provider linkedin or email. Read their channel first (synap_get_channel, mode person) for what was already said. The pod files it for a person to review in that channel; it goes out only once they approve it. Never call a tool's own send verb (Unipile, Gmail), never create an outreach touch, a note or a task holding the message, and never use synap_capture for it. Never send. A LinkedIn message is drafted whatever their reach: the pod holds a draft to someone who is not a connection yet, shows it with the next step and lets it go out once they connect, so never hold a draft back for want of a connection. Draft it, then, in this order: (1) a person with no linkedinUrl: find their profile with linkedin_find_profile (their full name and company); on a match, propose its linkedinUrl and linkedinProviderId on the person for a person to approve; on none or several, ask the person to choose among its candidates (the process "Find their LinkedIn" does this for one lead). (2) Read their linkedinConnection, which only the pod writes (never set it or linkedinInvitedAt): connected, nothing more; none or not set, ask to connect with linkedin_send_invite (it refuses someone already connected or already invited: then nothing more); pending, the draft waits for them; ignored, draft by email instead when they have an email address. While the draft waits for them to connect, set the lead's nextAction to "Wait for <name> to accept the LinkedIn request" and its nextActionAt 7 days later. An email message needs none of this. RULES: follow the rules this process follows, in order: Voice, then By kind of lead (the first row that fits the lead; a given campaign's angle comes first). A rule shown as not available is left out: say so. For each draft, set the lead's \`nextAction\` to send it (e.g. "Send the drafted message to Ana on LinkedIn") and \`nextActionAt\` to today. The person reviews each proposed message in its channel, edits it if needed and approves it; the agent never sends. CADENCE: when a message is sent (a person approved its proposed message, so it is an outbound message in the channel), set its lead's lastContactedAt to the sent day, count the messages sent to the lead (the outbound messages in its channels, read with synap_get_channel mode person: for a company lead, the channels of the person written to there), and set the lead's next action: after the first message, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days; after the first follow-up, nextAction "Follow up with <name> a last time if no reply" and nextActionAt the sent day + 7 days; after the second follow-up, nextAction "No reply after two follow-ups: nurture or drop <name>" and nextActionAt the sent day + 7 days, and when that date passes with no reply, "Follow up on leads in outreach" proposes nurturing. Never a third follow-up. Propose moving a lead at qualified to outreach through the status door, with its expected status. A reply stops the cadence: a reply is an inbound message after our last outbound one in the channel, and "Follow up on leads in outreach" reads it and proposes the next step.`,
|
|
15519
15523
|
"subjectProfile": {
|
|
15520
15524
|
"profileSlug": "lead"
|
|
15521
15525
|
},
|
|
@@ -15617,7 +15621,7 @@ var DATA = {
|
|
|
15617
15621
|
{
|
|
15618
15622
|
"name": "Personalized Outreach",
|
|
15619
15623
|
"description": "Run one outreach campaign \u2014 write the angle and its offer, pick the people, draft one personal first message each as a proposed message in their channel; a person approves the list, then approves each message, which the pod sends.",
|
|
15620
|
-
"goalTemplate": `Run this outreach campaign ({campaign}) on {channel}; each stage moves its status. If its type is not outreach, stop and say so. PREPARE: write the target audience, the value proposition and the call to action (from the By kind of lead row that fits the audience, when one does). Pick the people to reach from the pod (and public sources when the pod has too few), resolving each one before creating anything, link each as a member of the campaign with the lead role (lead source cold-outreach when it has none), and for each draft one first message to that person in this campaign's angle. DRAFT RULES: each draft is one proposed message in the channel of the person it is written to, filed through the pod's send door: run messaging.send with to = that person's entity id (for a company lead, its decider: when that person is not in the pod, create them through the entity door with only their own fields, such as name, role and LinkedIn URL, never the company's website, domain or email), text = the message, and provider linkedin or email. Read their channel first (synap_get_channel, mode person) for what was already said. The pod files it for a person to review in that channel; it goes out only once they approve it. Never call a tool's own send verb (Unipile, Gmail), never create an outreach touch, a note or a task holding the message, and never use synap_capture for it. Never send. A LinkedIn message is drafted whatever their reach: the pod holds a draft to someone who is not a connection yet, shows it with the next step and lets it go out once they connect, so never hold a draft back for want of a connection. Draft it, then, in this order: (1) a person with no linkedinUrl: find their profile with linkedin_find_profile (their full name and company); on a match, propose its linkedinUrl and linkedinProviderId on the person for a person to approve; on none or several, ask the person to choose among its candidates (the process "Find their LinkedIn" does this for one lead). (2) Read their linkedinConnection, which only the pod writes (never set it or linkedinInvitedAt): connected, nothing more; none or not set, ask to connect with linkedin_send_invite (it refuses someone already connected or already invited: then nothing more); pending, the draft waits for them; ignored, draft by email instead when they have an email address. While the draft waits for them to connect, set the lead's nextAction to "Wait for <name> to accept the LinkedIn request" and its nextActionAt 7 days later. An email message needs none of this. RULES: follow the rules this process follows, in order: Voice, then By kind of lead (the first row that fits the lead; a given campaign's angle comes first). A rule shown as not available is left out: say so. START: a person approves the audience, the offer and the list, then reviews each proposed message in its channel and approves it; nothing goes out before they approve it, and the agent never sends. Once a message is sent, follow the cadence, so "Follow up on leads in outreach" drafts the next one. CADENCE: when a message is sent (a person approved its proposed message, so it is an outbound message in the channel), set its lead's lastContactedAt to the sent day, count the messages sent to the lead (the outbound messages in its channels, read with synap_get_channel mode person: for a company lead, the channels of the person written to there), and set the lead's next action: after the first message, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days; after the first follow-up, nextAction "Follow up with <name> a last time if no reply" and nextActionAt the sent day + 7 days; after the second follow-up, nextAction "No reply after two follow-ups: nurture or drop <name>" and nextActionAt the sent day + 7 days, and when that date passes with no reply, "Follow up on leads in outreach" proposes nurturing. Never a third follow-up. Propose moving a lead at
|
|
15624
|
+
"goalTemplate": `Run this outreach campaign ({campaign}) on {channel}; each stage moves its status. If its type is not outreach, stop and say so. PREPARE: write the target audience, the value proposition and the call to action (from the By kind of lead row that fits the audience, when one does). Pick the people to reach from the pod (and public sources when the pod has too few), resolving each one before creating anything, link each as a member of the campaign with the lead role (lead source cold-outreach when it has none), and for each draft one first message to that person in this campaign's angle. DRAFT RULES: each draft is one proposed message in the channel of the person it is written to, filed through the pod's send door: run messaging.send with to = that person's entity id (for a company lead, its decider: when that person is not in the pod, create them through the entity door with only their own fields, such as name, role and LinkedIn URL, never the company's website, domain or email), text = the message, and provider linkedin or email. Read their channel first (synap_get_channel, mode person) for what was already said. The pod files it for a person to review in that channel; it goes out only once they approve it. Never call a tool's own send verb (Unipile, Gmail), never create an outreach touch, a note or a task holding the message, and never use synap_capture for it. Never send. A LinkedIn message is drafted whatever their reach: the pod holds a draft to someone who is not a connection yet, shows it with the next step and lets it go out once they connect, so never hold a draft back for want of a connection. Draft it, then, in this order: (1) a person with no linkedinUrl: find their profile with linkedin_find_profile (their full name and company); on a match, propose its linkedinUrl and linkedinProviderId on the person for a person to approve; on none or several, ask the person to choose among its candidates (the process "Find their LinkedIn" does this for one lead). (2) Read their linkedinConnection, which only the pod writes (never set it or linkedinInvitedAt): connected, nothing more; none or not set, ask to connect with linkedin_send_invite (it refuses someone already connected or already invited: then nothing more); pending, the draft waits for them; ignored, draft by email instead when they have an email address. While the draft waits for them to connect, set the lead's nextAction to "Wait for <name> to accept the LinkedIn request" and its nextActionAt 7 days later. An email message needs none of this. RULES: follow the rules this process follows, in order: Voice, then By kind of lead (the first row that fits the lead; a given campaign's angle comes first). A rule shown as not available is left out: say so. START: a person approves the audience, the offer and the list, then reviews each proposed message in its channel and approves it; nothing goes out before they approve it, and the agent never sends. Once a message is sent, follow the cadence, so "Follow up on leads in outreach" drafts the next one. CADENCE: when a message is sent (a person approved its proposed message, so it is an outbound message in the channel), set its lead's lastContactedAt to the sent day, count the messages sent to the lead (the outbound messages in its channels, read with synap_get_channel mode person: for a company lead, the channels of the person written to there), and set the lead's next action: after the first message, nextAction "Follow up with <name> if no reply" and nextActionAt the sent day + 3 days; after the first follow-up, nextAction "Follow up with <name> a last time if no reply" and nextActionAt the sent day + 7 days; after the second follow-up, nextAction "No reply after two follow-ups: nurture or drop <name>" and nextActionAt the sent day + 7 days, and when that date passes with no reply, "Follow up on leads in outreach" proposes nurturing. Never a third follow-up. Propose moving a lead at qualified to outreach through the status door, with its expected status. A reply stops the cadence: a reply is an inbound message after our last outbound one in the channel, and "Follow up on leads in outreach" reads it and proposes the next step. FINISH: when every person written to has replied or their follow-ups ended in silence, record in the campaign notes how many messages were sent (the outbound messages in their channels), how many got a reply and how many led to a booked meeting. Pausing or cancelling is a person's call.`,
|
|
15621
15625
|
"subjectProfile": {
|
|
15622
15626
|
"profileSlug": "campaign"
|
|
15623
15627
|
},
|
|
@@ -15989,7 +15993,7 @@ var DATA = {
|
|
|
15989
15993
|
{
|
|
15990
15994
|
"name": "Propose a Health cell",
|
|
15991
15995
|
"description": "Answer one question about your sales with a tile on the Health dashboard; the AI writes the tile and you approve it before it shows. Run by one of your agents for now (Synap AI cannot place a tile yet).",
|
|
15992
|
-
"goalTemplate": `Propose one Health tile that answers: {question}. FIND THE VIEW: in the CRM space, the bento view named Health (synap_list_views with the space's workspaceId, type bento). When the space has none, stop and say so: never create another dashboard. READ FIRST: what already sits on Health (its config.blocks: each widget tile names a cell by widgetType) and the space's cells (synap_list_widgets); when a tile already answers the question, say which one and stop. DATA: decide where each number comes from. A cell reads the pod ONLY through the cell bridge, at render time: window.synap.query(op, params), with an op of the bridge table (entities.list, entities.get, views.list, profiles.list, lifecycle.board, lifecycle.throughput, attention.needsYou, attention.count, sessions.list, lifecycle.home, lifecycle.moving, documents.get, lens.page) and only that op's params; the host stamps the space, so never put a workspaceId, a token, a pod URL or a fetch in the page. What the bridge reads stays live: query it in the page, never paste its rows. What it cannot read yet (messages, replies, sends: the bridge has no message op) you read now with your own tools (synap_get_channel, synap_get_entities) and write into the page as a snapshot, with the date it was taken shown on the tile (for example "au 8 novembre") and how it was counted. Never invent a number: a figure you cannot source is left out and the tile says what is missing. THE PAGE: one self-contained HTML page, inline script and style only (no CDN, no remote font or image: the frame's CSP refuses them), that answers the question in one glance (a number, a short table or a small chart), in the person's language (French by default), readable in light and dark, and that shows an error, never an empty tile, when a query fails. FILE IT: synap_create_cell with name = a short title of the question, rendererSource = the page, workspaceId = the CRM space (never pod-wide: the CRM app reads only its space's cells), contentKind widget, placeOn = {viewId: the Health view's id}, and reasoning = the question in the person's words. It comes back proposed: that is success, never retry it; the person approves it in the CRM or the pod, which defines the cell and puts its tile on Health in one act. One cell per run.`,
|
|
15996
|
+
"goalTemplate": `Propose one Health tile that answers: {question}. FIND THE VIEW: in the CRM space, the bento view named Health (synap_list_views with the space's workspaceId, type bento). When the space has none, stop and say so: never create another dashboard. READ FIRST: what already sits on Health (its config.blocks: each widget tile names a cell by widgetType) and the space's cells (synap_list_widgets); when a tile already answers the question, say which one and stop. DATA: decide where each number comes from. A cell reads the pod ONLY through the cell bridge, at render time: window.synap.query(op, params), with an op of the bridge table (entities.list, entities.get, views.list, profiles.list, lifecycle.board, flow.of, lifecycle.throughput, attention.needsYou, attention.count, sessions.list, lifecycle.home, lifecycle.moving, documents.get, lens.page) and only that op's params; the host stamps the space, so never put a workspaceId, a token, a pod URL or a fetch in the page. What the bridge reads stays live: query it in the page, never paste its rows. What it cannot read yet (messages, replies, sends: the bridge has no message op) you read now with your own tools (synap_get_channel, synap_get_entities) and write into the page as a snapshot, with the date it was taken shown on the tile (for example "au 8 novembre") and how it was counted. Never invent a number: a figure you cannot source is left out and the tile says what is missing. THE PAGE: one self-contained HTML page, inline script and style only (no CDN, no remote font or image: the frame's CSP refuses them), that answers the question in one glance (a number, a short table or a small chart), in the person's language (French by default), readable in light and dark, and that shows an error, never an empty tile, when a query fails. FILE IT: synap_create_cell with name = a short title of the question, rendererSource = the page, workspaceId = the CRM space (never pod-wide: the CRM app reads only its space's cells), contentKind widget, placeOn = {viewId: the Health view's id}, and reasoning = the question in the person's words. It comes back proposed: that is success, never retry it; the person approves it in the CRM or the pod, which defines the cell and puts its tile on Health in one act. One cell per run.`,
|
|
15993
15997
|
"params": [
|
|
15994
15998
|
{
|
|
15995
15999
|
"name": "question",
|
|
@@ -18769,7 +18773,7 @@ var DATA = {
|
|
|
18769
18773
|
"displayName": "Lead",
|
|
18770
18774
|
"icon": "user-plus",
|
|
18771
18775
|
"color": "yellow",
|
|
18772
|
-
"description": "An early-pipeline prospect \u2014 not yet a client, being qualified or nurtured.",
|
|
18776
|
+
"description": "An early-pipeline prospect \u2014 not yet a client, being qualified or nurtured. The lead role is a qualification decision a person makes, never a label an import applies: importing a contacts file creates people and companies, not leads. Prefer a lead on the company, with the founder as the contact; a person lead is allowed when no company is known.",
|
|
18773
18777
|
"scope": "shared",
|
|
18774
18778
|
"profileKind": "role",
|
|
18775
18779
|
"applicableKinds": [
|
|
@@ -18781,27 +18785,121 @@ var DATA = {
|
|
|
18781
18785
|
"options": [
|
|
18782
18786
|
{
|
|
18783
18787
|
"key": "new",
|
|
18784
|
-
"category": "open"
|
|
18788
|
+
"category": "open",
|
|
18789
|
+
"requires": [
|
|
18790
|
+
{
|
|
18791
|
+
"kind": "property",
|
|
18792
|
+
"blockerKey": "no_next_step",
|
|
18793
|
+
"label": "A next step with a date",
|
|
18794
|
+
"property": "nextActionAt",
|
|
18795
|
+
"owner": "you"
|
|
18796
|
+
}
|
|
18797
|
+
]
|
|
18785
18798
|
},
|
|
18786
18799
|
{
|
|
18787
18800
|
"key": "researching",
|
|
18788
|
-
"category": "open"
|
|
18801
|
+
"category": "open",
|
|
18802
|
+
"requires": [
|
|
18803
|
+
{
|
|
18804
|
+
"kind": "property",
|
|
18805
|
+
"blockerKey": "no_next_step",
|
|
18806
|
+
"label": "A next step with a date",
|
|
18807
|
+
"property": "nextActionAt",
|
|
18808
|
+
"owner": "you"
|
|
18809
|
+
},
|
|
18810
|
+
{
|
|
18811
|
+
"kind": "link",
|
|
18812
|
+
"blockerKey": "no_company",
|
|
18813
|
+
"label": "Their company",
|
|
18814
|
+
"relation": "works_at",
|
|
18815
|
+
"direction": "out",
|
|
18816
|
+
"owner": "agent",
|
|
18817
|
+
"forKinds": [
|
|
18818
|
+
"person"
|
|
18819
|
+
]
|
|
18820
|
+
}
|
|
18821
|
+
]
|
|
18789
18822
|
},
|
|
18790
18823
|
{
|
|
18791
|
-
"key": "
|
|
18792
|
-
"category": "
|
|
18824
|
+
"key": "qualified",
|
|
18825
|
+
"category": "active",
|
|
18826
|
+
"requires": [
|
|
18827
|
+
{
|
|
18828
|
+
"kind": "property",
|
|
18829
|
+
"blockerKey": "no_next_step",
|
|
18830
|
+
"label": "A next step with a date",
|
|
18831
|
+
"property": "nextActionAt",
|
|
18832
|
+
"owner": "you"
|
|
18833
|
+
}
|
|
18834
|
+
]
|
|
18793
18835
|
},
|
|
18794
18836
|
{
|
|
18795
|
-
"key": "
|
|
18796
|
-
"category": "
|
|
18837
|
+
"key": "outreach",
|
|
18838
|
+
"category": "open",
|
|
18839
|
+
"dateBinding": "nextActionAt",
|
|
18840
|
+
"waits": {
|
|
18841
|
+
"on": "person",
|
|
18842
|
+
"waitKind": "their_reply",
|
|
18843
|
+
"dateBinding": "nextActionAt"
|
|
18844
|
+
},
|
|
18845
|
+
"requires": [
|
|
18846
|
+
{
|
|
18847
|
+
"kind": "link",
|
|
18848
|
+
"blockerKey": "no_contact",
|
|
18849
|
+
"label": "A contact at the company",
|
|
18850
|
+
"relation": "works_at",
|
|
18851
|
+
"direction": "in",
|
|
18852
|
+
"forKinds": [
|
|
18853
|
+
"company"
|
|
18854
|
+
]
|
|
18855
|
+
},
|
|
18856
|
+
{
|
|
18857
|
+
"kind": "property",
|
|
18858
|
+
"blockerKey": "no_linkedin",
|
|
18859
|
+
"label": "Their LinkedIn profile",
|
|
18860
|
+
"property": "linkedinUrl",
|
|
18861
|
+
"owner": "agent",
|
|
18862
|
+
"clearedBy": {
|
|
18863
|
+
"capability": "linkedin_find_profile"
|
|
18864
|
+
},
|
|
18865
|
+
"forKinds": [
|
|
18866
|
+
"person"
|
|
18867
|
+
]
|
|
18868
|
+
},
|
|
18869
|
+
{
|
|
18870
|
+
"kind": "property",
|
|
18871
|
+
"blockerKey": "no_next_step",
|
|
18872
|
+
"label": "A next step with a date",
|
|
18873
|
+
"property": "nextActionAt",
|
|
18874
|
+
"owner": "you"
|
|
18875
|
+
}
|
|
18876
|
+
]
|
|
18797
18877
|
},
|
|
18798
18878
|
{
|
|
18799
|
-
"key": "
|
|
18800
|
-
"category": "active"
|
|
18879
|
+
"key": "engaged",
|
|
18880
|
+
"category": "active",
|
|
18881
|
+
"requires": [
|
|
18882
|
+
{
|
|
18883
|
+
"kind": "property",
|
|
18884
|
+
"blockerKey": "no_next_step",
|
|
18885
|
+
"label": "A next step with a date",
|
|
18886
|
+
"property": "nextActionAt",
|
|
18887
|
+
"owner": "you"
|
|
18888
|
+
}
|
|
18889
|
+
]
|
|
18801
18890
|
},
|
|
18802
18891
|
{
|
|
18803
18892
|
"key": "nurturing",
|
|
18804
|
-
"category": "active"
|
|
18893
|
+
"category": "active",
|
|
18894
|
+
"requires": [
|
|
18895
|
+
{
|
|
18896
|
+
"kind": "property",
|
|
18897
|
+
"blockerKey": "no_next_step",
|
|
18898
|
+
"label": "A next step with a date",
|
|
18899
|
+
"property": "nextActionAt",
|
|
18900
|
+
"owner": "you"
|
|
18901
|
+
}
|
|
18902
|
+
]
|
|
18805
18903
|
},
|
|
18806
18904
|
{
|
|
18807
18905
|
"key": "converted",
|
|
@@ -18824,9 +18922,9 @@ var DATA = {
|
|
|
18824
18922
|
"enumValues": [
|
|
18825
18923
|
"new",
|
|
18826
18924
|
"researching",
|
|
18925
|
+
"qualified",
|
|
18827
18926
|
"outreach",
|
|
18828
18927
|
"engaged",
|
|
18829
|
-
"qualified",
|
|
18830
18928
|
"nurturing",
|
|
18831
18929
|
"converted",
|
|
18832
18930
|
"disqualified"
|
|
@@ -18835,6 +18933,12 @@ var DATA = {
|
|
|
18835
18933
|
"defaultValue": "new"
|
|
18836
18934
|
}
|
|
18837
18935
|
},
|
|
18936
|
+
{
|
|
18937
|
+
"slug": "nextActionAt",
|
|
18938
|
+
"label": "Next action at",
|
|
18939
|
+
"valueType": "date",
|
|
18940
|
+
"inputType": "date"
|
|
18941
|
+
},
|
|
18838
18942
|
{
|
|
18839
18943
|
"slug": "notes",
|
|
18840
18944
|
"label": "Notes",
|
|
@@ -35799,7 +35903,8 @@ var LIFECYCLE_OPTION_FIELDS = [
|
|
|
35799
35903
|
"humanOnly",
|
|
35800
35904
|
"stuckAfterDays",
|
|
35801
35905
|
"dateBinding",
|
|
35802
|
-
"waits"
|
|
35906
|
+
"waits",
|
|
35907
|
+
"requires"
|
|
35803
35908
|
];
|
|
35804
35909
|
var LIFECYCLE_OPTION_WAITS_FIELDS = ["on", "waitKind", "refFrom", "dateBinding"];
|
|
35805
35910
|
var LIFECYCLE_WAITS_ON = ["person", "agent", "external", "thing", "decision", "date", "nobody"];
|
|
@@ -35873,6 +35978,66 @@ function lifecycleOptionWaitsProblems(option2) {
|
|
|
35873
35978
|
if (unknown.length > 0) return fail(`option "${key}" waits has unknown field(s): ${unknown.join(", ")}`);
|
|
35874
35979
|
return out;
|
|
35875
35980
|
}
|
|
35981
|
+
var LIFECYCLE_REQUIREMENT_OWNERS = ["you", "agent"];
|
|
35982
|
+
var LIFECYCLE_REQUIREMENT_DIRECTIONS = ["out", "in"];
|
|
35983
|
+
var REQUIREMENTS_PER_OPTION_MAX = 10;
|
|
35984
|
+
var BLOCKER_KEY = /^[a-z][a-z0-9_]{0,63}$/;
|
|
35985
|
+
function lifecycleOptionRequiresProblem(option2) {
|
|
35986
|
+
const raw = option2.requires;
|
|
35987
|
+
if (raw === void 0) return null;
|
|
35988
|
+
const key = String(option2.key);
|
|
35989
|
+
const at = (i) => `option "${key}" requires[${i}]`;
|
|
35990
|
+
if (!Array.isArray(raw)) return `option "${key}" requires must be a list of { kind: "link" | "property", blockerKey, ... }`;
|
|
35991
|
+
if (raw.length > 0 && (option2.category === "done" || option2.category === "lost"))
|
|
35992
|
+
return `option "${key}" is ${String(option2.category)}: a finished thing requires nothing (requires is for open, active or paused options)`;
|
|
35993
|
+
if (raw.length > REQUIREMENTS_PER_OPTION_MAX) return `option "${key}" requires at most ${REQUIREMENTS_PER_OPTION_MAX} things`;
|
|
35994
|
+
const seen = /* @__PURE__ */ new Set();
|
|
35995
|
+
for (const [i, item] of raw.entries()) {
|
|
35996
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return `${at(i)} must be an object`;
|
|
35997
|
+
const r = item;
|
|
35998
|
+
if (typeof r.blockerKey !== "string" || !BLOCKER_KEY.test(r.blockerKey))
|
|
35999
|
+
return `${at(i)}.blockerKey must be a lowercase name (letters, digits, _), e.g. "no_contact"`;
|
|
36000
|
+
if (seen.has(r.blockerKey)) return `${at(i)}.blockerKey "${r.blockerKey}" is declared twice`;
|
|
36001
|
+
seen.add(r.blockerKey);
|
|
36002
|
+
if (r.label !== void 0 && (typeof r.label !== "string" || !r.label.trim())) return `${at(i)}.label must be words`;
|
|
36003
|
+
if (r.owner !== void 0 && !LIFECYCLE_REQUIREMENT_OWNERS.includes(r.owner))
|
|
36004
|
+
return `${at(i)}.owner must be one of ${LIFECYCLE_REQUIREMENT_OWNERS.join(" | ")}`;
|
|
36005
|
+
if (r.clearedBy !== void 0 && !requirementClearedByOk(r.clearedBy))
|
|
36006
|
+
return `${at(i)}.clearedBy must be one of { answer: true } | { intent } | { playbookId } | { capability }`;
|
|
36007
|
+
if (r.forKinds !== void 0 && (!Array.isArray(r.forKinds) || r.forKinds.length === 0 || !r.forKinds.every((k) => typeof k === "string" && LIFECYCLE_PROPERTY_SLUG.test(k))))
|
|
36008
|
+
return `${at(i)}.forKinds must be a list of kind slugs (e.g. ["person"])`;
|
|
36009
|
+
const common = ["kind", "blockerKey", "label", "owner", "clearedBy", "forKinds"];
|
|
36010
|
+
if (r.kind === "link") {
|
|
36011
|
+
if (typeof r.relation !== "string" || !LIFECYCLE_PROPERTY_SLUG.test(r.relation))
|
|
36012
|
+
return `${at(i)}.relation must name a relation type (its slug, e.g. "works_at")`;
|
|
36013
|
+
if (!LIFECYCLE_REQUIREMENT_DIRECTIONS.includes(r.direction))
|
|
36014
|
+
return `${at(i)}.direction must be "out" (the thing is the link's source) or "in" (its target)`;
|
|
36015
|
+
if (r.min !== void 0 && !(typeof r.min === "number" && Number.isInteger(r.min) && r.min >= 1 && r.min <= 1e3))
|
|
36016
|
+
return `${at(i)}.min must be a whole number from 1 to 1000`;
|
|
36017
|
+
const unknown = Object.keys(r).filter((k) => ![...common, "relation", "direction", "min"].includes(k));
|
|
36018
|
+
if (unknown.length > 0) return `${at(i)} has unknown field(s): ${unknown.join(", ")}`;
|
|
36019
|
+
continue;
|
|
36020
|
+
}
|
|
36021
|
+
if (r.kind === "property") {
|
|
36022
|
+
if (typeof r.property !== "string" || !LIFECYCLE_PROPERTY_SLUG.test(r.property))
|
|
36023
|
+
return `${at(i)}.property must name a property (its slug, e.g. "linkedinUrl")`;
|
|
36024
|
+
if (r.in !== void 0 && !(Array.isArray(r.in) && r.in.length > 0 && r.in.every((v) => typeof v === "string" && v.trim())))
|
|
36025
|
+
return `${at(i)}.in must be a non-empty list of values`;
|
|
36026
|
+
const unknown = Object.keys(r).filter((k) => ![...common, "property", "in"].includes(k));
|
|
36027
|
+
if (unknown.length > 0) return `${at(i)} has unknown field(s): ${unknown.join(", ")}`;
|
|
36028
|
+
continue;
|
|
36029
|
+
}
|
|
36030
|
+
return `${at(i)}.kind must be "link" or "property"`;
|
|
36031
|
+
}
|
|
36032
|
+
return null;
|
|
36033
|
+
}
|
|
36034
|
+
function requirementClearedByOk(raw) {
|
|
36035
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return false;
|
|
36036
|
+
const c = raw;
|
|
36037
|
+
if (Object.keys(c).length !== 1) return false;
|
|
36038
|
+
if (c.answer === true) return true;
|
|
36039
|
+
return ["intent", "playbookId", "capability"].some((k) => typeof c[k] === "string" && c[k].trim() !== "");
|
|
36040
|
+
}
|
|
35876
36041
|
function stableJson(v) {
|
|
35877
36042
|
if (Array.isArray(v)) return `[${v.map(stableJson).join(",")}]`;
|
|
35878
36043
|
if (v && typeof v === "object")
|
|
@@ -35927,6 +36092,8 @@ function checkLifecycleDeclarations(tpl, resolveDep, corpus, add) {
|
|
|
35927
36092
|
}
|
|
35928
36093
|
for (const p of lifecycleOptionWaitsProblems(o ?? {}))
|
|
35929
36094
|
add("lifecycle-option-shape", `${at}.options[${i}].${p.field}`, p.message);
|
|
36095
|
+
const requiresProblem = lifecycleOptionRequiresProblem(o ?? {});
|
|
36096
|
+
if (requiresProblem) add("lifecycle-option-shape", `${at}.options[${i}].requires`, requiresProblem);
|
|
35930
36097
|
});
|
|
35931
36098
|
}
|
|
35932
36099
|
}
|
|
@@ -37233,6 +37400,7 @@ export {
|
|
|
37233
37400
|
isHashVersion,
|
|
37234
37401
|
isKnownDomain,
|
|
37235
37402
|
layerTemplateGraph,
|
|
37403
|
+
lifecycleOptionRequiresProblem,
|
|
37236
37404
|
lifecycleOptionWaitsProblems,
|
|
37237
37405
|
listPublicTemplates,
|
|
37238
37406
|
listWorkspaceTemplates,
|