context.dev 1.36.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +16 -9
  4. data/lib/context_dev/client.rb +7 -0
  5. data/lib/context_dev/models/brand_retrieve_params.rb +1079 -174
  6. data/lib/context_dev/models/monitor_create_params.rb +364 -0
  7. data/lib/context_dev/models/monitor_create_response.rb +608 -0
  8. data/lib/context_dev/models/monitor_delete_params.rb +20 -0
  9. data/lib/context_dev/models/monitor_delete_response.rb +22 -0
  10. data/lib/context_dev/models/monitor_list_account_changes_params.rb +93 -0
  11. data/lib/context_dev/models/monitor_list_account_changes_response.rb +199 -0
  12. data/lib/context_dev/models/monitor_list_account_runs_params.rb +55 -0
  13. data/lib/context_dev/models/monitor_list_account_runs_response.rb +227 -0
  14. data/lib/context_dev/models/monitor_list_changes_params.rb +57 -0
  15. data/lib/context_dev/models/monitor_list_changes_response.rb +198 -0
  16. data/lib/context_dev/models/monitor_list_params.rb +161 -0
  17. data/lib/context_dev/models/monitor_list_response.rb +631 -0
  18. data/lib/context_dev/models/monitor_list_runs_params.rb +62 -0
  19. data/lib/context_dev/models/monitor_list_runs_response.rb +227 -0
  20. data/lib/context_dev/models/monitor_retrieve_change_params.rb +20 -0
  21. data/lib/context_dev/models/monitor_retrieve_change_response.rb +264 -0
  22. data/lib/context_dev/models/monitor_retrieve_params.rb +20 -0
  23. data/lib/context_dev/models/monitor_retrieve_response.rb +608 -0
  24. data/lib/context_dev/models/monitor_run_params.rb +20 -0
  25. data/lib/context_dev/models/monitor_run_response.rb +35 -0
  26. data/lib/context_dev/models/monitor_update_params.rb +371 -0
  27. data/lib/context_dev/models/monitor_update_response.rb +608 -0
  28. data/lib/context_dev/models/utility_prefetch_params.rb +70 -6
  29. data/lib/context_dev/models/utility_prefetch_response.rb +23 -1
  30. data/lib/context_dev/models/web_extract_response.rb +17 -1
  31. data/lib/context_dev/models/web_web_crawl_md_params.rb +11 -1
  32. data/lib/context_dev/models/web_web_scrape_html_params.rb +11 -1
  33. data/lib/context_dev/models/web_web_scrape_html_response.rb +10 -2
  34. data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -1
  35. data/lib/context_dev/models/web_web_scrape_md_params.rb +11 -1
  36. data/lib/context_dev/models.rb +20 -12
  37. data/lib/context_dev/resources/ai.rb +0 -33
  38. data/lib/context_dev/resources/brand.rb +9 -204
  39. data/lib/context_dev/resources/monitors.rb +352 -0
  40. data/lib/context_dev/resources/utility.rb +9 -35
  41. data/lib/context_dev/resources/web.rb +14 -4
  42. data/lib/context_dev/version.rb +1 -1
  43. data/lib/context_dev.rb +23 -14
  44. data/rbi/context_dev/client.rbi +6 -0
  45. data/rbi/context_dev/models/brand_retrieve_params.rbi +3858 -678
  46. data/rbi/context_dev/models/monitor_create_params.rbi +641 -0
  47. data/rbi/context_dev/models/monitor_create_response.rbi +1020 -0
  48. data/rbi/context_dev/models/monitor_delete_params.rbi +35 -0
  49. data/rbi/context_dev/models/monitor_delete_response.rbi +29 -0
  50. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +211 -0
  51. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +376 -0
  52. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +125 -0
  53. data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +464 -0
  54. data/rbi/context_dev/models/monitor_list_changes_params.rbi +91 -0
  55. data/rbi/context_dev/models/monitor_list_changes_response.rbi +372 -0
  56. data/rbi/context_dev/models/monitor_list_params.rbi +335 -0
  57. data/rbi/context_dev/models/monitor_list_response.rbi +1089 -0
  58. data/rbi/context_dev/models/monitor_list_runs_params.rbi +125 -0
  59. data/rbi/context_dev/models/monitor_list_runs_response.rbi +455 -0
  60. data/rbi/context_dev/models/monitor_retrieve_change_params.rbi +38 -0
  61. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +469 -0
  62. data/rbi/context_dev/models/monitor_retrieve_params.rbi +38 -0
  63. data/rbi/context_dev/models/monitor_retrieve_response.rbi +1028 -0
  64. data/rbi/context_dev/models/monitor_run_params.rbi +35 -0
  65. data/rbi/context_dev/models/monitor_run_response.rbi +48 -0
  66. data/rbi/context_dev/models/monitor_update_params.rbi +681 -0
  67. data/rbi/context_dev/models/monitor_update_response.rbi +1020 -0
  68. data/rbi/context_dev/models/utility_prefetch_params.rbi +129 -7
  69. data/rbi/context_dev/models/utility_prefetch_response.rbi +55 -3
  70. data/rbi/context_dev/models/web_extract_response.rbi +10 -0
  71. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +15 -0
  72. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +15 -0
  73. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +29 -3
  74. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +17 -0
  75. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +15 -0
  76. data/rbi/context_dev/models.rbi +23 -15
  77. data/rbi/context_dev/resources/ai.rbi +0 -28
  78. data/rbi/context_dev/resources/brand.rbi +16 -228
  79. data/rbi/context_dev/resources/monitors.rbi +286 -0
  80. data/rbi/context_dev/resources/utility.rbi +14 -29
  81. data/rbi/context_dev/resources/web.rbi +21 -0
  82. data/sig/context_dev/client.rbs +2 -0
  83. data/sig/context_dev/models/brand_retrieve_params.rbs +1586 -281
  84. data/sig/context_dev/models/monitor_create_params.rbs +301 -0
  85. data/sig/context_dev/models/monitor_create_response.rbs +433 -0
  86. data/sig/context_dev/models/monitor_delete_params.rbs +23 -0
  87. data/sig/context_dev/models/monitor_delete_response.rbs +15 -0
  88. data/sig/context_dev/models/monitor_list_account_changes_params.rbs +104 -0
  89. data/sig/context_dev/models/monitor_list_account_changes_response.rbs +176 -0
  90. data/sig/context_dev/models/monitor_list_account_runs_params.rbs +58 -0
  91. data/sig/context_dev/models/monitor_list_account_runs_response.rbs +184 -0
  92. data/sig/context_dev/models/monitor_list_changes_params.rbs +61 -0
  93. data/sig/context_dev/models/monitor_list_changes_response.rbs +176 -0
  94. data/sig/context_dev/models/monitor_list_params.rbs +160 -0
  95. data/sig/context_dev/models/monitor_list_response.rbs +460 -0
  96. data/sig/context_dev/models/monitor_list_runs_params.rbs +63 -0
  97. data/sig/context_dev/models/monitor_list_runs_response.rbs +184 -0
  98. data/sig/context_dev/models/monitor_retrieve_change_params.rbs +23 -0
  99. data/sig/context_dev/models/monitor_retrieve_change_response.rbs +221 -0
  100. data/sig/context_dev/models/monitor_retrieve_params.rbs +23 -0
  101. data/sig/context_dev/models/monitor_retrieve_response.rbs +433 -0
  102. data/sig/context_dev/models/monitor_run_params.rbs +23 -0
  103. data/sig/context_dev/models/monitor_run_response.rbs +18 -0
  104. data/sig/context_dev/models/monitor_update_params.rbs +321 -0
  105. data/sig/context_dev/models/monitor_update_response.rbs +433 -0
  106. data/sig/context_dev/models/utility_prefetch_params.rbs +52 -4
  107. data/sig/context_dev/models/utility_prefetch_response.rbs +22 -3
  108. data/sig/context_dev/models/web_extract_response.rbs +5 -0
  109. data/sig/context_dev/models/web_web_crawl_md_params.rbs +7 -0
  110. data/sig/context_dev/models/web_web_scrape_html_params.rbs +7 -0
  111. data/sig/context_dev/models/web_web_scrape_html_response.rbs +8 -0
  112. data/sig/context_dev/models/web_web_scrape_images_params.rbs +7 -0
  113. data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
  114. data/sig/context_dev/models.rbs +20 -12
  115. data/sig/context_dev/resources/ai.rbs +0 -8
  116. data/sig/context_dev/resources/brand.rbs +1 -56
  117. data/sig/context_dev/resources/monitors.rbs +101 -0
  118. data/sig/context_dev/resources/utility.rbs +2 -7
  119. data/sig/context_dev/resources/web.rbs +4 -0
  120. metadata +71 -44
  121. data/lib/context_dev/models/ai_ai_query_params.rb +0 -235
  122. data/lib/context_dev/models/ai_ai_query_response.rb +0 -133
  123. data/lib/context_dev/models/brand_identify_from_transaction_params.rb +0 -474
  124. data/lib/context_dev/models/brand_identify_from_transaction_response.rb +0 -1074
  125. data/lib/context_dev/models/brand_retrieve_by_email_params.rb +0 -195
  126. data/lib/context_dev/models/brand_retrieve_by_email_response.rb +0 -1071
  127. data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +0 -195
  128. data/lib/context_dev/models/brand_retrieve_by_isin_response.rb +0 -1070
  129. data/lib/context_dev/models/brand_retrieve_by_name_params.rb +0 -452
  130. data/lib/context_dev/models/brand_retrieve_by_name_response.rb +0 -1070
  131. data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +0 -283
  132. data/lib/context_dev/models/brand_retrieve_by_ticker_response.rb +0 -1072
  133. data/lib/context_dev/models/utility_prefetch_by_email_params.rb +0 -37
  134. data/lib/context_dev/models/utility_prefetch_by_email_response.rb +0 -68
  135. data/rbi/context_dev/models/ai_ai_query_params.rbi +0 -504
  136. data/rbi/context_dev/models/ai_ai_query_response.rbi +0 -267
  137. data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +0 -2020
  138. data/rbi/context_dev/models/brand_identify_from_transaction_response.rbi +0 -3515
  139. data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +0 -743
  140. data/rbi/context_dev/models/brand_retrieve_by_email_response.rbi +0 -3511
  141. data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +0 -743
  142. data/rbi/context_dev/models/brand_retrieve_by_isin_response.rbi +0 -3510
  143. data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +0 -1982
  144. data/rbi/context_dev/models/brand_retrieve_by_name_response.rbi +0 -3510
  145. data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +0 -1153
  146. data/rbi/context_dev/models/brand_retrieve_by_ticker_response.rbi +0 -3512
  147. data/rbi/context_dev/models/utility_prefetch_by_email_params.rbi +0 -65
  148. data/rbi/context_dev/models/utility_prefetch_by_email_response.rbi +0 -132
  149. data/sig/context_dev/models/ai_ai_query_params.rbs +0 -218
  150. data/sig/context_dev/models/ai_ai_query_response.rbs +0 -121
  151. data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +0 -822
  152. data/sig/context_dev/models/brand_identify_from_transaction_response.rbs +0 -1441
  153. data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +0 -305
  154. data/sig/context_dev/models/brand_retrieve_by_email_response.rbs +0 -1441
  155. data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +0 -305
  156. data/sig/context_dev/models/brand_retrieve_by_isin_response.rbs +0 -1441
  157. data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +0 -801
  158. data/sig/context_dev/models/brand_retrieve_by_name_response.rbs +0 -1441
  159. data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +0 -467
  160. data/sig/context_dev/models/brand_retrieve_by_ticker_response.rbs +0 -1441
  161. data/sig/context_dev/models/utility_prefetch_by_email_params.rbs +0 -30
  162. data/sig/context_dev/models/utility_prefetch_by_email_response.rbs +0 -64
