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
@@ -14,7 +14,8 @@ module ContextDev
14
14
  sig { returns(String) }
15
15
  attr_accessor :id
16
16
 
17
- # Discriminated union describing how changes are detected.
17
+ # How changes are judged. Defaults to `semantic` for extract targets and page
18
+ # targets with `instructions`, otherwise `exact`.
18
19
  sig do
19
20
  returns(
20
21
  ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Variants
@@ -25,8 +26,7 @@ module ContextDev
25
26
  sig { returns(Time) }
26
27
  attr_accessor :created_at
27
28
 
28
- # Top-level monitor category. Always `web` today; the concrete behavior is
29
- # described by `target` and `change_detection`.
29
+ # Always `web`. Optional.
30
30
  sig do
31
31
  returns(
32
32
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Mode::TaggedSymbol
@@ -37,29 +37,13 @@ module ContextDev
37
37
  sig { returns(String) }
38
38
  attr_accessor :name
39
39
 
40
- # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
41
- # every 6 hours or every 2 days. The total interval (frequency × unit) must be
42
- # between 10 minutes and 1 year.
43
- sig do
44
- returns(
45
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule
46
- )
47
- end
48
- attr_reader :schedule
49
-
50
- sig do
51
- params(
52
- schedule:
53
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::OrHash
54
- ).void
55
- end
56
- attr_writer :schedule
40
+ # Unique ID of this request, also in `X-Request-Id`. Include it when contacting
41
+ # support.
42
+ sig { returns(String) }
43
+ attr_accessor :request_id
57
44
 
58
- # Monitor lifecycle status. `failed` means the most recent run failed (see the
59
- # monitor's `last_error`); failed monitors keep running on schedule and flip back
60
- # to `active` on the next successful run. Monitors are auto-`paused` after
61
- # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
62
- # status to `active`.
45
+ # Current state. Failed monitors keep running; paused monitors must be resumed
46
+ # with `status: "active"`.
63
47
  sig do
64
48
  returns(
65
49
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Status::TaggedSymbol
@@ -67,7 +51,7 @@ module ContextDev
67
51
  end
68
52
  attr_accessor :status
69
53
 
70
- # Discriminated union describing what the monitor watches.
54
+ # What to watch: a page, a sitemap, or data extracted from a site.
71
55
  sig do
72
56
  returns(
73
57
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Variants
@@ -78,10 +62,8 @@ module ContextDev
78
62
  sig { returns(Time) }
79
63
  attr_accessor :updated_at
80
64
 
81
- # Current baseline: the last observed value the monitor compares new snapshots
82
- # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
83
- # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
84
- # after a target or change_detection update, which resets the baseline).
65
+ # Comparison baseline, included on Retrieve. Null until capture completes or after
66
+ # target changes.
85
67
  sig do
86
68
  returns(
87
69
  T.nilable(
@@ -91,6 +73,24 @@ module ContextDev
91
73
  end
92
74
  attr_accessor :baseline
93
75
 
76
+ # Credits this request used and your remaining balance.
77
+ sig do
78
+ returns(
79
+ T.nilable(
80
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::KeyMetadata
81
+ )
82
+ )
83
+ end
84
+ attr_reader :key_metadata
85
+
86
+ sig do
87
+ params(
88
+ key_metadata:
89
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::KeyMetadata::OrHash
90
+ ).void
91
+ end
92
+ attr_writer :key_metadata
93
+
94
94
  sig { returns(T.nilable(Time)) }
95
95
  attr_accessor :last_change_at
96
96
 
@@ -117,18 +117,38 @@ module ContextDev
117
117
  sig { returns(T.nilable(Time)) }
118
118
  attr_accessor :last_run_at
119
119
 
120
- # When the next scheduled run is due.
120
+ # When the next scheduled run is due; null while paused.
121
121
  sig { returns(T.nilable(Time)) }
122
122
  attr_accessor :next_run_at
123
123
 
124
- # User-defined tags for grouping and filtering monitors and their changes.
125
- # Duplicates are removed.
124
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
125
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
126
+ # between 10 minutes and 1 year.
127
+ sig do
128
+ returns(
129
+ T.nilable(
130
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule
131
+ )
132
+ )
133
+ end
134
+ attr_reader :schedule
135
+
136
+ sig do
137
+ params(
138
+ schedule:
139
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::OrHash
140
+ ).void
141
+ end
142
+ attr_writer :schedule
143
+
144
+ # Labels for filtering monitors, their changes, and their usage.
126
145
  sig { returns(T.nilable(T::Array[String])) }
127
146
  attr_reader :tags
128
147
 
129
148
  sig { params(tags: T::Array[String]).void }
130
149
  attr_writer :tags
131
150
 
151
+ # Webhook destination and delivery settings. Null means no webhook is configured.
132
152
  sig do
133
153
  returns(
134
154
  T.nilable(
@@ -170,8 +190,6 @@ module ContextDev
170
190
  end
171
191
  attr_writer :webhook_failure
172
192
 
173
- # A web monitor. `mode` is the constant `web`; behavior is described by `target`
174
- # (page/sitemap/extract) and `change_detection` (exact/semantic).
175
193
  sig do
176
194
  params(
177
195
  id: String,
@@ -184,8 +202,7 @@ module ContextDev
184
202
  mode:
185
203
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Mode::OrSymbol,
186
204
  name: String,
187
- schedule:
188
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::OrHash,
205
+ request_id: String,
189
206
  status:
190
207
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Status::OrSymbol,
191
208
  target:
@@ -203,6 +220,8 @@ module ContextDev
203
220
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsExtractBaseline::OrHash
204
221
  )
205
222
  ),
223
+ key_metadata:
224
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::KeyMetadata::OrHash,
206
225
  last_change_at: T.nilable(Time),
207
226
  last_error:
208
227
  T.nilable(
@@ -210,6 +229,8 @@ module ContextDev
210
229
  ),
211
230
  last_run_at: T.nilable(Time),
212
231
  next_run_at: T.nilable(Time),
232
+ schedule:
233
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::OrHash,
213
234
  tags: T::Array[String],
214
235
  webhook:
215
236
  T.nilable(
@@ -223,40 +244,40 @@ module ContextDev
223
244
  end
224
245
  def self.new(
225
246
  id:,
226
- # Discriminated union describing how changes are detected.
247
+ # How changes are judged. Defaults to `semantic` for extract targets and page
248
+ # targets with `instructions`, otherwise `exact`.
227
249
  change_detection:,
228
250
  created_at:,
229
- # Top-level monitor category. Always `web` today; the concrete behavior is
230
- # described by `target` and `change_detection`.
251
+ # Always `web`. Optional.
231
252
  mode:,
232
253
  name:,
233
- # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
234
- # every 6 hours or every 2 days. The total interval (frequency × unit) must be
235
- # between 10 minutes and 1 year.
236
- schedule:,
237
- # Monitor lifecycle status. `failed` means the most recent run failed (see the
238
- # monitor's `last_error`); failed monitors keep running on schedule and flip back
239
- # to `active` on the next successful run. Monitors are auto-`paused` after
240
- # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
241
- # status to `active`.
254
+ # Unique ID of this request, also in `X-Request-Id`. Include it when contacting
255
+ # support.
256
+ request_id:,
257
+ # Current state. Failed monitors keep running; paused monitors must be resumed
258
+ # with `status: "active"`.
242
259
  status:,
243
- # Discriminated union describing what the monitor watches.
260
+ # What to watch: a page, a sitemap, or data extracted from a site.
244
261
  target:,
245
262
  updated_at:,
246
- # Current baseline: the last observed value the monitor compares new snapshots
247
- # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
248
- # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
249
- # after a target or change_detection update, which resets the baseline).
263
+ # Comparison baseline, included on Retrieve. Null until capture completes or after
264
+ # target changes.
250
265
  baseline: nil,
266
+ # Credits this request used and your remaining balance.
267
+ key_metadata: nil,
251
268
  last_change_at: nil,
252
269
  # Error from the most recent failed run; null when the last run succeeded.
253
270
  last_error: nil,
254
271
  last_run_at: nil,
255
- # When the next scheduled run is due.
272
+ # When the next scheduled run is due; null while paused.
256
273
  next_run_at: nil,
257
- # User-defined tags for grouping and filtering monitors and their changes.
258
- # Duplicates are removed.
274
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
275
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
276
+ # between 10 minutes and 1 year.
277
+ schedule: nil,
278
+ # Labels for filtering monitors, their changes, and their usage.
259
279
  tags: nil,
280
+ # Webhook destination and delivery settings. Null means no webhook is configured.
260
281
  webhook: nil,
261
282
  # Present while webhook deliveries are failing consecutively; null when deliveries
262
283
  # are healthy or no webhook is configured. Cleared on the next successful delivery
@@ -275,8 +296,7 @@ module ContextDev
275
296
  mode:
276
297
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Mode::TaggedSymbol,
277
298
  name: String,
278
- schedule:
279
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule,
299
+ request_id: String,
280
300
  status:
281
301
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Status::TaggedSymbol,
282
302
  target:
@@ -286,6 +306,8 @@ module ContextDev
286
306
  T.nilable(
287
307
  ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::Variants
288
308
  ),
309
+ key_metadata:
310
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::KeyMetadata,
289
311
  last_change_at: T.nilable(Time),
290
312
  last_error:
291
313
  T.nilable(
@@ -293,6 +315,8 @@ module ContextDev
293
315
  ),
294
316
  last_run_at: T.nilable(Time),
295
317
  next_run_at: T.nilable(Time),
318
+ schedule:
319
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule,
296
320
  tags: T::Array[String],
297
321
  webhook:
298
322
  T.nilable(
@@ -308,7 +332,8 @@ module ContextDev
308
332
  def to_hash
309
333
  end
310
334
 
311
- # Discriminated union describing how changes are detected.
335
+ # How changes are judged. Defaults to `semantic` for extract targets and page
336
+ # targets with `instructions`, otherwise `exact`.
312
337
  module ChangeDetection
313
338
  extend ContextDev::Internal::Type::Union
314
339
 
@@ -329,13 +354,17 @@ module ContextDev
329
354
  )
330
355
  end
331
356
 
357
+ # Use `exact` to compare visible text or sitemap URLs.
332
358
  sig { returns(Symbol) }
333
359
  attr_accessor :type
334
360
 
335
361
  # Detect exact changes. For page targets, this means visible text diffs. For
336
362
  # sitemap targets, this means URL additions and removals.
337
363
  sig { params(type: Symbol).returns(T.attached_class) }
338
- def self.new(type: :exact)
364
+ def self.new(
365
+ # Use `exact` to compare visible text or sitemap URLs.
366
+ type: :exact
367
+ )
339
368
  end
340
369
 
341
370
  sig { override.returns({ type: Symbol }) }
@@ -352,25 +381,30 @@ module ContextDev
352
381
  )
353
382
  end
354
383
 
384
+ # Use `semantic` to judge changes against the target instructions.
355
385
  sig { returns(Symbol) }
356
386
  attr_accessor :type
357
387
 
388
+ # Minimum confidence required to report a meaningful change, from 0 to 1.
358
389
  sig { returns(T.nilable(Float)) }
359
390
  attr_reader :confidence_threshold
360
391
 
361
392
  sig { params(confidence_threshold: Float).void }
362
393
  attr_writer :confidence_threshold
363
394
 
364
- # Detect meaning-level changes to page content, ignoring cosmetic or
365
- # instruction-irrelevant differences. Which changes are meaningful is judged
366
- # against the page or extract target's `instructions` (and an extract target's
367
- # `schema`, when provided).
395
+ # Detect meaningful content changes using the target’s instructions and optional
396
+ # schema.
368
397
  sig do
369
398
  params(confidence_threshold: Float, type: Symbol).returns(
370
399
  T.attached_class
371
400
  )
372
401
  end
373
- def self.new(confidence_threshold: nil, type: :semantic)
402
+ def self.new(
403
+ # Minimum confidence required to report a meaningful change, from 0 to 1.
404
+ confidence_threshold: nil,
405
+ # Use `semantic` to judge changes against the target instructions.
406
+ type: :semantic
407
+ )
374
408
  end
375
409
 
376
410
  sig do
@@ -391,8 +425,7 @@ module ContextDev
391
425
  end
392
426
  end
393
427
 
394
- # Top-level monitor category. Always `web` today; the concrete behavior is
395
- # described by `target` and `change_detection`.
428
+ # Always `web`. Optional.
396
429
  module Mode
397
430
  extend ContextDev::Internal::Type::Enum
398
431
 
@@ -422,145 +455,8 @@ module ContextDev
422
455
  end
423
456
  end
424
457
 
425
- class Schedule < ContextDev::Internal::Type::BaseModel
426
- OrHash =
427
- T.type_alias do
428
- T.any(
429
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule,
430
- ContextDev::Internal::AnyHash
431
- )
432
- end
433
-
434
- # Number of units between runs. The resulting interval (frequency × unit) must be
435
- # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
436
- # maximum 365 when unit is days).
437
- sig { returns(Integer) }
438
- attr_accessor :frequency
439
-
440
- sig do
441
- returns(
442
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol
443
- )
444
- end
445
- attr_accessor :type
446
-
447
- sig do
448
- returns(
449
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
450
- )
451
- end
452
- attr_accessor :unit
453
-
454
- # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
455
- # every 6 hours or every 2 days. The total interval (frequency × unit) must be
456
- # between 10 minutes and 1 year.
457
- sig do
458
- params(
459
- frequency: Integer,
460
- type:
461
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::OrSymbol,
462
- unit:
463
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::OrSymbol
464
- ).returns(T.attached_class)
465
- end
466
- def self.new(
467
- # Number of units between runs. The resulting interval (frequency × unit) must be
468
- # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
469
- # maximum 365 when unit is days).
470
- frequency:,
471
- type:,
472
- unit:
473
- )
474
- end
475
-
476
- sig do
477
- override.returns(
478
- {
479
- frequency: Integer,
480
- type:
481
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol,
482
- unit:
483
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
484
- }
485
- )
486
- end
487
- def to_hash
488
- end
489
-
490
- module Type
491
- extend ContextDev::Internal::Type::Enum
492
-
493
- TaggedSymbol =
494
- T.type_alias do
495
- T.all(
496
- Symbol,
497
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type
498
- )
499
- end
500
- OrSymbol = T.type_alias { T.any(Symbol, String) }
501
-
502
- INTERVAL =
503
- T.let(
504
- :interval,
505
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol
506
- )
507
-
508
- sig do
509
- override.returns(
510
- T::Array[
511
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol
512
- ]
513
- )
514
- end
515
- def self.values
516
- end
517
- end
518
-
519
- module Unit
520
- extend ContextDev::Internal::Type::Enum
521
-
522
- TaggedSymbol =
523
- T.type_alias do
524
- T.all(
525
- Symbol,
526
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit
527
- )
528
- end
529
- OrSymbol = T.type_alias { T.any(Symbol, String) }
530
-
531
- MINUTES =
532
- T.let(
533
- :minutes,
534
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
535
- )
536
- HOURS =
537
- T.let(
538
- :hours,
539
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
540
- )
541
- DAYS =
542
- T.let(
543
- :days,
544
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
545
- )
546
-
547
- sig do
548
- override.returns(
549
- T::Array[
550
- ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
551
- ]
552
- )
553
- end
554
- def self.values
555
- end
556
- end
557
- end
558
-
559
- # Monitor lifecycle status. `failed` means the most recent run failed (see the
560
- # monitor's `last_error`); failed monitors keep running on schedule and flip back
561
- # to `active` on the next successful run. Monitors are auto-`paused` after
562
- # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
563
- # status to `active`.
458
+ # Current state. Failed monitors keep running; paused monitors must be resumed
459
+ # with `status: "active"`.
564
460
  module Status
565
461
  extend ContextDev::Internal::Type::Enum
566
462
 
@@ -600,7 +496,7 @@ module ContextDev
600
496
  end
601
497
  end
602
498
 
603
- # Discriminated union describing what the monitor watches.
499
+ # What to watch: a page, a sitemap, or data extracted from a site.
604
500
  module Target
605
501
  extend ContextDev::Internal::Type::Union
606
502
 
@@ -622,27 +518,37 @@ module ContextDev
622
518
  )
623
519
  end
624
520
 
521
+ # Use `page` to watch one web page.
625
522
  sig { returns(Symbol) }
626
523
  attr_accessor :type
627
524
 
525
+ # Public HTTP(S) page URL to monitor.
628
526
  sig { returns(String) }
629
527
  attr_accessor :url
630
528
 
631
- # CSS selectors for HTML regions to remove before text extraction. Applied after
632
- # include_selectors; exclusion takes precedence when an element matches both. Omit
633
- # or pass an empty array to apply no explicit exclusions. Changing these selectors
634
- # creates a new baseline.
529
+ # Optional browser actions executed in array order after the page loads, before
530
+ # content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
531
+ # Changes create a new baseline.
532
+ sig do
533
+ returns(
534
+ T.nilable(
535
+ T::Array[
536
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Variants
537
+ ]
538
+ )
539
+ )
540
+ end
541
+ attr_accessor :actions
542
+
543
+ # Remove matching regions after inclusions. Changes create a new baseline.
635
544
  sig { returns(T.nilable(T::Array[String])) }
636
545
  attr_reader :exclude_selectors
637
546
 
638
547
  sig { params(exclude_selectors: T::Array[String]).void }
639
548
  attr_writer :exclude_selectors
640
549
 
641
- # CSS selectors defining the HTML regions to monitor. Matching subtrees are
642
- # combined in document order before text extraction, instead of automatic
643
- # main-content selection. Omit or pass an empty array to use automatic
644
- # main-content extraction. If the filtered page has no usable text, the run fails
645
- # without replacing the baseline. Changing these selectors creates a new baseline.
550
+ # Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
551
+ # create a new baseline.
646
552
  sig { returns(T.nilable(T::Array[String])) }
647
553
  attr_reader :include_selectors
648
554
 
@@ -669,6 +575,16 @@ module ContextDev
669
575
  sig do
670
576
  params(
671
577
  url: String,
578
+ actions:
579
+ T.nilable(
580
+ T::Array[
581
+ T.any(
582
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Wait::OrHash,
583
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Perform::OrHash,
584
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::OrHash
585
+ )
586
+ ]
587
+ ),
672
588
  exclude_selectors: T::Array[String],
673
589
  include_selectors: T::Array[String],
674
590
  instructions: String,
@@ -677,23 +593,23 @@ module ContextDev
677
593
  ).returns(T.attached_class)
678
594
  end
679
595
  def self.new(
596
+ # Public HTTP(S) page URL to monitor.
680
597
  url:,
681
- # CSS selectors for HTML regions to remove before text extraction. Applied after
682
- # include_selectors; exclusion takes precedence when an element matches both. Omit
683
- # or pass an empty array to apply no explicit exclusions. Changing these selectors
684
- # creates a new baseline.
598
+ # Optional browser actions executed in array order after the page loads, before
599
+ # content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
600
+ # Changes create a new baseline.
601
+ actions: nil,
602
+ # Remove matching regions after inclusions. Changes create a new baseline.
685
603
  exclude_selectors: nil,
686
- # CSS selectors defining the HTML regions to monitor. Matching subtrees are
687
- # combined in document order before text extraction, instead of automatic
688
- # main-content selection. Omit or pass an empty array to use automatic
689
- # main-content extraction. If the filtered page has no usable text, the run fails
690
- # without replacing the baseline. Changing these selectors creates a new baseline.
604
+ # Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
605
+ # create a new baseline.
691
606
  include_selectors: nil,
692
607
  # Plain-language goal describing which page changes matter. When provided without
693
608
  # change_detection, semantic detection is inferred.
694
609
  instructions: nil,
695
610
  # Normalize whitespace before comparing or analyzing text.
696
611
  normalize_whitespace: nil,
612
+ # Use `page` to watch one web page.
697
613
  type: :page
698
614
  )
699
615
  end
@@ -703,6 +619,12 @@ module ContextDev
703
619
  {
704
620
  type: Symbol,
705
621
  url: String,
622
+ actions:
623
+ T.nilable(
624
+ T::Array[
625
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Variants
626
+ ]
627
+ ),
706
628
  exclude_selectors: T::Array[String],
707
629
  include_selectors: T::Array[String],
708
630
  instructions: String,
@@ -712,6 +634,305 @@ module ContextDev
712
634
  end
713
635
  def to_hash
714
636
  end
637
+
638
+ # Browser action discriminated by `do`. Each variant exposes only its applicable
639
+ # fields.
640
+ module Action
641
+ extend ContextDev::Internal::Type::Union
642
+
643
+ Variants =
644
+ T.type_alias do
645
+ T.any(
646
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Wait,
647
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Perform,
648
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll
649
+ )
650
+ end
651
+
652
+ class Wait < ContextDev::Internal::Type::BaseModel
653
+ OrHash =
654
+ T.type_alias do
655
+ T.any(
656
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Wait,
657
+ ContextDev::Internal::AnyHash
658
+ )
659
+ end
660
+
661
+ # Use `wait` to pause for a fixed duration.
662
+ sig { returns(Symbol) }
663
+ attr_accessor :do_
664
+
665
+ # Time to pause in milliseconds before the next action.
666
+ sig { returns(Integer) }
667
+ attr_accessor :time_ms
668
+
669
+ # Pause for a fixed number of milliseconds before continuing to the next action.
670
+ sig do
671
+ params(time_ms: Integer, do_: Symbol).returns(T.attached_class)
672
+ end
673
+ def self.new(
674
+ # Time to pause in milliseconds before the next action.
675
+ time_ms:,
676
+ # Use `wait` to pause for a fixed duration.
677
+ do_: :wait
678
+ )
679
+ end
680
+
681
+ sig { override.returns({ do_: Symbol, time_ms: Integer }) }
682
+ def to_hash
683
+ end
684
+ end
685
+
686
+ class Perform < ContextDev::Internal::Type::BaseModel
687
+ OrHash =
688
+ T.type_alias do
689
+ T.any(
690
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Perform,
691
+ ContextDev::Internal::AnyHash
692
+ )
693
+ end
694
+
695
+ # One browser instruction, such as clicking a button or entering text.
696
+ sig { returns(String) }
697
+ attr_accessor :action
698
+
699
+ # Use `perform` for a plain-language browser instruction.
700
+ sig { returns(Symbol) }
701
+ attr_accessor :do_
702
+
703
+ # Resolve and perform one natural-language browser action.
704
+ sig do
705
+ params(action: String, do_: Symbol).returns(T.attached_class)
706
+ end
707
+ def self.new(
708
+ # One browser instruction, such as clicking a button or entering text.
709
+ action:,
710
+ # Use `perform` for a plain-language browser instruction.
711
+ do_: :perform
712
+ )
713
+ end
714
+
715
+ sig { override.returns({ action: String, do_: Symbol }) }
716
+ def to_hash
717
+ end
718
+ end
719
+
720
+ class Scroll < ContextDev::Internal::Type::BaseModel
721
+ OrHash =
722
+ T.type_alias do
723
+ T.any(
724
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll,
725
+ ContextDev::Internal::AnyHash
726
+ )
727
+ end
728
+
729
+ # Use `scroll` to move through the page or a container.
730
+ sig { returns(Symbol) }
731
+ attr_accessor :do_
732
+
733
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
734
+ # Defaults to viewport.
735
+ sig do
736
+ returns(
737
+ T.nilable(
738
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::Variants
739
+ )
740
+ )
741
+ end
742
+ attr_reader :amount
743
+
744
+ sig do
745
+ params(
746
+ amount:
747
+ T.any(
748
+ Integer,
749
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::OrSymbol
750
+ )
751
+ ).void
752
+ end
753
+ attr_writer :amount
754
+
755
+ # CSS selector for the first matching scroll container. Defaults to the page.
756
+ sig { returns(T.nilable(String)) }
757
+ attr_reader :container
758
+
759
+ sig { params(container: String).void }
760
+ attr_writer :container
761
+
762
+ # Direction to scroll. Defaults to down.
763
+ sig do
764
+ returns(
765
+ T.nilable(
766
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol
767
+ )
768
+ )
769
+ end
770
+ attr_reader :direction
771
+
772
+ sig do
773
+ params(
774
+ direction:
775
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::OrSymbol
776
+ ).void
777
+ end
778
+ attr_writer :direction
779
+
780
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
781
+ # changing. Defaults to 1.
782
+ sig { returns(T.nilable(Integer)) }
783
+ attr_reader :max_scrolls
784
+
785
+ sig { params(max_scrolls: Integer).void }
786
+ attr_writer :max_scrolls
787
+
788
+ # Scroll the page or a selected scrollable container, waiting adaptively for
789
+ # content and dimensions to settle after each iteration.
790
+ sig do
791
+ params(
792
+ amount:
793
+ T.any(
794
+ Integer,
795
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::OrSymbol
796
+ ),
797
+ container: String,
798
+ direction:
799
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::OrSymbol,
800
+ max_scrolls: Integer,
801
+ do_: Symbol
802
+ ).returns(T.attached_class)
803
+ end
804
+ def self.new(
805
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
806
+ # Defaults to viewport.
807
+ amount: nil,
808
+ # CSS selector for the first matching scroll container. Defaults to the page.
809
+ container: nil,
810
+ # Direction to scroll. Defaults to down.
811
+ direction: nil,
812
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
813
+ # changing. Defaults to 1.
814
+ max_scrolls: nil,
815
+ # Use `scroll` to move through the page or a container.
816
+ do_: :scroll
817
+ )
818
+ end
819
+
820
+ sig do
821
+ override.returns(
822
+ {
823
+ do_: Symbol,
824
+ amount:
825
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::Variants,
826
+ container: String,
827
+ direction:
828
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol,
829
+ max_scrolls: Integer
830
+ }
831
+ )
832
+ end
833
+ def to_hash
834
+ end
835
+
836
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
837
+ # Defaults to viewport.
838
+ module Amount
839
+ extend ContextDev::Internal::Type::Union
840
+
841
+ Variants =
842
+ T.type_alias do
843
+ T.any(
844
+ Integer,
845
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::TaggedSymbol
846
+ )
847
+ end
848
+
849
+ sig do
850
+ override.returns(
851
+ T::Array[
852
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::Variants
853
+ ]
854
+ )
855
+ end
856
+ def self.variants
857
+ end
858
+
859
+ TaggedSymbol =
860
+ T.type_alias do
861
+ T.all(
862
+ Symbol,
863
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount
864
+ )
865
+ end
866
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
867
+
868
+ VIEWPORT =
869
+ T.let(
870
+ :viewport,
871
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::TaggedSymbol
872
+ )
873
+ MAX =
874
+ T.let(
875
+ :max,
876
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Amount::TaggedSymbol
877
+ )
878
+ end
879
+
880
+ # Direction to scroll. Defaults to down.
881
+ module Direction
882
+ extend ContextDev::Internal::Type::Enum
883
+
884
+ TaggedSymbol =
885
+ T.type_alias do
886
+ T.all(
887
+ Symbol,
888
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction
889
+ )
890
+ end
891
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
892
+
893
+ UP =
894
+ T.let(
895
+ :up,
896
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol
897
+ )
898
+ DOWN =
899
+ T.let(
900
+ :down,
901
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol
902
+ )
903
+ LEFT =
904
+ T.let(
905
+ :left,
906
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol
907
+ )
908
+ RIGHT =
909
+ T.let(
910
+ :right,
911
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol
912
+ )
913
+
914
+ sig do
915
+ override.returns(
916
+ T::Array[
917
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Scroll::Direction::TaggedSymbol
918
+ ]
919
+ )
920
+ end
921
+ def self.values
922
+ end
923
+ end
924
+ end
925
+
926
+ sig do
927
+ override.returns(
928
+ T::Array[
929
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page::Action::Variants
930
+ ]
931
+ )
932
+ end
933
+ def self.variants
934
+ end
935
+ end
715
936
  end
716
937
 
717
938
  class Sitemap < ContextDev::Internal::Type::BaseModel
@@ -723,6 +944,7 @@ module ContextDev
723
944
  )
724
945
  end
725
946
 
947
+ # Use `sitemap` to watch a site for added or removed URLs.
726
948
  sig { returns(Symbol) }
727
949
  attr_accessor :type
728
950
 
@@ -751,11 +973,7 @@ module ContextDev
751
973
  sig { params(max_urls: Integer).void }
752
974
  attr_writer :max_urls
753
975
 
754
- # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
755
- # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
756
- # and its subdomains before comparison. On a detected difference the sitemap is
757
- # re-fetched within the same run and only URLs both observations agree on are
758
- # reported, suppressing transient crawl flaps.
976
+ # Watch a site’s URL inventory for confirmed additions and removals.
759
977
  sig do
760
978
  params(
761
979
  url: String,
@@ -774,6 +992,7 @@ module ContextDev
774
992
  include: nil,
775
993
  # Maximum number of sitemap URLs to track (capped at 10,000).
776
994
  max_urls: nil,
995
+ # Use `sitemap` to watch a site for added or removed URLs.
777
996
  type: :sitemap
778
997
  )
779
998
  end
@@ -807,6 +1026,7 @@ module ContextDev
807
1026
  sig { returns(String) }
808
1027
  attr_accessor :instructions
809
1028
 
1029
+ # Use `extract` to watch structured data across selected pages.
810
1030
  sig { returns(Symbol) }
811
1031
  attr_accessor :type
812
1032
 
@@ -814,6 +1034,7 @@ module ContextDev
814
1034
  sig { returns(String) }
815
1035
  attr_accessor :url
816
1036
 
1037
+ # Allow page discovery on subdomains of the target site.
817
1038
  sig { returns(T.nilable(T::Boolean)) }
818
1039
  attr_reader :follow_subdomains
819
1040
 
@@ -834,25 +1055,16 @@ module ContextDev
834
1055
  sig { params(max_pages: Integer).void }
835
1056
  attr_writer :max_pages
836
1057
 
837
- # JSON Schema describing the data you care about. It is used three ways: it guides
838
- # which pages are selected for tracking, it gives the change judge extra context
839
- # on which changes matter (alongside `instructions`), and it defines the shape of
840
- # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
841
- # about once a day). It is not a response format for changes: change events and
842
- # webhook payloads always contain diffs, summaries, and evidence excerpts — never
843
- # data in this schema's shape. If omitted, a default summary + key-points schema
844
- # is used.
1058
+ # JSON Schema for page selection and the baseline snapshot. Changes return diffs
1059
+ # and evidence.
845
1060
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
846
1061
  attr_reader :schema
847
1062
 
848
1063
  sig { params(schema: T::Hash[Symbol, T.anything]).void }
849
1064
  attr_writer :schema
850
1065
 
851
- # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
852
- # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
853
- # track; each run re-checks exactly those pages, and confirmed content changes are
854
- # judged for relevance against the monitor's `instructions` (and `schema`, when
855
- # provided). The tracked page set is refreshed by a periodic re-discovery crawl.
1066
+ # Track relevant pages selected by `schema` and `instructions`; refresh the page
1067
+ # set periodically.
856
1068
  sig do
857
1069
  params(
858
1070
  instructions: String,
@@ -870,20 +1082,16 @@ module ContextDev
870
1082
  instructions:,
871
1083
  # Root URL to extract structured data from.
872
1084
  url:,
1085
+ # Allow page discovery on subdomains of the target site.
873
1086
  follow_subdomains: nil,
874
1087
  # Optional maximum link depth from the starting URL (0 = only the starting page).
875
1088
  max_depth: nil,
876
1089
  # Maximum number of pages to track.
877
1090
  max_pages: nil,
878
- # JSON Schema describing the data you care about. It is used three ways: it guides
879
- # which pages are selected for tracking, it gives the change judge extra context
880
- # on which changes matter (alongside `instructions`), and it defines the shape of
881
- # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
882
- # about once a day). It is not a response format for changes: change events and
883
- # webhook payloads always contain diffs, summaries, and evidence excerpts — never
884
- # data in this schema's shape. If omitted, a default summary + key-points schema
885
- # is used.
1091
+ # JSON Schema for page selection and the baseline snapshot. Changes return diffs
1092
+ # and evidence.
886
1093
  schema: nil,
1094
+ # Use `extract` to watch structured data across selected pages.
887
1095
  type: :extract
888
1096
  )
889
1097
  end
@@ -916,10 +1124,8 @@ module ContextDev
916
1124
  end
917
1125
  end
918
1126
 
919
- # Current baseline: the last observed value the monitor compares new snapshots
920
- # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
921
- # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
922
- # after a target or change_detection update, which resets the baseline).
1127
+ # Comparison baseline, included on Retrieve. Null until capture completes or after
1128
+ # target changes.
923
1129
  module Baseline
924
1130
  extend ContextDev::Internal::Type::Union
925
1131
 
@@ -1028,10 +1234,8 @@ module ContextDev
1028
1234
  sig { returns(Time) }
1029
1235
  attr_accessor :captured_at
1030
1236
 
1031
- # The extracted structured data, matching the monitor's extraction schema (same
1032
- # shape as the /web/extract endpoint's `data`). Refreshed when the monitor
1033
- # re-discovers its page set (at most about once a day); `null` when no extraction
1034
- # has been captured yet.
1237
+ # Latest structured snapshot matching the extraction schema, refreshed at most
1238
+ # daily; `null` before capture.
1035
1239
  sig { returns(T.anything) }
1036
1240
  attr_accessor :data
1037
1241
 
@@ -1051,10 +1255,8 @@ module ContextDev
1051
1255
  def self.new(
1052
1256
  # When this baseline was last captured or replaced.
1053
1257
  captured_at:,
1054
- # The extracted structured data, matching the monitor's extraction schema (same
1055
- # shape as the /web/extract endpoint's `data`). Refreshed when the monitor
1056
- # re-discovers its page set (at most about once a day); `null` when no extraction
1057
- # has been captured yet.
1258
+ # Latest structured snapshot matching the extraction schema, refreshed at most
1259
+ # daily; `null` before capture.
1058
1260
  data:,
1059
1261
  # The page URLs the monitor tracks and analyzes for changes.
1060
1262
  urls_analyzed:
@@ -1085,6 +1287,46 @@ module ContextDev
1085
1287
  end
1086
1288
  end
1087
1289
 
1290
+ class KeyMetadata < ContextDev::Internal::Type::BaseModel
1291
+ OrHash =
1292
+ T.type_alias do
1293
+ T.any(
1294
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::KeyMetadata,
1295
+ ContextDev::Internal::AnyHash
1296
+ )
1297
+ end
1298
+
1299
+ # Credits charged for this request.
1300
+ sig { returns(Integer) }
1301
+ attr_accessor :credits_consumed
1302
+
1303
+ # Credits remaining for your organization.
1304
+ sig { returns(Integer) }
1305
+ attr_accessor :credits_remaining
1306
+
1307
+ # Credits this request used and your remaining balance.
1308
+ sig do
1309
+ params(credits_consumed: Integer, credits_remaining: Integer).returns(
1310
+ T.attached_class
1311
+ )
1312
+ end
1313
+ def self.new(
1314
+ # Credits charged for this request.
1315
+ credits_consumed:,
1316
+ # Credits remaining for your organization.
1317
+ credits_remaining:
1318
+ )
1319
+ end
1320
+
1321
+ sig do
1322
+ override.returns(
1323
+ { credits_consumed: Integer, credits_remaining: Integer }
1324
+ )
1325
+ end
1326
+ def to_hash
1327
+ end
1328
+ end
1329
+
1088
1330
  class LastError < ContextDev::Internal::Type::BaseModel
1089
1331
  OrHash =
1090
1332
  T.type_alias do
@@ -1110,6 +1352,146 @@ module ContextDev
1110
1352
  end
1111
1353
  end
1112
1354
 
1355
+ class Schedule < ContextDev::Internal::Type::BaseModel
1356
+ OrHash =
1357
+ T.type_alias do
1358
+ T.any(
1359
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule,
1360
+ ContextDev::Internal::AnyHash
1361
+ )
1362
+ end
1363
+
1364
+ # Number of units between runs. The resulting interval (frequency × unit) must be
1365
+ # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
1366
+ # maximum 365 when unit is days).
1367
+ sig { returns(Integer) }
1368
+ attr_accessor :frequency
1369
+
1370
+ # Use `interval` to run on a repeating schedule.
1371
+ sig do
1372
+ returns(
1373
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol
1374
+ )
1375
+ end
1376
+ attr_accessor :type
1377
+
1378
+ # Time unit used with `frequency` to set the run interval.
1379
+ sig do
1380
+ returns(
1381
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
1382
+ )
1383
+ end
1384
+ attr_accessor :unit
1385
+
1386
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
1387
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
1388
+ # between 10 minutes and 1 year.
1389
+ sig do
1390
+ params(
1391
+ frequency: Integer,
1392
+ type:
1393
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::OrSymbol,
1394
+ unit:
1395
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::OrSymbol
1396
+ ).returns(T.attached_class)
1397
+ end
1398
+ def self.new(
1399
+ # Number of units between runs. The resulting interval (frequency × unit) must be
1400
+ # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
1401
+ # maximum 365 when unit is days).
1402
+ frequency:,
1403
+ # Use `interval` to run on a repeating schedule.
1404
+ type:,
1405
+ # Time unit used with `frequency` to set the run interval.
1406
+ unit:
1407
+ )
1408
+ end
1409
+
1410
+ sig do
1411
+ override.returns(
1412
+ {
1413
+ frequency: Integer,
1414
+ type:
1415
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol,
1416
+ unit:
1417
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
1418
+ }
1419
+ )
1420
+ end
1421
+ def to_hash
1422
+ end
1423
+
1424
+ # Use `interval` to run on a repeating schedule.
1425
+ module Type
1426
+ extend ContextDev::Internal::Type::Enum
1427
+
1428
+ TaggedSymbol =
1429
+ T.type_alias do
1430
+ T.all(
1431
+ Symbol,
1432
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type
1433
+ )
1434
+ end
1435
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1436
+
1437
+ INTERVAL =
1438
+ T.let(
1439
+ :interval,
1440
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol
1441
+ )
1442
+
1443
+ sig do
1444
+ override.returns(
1445
+ T::Array[
1446
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type::TaggedSymbol
1447
+ ]
1448
+ )
1449
+ end
1450
+ def self.values
1451
+ end
1452
+ end
1453
+
1454
+ # Time unit used with `frequency` to set the run interval.
1455
+ module Unit
1456
+ extend ContextDev::Internal::Type::Enum
1457
+
1458
+ TaggedSymbol =
1459
+ T.type_alias do
1460
+ T.all(
1461
+ Symbol,
1462
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit
1463
+ )
1464
+ end
1465
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1466
+
1467
+ MINUTES =
1468
+ T.let(
1469
+ :minutes,
1470
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
1471
+ )
1472
+ HOURS =
1473
+ T.let(
1474
+ :hours,
1475
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
1476
+ )
1477
+ DAYS =
1478
+ T.let(
1479
+ :days,
1480
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
1481
+ )
1482
+
1483
+ sig do
1484
+ override.returns(
1485
+ T::Array[
1486
+ ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit::TaggedSymbol
1487
+ ]
1488
+ )
1489
+ end
1490
+ def self.values
1491
+ end
1492
+ end
1493
+ end
1494
+
1113
1495
  class Webhook < ContextDev::Internal::Type::BaseModel
1114
1496
  OrHash =
1115
1497
  T.type_alias do
@@ -1119,15 +1501,13 @@ module ContextDev
1119
1501
  )
1120
1502
  end
1121
1503
 
1122
- # Webhook URL events are delivered to. Slack incoming webhook URLs are
1123
- # automatically formatted as Slack messages.
1504
+ # Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
1505
+ # messages.
1124
1506
  sig { returns(String) }
1125
1507
  attr_accessor :url
1126
1508
 
1127
- # Events delivered to this endpoint. `change.detected` fires only when a run
1128
- # detects a change; `run.completed` fires on every completed run — including runs
1129
- # that detected no change — and embeds the change when one was detected. Defaults
1130
- # to `["change.detected"]` when omitted.
1509
+ # Events to deliver. Defaults to `change.detected`; `run.completed` also includes
1510
+ # unchanged runs.
1131
1511
  sig do
1132
1512
  returns(
1133
1513
  T.nilable(
@@ -1156,18 +1536,15 @@ module ContextDev
1156
1536
  sig { params(retry_: ContextDev::RetryConfig::OrHash).void }
1157
1537
  attr_writer :retry_
1158
1538
 
1159
- # Signing secret used to verify webhook authenticity. Omitted unless the API key
1160
- # has monitors:write permission or full access. Each delivery includes an
1161
- # `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
1162
- # `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
1163
- # compare and reject stale timestamps to prevent replay. Generated by the API;
1164
- # cannot be set by clients.
1539
+ # API-generated signing secret. Visible only with full access or `monitors:write`
1540
+ # permission.
1165
1541
  sig { returns(T.nilable(String)) }
1166
1542
  attr_reader :secret
1167
1543
 
1168
1544
  sig { params(secret: String).void }
1169
1545
  attr_writer :secret
1170
1546
 
1547
+ # Webhook destination and delivery settings. Null means no webhook is configured.
1171
1548
  sig do
1172
1549
  params(
1173
1550
  url: String,
@@ -1180,22 +1557,16 @@ module ContextDev
1180
1557
  ).returns(T.attached_class)
1181
1558
  end
1182
1559
  def self.new(
1183
- # Webhook URL events are delivered to. Slack incoming webhook URLs are
1184
- # automatically formatted as Slack messages.
1560
+ # Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
1561
+ # messages.
1185
1562
  url:,
1186
- # Events delivered to this endpoint. `change.detected` fires only when a run
1187
- # detects a change; `run.completed` fires on every completed run — including runs
1188
- # that detected no change — and embeds the change when one was detected. Defaults
1189
- # to `["change.detected"]` when omitted.
1563
+ # Events to deliver. Defaults to `change.detected`; `run.completed` also includes
1564
+ # unchanged runs.
1190
1565
  events: nil,
1191
1566
  # Webhook retry settings. Use {} for the default schedule.
1192
1567
  retry_: nil,
1193
- # Signing secret used to verify webhook authenticity. Omitted unless the API key
1194
- # has monitors:write permission or full access. Each delivery includes an
1195
- # `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
1196
- # `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
1197
- # compare and reject stale timestamps to prevent replay. Generated by the API;
1198
- # cannot be set by clients.
1568
+ # API-generated signing secret. Visible only with full access or `monitors:write`
1569
+ # permission.
1199
1570
  secret: nil
1200
1571
  )
1201
1572
  end