@listen-fire/handbook 0.15.2 → 0.16.1

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.
@@ -9,8 +9,8 @@
9
9
  "via": "lf catalog over a project connecting the real @lf/github module against its fake (modules/github/__test__/fake_github.ts): the whole github entry"
10
10
  },
11
11
  "slack": {
12
- "capturedAt": "2026-11-01",
13
- "via": "lf catalog over a project connecting the real @lf/slack module against fake-channels: the whole slack entry (the fake's workspace names its channels)"
12
+ "capturedAt": "2026-11-13",
13
+ "via": "lf catalog over a project connecting the real @lf/slack module against fake-channels: the whole slack entry (the fake's workspace names its channels); 0.16: the claim fields User Email, Sent By This App and Pressed By Email"
14
14
  },
15
15
  "forms": {
16
16
  "capturedAt": "2026-10-31",
@@ -22,15 +22,19 @@
22
22
  },
23
23
  "attio": {
24
24
  "capturedAt": "2026-11-01",
25
- "via": "lf catalog over a project connecting the real @lf/attio module against fake-channels (0.13: each object's records list Changes, landing on its own change type, CompanyChange, PersonChange, DealChange and FundChange; the Webhook Event, its variants and the events settings are gone); the rest of the attio entry is the platform capture"
25
+ "via": "lf catalog over a project connecting the real @lf/attio module against fake-channels (0.13: each object's records list Changes, landing on its own change type, CompanyChange, PersonChange, DealChange and FundChange; the Webhook Event, its variants and the events settings are gone); the rest of the attio entry is the platform capture; 0.16: the four change types recaptured on 2026-11-13 with Changed By"
26
26
  },
27
27
  "telegram, whatsapp, system": {
28
28
  "capturedAt": "2026-11-01",
29
- "via": "lf catalog over a project connecting the real @lf/telegram, @lf/whatsapp and @lf/system modules (offline): the whole of each entry"
29
+ "via": "lf catalog over a project connecting the real @lf/telegram, @lf/whatsapp and @lf/system modules (offline): the whole of each entry; 0.16: telegram and whatsapp recaptured on 2026-11-13 with their claim fields (Sender Email, Sender Phone)"
30
30
  },
31
31
  "gmail": {
32
32
  "capturedAt": "2026-11-02",
33
33
  "via": "lf catalog over a project connecting the real @lf/gmail module against fake-channels' Gmail: the whole gmail entry"
34
+ },
35
+ "airtable": {
36
+ "capturedAt": "2026-11-21",
37
+ "via": "reduced by hand from the real @lf/airtable module's describeTableChange (modules/airtable/schema_catalog.ts), through the projection's rules (a field of kind record becomes a record of the named position, mayBeAbsent becomes maybeAbsent): only the held record fields a probe reads (Previous, Current) and two of the table's own fields (Stage, Score), the whole entry otherwise absent. Exists so a probe can read a record held in a field."
34
38
  }
35
39
  }
36
40
  },
@@ -441,6 +445,16 @@
441
445
  }
442
446
  }
443
447
  }
448
+ },
449
+ "airtable": {
450
+ "constructionArgs": [
451
+ {
452
+ "name": "credentials",
453
+ "kind": "credential",
454
+ "required": true
455
+ }
456
+ ],
457
+ "description": "Airtable bases and their tables' rows, and a change for each row an edit touched."
444
458
  }
445
459
  },
446
460
  "schemas": {
@@ -944,7 +958,17 @@
944
958
  "Team"
945
959
  ]
946
960
  },
947
- "Record": "text"
961
+ "Record": "text",
962
+ "Changed By": {
963
+ "kind": "maybeAbsent",
964
+ "of": {
965
+ "kind": "branded",
966
+ "of": "text",
967
+ "brands": [
968
+ "claim:attio/user_id"
969
+ ]
970
+ }
971
+ }
948
972
  },
949
973
  "edges": {
950
974
  "Company": {
@@ -958,7 +982,8 @@
958
982
  "Id": "Names the change: the same on every redelivery of it.",
959
983
  "Kind": "What happened to the company.",
960
984
  "Field": "On an update, the attribute that changed, by its title (`Stage`).",
961
- "Record": "The company's record id."
985
+ "Record": "The company's record id.",
986
+ "Changed By": "The workspace member who made the change, by their Attio member id; null for a change by an api token or Attio itself. A claim Attio vouches for: a plugin function that accepts `claim:attio/user_id` takes it where it refuses plain text."
962
987
  }
963
988
  },
964
989
  "PersonChange": {
@@ -981,7 +1006,17 @@
981
1006
  "Company"
982
1007
  ]
983
1008
  },
984
- "Record": "text"
1009
+ "Record": "text",
1010
+ "Changed By": {
1011
+ "kind": "maybeAbsent",
1012
+ "of": {
1013
+ "kind": "branded",
1014
+ "of": "text",
1015
+ "brands": [
1016
+ "claim:attio/user_id"
1017
+ ]
1018
+ }
1019
+ }
985
1020
  },
986
1021
  "edges": {
987
1022
  "Person": {
@@ -995,7 +1030,8 @@
995
1030
  "Id": "Names the change: the same on every redelivery of it.",
996
1031
  "Kind": "What happened to the person.",
997
1032
  "Field": "On an update, the attribute that changed, by its title (`Stage`).",
998
- "Record": "The person's record id."
1033
+ "Record": "The person's record id.",
1034
+ "Changed By": "The workspace member who made the change, by their Attio member id; null for a change by an api token or Attio itself. A claim Attio vouches for: a plugin function that accepts `claim:attio/user_id` takes it where it refuses plain text."
999
1035
  }
1000
1036
  },
1001
1037
  "DealChange": {
@@ -1018,7 +1054,17 @@
1018
1054
  "Company"
1019
1055
  ]
1020
1056
  },
1021
- "Record": "text"
1057
+ "Record": "text",
1058
+ "Changed By": {
1059
+ "kind": "maybeAbsent",
1060
+ "of": {
1061
+ "kind": "branded",
1062
+ "of": "text",
1063
+ "brands": [
1064
+ "claim:attio/user_id"
1065
+ ]
1066
+ }
1067
+ }
1022
1068
  },
1023
1069
  "edges": {
1024
1070
  "Deal": {
@@ -1032,7 +1078,8 @@
1032
1078
  "Id": "Names the change: the same on every redelivery of it.",
1033
1079
  "Kind": "What happened to the deal.",
1034
1080
  "Field": "On an update, the attribute that changed, by its title (`Stage`).",
1035
- "Record": "The deal's record id."
1081
+ "Record": "The deal's record id.",
1082
+ "Changed By": "The workspace member who made the change, by their Attio member id; null for a change by an api token or Attio itself. A claim Attio vouches for: a plugin function that accepts `claim:attio/user_id` takes it where it refuses plain text."
1036
1083
  }
1037
1084
  },
1038
1085
  "FundChange": {
@@ -1055,7 +1102,17 @@
1055
1102
  "Advisors"
1056
1103
  ]
1057
1104
  },
1058
- "Record": "text"
1105
+ "Record": "text",
1106
+ "Changed By": {
1107
+ "kind": "maybeAbsent",
1108
+ "of": {
1109
+ "kind": "branded",
1110
+ "of": "text",
1111
+ "brands": [
1112
+ "claim:attio/user_id"
1113
+ ]
1114
+ }
1115
+ }
1059
1116
  },
1060
1117
  "edges": {
1061
1118
  "Fund": {
@@ -1069,7 +1126,8 @@
1069
1126
  "Id": "Names the change: the same on every redelivery of it.",
1070
1127
  "Kind": "What happened to the fund.",
1071
1128
  "Field": "On an update, the attribute that changed, by its title (`Stage`).",
1072
- "Record": "The fund's record id."
1129
+ "Record": "The fund's record id.",
1130
+ "Changed By": "The workspace member who made the change, by their Attio member id; null for a change by an api token or Attio itself. A claim Attio vouches for: a plugin function that accepts `claim:attio/user_id` takes it where it refuses plain text."
1073
1131
  }
1074
1132
  }
