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,12 @@ module ContextDev
11
11
  T.any(ContextDev::MonitorUpdateParams, ContextDev::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # ID of the monitor.
14
15
  sig { returns(String) }
15
16
  attr_accessor :monitor_id
16
17
 
17
- # Discriminated union describing how changes are detected.
18
+ # How changes are judged. Defaults to `semantic` for extract targets and page
19
+ # targets with `instructions`, otherwise `exact`.
18
20
  sig do
19
21
  returns(
20
22
  T.nilable(
@@ -38,6 +40,7 @@ module ContextDev
38
40
  end
39
41
  attr_writer :change_detection
40
42
 
43
+ # Display name for the monitor.
41
44
  sig { returns(T.nilable(String)) }
42
45
  attr_reader :name
43
46
 
@@ -55,6 +58,7 @@ module ContextDev
55
58
  end
56
59
  attr_writer :schedule
57
60
 
61
+ # Set `paused` to stop scheduled runs or `active` to resume them.
58
62
  sig do
59
63
  returns(T.nilable(ContextDev::MonitorUpdateParams::Status::OrSymbol))
60
64
  end
@@ -65,15 +69,14 @@ module ContextDev
65
69
  end
66
70
  attr_writer :status
67
71
 
68
- # User-defined tags for grouping and filtering monitors and their changes.
69
- # Duplicates are removed.
72
+ # Labels for filtering monitors, their changes, and their usage.
70
73
  sig { returns(T.nilable(T::Array[String])) }
71
74
  attr_reader :tags
72
75
 
73
76
  sig { params(tags: T::Array[String]).void }
74
77
  attr_writer :tags
75
78
 
76
- # Discriminated union describing what the monitor watches.
79
+ # What to watch: a page, a sitemap, or data extracted from a site.
77
80
  sig do
78
81
  returns(
79
82
  T.nilable(
@@ -99,7 +102,7 @@ module ContextDev
99
102
  end
100
103
  attr_writer :target
101
104
 
102
- # Set to null to remove the webhook.
105
+ # Set to null to remove the webhook. Changing `url` issues a new secret.
103
106
  sig { returns(T.nilable(ContextDev::MonitorUpdateParams::Webhook)) }
104
107
  attr_reader :webhook
105
108
 
@@ -133,21 +136,24 @@ module ContextDev
133
136
  ).returns(T.attached_class)
134
137
  end
135
138
  def self.new(
139
+ # ID of the monitor.
136
140
  monitor_id:,
137
- # Discriminated union describing how changes are detected.
141
+ # How changes are judged. Defaults to `semantic` for extract targets and page
142
+ # targets with `instructions`, otherwise `exact`.
138
143
  change_detection: nil,
144
+ # Display name for the monitor.
139
145
  name: nil,
140
146
  # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
141
147
  # every 6 hours or every 2 days. The total interval (frequency × unit) must be
142
148
  # between 10 minutes and 1 year.
143
149
  schedule: nil,
150
+ # Set `paused` to stop scheduled runs or `active` to resume them.
144
151
  status: nil,
145
- # User-defined tags for grouping and filtering monitors and their changes.
146
- # Duplicates are removed.
152
+ # Labels for filtering monitors, their changes, and their usage.
147
153
  tags: nil,
148
- # Discriminated union describing what the monitor watches.
154
+ # What to watch: a page, a sitemap, or data extracted from a site.
149
155
  target: nil,
150
- # Set to null to remove the webhook.
156
+ # Set to null to remove the webhook. Changing `url` issues a new secret.
151
157
  webhook: nil,
152
158
  request_options: {}
153
159
  )
@@ -180,7 +186,8 @@ module ContextDev
180
186
  def to_hash
181
187
  end
182
188
 
183
- # Discriminated union describing how changes are detected.
189
+ # How changes are judged. Defaults to `semantic` for extract targets and page
190
+ # targets with `instructions`, otherwise `exact`.
184
191
  module ChangeDetection
185
192
  extend ContextDev::Internal::Type::Union
186
193
 
@@ -201,13 +208,17 @@ module ContextDev
201
208
  )
202
209
  end
203
210
 
211
+ # Use `exact` to compare visible text or sitemap URLs.
204
212
  sig { returns(Symbol) }
205
213
  attr_accessor :type
206
214
 
207
215
  # Detect exact changes. For page targets, this means visible text diffs. For
208
216
  # sitemap targets, this means URL additions and removals.
209
217
  sig { params(type: Symbol).returns(T.attached_class) }
210
- def self.new(type: :exact)
218
+ def self.new(
219
+ # Use `exact` to compare visible text or sitemap URLs.
220
+ type: :exact
221
+ )
211
222
  end
212
223
 
213
224
  sig { override.returns({ type: Symbol }) }
@@ -224,25 +235,30 @@ module ContextDev
224
235
  )
225
236
  end
226
237
 
238
+ # Use `semantic` to judge changes against the target instructions.
227
239
  sig { returns(Symbol) }
228
240
  attr_accessor :type
229
241
 
242
+ # Minimum confidence required to report a meaningful change, from 0 to 1.
230
243
  sig { returns(T.nilable(Float)) }
231
244
  attr_reader :confidence_threshold
232
245
 
233
246
  sig { params(confidence_threshold: Float).void }
234
247
  attr_writer :confidence_threshold
235
248
 
236
- # Detect meaning-level changes to page content, ignoring cosmetic or
237
- # instruction-irrelevant differences. Which changes are meaningful is judged
238
- # against the page or extract target's `instructions` (and an extract target's
239
- # `schema`, when provided).
249
+ # Detect meaningful content changes using the target’s instructions and optional
250
+ # schema.
240
251
  sig do
241
252
  params(confidence_threshold: Float, type: Symbol).returns(
242
253
  T.attached_class
243
254
  )
244
255
  end
245
- def self.new(confidence_threshold: nil, type: :semantic)
256
+ def self.new(
257
+ # Minimum confidence required to report a meaningful change, from 0 to 1.
258
+ confidence_threshold: nil,
259
+ # Use `semantic` to judge changes against the target instructions.
260
+ type: :semantic
261
+ )
246
262
  end
247
263
 
248
264
  sig do
@@ -276,11 +292,13 @@ module ContextDev
276
292
  sig { returns(Integer) }
277
293
  attr_accessor :frequency
278
294
 
295
+ # Use `interval` to run on a repeating schedule.
279
296
  sig do
280
297
  returns(ContextDev::MonitorUpdateParams::Schedule::Type::OrSymbol)
281
298
  end
282
299
  attr_accessor :type
283
300
 
301
+ # Time unit used with `frequency` to set the run interval.
284
302
  sig do
285
303
  returns(ContextDev::MonitorUpdateParams::Schedule::Unit::OrSymbol)
286
304
  end
@@ -301,7 +319,9 @@ module ContextDev
301
319
  # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
302
320
  # maximum 365 when unit is days).
303
321
  frequency:,
322
+ # Use `interval` to run on a repeating schedule.
304
323
  type:,
324
+ # Time unit used with `frequency` to set the run interval.
305
325
  unit:
306
326
  )
307
327
  end
@@ -318,6 +338,7 @@ module ContextDev
318
338
  def to_hash
319
339
  end
320
340
 
341
+ # Use `interval` to run on a repeating schedule.
321
342
  module Type
322
343
  extend ContextDev::Internal::Type::Enum
323
344
 
@@ -344,6 +365,7 @@ module ContextDev
344
365
  end
345
366
  end
346
367
 
368
+ # Time unit used with `frequency` to set the run interval.
347
369
  module Unit
348
370
  extend ContextDev::Internal::Type::Enum
349
371
 
@@ -381,6 +403,7 @@ module ContextDev
381
403
  end
382
404
  end
383
405
 
406
+ # Set `paused` to stop scheduled runs or `active` to resume them.
384
407
  module Status
385
408
  extend ContextDev::Internal::Type::Enum
386
409
 
@@ -404,7 +427,7 @@ module ContextDev
404
427
  end
405
428
  end
406
429
 
407
- # Discriminated union describing what the monitor watches.
430
+ # What to watch: a page, a sitemap, or data extracted from a site.
408
431
  module Target
409
432
  extend ContextDev::Internal::Type::Union
410
433
 
@@ -426,27 +449,41 @@ module ContextDev
426
449
  )
