@synap-core/workspace-templates 0.38.0 → 0.39.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.
@@ -44,6 +44,9 @@ import {
44
44
  LIFECYCLE_OPTION_WAITS_FIELDS,
45
45
  LIFECYCLE_WAIT_KINDS,
46
46
  LIFECYCLE_WAITS_ON,
47
+ LIFECYCLE_REQUIREMENT_DIRECTIONS,
48
+ LIFECYCLE_REQUIREMENT_OWNERS,
49
+ REQUIREMENTS_PER_OPTION_MAX,
47
50
  validateTemplate,
48
51
  } from "./validate.js";
49
52
  import { resolveLifecyclePresets } from "./lifecycle-presets.js";
@@ -128,6 +131,7 @@ describe.skipIf(!hasBackend)("lifecycle waits parity — the field set", () => {
128
131
  stuckAfterDays: 7,
129
132
  dateBinding: "dueDate",
130
133
  waits: { on: "external", waitKind: "payment", refFrom: "clientId", dateBinding: "dueDate" },
134
+ requires: [{ kind: "link", blockerKey: "no_contact", relation: "works_at", direction: "in" }],
131
135
  };
132
136
  const { options, errors } = parse([full]);
133
137
  expect(errors).toEqual([]);
@@ -234,6 +238,93 @@ describe.skipIf(!hasBackend)("lifecycle waits parity — the pod's parser gives
234
238
  });
235
239
  });
236
240
 