1075
1133
  },
@@ -1470,7 +1528,18 @@
1470
1528
  "Channel": "text",
1471
1529
  "Timestamp": "date",
1472
1530
  "Topic": "text",
1473
- "Mentions App": "boolean"
1531
+ "Mentions App": "boolean",
1532
+ "User Email": {
1533
+ "kind": "maybeAbsent",
1534
+ "of": {
1535
+ "kind": "branded",
1536
+ "of": "text",
1537
+ "brands": [
1538
+ "claim:email/address"
1539
+ ]
1540
+ }
1541
+ },
1542
+ "Sent By This App": "boolean"
1474
1543
  },
1475
1544
  "edges": {
1476
1545
  "Files": {
@@ -1482,7 +1551,10 @@
1482
1551
  "sequenced": "chronological",
1483
1552
  "writable": true,
1484
1553
  "listenable": true,
1485
- "cursor": false
1554
+ "cursor": false,
1555
+ "carries": [
1556
+ "Channels"
1557
+ ]
1486
1558
  },
1487
1559
  "Interactions": {
1488
1560
  "target": "Interaction",
@@ -1553,7 +1625,9 @@
1553
1625
  "Channel": "The C… channel id (read-only — a post is written along a Channel's `Messages` edge).",
1554
1626
  "Timestamp": "When the message was posted.",
1555
1627
  "Topic": "A marker of your own for a message with Buttons (`Topic: \"lunch-poll\"`), so a listen can tell its presses from other messages' presses: `listen to chat-[:Channels]->-[m:Messages WHERE m.Topic == \"lunch-poll\"]->-[:Interactions]->`. Only a message with Buttons takes one: Slack keeps no other data on a message that comes back with a press, so the Topic is stored as the id of the block its buttons sit in (`lf:<topic>`), and read back from there — on the pressed message and on a listed one alike. It is written only with Buttons, and block ids starting `lf:` are reserved for it: a message whose own Blocks use one is refused.",
1556
- "Mentions App": "Whether the message @-mentions the connected app: `listen to chat-[:Channels]->-[m:Messages WHERE m.`Mentions App` == true]->` runs when somebody asks it something."
1628
+ "Mentions App": "Whether the message @-mentions the connected app: `listen to chat-[:Channels]->-[m:Messages WHERE m.`Mentions App` == true]->` runs when somebody asks it something.",
1629
+ "User Email": "The address Slack holds for the member who sent the message, lower case; null for a member with none and for a bot. A claim Slack vouches for: a plugin function such as a team check accepts it where it refuses plain text.",
1630
+ "Sent By This App": "Whether this app itself sent the message. A listen that should not hear the app's own posts filters on NOT Sent By This App. False when Slack does not say who the app is."
1557
1631
  },
1558
1632
  "fieldIds": {
1559
1633
  "Id": "id",
@@ -1562,7 +1636,9 @@
1562
1636
  "Channel": "channel",
1563
1637
  "Timestamp": "timestamp",
1564
1638
  "Topic": "topic",
1565
- "Mentions App": "mentions_app"
1639
+ "Mentions App": "mentions_app",
1640
+ "User Email": "user_email",
1641
+ "Sent By This App": "sent_by_this_app"
1566
1642
  }
1567
1643
  },