427
450
  end
428
451
 
452
+ # Use `page` to watch one web page.
429
453
  sig { returns(Symbol) }
430
454
  attr_accessor :type
431
455
 
456
+ # Public HTTP(S) page URL to monitor.
432
457
  sig { returns(String) }
433
458
  attr_accessor :url
434
459
 
435
- # CSS selectors for HTML regions to remove before text extraction. Applied after
436
- # include_selectors; exclusion takes precedence when an element matches both. Omit
437
- # or pass an empty array to apply no explicit exclusions. Changing these selectors
438
- # creates a new baseline.
460
+ # Optional browser actions executed in array order after the page loads, before
461
+ # content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
462
+ # Changes create a new baseline.
463
+ sig do
464
+ returns(
465
+ T.nilable(
466
+ T::Array[
467
+ T.any(
468
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Wait,
469
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Perform,
470
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll
471
+ )
472
+ ]
473
+ )
474
+ )
475
+ end
476
+ attr_accessor :actions
477
+
478
+ # Remove matching regions after inclusions. Changes create a new baseline.
439
479
  sig { returns(T.nilable(T::Array[String])) }
440
480
  attr_reader :exclude_selectors
441
481
 
442
482
  sig { params(exclude_selectors: T::Array[String]).void }
443
483
  attr_writer :exclude_selectors
