context.dev 2.21.0 → 2.22.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +4 -9
  5. data/lib/context_dev/models/batch_cancel_params.rb +2 -2
  6. data/lib/context_dev/models/batch_cancel_response.rb +16 -21
  7. data/lib/context_dev/models/batch_delete_params.rb +2 -2
  8. data/lib/context_dev/models/batch_delete_response.rb +8 -8
  9. data/lib/context_dev/models/batch_get_results_params.rb +2 -2
  10. data/lib/context_dev/models/batch_get_results_response.rb +17 -22
  11. data/lib/context_dev/models/batch_list_response.rb +38 -47
  12. data/lib/context_dev/models/batch_retrieve_params.rb +2 -2
  13. data/lib/context_dev/models/batch_retrieve_response.rb +37 -46
  14. data/lib/context_dev/models/batch_submit_params.rb +80 -109
  15. data/lib/context_dev/models/batch_submit_response.rb +18 -28
  16. data/lib/context_dev/models/brand_retrieve_params.rb +90 -149
  17. data/lib/context_dev/models/brand_retrieve_response.rb +18 -22
  18. data/lib/context_dev/models/brand_search_params.rb +2 -3
  19. data/lib/context_dev/models/brand_search_response.rb +8 -8
  20. data/lib/context_dev/models/crawl_controls.rb +1 -2
  21. data/lib/context_dev/models/feedback_submit_params.rb +2 -2
  22. data/lib/context_dev/models/feedback_submit_response.rb +8 -8
  23. data/lib/context_dev/models/industry_retrieve_naics_params.rb +17 -32
  24. data/lib/context_dev/models/industry_retrieve_naics_response.rb +10 -10
  25. data/lib/context_dev/models/industry_retrieve_sic_params.rb +20 -39
  26. data/lib/context_dev/models/industry_retrieve_sic_response.rb +10 -10
  27. data/lib/context_dev/models/intake.rb +7 -13
  28. data/lib/context_dev/models/log_list_response.rb +14 -10
  29. data/lib/context_dev/models/log_retrieve_response.rb +15 -41
  30. data/lib/context_dev/models/monitor_create_params.rb +238 -72
  31. data/lib/context_dev/models/monitor_create_response.rb +364 -175
  32. data/lib/context_dev/models/monitor_delete_params.rb +3 -1
  33. data/lib/context_dev/models/monitor_delete_response.rb +44 -1
  34. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +43 -1
  35. data/lib/context_dev/models/monitor_get_limits_response.rb +47 -7
  36. data/lib/context_dev/models/monitor_list_account_changes_response.rb +143 -20
  37. data/lib/context_dev/models/monitor_list_account_runs_response.rb +50 -8
  38. data/lib/context_dev/models/monitor_list_changes_params.rb +2 -1
  39. data/lib/context_dev/models/monitor_list_changes_response.rb +143 -20
  40. data/lib/context_dev/models/monitor_list_params.rb +3 -3
  41. data/lib/context_dev/models/monitor_list_response.rb +304 -106
  42. data/lib/context_dev/models/monitor_list_runs_params.rb +2 -1
  43. data/lib/context_dev/models/monitor_list_runs_response.rb +50 -8
  44. data/lib/context_dev/models/monitor_retrieve_change_params.rb +3 -1
  45. data/lib/context_dev/models/monitor_retrieve_change_response.rb +45 -15
  46. data/lib/context_dev/models/monitor_retrieve_params.rb +3 -1
  47. data/lib/context_dev/models/monitor_retrieve_response.rb +361 -171
  48. data/lib/context_dev/models/monitor_retrieve_run_params.rb +6 -2
  49. data/lib/context_dev/models/monitor_retrieve_run_response.rb +45 -8
  50. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +3 -1
  51. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +364 -172
  52. data/lib/context_dev/models/monitor_run_params.rb +3 -1
  53. data/lib/context_dev/models/monitor_run_response.rb +42 -4
  54. data/lib/context_dev/models/monitor_update_params.rb +239 -71
  55. data/lib/context_dev/models/monitor_update_response.rb +361 -171
  56. data/lib/context_dev/models/news_search_params.rb +10 -6
  57. data/lib/context_dev/models/news_search_response.rb +8 -8
  58. data/lib/context_dev/models/parse_handle_params.rb +9 -20
  59. data/lib/context_dev/models/parse_handle_response.rb +8 -8
  60. data/lib/context_dev/models/person_enrich_params.rb +76 -50
  61. data/lib/context_dev/models/person_enrich_response.rb +8 -8
  62. data/lib/context_dev/models/utility_prefetch_params.rb +15 -29
  63. data/lib/context_dev/models/utility_prefetch_response.rb +10 -10
  64. data/lib/context_dev/models/web_answers_params.rb +28 -47
  65. data/lib/context_dev/models/web_answers_response.rb +9 -8
  66. data/lib/context_dev/models/web_extract_competitors_params.rb +17 -32
  67. data/lib/context_dev/models/web_extract_competitors_response.rb +8 -8
  68. data/lib/context_dev/models/web_extract_styleguide_params.rb +22 -44
  69. data/lib/context_dev/models/web_extract_styleguide_response.rb +34 -44
  70. data/lib/context_dev/models/web_map_urls_params.rb +30 -51
  71. data/lib/context_dev/models/web_map_urls_response.rb +8 -8
  72. data/lib/context_dev/models/web_scrape_params.rb +193 -191
  73. data/lib/context_dev/models/web_scrape_response.rb +219 -95
  74. data/lib/context_dev/models/web_screenshot_params.rb +20 -39
  75. data/lib/context_dev/models/web_screenshot_response.rb +18 -28
  76. data/lib/context_dev/models/web_search_params.rb +76 -65
  77. data/lib/context_dev/models/web_search_response.rb +68 -27
  78. data/lib/context_dev/models/web_web_crawl_md_params.rb +41 -70
  79. data/lib/context_dev/models/web_web_crawl_md_response.rb +11 -15
  80. data/lib/context_dev/models/webhook_delivery.rb +3 -7
  81. data/lib/context_dev/models/webhooks/attempt.rb +3 -3
  82. data/lib/context_dev/models/webhooks/delivery.rb +16 -11
  83. data/lib/context_dev/models/webhooks/delivery_list_attempts_params.rb +2 -6
  84. data/lib/context_dev/models/webhooks/delivery_list_attempts_response.rb +8 -8
  85. data/lib/context_dev/models/webhooks/delivery_list_params.rb +4 -4
  86. data/lib/context_dev/models/webhooks/delivery_list_response.rb +8 -8
  87. data/lib/context_dev/models/webhooks/delivery_retrieve_params.rb +2 -6
  88. data/lib/context_dev/models/webhooks/delivery_retrieve_response.rb +8 -8
  89. data/lib/context_dev/models/webhooks/delivery_retry_params.rb +4 -4
  90. data/lib/context_dev/models/webhooks/delivery_retry_response.rb +8 -8
  91. data/lib/context_dev/models/webhooks/delivery_summary.rb +16 -11
  92. data/lib/context_dev/resources/batch.rb +17 -16
  93. data/lib/context_dev/resources/brand.rb +6 -8
  94. data/lib/context_dev/resources/feedback.rb +4 -5
  95. data/lib/context_dev/resources/industry.rb +9 -11
  96. data/lib/context_dev/resources/logs.rb +4 -5
  97. data/lib/context_dev/resources/monitors.rb +50 -53
  98. data/lib/context_dev/resources/news.rb +4 -8
  99. data/lib/context_dev/resources/parse.rb +4 -5
  100. data/lib/context_dev/resources/people.rb +11 -13
  101. data/lib/context_dev/resources/utility.rb +4 -11
  102. data/lib/context_dev/resources/web.rb +69 -94
  103. data/lib/context_dev/resources/webhooks/deliveries.rb +10 -18
  104. data/lib/context_dev/resources/webhooks.rb +1 -1
  105. data/lib/context_dev/version.rb +1 -1
  106. data/rbi/context_dev/client.rbi +4 -9
  107. data/rbi/context_dev/models/batch_cancel_params.rbi +2 -2
  108. data/rbi/context_dev/models/batch_cancel_response.rbi +17 -21
  109. data/rbi/context_dev/models/batch_delete_params.rbi +2 -2
  110. data/rbi/context_dev/models/batch_delete_response.rbi +9 -9
  111. data/rbi/context_dev/models/batch_get_results_params.rbi +2 -2
  112. data/rbi/context_dev/models/batch_get_results_response.rbi +18 -26
  113. data/rbi/context_dev/models/batch_list_response.rbi +41 -53
  114. data/rbi/context_dev/models/batch_retrieve_params.rbi +2 -2
  115. data/rbi/context_dev/models/batch_retrieve_response.rbi +40 -52
  116. data/rbi/context_dev/models/batch_submit_params.rbi +87 -147
  117. data/rbi/context_dev/models/batch_submit_response.rbi +19 -31
  118. data/rbi/context_dev/models/brand_retrieve_params.rbi +99 -190
  119. data/rbi/context_dev/models/brand_retrieve_response.rbi +19 -25
  120. data/rbi/context_dev/models/brand_search_params.rbi +2 -4
  121. data/rbi/context_dev/models/brand_search_response.rbi +9 -9
  122. data/rbi/context_dev/models/crawl_controls.rbi +1 -2
  123. data/rbi/context_dev/models/feedback_submit_params.rbi +2 -2
  124. data/rbi/context_dev/models/feedback_submit_response.rbi +9 -9
  125. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +19 -42
  126. data/rbi/context_dev/models/industry_retrieve_naics_response.rbi +11 -11
  127. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +22 -51
  128. data/rbi/context_dev/models/industry_retrieve_sic_response.rbi +11 -11
  129. data/rbi/context_dev/models/intake.rbi +7 -19
  130. data/rbi/context_dev/models/log_list_response.rbi +13 -11
  131. data/rbi/context_dev/models/log_retrieve_response.rbi +13 -76
  132. data/rbi/context_dev/models/monitor_create_params.rbi +418 -78
  133. data/rbi/context_dev/models/monitor_create_response.rbi +654 -287
  134. data/rbi/context_dev/models/monitor_delete_params.rbi +6 -1
  135. data/rbi/context_dev/models/monitor_delete_response.rbi +89 -3
  136. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +77 -3
  137. data/rbi/context_dev/models/monitor_get_limits_response.rbi +83 -10
  138. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +236 -24
  139. data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +86 -12
  140. data/rbi/context_dev/models/monitor_list_changes_params.rbi +2 -0
  141. data/rbi/context_dev/models/monitor_list_changes_response.rbi +234 -24
  142. data/rbi/context_dev/models/monitor_list_params.rbi +4 -4
  143. data/rbi/context_dev/models/monitor_list_response.rbi +502 -130
  144. data/rbi/context_dev/models/monitor_list_runs_params.rbi +2 -0
  145. data/rbi/context_dev/models/monitor_list_runs_response.rbi +84 -12
  146. data/rbi/context_dev/models/monitor_retrieve_change_params.rbi +6 -1
  147. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +79 -15
  148. data/rbi/context_dev/models/monitor_retrieve_params.rbi +6 -1
  149. data/rbi/context_dev/models/monitor_retrieve_response.rbi +654 -283
  150. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +9 -1
  151. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +77 -9
  152. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +6 -1
  153. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +659 -288
  154. data/rbi/context_dev/models/monitor_run_params.rbi +6 -1
  155. data/rbi/context_dev/models/monitor_run_response.rbi +82 -9
  156. data/rbi/context_dev/models/monitor_update_params.rbi +420 -75
  157. data/rbi/context_dev/models/monitor_update_response.rbi +650 -281
  158. data/rbi/context_dev/models/news_search_params.rbi +10 -2
  159. data/rbi/context_dev/models/news_search_response.rbi +9 -9
  160. data/rbi/context_dev/models/parse_handle_params.rbi +10 -29
  161. data/rbi/context_dev/models/parse_handle_response.rbi +9 -9
  162. data/rbi/context_dev/models/person_enrich_params.rbi +86 -44
  163. data/rbi/context_dev/models/person_enrich_response.rbi +9 -9
  164. data/rbi/context_dev/models/utility_prefetch_params.rbi +15 -27
  165. data/rbi/context_dev/models/utility_prefetch_response.rbi +11 -11
  166. data/rbi/context_dev/models/web_answers_params.rbi +33 -63
  167. data/rbi/context_dev/models/web_answers_response.rbi +11 -9
  168. data/rbi/context_dev/models/web_extract_competitors_params.rbi +19 -42
  169. data/rbi/context_dev/models/web_extract_competitors_response.rbi +9 -9
  170. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +25 -61
  171. data/rbi/context_dev/models/web_extract_styleguide_response.rbi +36 -51
  172. data/rbi/context_dev/models/web_map_urls_params.rbi +33 -68
  173. data/rbi/context_dev/models/web_map_urls_response.rbi +9 -9
  174. data/rbi/context_dev/models/web_scrape_params.rbi +212 -206
  175. data/rbi/context_dev/models/web_scrape_response.rbi +296 -120
  176. data/rbi/context_dev/models/web_screenshot_params.rbi +22 -51
  177. data/rbi/context_dev/models/web_screenshot_response.rbi +20 -35
  178. data/rbi/context_dev/models/web_search_params.rbi +114 -82
  179. data/rbi/context_dev/models/web_search_response.rbi +145 -33
  180. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +45 -95
  181. data/rbi/context_dev/models/web_web_crawl_md_response.rbi +12 -18
  182. data/rbi/context_dev/models/webhook_delivery.rbi +3 -9
  183. data/rbi/context_dev/models/webhooks/attempt.rbi +3 -3
  184. data/rbi/context_dev/models/webhooks/delivery.rbi +14 -11
  185. data/rbi/context_dev/models/webhooks/delivery_list_attempts_params.rbi +2 -4
  186. data/rbi/context_dev/models/webhooks/delivery_list_attempts_response.rbi +9 -9
  187. data/rbi/context_dev/models/webhooks/delivery_list_params.rbi +4 -4
  188. data/rbi/context_dev/models/webhooks/delivery_list_response.rbi +9 -9
  189. data/rbi/context_dev/models/webhooks/delivery_retrieve_params.rbi +2 -4
  190. data/rbi/context_dev/models/webhooks/delivery_retrieve_response.rbi +9 -9
  191. data/rbi/context_dev/models/webhooks/delivery_retry_params.rbi +4 -4
  192. data/rbi/context_dev/models/webhooks/delivery_retry_response.rbi +9 -9
  193. data/rbi/context_dev/models/webhooks/delivery_summary.rbi +14 -11
  194. data/rbi/context_dev/resources/batch.rbi +19 -18
  195. data/rbi/context_dev/resources/brand.rbi +6 -9
  196. data/rbi/context_dev/resources/feedback.rbi +4 -5
  197. data/rbi/context_dev/resources/industry.rbi +11 -27
  198. data/rbi/context_dev/resources/logs.rbi +4 -5
  199. data/rbi/context_dev/resources/monitors.rbi +71 -49
  200. data/rbi/context_dev/resources/news.rbi +4 -8
  201. data/rbi/context_dev/resources/parse.rbi +7 -14
  202. data/rbi/context_dev/resources/people.rbi +15 -13
  203. data/rbi/context_dev/resources/utility.rbi +4 -11
  204. data/rbi/context_dev/resources/web.rbi +89 -190
  205. data/rbi/context_dev/resources/webhooks/deliveries.rbi +10 -12
  206. data/rbi/context_dev/resources/webhooks.rbi +1 -1
  207. data/sig/context_dev/models/log_retrieve_response.rbs +0 -28
  208. data/sig/context_dev/models/monitor_create_params.rbs +113 -0
  209. data/sig/context_dev/models/monitor_create_response.rbs +203 -53
  210. data/sig/context_dev/models/monitor_delete_response.rbs +46 -3
  211. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +36 -3
  212. data/sig/context_dev/models/monitor_get_limits_response.rbs +36 -3
  213. data/sig/context_dev/models/monitor_list_account_changes_response.rbs +111 -8
  214. data/sig/context_dev/models/monitor_list_account_runs_response.rbs +36 -3
  215. data/sig/context_dev/models/monitor_list_changes_response.rbs +111 -8
  216. data/sig/context_dev/models/monitor_list_response.rbs +149 -3
  217. data/sig/context_dev/models/monitor_list_runs_response.rbs +36 -3
  218. data/sig/context_dev/models/monitor_retrieve_change_response.rbs +33 -0
  219. data/sig/context_dev/models/monitor_retrieve_response.rbs +203 -53
  220. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +33 -0
  221. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +203 -53
  222. data/sig/context_dev/models/monitor_run_response.rbs +48 -3
  223. data/sig/context_dev/models/monitor_update_params.rbs +113 -0
  224. data/sig/context_dev/models/monitor_update_response.rbs +203 -53
  225. data/sig/context_dev/models/web_scrape_response.rbs +204 -27
  226. data/sig/context_dev/models/web_search_params.rbs +25 -0
  227. data/sig/context_dev/models/web_search_response.rbs +48 -0
  228. data/sig/context_dev/resources/web.rbs +1 -0
  229. metadata +2 -2
