@synap-core/workspace-templates 0.62.0 → 0.64.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/README.md +1 -1
- package/capabilities/design.capability.json +19 -1
- package/dist/{define-KudS9Ja_.d.ts → define-gpV3Inzh.d.ts} +16 -16
- package/dist/index.d.ts +2 -2
- package/dist/index.js +149 -37
- package/dist/index.js.map +1 -1
- package/dist/wire.d.ts +1 -1
- package/package.json +1 -1
- package/src/agency-os.yaml +2 -1
- package/src/content-os.campaigns.template.test.ts +127 -0
- package/src/content-os.template.test.ts +6 -7
- package/src/content-os.yaml +159 -48
- package/src/crm.yaml +2 -3
- package/src/decisions-wave.template.test.ts +4 -3
- package/src/ecosystem.yaml +8 -6
- package/src/finance.yaml +7 -7
- package/src/process-contract.validate.test.ts +14 -1
- package/src/templates.ts +138 -33
- package/src/types.ts +16 -16
- package/src/validate.ts +12 -4
package/src/templates.ts
CHANGED
|
@@ -123,11 +123,14 @@ const DATA = {
|
|
|
123
123
|
"goalTemplate": "Run the weekly review. COLLECT: list everything captured this week that was never clarified, every question waiting on a person, and every session still open. CLARIFY: propose what each unclarified capture is. REVIEW: list deals with no next step, engagements with a deliverable past due, invoices overdue, campaigns past their end date without a report, and expenses waiting for approval — each with the one action that would move it — and end your answer with the three priorities you recommend for next week, most important first. Stop there: the pod then asks the person to pick next week's priorities and wakes you with their answer. PLAN: with their answer, create a task for each priority they picked (the three you recommended, or the ones they wrote instead); none when they want no new priorities.",
|
|
124
124
|
"executor": "is-agent",
|
|
125
125
|
"status": "active",
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
"activators": [
|
|
127
|
+
{
|
|
128
|
+
"on": "schedule",
|
|
129
|
+
"cron": "0 16 * * 5",
|
|
130
|
+
"mode": "appointment",
|
|
131
|
+
"startsPaused": true
|
|
132
|
+
}
|
|
133
|
+
],
|
|
131
134
|
"expectedOutputs": [
|
|
132
135
|
{
|
|
133
136
|
"kind": "task",
|
|
@@ -10640,6 +10643,13 @@ const DATA = {
|
|
|
10640
10643
|
"targetProfileSlug": "pillar",
|
|
10641
10644
|
"inputType": "entity_select"
|
|
10642
10645
|
},
|
|
10646
|
+
{
|
|
10647
|
+
"slug": "idea-campaign",
|
|
10648
|
+
"label": "Campaign",
|
|
10649
|
+
"valueType": "entity_id",
|
|
10650
|
+
"targetProfileSlug": "campaign",
|
|
10651
|
+
"inputType": "entity_select"
|
|
10652
|
+
},
|
|
10643
10653
|
{
|
|
10644
10654
|
"slug": "idea-stage",
|
|
10645
10655
|
"label": "Journey Stage",
|
|
@@ -11786,6 +11796,13 @@ const DATA = {
|
|
|
11786
11796
|
"video-capture",
|
|
11787
11797
|
"carousel"
|
|
11788
11798
|
]
|
|
11799
|
+
},
|
|
11800
|
+
{
|
|
11801
|
+
"slug": "composition-campaign",
|
|
11802
|
+
"label": "Campaign",
|
|
11803
|
+
"valueType": "entity_id",
|
|
11804
|
+
"targetProfileSlug": "campaign",
|
|
11805
|
+
"inputType": "entity_select"
|
|
11789
11806
|
}
|
|
11790
11807
|
]
|
|
11791
11808
|
},
|
|
@@ -12458,6 +12475,18 @@ const DATA = {
|
|
|
12458
12475
|
"type": "belongs_to_pillar",
|
|
12459
12476
|
"label": "Pillar"
|
|
12460
12477
|
},
|
|
12478
|
+
{
|
|
12479
|
+
"sourceProfileSlug": "idea",
|
|
12480
|
+
"targetProfileSlug": "campaign",
|
|
12481
|
+
"type": "part_of_campaign",
|
|
12482
|
+
"label": "Campaign"
|
|
12483
|
+
},
|
|
12484
|
+
{
|
|
12485
|
+
"sourceProfileSlug": "content-composition",
|
|
12486
|
+
"targetProfileSlug": "campaign",
|
|
12487
|
+
"type": "part_of_campaign",
|
|
12488
|
+
"label": "Campaign"
|
|
12489
|
+
},
|
|
12461
12490
|
{
|
|
12462
12491
|
"sourceProfileSlug": "content-composition",
|
|
12463
12492
|
"targetProfileSlug": "post",
|
|
@@ -12918,9 +12947,9 @@ const DATA = {
|
|
|
12918
12947
|
{
|
|
12919
12948
|
"name": "Plan Next Content",
|
|
12920
12949
|
"description": "Audit the whole corpus against the journey, find the gap, propose what to make next, and propose dates for the posts that have none or whose date has passed.",
|
|
12921
|
-
"goalTemplate": "
|
|
12950
|
+
"goalTemplate": "Plan the next content. THREE RULES FIRST (founder, 9 Nov 2026): (A) Only POSTS are planned. A recording, a free take, a composition or a board is raw material that posts are made FROM; never give one a slot or a date, and never treat a post that is only a take (tag source:take, no finished cut) as publishable. (B) The rhythm is the campaign's: which days it publishes and what each day carries (for example one produced video plus one companion carousel on the same idea) are written on the campaign (its notes or its plan document), never in this text. When the rhythm pairs formats, a companion never goes out alone: if a day has no finished lead piece, propose the piece to make (its idea, hook and format), not a lone companion. (C) You change nothing yourself: every new date, swap or move is filed as a proposal for the person (a capture or a proposed update), never applied directly, so never apply a date yourself; your final message must say exactly what is applied and what is proposed, read back from the records. WHICH CAMPAIGN: when this run has a subject, it is the campaign to plan, and you plan THAT campaign only: its dates (campaign-start-date, campaign-end-date), its goal, its audience, its notes and its plan document, its ideas (idea-campaign), its pieces (composition-campaign) and its posts (post-campaign). With no subject, plan every active campaign whose dates cover the coming weeks, each on its own rhythm; when none is active, plan without one and say so. Read the campaign's plan document first: its BACKBONE is the fixed series of slots and its BANK is every post at Idea or Briefed that has no slot yet, with the campaign's ideas and pieces (ideas from interviews, notes, news). Audit the corpus: map every post onto its pillar and its journey stage, list the pillar × stage cells that are empty or thin, and check the running series for the missing chapter. Then place the flow: for each bank idea, decide where it goes and say why: (1) TIMELY (news, a release, something people talk about this week): the next free day, or replace the backbone slot whose topic it covers better; (2) FITS THIS WEEK'S STAGE (the journey's stages in their order): swap it with the backbone slot of the same stage; (3) otherwise it waits in the bank. A displaced slot moves later, never silently dropped. Propose the coming week's days on the campaign's rhythm, with the reason for each (new pieces as post entities at Idea with their post-campaign set, existing ones as proposed date changes); the person decides every swap. When the campaign states no rhythm, follow each publishing account's cadence (platform-posting-freq on its platform) and each pillar's target (posting-frequency on the pillar). Keep a campaign's posts inside its dates, never put two posts of one account on the same day, never move a Published or Archived post, and never change a post's status. If the pod has offers, note which ones no content teaches toward; if it has none, plan purely for audience-building and do not invent commerce. When an input is missing (no rhythm, no cadence, no plan document), say which one in the run's summary and plan without it. Say \"agent\", never \"AI\".",
|
|
12922
12951
|
"subjectProfile": {
|
|
12923
|
-
"profileSlug": "
|
|
12952
|
+
"profileSlug": "campaign"
|
|
12924
12953
|
},
|
|
12925
12954
|
"activators": [
|
|
12926
12955
|
{
|
|
@@ -12934,6 +12963,63 @@ const DATA = {
|
|
|
12934
12963
|
"mode": "propose"
|
|
12935
12964
|
}
|
|
12936
12965
|
],
|
|
12966
|
+
"stages": [
|
|
12967
|
+
{
|
|
12968
|
+
"key": "read",
|
|
12969
|
+
"name": "Read the calendar and the corpus",
|
|
12970
|
+
"category": "started",
|
|
12971
|
+
"tier": "quick",
|
|
12972
|
+
"goal": "Read the campaign (the run's subject, else every active campaign): its plan document (backbone and bank), its rhythm, its ideas and its pieces, and list the posts with their status, pillar, stage, campaign and date. Read by id; write a short summary in the room and do not re-read it later."
|
|
12973
|
+
},
|
|
12974
|
+
{
|
|
12975
|
+
"key": "audit",
|
|
12976
|
+
"name": "Audit pillar x stage",
|
|
12977
|
+
"category": "started",
|
|
12978
|
+
"tier": "deep",
|
|
12979
|
+
"goal": "Map every post onto its pillar and journey stage, list empty or thin cells, name the missing chapter of the running series, and note offers no content teaches toward (or say there are none). Write the result in the room."
|
|
12980
|
+
},
|
|
12981
|
+
{
|
|
12982
|
+
"key": "place",
|
|
12983
|
+
"name": "Place the bank and the week",
|
|
12984
|
+
"category": "started",
|
|
12985
|
+
"tier": "deep",
|
|
12986
|
+
"goal": "For each bank idea decide timely / fits this week's stage / waits, with the reason. Propose the coming week's days on the campaign's rhythm. Every date change or swap is filed as a proposal; never apply it."
|
|
12987
|
+
},
|
|
12988
|
+
{
|
|
12989
|
+
"key": "file",
|
|
12990
|
+
"name": "File the plan and the next post idea",
|
|
12991
|
+
"category": "completed",
|
|
12992
|
+
"tier": "quick",
|
|
12993
|
+
"goal": "Create the plan document and the Next post idea (status Idea, no date), record both on the session, and post one message that says what is applied and what is proposed, read back from the records."
|
|
12994
|
+
}
|
|
12995
|
+
],
|
|
12996
|
+
"criteria": [
|
|
12997
|
+
{
|
|
12998
|
+
"key": "nothing-applied-directly",
|
|
12999
|
+
"statement": "No post date or status was changed directly: every date change is a pending proposal, and the final message says applied = none.",
|
|
13000
|
+
"required": true,
|
|
13001
|
+
"check": {
|
|
13002
|
+
"kind": "judge",
|
|
13003
|
+
"hint": "Compare the final message with the records' updatedAt."
|
|
13004
|
+
}
|
|
13005
|
+
},
|
|
13006
|
+
{
|
|
13007
|
+
"key": "rhythm-kept",
|
|
13008
|
+
"statement": "Each proposed publishing day follows the campaign's rhythm; when the rhythm pairs formats, no companion goes out alone, and no take, composition or board is given a date.",
|
|
13009
|
+
"required": true,
|
|
13010
|
+
"check": {
|
|
13011
|
+
"kind": "judge"
|
|
13012
|
+
}
|
|
13013
|
+
},
|
|
13014
|
+
{
|
|
13015
|
+
"key": "outputs-filed",
|
|
13016
|
+
"statement": "The Next post idea and the plan document are recorded on the session before it ends, within one run's turns and without a 'Keep the run going' ask.",
|
|
13017
|
+
"required": true,
|
|
13018
|
+
"check": {
|
|
13019
|
+
"kind": "judge"
|
|
13020
|
+
}
|
|
13021
|
+
}
|
|
13022
|
+
],
|
|
12937
13023
|
"expectedOutputs": [
|
|
12938
13024
|
{
|
|
12939
13025
|
"kind": "post",
|
|
@@ -13336,7 +13422,7 @@ const DATA = {
|
|
|
13336
13422
|
{
|
|
13337
13423
|
"name": "Derive outputs",
|
|
13338
13424
|
"description": "Make posts from a piece, spread over two weeks on the accounts you pick (several per account, never two on one account the same day), each linked to the piece, and optionally a newsletter issue.",
|
|
13339
|
-
"goalTemplate": "Derive outputs from this piece ({piece}). Read the piece's body (its document) first. Then create {posts} posts (six when that is empty), each a `post` at Idea (post-status Idea), linked derived_from the piece. Accounts: {accounts} (each a platform entity's id and name; when empty, ask the person which accounts, offering first those whose default-project-id is a project the piece is filed in). Give each post its account (post-account, the platform's id) and a publish-date, spread over the two weeks starting {from} (today when it is empty): several posts per account, never two posts on one account the same day, and skip any day an account already has a post (read that account's posts first). Each post gets its own post-hook and its own text (in `content`), taken from the piece's own words, cut and shaped for the account's platform; never a claim the piece does not make, and no two posts with the same angle. Set post-platform from the account's platform-type. Optionally, when the piece reads as one, add ONE newsletter issue at Idea (newsletter-status Idea) linked derived_from the piece. Create each post and the issue (create_entity), then link each one derived_from the piece (create_relation); each write is a proposal the person approves. The piece's own status is not moved by this run. Nothing is scheduled or published.",
|
|
13425
|
+
"goalTemplate": "Derive outputs from this piece ({piece}). Read the piece's body (its document) first. Then create {posts} posts (six when that is empty), each a `post` at Idea (post-status Idea), linked derived_from the piece. Accounts: {accounts} (each a platform entity's id and name; when empty, ask the person which accounts, offering first those whose default-project-id is a project the piece is filed in). Give each post its account (post-account, the platform's id) and a publish-date, spread over the two weeks starting {from} (today when it is empty): several posts per account, never two posts on one account the same day, and skip any day an account already has a post (read that account's posts first). Each post gets its own post-hook and its own text (in `content`), taken from the piece's own words, cut and shaped for the account's platform; never a claim the piece does not make, and no two posts with the same angle. Set post-platform from the account's platform-type. When the piece has a campaign (composition-campaign), give each post that campaign (post-campaign). Optionally, when the piece reads as one, add ONE newsletter issue at Idea (newsletter-status Idea, and its newsletter-campaign when the piece has one) linked derived_from the piece. Create each post and the issue (create_entity), then link each one derived_from the piece (create_relation); each write is a proposal the person approves. The piece's own status is not moved by this run. Nothing is scheduled or published.",
|
|
13340
13426
|
"subjectProfile": {
|
|
13341
13427
|
"profileSlug": "content-composition"
|
|
13342
13428
|
},
|
|
@@ -13394,10 +13480,10 @@ const DATA = {
|
|
|
13394
13480
|
{
|
|
13395
13481
|
"key": "content-os-weekly-produce",
|
|
13396
13482
|
"name": "Weekly content production",
|
|
13397
|
-
"description": "
|
|
13483
|
+
"description": "Tuesday 09:00. Runs Produce Content once, with no subject. The playbook takes the first eligible pinned post, or the oldest post still in Idea when the pin list has nobody eligible. Shipped paused because Content OS is public: an active cron would spend a run for every installer. Turn it on to start the cycle. Produce Content's own schedule stays off.\n",
|
|
13398
13484
|
"triggerType": "cron",
|
|
13399
13485
|
"triggerConfig": {
|
|
13400
|
-
"expression": "0 9 * *
|
|
13486
|
+
"expression": "0 9 * * 2"
|
|
13401
13487
|
},
|
|
13402
13488
|
"status": "paused",
|
|
13403
13489
|
"flow": {
|
|
@@ -13410,10 +13496,10 @@ const DATA = {
|
|
|
13410
13496
|
"y": 0
|
|
13411
13497
|
},
|
|
13412
13498
|
"data": {
|
|
13413
|
-
"label": "
|
|
13499
|
+
"label": "Tuesday at 09:00",
|
|
13414
13500
|
"triggerType": "cron",
|
|
13415
13501
|
"config": {
|
|
13416
|
-
"expression": "0 9 * *
|
|
13502
|
+
"expression": "0 9 * * 2"
|
|
13417
13503
|
}
|
|
13418
13504
|
}
|
|
13419
13505
|
},
|
|
@@ -15364,10 +15450,13 @@ const DATA = {
|
|
|
15364
15450
|
"name": "CRM Hygiene",
|
|
15365
15451
|
"description": "Always-on maintenance — enriches stale contacts/companies and flags stalled deals. Every change is proposed for your review, never auto-applied.",
|
|
15366
15452
|
"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.",
|
|
15367
|
-
"
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
|
|
15453
|
+
"activators": [
|
|
15454
|
+
{
|
|
15455
|
+
"on": "schedule",
|
|
15456
|
+
"cron": "0 8 * * *",
|
|
15457
|
+
"mode": "run"
|
|
15458
|
+
}
|
|
15459
|
+
],
|
|
15371
15460
|
"metadata": {
|
|
15372
15461
|
"governance": {
|
|
15373
15462
|
"forceProposeWrites": true
|
|
@@ -17449,10 +17538,15 @@ const DATA = {
|
|
|
17449
17538
|
}
|
|
17450
17539
|
],
|
|
17451
17540
|
"executor": "is-agent",
|
|
17452
|
-
"
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
|
|
17541
|
+
"activators": [
|
|
17542
|
+
{
|
|
17543
|
+
"on": "schedule",
|
|
17544
|
+
"cron": "0 9 * * 1",
|
|
17545
|
+
"size": "per_thing",
|
|
17546
|
+
"mode": "run",
|
|
17547
|
+
"startsPaused": true
|
|
17548
|
+
}
|
|
17549
|
+
],
|
|
17456
17550
|
"tools": [
|
|
17457
17551
|
"update_entity",
|
|
17458
17552
|
"exa_search",
|
|
@@ -17465,10 +17559,14 @@ const DATA = {
|
|
|
17465
17559
|
"name": "Discover Competitors",
|
|
17466
17560
|
"description": "Scan the market for competitors we don't track yet and add them to the ecosystem — the self-generating half of the radar.",
|
|
17467
17561
|
"goalTemplate": "Find companies that compete with us in {ourSpace}. Fan out neural web searches with the exa_search skill using category \"company\" — cover direct competitors, adjacent tools that solve the same job a different way, and emerging players, not just the obvious incumbents. For each genuinely NEW one (not already a competitor in our ecosystem), propose it as a `competitor` entity and ALWAYS include its `website` (its canonical URL) as the dedup key — never create a company whose website already matches one we track. Skip anything already known. Report what you added, the search angles you covered, and why each new one matters.",
|
|
17468
|
-
"
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17562
|
+
"activators": [
|
|
17563
|
+
{
|
|
17564
|
+
"on": "schedule",
|
|
17565
|
+
"cron": "0 9 * * 1",
|
|
17566
|
+
"mode": "run",
|
|
17567
|
+
"startsPaused": true
|
|
17568
|
+
}
|
|
17569
|
+
],
|
|
17472
17570
|
"params": [
|
|
17473
17571
|
{
|
|
17474
17572
|
"name": "ourSpace",
|
|
@@ -18778,10 +18876,14 @@ const DATA = {
|
|
|
18778
18876
|
],
|
|
18779
18877
|
"executor": "is-agent",
|
|
18780
18878
|
"status": "active",
|
|
18781
|
-
"
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18879
|
+
"activators": [
|
|
18880
|
+
{
|
|
18881
|
+
"on": "schedule",
|
|
18882
|
+
"cron": "0 8 1 * *",
|
|
18883
|
+
"size": "per_thing",
|
|
18884
|
+
"mode": "run"
|
|
18885
|
+
}
|
|
18886
|
+
],
|
|
18785
18887
|
"metadata": {
|
|
18786
18888
|
"governance": {
|
|
18787
18889
|
"forceProposeWrites": true
|
|
@@ -18881,11 +18983,14 @@ const DATA = {
|
|
|
18881
18983
|
"goalTemplate": "Close the month. RECONCILE: compare each account's balance with the bank or payment provider and list every difference, and every account with no bank or payment-provider connection. Stop there: the pod asks the person whether to go on or to connect those accounts first (a connection, never a password in a form) and wakes you with their answer; when they connected them, reconcile those accounts again. RECEIVABLES: list unpaid and overdue invoices and propose a reminder for each overdue one. PAYABLES: list expenses still pending or approved but unpaid. METRICS: record this month's cash in bank, net burn, runway in months and monthly recurring revenue as financial metrics, each with its as-of date and how it was computed. REVIEW: write a one-page month-end note for a person — what changed, what is at risk, what to decide — and wait for their approval before closing.",
|
|
18882
18984
|
"executor": "is-agent",
|
|
18883
18985
|
"status": "active",
|
|
18884
|
-
"
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18986
|
+
"activators": [
|
|
18987
|
+
{
|
|
18988
|
+
"on": "schedule",
|
|
18989
|
+
"cron": "0 9 1 * *",
|
|
18990
|
+
"mode": "appointment",
|
|
18991
|
+
"startsPaused": true
|
|
18992
|
+
}
|
|
18993
|
+
],
|
|
18889
18994
|
"tools": [
|
|
18890
18995
|
"fetch_record",
|
|
18891
18996
|
"list_records"
|
package/src/types.ts
CHANGED
|
@@ -559,11 +559,8 @@ export interface TemplatePlaybook {
|
|
|
559
559
|
aiReactionMode?: "on_mention" | "always" | "never";
|
|
560
560
|
};
|
|
561
561
|
/**
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
* `enabled` is read STRICTLY (`materializePlaybookCronAutomation` requires
|
|
565
|
-
* `enabled === true`) — omit it and the backing cron is NEVER created, so the
|
|
566
|
-
* playbook silently never fires. Always set it explicitly.
|
|
562
|
+
* RETIRED: declare a `schedule` activator instead. The pod still accepts it
|
|
563
|
+
* and folds it into one (`enabled: false` → `startsPaused`).
|
|
567
564
|
*/
|
|
568
565
|
schedule?: { cron: string; enabled: boolean } | null;
|
|
569
566
|
/**
|
|
@@ -597,11 +594,8 @@ export interface TemplatePlaybook {
|
|
|
597
594
|
subjectProfile?: {
|
|
598
595
|
profileSlug: string;
|
|
599
596
|
/**
|
|
600
|
-
* Narrows a
|
|
601
|
-
* `{ "properties.<key>": value }
|
|
602
|
-
* keeps only a string (`readSubjectProfile`, synap-backend
|
|
603
|
-
* cron-automation.ts) — an object would be dropped, and an unfiltered AI
|
|
604
|
-
* fan-out is refused, so the schedule would silently never be created.
|
|
597
|
+
* Narrows the set of a per_thing `schedule` activator: a JSON string of
|
|
598
|
+
* `{ "properties.<key>": value }` (the pod's query filter grammar).
|
|
605
599
|
*/
|
|
606
600
|
filter?: string;
|
|
607
601
|
};
|
|
@@ -767,19 +761,25 @@ export interface TemplateCriterion {
|
|
|
767
761
|
export interface TemplatePlaybookActivator {
|
|
768
762
|
/**
|
|
769
763
|
* `created` / `enters_status` per thing; `count` (≥ `min` things in
|
|
770
|
-
* `status`)
|
|
764
|
+
* `status`) over the whole set; `schedule` (on `cron`) over the set, once
|
|
765
|
+
* per thing (`per_thing`), or once per tick with no subject; `manual` a
|
|
771
766
|
* button that compiles no rule. The pod's grammar (`ACTIVATOR_ON`).
|
|
772
767
|
*/
|
|
773
768
|
on: "created" | "enters_status" | "count" | "schedule" | "manual";
|
|
774
|
-
/** Required for `enters_status` / `count`, optional for `schedule
|
|
775
|
-
status?: string;
|
|
776
|
-
/** Required for `schedule
|
|
769
|
+
/** Required for `enters_status` / `count`, optional for `schedule` (a list there): a value of the status property. */
|
|
770
|
+
status?: string | string[];
|
|
771
|
+
/** Required for `schedule`. */
|
|
777
772
|
cron?: string;
|
|
773
|
+
/** `schedule`: the IANA zone of `cron`; absent = the owner's zone. */
|
|
774
|
+
timezone?: string;
|
|
775
|
+
/** `schedule`: installed paused, a person turns it on. */
|
|
776
|
+
startsPaused?: true;
|
|
778
777
|
/** Required for `count`. */
|
|
779
778
|
min?: number;
|
|
780
|
-
/** `per_thing` (default) or `per_moment`; count
|
|
779
|
+
/** `per_thing` (default) or `per_moment`; count is per_moment, schedule defaults to it. */
|
|
781
780
|
size?: "per_thing" | "per_moment";
|
|
782
|
-
|
|
781
|
+
/** `appointment` (schedule only): each tick opens a session that waits for a person. */
|
|
782
|
+
mode: "run" | "propose" | "appointment";
|
|
783
783
|
/** Pending approvals before the worker stops starting runs (default 20). */
|
|
784
784
|
maxPendingApprovals?: number;
|
|
785
785
|
/** Per-thing `created` / `enters_status` only: leave out a thing that carries this property. */
|
package/src/validate.ts
CHANGED
|
@@ -681,6 +681,12 @@ function checkProcessContract(
|
|
|
681
681
|
`${at}.${field}`,
|
|
682
682
|
`playbook "${pb.name}" declares ${field} — retired: the process follows the kind's declared lifecycle (a person-only status is \`humanOnly\` on that lifecycle, a status no stage owns is derived, and a session end moves nothing)`
|
|
683
683
|
);
|
|
684
|
+
if (raw.schedule !== undefined && raw.schedule !== null)
|
|
685
|
+
add(
|
|
686
|
+
"playbook-field-retired",
|
|
687
|
+
`${at}.schedule`,
|
|
688
|
+
`playbook "${pb.name}" declares schedule — retired: declare a schedule activator ({ on: schedule, cron, mode }; enabled: false is startsPaused: true)`
|
|
689
|
+
);
|
|
684
690
|
|
|
685
691
|
// The lifecycle vocabulary: the kind's DECLARED lifecycle (null = none in
|
|
686
692
|
// reach to check against).
|
|
@@ -763,16 +769,18 @@ function checkProcessContract(
|
|
|
763
769
|
const ap = `${at}.activators[${i}]`;
|
|
764
770
|
if (!(TEMPLATE_ACTIVATOR_ON as readonly string[]).includes(a.on))
|
|
765
771
|
add("activator-on-invalid", `${ap}.on`, `${ap}.on "${String(a.on)}" must be one of ${TEMPLATE_ACTIVATOR_ON.join(", ")}`);
|
|
766
|
-
if (a.mode !== "run" && a.mode !== "propose")
|
|
767
|
-
add("activator-mode-invalid", `${ap}.mode`, `${ap}.mode "${String(a.mode)}" must be "run" or "
|
|
768
|
-
|
|
772
|
+
if (a.mode !== "run" && a.mode !== "propose" && a.mode !== "appointment")
|
|
773
|
+
add("activator-mode-invalid", `${ap}.mode`, `${ap}.mode "${String(a.mode)}" must be "run", "propose" or "appointment"`);
|
|
774
|
+
// A schedule may run with no subject: once per tick, over nothing.
|
|
775
|
+
if (!kind && a.on !== "schedule")
|
|
769
776
|
add("activator-no-subject", ap, `${ap} needs subjectProfile.profileSlug — an activator fires on an entity of that kind`);
|
|
770
777
|
if (a.on === "enters_status" || a.on === "count") {
|
|
771
778
|
if (a.status === undefined)
|
|
772
779
|
add("activator-status-required", `${ap}.status`, `${ap} on "${a.on}" names no status`);
|
|
773
780
|
else checkStatus("activator-status-unknown", `${ap}.status`, a.status);
|
|
774
781
|
} else if (a.on === "schedule") {
|
|
775
|
-
|
|
782
|
+
for (const st of a.status === undefined ? [] : typeof a.status === "string" ? [a.status] : a.status)
|
|
783
|
+
checkStatus("activator-status-unknown", `${ap}.status`, st);
|
|
776
784
|
} else if (a.status !== undefined) {
|
|
777
785
|
add("activator-status-unexpected", `${ap}.status`, `${ap}.status is not read when on = "${a.on}"`);
|
|
778
786
|
}
|