444
484
 
445
- # CSS selectors defining the HTML regions to monitor. Matching subtrees are
446
- # combined in document order before text extraction, instead of automatic
447
- # main-content selection. Omit or pass an empty array to use automatic
448
- # main-content extraction. If the filtered page has no usable text, the run fails
449
- # without replacing the baseline. Changing these selectors creates a new baseline.
485
+ # Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
486
+ # create a new baseline.
450
487
  sig { returns(T.nilable(T::Array[String])) }
451
488
  attr_reader :include_selectors
452
489
 
@@ -473,6 +510,16 @@ module ContextDev
473
510
  sig do
474
511
  params(
475
512
  url: String,
513
+ actions:
514
+ T.nilable(
515
+ T::Array[
516
+ T.any(
517
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Wait::OrHash,
518
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Perform::OrHash,
519
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::OrHash
520
+ )
521
+ ]
522
+ ),
476
523
  exclude_selectors: T::Array[String],
477
524
  include_selectors: T::Array[String],
478
525
  instructions: String,
@@ -481,23 +528,23 @@ module ContextDev
481
528
  ).returns(T.attached_class)
482
529
  end
483
530
  def self.new(
531
+ # Public HTTP(S) page URL to monitor.
484
532
  url:,
485
- # CSS selectors for HTML regions to remove before text extraction. Applied after
486
- # include_selectors; exclusion takes precedence when an element matches both. Omit
487
- # or pass an empty array to apply no explicit exclusions. Changing these selectors
488
- # creates a new baseline.
533
+ # Optional browser actions executed in array order after the page loads, before
534
+ # content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
535
+ # Changes create a new baseline.
536
+ actions: nil,
537
+ # Remove matching regions after inclusions. Changes create a new baseline.
489
538
  exclude_selectors: nil,
490
- # CSS selectors defining the HTML regions to monitor. Matching subtrees are
491
- # combined in document order before text extraction, instead of automatic
492
- # main-content selection. Omit or pass an empty array to use automatic
493
- # main-content extraction. If the filtered page has no usable text, the run fails
494
- # without replacing the baseline. Changing these selectors creates a new baseline.
539
+ # Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
540
+ # create a new baseline.
495
541
  include_selectors: nil,
496
542
  # Plain-language goal describing which page changes matter. When provided without
497
543
  # change_detection, semantic detection is inferred.
498
544
  instructions: nil,
499
545
  # Normalize whitespace before comparing or analyzing text.
500
546
  normalize_whitespace: nil,
547
+ # Use `page` to watch one web page.
501
548
  type: :page
502
549
  )