@@ -11,10 +11,11 @@ module ContextDev
11
11
  T.any(ContextDev::MonitorCreateParams, ContextDev::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # Display name for the monitor.
14
15
  sig { returns(String) }
15
16
  attr_accessor :name
16
17
 
17
- # Discriminated union describing what the monitor watches.
18
+ # What to watch: a page, a sitemap, or data extracted from a site.
18
19
  sig do
19
20
  returns(
20
21
  T.any(
@@ -26,7 +27,8 @@ module ContextDev
26
27
  end
27
28
  attr_accessor :target
28
29
 
29
- # Discriminated union describing how changes are detected.
30
+ # How changes are judged. Defaults to `semantic` for extract targets and page
31
+ # targets with `instructions`, otherwise `exact`.
30
32
  sig do
31
33
  returns(
32
34
  T.nilable(
@@ -50,8 +52,7 @@ module ContextDev
50
52
  end
51
53
  attr_writer :change_detection
52
54
 
53
- # Top-level monitor category. Always `web` today; the concrete behavior is
54
- # described by `target` and `change_detection`.
55
+ # Always `web`. Optional.
55
56
  sig do
56
57
  returns(T.nilable(ContextDev::MonitorCreateParams::Mode::OrSymbol))
57
58
  end
@@ -71,14 +72,14 @@ module ContextDev
71
72
  end
72
73
  attr_writer :schedule
73
74
 
74
- # User-defined tags for grouping and filtering monitors and their changes.
75
- # Duplicates are removed.
75
+ # Labels for filtering monitors, their changes, and their usage.
76
76
  sig { returns(T.nilable(T::Array[String])) }
77
77
  attr_reader :tags
78
78
 
79
79
  sig { params(tags: T::Array[String]).void }
80
80
  attr_writer :tags
81
81
 
82
+ # Webhook destination and delivery settings. Null means no webhook is configured.
82
83
  sig { returns(T.nilable(ContextDev::MonitorCreateParams::Webhook)) }
83
84
  attr_reader :webhook
84
85
 
@@ -111,21 +112,22 @@ module ContextDev
111
112
  ).returns(T.attached_class)
112
113
  end
113
114
  def self.new(
115
+ # Display name for the monitor.
114
116
  name:,
115
- # Discriminated union describing what the monitor watches.
117
+ # What to watch: a page, a sitemap, or data extracted from a site.
116
118
  target:,
117
- # Discriminated union describing how changes are detected.
119
+ # How changes are judged. Defaults to `semantic` for extract targets and page
120
+ # targets with `instructions`, otherwise `exact`.
118
121
  change_detection: nil,
119
- # Top-level monitor category. Always `web` today; the concrete behavior is
120
- # described by `target` and `change_detection`.
122
+ # Always `web`. Optional.
121
123
  mode: nil,
122
124
  # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
123
125
  # every 6 hours or every 2 days. The total interval (frequency × unit) must be
124
126
  # between 10 minutes and 1 year.
125
127
  schedule: nil,
126
- # User-defined tags for grouping and filtering monitors and their changes.
127
- # Duplicates are removed.
128
+ # Labels for filtering monitors, their changes, and their usage.
128
129
  tags: nil,
130
+ # Webhook destination and delivery settings. Null means no webhook is configured.
129
131
  webhook: nil,
130
132
  request_options: {}
131
133
  )
@@ -157,7 +159,7 @@ module ContextDev
157
159
  def to_hash
158
160
  end
159
161
 
160
- # Discriminated union describing what the monitor watches.
162
+ # What to watch: a page, a sitemap, or data extracted from a site.
161
163
  module Target
162
164
  extend ContextDev::Internal::Type::Union
163
165
 
@@ -179,27 +181,41 @@ module ContextDev
179
181
  )
180
182
  end
181
183
 
184
+ # Use `page` to watch one web page.
182
185
  sig { returns(Symbol) }
183
186
  attr_accessor :type
184
187
 
188
+ # Public HTTP(S) page URL to monitor.
185
189
  sig { returns(String) }
186
190
  attr_accessor :url
187
191
 
188
- # CSS selectors for HTML regions to remove before text extraction. Applied after
189
- # include_selectors; exclusion takes precedence when an element matches both. Omit
190
- # or pass an empty array to apply no explicit exclusions. Changing these selectors
191
- # creates a new baseline.
192
+ # Optional browser actions executed in array order after the page loads, before
193
+ # content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
194
+ # Changes create a new baseline.
195
+ sig do
196
+ returns(
197
+ T.nilable(
198
+ T::Array[
199
+ T.any(
200
+ ContextDev::MonitorCreateParams::Target::Page::Action::Wait,
201
+ ContextDev::MonitorCreateParams::Target::Page::Action::Perform,
202
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll
203
+ )
204
+ ]
205
+ )
206
+ )
207
+ end
208
+ attr_accessor :actions
209
+
210
+ # Remove matching regions after inclusions. Changes create a new baseline.
192
211
  sig { returns(T.nilable(T::Array[String])) }
193
212
  attr_reader :exclude_selectors
194
213
 
195
214
  sig { params(exclude_selectors: T::Array[String]).void }
196
215
  attr_writer :exclude_selectors
197
216
 
198
- # CSS selectors defining the HTML regions to monitor. Matching subtrees are
199
- # combined in document order before text extraction, instead of automatic
200
- # main-content selection. Omit or pass an empty array to use automatic
201
- # main-content extraction. If the filtered page has no usable text, the run fails
202
- # without replacing the baseline. Changing these selectors creates a new baseline.
217
+ # Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
218
+ # create a new baseline.
203
219
  sig { returns(T.nilable(T::Array[String])) }
204
220
  attr_reader :include_selectors
205
221
 
@@ -226,6 +242,16 @@ module ContextDev
226
242
  sig do
227
243
  params(
228
244
  url: String,
245
+ actions:
246
+ T.nilable(
247
+ T::Array[
248
+ T.any(
249
+ ContextDev::MonitorCreateParams::Target::Page::Action::Wait::OrHash,
250
+ ContextDev::MonitorCreateParams::Target::Page::Action::Perform::OrHash,
251
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::OrHash
252
+ )
253
+ ]
254
+ ),
229
255
  exclude_selectors: T::Array[String],
230
256
  include_selectors: T::Array[String],
231
257
  instructions: String,
@@ -234,23 +260,23 @@ module ContextDev
234
260
  ).returns(T.attached_class)
235
261
  end
236
262
  def self.new(
263
+ # Public HTTP(S) page URL to monitor.
237
264
  url:,
238
- # CSS selectors for HTML regions to remove before text extraction. Applied after
239
- # include_selectors; exclusion takes precedence when an element matches both. Omit
240
- # or pass an empty array to apply no explicit exclusions. Changing these selectors
241
- # creates a new baseline.
265
+ # Optional browser actions executed in array order after the page loads, before
266
+ # content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
267
+ # Changes create a new baseline.
268
+ actions: nil,
269
+ # Remove matching regions after inclusions. Changes create a new baseline.
242
270
  exclude_selectors: nil,
243
- # CSS selectors defining the HTML regions to monitor. Matching subtrees are
244
- # combined in document order before text extraction, instead of automatic
245
- # main-content selection. Omit or pass an empty array to use automatic
246
- # main-content extraction. If the filtered page has no usable text, the run fails
247
- # without replacing the baseline. Changing these selectors creates a new baseline.
271
+ # Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
272
+ # create a new baseline.
248
273
  include_selectors: nil,
249
274
  # Plain-language goal describing which page changes matter. When provided without
250
275
  # change_detection, semantic detection is inferred.
251
276
  instructions: nil,
252
277
  # Normalize whitespace before comparing or analyzing text.
253
278
  normalize_whitespace: nil,
279
+ # Use `page` to watch one web page.
254
280
  type: :page
255
281
  )
256
282
  end
@@ -260,6 +286,16 @@ module ContextDev
260
286
  {
261
287
  type: Symbol,
262
288
  url: String,
289
+ actions:
290
+ T.nilable(
291
+ T::Array[
292
+ T.any(
293
+ ContextDev::MonitorCreateParams::Target::Page::Action::Wait,
294
+ ContextDev::MonitorCreateParams::Target::Page::Action::Perform,
295
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll
296
+ )
297
+ ]
298
+ ),
263
299
  exclude_selectors: T::Array[String],
264
300
  include_selectors: T::Array[String],
265
301
  instructions: String,
@@ -269,6 +305,311 @@ module ContextDev
269
305
  end
270
306
  def to_hash
271
307
  end
308
+
309
+ # Browser action discriminated by `do`. Each variant exposes only its applicable
310
+ # fields.
311
+ module Action
312
+ extend ContextDev::Internal::Type::Union
313
+
314
+ Variants =
315
+ T.type_alias do
316
+ T.any(
317
+ ContextDev::MonitorCreateParams::Target::Page::Action::Wait,
318
+ ContextDev::MonitorCreateParams::Target::Page::Action::Perform,
319
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll
320
+ )
321
+ end
322
+
323
+ class Wait < ContextDev::Internal::Type::BaseModel
324
+ OrHash =
325
+ T.type_alias do
326
+ T.any(
327
+ ContextDev::MonitorCreateParams::Target::Page::Action::Wait,
328
+ ContextDev::Internal::AnyHash
329
+ )
330
+ end
331
+
332
+ # Use `wait` to pause for a fixed duration.
333
+ sig { returns(Symbol) }
334
+ attr_accessor :do_
335
+
336
+ # Time to pause in milliseconds before the next action.
337
+ sig { returns(Integer) }
338
+ attr_accessor :time_ms
339
+
340
+ # Pause for a fixed number of milliseconds before continuing to the next action.
341
+ sig do
342
+ params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
343
+ end
344
+ def self.new(
345
+ # Time to pause in milliseconds before the next action.
346
+ time_ms:,
347
+ # Use `wait` to pause for a fixed duration.
348
+ do_: :wait
349
+ )
350
+ end
351
+
352
+ sig { override.returns({ do_: Symbol, time_ms: Integer }) }
353
+ def to_hash
354
+ end
355
+ end
356
+
357
+ class Perform < ContextDev::Internal::Type::BaseModel
358
+ OrHash =
359
+ T.type_alias do
360
+ T.any(
361
+ ContextDev::MonitorCreateParams::Target::Page::Action::Perform,
362
+ ContextDev::Internal::AnyHash
363
+ )
364
+ end
365
+
366
+ # One browser instruction, such as clicking a button or entering text.
367
+ sig { returns(String) }
368
+ attr_accessor :action
369
+
370
+ # Use `perform` for a plain-language browser instruction.
371
+ sig { returns(Symbol) }
372
+ attr_accessor :do_
373
+
374
+ # Resolve and perform one natural-language browser action.
375
+ sig do
376
+ params(action: String, do_: Symbol).returns(T.attached_class)
377
+ end
378
+ def self.new(
379
+ # One browser instruction, such as clicking a button or entering text.
380
+ action:,
381
+ # Use `perform` for a plain-language browser instruction.
382
+ do_: :perform
383
+ )
384
+ end
385
+
386
+ sig { override.returns({ action: String, do_: Symbol }) }
387
+ def to_hash
388
+ end
389
+ end
390
+
391
+ class Scroll < ContextDev::Internal::Type::BaseModel
392
+ OrHash =
393
+ T.type_alias do
394
+ T.any(
395
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll,
396
+ ContextDev::Internal::AnyHash
397
+ )
398
+ end
399
+
400
+ # Use `scroll` to move through the page or a container.
401
+ sig { returns(Symbol) }
402
+ attr_accessor :do_
403
+
404
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
405
+ # Defaults to viewport.
406
+ sig do
407
+ returns(
408
+ T.nilable(
409
+ T.any(
410
+ Integer,
411
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::OrSymbol
412
+ )
413
+ )
414
+ )
415
+ end
416
+ attr_reader :amount
417
+
418
+ sig do
419
+ params(
420
+ amount:
421
+ T.any(
422
+ Integer,
423
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::OrSymbol
424
+ )
425
+ ).void
426
+ end
427
+ attr_writer :amount
428
+
429
+ # CSS selector for the first matching scroll container. Defaults to the page.
430
+ sig { returns(T.nilable(String)) }
431
+ attr_reader :container
432
+
433
+ sig { params(container: String).void }
434
+ attr_writer :container
435
+
436
+ # Direction to scroll. Defaults to down.
437
+ sig do
438
+ returns(
439
+ T.nilable(
440
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::OrSymbol
441
+ )
442
+ )
443
+ end
444
+ attr_reader :direction
445
+
446
+ sig do
447
+ params(
448
+ direction:
449
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::OrSymbol
450
+ ).void
451
+ end
452
+ attr_writer :direction
453
+
454
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
455
+ # changing. Defaults to 1.
456
+ sig { returns(T.nilable(Integer)) }
457
+ attr_reader :max_scrolls
458
+
459
+ sig { params(max_scrolls: Integer).void }
460
+ attr_writer :max_scrolls
461
+
462
+ # Scroll the page or a selected scrollable container, waiting adaptively for
463
+ # content and dimensions to settle after each iteration.
464
+ sig do
465
+ params(
466
+ amount:
467
+ T.any(
468
+ Integer,
469
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::OrSymbol
470
+ ),
471
+ container: String,
472
+ direction:
473
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::OrSymbol,
474
+ max_scrolls: Integer,
475
+ do_: Symbol
476
+ ).returns(T.attached_class)
477
+ end
478
+ def self.new(
479
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
480
+ # Defaults to viewport.
481
+ amount: nil,
482
+ # CSS selector for the first matching scroll container. Defaults to the page.
483
+ container: nil,
484
+ # Direction to scroll. Defaults to down.
485
+ direction: nil,
486
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
487
+ # changing. Defaults to 1.
488
+ max_scrolls: nil,
489
+ # Use `scroll` to move through the page or a container.
490
+ do_: :scroll
491
+ )
492
+ end
493
+
494
+ sig do
495
+ override.returns(
496
+ {
497
+ do_: Symbol,
498
+ amount:
499
+ T.any(
500
+ Integer,
501
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::OrSymbol
502
+ ),
503
+ container: String,
504
+ direction:
505
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::OrSymbol,
506
+ max_scrolls: Integer
507
+ }
508
+ )
509
+ end
510
+ def to_hash
511
+ end
512
+
513
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
514
+ # Defaults to viewport.
515
+ module Amount
516
+ extend ContextDev::Internal::Type::Union
517
+
518
+ Variants =
519
+ T.type_alias do
520
+ T.any(
521
+ Integer,
522
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::TaggedSymbol
523
+ )
524
+ end
525
+
526
+ sig do
527
+ override.returns(
528
+ T::Array[
529
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::Variants
530
+ ]
531
+ )
532
+ end
533
+ def self.variants
534
+ end
535
+
536
+ TaggedSymbol =
537
+ T.type_alias do
538
+ T.all(
539
+ Symbol,
540
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount
541
+ )
542
+ end
543
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
544
+
545
+ VIEWPORT =
546
+ T.let(
547
+ :viewport,
548
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::TaggedSymbol
549
+ )
550
+ MAX =
551
+ T.let(
552
+ :max,
553
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Amount::TaggedSymbol
554
+ )
555
+ end
556
+
557
+ # Direction to scroll. Defaults to down.
558
+ module Direction
559
+ extend ContextDev::Internal::Type::Enum
560
+
561
+ TaggedSymbol =
562
+ T.type_alias do
563
+ T.all(
564
+ Symbol,
565
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction
566
+ )
567
+ end
568
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
569
+
570
+ UP =
571
+ T.let(
572
+ :up,
573
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
574
+ )
575
+ DOWN =
576
+ T.let(
577
+ :down,
578
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
579
+ )
580
+ LEFT =
581
+ T.let(
582
+ :left,
583
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
584
+ )
585
+ RIGHT =
586
+ T.let(
587
+ :right,
588
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
589
+ )
590
+
591
+ sig do
592
+ override.returns(
593
+ T::Array[
594
+ ContextDev::MonitorCreateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
595
+ ]
596
+ )
597
+ end
598
+ def self.values
599
+ end
600
+ end
601
+ end
602
+
603
+ sig do
604
+ override.returns(
605
+ T::Array[
606
+ ContextDev::MonitorCreateParams::Target::Page::Action::Variants
607
+ ]
608
+ )
609
+ end
610
+ def self.variants
611
+ end
612
+ end
272
613
  end
273
614
 
274
615
  class Sitemap < ContextDev::Internal::Type::BaseModel
@@ -280,6 +621,7 @@ module ContextDev
280
621
  )
281
622
  end
282
623
 
624
+ # Use `sitemap` to watch a site for added or removed URLs.
283
625
  sig { returns(Symbol) }
284
626
  attr_accessor :type
285
627
 
@@ -308,11 +650,7 @@ module ContextDev
308
650
  sig { params(max_urls: Integer).void }
309
651
  attr_writer :max_urls
310
652
 
311
- # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
312
- # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
313
- # and its subdomains before comparison. On a detected difference the sitemap is
314
- # re-fetched within the same run and only URLs both observations agree on are
315
- # reported, suppressing transient crawl flaps.
653
+ # Watch a site’s URL inventory for confirmed additions and removals.
316
654
  sig do
317
655
  params(
318
656
  url: String,
@@ -331,6 +669,7 @@ module ContextDev
331
669
  include: nil,
332
670
  # Maximum number of sitemap URLs to track (capped at 10,000).
333
671
  max_urls: nil,
672
+ # Use `sitemap` to watch a site for added or removed URLs.
334
673
  type: :sitemap
335
674
  )
336
675
  end
@@ -364,6 +703,7 @@ module ContextDev
364
703
  sig { returns(String) }
365
704
  attr_accessor :instructions
366
705
 
706
+ # Use `extract` to watch structured data across selected pages.
367
707
  sig { returns(Symbol) }
368
708
  attr_accessor :type
369
709
 
@@ -371,6 +711,7 @@ module ContextDev
371
711
  sig { returns(String) }
372
712
  attr_accessor :url
373
713
 
714
+ # Allow page discovery on subdomains of the target site.
374
715
  sig { returns(T.nilable(T::Boolean)) }
375
716
  attr_reader :follow_subdomains
376
717
 
@@ -391,25 +732,16 @@ module ContextDev
391
732
  sig { params(max_pages: Integer).void }
392
733
  attr_writer :max_pages
393
734
 
394
- # JSON Schema describing the data you care about. It is used three ways: it guides
395
- # which pages are selected for tracking, it gives the change judge extra context
396
- # on which changes matter (alongside `instructions`), and it defines the shape of
397
- # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
398
- # about once a day). It is not a response format for changes: change events and
399
- # webhook payloads always contain diffs, summaries, and evidence excerpts — never
400
- # data in this schema's shape. If omitted, a default summary + key-points schema
401
- # is used.
735
+ # JSON Schema for page selection and the baseline snapshot. Changes return diffs
736
+ # and evidence.
402
737
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
403
738
  attr_reader :schema
404
739
 
405
740
  sig { params(schema: T::Hash[Symbol, T.anything]).void }
406
741
  attr_writer :schema
407
742
 
408
- # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
409
- # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
410
- # track; each run re-checks exactly those pages, and confirmed content changes are
411
- # judged for relevance against the monitor's `instructions` (and `schema`, when
412
- # provided). The tracked page set is refreshed by a periodic re-discovery crawl.
743
+ # Track relevant pages selected by `schema` and `instructions`; refresh the page
744
+ # set periodically.
413
745
  sig do
414
746
  params(
415
747
  instructions: String,
@@ -427,20 +759,16 @@ module ContextDev
427
759
  instructions:,
428
760
  # Root URL to extract structured data from.
429
761
  url:,
762
+ # Allow page discovery on subdomains of the target site.
430
763
  follow_subdomains: nil,
431
764
  # Optional maximum link depth from the starting URL (0 = only the starting page).
432
765
  max_depth: nil,
433
766
  # Maximum number of pages to track.
434
767
  max_pages: nil,
435
- # JSON Schema describing the data you care about. It is used three ways: it guides
436
- # which pages are selected for tracking, it gives the change judge extra context
437
- # on which changes matter (alongside `instructions`), and it defines the shape of
438
- # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
439
- # about once a day). It is not a response format for changes: change events and
440
- # webhook payloads always contain diffs, summaries, and evidence excerpts — never
441
- # data in this schema's shape. If omitted, a default summary + key-points schema
442
- # is used.
768
+ # JSON Schema for page selection and the baseline snapshot. Changes return diffs
769
+ # and evidence.
443
770
  schema: nil,
771
+ # Use `extract` to watch structured data across selected pages.
444
772
  type: :extract
445
773
  )
446
774
  end
@@ -471,7 +799,8 @@ module ContextDev
471
799
  end
472
800
  end
473
801
 
474
- # Discriminated union describing how changes are detected.
802
+ # How changes are judged. Defaults to `semantic` for extract targets and page
803
+ # targets with `instructions`, otherwise `exact`.
475
804
  module ChangeDetection
476
805
  extend ContextDev::Internal::Type::Union
477
806
 
@@ -492,13 +821,17 @@ module ContextDev
492
821
  )
493
822
  end
494
823
 
824
+ # Use `exact` to compare visible text or sitemap URLs.
495
825
  sig { returns(Symbol) }
496
826
  attr_accessor :type
497
827
 
498
828
  # Detect exact changes. For page targets, this means visible text diffs. For
499
829
  # sitemap targets, this means URL additions and removals.
500
830
  sig { params(type: Symbol).returns(T.attached_class) }
501
- def self.new(type: :exact)
831
+ def self.new(
832
+ # Use `exact` to compare visible text or sitemap URLs.
833
+ type: :exact
834
+ )
502
835
  end
503
836
 
504
837
  sig { override.returns({ type: Symbol }) }
@@ -515,25 +848,30 @@ module ContextDev
515
848
  )
516
849
  end
517
850
 
851
+ # Use `semantic` to judge changes against the target instructions.
518
852
  sig { returns(Symbol) }
519
853
  attr_accessor :type
520
854
 
855
+ # Minimum confidence required to report a meaningful change, from 0 to 1.
521
856
  sig { returns(T.nilable(Float)) }
522
857
  attr_reader :confidence_threshold
523
858
 
524
859
  sig { params(confidence_threshold: Float).void }
525
860
  attr_writer :confidence_threshold
526
861
 
527
- # Detect meaning-level changes to page content, ignoring cosmetic or
528
- # instruction-irrelevant differences. Which changes are meaningful is judged
529
- # against the page or extract target's `instructions` (and an extract target's
530
- # `schema`, when provided).
862
+ # Detect meaningful content changes using the target’s instructions and optional
863
+ # schema.
531
864
  sig do
532
865
  params(confidence_threshold: Float, type: Symbol).returns(
533
866
  T.attached_class
534
867
  )
535
868
  end
536
- def self.new(confidence_threshold: nil, type: :semantic)
869
+ def self.new(
870
+ # Minimum confidence required to report a meaningful change, from 0 to 1.
871
+ confidence_threshold: nil,
872
+ # Use `semantic` to judge changes against the target instructions.
873
+ type: :semantic
874
+ )
537
875
  end
538
876
 
539
877
  sig do
@@ -552,8 +890,7 @@ module ContextDev
552
890
  end
553
891
  end
554
892
 
555
- # Top-level monitor category. Always `web` today; the concrete behavior is
556
- # described by `target` and `change_detection`.
893
+ # Always `web`. Optional.
557
894
  module Mode
558
895
  extend ContextDev::Internal::Type::Enum
559
896
 
@@ -587,11 +924,13 @@ module ContextDev
587
924
  sig { returns(Integer) }
588
925
  attr_accessor :frequency
589
926
 
927
+ # Use `interval` to run on a repeating schedule.
590
928
  sig do
591
929
  returns(ContextDev::MonitorCreateParams::Schedule::Type::OrSymbol)
592
930
  end
593
931
  attr_accessor :type
594
932
 
933
+ # Time unit used with `frequency` to set the run interval.
595
934
  sig do
596
935
  returns(ContextDev::MonitorCreateParams::Schedule::Unit::OrSymbol)
597
936
  end
@@ -612,7 +951,9 @@ module ContextDev
612
951
  # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
613
952
  # maximum 365 when unit is days).
614
953
  frequency:,
954
+ # Use `interval` to run on a repeating schedule.
615
955
  type:,
956
+ # Time unit used with `frequency` to set the run interval.
616
957
  unit:
617
958
  )
