@open-everywhere/provider-notion 0.1.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.
Files changed (186) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +21 -0
  3. package/README.md +48 -0
  4. package/agent/channels/notion-acting-identity.ts +88 -0
  5. package/agent/channels/notion-ancestry-trust.ts +458 -0
  6. package/agent/channels/notion-api.ts +1290 -0
  7. package/agent/channels/notion-bot-user.ts +250 -0
  8. package/agent/channels/notion-catch-up.ts +339 -0
  9. package/agent/channels/notion-credentials.ts +417 -0
  10. package/agent/channels/notion-engagement.ts +372 -0
  11. package/agent/channels/notion-event-normalizer.ts +587 -0
  12. package/agent/channels/notion-identity.ts +271 -0
  13. package/agent/channels/notion-ingress-drain.ts +289 -0
  14. package/agent/channels/notion-ingress.ts +182 -0
  15. package/agent/channels/notion-message-ops.ts +140 -0
  16. package/agent/channels/notion-origin-codec.ts +38 -0
  17. package/agent/channels/notion-post-arm.ts +189 -0
  18. package/agent/channels/notion-question-return.ts +223 -0
  19. package/agent/channels/notion-read.ts +283 -0
  20. package/agent/channels/notion-scope.ts +560 -0
  21. package/agent/channels/notion-stop.ts +169 -0
  22. package/agent/channels/notion-supervisor.ts +856 -0
  23. package/agent/channels/notion-webhook-timing.ts +131 -0
  24. package/agent/channels/notion-webhook-verifier.ts +55 -0
  25. package/agent/channels/notion-webhook.ts +963 -0
  26. package/agent/channels/notion-work-search.ts +74 -0
  27. package/agent/channels/notion-work.ts +144 -0
  28. package/agent/channels/notion.ts +1242 -0
  29. package/agent/contributions.ts +39 -0
  30. package/agent/docs-generated.ts +15 -0
  31. package/agent/memory/blocks.ts +295 -0
  32. package/agent/memory/memory.ts +622 -0
  33. package/agent/provider-events.ts +198 -0
  34. package/agent/register.ts +144 -0
  35. package/agent/schedules/notion-ingress.ts +20 -0
  36. package/agent/surface-parity.ts +105 -0
  37. package/agent/tools/notion_search.ts +110 -0
  38. package/agent/tools/read_notion_comments.ts +250 -0
  39. package/agent/tools/read_notion_page.ts +351 -0
  40. package/dist/agent/channels/notion-acting-identity.d.ts +23 -0
  41. package/dist/agent/channels/notion-acting-identity.d.ts.map +1 -0
  42. package/dist/agent/channels/notion-acting-identity.js +85 -0
  43. package/dist/agent/channels/notion-acting-identity.js.map +1 -0
  44. package/dist/agent/channels/notion-ancestry-trust.d.ts +208 -0
  45. package/dist/agent/channels/notion-ancestry-trust.d.ts.map +1 -0
  46. package/dist/agent/channels/notion-ancestry-trust.js +331 -0
  47. package/dist/agent/channels/notion-ancestry-trust.js.map +1 -0
  48. package/dist/agent/channels/notion-api.d.ts +655 -0
  49. package/dist/agent/channels/notion-api.d.ts.map +1 -0
  50. package/dist/agent/channels/notion-api.js +938 -0
  51. package/dist/agent/channels/notion-api.js.map +1 -0
  52. package/dist/agent/channels/notion-bot-user.d.ts +107 -0
  53. package/dist/agent/channels/notion-bot-user.d.ts.map +1 -0
  54. package/dist/agent/channels/notion-bot-user.js +192 -0
  55. package/dist/agent/channels/notion-bot-user.js.map +1 -0
  56. package/dist/agent/channels/notion-catch-up.d.ts +64 -0
  57. package/dist/agent/channels/notion-catch-up.d.ts.map +1 -0
  58. package/dist/agent/channels/notion-catch-up.js +289 -0
  59. package/dist/agent/channels/notion-catch-up.js.map +1 -0
  60. package/dist/agent/channels/notion-credentials.d.ts +210 -0
  61. package/dist/agent/channels/notion-credentials.d.ts.map +1 -0
  62. package/dist/agent/channels/notion-credentials.js +360 -0
  63. package/dist/agent/channels/notion-credentials.js.map +1 -0
  64. package/dist/agent/channels/notion-engagement.d.ts +219 -0
  65. package/dist/agent/channels/notion-engagement.d.ts.map +1 -0
  66. package/dist/agent/channels/notion-engagement.js +283 -0
  67. package/dist/agent/channels/notion-engagement.js.map +1 -0
  68. package/dist/agent/channels/notion-event-normalizer.d.ts +194 -0
  69. package/dist/agent/channels/notion-event-normalizer.d.ts.map +1 -0
  70. package/dist/agent/channels/notion-event-normalizer.js +542 -0
  71. package/dist/agent/channels/notion-event-normalizer.js.map +1 -0
  72. package/dist/agent/channels/notion-identity.d.ts +119 -0
  73. package/dist/agent/channels/notion-identity.d.ts.map +1 -0
  74. package/dist/agent/channels/notion-identity.js +205 -0
  75. package/dist/agent/channels/notion-identity.js.map +1 -0
  76. package/dist/agent/channels/notion-ingress-drain.d.ts +66 -0
  77. package/dist/agent/channels/notion-ingress-drain.d.ts.map +1 -0
  78. package/dist/agent/channels/notion-ingress-drain.js +185 -0
  79. package/dist/agent/channels/notion-ingress-drain.js.map +1 -0
  80. package/dist/agent/channels/notion-ingress.d.ts +64 -0
  81. package/dist/agent/channels/notion-ingress.d.ts.map +1 -0
  82. package/dist/agent/channels/notion-ingress.js +130 -0
  83. package/dist/agent/channels/notion-ingress.js.map +1 -0
  84. package/dist/agent/channels/notion-message-ops.d.ts +3 -0
  85. package/dist/agent/channels/notion-message-ops.d.ts.map +1 -0
  86. package/dist/agent/channels/notion-message-ops.js +126 -0
  87. package/dist/agent/channels/notion-message-ops.js.map +1 -0
  88. package/dist/agent/channels/notion-origin-codec.d.ts +7 -0
  89. package/dist/agent/channels/notion-origin-codec.d.ts.map +1 -0
  90. package/dist/agent/channels/notion-origin-codec.js +32 -0
  91. package/dist/agent/channels/notion-origin-codec.js.map +1 -0
  92. package/dist/agent/channels/notion-post-arm.d.ts +3 -0
  93. package/dist/agent/channels/notion-post-arm.d.ts.map +1 -0
  94. package/dist/agent/channels/notion-post-arm.js +185 -0
  95. package/dist/agent/channels/notion-post-arm.js.map +1 -0
  96. package/dist/agent/channels/notion-question-return.d.ts +77 -0
  97. package/dist/agent/channels/notion-question-return.d.ts.map +1 -0
  98. package/dist/agent/channels/notion-question-return.js +183 -0
  99. package/dist/agent/channels/notion-question-return.js.map +1 -0
  100. package/dist/agent/channels/notion-read.d.ts +62 -0
  101. package/dist/agent/channels/notion-read.d.ts.map +1 -0
  102. package/dist/agent/channels/notion-read.js +257 -0
  103. package/dist/agent/channels/notion-read.js.map +1 -0
  104. package/dist/agent/channels/notion-scope.d.ts +188 -0
  105. package/dist/agent/channels/notion-scope.d.ts.map +1 -0
  106. package/dist/agent/channels/notion-scope.js +433 -0
  107. package/dist/agent/channels/notion-scope.js.map +1 -0
  108. package/dist/agent/channels/notion-stop.d.ts +48 -0
  109. package/dist/agent/channels/notion-stop.d.ts.map +1 -0
  110. package/dist/agent/channels/notion-stop.js +141 -0
  111. package/dist/agent/channels/notion-stop.js.map +1 -0
  112. package/dist/agent/channels/notion-supervisor.d.ts +462 -0
  113. package/dist/agent/channels/notion-supervisor.d.ts.map +1 -0
  114. package/dist/agent/channels/notion-supervisor.js +482 -0
  115. package/dist/agent/channels/notion-supervisor.js.map +1 -0
  116. package/dist/agent/channels/notion-webhook-timing.d.ts +35 -0
  117. package/dist/agent/channels/notion-webhook-timing.d.ts.map +1 -0
  118. package/dist/agent/channels/notion-webhook-timing.js +99 -0
  119. package/dist/agent/channels/notion-webhook-timing.js.map +1 -0
  120. package/dist/agent/channels/notion-webhook-verifier.d.ts +5 -0
  121. package/dist/agent/channels/notion-webhook-verifier.d.ts.map +1 -0
  122. package/dist/agent/channels/notion-webhook-verifier.js +53 -0
  123. package/dist/agent/channels/notion-webhook-verifier.js.map +1 -0
  124. package/dist/agent/channels/notion-webhook.d.ts +242 -0
  125. package/dist/agent/channels/notion-webhook.d.ts.map +1 -0
  126. package/dist/agent/channels/notion-webhook.js +675 -0
  127. package/dist/agent/channels/notion-webhook.js.map +1 -0
  128. package/dist/agent/channels/notion-work-search.d.ts +9 -0
  129. package/dist/agent/channels/notion-work-search.d.ts.map +1 -0
  130. package/dist/agent/channels/notion-work-search.js +69 -0
  131. package/dist/agent/channels/notion-work-search.js.map +1 -0
  132. package/dist/agent/channels/notion-work.d.ts +68 -0
  133. package/dist/agent/channels/notion-work.d.ts.map +1 -0
  134. package/dist/agent/channels/notion-work.js +126 -0
  135. package/dist/agent/channels/notion-work.js.map +1 -0
  136. package/dist/agent/channels/notion.d.ts +95 -0
  137. package/dist/agent/channels/notion.d.ts.map +1 -0
  138. package/dist/agent/channels/notion.js +1081 -0
  139. package/dist/agent/channels/notion.js.map +1 -0
  140. package/dist/agent/contributions.d.ts +32 -0
  141. package/dist/agent/contributions.d.ts.map +1 -0
  142. package/dist/agent/contributions.js +37 -0
  143. package/dist/agent/contributions.js.map +1 -0
  144. package/dist/agent/docs-generated.d.ts +3 -0
  145. package/dist/agent/docs-generated.d.ts.map +1 -0
  146. package/dist/agent/docs-generated.js +13 -0
  147. package/dist/agent/docs-generated.js.map +1 -0
  148. package/dist/agent/memory/blocks.d.ts +58 -0
  149. package/dist/agent/memory/blocks.d.ts.map +1 -0
  150. package/dist/agent/memory/blocks.js +264 -0
  151. package/dist/agent/memory/blocks.js.map +1 -0
  152. package/dist/agent/memory/memory.d.ts +157 -0
  153. package/dist/agent/memory/memory.d.ts.map +1 -0
  154. package/dist/agent/memory/memory.js +471 -0
  155. package/dist/agent/memory/memory.js.map +1 -0
  156. package/dist/agent/provider-events.d.ts +3 -0
  157. package/dist/agent/provider-events.d.ts.map +1 -0
  158. package/dist/agent/provider-events.js +196 -0
  159. package/dist/agent/provider-events.js.map +1 -0
  160. package/dist/agent/register.d.ts +5 -0
  161. package/dist/agent/register.d.ts.map +1 -0
  162. package/dist/agent/register.js +128 -0
  163. package/dist/agent/register.js.map +1 -0
  164. package/dist/agent/schedules/notion-ingress.d.ts +6 -0
  165. package/dist/agent/schedules/notion-ingress.d.ts.map +1 -0
  166. package/dist/agent/schedules/notion-ingress.js +16 -0
  167. package/dist/agent/schedules/notion-ingress.js.map +1 -0
  168. package/dist/agent/surface-parity.d.ts +3 -0
  169. package/dist/agent/surface-parity.d.ts.map +1 -0
  170. package/dist/agent/surface-parity.js +99 -0
  171. package/dist/agent/surface-parity.js.map +1 -0
  172. package/dist/agent/tools/notion_search.d.ts +56 -0
  173. package/dist/agent/tools/notion_search.d.ts.map +1 -0
  174. package/dist/agent/tools/notion_search.js +100 -0
  175. package/dist/agent/tools/notion_search.js.map +1 -0
  176. package/dist/agent/tools/read_notion_comments.d.ts +57 -0
  177. package/dist/agent/tools/read_notion_comments.d.ts.map +1 -0
  178. package/dist/agent/tools/read_notion_comments.js +236 -0
  179. package/dist/agent/tools/read_notion_comments.js.map +1 -0
  180. package/dist/agent/tools/read_notion_page.d.ts +53 -0
  181. package/dist/agent/tools/read_notion_page.d.ts.map +1 -0
  182. package/dist/agent/tools/read_notion_page.js +327 -0
  183. package/dist/agent/tools/read_notion_page.js.map +1 -0
  184. package/package.json +231 -0
  185. package/tsconfig.build.json +22 -0
  186. package/tsconfig.json +15 -0