503
550
  end
@@ -507,6 +554,16 @@ module ContextDev
507
554
  {
508
555
  type: Symbol,
509
556
  url: String,
557
+ actions:
558
+ T.nilable(
559
+ T::Array[
560
+ T.any(
561
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Wait,
562
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Perform,
563
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll
564
+ )
565
+ ]
566
+ ),
510
567
  exclude_selectors: T::Array[String],
511
568
  include_selectors: T::Array[String],
512
569
  instructions: String,
@@ -516,6 +573,311 @@ module ContextDev
516
573
  end
517
574
  def to_hash
518
575
  end
576
+
577
+ # Browser action discriminated by `do`. Each variant exposes only its applicable
578
+ # fields.
579
+ module Action
580
+ extend ContextDev::Internal::Type::Union
581
+
582
+ Variants =
583
+ T.type_alias do
584
+ T.any(
585
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Wait,
586
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Perform,
587
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll
588
+ )
589
+ end
590
+
591
+ class Wait < ContextDev::Internal::Type::BaseModel
592
+ OrHash =
593
+ T.type_alias do
594
+ T.any(
595
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Wait,
596
+ ContextDev::Internal::AnyHash
597
+ )
598
+ end
599
+
600
+ # Use `wait` to pause for a fixed duration.
601
+ sig { returns(Symbol) }
602
+ attr_accessor :do_
603
+
604
+ # Time to pause in milliseconds before the next action.
605
+ sig { returns(Integer) }
606
+ attr_accessor :time_ms
607
+
608
+ # Pause for a fixed number of milliseconds before continuing to the next action.
609
+ sig do
610
+ params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
611
+ end
612
+ def self.new(
613
+ # Time to pause in milliseconds before the next action.
614
+ time_ms:,
615
+ # Use `wait` to pause for a fixed duration.
616
+ do_: :wait
617
+ )
618
+ end
619
+
620
+ sig { override.returns({ do_: Symbol, time_ms: Integer }) }
621
+ def to_hash
622
+ end
623
+ end
624
+
625
+ class Perform < ContextDev::Internal::Type::BaseModel
626
+ OrHash =
627
+ T.type_alias do
628
+ T.any(
629
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Perform,
630
+ ContextDev::Internal::AnyHash
631
+ )
632
+ end
633
+
634
+ # One browser instruction, such as clicking a button or entering text.
635
+ sig { returns(String) }
636
+ attr_accessor :action
637
+
638
+ # Use `perform` for a plain-language browser instruction.
639
+ sig { returns(Symbol) }
640
+ attr_accessor :do_
641
+
642
+ # Resolve and perform one natural-language browser action.
643
+ sig do
644
+ params(action: String, do_: Symbol).returns(T.attached_class)
645
+ end
646
+ def self.new(
647
+ # One browser instruction, such as clicking a button or entering text.
648
+ action:,
649
+ # Use `perform` for a plain-language browser instruction.
650
+ do_: :perform
651
+ )
652
+ end
653
+
654
+ sig { override.returns({ action: String, do_: Symbol }) }
655
+ def to_hash
656
+ end
657
+ end
658
+
659
+ class Scroll < ContextDev::Internal::Type::BaseModel
660
+ OrHash =
661
+ T.type_alias do
662
+ T.any(
663
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll,
664
+ ContextDev::Internal::AnyHash
665
+ )
666
+ end
667
+
668
+ # Use `scroll` to move through the page or a container.
669
+ sig { returns(Symbol) }
670
+ attr_accessor :do_
671
+
672
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
673
+ # Defaults to viewport.
674
+ sig do
675
+ returns(
676
+ T.nilable(
677
+ T.any(
678
+ Integer,
679
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::OrSymbol
680
+ )
681
+ )
682
+ )
683
+ end
684
+ attr_reader :amount
685
+
686
+ sig do
687
+ params(
688
+ amount:
689
+ T.any(
690
+ Integer,
691
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::OrSymbol
692
+ )
693
+ ).void
694
+ end
695
+ attr_writer :amount
696
+
697
+ # CSS selector for the first matching scroll container. Defaults to the page.
698
+ sig { returns(T.nilable(String)) }
699
+ attr_reader :container
700
+
701
+ sig { params(container: String).void }
702
+ attr_writer :container
703
+
704
+ # Direction to scroll. Defaults to down.
705
+ sig do
706
+ returns(
707
+ T.nilable(
708
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::OrSymbol
709
+ )
710
+ )
711
+ end
712
+ attr_reader :direction
713
+
714
+ sig do
715
+ params(
716
+ direction:
717
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::OrSymbol
718
+ ).void
719
+ end
720
+ attr_writer :direction
721
+
722
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
723
+ # changing. Defaults to 1.
724
+ sig { returns(T.nilable(Integer)) }
725
+ attr_reader :max_scrolls
726
+
727
+ sig { params(max_scrolls: Integer).void }
728
+ attr_writer :max_scrolls
729
+
730
+ # Scroll the page or a selected scrollable container, waiting adaptively for
731
+ # content and dimensions to settle after each iteration.
732
+ sig do
733
+ params(
734
+ amount:
735
+ T.any(
736
+ Integer,
737
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::OrSymbol
738
+ ),
739
+ container: String,
740
+ direction:
741
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::OrSymbol,
742
+ max_scrolls: Integer,
743
+ do_: Symbol
744
+ ).returns(T.attached_class)
745
+ end
746
+ def self.new(
747
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
748
+ # Defaults to viewport.
749
+ amount: nil,
750
+ # CSS selector for the first matching scroll container. Defaults to the page.
751
+ container: nil,
752
+ # Direction to scroll. Defaults to down.
753
+ direction: nil,
754
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
755
+ # changing. Defaults to 1.
756
+ max_scrolls: nil,
757
+ # Use `scroll` to move through the page or a container.
758
+ do_: :scroll
759
+ )
760
+ end
761
+
762
+ sig do
763
+ override.returns(
764
+ {
765
+ do_: Symbol,
766
+ amount:
767
+ T.any(
768
+ Integer,
769
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::OrSymbol
770
+ ),
771
+ container: String,
772
+ direction:
773
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::OrSymbol,
774
+ max_scrolls: Integer
775
+ }
776
+ )
777
+ end
778
+ def to_hash
779
+ end
780
+
781
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
782
+ # Defaults to viewport.
783
+ module Amount
784
+ extend ContextDev::Internal::Type::Union
785
+
786
+ Variants =
787
+ T.type_alias do
788
+ T.any(
789
+ Integer,
790
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::TaggedSymbol
791
+ )
792
+ end
793
+
794
+ sig do
795
+ override.returns(
796
+ T::Array[
797
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::Variants
798
+ ]
799
+ )
800
+ end
801
+ def self.variants
802
+ end
803
+
804
+ TaggedSymbol =
805
+ T.type_alias do
806
+ T.all(
807
+ Symbol,
808
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount
809
+ )
810
+ end
811
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
812
+
813
+ VIEWPORT =
814
+ T.let(
815
+ :viewport,
816
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::TaggedSymbol
817
+ )
818
+ MAX =
819
+ T.let(
820
+ :max,
821
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Amount::TaggedSymbol
822
+ )
823
+ end
824
+
825
+ # Direction to scroll. Defaults to down.
826
+ module Direction
827
+ extend ContextDev::Internal::Type::Enum
828
+
829
+ TaggedSymbol =
830
+ T.type_alias do
831
+ T.all(
832
+ Symbol,
833
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction
834
+ )
835
+ end
836
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
837
+
838
+ UP =
839
+ T.let(
840
+ :up,
841
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
842
+ )
843
+ DOWN =
844
+ T.let(
845
+ :down,
846
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
847
+ )
848
+ LEFT =
849
+ T.let(
850
+ :left,
851
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
852
+ )
853
+ RIGHT =
854
+ T.let(
855
+ :right,
856
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
857
+ )
858
+
859
+ sig do
860
+ override.returns(
861
+ T::Array[
862
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Scroll::Direction::TaggedSymbol
863
+ ]
864
+ )
865
+ end
866
+ def self.values
867
+ end
868
+ end
869
+ end
870
+
871
+ sig do
872
+ override.returns(
873
+ T::Array[
874
+ ContextDev::MonitorUpdateParams::Target::Page::Action::Variants
875
+ ]
876
+ )
877
+ end
878
+ def self.variants
879
+ end
880
+ end
519
881
  end
520
882
 
521
883
  class Sitemap < ContextDev::Internal::Type::BaseModel
@@ -527,6 +889,7 @@ module ContextDev
527
889
  )