618
959
  end
@@ -629,6 +970,7 @@ module ContextDev
629
970
  def to_hash
630
971
  end
631
972
 
973
+ # Use `interval` to run on a repeating schedule.
632
974
  module Type
633
975
  extend ContextDev::Internal::Type::Enum
634
976
 
@@ -655,6 +997,7 @@ module ContextDev
655
997
  end
656
998
  end
657
999
 
1000
+ # Time unit used with `frequency` to set the run interval.
658
1001
  module Unit
659
1002
  extend ContextDev::Internal::Type::Enum
660
1003
 
@@ -701,15 +1044,13 @@ module ContextDev
701
1044
  )
702
1045
  end
703
1046
 
704
- # Webhook URL events are delivered to. Slack incoming webhook URLs are
705
- # automatically formatted as Slack messages.
1047
+ # Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
1048
+ # messages.
706
1049
  sig { returns(String) }
707
1050
  attr_accessor :url
708
1051
 
709
- # Events delivered to this endpoint. `change.detected` fires only when a run
710
- # detects a change; `run.completed` fires on every completed run — including runs
711
- # that detected no change — and embeds the change when one was detected. Defaults
712
- # to `["change.detected"]` when omitted.
1052
+ # Events to deliver. Defaults to `change.detected`; `run.completed` also includes
1053
+ # unchanged runs.
713
1054
  sig do
714
1055
  returns(
715
1056
  T.nilable(
@@ -738,6 +1079,7 @@ module ContextDev
738
1079
  sig { params(retry_: ContextDev::RetryConfig::OrHash).void }
739
1080
  attr_writer :retry_
740
1081
 
1082
+ # Webhook destination and delivery settings. Null means no webhook is configured.
741
1083
  sig do
742
1084
  params(
743
1085
  url: String,
@@ -749,13 +1091,11 @@ module ContextDev
749
1091
  ).returns(T.attached_class)
750
1092
  end
751
1093
  def self.new(
752
- # Webhook URL events are delivered to. Slack incoming webhook URLs are
753
- # automatically formatted as Slack messages.
1094
+ # Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
1095
+ # messages.
754
1096
  url:,
755
- # Events delivered to this endpoint. `change.detected` fires only when a run
756
- # detects a change; `run.completed` fires on every completed run — including runs
757
- # that detected no change — and embeds the change when one was detected. Defaults
758
- # to `["change.detected"]` when omitted.
1097
+ # Events to deliver. Defaults to `change.detected`; `run.completed` also includes
1098
+ # unchanged runs.
759
1099
  events: nil,
760
1100
  # Webhook retry settings. Use {} for the default schedule.
761
1101
  retry_: nil