1568
1644
  "File": {
@@ -1587,7 +1663,17 @@
1587
1663
  "Interaction": {
1588
1664
  "properties": {
1589
1665
  "Id": "text",
1590
- "At": "date"
1666
+ "At": "date",
1667
+ "Pressed By Email": {
1668
+ "kind": "maybeAbsent",
1669
+ "of": {
1670
+ "kind": "branded",
1671
+ "of": "text",
1672
+ "brands": [
1673
+ "claim:email/address"
1674
+ ]
1675
+ }
1676
+ }
1591
1677
  },
1592
1678
  "edges": {
1593
1679
  "Actions": {
@@ -1607,11 +1693,13 @@
1607
1693
  "description": "Someone pressing a button (or using another control) on a message — what `await msg-[:Interactions]->` binds, and what a listen on a message's `Interactions` runs on. `Actions` are the controls used, `By` the member who pressed, `Message` the message pressed.",
1608
1694
  "fieldDocs": {
1609
1695
  "Id": "Names this press (Slack's trigger id).",
1610
- "At": "When the press was made."
1696
+ "At": "When the press was made.",
1697
+ "Pressed By Email": "The address Slack holds for the member who pressed, lower case; null for a member with none. A claim Slack vouches for: a plugin function such as a team check accepts it where it refuses plain text."
1611
1698
  },
1612
1699
  "fieldIds": {
1613
1700
  "Id": "id",
1614
- "At": "pressed_at"
1701
+ "At": "pressed_at",
1702
+ "Pressed By Email": "pressed_by_email"
1615
1703
  }
1616
1704
  },
1617
1705
  "Action": {
@@ -1634,7 +1722,18 @@
1634
1722
  "properties": {
1635
1723
  "Emoji": "text",
1636
1724
  "Channel": "text",
1637
- "Reactor": "text"
1725
+ "Reactor": "text",
1726
+ "User Email": {
1727
+ "kind": "maybeAbsent",
1728
+ "of": {
1729
+ "kind": "branded",
1730
+ "of": "text",
1731
+ "brands": [
1732
+ "claim:email/address"
1733
+ ]
1734
+ }
1735
+ },
1736
+ "Sent By This App": "boolean"
1638
1737
  },
1639
1738
  "edges": {
1640
1739
  "Message": {
@@ -1651,12 +1750,16 @@
1651
1750
  "fieldDocs": {
1652
1751
  "Emoji": "The reaction emoji name (e.g. \"thumbsup\"), without colons. On a write along `msg-[:Reactions]->`: the single emoji to react with — required.",
1653
1752
  "Channel": "The C… channel id the reaction is in (read-only — walk the `Channel` edge for the Channel node).",
1654
- "Reactor": "The U… id of the user who added the reaction (read-only — walk the `Reactor` edge for the User node)."
1753
+ "Reactor": "The U… id of the user who added the reaction (read-only — walk the `Reactor` edge for the User node).",
1754
+ "User Email": "The address Slack holds for the member who sent the reaction, lower case; null for a member with none and for a bot. A claim Slack vouches for: a plugin function such as a team check accepts it where it refuses plain text.",
1755
+ "Sent By This App": "Whether this app itself sent the reaction. A listen that should not hear the app's own posts filters on NOT Sent By This App. False when Slack does not say who the app is."
1655
1756
  },
1656
1757
  "fieldIds": {
1657
1758
  "Emoji": "emoji",
1658
1759
  "Channel": "channel",
1659
- "Reactor": "reactor"
1760
+ "Reactor": "reactor",
1761
+ "User Email": "user_email",
1762
+ "Sent By This App": "sent_by_this_app"
1660
1763
  }
1661
1764
  },
1662
1765
  "Channel": {
@@ -1761,6 +1864,17 @@
1761
1864
  "Timestamp": "date",
1762
1865
  "Topic": "text",
1763
1866
  "Mentions App": "boolean",
1867
+ "User Email": {
1868
+ "kind": "maybeAbsent",
1869
+ "of": {
1870
+ "kind": "branded",
1871
+ "of": "text",
1872
+ "brands": [
1873
+ "claim:email/address"
1874
+ ]
1875
+ }
1876
+ },
1877
+ "Sent By This App": "boolean",
1764
1878
  "File": "file",
1765
1879
  "Blocks": {
1766
1880
  "kind": "list",
@@ -1781,7 +1895,10 @@
1781
1895
  "sequenced": "chronological",
1782
1896
  "writable": true,
1783
1897
  "listenable": true,
1784
- "cursor": false
1898
+ "cursor": false,
1899
+ "carries": [
1900
+ "Channels"
1901
+ ]
1785
1902
  },
1786
1903
  "Interactions": {
1787
1904
  "target": "Interaction",
@@ -1868,7 +1985,18 @@
1868
1985
  "url": "text",
1869
1986
  "Emoji": "text",
1870
1987
  "Channel": "text",
1871
- "Reactor": "text"
1988
+ "Reactor": "text",
1989
+ "User Email": {
1990
+ "kind": "maybeAbsent",
1991
+ "of": {
1992
+ "kind": "branded",
1993
+ "of": "text",
1994
+ "brands": [
1995
+ "claim:email/address"
1996
+ ]
1997
+ }
1998
+ },
1999
+ "Sent By This App": "boolean"
1872
2000
  },
1873
2001
  "edges": {
1874
2002
  "Message": {
@@ -2746,6 +2874,16 @@
2746
2874
  "Sender Id": "text",
2747
2875
  "Sender Username": "text",
2748
2876
  "Sender First Name": "text",
2877
+ "Sender Email": {
2878
+ "kind": "maybeAbsent",
2879
+ "of": {
2880
+ "kind": "branded",
2881
+ "of": "text",
2882
+ "brands": [
2883
+ "claim:email/address"
2884
+ ]
2885
+ }
2886
+ },
2749
2887
  "Date": "text"
2750
2888
  },
2751
2889
  "edges": {
@@ -2778,6 +2916,7 @@
2778
2916
  "Sender Id": "The numeric id of the user who sent the message.",
2779
2917
  "Sender Username": "The @username of the sender, when set.",
2780
2918
  "Sender First Name": "The sender's first name.",
2919
+ "Sender Email": "The address the sender bound to their Telegram account by the link handshake, lower case; null for a sender who has not linked. A claim Telegram vouches for: a plugin function such as a team check accepts it where it refuses plain text.",
2781
2920
  "Date": "When the message was sent (ISO-8601)."
2782
2921
  },
2783
2922
  "fieldIds": {
@@ -2789,6 +2928,7 @@
2789
2928
  "Sender Id": "sender_id",
2790
2929
  "Sender Username": "sender_username",
2791
2930
  "Sender First Name": "sender_first_name",
2931
+ "Sender Email": "sender_email",
2792
2932
  "Date": "date"
2793
2933
  }
2794
2934
  },
@@ -2869,6 +3009,16 @@
2869
3009
  "Sender Id": "text",
2870
3010
  "Sender Username": "text",
2871
3011
  "Sender First Name": "text",
3012
+ "Sender Email": {
3013
+ "kind": "maybeAbsent",
3014
+ "of": {
3015
+ "kind": "branded",
3016
+ "of": "text",
3017
+ "brands": [
3018
+ "claim:email/address"
3019
+ ]
3020
+ }
3021
+ },
2872
3022
  "Date": "text",
2873
3023
  "Reply Markup": "json"
2874
3024
  },
@@ -2905,6 +3055,16 @@
2905
3055
  "properties": {
2906
3056
  "Message Id": "text",
2907
3057
  "From": "text",
3058
+ "Sender Phone": {
3059
+ "kind": "maybeAbsent",
3060
+ "of": {
3061
+ "kind": "branded",
3062
+ "of": "text",
3063
+ "brands": [
3064
+ "claim:phone/e164"
3065
+ ]
3066
+ }
3067
+ },
2908
3068
  "To": "text",
2909
3069
  "Body": "text",
2910
3070
  "WhatsApp Id": "text",
@@ -2944,6 +3104,7 @@
2944
3104
  "fieldDocs": {
2945
3105
  "Message Id": "The WhatsApp message id — the value a reply or reaction addresses.",
2946
3106
  "From": "The sender's phone number, digits with the country code first and no plus (`447700900001`): the conversation a message is in, so a listen narrows to one by it.",
3107
+ "Sender Phone": "The sender's number with its plus (`+447700900001`), a claim WhatsApp vouches for: Meta signs the delivery. A plugin function that accepts `claim:phone/e164` takes it where it refuses plain text.",
2947
3108
  "To": "Inbound: the team's own WhatsApp business number (the message's recipient). On a send: the other party's phone number, derived from the message the write is anchored on (an inbound parent's From, a sent parent's To) — read-only either way.",
2948
3109
  "Body": "The message text. Empty for media-only messages. At least one of Body / File on a send (the Body captions the file).",
2949
3110
  "File": "A file to send (image / PDF / audio / video, routed by content type). At least one of Body / File. Send-side only: a received message's media is on its Attachments edge — read `msg-[:Attachments]->.File`.",
@@ -2955,6 +3116,7 @@
2955
3116
  "fieldIds": {
2956
3117
  "Message Id": "messageId",
2957
3118
  "From": "from",
3119
+ "Sender Phone": "senderPhone",
2958
3120
  "To": "to",
2959
3121
  "Body": "body",
2960
3122
  "WhatsApp Id": "waId",
@@ -2983,6 +3145,16 @@
2983
3145
  "Reacted Message Id": "text",
2984
3146
  "Message Id": "text",
2985
3147
  "From": "text",
3148
+ "Sender Phone": {
3149
+ "kind": "maybeAbsent",
3150
+ "of": {
3151
+ "kind": "branded",
3152
+ "of": "text",
3153
+ "brands": [
3154
+ "claim:phone/e164"
3155
+ ]
3156
+ }
3157
+ },
2986
3158
  "Profile Name": "text",
2987
3159
  "Timestamp": "text"
2988
3160
  },
@@ -2992,13 +3164,15 @@
2992
3164
  "Emoji": "The reaction emoji. Inbound: empty when the reaction was removed. On a write along msg-[:Reactions]->: the single emoji to react with — required.",
2993
3165
  "Reacted Message Id": "The message the reaction is on.",
2994
3166
  "Message Id": "The reaction event's own id.",
2995
- "From": "The reactor's phone number."
3167
+ "From": "The reactor's phone number.",
3168
+ "Sender Phone": "The reactor's number with its plus (`+447700900001`), a claim WhatsApp vouches for: Meta signs the delivery. A plugin function that accepts `claim:phone/e164` takes it where it refuses plain text."
2996
3169
  },
2997
3170
  "fieldIds": {
2998
3171
  "Emoji": "emoji",
2999
3172
  "Reacted Message Id": "reactedMessageId",
3000
3173
  "Message Id": "messageId",
3001
3174
  "From": "from",
3175
+ "Sender Phone": "senderPhone",
3002
3176
  "Profile Name": "profileName",
3003
3177
  "Timestamp": "timestamp"
3004
3178
  }
@@ -3011,13 +3185,24 @@
3011
3185
  "Address": "text",
3012
3186
  "Message Id": "text",
3013
3187
  "From": "text",
3188
+ "Sender Phone": {
3189
+ "kind": "maybeAbsent",
3190
+ "of": {
3191
+ "kind": "branded",
3192
+ "of": "text",
3193
+ "brands": [
3194
+ "claim:phone/e164"
3195
+ ]
3196
+ }
3197
+ },
3014
3198
  "Profile Name": "text",
3015
3199
  "Timestamp": "text"
3016
3200
  },
3017
3201
  "edges": {},
3018
3202
  "description": "Someone shared a location with the team number. What a listen on `Locations` delivers.",
3019
3203
  "fieldDocs": {
3020
- "Name": "The place name, when the sender picked one."
3204
+ "Name": "The place name, when the sender picked one.",
3205
+ "Sender Phone": "The sender's number with its plus (`+447700900001`), a claim WhatsApp vouches for: Meta signs the delivery. A plugin function that accepts `claim:phone/e164` takes it where it refuses plain text."
3021
3206
  },
3022
3207
  "fieldIds": {
3023
3208
  "Latitude": "latitude",
@@ -3026,6 +3211,7 @@
3026
3211
  "Address": "address",
3027
3212
  "Message Id": "messageId",
3028
3213
  "From": "from",
3214
+ "Sender Phone": "senderPhone",
3029
3215
  "Profile Name": "profileName",
3030
3216
  "Timestamp": "timestamp"
3031
3217
  }
@@ -3073,6 +3259,16 @@
3073
3259
  "url": "text",
3074
3260
  "Message Id": "text",
3075
3261
  "From": "text",
3262
+ "Sender Phone": {
3263
+ "kind": "maybeAbsent",
3264
+ "of": {
3265
+ "kind": "branded",
3266
+ "of": "text",
3267
+ "brands": [
3268
+ "claim:phone/e164"
3269
+ ]
3270
+ }
3271
+ },
3076
3272
  "To": "text",
3077
3273
  "Body": "text",
3078
3274
  "WhatsApp Id": "text",
@@ -3123,6 +3319,16 @@
3123
3319
  "Reacted Message Id": "text",
3124
3320
  "Message Id": "text",
3125
3321
  "From": "text",
3322
+ "Sender Phone": {
3323
+ "kind": "maybeAbsent",
3324
+ "of": {
3325
+ "kind": "branded",
3326
+ "of": "text",
3327
+ "brands": [
3328
+ "claim:phone/e164"
3329
+ ]
3330
+ }
3331
+ },
3126
3332
  "Profile Name": "text",
3127
3333
  "Timestamp": "text"
3128
3334
  },
@@ -4350,6 +4556,68 @@
4350
4556
  }
4351
4557
  },
4352
4558
  "supportsInPlaceUpdate": true
4559
+ },
4560
+ "airtable": {
4561
+ "positions": {
4562
+ "Candidate": {
4563
+ "properties": {
4564
+ "Name": "text",
4565
+ "Stage": "text",
4566
+ "Score": {
4567
+ "kind": "maybeAbsent",
4568
+ "of": "number"
4569
+ }
4570
+ },
4571
+ "edges": {}
4572
+ },
4573
+ "Candidate Change": {
4574
+ "properties": {
4575
+ "Id": "text",
4576
+ "Kind": {
4577
+ "kind": "enum",
4578
+ "options": [
4579
+ "created",
4580
+ "updated",
4581
+ "deleted"
4582
+ ]
4583
+ },
4584
+ "Current": {
4585
+ "kind": "maybeAbsent",
4586
+ "of": {
4587
+ "kind": "record",
4588
+ "position": {
4589
+ "kind": "position",
4590
+ "position": "Candidate"
4591
+ }
4592
+ }
4593
+ },
4594
+ "Previous": {
4595
+ "kind": "maybeAbsent",
4596
+ "of": {
4597
+ "kind": "record",
4598
+ "position": {
4599
+ "kind": "position",
4600
+ "position": "Candidate"
4601
+ }
4602
+ }
4603
+ }
4604
+ },
4605
+ "edges": {
4606
+ "Record": {
4607
+ "target": "Candidate"
4608
+ }
4609
+ }
4610
+ }
4611
+ },
4612
+ "collections": {
4613
+ "Candidates": {
4614
+ "target": "Candidate"
4615
+ },
4616
+ "Candidate Changes": {
4617
+ "target": "Candidate Change"
4618
+ }
4619
+ },
4620
+ "writableRoots": {}
4353
4621
  }
4354
4622
  }