528
890
  end
529
891
 
892
+ # Use `sitemap` to watch a site for added or removed URLs.
530
893
  sig { returns(Symbol) }
531
894
  attr_accessor :type
532
895
 
@@ -555,11 +918,7 @@ module ContextDev
555
918
  sig { params(max_urls: Integer).void }
556
919
  attr_writer :max_urls
557
920
 
558
- # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
559
- # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
560
- # and its subdomains before comparison. On a detected difference the sitemap is
561
- # re-fetched within the same run and only URLs both observations agree on are
562
- # reported, suppressing transient crawl flaps.
921
+ # Watch a site’s URL inventory for confirmed additions and removals.
563
922
  sig do
564
923
  params(
565
924
  url: String,
@@ -578,6 +937,7 @@ module ContextDev
578
937
  include: nil,
579
938
  # Maximum number of sitemap URLs to track (capped at 10,000).
580
939
  max_urls: nil,
940
+ # Use `sitemap` to watch a site for added or removed URLs.
581
941
  type: :sitemap
582
942
  )
583
943
  end
@@ -611,6 +971,7 @@ module ContextDev
611
971
  sig { returns(String) }
612
972
  attr_accessor :instructions
613
973
 
974
+ # Use `extract` to watch structured data across selected pages.
614
975
  sig { returns(Symbol) }
