context.dev 2.17.1 → 2.19.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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +0 -4
  5. data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
  6. data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
  7. data/lib/context_dev/models/monitor_retrieve_run_params.rb +26 -0
  8. data/lib/context_dev/models/monitor_retrieve_run_response.rb +232 -0
  9. data/lib/context_dev/models/monitor_rotate_webhook_secret_params.rb +20 -0
  10. data/lib/context_dev/models/monitor_rotate_webhook_secret_response.rb +765 -0
  11. data/lib/context_dev/models/parse_handle_params.rb +8 -6
  12. data/lib/context_dev/models/person_enrich_params.rb +28 -1
  13. data/lib/context_dev/models/web_answers_params.rb +28 -1
  14. data/lib/context_dev/models/web_extract_competitors_params.rb +28 -1
  15. data/lib/context_dev/models/web_extract_styleguide_params.rb +30 -3
  16. data/lib/context_dev/models/{web_web_scrape_sitemap_params.rb → web_map_urls_params.rb} +22 -20
  17. data/lib/context_dev/models/web_map_urls_response.rb +123 -0
  18. data/lib/context_dev/models/web_scrape_params.rb +906 -0
  19. data/lib/context_dev/models/web_scrape_response.rb +659 -0
  20. data/lib/context_dev/models/web_screenshot_params.rb +25 -9
  21. data/lib/context_dev/models/web_screenshot_response.rb +3 -3
  22. data/lib/context_dev/models/web_search_params.rb +30 -3
  23. data/lib/context_dev/models.rb +8 -20
  24. data/lib/context_dev/resources/brand.rb +0 -36
  25. data/lib/context_dev/resources/industry.rb +6 -2
  26. data/lib/context_dev/resources/monitors.rb +47 -0
  27. data/lib/context_dev/resources/people.rb +3 -1
  28. data/lib/context_dev/resources/web.rb +116 -413
  29. data/lib/context_dev/version.rb +1 -1
  30. data/lib/context_dev.rb +8 -21
  31. data/rbi/context_dev/client.rbi +0 -3
  32. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
  33. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
  34. data/rbi/context_dev/models/monitor_retrieve_run_params.rbi +46 -0
  35. data/rbi/context_dev/models/monitor_retrieve_run_response.rbi +452 -0
  36. data/rbi/context_dev/models/monitor_rotate_webhook_secret_params.rbi +38 -0
  37. data/rbi/context_dev/models/monitor_rotate_webhook_secret_response.rbi +1367 -0
  38. data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
  39. data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
  40. data/rbi/context_dev/models/web_answers_params.rbi +45 -0
  41. data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
  42. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
  43. data/rbi/context_dev/models/{web_web_scrape_sitemap_params.rbi → web_map_urls_params.rbi} +35 -54
  44. data/rbi/context_dev/models/web_map_urls_response.rbi +226 -0
  45. data/rbi/context_dev/models/web_scrape_params.rbi +2000 -0
  46. data/rbi/context_dev/models/{web_web_scrape_html_response.rbi → web_scrape_response.rbi} +550 -418
  47. data/rbi/context_dev/models/web_screenshot_params.rbi +38 -12
  48. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -4
  49. data/rbi/context_dev/models/web_search_params.rbi +48 -3
  50. data/rbi/context_dev/models.rbi +9 -21
  51. data/rbi/context_dev/resources/brand.rbi +0 -35
  52. data/rbi/context_dev/resources/industry.rbi +14 -0
  53. data/rbi/context_dev/resources/monitors.rbi +24 -0
  54. data/rbi/context_dev/resources/parse.rbi +4 -4
  55. data/rbi/context_dev/resources/people.rbi +7 -0
  56. data/rbi/context_dev/resources/web.rbi +166 -533
  57. data/sig/context_dev/client.rbs +0 -2
  58. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
  59. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
  60. data/sig/context_dev/models/monitor_retrieve_run_params.rbs +28 -0
  61. data/sig/context_dev/models/monitor_retrieve_run_response.rbs +182 -0
  62. data/sig/context_dev/models/monitor_rotate_webhook_secret_params.rbs +23 -0
  63. data/sig/context_dev/models/monitor_rotate_webhook_secret_response.rbs +545 -0
  64. data/sig/context_dev/models/person_enrich_params.rbs +21 -1
  65. data/sig/context_dev/models/web_answers_params.rbs +21 -1
  66. data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
  67. data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
  68. data/sig/context_dev/models/{web_web_scrape_sitemap_params.rbs → web_map_urls_params.rbs} +22 -22
  69. data/sig/context_dev/models/web_map_urls_response.rbs +125 -0
  70. data/sig/context_dev/models/web_scrape_params.rbs +834 -0
  71. data/sig/context_dev/models/web_scrape_response.rbs +552 -0
  72. data/sig/context_dev/models/web_screenshot_params.rbs +7 -0
  73. data/sig/context_dev/models/web_search_params.rbs +21 -1
  74. data/sig/context_dev/models.rbs +8 -20
  75. data/sig/context_dev/resources/brand.rbs +0 -9
  76. data/sig/context_dev/resources/industry.rbs +2 -0
  77. data/sig/context_dev/resources/monitors.rbs +11 -0
  78. data/sig/context_dev/resources/people.rbs +1 -0
  79. data/sig/context_dev/resources/web.rbs +34 -108
  80. metadata +26 -65
  81. data/lib/context_dev/models/ai_extract_product_params.rb +0 -98
  82. data/lib/context_dev/models/ai_extract_product_response.rb +0 -352
  83. data/lib/context_dev/models/ai_extract_products_params.rb +0 -233
  84. data/lib/context_dev/models/ai_extract_products_response.rb +0 -320
  85. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +0 -120
  86. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +0 -441
  87. data/lib/context_dev/models/web_extract_fonts_params.rb +0 -114
  88. data/lib/context_dev/models/web_extract_fonts_response.rb +0 -291
  89. data/lib/context_dev/models/web_extract_params.rb +0 -392
  90. data/lib/context_dev/models/web_extract_response.rb +0 -287
  91. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +0 -344
  92. data/lib/context_dev/models/web_web_scrape_bytes_response.rb +0 -135
  93. data/lib/context_dev/models/web_web_scrape_html_params.rb +0 -633
  94. data/lib/context_dev/models/web_web_scrape_html_response.rb +0 -588
  95. data/lib/context_dev/models/web_web_scrape_images_params.rb +0 -346
  96. data/lib/context_dev/models/web_web_scrape_images_response.rb +0 -409
  97. data/lib/context_dev/models/web_web_scrape_md_params.rb +0 -668
  98. data/lib/context_dev/models/web_web_scrape_md_response.rb +0 -567
  99. data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +0 -144
  100. data/lib/context_dev/resources/ai.rb +0 -69
  101. data/rbi/context_dev/models/ai_extract_product_params.rbi +0 -199
  102. data/rbi/context_dev/models/ai_extract_product_response.rbi +0 -696
  103. data/rbi/context_dev/models/ai_extract_products_params.rbi +0 -490
  104. data/rbi/context_dev/models/ai_extract_products_response.rbi +0 -623
  105. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +0 -256
  106. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +0 -1040
  107. data/rbi/context_dev/models/web_extract_fonts_params.rbi +0 -223
  108. data/rbi/context_dev/models/web_extract_fonts_response.rbi +0 -563
  109. data/rbi/context_dev/models/web_extract_params.rbi +0 -736
  110. data/rbi/context_dev/models/web_extract_response.rbi +0 -512
  111. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +0 -699
  112. data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +0 -238
  113. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +0 -1217
  114. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +0 -671
  115. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +0 -910
  116. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +0 -1049
  117. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +0 -1088
  118. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +0 -258
  119. data/rbi/context_dev/resources/ai.rbi +0 -56
  120. data/sig/context_dev/models/ai_extract_product_params.rbs +0 -86
  121. data/sig/context_dev/models/ai_extract_product_response.rbs +0 -273
  122. data/sig/context_dev/models/ai_extract_products_params.rbs +0 -202
  123. data/sig/context_dev/models/ai_extract_products_response.rbs +0 -252
  124. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +0 -104
  125. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +0 -413
  126. data/sig/context_dev/models/web_extract_fonts_params.rbs +0 -93
  127. data/sig/context_dev/models/web_extract_fonts_response.rbs +0 -230
  128. data/sig/context_dev/models/web_extract_params.rbs +0 -304
  129. data/sig/context_dev/models/web_extract_response.rbs +0 -239
  130. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +0 -531
  131. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +0 -108
  132. data/sig/context_dev/models/web_web_scrape_html_params.rbs +0 -730
  133. data/sig/context_dev/models/web_web_scrape_html_response.rbs +0 -495
  134. data/sig/context_dev/models/web_web_scrape_images_params.rbs +0 -261
  135. data/sig/context_dev/models/web_web_scrape_images_response.rbs +0 -371
  136. data/sig/context_dev/models/web_web_scrape_md_params.rbs +0 -758
  137. data/sig/context_dev/models/web_web_scrape_md_response.rbs +0 -465
  138. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +0 -117
  139. data/sig/context_dev/resources/ai.rbs +0 -20