@@ -0,0 +1,364 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Monitors#create
6
+ class MonitorCreateParams < ContextDev::Internal::Type::BaseModel
7
+ extend ContextDev::Internal::Type::RequestParameters::Converter
8
+ include ContextDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute change_detection
11
+ # Discriminated union describing how changes are detected.
12
+ #
13
+ # @return [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic]
14
+ required :change_detection, union: -> { ContextDev::MonitorCreateParams::ChangeDetection }
15
+
16
+ # @!attribute name
17
+ #
18
+ # @return [String]
19
+ required :name, String
20
+
21
+ # @!attribute schedule
22
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
23
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
24
+ # between 10 minutes and 1 year.
25
+ #
26
+ # @return [ContextDev::Models::MonitorCreateParams::Schedule]
27
+ required :schedule, -> { ContextDev::MonitorCreateParams::Schedule }
28
+
29
+ # @!attribute target
30
+ # Discriminated union describing what the monitor watches.
31
+ #
32
+ # @return [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract]
33
+ required :target, union: -> { ContextDev::MonitorCreateParams::Target }
34
+
35
+ # @!attribute mode
36
+ # Top-level monitor category. Always `web` today; the concrete behavior is
37
+ # described by `target` and `change_detection`.
38
+ #
39
+ # @return [Symbol, ContextDev::Models::MonitorCreateParams::Mode, nil]
40
+ optional :mode, enum: -> { ContextDev::MonitorCreateParams::Mode }
41
+
42
+ # @!attribute tags
43
+ # User-defined tags for grouping and filtering monitors and their changes.
44
+ #
45
+ # @return [Array<String>, nil]
46
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
47
+
48
+ # @!attribute webhook
49
+ #
50
+ # @return [ContextDev::Models::MonitorCreateParams::Webhook, nil]
51
+ optional :webhook, -> { ContextDev::MonitorCreateParams::Webhook }, nil?: true
52
+
53
+ # @!method initialize(change_detection:, name:, schedule:, target:, mode: nil, tags: nil, webhook: nil, request_options: {})
54
+ # Some parameter documentations has been truncated, see
55
+ # {ContextDev::Models::MonitorCreateParams} for more details.
56
+ #
57
+ # @param change_detection [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
58
+ #
59
+ # @param name [String]
60
+ #
61
+ # @param schedule [ContextDev::Models::MonitorCreateParams::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
62
+ #
63
+ # @param target [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract] Discriminated union describing what the monitor watches.
64
+ #
65
+ # @param mode [Symbol, ContextDev::Models::MonitorCreateParams::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ
66
+ #
67
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
68
+ #
69
+ # @param webhook [ContextDev::Models::MonitorCreateParams::Webhook, nil]
70
+ #
71
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
72
+
73
+ # Discriminated union describing how changes are detected.
74
+ module ChangeDetection
75
+ extend ContextDev::Internal::Type::Union
76
+
77
+ discriminator :type
78
+
79
+ # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
80
+ variant :exact, -> { ContextDev::MonitorCreateParams::ChangeDetection::Exact }
81
+
82
+ # Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
83
+ variant :semantic, -> { ContextDev::MonitorCreateParams::ChangeDetection::Semantic }
84
+
85
+ class Exact < ContextDev::Internal::Type::BaseModel
86
+ # @!attribute type
87
+ #
88
+ # @return [Symbol, :exact]
89
+ required :type, const: :exact
90
+
91
+ # @!method initialize(type: :exact)
92
+ # Detect exact changes. For page targets, this means visible text diffs. For
93
+ # sitemap targets, this means URL additions and removals.
94
+ #
95
+ # @param type [Symbol, :exact]
96
+ end
97
+
98
+ class Semantic < ContextDev::Internal::Type::BaseModel
99
+ # @!attribute type
100
+ #
101
+ # @return [Symbol, :semantic]
102
+ required :type, const: :semantic
103
+
104
+ # @!attribute confidence_threshold
105
+ #
106
+ # @return [Float, nil]
107
+ optional :confidence_threshold, Float
108
+
109
+ # @!method initialize(confidence_threshold: nil, type: :semantic)
110
+ # Detect meaning-level changes to the extracted data, ignoring cosmetic or
111
+ # paraphrase-only differences. What is watched is determined by the extract
112
+ # target's `schema` and `instructions`.
113
+ #
114
+ # @param confidence_threshold [Float]
115
+ # @param type [Symbol, :semantic]
116
+ end
117
+
118
+ # @!method self.variants
119
+ # @return [Array(ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic)]
120
+ end
121
+
122
+ class Schedule < ContextDev::Internal::Type::BaseModel
123
+ # @!attribute frequency
124
+ # Number of units between runs. The resulting interval (frequency × unit) must be
125
+ # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
126
+ # maximum 365 when unit is days).
127
+ #
128
+ # @return [Integer]
129
+ required :frequency, Integer
130
+
131
+ # @!attribute type
132
+ #
133
+ # @return [Symbol, ContextDev::Models::MonitorCreateParams::Schedule::Type]
134
+ required :type, enum: -> { ContextDev::MonitorCreateParams::Schedule::Type }
135
+
136
+ # @!attribute unit
137
+ #
138
+ # @return [Symbol, ContextDev::Models::MonitorCreateParams::Schedule::Unit]
139
+ required :unit, enum: -> { ContextDev::MonitorCreateParams::Schedule::Unit }
140
+
141
+ # @!method initialize(frequency:, type:, unit:)
142
+ # Some parameter documentations has been truncated, see
143
+ # {ContextDev::Models::MonitorCreateParams::Schedule} for more details.
144
+ #
145
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
146
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
147
+ # between 10 minutes and 1 year.
148
+ #
149
+ # @param frequency [Integer] Number of units between runs. The resulting interval (frequency × unit) must be
150
+ #
151
+ # @param type [Symbol, ContextDev::Models::MonitorCreateParams::Schedule::Type]
152
+ #
153
+ # @param unit [Symbol, ContextDev::Models::MonitorCreateParams::Schedule::Unit]
154
+
155
+ # @see ContextDev::Models::MonitorCreateParams::Schedule#type
156
+ module Type
157
+ extend ContextDev::Internal::Type::Enum
158
+
159
+ INTERVAL = :interval
160
+
161
+ # @!method self.values
162
+ # @return [Array<Symbol>]
163
+ end
164
+
165
+ # @see ContextDev::Models::MonitorCreateParams::Schedule#unit
166
+ module Unit
167
+ extend ContextDev::Internal::Type::Enum
168
+
169
+ MINUTES = :minutes
170
+ HOURS = :hours
171
+ DAYS = :days
172
+
173
+ # @!method self.values
174
+ # @return [Array<Symbol>]
175
+ end
176
+ end
177
+
178
+ # Discriminated union describing what the monitor watches.
179
+ module Target
180
+ extend ContextDev::Internal::Type::Union
181
+
182
+ discriminator :type
183
+
184
+ # Watch a single web page.
185
+ variant :page, -> { ContextDev::MonitorCreateParams::Target::Page }
186
+
187
+ # 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.
188
+ variant :sitemap, -> { ContextDev::MonitorCreateParams::Target::Sitemap }
189
+
190
+ # 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
191
+ variant :extract, -> { ContextDev::MonitorCreateParams::Target::Extract }
192
+
193
+ class Page < ContextDev::Internal::Type::BaseModel
194
+ # @!attribute type
195
+ #
196
+ # @return [Symbol, :page]
197
+ required :type, const: :page
198
+
199
+ # @!attribute url
200
+ #
201
+ # @return [String]
202
+ required :url, String
203
+
204
+ # @!attribute normalize_whitespace
205
+ # Normalize whitespace before comparing or analyzing text.
206
+ #
207
+ # @return [Boolean, nil]
208
+ optional :normalize_whitespace, ContextDev::Internal::Type::Boolean
209
+
210
+ # @!method initialize(url:, normalize_whitespace: nil, type: :page)
211
+ # Watch a single web page.
212
+ #
213
+ # @param url [String]
214
+ #
215
+ # @param normalize_whitespace [Boolean] Normalize whitespace before comparing or analyzing text.
216
+ #
217
+ # @param type [Symbol, :page]
218
+ end
219
+
220
+ class Sitemap < ContextDev::Internal::Type::BaseModel
221
+ # @!attribute type
222
+ #
223
+ # @return [Symbol, :sitemap]
224
+ required :type, const: :sitemap
225
+
226
+ # @!attribute url
227
+ # Sitemap URL to monitor.
228
+ #
229
+ # @return [String]
230
+ required :url, String
231
+
232
+ # @!attribute exclude
233
+ # URL path patterns to exclude.
234
+ #
235
+ # @return [Array<String>, nil]
236
+ optional :exclude, ContextDev::Internal::Type::ArrayOf[String]
237
+
238
+ # @!attribute include
239
+ # URL path patterns to include.
240
+ #
241
+ # @return [Array<String>, nil]
242
+ optional :include, ContextDev::Internal::Type::ArrayOf[String]
243
+
244
+ # @!attribute max_urls
245
+ # Maximum number of sitemap URLs to track (capped at 10,000).
246
+ #
247
+ # @return [Integer, nil]
248
+ optional :max_urls, Integer
249
+
250
+ # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
251
+ # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
252
+ # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
253
+ # and its subdomains before comparison. On a detected difference the sitemap is
254
+ # re-fetched within the same run and only URLs both observations agree on are
255
+ # reported, suppressing transient crawl flaps.
256
+ #
257
+ # @param url [String] Sitemap URL to monitor.
258
+ #
259
+ # @param exclude [Array<String>] URL path patterns to exclude.
260
+ #
261
+ # @param include [Array<String>] URL path patterns to include.
262
+ #
263
+ # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
264
+ #
265
+ # @param type [Symbol, :sitemap]
266
+ end
267
+
268
+ class Extract < ContextDev::Internal::Type::BaseModel
269
+ # @!attribute instructions
270
+ # Natural-language instructions guiding which pages and facts to track and which
271
+ # changes to report.
272
+ #
273
+ # @return [String]
274
+ required :instructions, String
275
+
276
+ # @!attribute type
277
+ #
278
+ # @return [Symbol, :extract]
279
+ required :type, const: :extract
280
+
281
+ # @!attribute url
282
+ # Root URL to extract structured data from.
283
+ #
284
+ # @return [String]
285
+ required :url, String
286
+
287
+ # @!attribute follow_subdomains
288
+ #
289
+ # @return [Boolean, nil]
290
+ optional :follow_subdomains, ContextDev::Internal::Type::Boolean
291
+
292
+ # @!attribute max_depth
293
+ # Optional maximum link depth from the starting URL (0 = only the starting page).
294
+ #
295
+ # @return [Integer, nil]
296
+ optional :max_depth, Integer
297
+
298
+ # @!attribute max_pages
299
+ # Maximum number of pages to track.
300
+ #
301
+ # @return [Integer, nil]
302
+ optional :max_pages, Integer
303
+
304
+ # @!attribute schema
305
+ # JSON Schema describing the data you care about. It guides which pages are
306
+ # selected for tracking and gives the change judge context on what matters. If
307
+ # omitted, a default summary + key-points schema is used.
308
+ #
309
+ # @return [Hash{Symbol=>Object}, nil]
310
+ optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
311
+
312
+ # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
313
+ # Some parameter documentations has been truncated, see
314
+ # {ContextDev::Models::MonitorCreateParams::Target::Extract} for more details.
315
+ #
316
+ # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
317
+ # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
318
+ # track; each run re-checks exactly those pages, and confirmed content changes are
319
+ # judged against the monitor's instructions. The tracked page set is refreshed by
320
+ # a periodic re-discovery crawl.
321
+ #
322
+ # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
323
+ #
324
+ # @param url [String] Root URL to extract structured data from.
325
+ #
326
+ # @param follow_subdomains [Boolean]
327
+ #
328
+ # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
329
+ #
330
+ # @param max_pages [Integer] Maximum number of pages to track.
331
+ #
332
+ # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
333
+ #
334
+ # @param type [Symbol, :extract]
335
+ end
336
+
337
+ # @!method self.variants
338
+ # @return [Array(ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract)]
339
+ end
340
+
341
+ # Top-level monitor category. Always `web` today; the concrete behavior is
342
+ # described by `target` and `change_detection`.
343
+ module Mode
344
+ extend ContextDev::Internal::Type::Enum
345
+
346
+ WEB = :web
347
+
348
+ # @!method self.values
349
+ # @return [Array<Symbol>]
350
+ end
351
+
352
+ class Webhook < ContextDev::Internal::Type::BaseModel
353
+ # @!attribute url
354
+ # Webhook URL called when a change is detected.
355
+ #
356
+ # @return [String]
357
+ required :url, String
358
+
359
+ # @!method initialize(url:)
360
+ # @param url [String] Webhook URL called when a change is detected.
361
+ end
362
+ end
363
+ end
364
+ end