615
976
  attr_accessor :type
616
977
 
@@ -618,6 +979,7 @@ module ContextDev
618
979
  sig { returns(String) }
619
980
  attr_accessor :url
620
981
 
982
+ # Allow page discovery on subdomains of the target site.
621
983
  sig { returns(T.nilable(T::Boolean)) }
622
984
  attr_reader :follow_subdomains
623
985
 
@@ -638,25 +1000,16 @@ module ContextDev
638
1000
  sig { params(max_pages: Integer).void }
639
1001
  attr_writer :max_pages
640
1002
 
641
- # JSON Schema describing the data you care about. It is used three ways: it guides
642
- # which pages are selected for tracking, it gives the change judge extra context
643
- # on which changes matter (alongside `instructions`), and it defines the shape of
644
- # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
645
- # about once a day). It is not a response format for changes: change events and
646
- # webhook payloads always contain diffs, summaries, and evidence excerpts — never
647
- # data in this schema's shape. If omitted, a default summary + key-points schema
648
- # is used.
1003
+ # JSON Schema for page selection and the baseline snapshot. Changes return diffs
1004
+ # and evidence.
649
1005
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
650
1006
  attr_reader :schema
651
1007
 
652
1008
  sig { params(schema: T::Hash[Symbol, T.anything]).void }