@@ -0,0 +1,765 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Monitors#rotate_webhook_secret
6
+ class MonitorRotateWebhookSecretResponse < ContextDev::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute change_detection
13
+ # Discriminated union describing how changes are detected.
14
+ #
15
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Exact, ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Semantic]
16
+ required :change_detection,
17
+ union: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection }
18
+
19
+ # @!attribute created_at
20
+ #
21
+ # @return [Time]
22
+ required :created_at, Time
23
+
24
+ # @!attribute mode
25
+ # Top-level monitor category. Always `web` today; the concrete behavior is
26
+ # described by `target` and `change_detection`.
27
+ #
28
+ # @return [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Mode]
29
+ required :mode, enum: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Mode }
30
+
31
+ # @!attribute name
32
+ #
33
+ # @return [String]
34
+ required :name, String
35
+
36
+ # @!attribute schedule
37
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
38
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
39
+ # between 10 minutes and 1 year.
40
+ #
41
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule]
42
+ required :schedule, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule }
43
+
44
+ # @!attribute status
45
+ # Monitor lifecycle status. `failed` means the most recent run failed (see the
46
+ # monitor's `last_error`); failed monitors keep running on schedule and flip back
47
+ # to `active` on the next successful run. Monitors are auto-`paused` after
48
+ # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
49
+ # status to `active`.
50
+ #
51
+ # @return [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Status]
52
+ required :status, enum: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Status }
53
+
54
+ # @!attribute target
55
+ # Discriminated union describing what the monitor watches.
56
+ #
57
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page, ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Sitemap, ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Extract]
58
+ required :target, union: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Target }
59
+
60
+ # @!attribute updated_at
61
+ #
62
+ # @return [Time]
63
+ required :updated_at, Time
64
+
65
+ # @!attribute baseline
66
+ # Current baseline: the last observed value the monitor compares new snapshots
67
+ # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
68
+ # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
69
+ # after a target or change_detection update, which resets the baseline).
70
+ #
71
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsExtractBaseline, nil]
72
+ optional :baseline,
73
+ union: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline },
74
+ nil?: true
75
+
76
+ # @!attribute last_change_at
77
+ #
78
+ # @return [Time, nil]
79
+ optional :last_change_at, Time, nil?: true
80
+
81
+ # @!attribute last_error
82
+ # Error from the most recent failed run; null when the last run succeeded.
83
+ #
84
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::LastError, nil]
85
+ optional :last_error, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::LastError }, nil?: true
86
+
87
+ # @!attribute last_run_at
88
+ #
89
+ # @return [Time, nil]
90
+ optional :last_run_at, Time, nil?: true
91
+
92
+ # @!attribute next_run_at
93
+ # When the next scheduled run is due.
94
+ #
95
+ # @return [Time, nil]
96
+ optional :next_run_at, Time, nil?: true
97
+
98
+ # @!attribute tags
99
+ # User-defined tags for grouping and filtering monitors and their changes.
100
+ # Duplicates are removed.
101
+ #
102
+ # @return [Array<String>, nil]
103
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
104
+
105
+ # @!attribute webhook
106
+ #
107
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook, nil]
108
+ optional :webhook, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook }, nil?: true
109
+
110
+ # @!attribute webhook_failure
111
+ # Present while webhook deliveries are failing consecutively; null when deliveries
112
+ # are healthy or no webhook is configured. Cleared on the next successful delivery
113
+ # and when the webhook URL changes.
114
+ #
115
+ # @return [ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure, nil]
116
+ optional :webhook_failure,
117
+ -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure },
118
+ nil?: true
119
+
120
+ # @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, baseline: nil, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil, webhook_failure: nil)
121
+ # Some parameter documentations has been truncated, see
122
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse} for more details.
123
+ #
124
+ # A web monitor. `mode` is the constant `web`; behavior is described by `target`
125
+ # (page/sitemap/extract) and `change_detection` (exact/semantic).
126
+ #
127
+ # @param id [String]
128
+ #
129
+ # @param change_detection [ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Exact, ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
130
+ #
131
+ # @param created_at [Time]
132
+ #
133
+ # @param mode [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ
134
+ #
135
+ # @param name [String]
136
+ #
137
+ # @param schedule [ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
138
+ #
139
+ # @param status [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon
140
+ #
141
+ # @param target [ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page, ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Sitemap, ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Extract] Discriminated union describing what the monitor watches.
142
+ #
143
+ # @param updated_at [Time]
144
+ #
145
+ # @param baseline [ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga
146
+ #
147
+ # @param last_change_at [Time, nil]
148
+ #
149
+ # @param last_error [ContextDev::Models::MonitorRotateWebhookSecretResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
150
+ #
151
+ # @param last_run_at [Time, nil]
152
+ #
153
+ # @param next_run_at [Time, nil] When the next scheduled run is due.
154
+ #
155
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
156
+ #
157
+ # @param webhook [ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook, nil]
158
+ #
159
+ # @param webhook_failure [ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure, nil] Present while webhook deliveries are failing consecutively; null when deliveries
160
+
161
+ # Discriminated union describing how changes are detected.
162
+ #
163
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#change_detection
164
+ module ChangeDetection
165
+ extend ContextDev::Internal::Type::Union
166
+
167
+ discriminator :type
168
+
169
+ # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
170
+ variant :exact, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Exact }
171
+
172
+ # Detect meaning-level changes to page content, ignoring cosmetic or instruction-irrelevant differences. Which changes are meaningful is judged against the page or extract target's `instructions` (and an extract target's `schema`, when provided).
173
+ variant :semantic,
174
+ -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Semantic }
175
+
176
+ class Exact < ContextDev::Internal::Type::BaseModel
177
+ # @!attribute type
178
+ #
179
+ # @return [Symbol, :exact]
180
+ required :type, const: :exact
181
+
182
+ # @!method initialize(type: :exact)
183
+ # Detect exact changes. For page targets, this means visible text diffs. For
184
+ # sitemap targets, this means URL additions and removals.
185
+ #
186
+ # @param type [Symbol, :exact]
187
+ end
188
+
189
+ class Semantic < ContextDev::Internal::Type::BaseModel
190
+ # @!attribute type
191
+ #
192
+ # @return [Symbol, :semantic]
193
+ required :type, const: :semantic
194
+
195
+ # @!attribute confidence_threshold
196
+ #
197
+ # @return [Float, nil]
198
+ optional :confidence_threshold, Float
199
+
200
+ # @!method initialize(confidence_threshold: nil, type: :semantic)
201
+ # Detect meaning-level changes to page content, ignoring cosmetic or
202
+ # instruction-irrelevant differences. Which changes are meaningful is judged
203
+ # against the page or extract target's `instructions` (and an extract target's
204
+ # `schema`, when provided).
205
+ #
206
+ # @param confidence_threshold [Float]
207
+ # @param type [Symbol, :semantic]
208
+ end
209
+
210
+ # @!method self.variants
211
+ # @return [Array(ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Exact, ContextDev::Models::MonitorRotateWebhookSecretResponse::ChangeDetection::Semantic)]
212
+ end
213
+
214
+ # Top-level monitor category. Always `web` today; the concrete behavior is
215
+ # described by `target` and `change_detection`.
216
+ #
217
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#mode
218
+ module Mode
219
+ extend ContextDev::Internal::Type::Enum
220
+
221
+ WEB = :web
222
+
223
+ # @!method self.values
224
+ # @return [Array<Symbol>]
225
+ end
226
+
227
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#schedule
228
+ class Schedule < ContextDev::Internal::Type::BaseModel
229
+ # @!attribute frequency
230
+ # Number of units between runs. The resulting interval (frequency × unit) must be
231
+ # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
232
+ # maximum 365 when unit is days).
233
+ #
234
+ # @return [Integer]
235
+ required :frequency, Integer
236
+
237
+ # @!attribute type
238
+ #
239
+ # @return [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type]
240
+ required :type, enum: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type }
241
+
242
+ # @!attribute unit
243
+ #
244
+ # @return [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit]
245
+ required :unit, enum: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit }
246
+
247
+ # @!method initialize(frequency:, type:, unit:)
248
+ # Some parameter documentations has been truncated, see
249
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule} for more
250
+ # details.
251
+ #
252
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
253
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
254
+ # between 10 minutes and 1 year.
255
+ #
256
+ # @param frequency [Integer] Number of units between runs. The resulting interval (frequency × unit) must be
257
+ #
258
+ # @param type [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Type]
259
+ #
260
+ # @param unit [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule::Unit]
261
+
262
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule#type
263
+ module Type
264
+ extend ContextDev::Internal::Type::Enum
265
+
266
+ INTERVAL = :interval
267
+
268
+ # @!method self.values
269
+ # @return [Array<Symbol>]
270
+ end
271
+
272
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse::Schedule#unit
273
+ module Unit
274
+ extend ContextDev::Internal::Type::Enum
275
+
276
+ MINUTES = :minutes
277
+ HOURS = :hours
278
+ DAYS = :days
279
+
280
+ # @!method self.values
281
+ # @return [Array<Symbol>]
282
+ end
283
+ end
284
+
285
+ # Monitor lifecycle status. `failed` means the most recent run failed (see the
286
+ # monitor's `last_error`); failed monitors keep running on schedule and flip back
287
+ # to `active` on the next successful run. Monitors are auto-`paused` after
288
+ # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
289
+ # status to `active`.
290
+ #
291
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#status
292
+ module Status
293
+ extend ContextDev::Internal::Type::Enum
294
+
295
+ ACTIVE = :active
296
+ PAUSED = :paused
297
+ FAILED = :failed
298
+
299
+ # @!method self.values
300
+ # @return [Array<Symbol>]
301
+ end
302
+
303
+ # Discriminated union describing what the monitor watches.
304
+ #
305
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#target
306
+ module Target
307
+ extend ContextDev::Internal::Type::Union
308
+
309
+ discriminator :type
310
+
311
+ # Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.
312
+ variant :page, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page }
313
+
314
+ # Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.
315
+ variant :sitemap, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Sitemap }
316
+
317
+ # Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.
318
+ variant :extract, -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Extract }
319
+
320
+ class Page < ContextDev::Internal::Type::BaseModel
321
+ # @!attribute type
322
+ #
323
+ # @return [Symbol, :page]
324
+ required :type, const: :page
325
+
326
+ # @!attribute url
327
+ #
328
+ # @return [String]
329
+ required :url, String
330
+
331
+ # @!attribute exclude_selectors
332
+ # CSS selectors for HTML regions to remove before text extraction. Applied after
333
+ # include_selectors; exclusion takes precedence when an element matches both. Omit
334
+ # or pass an empty array to apply no explicit exclusions. Changing these selectors
335
+ # creates a new baseline.
336
+ #
337
+ # @return [Array<String>, nil]
338
+ optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String]
339
+
340
+ # @!attribute include_selectors
341
+ # CSS selectors defining the HTML regions to monitor. Matching subtrees are
342
+ # combined in document order before text extraction, instead of automatic
343
+ # main-content selection. Omit or pass an empty array to use automatic
344
+ # main-content extraction. If the filtered page has no usable text, the run fails
345
+ # without replacing the baseline. Changing these selectors creates a new baseline.
346
+ #
347
+ # @return [Array<String>, nil]
348
+ optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String]
349
+
350
+ # @!attribute instructions
351
+ # Plain-language goal describing which page changes matter. When provided without
352
+ # change_detection, semantic detection is inferred.
353
+ #
354
+ # @return [String, nil]
355
+ optional :instructions, String
356
+
357
+ # @!attribute normalize_whitespace
358
+ # Normalize whitespace before comparing or analyzing text.
359
+ #
360
+ # @return [Boolean, nil]
361
+ optional :normalize_whitespace, ContextDev::Internal::Type::Boolean
362
+
363
+ # @!method initialize(url:, exclude_selectors: nil, include_selectors: nil, instructions: nil, normalize_whitespace: nil, type: :page)
364
+ # Some parameter documentations has been truncated, see
365
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page} for more
366
+ # details.
367
+ #
368
+ # Watch a single web page. Exact detection reports visible-text diffs; semantic
369
+ # detection judges confirmed stable diffs against `instructions`.
370
+ #
371
+ # @param url [String]
372
+ #
373
+ # @param exclude_selectors [Array<String>] CSS selectors for HTML regions to remove before text extraction. Applied after i
374
+ #
375
+ # @param include_selectors [Array<String>] CSS selectors defining the HTML regions to monitor. Matching subtrees are combin
376
+ #
377
+ # @param instructions [String] Plain-language goal describing which page changes matter. When provided without
378
+ #
379
+ # @param normalize_whitespace [Boolean] Normalize whitespace before comparing or analyzing text.
380
+ #
381
+ # @param type [Symbol, :page]
382
+ end
383
+
384
+ class Sitemap < ContextDev::Internal::Type::BaseModel
385
+ # @!attribute type
386
+ #
387
+ # @return [Symbol, :sitemap]
388
+ required :type, const: :sitemap
389
+
390
+ # @!attribute url
391
+ # Sitemap URL to monitor.
392
+ #
393
+ # @return [String]
394
+ required :url, String
395
+
396
+ # @!attribute exclude
397
+ # URL path patterns to exclude (max 50).
398
+ #
399
+ # @return [Array<String>, nil]
400
+ optional :exclude, ContextDev::Internal::Type::ArrayOf[String]
401
+
402
+ # @!attribute include
403
+ # URL path patterns to include (max 50).
404
+ #
405
+ # @return [Array<String>, nil]
406
+ optional :include, ContextDev::Internal::Type::ArrayOf[String]
407
+
408
+ # @!attribute max_urls
409
+ # Maximum number of sitemap URLs to track (capped at 10,000).
410
+ #
411
+ # @return [Integer, nil]
412
+ optional :max_urls, Integer
413
+
414
+ # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
415
+ # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
416
+ # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
417
+ # and its subdomains before comparison. On a detected difference the sitemap is
418
+ # re-fetched within the same run and only URLs both observations agree on are
419
+ # reported, suppressing transient crawl flaps.
420
+ #
421
+ # @param url [String] Sitemap URL to monitor.
422
+ #
423
+ # @param exclude [Array<String>] URL path patterns to exclude (max 50).
424
+ #
425
+ # @param include [Array<String>] URL path patterns to include (max 50).
426
+ #
427
+ # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
428
+ #
429
+ # @param type [Symbol, :sitemap]
430
+ end
431
+
432
+ class Extract < ContextDev::Internal::Type::BaseModel
433
+ # @!attribute instructions
434
+ # Natural-language instructions guiding which pages and facts to track and which
435
+ # changes to report.
436
+ #
437
+ # @return [String]
438
+ required :instructions, String
439
+
440
+ # @!attribute type
441
+ #
442
+ # @return [Symbol, :extract]
443
+ required :type, const: :extract
444
+
445
+ # @!attribute url
446
+ # Root URL to extract structured data from.
447
+ #
448
+ # @return [String]
449
+ required :url, String
450
+
451
+ # @!attribute follow_subdomains
452
+ #
453
+ # @return [Boolean, nil]
454
+ optional :follow_subdomains, ContextDev::Internal::Type::Boolean
455
+
456
+ # @!attribute max_depth
457
+ # Optional maximum link depth from the starting URL (0 = only the starting page).
458
+ #
459
+ # @return [Integer, nil]
460
+ optional :max_depth, Integer
461
+
462
+ # @!attribute max_pages
463
+ # Maximum number of pages to track.
464
+ #
465
+ # @return [Integer, nil]
466
+ optional :max_pages, Integer
467
+
468
+ # @!attribute schema
469
+ # JSON Schema describing the data you care about. It is used three ways: it guides
470
+ # which pages are selected for tracking, it gives the change judge extra context
471
+ # on which changes matter (alongside `instructions`), and it defines the shape of
472
+ # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
473
+ # about once a day). It is not a response format for changes: change events and
474
+ # webhook payloads always contain diffs, summaries, and evidence excerpts — never
475
+ # data in this schema's shape. If omitted, a default summary + key-points schema
476
+ # is used.
477
+ #
478
+ # @return [Hash{Symbol=>Object}, nil]
479
+ optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
480
+
481
+ # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
482
+ # Some parameter documentations has been truncated, see
483
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Extract} for
484
+ # more details.
485
+ #
486
+ # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
487
+ # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
488
+ # track; each run re-checks exactly those pages, and confirmed content changes are
489
+ # judged for relevance against the monitor's `instructions` (and `schema`, when
490
+ # provided). The tracked page set is refreshed by a periodic re-discovery crawl.
491
+ #
492
+ # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
493
+ #
494
+ # @param url [String] Root URL to extract structured data from.
495
+ #
496
+ # @param follow_subdomains [Boolean]
497
+ #
498
+ # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
499
+ #
500
+ # @param max_pages [Integer] Maximum number of pages to track.
501
+ #
502
+ # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It is used three ways: it guides
503
+ #
504
+ # @param type [Symbol, :extract]
505
+ end
506
+
507
+ # @!method self.variants
508
+ # @return [Array(ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Page, ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Sitemap, ContextDev::Models::MonitorRotateWebhookSecretResponse::Target::Extract)]
509
+ end
510
+
511
+ # Current baseline: the last observed value the monitor compares new snapshots
512
+ # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
513
+ # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
514
+ # after a target or change_detection update, which resets the baseline).
515
+ #
516
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#baseline
517
+ module Baseline
518
+ extend ContextDev::Internal::Type::Union
519
+
520
+ # Current baseline of a `page` monitor: the visible page text as last observed.
521
+ variant -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsPageBaseline }
522
+
523
+ # Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
524
+ variant -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsSitemapBaseline }
525
+
526
+ # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
527
+ variant -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsExtractBaseline }
528
+
529
+ class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
530
+ # @!attribute captured_at
531
+ # When this baseline was last captured or replaced.
532
+ #
533
+ # @return [Time]
534
+ required :captured_at, Time
535
+
536
+ # @!attribute text
537
+ # The page's visible text as last observed.
538
+ #
539
+ # @return [String]
540
+ required :text, String
541
+
542
+ # @!method initialize(captured_at:, text:)
543
+ # Current baseline of a `page` monitor: the visible page text as last observed.
544
+ #
545
+ # @param captured_at [Time] When this baseline was last captured or replaced.
546
+ #
547
+ # @param text [String] The page's visible text as last observed.
548
+ end
549
+
550
+ class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
551
+ # @!attribute captured_at
552
+ # When this baseline was last captured or replaced.
553
+ #
554
+ # @return [Time]
555
+ required :captured_at, Time
556
+
557
+ # @!attribute url_count
558
+ # Number of URLs in the baseline.
559
+ #
560
+ # @return [Integer]
561
+ required :url_count, Integer
562
+
563
+ # @!attribute urls
564
+ # The sitemap URLs as last observed (sorted, normalized).
565
+ #
566
+ # @return [Array<String>]
567
+ required :urls, ContextDev::Internal::Type::ArrayOf[String]
568
+
569
+ # @!method initialize(captured_at:, url_count:, urls:)
570
+ # Current baseline of a `sitemap` monitor: the normalized URL set as last
571
+ # observed.
572
+ #
573
+ # @param captured_at [Time] When this baseline was last captured or replaced.
574
+ #
575
+ # @param url_count [Integer] Number of URLs in the baseline.
576
+ #
577
+ # @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
578
+ end
579
+
580
+ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
581
+ # @!attribute captured_at
582
+ # When this baseline was last captured or replaced.
583
+ #
584
+ # @return [Time]
585
+ required :captured_at, Time
586
+
587
+ # @!attribute data
588
+ # The extracted structured data, matching the monitor's extraction schema (same
589
+ # shape as the /web/extract endpoint's `data`). Refreshed when the monitor
590
+ # re-discovers its page set (at most about once a day); `null` when no extraction
591
+ # has been captured yet.
592
+ #
593
+ # @return [Object]
594
+ required :data, ContextDev::Internal::Type::Unknown
595
+
596
+ # @!attribute urls_analyzed
597
+ # The page URLs the monitor tracks and analyzes for changes.
598
+ #
599
+ # @return [Array<String>]
600
+ required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]
601
+
602
+ # @!method initialize(captured_at:, data:, urls_analyzed:)
603
+ # Some parameter documentations has been truncated, see
604
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsExtractBaseline}
605
+ # for more details.
606
+ #
607
+ # Current baseline of an `extract` monitor: the pages it tracks and the structured
608
+ # data as last extracted.
609
+ #
610
+ # @param captured_at [Time] When this baseline was last captured or replaced.
611
+ #
612
+ # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
613
+ #
614
+ # @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
615
+ end
616
+
617
+ # @!method self.variants
618
+ # @return [Array(ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRotateWebhookSecretResponse::Baseline::MonitorsExtractBaseline)]
619
+ end
620
+
621
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#last_error
622
+ class LastError < ContextDev::Internal::Type::BaseModel
623
+ # @!attribute code
624
+ #
625
+ # @return [String]
626
+ required :code, String
627
+
628
+ # @!attribute message
629
+ #
630
+ # @return [String]
631
+ required :message, String
632
+
633
+ # @!method initialize(code:, message:)
634
+ # Error from the most recent failed run; null when the last run succeeded.
635
+ #
636
+ # @param code [String]
637
+ # @param message [String]
638
+ end
639
+
640
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#webhook
641
+ class Webhook < ContextDev::Internal::Type::BaseModel
642
+ # @!attribute url
643
+ # Webhook URL events are delivered to. Slack incoming webhook URLs are
644
+ # automatically formatted as Slack messages.
645
+ #
646
+ # @return [String]
647
+ required :url, String
648
+
649
+ # @!attribute events
650
+ # Events delivered to this endpoint. `change.detected` fires only when a run
651
+ # detects a change; `run.completed` fires on every completed run — including runs
652
+ # that detected no change — and embeds the change when one was detected. Defaults
653
+ # to `["change.detected"]` when omitted.
654
+ #
655
+ # @return [Array<Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook::Event>, nil]
656
+ optional :events,
657
+ -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook::Event] }
658
+
659
+ # @!attribute retry_
660
+ # Webhook retry settings. Use {} for the default schedule.
661
+ #
662
+ # @return [ContextDev::Models::RetryConfig, nil]
663
+ optional :retry_, -> { ContextDev::RetryConfig }, api_name: :retry
664
+
665
+ response_only do
666
+ # @!attribute secret
667
+ # Signing secret used to verify webhook authenticity. Omitted unless the API key
668
+ # has monitors:write permission or full access. Each delivery includes an
669
+ # `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
670
+ # `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
671
+ # compare and reject stale timestamps to prevent replay. Generated by the API;
672
+ # cannot be set by clients.
673
+ #
674
+ # @return [String, nil]
675
+ optional :secret, String
676
+ end
677
+
678
+ # @!method initialize(url:, events: nil, retry_: nil, secret: nil)
679
+ # Some parameter documentations has been truncated, see
680
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook} for more
681
+ # details.
682
+ #
683
+ # @param url [String] Webhook URL events are delivered to. Slack incoming webhook URLs are automatical
684
+ #
685
+ # @param events [Array<Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::Webhook::Event>] Events delivered to this endpoint. `change.detected` fires only when a run detec
686
+ #
687
+ # @param retry_ [ContextDev::Models::RetryConfig] Webhook retry settings. Use {} for the default schedule.
688
+ #
689
+ # @param secret [String] Signing secret used to verify webhook authenticity. Omitted unless the API key h
690
+
691
+ module Event
692
+ extend ContextDev::Internal::Type::Enum
693
+
694
+ CHANGE_DETECTED = :"change.detected"
695
+ RUN_COMPLETED = :"run.completed"
696
+
697
+ # @!method self.values
698
+ # @return [Array<Symbol>]
699
+ end
700
+ end
701
+
702
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse#webhook_failure
703
+ class WebhookFailure < ContextDev::Internal::Type::BaseModel
704
+ # @!attribute consecutive_failures
705
+ # Number of consecutive delivery attempts that did not succeed.
706
+ #
707
+ # @return [Integer]
708
+ required :consecutive_failures, Integer
709
+
710
+ # @!attribute last_failed_at
711
+ #
712
+ # @return [Time]
713
+ required :last_failed_at, Time
714
+
715
+ # @!attribute last_message
716
+ # Human-readable description of the most recent failure.
717
+ #
718
+ # @return [String]
719
+ required :last_message, String
720
+
721
+ # @!attribute last_status
722
+ # Outcome of the most recent failed delivery. rejected means a non-2xx response;
723
+ # failed means no HTTP response was received; skipped_unsafe_url means the URL
724
+ # failed the public-endpoint safety check.
725
+ #
726
+ # @return [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure::LastStatus]
727
+ required :last_status,
728
+ enum: -> { ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure::LastStatus }
729
+
730
+ # @!method initialize(consecutive_failures:, last_failed_at:, last_message:, last_status:)
731
+ # Some parameter documentations has been truncated, see
732
+ # {ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure} for
733
+ # more details.
734
+ #
735
+ # Present while webhook deliveries are failing consecutively; null when deliveries
736
+ # are healthy or no webhook is configured. Cleared on the next successful delivery
737
+ # and when the webhook URL changes.
738
+ #
739
+ # @param consecutive_failures [Integer] Number of consecutive delivery attempts that did not succeed.
740
+ #
741
+ # @param last_failed_at [Time]
742
+ #
743
+ # @param last_message [String] Human-readable description of the most recent failure.
744
+ #
745
+ # @param last_status [Symbol, ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure::LastStatus] Outcome of the most recent failed delivery. rejected means a non-2xx response; f
746
+
747
+ # Outcome of the most recent failed delivery. rejected means a non-2xx response;
748
+ # failed means no HTTP response was received; skipped_unsafe_url means the URL
749
+ # failed the public-endpoint safety check.
750
+ #
751
+ # @see ContextDev::Models::MonitorRotateWebhookSecretResponse::WebhookFailure#last_status
752
+ module LastStatus
753
+ extend ContextDev::Internal::Type::Enum
754
+
755
+ REJECTED = :rejected
756
+ FAILED = :failed
757
+ SKIPPED_UNSAFE_URL = :skipped_unsafe_url
758
+
759
+ # @!method self.values
760
+ # @return [Array<Symbol>]
761
+ end
762
+ end
763
+ end
764
+ end
765
+ end