@synap-core/workspace-templates 0.41.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/wire.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-C0Iizc2r.js';
1
+ import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-CRNRmaqi.js';
2
2
  import '@synap-core/types/presentation';
3
3
  import '@synap-core/types/space-brief';
4
4
  import '@synap-core/types/capability-intents';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synap-core/workspace-templates",
3
- "version": "0.41.0",
3
+ "version": "0.43.0",
4
4
  "type": "module",
5
5
  "description": "Canonical workspace definitions — YAML source + typed exports for browser, backend, CLI, and marketplace",
6
6
  "repository": {
@@ -78,6 +78,7 @@ playbooks:
78
78
  params:
79
79
  - { name: note, type: entity, label: Capture, required: true }
80
80
  executor: is-agent
81
+ tools: [resolve_identity, create_entity, attach_facet, create_relation]
81
82
  status: active
82
83
  expectedOutputs:
83
84
  - { kind: task, label: What the capture became, relationToSubject: relates_to }
@@ -1192,7 +1192,7 @@ playbooks:
1192
1192
  - { name: asset, type: entity, label: Brand asset, required: true }
1193
1193
  executor: is-agent
1194
1194
  status: active
1195
- requiredIntents: [generate_media]
1195
+ tools: [generate_media]
1196
1196
  expectedOutputs:
1197
1197
  - { kind: brand-asset, label: Variants, relationToSubject: derived_from }
1198
1198
  stages:
package/src/builder.yaml CHANGED
@@ -2098,6 +2098,7 @@ playbooks:
2098
2098
  params:
2099
2099
  - { name: feature, type: entity, label: Feature, required: true }
2100
2100
  executor: is-agent
2101
+ tools: [github_pr_checks]
2101
2102
  status: active
2102
2103
  stages:
2103
2104
  - key: shape
@@ -2223,6 +2224,7 @@ playbooks:
2223
2224
  - { name: change, type: text, label: "What to dogfood (a pull request, a sha, a feature)" }
2224
2225
  - { name: where, type: text, label: "Where it runs (the lab host)", default: lab }
2225
2226
  executor: is-agent
2227
+ tools: [create_entity, create_relation]
2226
2228
  status: active
2227
2229
  criteria:
2228
2230
  - key: dogfood-walked
@@ -2243,7 +2245,7 @@ playbooks:
2243
2245
  # --- Build a change ---
2244
2246
  - name: Build a change
2245
2247
  description: 'Dev set (decision d05), key: build. Works one feature (devplane_feature) from shaped criteria to a verified change on main; its stages follow the feature''s lifecycle (spec, in_progress, in_review, done); a cancelled or failed session leaves the feature where it is. One feature per session, never two subjects (founder default, 2026-11-05). A quick change is this playbook with size small (no plan); a night shift run is this playbook with unattended true. No activators until binding is turned on; the shape would be {on: enters_status, status: spec, size: per_thing, mode: propose}, the trigger Ship a change uses today. Reuses Ship a change (2c5aa553) stage text and evidence keys; absorbs AI Dev Session and Quick change once they are re-pointed. Draft until the founder activates it.'
2246
- goalTemplate: 'Build {feature} through one session and one PR per repo (or gated commits on main in a private repo), size {size}. SHAPE: write the end state and 2-5 binary criteria on this session (plan skill, skipped when size is small). BUILD: branch <type>/<slug> from origin/main in your own worktree, commit in verified slices, run the smallest gate that answers with its negative control, quote the output. LAND: follow the land stages (Change proposed, Checks green, Landed on main, Deployed to lab, Dogfooded, Criteria verified). Unattended: {unattended}. When unattended is true, ask no person, stop at a draft PR or a gated branch, never merge, push main or deploy, and post one "Look at first:" paragraph in the room.'
2248
+ goalTemplate: 'Build {feature} through one session and one PR per repo (or gated commits on main in a private repo), size {size}. SHAPE: write the end state and 2-5 binary criteria on this session (plan skill, skipped when size is small). BUILD: branch <type>/<slug> from origin/main in your own worktree, commit in verified slices, run the smallest gate that answers with its negative control, quote the output. LAND: follow the land stages (Change proposed, Checks green, Landed on main, Deployed to lab, Dogfooded, Criteria verified). Unattended: {unattended}. When unattended is true, ask no person, stop at a draft PR or a gated branch, never merge, push main or deploy, and end with your answer: one "Look at first:" paragraph.'
2247
2249
  scope: session
2248
2250
  subjectProfile:
2249
2251
  profileSlug: devplane_feature
@@ -2388,7 +2390,7 @@ playbooks:
2388
2390
  optional: true
2389
2391
  relationToSubject: relates_to
2390
2392
  - key: verify
2391
- goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and close the session.
2393
+ goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and end with the graded criteria as your answer.
2392
2394
  name: Criteria verified
2393
2395
  category: completed
2394
2396
  criteria:
@@ -2402,7 +2404,7 @@ playbooks:
2402
2404
  # --- Fix a bug ---
2403
2405
  - name: Fix a bug
2404
2406
  description: 'Dev set (decision d05), key: fix. Works an issue at its root: reproduce it with a failing test, fix the canonical path, a clean-context review, then the shared land stages. Its stages follow the issue''s lifecycle (open, investigating, fixed); a cancelled or failed session leaves the issue where it is, as Fix a finding does. Small fixes may be batched (founder default, 2026-11-05): several issues in one session, one as the subject and the rest as session targets; today a stage moves only the subject. No activators until binding is turned on; a batch would be {on: count, status: open, min: 3} or {on: schedule, cron, status: open} (both one session per moment). A night shift run is this playbook with unattended true. Reuses Bugfix (8c335e2e), Night shift: build an issue (c101dd75) and Ship a change (2c5aa553). Draft until the founder activates it.'
2405
- goalTemplate: 'Fix the issue {issue} at its root and prove it with a test that fails before the fix and passes after. REPRODUCE (recall first, smallest reproduction, root cause file:line), FIX on the canonical path in your own worktree, a clean-context REVIEW, then LAND through the shared land stages (Change proposed, Checks green, Landed on main, Deployed to lab, Dogfooded, Criteria verified). Unattended: {unattended}. When unattended is true, ask no person, stop at a draft PR or a gated branch, never merge, push main or deploy; if no code fix is right, write the root cause as a pod document; post one "Look at first:" paragraph in the room.'
2407
+ goalTemplate: 'Fix the issue {issue} at its root and prove it with a test that fails before the fix and passes after. REPRODUCE (recall first, smallest reproduction, root cause file:line), FIX on the canonical path in your own worktree, a clean-context REVIEW, then LAND through the shared land stages (Change proposed, Checks green, Landed on main, Deployed to lab, Dogfooded, Criteria verified). Unattended: {unattended}. When unattended is true, ask no person, stop at a draft PR or a gated branch, never merge, push main or deploy; if no code fix is right, write the root cause as a pod document; end with your answer: one "Look at first:" paragraph.'
2406
2408
  scope: session
2407
2409
  subjectProfile:
2408
2410
  profileSlug: issue
@@ -2561,7 +2563,7 @@ playbooks:
2561
2563
  optional: true
2562
2564
  relationToSubject: relates_to
2563
2565
  - key: verify
2564
- goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and close the session.
2566
+ goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and end with the graded criteria as your answer.
2565
2567
  name: Criteria verified
2566
2568
  category: completed
2567
2569
  criteria:
@@ -2645,6 +2647,7 @@ playbooks:
2645
2647
  type: entity
2646
2648
  label: Feature under review
2647
2649
  executor: is-agent
2650
+ tools: [create_document]
2648
2651
  status: draft
2649
2652
  stages:
2650
2653
  - key: read
@@ -2675,7 +2678,7 @@ playbooks:
2675
2678
  # --- Maintain ---
2676
2679
  - name: Maintain
2677
2680
  description: 'Dev set (decision d05), key: maintain. Works a task (one bounded chore: a dependency bump, a cleanup, a prune) in your own worktree, gated at the smallest rung, then the shared land stages when something changed. Nothing to change ends the session with a one-line reason. Small chores may be batched: several tasks in one session, one as the subject and the rest as targets. It writes no task status yet: the task lifecycle property is not confirmed (Builder''s task-status is a plain select with no declared lifecycle). No activators until binding is turned on. Draft until the founder activates it.'
2678
- goalTemplate: 'Do this chore: {chore} (repo: {repo}). DO it in your own worktree and run the smallest gate that answers; if there is nothing to change, say why in one line and close. LAND it through the shared land stages only when something changed.'
2681
+ goalTemplate: 'Do this chore: {chore} (repo: {repo}). DO it in your own worktree and run the smallest gate that answers; if there is nothing to change, stop and say why in one line as your answer. LAND it through the shared land stages only when something changed.'
2679
2682
  scope: session
2680
2683
  subjectProfile:
2681
2684
  profileSlug: task
@@ -2791,7 +2794,7 @@ playbooks:
2791
2794
  optional: true
2792
2795
  relationToSubject: relates_to
2793
2796
  - key: verify
2794
- goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and close the session.
2797
+ goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and end with the graded criteria as your answer.
2795
2798
  name: Criteria verified
2796
2799
  category: completed
2797
2800
  criteria:
@@ -2804,7 +2807,7 @@ playbooks:
2804
2807
  # --- Fix main red ---
2805
2808
  - name: Fix main red
2806
2809
  description: 'Dev set (decision d05), key: main-red. Own one red on main, once: claim it or join its owner, read the failing step, fix forward on fix/main-red-<sha8>, then the shared land stages. No subject kind: a session titled "main red: <repo> <check> @<sha8>" (the title the github-ci rule mandates) is how it is started. Stage text comes from the github-ci rule section "Never". Draft until the founder activates it.'
2807
- goalTemplate: 'Fix main red on {repo}: check {check} at {sha8}. CLAIM it once or join its owner. READ the failing step and recall what the pod knows. FIX forward on branch fix/main-red-{sha8} with a PR titled "fix: main red", gated at the smallest rung; never revert-war. LAND it through the shared land stages and close this session once the fix is on main.'
2810
+ goalTemplate: 'Fix main red on {repo}: check {check} at {sha8}. CLAIM it once or join its owner. READ the failing step and recall what the pod knows. FIX forward on branch fix/main-red-{sha8} with a PR titled "fix: main red", gated at the smallest rung; never revert-war. LAND it through the shared land stages until the fix is on main.'
2808
2811
  scope: session
2809
2812
  params:
2810
2813
  - name: repo
@@ -2941,7 +2944,7 @@ playbooks:
2941
2944
  label: Dogfood report (each path WORKS, BROKEN or CANNOT-TELL, with what was seen)
2942
2945
  optional: true
2943
2946
  - key: verify
2944
- goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and close the session.
2947
+ goal: Grade every criterion of the session with its evidence, separating VERIFIED (gate or check output quoted) from NEEDS-DOGFOOD, capture what was learned, and end with the graded criteria as your answer.
2945
2948
  name: Criteria verified
2946
2949
  category: completed
2947
2950
  criteria:
@@ -322,9 +322,9 @@ describe("Content OS Repurpose proposes once per original, never for a copy", ()
322
322
  });