653
1009
  attr_writer :schema
654
1010
 
655
- # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
656
- # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
657
- # track; each run re-checks exactly those pages, and confirmed content changes are
658
- # judged for relevance against the monitor's `instructions` (and `schema`, when
659
- # provided). The tracked page set is refreshed by a periodic re-discovery crawl.
1011
+ # Track relevant pages selected by `schema` and `instructions`; refresh the page
1012
+ # set periodically.
660
1013
  sig do
661
1014
  params(
662
1015
  instructions: String,
@@ -674,20 +1027,16 @@ module ContextDev
674
1027
  instructions:,
675
1028
  # Root URL to extract structured data from.
676
1029
  url:,
1030
+ # Allow page discovery on subdomains of the target site.
677
1031
  follow_subdomains: nil,
678
1032
  # Optional maximum link depth from the starting URL (0 = only the starting page).
679
1033
  max_depth: nil,
680
1034
  # Maximum number of pages to track.
681
1035
  max_pages: nil,
682
- # JSON Schema describing the data you care about. It is used three ways: it guides
683
- # which pages are selected for tracking, it gives the change judge extra context
684
- # on which changes matter (alongside `instructions`), and it defines the shape of
685
- # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
686
- # about once a day). It is not a response format for changes: change events and
687
- # webhook payloads always contain diffs, summaries, and evidence excerpts — never
688
- # data in this schema's shape. If omitted, a default summary + key-points schema
689
- # is used.
1036
+ # JSON Schema for page selection and the baseline snapshot. Changes return diffs
1037
+ # and evidence.
690
1038
  schema: nil,
1039
+ # Use `extract` to watch structured data across selected pages.
691
1040
  type: :extract
692
1041
  )
693
1042
  end
@@ -727,15 +1076,13 @@ module ContextDev
727
1076
  )
728
1077
  end
729
1078
 
730
- # Webhook URL events are delivered to. Slack incoming webhook URLs are
731
- # automatically formatted as Slack messages.
1079
+ # Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
1080
+ # messages.
732
1081
  sig { returns(String) }
733
1082
  attr_accessor :url
734
1083
 
735
- # Events delivered to this endpoint. `change.detected` fires only when a run
736
- # detects a change; `run.completed` fires on every completed run — including runs
737
- # that detected no change — and embeds the change when one was detected. Defaults
738
- # to `["change.detected"]` when omitted.
1084
+ # Events to deliver. Defaults to `change.detected`; `run.completed` also includes
1085
+ # unchanged runs.
739
1086
  sig do
740
1087
  returns(
741
1088
  T.nilable(
@@ -764,7 +1111,7 @@ module ContextDev
764
1111
  sig { params(retry_: ContextDev::RetryConfig::OrHash).void }
765
1112
  attr_writer :retry_
766
1113
 
767
- # Set to null to remove the webhook.
1114
+ # Set to null to remove the webhook. Changing `url` issues a new secret.
768
1115
  sig do
769
1116
  params(
770
1117
  url: String,
@@ -776,13 +1123,11 @@ module ContextDev
776
1123
  ).returns(T.attached_class)
777
1124
  end
778
1125
  def self.new(
779
- # Webhook URL events are delivered to. Slack incoming webhook URLs are
780
- # automatically formatted as Slack messages.
1126
+ # Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
1127
+ # messages.
781
1128
  url:,
782
- # Events delivered to this endpoint. `change.detected` fires only when a run
783
- # detects a change; `run.completed` fires on every completed run — including runs
784
- # that detected no change — and embeds the change when one was detected. Defaults
785
- # to `["change.detected"]` when omitted.
1129
+ # Events to deliver. Defaults to `change.detected`; `run.completed` also includes
1130
+ # unchanged runs.
786
1131
  events: nil,
787
1132
  # Webhook retry settings. Use {} for the default schedule.
788
1133
  retry_: nil