4355
4623
  }
package/dist/builtins.md CHANGED
@@ -170,10 +170,10 @@ code = Text.upper(Text.trim(msg.Subject))
170
170
 
171
171
  ### Text.includes
172
172
 
173
- `Text.includes(text, part)` → `boolean` — whether the text contains `part`, ignoring case. The same test as `CONTAINS` in a `WHERE`.
173
+ `Text.includes(text, part)` → `boolean` — whether the text contains `part`. Letter case counts, as in JavaScript's `includes`; to ignore it, lower both sides. The same test as `CONTAINS` in a `WHERE`.
174
174
 
175
175
  ```
176
- urgent = Text.includes(msg.Subject, "urgent")
176
+ urgent = Text.includes(Text.lower(msg.Subject), "urgent")
177
177
  ```
178
178
 
179
179
  ### Text.length
@@ -33,7 +33,7 @@ import { fetchUrl } from plugins
33
33
  import { \`Log Lead\`, Lead as \`Inbound Lead\` } from "lib/intake-routines"
34
34
  \`\`\`
35
35
 
36
- - \`plugins\` — functions the platform ships, called as a function is, by position, with any other inputs in one settings record last: \`page = fetchUrl(c.website)\`, \`deck = fetchUrl(o.deck_url, { email: @user_email })\`.
36
+ - \`plugins\` — functions the platform ships, called as a function is, by position, with any other inputs in one settings record last: \`page = fetchUrl(c.website)\`, \`deck = fetchUrl(o.deck_url, { email: "deals@acme.test" })\`.
37
37
  - A quoted path — automations and record structures from another saved file. Only declarations it marks \`export\` are importable, and \`as\` renames locally.
38
38
 
39
39
  The quoted path is the other file's saved name, matched exactly — no folders, no extension, no case-folding; \`"lib/…"\` is a naming habit, not a directory. Importing from a file changes nothing about that file: its own \`listen\` lines keep firing it, and never fire yours.
@@ -64,17 +64,15 @@ if (\`Suggested Action\` != null) {
64
64
  \`\`\`
65
65
  write crm-[:Companies]-> {
66
66
  Name: msg.Subject
67
- Description ?: "Owner: \${@user_email} — forwarded in by \${@actor_name} on \${@current_date}"
67
+ Description ?: "Forwarded in on \${@current_date}"
68
68
  }
69
69
  \`\`\`
70
70
 
71
- Values that come from the run itself rather than from any record wear an \`@\` prefix and read like any other value, anywhere an expression can appear. There are eight, in three groups:
71
+ Values that come from the run itself rather than from any record wear an \`@\` prefix and read like any other value, anywhere an expression can appear. There are two:
72
72
 
73
73
  - \`@current_date\` (\`"2026-03-12"\`) and \`@current_timestamp\`, the moment the run fires, in UTC — \`Deadline: Date.addDays(@current_date, 14)\`. Every clock reading in a run gives that same moment, however long the run takes. For the date somewhere in particular, reach for \`Date.today(zone)\`.
74
- - \`@user_email\`, \`@user_name\`, \`@user_id\` — the identity the host resolves for the run: the person it acts *on behalf of*. The platform resolves it through its workspace members, \`listen-fire\` through the project. Forwarders are followed back to the real person: a message forwarded in by a teammate still names the original sender, the person whose work this is.
75
- - \`@actor_email\`, \`@actor_name\`, \`@actor_id\` — whoever literally triggered the event in the source system, exactly as it reported them, member or not.
76
74
 
77
- The two agree until a forward, relay, or service account sits between the originator and the responsible person. A meta-field the run can't resolve — an event the host maps to no identity, a source that reports no sender — is simply empty, never an error.
75
+ Who sent or pressed something is never a meta-field. A module publishes it as a field of what landed (listeners chapter, *who-acted*).
78
76
 
79
77
  ### aggregates
80
78
 
@@ -254,7 +252,7 @@ A separate and stronger thing is a value typed as *possibly not there at all*
254
252
  - **a named \`match\`.** \`existing = match crm-[:Companies]-> { … }\` is the record or absent; test \`existing == null\` (the \`else\` arm sees it present) or \`!= null\` before reading a field off it or linking it;
255
253
  - **a record held in a field.** A field may hold a record: a value with typed fields, such as a change's row before and after (\`c.Previous\`, \`c.Current\`). Its fields are read with \`.\` (\`c.Current.Stage\`); it has no edges, so the record as it is now is reached by its edge (\`c-[:Record]->\`). \`c.Previous\` is absent on a created row, and a field read through it with \`.\` is refused until tested: \`c.Previous?.Stage\` reads it (absent on a created row), or test it first, \`exists(c.Previous) && c.Previous.Stage == "Applied"\`, \`!exists(c.Previous) || c.Previous.Stage != "Interview"\`, or inside \`if (exists(c.Previous)) { … }\` (in a \`WHERE\`: \`AND\`, \`OR\`, \`NOT\`);
256
254
  - **a \`race\` slot** — \`r[0]\` reads what the first arm of a \`race\` returned, and only the arm that settled first has its slot filled, so every slot off a \`race\` may be absent. (A \`map\` over a list of functions runs every one, so its slots are not.)
257
- - **a field read off a record that may not be there.** \`details = extractOne(…)\` may have found nothing, so \`details.summary\` is refused, as TypeScript refuses it under strict null checks. Read it with \`details?.summary\`, which is \`text | absent\`: absent when \`details\` is, so \`details?.summary == null\` holds then. Or test \`exists(details)\` (or \`details != null\`) first and read \`details.summary\` after. \`details?.summary != null\` proves \`details\` present too. A graph literal's required field refuses such a value too: declare the field \`<text | null>\`, or fall back.
255
+ - **a field read off a record that may not be there.** \`details = extractOne(…)\` may have found nothing, so \`details.summary\` is refused, as TypeScript refuses it under strict null checks. Read it with \`details?.summary\`, which is \`text | absent\`: absent when \`details\` is, so \`details?.summary == null\` holds then. Or test \`exists(details)\` (or \`details != null\`) first and read \`details.summary\` after. \`details?.summary != null\` proves \`details\` and \`details.summary\` present, so \`details.summary\` can be compared or written after it. A graph literal's required field refuses such a value too: declare the field \`<text | null>\`, or fall back.
258
256
  - **a typed extracted field, and a lookup by a computed key.** A \`<number>\`, \`<date>\`, \`<boolean>\` or set-of-values field of an \`extract\` is something the model was asked for and may not have found, so reading one is \`T | absent\` — a write field takes it with the \`?:\` fill rather than plainly. A text field is never absent: one the model did not find reads as \`""\`, so test it with \`!= ""\` — a null test on it is refused. Annotate it \`<text | null>\` to have a missing one arrive null instead: it is then \`text | absent\` like the rest, and a null test narrows it. \`d[key]\` with a key worked out at run time is the same: a key that is not there reads nothing.
259
257
 
260
258
  Reading such a value is always fine, and so is interpolating it — it prints as nothing. Testing it needs no guard either. \`==\` and \`!=\` take it on either side: a missing value equals only \`null\`, so \`o.stage == "Seed"\` is false and \`o.stage != "Seed"\` true when the model found nothing. A condition takes a \`<boolean>\` that may be missing and reads a missing one as false — \`if (o.viable) { … }\`, \`o.viable ? a : b\`, \`a && o.viable\`, \`!o.viable\`.
@@ -270,7 +268,7 @@ Four things discharge it, and one of them always fits:
270
268
  \`\`\`
271
269
 
272
270
  - **Gate on it with a traversal.** A block headed by the landing runs only when the landing is there, and everything inside it knows so: \`q-[a:Response]-> { … }\`.
273
- - **Test it with \`==\`.** Comparing against \`null\` (\`x == null\` / \`x != null\`) is the dedicated presence test, and the one place \`==\` is deliberately loose: \`null\` and absent mean the same thing here, so it's legal against *any* possibly-missing value. Comparing against a present value works too and narrows the same way (\`if (a.Answer == "pursue") { … }\` is legal even though \`a.Answer\` may be absent). Either way, the arm that took the comparison knows the value is present — and for \`== null\` used as a guard clause (\`if (x == null) { fail("…") }\`), so does everything **after** the \`if\`, not just the arm. A test on a field read off a bound record proves the record too (\`if (channel?.Topic != null)\`), so that arm may write off \`channel\`. The value-level form \`x != null ? … : …\` narrows only its first branch. See *narrowing-past-a-guard* in the branching chapter.
271
+ - **Test it with \`==\`.** Comparing against \`null\` (\`x == null\` / \`x != null\`) is the dedicated presence test, and the one place \`==\` is deliberately loose: \`null\` and absent mean the same thing here, so it's legal against *any* possibly-missing value. Comparing against a present value works too and narrows the same way (\`if (a.Answer == "pursue") { … }\` is legal even though \`a.Answer\` may be absent). Either way, the arm that took the comparison knows the value is present — and for \`== null\` used as a guard clause (\`if (x == null) { fail("…") }\`), so does everything **after** the \`if\`, not just the arm. A test on a field read off a bound record proves the record and the field (\`if (channel?.Topic != null)\`), so that arm may write off \`channel\` and read \`channel.Topic\`. A test proves the whole path, as TypeScript's does: \`c.Previous.Score != null\` proves \`c.Previous.Score\`, and a field of \`c.Previous\` that has no test of its own stays refused. A call written to the right of a test is checked under it, since a run reaches the call only when the test held: \`exists(c.Previous) && shout(c.Previous.Stage)\`. The value-level form \`x != null ? … : …\` narrows only its first branch. See *narrowing-past-a-guard* in the branching chapter.
274
272
  - **Fall back with \`coalesce\`.** \`coalesce(a, b)\` answers the first of its arguments that has a value, so the moment one of them always does — a literal, or anything already known to be there — the result always does too: \`Name: coalesce(only(msg-[:Attachments]->.Name), "no attachment")\`. A \`coalesce\` whose arguments might *all* be empty is itself possibly-empty and is refused in the same places, so the one-argument form discharges nothing at all.
275
273
 
276
274
  For a list that may hold absent members, drop them (\`List.sum(List.compact(xs))\`) or fill them (\`List.sum(map(xs, (x) => coalesce(x, 0)))\`) before folding.
@@ -552,7 +550,7 @@ function \`Intake\`(m: <inbox-[:Emails]->>) {
552
550
  `,
553
551
  },