323
323
 
324
324
  // "Write the caption" (founder, 5 Nov): Content Studio's "Write it for me" runs it on ONE post. It drafts, never
325
- // decides: it writes the script's "## Caption draft" section, never the "## Caption"; the person's "Use this draft" and
326
- // Save in the app make it the caption. It raises no ask and closes nothing: a run has no session tools (founder, 9 Nov:
327
- // the tools win; schema/run-tools.guard.test.ts holds every playbook to that). It binds no stage and moves no status.
325
+ // decides. One-shot (plan 08e4fba7, backend#988): the pod makes one call with no tools and files the answer as a
326
+ // proposal of the script's "Caption draft" section, never the "Caption" the person saved; the person approves it
327
+ // inline. No session, so no ask and nothing to close; it binds no stage and moves no status.
328
328
  describe("Content OS Write the caption drafts one post's caption, never the person's", () => {
329
329
  const playbooks = (template.playbooks ?? []) as TemplatePlaybook[];
330
330
  const caption = playbooks.find((p) => p.name === "Write the caption");
@@ -336,15 +336,30 @@ describe("Content OS Write the caption drafts one post's caption, never the pers
336
336
  expect(caption?.status).toBe("active");
337
337
  });
338
338
 
339
- it("writes the draft section only, never the saved caption, and never moves the status", () => {
340
- expect(caption?.goalTemplate).toMatch(/"## Caption draft" section/);
341
- expect(caption?.goalTemplate).toMatch(/Never write or change the "## Caption" section:\s+it\s+is the person's/);
342
- // The person approves in Content Studio ("Use this draft" + Save); the run itself asks nothing and closes nothing.
343
- expect(caption?.goalTemplate).toMatch(/"Use this draft" and their Save make it the caption/);
344
- expect(caption?.goalTemplate).not.toMatch(/\bask\b|\bclose\b|\bOn yes\b/i);
345
- expect(caption?.goalTemplate).toMatch(/Never\s+move the post's status/);
339
+ it("runs one-shot: one call with no tools, its draft landing in the \"Caption draft\" section, never the saved caption", () => {
340
+ // backend#988: the pod files the answer as a proposal of the script's "Caption draft" section; the person
341
+ // approves it inline. Nothing writes the "Caption" section the person saved, and nothing moves the status.
342
+ expect(caption?.executor).toBe("generate");
343
+ expect(caption?.tools ?? []).toEqual([]);
346
344
  expect(caption?.stages ?? []).toEqual([]);
347
345
  expect(caption?.activators ?? []).toEqual([]);
348
- expect(caption?.expectedOutputs).toEqual([expect.objectContaining({ kind: "document", label: "Caption draft", relationToSubject: "none" })]);
346
+ expect(caption?.expectedOutputs).toEqual([
347
+ expect.objectContaining({
348
+ kind: "document",
349
+ label: "Caption draft",
350
+ relationToSubject: "none",
351
+ lands: {
352
+ target: "subject_document_section",
353
+ section: "Caption draft",
354
+ // backend#1005: the person's last decided captions in this space, as examples.
355
+ examples: { approved: 3, rejected: 3 },
356
+ },
357
+ }),
358
+ ]);
359
+ // A writing instruction only: no tool, no write, no ask, no close, no status move.
360
+ expect(caption?.goalTemplate).not.toMatch(/synap_|update_document|revision|\bask\b|\bclose\b|\bstatus\b/i);
361
+ expect(caption?.goalTemplate).toMatch(/Write ONE caption in the brand voice/);
362
+ // The voice reaches the one call as guidance (the call cannot look it up).
363
+ expect(caption?.guidance).toEqual([expect.objectContaining({ ref: "kind:brand-voice-guide" })]);
349
364
  });
350
365
  });
@@ -1905,7 +1905,7 @@ playbooks:
1905
1905
  # What the process needs the pod to be able to do. Schedule queues the post
1906
1906
  # through whatever serves publish_post (the `postiz` capability's
1907
1907
  # postiz_schedule_post); a pod with nothing serving it reports the gap.
1908
- requiredIntents: [publish_post]
1908
+ tools: [publish_post, generate_media, edit_video]
1909
1909
  inputStrategy:
1910
1910
  kind: pinned
1911
1911
  fallback:
@@ -2374,6 +2374,7 @@ playbooks:
2374
2374
  expectedOutputs:
2375
2375
  - { kind: post, label: Next post idea, relationToSubject: none }
2376
2376
  executor: is-agent
2377
+ tools: [create_entity, update_entities]
2377
2378
  status: active
2378
2379
 
2379
2380
  # The idea bank's door (decision B, review 22fec5ee §7): Content Studio's
@@ -2403,48 +2404,54 @@ playbooks:
2403
2404
  expectedOutputs:
2404
2405
  - { kind: post, label: Packaged post, relationToSubject: none }
2405
2406
  executor: is-agent
2407
+ tools: [propose_entity_graph, update_entity]
2406
2408
  status: active
2407
2409
 
2408
2410
  # One post's caption, on request (founder, 5 Nov: "something that writes the
2409
2411
  # caption so I don't have to"). Content Studio's "Write it for me" on a post's
2410
- # Caption box runs it for that post. It writes a DRAFT, the script document's
2411
- # "## Caption draft" section, never the "## Caption" the person saved; the
2412
- # person approves it in the app's Caption box ("Use this draft", then Save).
2413
- # It raises no ask and closes nothing: a run has no session tools (founder,
2414
- # 9 Nov: when a playbook's text and its run's tools disagree, the tools win;
2415
- # the pod, not the agent, raises a person's approval at a run's end;
2416
- # schema/run-tools.guard.test.ts keeps every playbook to that). It works
2417
- # one post but binds no stage and never moves the status.
2412
+ # Caption box runs it for that post. ONE-SHOT (executor generate, plan
2413
+ # 08e4fba7, backend#988): the pod reads the post's fields and its script
2414
+ # document, makes ONE model call with no tools, and files the answer as a
2415
+ # PROPOSAL of the script's AI-owned "Caption draft" section (`lands`), never
2416
+ # the "Caption" the person saved. No session, no room, no agent turn: the
2417
+ # person approves the draft inline in the app or in Needs you. So the goal is
2418
+ # a WRITING instruction only: what a good caption is, never a tool or a write
2419
+ # (schema/run-tools.guard.test.ts holds a one-shot run to no tools). The
2420
+ # brand voice reaches the call as guidance: the approved general and social
2421
+ # voice guides (Brand Library, a dependency), since the call cannot look
2422
+ # anything up. It binds no stage and never moves the status.
2418
2423
  - name: Write the caption
2419
- 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.
2424
+ description: Draft the caption of one post from its brief and its script, filed as a draft section of its script document for the person to approve.
2420
2425
  goalTemplate: >-
2421
- Draft the caption of this post ({post}). Read the post: its hook
2422
- (post-hook), its call to action (post-cta), its pillar, its journey
2423
- stage, its platform (post-platform) and its format. Read its script, the
2424
- post's own document: its slides (the S1, S2 lines or the slide table)
2425
- and any caption already written under "## Caption". Write ONE caption in
2426
- the brand voice (the pod's brand kit) that says what the slides leave
2427
- out: a first line that stands on its own before the platform cuts it
2428
- (Instagram shows about 125 characters before "more", LinkedIn about 210
2429
- before "see more"), then two or three short lines, and the call to action
2430
- last. No hashtag wall, no emoji run, no claim the script does not make,
2431
- and no line that starts with "##". Put it in the script document as its
2432
- "## Caption draft" section: replace that section if it is there, else add
2433
- it at the end, and change no other line (synap_update_document with the
2434
- revision you read). Never write or change the "## Caption" section: it
2435
- is the person's. They approve your draft on the post's page in Content
2436
- Studio, where "Use this draft" and their Save make it the caption. Never
2437
- move the post's status. Stop once the draft is in the document: your
2438
- answer is the caption draft itself.
2426
+ Write the caption of this post ({post}) from its fields and its script
2427
+ below: its hook (post-hook), its call to action (post-cta), its pillar,
2428
+ its journey stage, its platform (post-platform) and its format, the
2429
+ script's slides (the S1, S2 lines or the slide table) and any caption
2430
+ already written under "Caption". Write ONE caption in the brand voice
2431
+ you are given that says what the slides leave out: a first line that
2432
+ stands on its own before the platform cuts it (Instagram shows about 125
2433
+ characters before "more", LinkedIn about 210 before "see more"), then
2434
+ two or three short lines, and the call to action last. No hashtag wall,
2435
+ no emoji run, no claim the script does not make, and no line that starts
2436
+ with "##".
2439
2437
  subjectProfile:
2440
2438
  profileSlug: post
2441
- # Typed output: the draft lives in the post's own script document (a
2442
- # section of it), so nothing new is created and there is no edge to add.
2439
+ guidance:
2440
+ - { ref: "kind:brand-voice-guide", label: Voice, where: { voice-context: [general, social] } }
2441
+ # Typed output: the draft lands in the post's own script document, as its
2442
+ # "Caption draft" section (a proposal), so nothing new is created and there
2443
+ # is no edge to add. `examples` (backend#1005, founder decision 8 of plan
2444
+ # 08e4fba7): the call also sees the person's last 3 approved captions (as
2445
+ # they kept them) and last 3 rejected ones (with their reason when given)
2446
+ # from this space, so a draft starts closer to what they keep.
2443
2447
  expectedOutputs:
2444
- - { kind: document, label: Caption draft, relationToSubject: none }
2448
+ - kind: document
2449
+ label: Caption draft
2450
+ relationToSubject: none
2451
+ lands: { target: subject_document_section, section: Caption draft, examples: { approved: 3, rejected: 3 } }
2445
2452
  params:
2446
2453
  - { name: post, type: entity, label: Post, required: true }
2447
- executor: is-agent
2454
+ executor: generate
2448
2455
  status: active
2449
2456
 
2450
2457
  # Once a post is Published, propose turning it into its siblings (thread →
@@ -2470,6 +2477,7 @@ playbooks:
2470
2477
  params:
2471
2478
  - { name: post, type: entity, label: Post, required: true }
2472
2479
  executor: is-agent
2480
+ tools: [create_entity, create_relation]
2473
2481
  status: active
2474
2482
 
2475
2483
  # A newsletter issue from idea to sent, one stage per `newsletter-status`.
@@ -61,8 +61,7 @@ describe("CRM — Find the right contact", () => {
61
61
  expect(pb().activators).toEqual([{ on: "manual", mode: "propose" }]);
62
62
  expect(pb().executor).toBe("is-agent");
63
63
  expect(pb().status).toBe("active");
64
- expect(pb().grants).toEqual(["entity.create"]);
65
- expect(pb().requiredIntents).toEqual(["find_people", "enrich_entity"]);
64
+ expect(pb().tools).toEqual(["find_people", "enrich_entity", "web.read", "unipile_list_accounts", "entity.create"]);
66
65
  });
67
66
 
68
67
  it("works a company, which has no lifecycle: no stage moves it and no gate stops it", () => {
@@ -74,7 +74,7 @@ describe("CRM lists — catalog contract", () => {
74
74
  ["campaign", "entity", false, undefined],
75
75
  ["channel", "choice", false, "linkedin"],
76
76
  ]);
77
- expect(pb.grants).toEqual(["entity.create"]);
77
+ expect(pb.tools).toEqual(["messaging.send", "channel.resolve", "feed.read", "linkedin_find_profile", "linkedin_send_invite", "entity.create"]);
78
78
  expect((pb.stages ?? []).flatMap((s) => s.expectedOutputs ?? [])).toEqual([
79
79
  { kind: "messaging", label: "Proposed first message", relationToSubject: "none" },
80
80
  ]);
@@ -54,7 +54,7 @@ const stageOf = (name: string, key: string) => {
54
54
  };
55
55
 
56
56
  const CADENCE =
57
- '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.';
57
+ '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 channel.resolve and feed.read: 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.';
58
58
 
59
59
  /**
60
60
  * The LinkedIn order (CRM wave 2, S4b, build map 6f6c197f; changed by the CRM
@@ -70,7 +70,7 @@ const LINKEDIN_ORDER =
70
70
  '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.';
71
71
 
72
72
  const DRAFT_RULES =
73
- "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. " +
73
+ "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 (channel.resolve, then feed.read) 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. " +
74
74
  LINKEDIN_ORDER;
75
75
 
76
76
  /**
@@ -276,7 +276,7 @@ describe("CRM messages and cadence — catalog contract", () => {
276
276
  expect(pb.params?.find((p) => p.name === "person")).toMatchObject({ type: "entity", required: true });
277
277
  expect(pb.params?.find((p) => p.name === "lead")).toBeUndefined();
278
278
  expect(goalOf(name)).not.toContain("{lead}");
279
- expect(pb.requiredIntents).toEqual(["enrich_entity"]);
279
+ expect(pb.tools).toEqual(["enrich_entity", "unipile_list_accounts"]);
280
280
  const goal = goalOf(name);
281
281
  expect(goal).toContain("run linkedin_find_profile with their full name, their");
282
282
  expect(goal).toContain("company when known");
@@ -124,7 +124,7 @@ describe("'Propose my rules from my sent messages': drafts only", () => {
124
124
  it("exists, started by the person, and yields draft voice and By kind of lead rows", () => {
125
125
  expect(pb).toBeTruthy();
126
126
  expect(pb?.executor).toBe("is-agent");
127
- expect(pb?.grants).toEqual(["entity.create"]);
127
+ expect(pb?.tools).toEqual(["channel.resolve", "feed.read", "entity.create"]);
128
128
  expect((pb?.expectedOutputs ?? []).map((o) => o.kind).sort()).toEqual(["brand-voice-guide", "outreach-angle"]);
129
129
  });
130
130
 
package/src/crm.yaml CHANGED
@@ -1024,9 +1024,7 @@ playbooks:
1024
1024
  params:
1025
1025
  - { name: target, type: entity, label: Lead or company, required: true }
1026
1026
  executor: is-agent
1027
- grants:
1028
- - apify_run_actor
1029
- - entity.create
1027
+ tools: [update_entity, apify_run_actor, entity.create]
1030
1028
  status: active
1031
1029
 
1032
1030
  # ── Qualify a lead — a ROLE-subject process ─────────────────────────────
@@ -1082,7 +1080,7 @@ playbooks:
1082
1080
  - { name: lead, type: entity, label: Lead, required: true }
1083
1081
  executor: is-agent
1084
1082
  status: active
1085
- requiredIntents: [enrich_entity, search_external]
1083
+ tools: [enrich_entity, search_external]
1086
1084
  stages:
1087
1085
  - key: research
1088
1086
  name: Research
@@ -1179,8 +1177,7 @@ playbooks:
1179
1177
  governance:
1180
1178
  forceProposeWrites: true
1181
1179
  executor: is-agent
1182
- grants:
1183
- - apify_run_actor
1180
+ tools: [update_entity, enrich_entity, apify_run_actor]
1184
1181
  status: active
1185
1182
 
1186
1183
  - name: Win a deal
@@ -1214,7 +1211,7 @@ playbooks:
1214
1211
  - { name: deal, type: entity, label: Deal, required: true }
1215
1212
  executor: is-agent
1216
1213
  status: active
1217
- requiredIntents: [enrich_entity, search_external, list_records]
1214
+ tools: [enrich_entity, search_external, list_records, send_message]
1218
1215
  expectedOutputs:
1219
1216
  - { kind: person, label: Decision maker, relationToSubject: linked_to_deal }
1220
1217
  - { kind: document, label: Proposal }
@@ -1350,7 +1347,7 @@ playbooks:
1350
1347
  - { name: pool, type: choice, label: Where to look, options: [public, network], defaultValue: public }
1351
1348
  executor: is-agent
1352
1349
  status: active
1353
- requiredIntents: [search_external]
1350
+ tools: [search_external]
1354
1351
  stages:
1355
1352
  - key: read
1356
1353
  name: Read the foundation
@@ -1440,7 +1437,7 @@ playbooks:
1440
1437
  - { name: rescoreAfterDays, type: number, label: Rescore leads scored more than this many days ago, defaultValue: 30 }
1441
1438
  executor: is-agent
1442
1439
  status: active
1443
- requiredIntents: [search_external]
1440
+ tools: [search_external]
1444
1441
  stages:
1445
1442
  - key: read
1446
1443
  name: Read the list
@@ -1518,7 +1515,7 @@ playbooks:
1518
1515
  them through the entity door with only their own fields, such as name,
1519
1516
  role and LinkedIn URL, never the company's website, domain or email),
1520
1517
  text = the message, and provider linkedin or email. Read their channel
1521
- first (synap_get_channel, mode person) for what was already said. The
1518
+ first (channel.resolve, then feed.read) for what was already said. The
1522
1519
  pod files it for a person to review in that channel; it goes out only
1523
1520
  once they approve it. Never call a tool's own send verb (Unipile,
1524
1521
  Gmail), never create an outreach touch, a note or a task holding the
@@ -1554,7 +1551,7 @@ playbooks:
1554
1551
  proposed message, so it is an outbound message in the channel), set
1555
1552
  its lead's lastContactedAt to the sent day, count the messages sent to
1556
1553
  the lead (the outbound messages in its channels, read with
1557
- synap_get_channel mode person: for a company lead, the channels of the
1554
+ channel.resolve and feed.read: for a company lead, the channels of the
1558
1555
  person written to there), and set the lead's next action: after the
1559
1556
  first message, nextAction "Follow up with <name> if no reply" and
1560
1557
  nextActionAt the sent day + 3 days; after the first follow-up,
@@ -1588,7 +1585,7 @@ playbooks:
1588
1585
  guidance:
1589
1586
  - { ref: "kind:brand-voice-guide", label: Voice, where: { voice-context: [general, outreach] } }
1590
1587
  - { ref: "kind:outreach-angle", label: By kind of lead }
1591
- grants: [entity.create]
1588
+ tools: [messaging.send, channel.resolve, feed.read, linkedin_find_profile, linkedin_send_invite, entity.create]
1592
1589
  stages:
1593
1590
  - key: draft
1594
1591
  name: Draft the first message
@@ -1666,7 +1663,7 @@ playbooks:
1666
1663
  - { name: person, type: entity, label: Person, required: true }
1667
1664
  executor: is-agent
1668
1665
  status: active
1669
- requiredIntents: [enrich_entity]
1666
+ tools: [enrich_entity, unipile_list_accounts]
1670
1667
  stages:
1671
1668
  - key: find
1672
1669
  name: Find the profile
@@ -1763,8 +1760,7 @@ playbooks:
1763
1760
  - { name: audience, type: entity, label: Audience (ICP) the company came from }
1764
1761
  executor: is-agent
1765
1762
  status: active
1766
- requiredIntents: [find_people, enrich_entity]
1767
- grants: [entity.create]
1763
+ tools: [find_people, enrich_entity, web.read, unipile_list_accounts, entity.create]
1768
1764
  stages:
1769
1765
  - key: read
1770
1766
  name: Read the company and the roles
@@ -1837,7 +1833,7 @@ playbooks:
1837
1833
  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.
1838
1834
  goalTemplate: >-
1839
1835
  Follow up on the leads in outreach. For each, read its channels
1840
- (synap_get_channel, mode person: for a company lead, the channels of
1836
+ (channel.resolve and feed.read: for a company lead, the channels of
1841
1837
  the person who decides there) and its notes. A REPLY is an inbound
1842
1838
  message after our last outbound one in a channel. With a reply, draft
1843
1839
  nothing: summarise it for a person; when they show interest, propose
@@ -1865,7 +1861,7 @@ playbooks:
1865
1861
  with only their own fields, such as name, role and LinkedIn URL, never
1866
1862
  the company's website, domain or email), text = the message, and
1867
1863
  provider linkedin or email. Read their channel first
1868
- (synap_get_channel, mode person) for what was already said. The pod
1864
+ (channel.resolve, then feed.read) for what was already said. The pod
1869
1865
  files it for a person to review in that channel; it goes out only once
1870
1866
  they approve it. Never call a tool's own send verb (Unipile, Gmail),
1871
1867
  never create an outreach touch, a note or a task holding the message,
@@ -1898,7 +1894,7 @@ playbooks:
1898
1894
  approved its proposed message, so it is an outbound message in the
1899
1895
  channel), set its lead's lastContactedAt to the sent day, count the
1900
1896
  messages sent to the lead (the outbound messages in its channels, read
1901
- with synap_get_channel mode person: for a company lead, the channels of
1897
+ with channel.resolve and feed.read: for a company lead, the channels of
1902
1898
  the person written to there), and set the lead's next action: after
1903
1899
  the first message, nextAction "Follow up with <name> if no reply" and
1904
1900
  nextActionAt the sent day + 3 days; after the first follow-up,
@@ -1919,6 +1915,7 @@ playbooks:
1919
1915
  - { on: schedule, cron: "0 7 * * 1-5", status: outreach, mode: propose }
1920
1916
  - { on: manual, mode: propose }
1921
1917
  executor: is-agent
1918
+ tools: [messaging.send, channel.resolve, feed.read, linkedin_find_profile, linkedin_send_invite]
1922
1919
  status: active
1923
1920
  # The rules it writes by (design b199a3a4, backend#924): every run renders
1924
1921
  # the CURRENT, person-approved versions under "Rules this playbook
@@ -1995,7 +1992,7 @@ playbooks:
1995
1992
  is not in the pod, create them through the entity door with only their
1996
1993
  own fields, such as name, role and LinkedIn URL, never the company's
1997
1994
  website, domain or email), text = the message, and provider linkedin
1998
- or email. Read their channel first (synap_get_channel, mode person) for
1995
+ or email. Read their channel first (channel.resolve, then feed.read) for
1999
1996
  what was already said. The pod files it for a person to review in that
2000
1997
  channel; it goes out only once they approve it. Never call a tool's own
2001
1998
  send verb (Unipile, Gmail), never create an outreach touch, a note or a
@@ -2030,7 +2027,7 @@ playbooks:
2030
2027
  person approved its proposed message, so it is an outbound message in
2031
2028
  the channel), set its lead's lastContactedAt to the sent day, count
2032
2029
  the messages sent to the lead (the outbound messages in its channels,
2033
- read with synap_get_channel mode person: for a company lead, the
2030
+ read with channel.resolve and feed.read: for a company lead, the
2034
2031
  channels of the person written to there), and set the lead's next
2035
2032
  action: after the first message, nextAction "Follow up with <name> if
2036
2033
  no reply" and nextActionAt the sent day + 3 days; after the first
@@ -2067,8 +2064,7 @@ playbooks:
2067
2064
  guidance:
2068
2065
  - { ref: "kind:brand-voice-guide", label: Voice, where: { voice-context: [general, outreach] } }
2069
2066
  - { ref: "kind:outreach-angle", label: By kind of lead }
2070
- requiredIntents: [find_people, enrich_entity]
2071
- grants: [entity.create]
2067
+ tools: [find_people, enrich_entity, messaging.send, channel.resolve, feed.read, linkedin_send_invite, entity.create]
2072
2068
  expectedOutputs:
2073
2069
  # Proposed messages on the members' channels (see "Draft a first message").
2074
2070
  - { kind: messaging, label: Proposed first messages, relationToSubject: none }
@@ -2164,6 +2160,7 @@ playbooks:
2164
2160
  params:
2165
2161
  - { name: touch, type: entity, label: Outreach message, required: true }
2166
2162
  executor: is-agent
2163
+ tools: [channel.resolve, feed.read]
2167
2164
  status: active
2168
2165
  stages:
2169
2166
  - key: wait
@@ -2235,7 +2232,7 @@ playbooks:
2235
2232
  - { name: formAnswers, type: text, label: What they wrote in the website form (empty for outbound), default: "" }
2236
2233
  executor: is-agent
2237
2234
  status: active
2238
- requiredIntents: [search_external]
2235
+ tools: [search_external]
2239
2236
  stages:
2240
2237
  - key: research
2241
2238
  name: Research
@@ -2285,7 +2282,8 @@ playbooks:
2285
2282
  # communication page or in the pod. A draft of something that already has a
2286
2283
  # current version is a NEW record that `revises` it, never an edit of it.
2287
2284
  # No subject and no activator: the person starts it, as "Propose a Health
2288
- # cell". grants entity.create: it creates the draft records.
2285
+ # cell". tools: entity.create creates the draft records; channel.resolve
2286
+ # and feed.read read the sent messages.
2289
2287
  - name: Propose my rules from my sent messages
2290
2288
  description: Propose the first rules your drafts follow, the voice (say, don't say) and what to lead with by kind of lead, from the rules your drafters held until now and the messages you sent; they stay drafts until you make them current.
2291
2289
  goalTemplate: >-
@@ -2294,7 +2292,7 @@ playbooks:
2294
2292
  (synap_get_entities profileSlug brand-voice-guide) and By kind of lead
2295
2293
  rows (profileSlug outreach-angle), the audiences and offers, and the
2296
2294
  messages already sent: for the leads with a lastContactedAt, newest
2297
- first, at most 20, their channels (synap_get_channel, mode person) and
2295
+ first, at most 20, their channels (channel.resolve, then feed.read) and
2298
2296
  the outbound messages they show. SEED: the drafters' rules until now,
2299
2297
  word for word: "Its message is personal: it cites the buying signal and
2300
2298
  what it showed, or a past exchange, never a generic template; short; in
@@ -2318,7 +2316,7 @@ playbooks:
2318
2316
  FINISH: list each draft with the messages it came from.
2319
2317
  executor: is-agent
2320
2318
  status: active
2321
- grants: [entity.create]
2319
+ tools: [channel.resolve, feed.read, entity.create]
2322
2320
  expectedOutputs:
2323
2321
  - { kind: brand-voice-guide, label: Draft outreach voice, relationToSubject: none }
2324
2322
  - { kind: outreach-angle, label: "Draft \"By kind of lead\" rows", relationToSubject: none }
@@ -370,10 +370,7 @@ playbooks:
370
370
  # competitor. Disabled by default so installing the workspace never silently
371
371
  # starts paid AI runs — the user turns it on when they want the watch.
372
372
  schedule: { cron: "0 9 * * 1", enabled: false }
373
- grants:
374
- - exa_search
375
- - apify_run_actor
376
- - entity.create
373
+ tools: [update_entity, exa_search, apify_run_actor, entity.create]
377
374
  status: active
378
375
 
379
376
  # A radar DISCOVERY run: the self-generating half. No subjectProfile → a single
@@ -401,9 +398,7 @@ playbooks:
401
398
  required: true,
402
399
  }
403
400
  executor: is-agent
404
- grants:
405
- - exa_search
406
- - entity.create
401
+ tools: [exa_search, entity.create]
407
402
  status: active
408
403
 
409
404
  # Exa powers the discovery radar (find companies we don't track yet); Apify
package/src/finance.yaml CHANGED
@@ -597,7 +597,7 @@ playbooks:
597
597
  - { name: invoice, type: entity, label: Invoice, required: true }
598
598
  executor: is-agent
599
599
  status: active
600
- requiredIntents: [fetch_record, list_records, send_message]
600
+ tools: [fetch_record, list_records, send_message]
601
601
  expectedOutputs:
602
602
  - { kind: document, label: Invoice sent to the client }
603
603
  stages:
@@ -680,7 +680,7 @@ playbooks:
680
680
  metadata:
681
681
  governance:
682
682
  forceProposeWrites: true
683
- requiredIntents: [list_records]
683
+ tools: [create_entity, create_relation, list_records]
684
684
  expectedOutputs:
685
685
  - { kind: invoice, label: This month's invoice, relationToSubject: relates_to }
686
686
 
@@ -749,7 +749,7 @@ playbooks:
749
749
  executor: is-agent
750
750
  status: active
751
751
  schedule: { cron: "0 9 1 * *", enabled: false, mode: appointment }
752
- requiredIntents: [fetch_record, list_records]
752
+ tools: [fetch_record, list_records]
753
753
  expectedOutputs:
754
754
  - { kind: financial-metric, label: Month-end metrics, relationToSubject: none }
755
755
  - { kind: document, label: Month-end note, relationToSubject: none }