241
+
242
+ // ── requires (backend#968): the same rules, the same words ──────────────────
243
+
244
+ const requiresErrors = (t: WorkspaceYaml) =>
245
+ validateTemplate(t).errors.filter((e) => /\.options\[\d+\]\.requires$/.test(e.path));
246
+
247
+ const LINK = { kind: "link", blockerKey: "no_contact", relation: "works_at", direction: "in" };
248
+ const PROP = { kind: "property", blockerKey: "no_linkedin", property: "linkedinUrl" };
249
+ type ReqRow = { name: string; key: string; requires: unknown; ok: boolean };
250
+ const REQ_ROWS: ReqRow[] = [
251
+ { name: "a link requirement", key: "proposed", requires: [LINK], ok: true },
252
+ { name: "a property requirement", key: "draft", requires: [PROP], ok: true },
253
+ { name: "every optional field", key: "negotiating", requires: [{ ...LINK, min: 2, label: "A contact", owner: "agent", forKinds: ["company"], clearedBy: { playbookId: "p" } }, { ...PROP, in: ["a", "b"], clearedBy: { capability: "linkedin_find_profile" } }], ok: true },
254
+ { name: "clearedBy answer", key: "proposed", requires: [{ ...PROP, clearedBy: { answer: true } }], ok: true },
255
+ { name: "clearedBy intent", key: "proposed", requires: [{ ...PROP, clearedBy: { intent: "find_people" } }], ok: true },
256
+ { name: "an empty list on a done step", key: "won", requires: [], ok: true },
257
+ { name: "requires on a done step", key: "won", requires: [LINK], ok: false },
258
+ { name: "requires on a lost step", key: "lost", requires: [PROP], ok: false },
259
+ { name: "requires not a list", key: "proposed", requires: LINK, ok: false },
260
+ { name: "requires null", key: "proposed", requires: null, ok: false },
261
+ { name: "eleven requirements", key: "proposed", requires: Array.from({ length: REQUIREMENTS_PER_OPTION_MAX + 1 }, (_, i) => ({ ...PROP, blockerKey: `k${i}` })), ok: false },
262
+ { name: "an item that is a word", key: "proposed", requires: ["no_contact"], ok: false },
263
+ { name: "blockerKey upper case", key: "proposed", requires: [{ ...LINK, blockerKey: "NoContact" }], ok: false },
264
+ { name: "blockerKey missing", key: "proposed", requires: [{ kind: "link", relation: "works_at", direction: "in" }], ok: false },
265
+ { name: "blockerKey declared twice", key: "proposed", requires: [LINK, { ...PROP, blockerKey: "no_contact" }], ok: false },
266
+ { name: "label blank", key: "proposed", requires: [{ ...LINK, label: " " }], ok: false },
267
+ { name: "owner unknown", key: "proposed", requires: [{ ...LINK, owner: "them" }], ok: false },
268
+ { name: "clearedBy empty", key: "proposed", requires: [{ ...LINK, clearedBy: {} }], ok: false },
269
+ { name: "clearedBy two keys", key: "proposed", requires: [{ ...LINK, clearedBy: { answer: true, intent: "x" } }], ok: false },
270
+ { name: "clearedBy answer false", key: "proposed", requires: [{ ...LINK, clearedBy: { answer: false } }], ok: false },
271
+ { name: "forKinds empty", key: "proposed", requires: [{ ...LINK, forKinds: [] }], ok: false },
272
+ { name: "forKinds with a space", key: "proposed", requires: [{ ...LINK, forKinds: ["a b"] }], ok: false },
273
+ { name: "link without a direction", key: "proposed", requires: [{ kind: "link", blockerKey: "k", relation: "works_at" }], ok: false },
274
+ { name: "link direction sideways", key: "proposed", requires: [{ ...LINK, direction: "both" }], ok: false },
275
+ { name: "link relation with a space", key: "proposed", requires: [{ ...LINK, relation: "works at" }], ok: false },
276
+ { name: "link min 0", key: "proposed", requires: [{ ...LINK, min: 0 }], ok: false },
277
+ { name: "link min 1001", key: "proposed", requires: [{ ...LINK, min: 1001 }], ok: false },
278
+ { name: "link with a property field", key: "proposed", requires: [{ ...LINK, property: "x" }], ok: false },
279
+ { name: "property with a link field", key: "proposed", requires: [{ ...PROP, relation: "works_at" }], ok: false },
280
+ { name: "property with a digit-first slug", key: "proposed", requires: [{ ...PROP, property: "1x" }], ok: false },
281
+ { name: "property in empty", key: "proposed", requires: [{ ...PROP, in: [] }], ok: false },
282
+ { name: "kind unknown", key: "proposed", requires: [{ kind: "count", blockerKey: "k" }], ok: false },
283
+ ];
284
+
285
+ describe("lifecycle requires parity — the vocabulary and the table", () => {
286
+ it("non-vacuity: accepted and refused rows, on every category", () => {
287
+ expect(REQ_ROWS.some((r) => r.ok)).toBe(true);
288
+ expect(REQ_ROWS.some((r) => !r.ok)).toBe(true);
289
+ expect(new Set(REQ_ROWS.map((r) => r.key))).toEqual(new Set(["draft", "proposed", "negotiating", "won", "lost"]));
290
+ });
291
+
292
+ it("the unmodified crm template has no requires errors (a clean base)", () => {
293
+ expect(requiresErrors(structuredClone(crm))).toEqual([]);
294
+ });
295
+
296
+ it.each(REQ_ROWS)("the validator: $name → ok=$ok", ({ key, requires, ok }) => {
297
+ const errs = requiresErrors(dealWith(key, { requires }));
298
+ expect(errs.length === 0, errs.map((e) => e.message).join("; ")).toBe(ok);
299
+ });
300
+ });
301
+
302
+ describe.skipIf(!hasBackend)("lifecycle requires parity — the pod's parser gives the same verdict and words", () => {
303
+ const parse = hasBackend ? loadBackendParser() : null;
304
+ const dealOption = (key: string) => crm.profiles.find((p) => p.slug === "deal")!.lifecycle!.options.find((o) => o.key === key)!;
305
+
306
+ it("the mirrored lists are the types' lists", () => {
307
+ const t = typesLifecycle as unknown as Record<string, readonly string[]>;
308
+ expect([...LIFECYCLE_REQUIREMENT_OWNERS]).toEqual([...t.LIFECYCLE_REQUIREMENT_OWNERS!]);
309
+ expect([...LIFECYCLE_REQUIREMENT_DIRECTIONS]).toEqual([...t.LIFECYCLE_REQUIREMENT_DIRECTIONS!]);
310
+ });
311
+
312
+ it.each(REQ_ROWS)("the pod: $name → ok=$ok", ({ key, requires, ok }) => {
313
+ const { options, errors } = parse!([{ ...dealOption(key), requires }]);
314
+ expect(errors.length === 0, errors.join("; ")).toBe(ok);
315
+ // accepted means CARRIED (an empty list is dropped on purpose)
316
+ if (ok && Array.isArray(requires) && requires.length > 0) expect(options[0]!.requires).toBeDefined();
317
+ });
318
+
319
+ it("the same words: a refused row says what the pod would say", () => {
320
+ for (const row of REQ_ROWS.filter((r) => !r.ok)) {
321
+ const pod = parse!([{ ...dealOption(row.key), requires: row.requires }]).errors;
322
+ const ours = requiresErrors(dealWith(row.key, { requires: row.requires })).map((e) => e.message);
323
+ expect(ours, row.name).toEqual(pod);
324
+ }
325
+ });
326
+ });
327
+
237
328
  // ── presets carry them ──────────────────────────────────────────────────────