@@ -0,0 +1,196 @@
1
+ // NOTION's event inventory (OPE-1612). See the core module's header
2
+ // (packages/core/agent/routines/provider-events.ts) for what the three routing states mean.
3
+ //
4
+ // NOTION PARTITIONS BY PREFIX, NOT BY EVENT. `notionEventClass`
5
+ // (channels/notion-event-normalizer.ts) reads the type's prefix: `page.` / `database.` /
6
+ // `data_source.` are STRUCTURAL and routable, `comment.` is CONVERSATION and the ambient
7
+ // supervisor's, anything else is unrecognised. `liftNotionEvent` returns null for everything that is
8
+ // not structural, so every `comment.` row below is honestly `routing: "none"` — nothing routes it,
9
+ // even though the bundle does register a normalizer.
10
+ //
11
+ // THE MAPPING IS THE ENVELOPE'S, NOT THE TYPE'S. `notionScopePath` reads `workspace_id`, the
12
+ // `parent` object and the `entity` object, and every structural delivery carries the same three. So
13
+ // each structural row below records the same mapping; what differs between them is what the event
14
+ // MEANS, which is what the note carries. The `sub` step is the exception and it is conditional:
15
+ // `page.content_updated` names an ARRAY of updated blocks and the path takes one only when the array
16
+ // holds exactly one, because the path holds at most one step per kind.
17
+ //
18
+ // 🔴 THE PARENT-TYPE SET IS THE NORMALIZER'S REVIEWED LIST, NOT THE VENDOR'S PUBLISHED ONE. Notion's
19
+ // event reference shows a `parent` object in each sample payload but never enumerates the types it
20
+ // can take, so `notionScopePath`'s list — `space` → `group`, and `database` / `data_source` / `page`
21
+ // / `block` → `container` — is a decision somebody made, and this file records the same set. A
22
+ // `space` parent is reachable for EVERY structural family, so every structural row below lists
23
+ // `group` beside `container`: the two are alternatives on one delivery (a parent is one thing), and
24
+ // listing both is what tells a reader that a teamspace-level narrowing is available at all.
25
+ //
26
+ // The `database.` family is the vendor's older spelling. Notion's 2025-09-03 API version deprecates
27
+ // several of those in favour of the `data_source.` equivalents; both are still delivered and both
28
+ // route identically here, so both are listed.
29
+ export const NOTION_PROVIDER_EVENTS = {
30
+ source: "notion",
31
+ doc: "https://developers.notion.com/reference/webhooks-events-delivery",
32
+ events: [
33
+ {
34
+ event: "page.created",
35
+ routing: "mapped",
36
+ match: ["parent", "entity"],
37
+ scope: ["group", "container", "entity"],
38
+ note: "a page was added; the container step is its parent database, data source or page",
39
+ },
40
+ {
41
+ event: "page.properties_updated",
42
+ routing: "mapped",
43
+ match: ["parent", "entity"],
44
+ scope: ["group", "container", "entity"],
45
+ note: "a page's property values changed — a status field moving is this event, not a content edit",
46
+ },
47
+ {
48
+ event: "page.content_updated",
49
+ routing: "mapped",
50
+ match: ["parent", "entity"],
51
+ scope: ["group", "container", "entity", "sub"],
52
+ note: "a page's blocks changed; the sub step is the block, and only when the delivery names exactly one",
53
+ },
54
+ {
55
+ event: "page.moved",
56
+ routing: "mapped",
57
+ match: ["parent", "entity"],
58
+ scope: ["group", "container", "entity"],
59
+ note: "a page was moved to a different parent; the container step is the NEW parent",
60
+ },
61
+ {
62
+ event: "page.deleted",
63
+ routing: "mapped",
64
+ match: ["parent", "entity"],
65
+ scope: ["group", "container", "entity"],
66
+ note: "a page was sent to trash — the terminal event a scope path can carry and a fetch cannot",
67
+ },
68
+ {
69
+ event: "page.undeleted",
70
+ routing: "mapped",
71
+ match: ["parent", "entity"],
72
+ scope: ["group", "container", "entity"],
73
+ note: "a page was restored from trash",
74
+ },
75
+ {
76
+ event: "page.locked",
77
+ routing: "mapped",
78
+ match: ["parent", "entity"],
79
+ scope: ["group", "container", "entity"],
80
+ note: "a page was locked against edits",
81
+ },
82
+ {
83
+ event: "page.unlocked",
84
+ routing: "mapped",
85
+ match: ["parent", "entity"],
86
+ scope: ["group", "container", "entity"],
87
+ note: "a page was unlocked",
88
+ },
89
+ {
90
+ event: "database.created",
91
+ routing: "mapped",
92
+ match: ["parent", "entity"],
93
+ scope: ["group", "container", "entity"],
94
+ note: "a database was added; the group step is the teamspace, when the parent is one",
95
+ },
96
+ {
97
+ event: "database.content_updated",
98
+ routing: "mapped",
99
+ match: ["parent", "entity"],
100
+ scope: ["group", "container", "entity"],
101
+ note: "rows were added to or removed from a database",
102
+ },
103
+ {
104
+ event: "database.schema_updated",
105
+ routing: "mapped",
106
+ match: ["parent", "entity"],
107
+ scope: ["group", "container", "entity"],
108
+ note: "a database's property schema changed — the event that breaks a routine reading a column by name",
109
+ },
110
+ {
111
+ event: "database.moved",
112
+ routing: "mapped",
113
+ match: ["parent", "entity"],
114
+ scope: ["group", "container", "entity"],
115
+ note: "a database was moved to a different parent",
116
+ },
117
+ {
118
+ event: "database.deleted",
119
+ routing: "mapped",
120
+ match: ["parent", "entity"],
121
+ scope: ["group", "container", "entity"],
122
+ note: "a database was sent to trash",
123
+ },
124
+ {
125
+ event: "database.undeleted",
126
+ routing: "mapped",
127
+ match: ["parent", "entity"],
128
+ scope: ["group", "container", "entity"],
129
+ note: "a database was restored from trash",
130
+ },
131
+ {
132
+ event: "data_source.created",
133
+ routing: "mapped",
134
+ match: ["parent", "entity"],
135
+ scope: ["group", "container", "entity"],
136
+ note: "the 2025-09-03 spelling of a database creation, delivered beside the older `database.` family",
137
+ },
138
+ {
139
+ event: "data_source.content_updated",
140
+ routing: "mapped",
141
+ match: ["parent", "entity"],
142
+ scope: ["group", "container", "entity"],
143
+ note: "rows were added to or removed from a data source",
144
+ },
145
+ {
146
+ event: "data_source.schema_updated",
147
+ routing: "mapped",
148
+ match: ["parent", "entity"],
149
+ scope: ["group", "container", "entity"],
150
+ note: "a data source's property schema changed",
151
+ },
152
+ {
153
+ event: "data_source.moved",
154
+ routing: "mapped",
155
+ match: ["parent", "entity"],
156
+ scope: ["group", "container", "entity"],
157
+ note: "a data source was moved to a different parent",
158
+ },
159
+ {
160
+ event: "data_source.deleted",
161
+ routing: "mapped",
162
+ match: ["parent", "entity"],
163
+ scope: ["group", "container", "entity"],
164
+ note: "a data source was sent to trash",
165
+ },
166
+ {
167
+ event: "data_source.undeleted",
168
+ routing: "mapped",
169
+ match: ["parent", "entity"],
170
+ scope: ["group", "container", "entity"],
171
+ note: "a data source was restored from trash",
172
+ },
173
+ {
174
+ event: "comment.created",
175
+ routing: "none",
176
+ match: [],
177
+ scope: [],
178
+ note: "a comment was added; declined by the normalizer on purpose — a comment is CONVERSATION and the ambient supervisor answers it, so routing it would wake a seat twice for one event",
179
+ },
180
+ {
181
+ event: "comment.updated",
182
+ routing: "none",
183
+ match: [],
184
+ scope: [],
185
+ note: "a comment was edited; declined with the whole `comment.` family",
186
+ },
187
+ {
188
+ event: "comment.deleted",
189
+ routing: "none",
190
+ match: [],
191
+ scope: [],
192
+ note: "a comment was removed; declined with the whole `comment.` family",
193
+ },
194
+ ],
195
+ };
196
+ //# sourceMappingURL=provider-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-events.js","sourceRoot":"","sources":["../../agent/provider-events.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,4FAA4F;AAC5F,EAAE;AACF,gEAAgE;AAChE,yFAAyF;AACzF,yFAAyF;AACzF,qGAAqG;AACrG,mGAAmG;AACnG,qDAAqD;AACrD,EAAE;AACF,6FAA6F;AAC7F,oGAAoG;AACpG,kGAAkG;AAClG,gGAAgG;AAChG,qGAAqG;AACrG,uEAAuE;AACvE,EAAE;AACF,qGAAqG;AACrG,mGAAmG;AACnG,qGAAqG;AACrG,+FAA+F;AAC/F,+FAA+F;AAC/F,oGAAoG;AACpG,4FAA4F;AAC5F,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,8CAA8C;AAI9C,MAAM,CAAC,MAAM,sBAAsB,GAA6B;IA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D;YACE,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC;YACvC,IAAI,EAAE,iCAAiC;SACxC;QACD;YACE,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC;YACvC,IAAI,EAAE,uCAAuC;SAC9C;QACD;YACE,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,mLAAmL;SAC1L;QACD;YACE,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,iEAAiE;SACxE;QACD;YACE,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,kEAAkE;SACzE;KACF;CACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Perform ALL of the notion bundle's registrations. Idempotent (each register call replaces);
2
+ * cheap and side-effect-free beyond the registry writes (the memory provider's token resolves
3
+ * lazily through the credential broker only when a notion silo is actually read). */
4
+ export declare function registerNotionProvider(): void;
5
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../agent/register.ts"],"names":[],"mappings":"AAkEA;;sFAEsF;AACtF,wBAAgB,sBAAsB,IAAI,IAAI,CA0E7C"}
@@ -0,0 +1,128 @@
1
+ // registerNotionProvider — the ONE boot entry of @open-everywhere/provider-notion. The app's
2
+ // adapter-wiring module (agent/lib/register-adapters.ts) imports this STATICALLY and calls it once
3
+ // at boot; every seam the notion bundle implements registers here and nowhere else. Static imports
4
+ // only: eve bundles the agent definition and its whole import graph into one rolldown chunk — a
5
+ // literal dynamic import() code-splits and trips eve's "expected one authored module" invariant.
6
+ //
7
+ // What notion registers (and what it deliberately does NOT):
8
+ // • identity mapper — bindNotion (chat-surface plane; channels/notion-identity.ts)
9
+ // • capability manifest — midTurnPost wired via createCommentReply; no reaction primitive
10
+ // • post arm — notionPostArm (mid-turn reply + unified reply + edit + redrive helpers)
11
+ // • wake-origin codec — the stored-data notion arm (channels/notion-origin-codec.ts)
12
+ // • webhook verifier — Notion's `x-notion-signature` scheme (channels/notion-webhook-verifier.ts)
13
+ // • event normalizer + — the routing plane's two halves, STRUCTURAL events only; comments stay
14
+ // event scope grant with the ambient supervisor (channels/notion-event-normalizer.ts)
15
+ // • subtree platform — Notion honours `Surface.subtree`, and registerNotionTrustRoots is
16
+ // what core hands the declared keys to (channels/notion-ancestry-trust.ts)
17
+ // • memory provider — the read-only Notion page-subtree backing (memory/memory.ts)
18
+ // • read adapter — notionReadAdapter (channels/notion-read.ts, OPE-988): THREAD-FIRST —
19
+ // read_thread = one discussion (the default view), read_channel = the
20
+ // page's discussions, each headed by its anchor. Page CONTENT is not on
21
+ // the chat plane; the comment layer is Notion's chat surface.
22
+ // • ancillary message ops — notionMessageOps (channels/notion-message-ops.ts, OPE-1043/OPE-1047):
23
+ // postText/editMessage — the transport the stop acknowledgement
24
+ // (OPE-989's control) and the approval-decision notice now have on
25
+ // Notion. postFiles uploads through Notion's two-step file-upload API
26
+ // (notion-api.ts's uploadNotionFile) and attaches the results to a page
27
+ // comment. NO setReaction (no reaction primitive, below).
28
+ // • NO reaction surface — Notion has no integration reaction primitive
29
+ // • NO grant plane arm — personal lending BORROWS the owner's MCP tools (OPE-1136). Core
30
+ // drives that path itself through the connector's own MCP connection
31
+ // (connections/grant-mcp-borrow.ts); a provider bundle registers
32
+ // nothing for it. The REST arm this file once carried — a verb
33
+ // registry plus a `GrantTransport` spending a second REST-family
34
+ // token — is deleted.
35
+ import { registerIdentityMapper, registerCapabilityManifest, registerSurfaceParity, registerProviderEvents, registerPostArm, registerWakeOriginCodec, registerReadAdapter, registerSeatCatchUp, registerProviderDocs, registerWebhookVerifier, registerEventNormalizer, registerEventScopeGrant, registerSubtreePlatform, registerSurfaceMessageOps, } from "@open-everywhere/core/agent/adapter-api.js";
36
+ import { registerNotionTrustRoots } from "./channels/notion-ancestry-trust.js";
37
+ import { PROVIDER_DOCS } from "./docs-generated.js";
38
+ import { NOTION_SURFACE_PARITY } from "./surface-parity.js";
39
+ import { NOTION_PROVIDER_EVENTS } from "./provider-events.js";
40
+ import { bindNotion } from "./channels/notion-identity.js";
41
+ import { notionPostArm } from "./channels/notion-post-arm.js";
42
+ import { notionMessageOps } from "./channels/notion-message-ops.js";
43
+ import { notionWakeOriginCodec } from "./channels/notion-origin-codec.js";
44
+ import { notionReadAdapter } from "./channels/notion-read.js";
45
+ import { notionSeatCatchUpFetch, NOTION_TIMESTAMP_PRECISION_MS } from "./channels/notion-catch-up.js";
46
+ import { registerNotionWorkSearch } from "./channels/notion-work-search.js";
47
+ import { notionWebhookVerifier } from "./channels/notion-webhook-verifier.js";
48
+ import { notionEventNormalizer, notionEventScopeGrant } from "./channels/notion-event-normalizer.js";
49
+ import { registerNotionMemory } from "./memory/memory.js";
50
+ /** Perform ALL of the notion bundle's registrations. Idempotent (each register call replaces);
51
+ * cheap and side-effect-free beyond the registry writes (the memory provider's token resolves
52
+ * lazily through the credential broker only when a notion silo is actually read). */
53
+ export function registerNotionProvider() {
54
+ registerIdentityMapper("notion", bindNotion);
55
+ // Comment surface: mid-turn post wired via createCommentReply (the post arm's dispatchReply
56
+ // posts a new comment into the triggering discussion). No integration reaction primitive.
57
+ // closingProseDropped (OPE-811, widened by OPE-2006): a per-doc container-supervisor turn runs the
58
+ // message-tool-only gate live — it did already on a windowed domain, and now on every domain — so
59
+ // its turn-final text is dropped and `reply` is the only route out.
60
+ // 🔴 THE SURFACE-WIDE FACT NEEDS SURFACE-WIDE EVIDENCE, and here it is: `channels/notion.ts`'s
61
+ // `message.completed` is this bundle's ONLY completion handler, it routes EVERY Notion session
62
+ // through the shared `completeSupervisorTurn` arm whatever the session's shape, and it never
63
+ // delegates to the agent framework's default poster. So no Notion seat of any shape posts its
64
+ // closing prose — which is the bar `identity/capabilities.ts` sets for declaring this fact, and
65
+ // the bar Linear fails.
66
+ registerCapabilityManifest("notion", { midTurnPost: true, reactions: false, closingProseDropped: true });
67
+ // The OPE-1499 parity ledger: every capability the chat-surface contract names, answered
68
+ // `supported` or `{ unsupported: "<reason>" }`. Gates nothing at runtime — `lint:surface-parity`
69
+ // reds on an unanswered row, and the contract's §7.1/§7.1.1/§7.2 tables are generated from it.
70
+ registerSurfaceParity("notion", NOTION_SURFACE_PARITY);
71
+ // The OPE-1612 event inventory: every vendor event that could wake a routine, and how far the
72
+ // normalizer plane carries each one. Gates nothing at runtime — `lint:provider-events` reds a
73
+ // bundle that declares none or that promises a match key the normalizer does not declare, and
74
+ // the manual's inventory table is generated from it.
75
+ registerProviderEvents("notion", NOTION_PROVIDER_EVENTS);
76
+ registerPostArm(notionPostArm);
77
+ // Ancillary message ops (OPE-1043): postText/editMessage, so the stop acknowledgement
78
+ // (hooks/turn-anchor.ts's postSurfaceText) and the approval-decision notice have a transport on
79
+ // Notion. postFiles (OPE-1047) uploads via Notion's file-upload API. No setReaction (no
80
+ // reaction primitive — see below).
81
+ registerSurfaceMessageOps(notionMessageOps);
82
+ registerWakeOriginCodec("notion", notionWakeOriginCodec);
83
+ // Generic chat READ plane (OPE-988): read_channel / read_thread over the page's comment layer.
84
+ // Without this the two verbs still MOUNTED on a unified window and refused at execute time
85
+ // ("reading a notion channel is not supported yet") — the OPE-927 mount-honesty class.
86
+ registerReadAdapter(notionReadAdapter);
87
+ // THE SEAT CATCH-UP FETCH (OPE-1726): the comments this page discussion collected since the
88
+ // seat's last wake. Core's shared path applies the bounds, the admission policy and the cap.
89
+ // The surface DECLARES the unit its own message stamps carry, and core widens both catch-up
90
+ // bounds by it (OPE-1847). A wrong or missing unit bounds the seat out of its own window.
91
+ registerSeatCatchUp("notion", notionSeatCatchUpFetch, { timestampPrecisionMs: NOTION_TIMESTAMP_PRECISION_MS });
92
+ // Work-plane federated SEARCH (OPE-961): the ONE `search` tool's Notion half. Grant-gated like
93
+ // notion_search.ts, and now registered here too so the federator can find it.
94
+ registerNotionWorkSearch();
95
+ // Webhook-verifier plane (OPE-164): Notion's `x-notion-signature` scheme, so a GENERIC hook can
96
+ // declare `source: "notion"` and be verified the way Notion signs. Changes no existing route.
97
+ registerWebhookVerifier(notionWebhookVerifier);
98
+ // ⚠️ NO PROVISIONING DECLARATION, AND THAT IS NOT AN OMISSION (OPE-207). Notion's signing key is
99
+ // its own `verification_token`, which arrives once in an unauthenticated setup POST — so it can
100
+ // never be a key WE mint, and `notionWebhookVerifier`'s `keyOrigin: "vendor-issued"` is what keeps
101
+ // `source: "notion"` out of the chat-creatable vocabulary. A declaration + setup exchange for that
102
+ // arm shipped and was deleted: nothing could put a hook into the status the arm required, so it was
103
+ // reachable by no route. A Notion hook is a CONFIG hook (its secret arrives through
104
+ // `webhooks/handshake-capture.ts` on the provider's own front door) until that changes.
105
+ // Event plane (OPE-189) — the FIRST bundle-resident normalizer + scope grant in the tree. Both
106
+ // registered on ADJACENT lines on purpose: `checkEventReadGrant` fail-closes to
107
+ // `no-grant-adapter` when a grant is missing, so a normalizer registered ALONE would produce a
108
+ // source where every match is skipped with an audited refusal and nothing says why.
109
+ // The normalizer routes `page.*`/`database.*`/`data_source.*` (work) and returns null for
110
+ // `comment.*` (conversation — the ambient supervisor's, above); see notion-event-normalizer.ts.
111
+ registerEventNormalizer(notionEventNormalizer);
112
+ registerEventScopeGrant(notionEventScopeGrant);
113
+ // Subtree-trust plane (OPE-539): Notion is the one platform whose surface key carries no
114
+ // hierarchy — a page id names a page that can hold pages — so it is the one platform that honours
115
+ // `defineSurface({ …, subtree: true })`. Core carries the claim and hands the keys here; this
116
+ // module walks the parent chain at ingestion. Declaring the capability is also what makes the same
117
+ // word on slack/github/teams a BOOT ERROR instead of a line that grants nothing.
118
+ registerSubtreePlatform("notion", registerNotionTrustRoots);
119
+ // Memory plane: a read-only silo with provider:"notion", container:"<root-page-id>" resolves to
120
+ // that Notion page + all its child pages, pulled recursively (docs/capabilities/memory.md). The
121
+ // integration token resolves LAZILY through the credential broker (default ref NOTION_TOKEN).
122
+ registerNotionMemory();
123
+ // Shipped-manual plane (OPE-138): this bundle's own setup runbook (docs/deploy/surfaces/notion.md,
124
+ // compiled into ./docs-generated.ts because docs/ is not on disk at runtime). De-select the bundle
125
+ // and the module leaves the import graph; registerProviderDocs re-checks the selection gate anyway.
126
+ registerProviderDocs("notion", PROVIDER_DOCS);
127
+ }
128
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../agent/register.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,mGAAmG;AACnG,mGAAmG;AACnG,gGAAgG;AAChG,iGAAiG;AACjG,EAAE;AACF,6DAA6D;AAC7D,4FAA4F;AAC5F,+FAA+F;AAC/F,uGAAuG;AACvG,4FAA4F;AAC5F,0GAA0G;AAC1G,qGAAqG;AACrG,iGAAiG;AACjG,iGAAiG;AACjG,wGAAwG;AACxG,4FAA4F;AAC5F,oGAAoG;AACpG,mGAAmG;AACnG,qGAAqG;AACrG,2FAA2F;AAC3F,qGAAqG;AACrG,6FAA6F;AAC7F,gGAAgG;AAChG,mGAAmG;AACnG,qGAAqG;AACrG,uFAAuF;AACvF,4EAA4E;AAC5E,+FAA+F;AAC/F,kGAAkG;AAClG,8FAA8F;AAC9F,4FAA4F;AAC5F,8FAA8F;AAC9F,mDAAmD;AAEnD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,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AAuB,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;IAC5D,gGAAgG;IAChG,gGAAgG;IAChG,8FAA8F;IAC9F,oBAAoB,EAAE,CAAC;IACvB,mGAAmG;IACnG,mGAAmG;IACnG,oGAAoG;IACpG,oBAAoB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ cron: string;
3
+ run(): Promise<void>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=notion-ingress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-ingress.d.ts","sourceRoot":"","sources":["../../../agent/schedules/notion-ingress.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ // Recovery clock for authenticated Notion deliveries. The public route nudges the same drain
2
+ // immediately, but this minute tick is the durable guarantee after a process dies between commit
3
+ // and that nudge. It sends row keys only; the private route atomically claims and loads payload.
4
+ import { defineSchedule } from "eve/schedules";
5
+ import { deploymentOrg, getOperationalStore } from "@open-everywhere/core/agent/adapter-api.js";
6
+ import { recoverNotionIngress } from "../channels/notion-ingress-drain.js";
7
+ export default defineSchedule({
8
+ cron: "* * * * *",
9
+ async run() {
10
+ const result = await recoverNotionIngress(deploymentOrg(), getOperationalStore());
11
+ if (result.due > 0) {
12
+ console.log(`[open-everywhere:notion] ingress recovery: ${result.due} due -> ${result.posted} posted, ${result.failed} failed`);
13
+ }
14
+ },
15
+ });
16
+ //# sourceMappingURL=notion-ingress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion-ingress.js","sourceRoot":"","sources":["../../../agent/schedules/notion-ingress.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,iGAAiG;AACjG,iGAAiG;AAEjG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,eAAe,cAAc,CAAC;IAC5B,IAAI,EAAE,WAAW;IACjB,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,aAAa,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAClF,IAAI,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CACT,8CAA8C,MAAM,CAAC,GAAG,WAAW,MAAM,CAAC,MAAM,YAAY,MAAM,CAAC,MAAM,SAAS,CACnH,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { SurfaceParityDeclaration } from "@open-everywhere/core/agent/adapter-api.js";
2
+ export declare const NOTION_SURFACE_PARITY: SurfaceParityDeclaration;
3
+ //# sourceMappingURL=surface-parity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface-parity.d.ts","sourceRoot":"","sources":["../../agent/surface-parity.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAE3F,eAAO,MAAM,qBAAqB,EAAE,wBA8FnC,CAAC"}
@@ -0,0 +1,99 @@
1
+ // NOTION's surface-parity declaration (OPE-1499). See the core module's header
2
+ // (packages/core/agent/identity/surface-parity.ts) for what the three cell shapes mean.
3
+ //
4
+ // Notion is THREAD-FIRST and the inverse of Slack: a comment carries `discussion_id` from birth, a
5
+ // new top-level comment MINTS a discussion, and there is no bare-channel state at all (§4.6.1). It
6
+ // is also the one surface with no @mention of an integration, so its addressed leg keys on a
7
+ // name-drop or structured mention instead — which is why those two rows read the way they do.
8
+ export const NOTION_SURFACE_PARITY = {
9
+ // --- registration seams (§7.1) ---------------------------------------------------------------
10
+ "identity-mapper": "supported",
11
+ "capability-manifest": "supported",
12
+ "post-arm": "supported",
13
+ "wake-origin-codec": "supported",
14
+ "unified-action-plane": {
15
+ unsupported: "a Notion discussion comment is rich text with no component plane — the API offers no tappable button an integration may render into one, so there is nothing for a tap route to receive. The bridged approval posts as prose, which the question bridge already renders complete",
16
+ },
17
+ "origin-placement-carry": {
18
+ unsupported: "the placement is INSIDE the conversation identity: a reply targets `discussionId`, which is exactly what `threadRef` keys on, so two origins that pass the conversation test name the same discussion and cannot disagree about placement",
19
+ },
20
+ "read-adapter": "supported",
21
+ // 🔴 PERMANENT, and confirmed in BOTH directions (OPE-1502, developers.notion.com read
22
+ // 2026-09-07). The webhook catalogue carries page, database, data-source and comment events and
23
+ // no reaction event of any kind; the comment object carries `rich_text`, `attachments` and
24
+ // `display_name` and no reactions field. So there is nothing to receive and nothing to poll —
25
+ // unlike GitHub, where the absent webhook still leaves a REST route to read.
26
+ "reaction-feedback-ingest": { unsupported: "vendor limit — Notion pushes no reaction event and its comment object exposes no reaction resource, so there is nothing to receive and nothing to poll" },
27
+ "ancillary-ops": "supported",
28
+ "ambient-engagement-seam": "supported",
29
+ // `notionWakeAddressing` (channels/notion-engagement.ts) carries the seam's own `deliver` verdict
30
+ // to the `notion.dispatched` row, so an engaged follow-up reads `thread-follow` and ambient page
31
+ // chatter still reads `channel-watch`. The row also carries `via`, which names the DOMAIN ORIGIN
32
+ // the addressed door gated on — that field is Notion's alone (OPE-1510).
33
+ "engaged-row-promotion": "supported",
34
+ // Notion is thread-first: every wake arrives scoped to one discussion, so every wake this surface
35
+ // diverts is thread-scoped and consults ownership.
36
+ "owned-thread-ingress": "supported",
37
+ // --- wake legs and conversation shapes -------------------------------------------------------
38
+ // Notion lets no user @mention an internal integration, so the old mention gate was structurally
39
+ // dead (channels/notion-webhook.ts). A `direct` Notion wake is an ADDRESSED, single-author
40
+ // comment recognised by a name-drop or structured mention — the leg exists, by another route.
41
+ "addressed-leg": { supported: "the `direct` wake — a name-drop or structured mention, not a platform @mention" },
42
+ // The ambient supervisor, a different mechanism from the §2.5 registry: the domain opt-in decides
43
+ // whether it runs, and the registry has never gated that. Since OPE-1501 the registry both
44
+ // SUPPRESSES it (a stood-down page) and OPENS it (an engaged page wakes without the opt-in).
45
+ "ambient-leg": { supported: "the ambient supervisor, not the §2.5 engagement registry" },
46
+ // `notion-catch-up.ts` re-reads the seat's own discussion (a single block's inline comments) over
47
+ // the same brokered credential `read_channel` uses, keeping what is newer than the seat's own
48
+ // `lastWakeAt`. Notion's comments endpoint takes no `since`, so the bound is applied on our side.
49
+ "seat-catch-up": "supported",
50
+ // The slot is EMPTY on this surface: `notion.ts` builds no `contextLines`, so there is no pour to
51
+ // police. The seat's room context is the catch-up read above, which core already admits.
52
+ "seat-context-admission": { unsupported: "the hydration fills no context-line slot — the seat's room context is the catch-up read, which core already admits" },
53
+ // A Notion comment carries no component plane — no button, no tap route. See the roster row for
54
+ // what that costs and where it does NOT cost anything.
55
+ "approval-card": { unsupported: "a page comment carries no component plane, so there is no button to render and no route for a tap. A governed act that takes the venue walk is redirected to a card-capable room in the SAME domain, or refused when the domain holds none. The paths OUTSIDE that walk do not: the spend checkpoint (spend/checkpoint.ts `requireSessionContinuation`) fails OPEN here and records the crossing in an audit row instead" },
56
+ // THE TRACE ARRIVES EVEN THOUGH THE BUTTON CANNOT (OPE-1854). A judge-lifted act posts its
57
+ // notice here as a plain page comment through the shared road (`postJudgeLiftNotice`), on this
58
+ // surface's own `SurfaceMessageOps` transport. It carries the overrule as an INSTRUCTION in
59
+ // words, with the action id a reviewer finds the act by, because no tap can land here.
60
+ // 🔴 BARE, NOT `{ supported: "…" }`. A noted cell is exempt from the overclaim arm, and the
61
+ // arm is the point: drop this bundle's text transport and the notice silently stops arriving.
62
+ "judge-lift-notice": "supported",
63
+ "name-drop-mention": "supported",
64
+ // 🔴 STEP 4 OF THE WEBHOOK ADMITS ONE EVENT TYPE. `handleNotionDelivery` answers `ignored` for
65
+ // anything that is not `comment.created`, so `comment.updated` returns above the classifier, the
66
+ // ambient gate and the engagement seam alike.
67
+ "message-edit-wake": { unsupported: "the webhook admits `comment.created` only — `comment.updated` answers `ignored` at step 4" },
68
+ // ONE discussion. A Notion wake always arrives thread-scoped (§4.6.1).
69
+ threads: { supported: "thread-first — every wake arrives scoped to one discussion" },
70
+ // A STANDING room, not §4.5's read_channel container — Notion has the latter (the page's
71
+ // discussions) and `read_channel` is supported below. A discussion is minted by its first comment
72
+ // and is anchored to one block, so nothing on this surface predates the conversation in it.
73
+ rooms: { unsupported: "no standing container — a discussion is minted by its first comment and anchored to one block" },
74
+ dm: { unsupported: "no DM plane — Notion carries no person-to-person message channel" },
75
+ mpim: { unsupported: "no DM plane — Notion carries no person-to-person message channel" },
76
+ // --- core verbs (§7.2) -----------------------------------------------------------------------
77
+ reply: "supported",
78
+ edit_reply: "supported",
79
+ react: { unsupported: "vendor limit — the Notion comment API exposes no reaction write" },
80
+ no_reply: "supported",
81
+ read_channel: "supported",
82
+ read_thread: "supported",
83
+ search: "supported",
84
+ // Unbuilt, not impossible — see OPE-1507. The transport is registered; the missing piece is the
85
+ // `channel` row in `access/resource-grant.ts`'s closed `RESOURCE_TYPES` table.
86
+ post_message: { unsupported: "not built yet — no `channel` row in `access/resource-grant.ts` — OPE-1507" },
87
+ dm_person: { unsupported: "no DM plane — Notion carries no person-to-person message channel (§4.7.2)" },
88
+ set_dm_delivery: { unsupported: "no DM plane — the verb mounts only inside a 1:1 DM (§4.7.2)" },
89
+ // The direction matters: a human's stop needs an INBOUND reaction event, and Notion's webhook
90
+ // catalogue carries none (notion-stop.ts's banner is the vendor evidence). Whether OE can WRITE a
91
+ // reaction is a different limit, and it is the one the two rows below name.
92
+ stop: { supported: "a comment whose entire body is `stop` — Notion pushes no reaction webhook" },
93
+ ack_stop_glyph: { unsupported: "vendor limit — the Notion comment API exposes no reaction write, so there is no glyph to place" },
94
+ ack_cancel_note: "supported",
95
+ stand_down: { supported: "marks the page row; refuses when no row exists" },
96
+ // OPE-1047. Notion accepts at most three files per comment — its own vendor cap.
97
+ post_file: { supported: "at most 3 files per post — a Notion comment's own vendor cap" },
98
+ };
99
+ //# sourceMappingURL=surface-parity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface-parity.js","sourceRoot":"","sources":["../../agent/surface-parity.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wFAAwF;AACxF,EAAE;AACF,mGAAmG;AACnG,mGAAmG;AACnG,6FAA6F;AAC7F,8FAA8F;AAI9F,MAAM,CAAC,MAAM,qBAAqB,GAA6B;IAC7D,gGAAgG;IAChG,iBAAiB,EAAE,WAAW;IAC9B,qBAAqB,EAAE,WAAW;IAClC,UAAU,EAAE,WAAW;IACvB,mBAAmB,EAAE,WAAW;IAChC,sBAAsB,EAAE;QACtB,WAAW,EACT,kRAAkR;KACrR;IACD,wBAAwB,EAAE;QACxB,WAAW,EACT,2OAA2O;KAC9O;IACD,cAAc,EAAE,WAAW;IAC3B,uFAAuF;IACvF,gGAAgG;IAChG,2FAA2F;IAC3F,8FAA8F;IAC9F,6EAA6E;IAC7E,0BAA0B,EAAE,EAAE,WAAW,EAAE,wJAAwJ,EAAE;IACrM,eAAe,EAAE,WAAW;IAC5B,yBAAyB,EAAE,WAAW;IACtC,kGAAkG;IAClG,iGAAiG;IACjG,iGAAiG;IACjG,yEAAyE;IACzE,uBAAuB,EAAE,WAAW;IACpC,kGAAkG;IAClG,mDAAmD;IACnD,sBAAsB,EAAE,WAAW;IAEnC,gGAAgG;IAChG,iGAAiG;IACjG,2FAA2F;IAC3F,8FAA8F;IAC9F,eAAe,EAAE,EAAE,SAAS,EAAE,gFAAgF,EAAE;IAChH,kGAAkG;IAClG,2FAA2F;IAC3F,6FAA6F;IAC7F,aAAa,EAAE,EAAE,SAAS,EAAE,0DAA0D,EAAE;IACxF,kGAAkG;IAClG,8FAA8F;IAC9F,kGAAkG;IAClG,eAAe,EAAE,WAAW;IAC5B,kGAAkG;IAClG,yFAAyF;IACzF,wBAAwB,EAAE,EAAE,WAAW,EAAE,oHAAoH,EAAE;IAC/J,gGAAgG;IAChG,uDAAuD;IACvD,eAAe,EAAE,EA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AC"}
@@ -0,0 +1,56 @@
1
+ export declare const notionSearchEntry: import("eve/tools").ToolDefinition<{
2
+ query: string;
3
+ limit?: number | undefined;
4
+ kind?: "database" | "page" | undefined;
5
+ }, {
6
+ query: string;
7
+ hits: {
8
+ id: string;
9
+ object: string;
10
+ title: string;
11
+ url?: string | undefined;
12
+ }[];
13
+ }> & {
14
+ execute(input: {
15
+ query: string;
16
+ limit?: number | undefined;
17
+ kind?: "database" | "page" | undefined;
18
+ }, ctx: import("eve/tools").ToolContext): Promise<{
19
+ query: string;
20
+ hits: {
21
+ id: string;
22
+ object: string;
23
+ title: string;
24
+ url?: string;
25
+ }[];
26
+ }>;
27
+ };
28
+ declare const _default: import("eve/tools").DynamicSentinel<(import("eve/tools").ToolDefinition<{
29
+ query: string;
30
+ limit?: number | undefined;
31
+ kind?: "database" | "page" | undefined;
32
+ }, {
33
+ query: string;
34
+ hits: {
35
+ id: string;
36
+ object: string;
37
+ title: string;
38
+ url?: string | undefined;
39
+ }[];
40
+ }> & {
41
+ execute(input: {
42
+ query: string;
43
+ limit?: number | undefined;
44
+ kind?: "database" | "page" | undefined;
45
+ }, ctx: import("eve/tools").ToolContext): Promise<{
46
+ query: string;
47
+ hits: {
48
+ id: string;
49
+ object: string;
50
+ title: string;
51
+ url?: string;
52
+ }[];
53
+ }>;
54
+ }) | null>;
55
+ export default _default;
56
+ //# sourceMappingURL=notion_search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notion_search.d.ts","sourceRoot":"","sources":["../../../agent/tools/notion_search.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD5B,CAAC"}