554
552
  {
555
- construct: 'ambient values (@user_email, @actor_*, @current_date)',
553
+ construct: 'ambient values (@current_date)',
556
554
  status: 'runs',
557
555
  probe: `
558
556
  inbox = connect \`@lf/email\`
@@ -561,7 +559,7 @@ crm = connect \`@lf/attio\` using acme
561
559
  function \`Intake\`(m: <inbox-[:Emails]->>) {
562
560
  write crm-[:Companies]-> {
563
561
  Name: m.Subject
564
- Description ?: "Owner: \${@user_email} — from \${@actor_name} on \${@current_date}"
562
+ Description ?: "Forwarded in on \${@current_date}"
565
563
  }
566
564
  }
567
565
  `,
@@ -699,6 +697,52 @@ function \`Gather\`(m: <inbox-[:Emails]->>, n: <number>) {
699
697
  }
700
698
  }
701
699
 
700
+ `,
701
+ },
702
+ {
703
+ construct: 'a test through ?. proves the field it reads, a held record bound to a name too',
704
+ status: 'runs',
705
+ probe: `
706
+ hr = connect \`@lf/airtable\` using hiring
707
+
708
+ function \`Strong\`(c: <hr-[:Candidate Changes]->>) {
709
+ held = c.Previous
710
+ if (held?.Score != null) {
711
+ strong = held.Score > 3
712
+ }
713
+ if (exists(c.Current?.Score)) {
714
+ now = c.Current.Score > 3
715
+ }
716
+ }
717
+ `,
718
+ },
719
+ {
720
+ construct: 'exists(c.Previous) && c.Previous.Stage, and a field of the held record tested in the same condition',
721
+ status: 'runs',
722
+ probe: `
723
+ hr = connect \`@lf/airtable\` using hiring
724
+
725
+ function \`Moved\`(c: <hr-[:Candidate Changes]->>) {
726
+ from_applied = exists(c.Previous) && c.Previous.Stage == "Applied"
727
+ not_interview = !exists(c.Previous) || c.Previous.Stage != "Interview"
728
+ was_strong = exists(c.Previous) && c.Previous.Score != null && c.Previous.Score > 3
729
+ }
730
+ `,
731
+ },
732
+ {
733
+ construct: 'a call to the right of a test sees what the test proved',
734
+ status: 'runs',
735
+ probe: `
736
+ hr = connect \`@lf/airtable\` using hiring
737
+
738
+ function shout(s: <text>) {
739
+ return Text.upper(s)
740
+ }
741
+
742
+ function \`Loud\`(c: <hr-[:Candidate Changes]->>) {
743
+ was_loud = exists(c.Previous) && shout(c.Previous.Stage) == "APPLIED"
744
+ label = exists(c.Current) ? shout(c.Current.Stage) : ""
745
+ }
702
746
  `,
703
747
  },
704
748
  ],