238
329
 
239
330
  describe("lifecycle presets carry dateBinding and waits", () => {
package/src/templates.ts CHANGED
@@ -12534,7 +12534,7 @@ const DATA = {
12534
12534
  {
12535
12535
  "name": "Write the caption",
12536
12536
  "description": "Draft the caption of one post from its brief and its script, as a draft in its script document that the person edits and saves.",
12537
- "goalTemplate": "Draft the caption of this post ({post}). Read the post: its hook (post-hook), its call to action (post-cta), its pillar, its journey stage, its platform (post-platform) and its format. Read its script, the post's own document: its slides (the S1, S2 lines or the slide table) and any caption already written under \"## Caption\". Write ONE caption in the brand voice (the pod's brand kit) that says what the slides leave out: a first line that stands on its own before the platform cuts it (Instagram shows about 125 characters before \"more\", LinkedIn about 210 before \"see more\"), then two or three short lines, and the call to action last. No hashtag wall, no emoji run, no claim the script does not make, and no line that starts with \"##\". Put it in the script document as its \"## Caption draft\" section: replace that section if it is there, else add it at the end, and change no other line (synap_update_document with the revision you read). Never write or change the \"## Caption\" section on your own: it is the person's. Then ask the person to approve your draft: ONE confirm ask on this session (owner the person), its prompt the caption itself, \"Use this caption\" recommended. On yes, put the draft in the \"## Caption\" section (replace its words, or add it) and remove the \"## Caption draft\" section, nothing else. On no, leave the draft where it is (they may edit it and save it on the post's page in Content Studio, which also makes it the caption). Never move the post's status. Close this session once the person answered.",
12537
+ "goalTemplate": "Draft the caption of this post ({post}). Read the post: its hook (post-hook), its call to action (post-cta), its pillar, its journey stage, its platform (post-platform) and its format. Read its script, the post's own document: its slides (the S1, S2 lines or the slide table) and any caption already written under \"## Caption\". Write ONE caption in the brand voice (the pod's brand kit) that says what the slides leave out: a first line that stands on its own before the platform cuts it (Instagram shows about 125 characters before \"more\", LinkedIn about 210 before \"see more\"), then two or three short lines, and the call to action last. No hashtag wall, no emoji run, no claim the script does not make, and no line that starts with \"##\". Put it in the script document as its \"## Caption draft\" section: replace that section if it is there, else add it at the end, and change no other line (synap_update_document with the revision you read). Never write or change the \"## Caption\" section: it is the person's. They approve your draft on the post's page in Content Studio, where \"Use this draft\" and their Save make it the caption. Never move the post's status. Stop once the draft is in the document: your answer is the caption draft itself.",
12538
12538
  "subjectProfile": {
12539
12539
  "profileSlug": "post"
12540
12540
  },
@@ -13344,7 +13344,7 @@ const DATA = {
13344
13344
  "values": {
13345
13345
  "commercialStage": "negotiating",
13346
13346
  "value": 12000,
13347
- "nextStep": "Send revised quote Thu"
13347
+ "nextAction": "Send revised quote Thu"
13348
13348
  }
13349
13349
  },
13350
13350
  {
@@ -13352,7 +13352,7 @@ const DATA = {
13352
13352
  "values": {
13353
13353
  "commercialStage": "proposed",
13354
13354
  "value": 6000,
13355
- "nextStep": "Follow up on proposal Mon"
13355
+ "nextAction": "Follow up on proposal Mon"
13356
13356
  }
13357
13357
  },
13358
13358
  {
@@ -13360,7 +13360,7 @@ const DATA = {
13360
13360
  "values": {
13361
13361
  "commercialStage": "draft",
13362
13362
  "value": 2800,
13363
- "nextStep": "Discovery call Wed"
13363
+ "nextAction": "Discovery call Wed"
13364
13364
  }
13365
13365
  },
13366
13366
  {
@@ -13368,7 +13368,7 @@ const DATA = {
13368
13368
  "values": {
13369
13369
  "commercialStage": "won",
13370
13370
  "value": 18000,
13371
- "nextStep": "Kick-off next week"
13371
+ "nextAction": "Kick-off next week"
13372
13372
  }
13373
13373
  },
13374
13374
  {
@@ -13516,18 +13516,6 @@ const DATA = {
13516
13516
  "valueType": "date",
13517
13517
  "inputType": "date"
13518
13518
  },
13519
- {
13520
- "slug": "nextFollowUpDate",
13521
- "label": "Next follow-up date",
13522
- "valueType": "date",
13523
- "inputType": "date"
13524
- },
13525
- {
13526
- "slug": "nextStep",
13527
- "label": "Next step",
13528
- "valueType": "string",
13529
- "inputType": "textarea"
13530
- },
13531
13519
  {
13532
13520
  "slug": "notes",
13533
13521
  "label": "Notes",
@@ -13621,18 +13609,6 @@ const DATA = {
13621
13609
  "valueType": "date",
13622
13610
  "inputType": "date"
13623
13611
  },
13624
- {
13625
- "slug": "nextFollowUpDate",
13626
- "label": "Next follow-up date",
13627
- "valueType": "date",
13628
- "inputType": "date"
13629
- },
13630
- {
13631
- "slug": "nextStep",
13632
- "label": "Next step",
13633
- "valueType": "string",
13634
- "inputType": "textarea"
13635
- },
13636
13612
  {
13637
13613
  "slug": "notes",
13638
13614
  "label": "Notes",
@@ -13655,18 +13631,45 @@ const DATA = {
13655
13631
  "key": "draft",
13656
13632
  "label": "Meeting booked",
13657
13633
  "category": "open",
13658
- "stuckAfterDays": 14
13634
+ "stuckAfterDays": 14,
13635
+ "requires": [
13636
+ {
13637
+ "kind": "property",
13638
+ "blockerKey": "no_next_step",
13639
+ "label": "A next step with a date",
13640
+ "property": "nextActionAt",
13641
+ "owner": "you"
13642
+ }
13643
+ ]
13659
13644
  },
13660
13645
  {
13661
13646
  "key": "proposed",
13662
13647
  "label": "Proposal sent",
13663
13648
  "category": "active",
13664
- "stuckAfterDays": 14
13649
+ "stuckAfterDays": 14,
13650
+ "requires": [
13651
+ {
13652
+ "kind": "property",
13653
+ "blockerKey": "no_next_step",
13654
+ "label": "A next step with a date",
13655
+ "property": "nextActionAt",
13656
+ "owner": "you"
13657
+ }
13658
+ ]
13665
13659
  },
13666
13660
  {
13667
13661
  "key": "negotiating",
13668
13662
  "category": "active",
13669
- "stuckAfterDays": 14
13663
+ "stuckAfterDays": 14,
13664
+ "requires": [
13665
+ {
13666
+ "kind": "property",
13667
+ "blockerKey": "no_next_step",
13668
+ "label": "A next step with a date",
13669
+ "property": "nextActionAt",
13670
+ "owner": "you"
13671
+ }
13672
+ ]
13670
13673
  },
13671
13674
  {
13672
13675
  "key": "won",
@@ -13737,11 +13740,17 @@ const DATA = {
13737
13740
  "inputType": "date"
13738
13741
  },
13739
13742
  {
13740
- "slug": "nextStep",
13741
- "label": "Next step",
13743
+ "slug": "nextAction",
13744
+ "label": "Next action",
13742
13745
  "valueType": "string",
13743
13746
  "inputType": "textarea"
13744
13747
  },
13748
+ {
13749
+ "slug": "nextActionAt",
13750
+ "label": "Next action at",
13751
+ "valueType": "date",
13752
+ "inputType": "date"
13753
+ },
13745
13754
  {
13746
13755
  "slug": "description",
13747
13756
  "label": "Notes",
@@ -13902,12 +13911,6 @@ const DATA = {
13902
13911
  "valueType": "date",
13903
13912
  "inputType": "date"
13904
13913
  },
13905
- {
13906
- "slug": "nextActionAt",
13907
- "label": "Next action at",
13908
- "valueType": "date",
13909
- "inputType": "date"
13910
- },
13911
13914
  {
13912
13915
  "slug": "nextAction",
13913
13916
  "label": "Next action",
@@ -14442,7 +14445,8 @@ const DATA = {
14442
14445
  "commercialStage",
14443
14446
  "value",
14444
14447
  "closeDate",
14445
- "nextStep"
14448
+ "nextAction",
14449
+ "nextActionAt"
14446
14450
  ]
14447
14451
  }
14448
14452
  },
@@ -14506,6 +14510,7 @@ const DATA = {
14506
14510
  "starters": [
14507
14511
  "A useful first pipeline is deliberately small. A deal's stages are the sale only — 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",
14508
14512
  "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",
14513
+ "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",
14509
14514
  "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"
14510
14515
  ],
14511
14516
  "blindSpots": [
@@ -14525,8 +14530,7 @@ const DATA = {
14525
14530
  "website",
14526
14531
  "industry",
14527
14532
  "companySize",
14528
- "source",
14529
- "nextStep"
14533
+ "source"
14530
14534
  ]
14531
14535
  },
14532
14536
  {
@@ -14538,8 +14542,7 @@ const DATA = {
14538
14542
  "email",
14539
14543
  "jobTitle",
14540
14544
  "company",
14541
- "source",
14542
- "nextFollowUpDate"
14545
+ "source"
14543
14546
  ]
14544
14547
  },
14545
14548
  {
@@ -14551,7 +14554,8 @@ const DATA = {
14551
14554
  "commercialStage",
14552
14555
  "value",
14553
14556
  "closeDate",
14554
- "nextStep"
14557
+ "nextAction",
14558
+ "nextActionAt"
14555
14559
  ]
14556
14560
  }
14557
14561
  ],
@@ -14694,7 +14698,7 @@ const DATA = {
14694
14698
  {
14695
14699
  "name": "CRM Hygiene",
14696
14700
  "description": "Always-on maintenance — enriches stale contacts/companies and flags stalled deals. Every change is proposed for your review, never auto-applied.",
14697
- "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 — 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 — 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 `nextStep` to unblock it and note why it looks stalled. Do not advance a deal's stage on its behalf — surface the risk and a recommended action for the human to decide.\nSkip anything already healthy. If nothing needs attention, do nothing.",
14701
+ "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 — 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 — 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 — surface the risk and a recommended action for the human to decide.\nSkip anything already healthy. If nothing needs attention, do nothing.",
14698
14702
  "schedule": {
14699
14703
  "cron": "0 8 * * *",
14700
14704
  "enabled": true
@@ -15127,7 +15131,7 @@ const DATA = {
15127
15131
  {
15128
15132
  "name": "Draft a first message",
15129
15133
  "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.",
15130
- "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 new or researching 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.",
15134
+ "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.",
15131
15135
  "subjectProfile": {
15132
15136
  "profileSlug": "lead"
15133
15137
  },
@@ -15236,7 +15240,7 @@ const DATA = {
15236
15240
  "key": "send",
15237
15241
  "name": "Person sends",
15238
15242
  "category": "completed",
15239
- "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 new or researching lead to outreach.",
15243
+ "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.",
15240
15244
  "gate": {
15241
15245
  "kind": "human"
15242
15246
  },
@@ -15438,7 +15442,7 @@ const DATA = {
15438
15442
  {
15439
15443
  "name": "Follow up on leads in outreach",
15440
15444
  "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.",
15441
- "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 new or researching 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.",
15445
+ "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.",
15442
15446
  "subjectProfile": {
15443
15447
  "profileSlug": "lead"
15444
15448
  },
@@ -15540,7 +15544,7 @@ const DATA = {
15540
15544
  {
15541
15545
  "name": "Personalized Outreach",
15542
15546
  "description": "Run one outreach campaign — 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.",
15543
- "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 new or researching 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.",
15547
+ "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.",
15544
15548
  "subjectProfile": {
15545
15549
  "profileSlug": "campaign"
15546
15550
  },
@@ -15912,7 +15916,7 @@ const DATA = {
15912
15916
  {
15913
15917
  "name": "Propose a Health cell",
15914
15918
  "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).",
15915
- "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.",
15919
+ "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.",
15916
15920
  "params": [
15917
15921
  {
15918
15922
  "name": "question",
@@ -18690,7 +18694,7 @@ const DATA = {
18690
18694
  "displayName": "Lead",
18691
18695
  "icon": "user-plus",
18692
18696
  "color": "yellow",
18693
- "description": "An early-pipeline prospect — not yet a client, being qualified or nurtured.",
18697
+ "description": "An early-pipeline prospect — 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.",
18694
18698
  "scope": "shared",
18695
18699
  "profileKind": "role",
18696
18700
  "applicableKinds": [
@@ -18702,27 +18706,121 @@ const DATA = {
18702
18706
  "options": [
18703
18707
  {
18704
18708
  "key": "new",
18705
- "category": "open"
18709
+ "category": "open",
18710
+ "requires": [
18711
+ {
18712
+ "kind": "property",
18713
+ "blockerKey": "no_next_step",
18714
+ "label": "A next step with a date",
18715
+ "property": "nextActionAt",
18716
+ "owner": "you"
18717
+ }
18718
+ ]
18706
18719
  },
18707
18720
  {
18708
18721
  "key": "researching",
18709
- "category": "open"
18722
+ "category": "open",
18723
+ "requires": [
18724
+ {
18725
+ "kind": "property",
18726
+ "blockerKey": "no_next_step",
18727
+ "label": "A next step with a date",
18728
+ "property": "nextActionAt",
18729
+ "owner": "you"
18730
+ },
18731
+ {
18732
+ "kind": "link",
18733
+ "blockerKey": "no_company",
18734
+ "label": "Their company",
18735
+ "relation": "works_at",
18736
+ "direction": "out",
18737
+ "owner": "agent",
18738
+ "forKinds": [
18739
+ "person"
18740
+ ]
18741
+ }
18742
+ ]
18710
18743
  },
18711
18744
  {
18712
- "key": "outreach",
18713
- "category": "open"
18745
+ "key": "qualified",
18746
+ "category": "active",
18747
+ "requires": [
18748
+ {
18749
+ "kind": "property",
18750
+ "blockerKey": "no_next_step",
18751
+ "label": "A next step with a date",
18752
+ "property": "nextActionAt",
18753
+ "owner": "you"
18754
+ }
18755
+ ]
18714
18756
  },
18715
18757
  {
18716
- "key": "engaged",
18717
- "category": "active"
18758
+ "key": "outreach",
18759
+ "category": "open",
18760
+ "dateBinding": "nextActionAt",
18761
+ "waits": {
18762
+ "on": "person",
18763
+ "waitKind": "their_reply",
18764
+ "dateBinding": "nextActionAt"
18765
+ },
18766
+ "requires": [
18767
+ {
18768
+ "kind": "link",
18769
+ "blockerKey": "no_contact",
18770
+ "label": "A contact at the company",
18771
+ "relation": "works_at",
18772
+ "direction": "in",
18773
+ "forKinds": [
18774
+ "company"
18775
+ ]
18776
+ },
18777
+ {
18778
+ "kind": "property",
18779
+ "blockerKey": "no_linkedin",
18780
+ "label": "Their LinkedIn profile",
18781
+ "property": "linkedinUrl",
18782
+ "owner": "agent",
18783
+ "clearedBy": {
18784
+ "capability": "linkedin_find_profile"
18785
+ },
18786
+ "forKinds": [
18787
+ "person"
18788
+ ]
18789
+ },
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
+ ]
18718
18798
  },
18719
18799
  {
18720
- "key": "qualified",
18721
- "category": "active"
18800
+ "key": "engaged",
18801
+ "category": "active",
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
+ ]
18722
18811
  },
18723
18812
  {
18724
18813
  "key": "nurturing",
18725
- "category": "active"
18814
+ "category": "active",
18815
+ "requires": [
18816
+ {
18817
+ "kind": "property",
18818
+ "blockerKey": "no_next_step",
18819
+ "label": "A next step with a date",
18820
+ "property": "nextActionAt",
18821
+ "owner": "you"
18822
+ }
18823
+ ]
18726
18824
  },
18727
18825
  {
18728
18826
  "key": "converted",
@@ -18745,9 +18843,9 @@ const DATA = {
18745
18843
  "enumValues": [
18746
18844
  "new",
18747
18845
  "researching",
18846
+ "qualified",
18748
18847
  "outreach",
18749
18848
  "engaged",
18750
- "qualified",
18751
18849
  "nurturing",
18752
18850
  "converted",
18753
18851
  "disqualified"
@@ -18756,6 +18854,12 @@ const DATA = {
18756
18854
  "defaultValue": "new"
18757
18855
  }
18758
18856
  },
18857
+ {
18858
+ "slug": "nextActionAt",
18859
+ "label": "Next action at",
18860
+ "valueType": "date",
18861
+ "inputType": "date"
18862
+ },
18759
18863
  {
18760
18864
  "slug": "notes",
18761
18865
  "label": "Notes",
package/src/types.ts CHANGED
@@ -233,8 +233,31 @@ export interface TemplateLifecycleOption {
233
233
  * someone without being a pause. Open/active/paused only.
234
234
  */
235
235
  waits?: TemplateLifecycleOptionWaits;
236
+ /**
237
+ * What a thing standing here must HAVE before it can move on (a lead in
238
+ * `outreach` needs a contact). Each unmet one is a derived blocker on the
239
+ * thing, never a stored flag. The pod's `LifecycleOptionRequirement`.
240
+ * Open/active/paused only.
241
+ */
242
+ requires?: TemplateLifecycleRequirement[];
236
243
  }
237
244
 
245
+ /** One requirement of a step (the pod's `LifecycleOptionRequirement`): typed and closed. */
246
+ export type TemplateLifecycleRequirement = {
247
+ /** The blocker's domain name (`no_contact`); unique in its option. */
248
+ blockerKey: string;
249
+ label?: string;
250
+ /** Exactly one of `{answer: true}`, `{intent}`, `{playbookId}`, `{capability}`. */
251
+ clearedBy?: { answer: true } | { intent: string } | { playbookId: string } | { capability: string };
252
+ /** Whose move it is; absent ⇒ `you`. */
253
+ owner?: "you" | "agent";
254
+ /** Only things of these kinds (profile slugs) are held to it. */
255
+ forKinds?: string[];
256
+ } & (
257
+ | { kind: "link"; relation: string; direction: "out" | "in"; min?: number }
258
+ | { kind: "property"; property: string; in?: string[] }
259
+ );
260
+
238
261
  /** A step's declared wait (the pod's `LifecycleOptionWaits`). */
239
262
  export interface TemplateLifecycleOptionWaits {
240
263
  /** A hold's `on`, never `unspecified`: person · agent · external · thing · decision · date · nobody. */