@synap-core/workspace-templates 0.40.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.40.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 }
@@ -91,9 +92,12 @@ playbooks:
91
92
  REVIEW: list deals with no next step, engagements with a deliverable past
92
93
  due, invoices overdue, campaigns past their end date without a report,
93
94
  and expenses waiting for approval — each with the one action that would
94
- move it. PLAN: ask the person to `choose` next week's three priorities,
95
- your recommendation first; that answer is the plan. Create a task for
96
- each priority they choose.
95
+ move it — and end your answer with the three priorities you recommend
96
+ for next week, most important first. Stop there: the pod then asks the
97
+ person to pick next week's priorities and wakes you with their answer.
98
+ PLAN: with their answer, create a task for each priority they picked
99
+ (the three you recommended, or the ones they wrote instead); none when
100
+ they want no new priorities.
97
101
  executor: is-agent
98
102
  status: active
99
103
  schedule: { cron: "0 16 * * 5", enabled: false, mode: appointment }
@@ -111,12 +115,23 @@ playbooks:
111
115
  - key: review
112
116
  name: Review
113
117
  category: started
114
- goal: List stuck deals, late deliverables, overdue invoices, unreported campaigns and pending expenses, each with one action.
118
+ goal: List stuck deals, late deliverables, overdue invoices, unreported campaigns and pending expenses, each with one action, and end with the three priorities you recommend for next week.
115
119
  criteria:
116
120
  - key: review-every-area
117
121
  statement: Deals, engagements, invoices, campaigns and expenses were each checked, or the review says the space is not installed.
118
122
  check: { kind: judge }
123
+ # Raised by the pod when the turn ends this stage (plan 08e4fba7
124
+ # decision 5): a run has no ask tool. The answer wakes the run at Plan.
125
+ endAsk:
126
+ label: Next week's priorities
127
+ why: The review above ends with the three priorities the run recommends for next week.
128
+ unblocks: The run creates a task for each priority
129
+ ask:
130
+ mode: choose
131
+ options:
132
+ - { label: The three recommended, value: recommended, recommended: true, description: A task is created for each }
133
+ - { label: No new priorities this week, value: none, description: Nothing is created }
119
134
  - key: plan
120
135
  name: Plan
121
136
  category: completed
122
- goal: Ask the person to choose next week's three priorities, your recommendation first; create a task for each.
137
+ goal: Create a task for each priority the person picked (the three recommended, or the ones they wrote); none when they want no new priorities.
@@ -1180,10 +1180,11 @@ playbooks:
1180
1180
  references and the active token set; never a draft — and load the
1181
1181
  creative-director skill to pick the recipe. Make the draft (or up to
1182
1182
  three variants, each its own asset derived from this one) and record the
1183
- generator, prompt and parameters on it. APPROVE: a person approves one
1184
- draft as final; with variants, the approval asks them to `choose` one,
1185
- your recommendation first, and that choice is the approval. Until then
1186
- nothing may use it.
1183
+ generator, prompt and parameters on it. Stop there: with variants, the
1184
+ pod asks the person which one to keep and wakes you with their choice
1185
+ (its id is in the answer); when they want none, draft again. APPROVE: a
1186
+ person approves one draft as final (with variants, the one they kept).
1187
+ Until then nothing may use it.
1187
1188
  Deprecating an asset is a person's call.
1188
1189
  subjectProfile:
1189
1190
  profileSlug: brand-asset
@@ -1191,7 +1192,7 @@ playbooks:
1191
1192
  - { name: asset, type: entity, label: Brand asset, required: true }
1192
1193
  executor: is-agent
1193
1194
  status: active
1194
- requiredIntents: [generate_media]
1195
+ tools: [generate_media]
1195
1196
  expectedOutputs:
1196
1197
  - { kind: brand-asset, label: Variants, relationToSubject: derived_from }
1197
1198
  stages:
@@ -1207,11 +1208,23 @@ playbooks:
1207
1208
  - key: asset-provenance
1208
1209
  statement: The asset records its generator, prompt and parameters, or says it was made by hand.
1209
1210
  check: { kind: judge }
1211
+ # Raised by the pod when the turn ends this stage (plan 08e4fba7
1212
+ # decision 5), with the variants derived from this asset as the
1213
+ # options; a single draft (no variant) asks nothing.
1214
+ endAsk:
1215
+ label: Variant to keep
1216
+ why: The run made several variants of this asset.
1217
+ unblocks: The variant you keep goes to approval
1218
+ ask:
1219
+ mode: choose
1220
+ options:
1221
+ - { label: "None of them: draft again", value: redo, description: The run makes new variants }
1222
+ optionsFrom: { relation: derived_from }
1210
1223
  - key: approve
1211
1224
  name: Approve
1212
1225
  category: completed
1213
1226
  subjectStatus: approved
1214
- goal: A person approves one draft as final; with variants, they choose one, recommended first.
1227
+ goal: A person approves one draft as final; with variants, the one they kept.
1215
1228
  gate: { kind: human }
1216
1229
  onFail: { toStage: draft }
1217
1230
 
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