@@ -111,7 +111,7 @@ These hold everywhere, in every chapter, and are not restated per situation:
111
111
  order the callee declares them (\`\`Log Lead\`(msg)\`), as TypeScript calls a
112
112
  function, with an optional settings record last
113
113
  (\`map(xs, (x) => x.Name, { concurrency: 2 })\`). A plugin is called the
114
- same way (\`fetchUrl(c.website)\`, \`fetchUrl(u, { email: @user_email })\`). A function, a plugin, a built-in and a
114
+ same way (\`fetchUrl(c.website)\`, \`fetchUrl(u, { email: "deals@acme.test" })\`). A function, a plugin, a built-in and a
115
115
  closure bound to a name are all called the same way. Names are exact in
116
116
  case, inside walk brackets too. Braces are declarative bodies.
117
117
  - Fields read with a dot (\`msg.Subject\`); "double quotes" are strings;
@@ -25,7 +25,7 @@ Saving the file registers its listeners; if one can't go live, the save says so.
25
25
 
26
26
  ### where-a-filter-is-judged
27
27
 
28
- A listen may filter any hop: \`chat-[ch:Channels WHERE ch.Name == "deals"]->-[m:Messages WHERE m.Message CONTAINS "intro"]->\`. A \`WHERE\` reads only its own hops and literals — never a name a run holds, \`ai(…)\`, or another walk. Each part of it is judged in one of three places:
28
+ A listen may filter any hop: \`chat-[ch:Channels WHERE ch.Name == "deals"]->-[m:Messages WHERE m.Message CONTAINS "intro"]->\`. A \`WHERE\` reads only its own hops, literals and pure calls — never a name a run holds, \`ai(…)\`, or another walk. A call is pure when it reads no clock, model or source: a built-in such as \`Text.regexExtract\`, or a host's function that declares itself pure (*who-acted*). Each part of it is judged in one of three places:
29
29
 
30
30
  - **By the system**, which sends only what matches, as it does for a read.
31
31
  - **On arrival**, against the record that landed and the records it carries: a Slack message carries its channel, a press its channel and message. Each system's chapter says what its arrivals carry.
@@ -71,28 +71,80 @@ Once the system answers again, \`listen-fire listens replay <file>:<movement> --
71
71
 
72
72
  ### who-acted
73
73
 
74
- What lands can say who acted. \`listen-fire\` and the platform both give a landing an \`Actor\`, once its system reports who acted, and a filter and a run read it like any other field:
74
+ A module publishes who acted as a **claim**: a field of what landed whose type carries a brand, \`text & Brand<"claim:email/address">\`. A module publishes a claim only when it vouches for it.
75
75
 
76
- - \`Id\` — the system's own id for them.
77
- - \`Email\` and \`Domain\` — their address in lower case, and the part after its last \`@\`.
78
- - \`Phone\` — digits only, country code first.
79
- - \`Name\` — as the system reports it.
80
- - \`Proven\` — true when the module checked that the system vouches for who it names.
76
+ - Slack: \`User Email\` on a message and a reaction, \`Pressed By Email\` on a press.
77
+ - Telegram: \`Sender Email\`. WhatsApp: \`Sender Phone\` (\`+447700900123\`). Granola: \`Note Owner Email\`. Attio: \`Changed By\`, a workspace member's id.
78
+ - Email publishes none. Its \`From\` is plain text anyone can forge.
81
79
 
82
- \`Actor\` is missing when the system names nobody, and so are all of its fields but \`Id\` and \`Proven\`, so read it with \`?.\`. A \`Domain\` is exact: \`"acme.test"\` does not match \`acme.test.example.com\`.
80
+ What a claim means to the team is a **host function**'s answer. A host offers functions as a plugin package, imported like any plugin, and a listen's filter may call one that is pure. This example uses one host's package, the platform's \`@lf-platform/team\`:
83
81
 
84
82
  \`\`\`
85
- listen to inbox-[e:Emails WHERE e.Key == "deals" AND e.Actor?.Domain == "acme.test"]-> fire \`Intake\`
83
+ import { \`@lf-platform/team\` as team } from plugins
84
+ slack = connect \`@lf/slack\` using team_workspace
85
+
86
+ function intake(m: <slack-[:Message]->>) {
87
+ write m-[:Reactions]-> { Emoji: "eyes" }
88
+ }
89
+
90
+ listen to slack-[ch:Channels WHERE ch.Name == "dealflow"]->-[m:Messages WHERE m.\`User Email\` != null AND team.isMember(m.\`User Email\`)]-> fire intake
86
91
  \`\`\`
87
92
 
88
- \`Proven\` is false for email: nothing in a message vouches for its \`From\` line. Slack, Telegram, Attio, WhatsApp and Granola set it when they name someone.
93
+ - Which functions exist is the host's choice. The platform's \`@lf-platform/team\` offers \`isMember(claim)\` and \`userFor(claim)\`; \`listen-fire\` alone offers none.
94
+ - A function takes the claim it matches. Plain text where a claim is wanted is refused, so a \`From\` line cannot be passed to \`isMember\`.
95
+ - A function may answer a record, or none. Read its field with \`?.\`: \`m.\`User Email\` != null AND team.userFor(m.\`User Email\`)?.Level == "admin"\`. Without the \`?\` it is refused, since the answer may be none.
96
+ - Write the checks that need no host first. The host is called only for a sender the cheaper terms let through, and each answer is kept.
97
+ - When the host cannot be reached, the arrival waits unjudged and nothing runs until it is judged.
98
+ - To keep a listen off the app's own posts, add \`AND NOT m.\`Sent By This App\`\` (Slack).
99
+ - To limit by domain, read it off a claim: \`Text.regexExtract(m.\`User Email\`, "@([^@]+)$", 1) == "acme.com"\`. The match is exact (\`acme.com.evil.com\` is not \`acme.com\`).
89
100
 
90
- If a system has a field of its own called \`Actor\`, that field is the one you read.
101
+ A claim can be missing (a bot, a member with no address), so test it for null before passing it on, as above. \`team.isMember(m.\`User Email\`)\` alone is refused.
91
102
 
92
103
  ### inbound-mail
93
104
 
94
105
  \`\`connect \`@lf/email\` \`\` is inbound mail. Which carrier delivers it is a setting of the deployment, not a choice an automation makes.`,
95
106
  engineClaims: [
107
+ {
108
+ construct: "a host function in a listen's filter (a claim passed to team.isMember), the app's own posts left out",
109
+ status: 'runs',
110
+ probe: `
111
+ import { \`@lf-platform/team\` as team } from plugins
112
+ slack = connect \`@lf/slack\` using team_workspace
113
+
114
+ function intake(m: <slack-[:Message]->>) {
115
+ write m-[:Reactions]-> { Emoji: "eyes" }
116
+ }
117
+
118
+ listen to slack-[ch:Channels WHERE ch.Name == "dealflow"]->-[m:Messages WHERE NOT m.\`Sent By This App\` AND m.\`User Email\` != null AND team.isMember(m.\`User Email\`)]-> fire intake
119
+ `,
120
+ },
121
+ {
122
+ construct: "a field of a host function's record answer in a listen's filter (team.userFor(…)?.Level)",
123
+ status: 'runs',
124
+ probe: `
125
+ import { \`@lf-platform/team\` as team } from plugins
126
+ slack = connect \`@lf/slack\` using team_workspace
127
+
128
+ function intake(m: <slack-[:Message]->>) {
129
+ write m-[:Reactions]-> { Emoji: "eyes" }
130
+ }
131
+
132
+ listen to slack-[ch:Channels WHERE ch.Name == "dealflow"]->-[m:Messages WHERE m.\`User Email\` != null AND team.userFor(m.\`User Email\`)?.Level == "admin"]-> fire intake
133
+ `,
134
+ },
135
+ {
136
+ construct: "a domain test off a claim with Text.regexExtract in a listen's filter",
137
+ status: 'runs',
138
+ probe: `
139
+ slack = connect \`@lf/slack\` using team_workspace
140
+
141
+ function intake(m: <slack-[:Message]->>) {
142
+ write m-[:Reactions]-> { Emoji: "eyes" }
143
+ }
144
+
145
+ listen to slack-[ch:Channels WHERE ch.Name == "dealflow"]->-[m:Messages WHERE Text.regexExtract(m.\`User Email\`, "@([^@]+)$", 1) == "acme.com"]-> fire intake
146
+ `,
147
+ },
96
148
  {
97
149
  construct: 'listen as "…" — two aliased lanes on one channel firing one movement',
98
150
  status: 'runs',
@@ -87,20 +87,14 @@ Types **always** wear angle brackets; positions, scalar values, and handles **ne
87
87
 
88
88
  ### meta-fields
89
89
 
90
- \`@\`-prefixed values from the run itself; read like any other value. Eight, in three groups:
91
-
92
- - Time: \`@current_date\` (\`YYYY-MM-DD\`), \`@current_timestamp\`.
93
- - Responsible user (forwarder-resolved — *whose work is this*): \`@user_email\`, \`@user_name\`, \`@user_id\`.
94
- - Raw originator (*who literally sent this*, unresolved): \`@actor_email\`, \`@actor_name\`, \`@actor_id\`.
95
-
96
- A meta-field the run can't resolve is simply empty.
90
+ \`@\`-prefixed values from the run itself; read like any other value. Two: \`@current_date\` (\`YYYY-MM-DD\`) and \`@current_timestamp\`.
97
91
 
98
92
  ### writes
99
93
 
100
94
  \`\`\`
101
95
  company = write crm-[:Companies]-> {
102
96
  Name: msg.Subject # plain — overwrites every run
103
- Owner ?: @user_email # set-if-empty — leaves an existing value alone
97
+ Owner ?: msg.From # set-if-empty — leaves an existing value alone
104
98
  Tags +: ["inbound"] # append to a multi-value field (duplicates allowed)
105
99
  Sources +?:["email"] # append only what's missing (set-union)
106
100
  ?...e # every field of e (extracted, <Decl>-typed, or a graph), set-if-empty; \`...e\`: plain
@@ -161,14 +155,14 @@ fail("unexpected record kind") # abort the whole run with a re
161
155
  n = only(company-[t:Notes WHERE t.Title == "Brief"]->) # T | absent — a lookup that might match nothing
162
156
  d = first(company.Domains) # T | absent — same, over a field
163
157
  t = n?.Title # reads through n: absent when n is
164
- if (n?.Title != null) { … } # proves n present INSIDE this arm, as exists(n) does
158
+ if (n?.Title != null) { … } # proves n and n.Title present INSIDE this arm
165
159
  if (n == null) { fail("no notes found") } # guard clause — n is present for every line after
166
160
  if (n != null) { … } # narrows n present INSIDE this arm only
167
161
  x = d != null ? "\${d}" : "" # narrows d present in the true arm only
168
162
  Field ?: d # '?:' takes a maybe-absent value, no guard needed
169
163
  \`\`\`
170
164
 
171
- \`first\`/\`List.last\`/\`List.min\`/\`List.max\`/\`xs[n]\` over anything that can come up empty, and a named \`match\` that found nothing, type \`T | absent\`. Using such a value where a present one is required — a write or traversal target, a field read with \`.\`, an ordered comparison (\`<\` \`<=\` \`>\` \`>=\`) — is refused until narrowed, naming the fix. \`==\`/\`!=\` against \`null\` is the presence test (loose: \`null\` and absent mean the same thing); against any other value a maybe-absent side needs no guard (absent is never equal to a present value), and a condition (\`if\`, \`? :\`, \`&&\`/\`||\`/\`!\`) reads a missing boolean as false. Both sides must still match in kind. \`exists(…)\` takes related records (\`exists(msg-[:Attachments]->)\`) or a value (\`exists(x)\`, \`exists(x?.Field)\`: the same test as \`x?.Field != null\`); \`x != null\` and \`x == null\` take a bound name or a field read off one, and a proven field proves the record it came off. A field may hold a record, a value read with \`.\` (\`c.Current.Stage\`): it has fields only, no edges, and the record as it is now is reached by its edge (\`c-[:Record]->\`). A field is never read with \`.\` through a value that may be absent: any of the above, a call's result (\`only(…).F\`), an index read (\`xs[0].F\`), a change's row (\`c.Previous\` is absent on a created row) or a map member. Read it with \`?.\` (\`n?.Title\`, \`c.Previous?.Stage\`), absent when the value is, or test it first: \`exists(c.Previous) && c.Previous.Stage == "Applied"\`, \`!exists(c.Previous) || c.Previous.Stage != "Interview"\`, or inside \`if (exists(c.Previous)) { … }\`. A test of an index read at a literal (\`exists(xs[0])\`) proves every later \`xs[0]\`. A WHERE writes them \`AND\`, \`OR\`, \`NOT\`.
165
+ \`first\`/\`List.last\`/\`List.min\`/\`List.max\`/\`xs[n]\` over anything that can come up empty, and a named \`match\` that found nothing, type \`T | absent\`. Using such a value where a present one is required — a write or traversal target, a field read with \`.\`, an ordered comparison (\`<\` \`<=\` \`>\` \`>=\`) — is refused until narrowed, naming the fix. \`==\`/\`!=\` against \`null\` is the presence test (loose: \`null\` and absent mean the same thing); against any other value a maybe-absent side needs no guard (absent is never equal to a present value), and a condition (\`if\`, \`? :\`, \`&&\`/\`||\`/\`!\`) reads a missing boolean as false. Both sides must still match in kind. \`exists(…)\` takes related records (\`exists(msg-[:Attachments]->)\`) or a value (\`exists(x)\`, \`exists(x?.Field)\`: the same test as \`x?.Field != null\`); \`x != null\` and \`x == null\` take a bound name or a field read off one, and a proven field proves the record it came off, as a proven record proves the path to it (\`c.Previous.Score != null\`). A call to the right of a test (\`exists(c.Previous) && f(c.Previous.Stage)\`) is checked under it. A field may hold a record, a value read with \`.\` (\`c.Current.Stage\`): it has fields only, no edges, and the record as it is now is reached by its edge (\`c-[:Record]->\`). A field is never read with \`.\` through a value that may be absent: any of the above, a call's result (\`only(…).F\`), an index read (\`xs[0].F\`), a change's row (\`c.Previous\` is absent on a created row) or a map member. Read it with \`?.\` (\`n?.Title\`, \`c.Previous?.Stage\`), absent when the value is, or test it first: \`exists(c.Previous) && c.Previous.Stage == "Applied"\`, \`!exists(c.Previous) || c.Previous.Stage != "Interview"\`, or inside \`if (exists(c.Previous)) { … }\`. A test of an index read at a literal (\`exists(xs[0])\`) proves every later \`xs[0]\`. A WHERE writes them \`AND\`, \`OR\`, \`NOT\`.
172
166
 
173
167
  ### listeners
174
168
 
@@ -259,7 +253,7 @@ Content is a list (shared content first, record-specific content last, so repeat
259
253
  - **Expecting one extraction per piece from a list.** \`extract(pieces, Shape)\` reads them all as a single job; \`map(pieces, (p) => extract([p], Shape))\` is the per-piece form.
260
254
  - **Verifying from the target system only.** The run record shows what was sent and why; read provenance before editing the automation.
261
255
  - **Using a maybe-absent value unguarded.** A write/traversal target, a link end, a field read with \`.\`, or an ordered comparison off a \`first\`/\`List.last\`/\`List.min\`/\`List.max\`/\`xs[n]\` result or a named \`match\` is refused until narrowed — guard with \`if (x == null) { fail(…) }\` (or an \`else\` arm), \`x != null\`, or \`?:\` on the write field, or read the field with \`x?.Field\`.
262
- - **Binding a field just to test it.** \`x.Field != null\` reads the field directly (\`x?.Field != null\` when \`x\` may be absent, which proves \`x\` present too); no intermediate binding.
256
+ - **Binding a field just to test it.** \`x.Field != null\` reads the field directly (\`x?.Field != null\` when \`x\` may be absent, which proves \`x\` and \`x.Field\` present); no intermediate binding.
263
257
  - **Keeping a closure as data.** A closure lives in a variable or a parameter, or is passed as an argument where it is written (\`map(xs, (x) => …)\`, \`all(f, g)\`). In a list, under a key, in a field or as what a \`map\` returns it is refused when you save.
264
258
  - **Calling something that may not be a function.** A name is called when its type shows it is a closure (\`g = label\` then \`g()\`, a closure-typed parameter); a value that may be something else is refused when you save.`,
265
259
  };
@@ -55,14 +55,14 @@ Read the message's \`From\` for this, not its \`To\` — on a forward, \`To\` is
55
55
  The substance of a dealflow message is in the deck, and a deck arrives two ways. Read **both**:
56
56
 
57
57
  \`\`\`
58
- decks = vcUrlRetrieval(msg.Body, { email: @user_email })
58
+ decks = vcUrlRetrieval(msg.Body, { email: "deals@acme.test" })
59
59
  content = [msg.Body, ...msg-[a:Attachments]->.File, ...map(decks, (d) => coalesce(d.text, ""))]
60
60
  companies = extract(content, Company, { tier: "careful" })
61
61
  \`\`\`
62
62
 
63
63
  The content carries the body *and* the attached files (a PDF, a slide deck, a voice note whose spoken words are transcribed). \`vcUrlRetrieval\` covers the other channel — it finds the deck *links* in the body, works out which are decks, and loads them. Extract from the body alone and the deck never reaches the model.
64
64
 
65
- The \`email\` argument gets past an *enter your email to view* gate. \`@user_email\` — the team member responsible for the run, resolved through forwarders — is right almost always; reach for \`@actor_email\`, the raw sender of the triggering message, only when the gated link was shared with that sender rather than with the team.
65
+ The \`email\` argument gets past an *enter your email to view* gate. Give it an address the team reads, as above.
66
66
 
67
67
  Everything after the extraction is the ordinary shape: each founder written along their company's own edge, names matched with \`FUZZY\`. The extraction and patterns chapters carry it.
68
68
  `,
@@ -90,7 +90,7 @@ node Introducer: "the person who sent or forwarded this message to us" {
90
90
  }
91
91
 
92
92
  function \`Log Dealflow\`(msg: <inbox-[:Emails]->>) {
93
- decks = vcUrlRetrieval(msg.Body, { email: @user_email })
93
+ decks = vcUrlRetrieval(msg.Body, { email: "deals@acme.test" })
94
94
  content = [msg.Body, ...msg-[a:Attachments]->.File, ...map(decks, (d) => coalesce(d.text, ""))]
95
95
  companies = extract(content, Company, { tier: "careful" })
96
96
  introducer = extractOne(content, Introducer, { tier: "careful" })
@@ -55,7 +55,7 @@ changed = was != null && was.Domains != company.Domains
55
55
  write crm-[:Companies]-> {
56
56
  unique by (Name)
57
57
  Name: msg.Subject
58
- Description ?: "Owner: \${@user_email}"
58
+ Description ?: "Filed on \${@current_date}"
59
59
  }
60
60
  \`\`\`
61
61
 
@@ -83,7 +83,7 @@ A few fields take a **structured value** — an object with named keys, nested a
83
83
  \`\`\`
84
84
  Layout: {
85
85
  heading: "\${company.Name} is ready",
86
- blocks: [{ kind: "text", value: "Approved by \${@user_email}" }]
86
+ blocks: [{ kind: "text", value: "Approved on \${@current_date}" }]
87
87
  }
88
88
  \`\`\`
89
89
 
@@ -347,7 +347,7 @@ function \`Intake\`(m: <inbox-[:Emails]->>) {
347
347
  write crm-[:Companies]-> {
348
348
  unique by (Name)
349
349
  Name: m.Subject
350
- Description ?: "Owner: \${@user_email}"
350
+ Description ?: "Filed on \${@current_date}"
351
351
  }
352
352
  }
353
353
  `,
package/dist/testing.js CHANGED
@@ -76,6 +76,7 @@ const CREDENTIAL_ADAPTERS = {
76
76
  team_whatsapp: 'whatsapp',
77
77
  my_github: 'github',
78
78
  my_slack: 'slack',
79
+ hiring: 'airtable',
79
80
  };
80
81
  /**
81
82
  * The package each captured adapter is installed from, which a `connect`
@@ -93,6 +94,38 @@ const CAPTURED_PACKAGES = {
93
94
  github: '@lf/github',
94
95
  forms: '@lf/forms',
95
96
  gmail: '@lf/gmail',
97
+ airtable: '@lf/airtable',
98
+ };
99
+ const EMAIL_CLAIM = { kind: 'branded', of: 'text', brands: ['claim:email/address'] };
100
+ /**
101
+ * A host's functions, as the examples meet them: the team a platform serves
102
+ * (`import { \`@lf-platform/team\` as team } from plugins`). Whether a host
103
+ * offers any, and which, is its own choice; the language only reads what a
104
+ * plugin package declares.
105
+ */
106
+ const TEAM_PLUGINS = {
107
+ '@lf-platform/team/isMember': {
108
+ args: ['claim'],
109
+ requiredArgs: ['claim'],
110
+ argTypes: { claim: EMAIL_CLAIM },
111
+ priced: false,
112
+ effects: {},
113
+ output: { kind: 'value', type: 'boolean' },
114
+ package: '@lf-platform/team',
115
+ name: 'isMember',
116
+ pure: true,
117
+ },
118
+ '@lf-platform/team/userFor': {
119
+ args: ['claim'],
120
+ requiredArgs: ['claim'],
121
+ argTypes: { claim: EMAIL_CLAIM },
122
+ priced: false,
123
+ effects: {},
124
+ output: { kind: 'record', fields: { Id: 'text', Email: EMAIL_CLAIM, Name: 'text', Level: { kind: 'enum', options: ['read', 'write', 'admin'] } }, maybeAbsent: true },
125
+ package: '@lf-platform/team',
126
+ name: 'userFor',
127
+ pure: true,
128
+ },
96
129
  };
97
130
  /** The snapshot a run of any example would be handed. */
98
131
  exports.HANDBOOK_CATALOG = (0, movement_lang_1.mockCatalogSnapshot)({
@@ -107,7 +140,7 @@ exports.HANDBOOK_CATALOG = (0, movement_lang_1.mockCatalogSnapshot)({
107
140
  // The real registry, not a hand-kept copy: a chapter teaching an argument
108
141
  // the plugin doesn't accept fails here rather than passing against a
109
142
  // literal someone remembered to update.
110
- plugins: (0, plugins_1.bundledPluginSpecs)(),
143
+ plugins: { ...(0, plugins_1.bundledPluginSpecs)(), ...TEAM_PLUGINS },
111
144
  });
112
145
  /**
113
146
  * Probes deliberately NOT checked, each with the reason. A probe belongs here
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@listen-fire/handbook",
3
3
  "license": "Apache-2.0",
4
- "version": "0.15.2",
4
+ "version": "0.16.1",
5
5
  "description": "The movement language's handbook: the hand-written chapters, the front page, the routes into them and the language search over them. A host adds its own systems' and plugins' sections on top (the platform assembles system:* and plugin:* chapters). `testing` is the catalog every shown example is checked against, for a host's tests of its own sections.",
6
6
  "engines": {
7
7
  "node": ">=22.23.4 <23"
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "type": "commonjs",
23
23
  "peerDependencies": {
24
- "@listen-fire/engine": ">=0.15.0 <1.0.0",
25
- "@listen-fire/engine-contracts": ">=0.15.0 <1.0.0",
26
- "@listen-fire/movement-lang": ">=0.15.0 <1.0.0"
24
+ "@listen-fire/engine": ">=0.16.0 <1.0.0",
25
+ "@listen-fire/engine-contracts": ">=0.16.0 <1.0.0",
26
+ "@listen-fire/movement-lang": ">=0.16.0 <1.0.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/jest": "29.5.14",