context.dev 2.0.0 → 2.2.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/brand_retrieve_params.rb +46 -3
  5. data/lib/context_dev/models/monitor_create_params.rb +36 -28
  6. data/lib/context_dev/models/monitor_create_response.rb +158 -29
  7. data/lib/context_dev/models/monitor_list_account_runs_response.rb +102 -1
  8. data/lib/context_dev/models/monitor_list_params.rb +4 -4
  9. data/lib/context_dev/models/monitor_list_response.rb +158 -29
  10. data/lib/context_dev/models/monitor_list_runs_response.rb +100 -1
  11. data/lib/context_dev/models/monitor_retrieve_change_response.rb +1 -8
  12. data/lib/context_dev/models/monitor_retrieve_response.rb +158 -29
  13. data/lib/context_dev/models/monitor_update_params.rb +36 -28
  14. data/lib/context_dev/models/monitor_update_response.rb +158 -29
  15. data/lib/context_dev/resources/brand.rb +4 -2
  16. data/lib/context_dev/resources/monitors.rb +1 -1
  17. data/lib/context_dev/version.rb +1 -1
  18. data/rbi/context_dev/models/brand_retrieve_params.rbi +67 -0
  19. data/rbi/context_dev/models/monitor_create_params.rbi +44 -33
  20. data/rbi/context_dev/models/monitor_create_response.rbi +243 -33
  21. data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +204 -3
  22. data/rbi/context_dev/models/monitor_list_params.rbi +9 -6
  23. data/rbi/context_dev/models/monitor_list_response.rbi +247 -33
  24. data/rbi/context_dev/models/monitor_list_runs_response.rbi +204 -3
  25. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +0 -9
  26. data/rbi/context_dev/models/monitor_retrieve_response.rbi +243 -33
  27. data/rbi/context_dev/models/monitor_update_params.rbi +44 -33
  28. data/rbi/context_dev/models/monitor_update_response.rbi +243 -33
  29. data/rbi/context_dev/resources/brand.rbi +4 -1
  30. data/rbi/context_dev/resources/monitors.rbi +2 -2
  31. data/sig/context_dev/models/brand_retrieve_params.rbs +26 -0
  32. data/sig/context_dev/models/monitor_create_params.rbs +7 -17
  33. data/sig/context_dev/models/monitor_create_response.rbs +81 -17
  34. data/sig/context_dev/models/monitor_list_account_runs_response.rbs +74 -3
  35. data/sig/context_dev/models/monitor_list_params.rbs +2 -2
  36. data/sig/context_dev/models/monitor_list_response.rbs +81 -17
  37. data/sig/context_dev/models/monitor_list_runs_response.rbs +74 -3
  38. data/sig/context_dev/models/monitor_retrieve_change_response.rbs +0 -7
  39. data/sig/context_dev/models/monitor_retrieve_response.rbs +81 -17
  40. data/sig/context_dev/models/monitor_update_params.rbs +7 -17
  41. data/sig/context_dev/models/monitor_update_response.rbs +81 -17
  42. metadata +2 -2
@@ -61,6 +61,15 @@ module ContextDev
61
61
  # @return [Time]
62
62
  required :updated_at, Time
63
63
 
64
+ # @!attribute baseline
65
+ # Current baseline: the last observed value the monitor compares new snapshots
66
+ # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
67
+ # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
68
+ # after a target or change_detection update, which resets the baseline).
69
+ #
70
+ # @return [ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline, nil]
71
+ optional :baseline, union: -> { ContextDev::Models::MonitorRetrieveResponse::Baseline }, nil?: true
72
+
64
73
  # @!attribute last_change_at
65
74
  #
66
75
  # @return [Time, nil]
@@ -94,7 +103,7 @@ module ContextDev
94
103
  # @return [ContextDev::Models::MonitorRetrieveResponse::Webhook, nil]
95
104
  optional :webhook, -> { ContextDev::Models::MonitorRetrieveResponse::Webhook }, nil?: true
96
105
 
97
- # @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil)
106
+ # @!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)
98
107
  # Some parameter documentations has been truncated, see
99
108
  # {ContextDev::Models::MonitorRetrieveResponse} for more details.
100
109
  #
@@ -119,6 +128,8 @@ module ContextDev
119
128
  #
120
129
  # @param updated_at [Time]
121
130
  #
131
+ # @param baseline [ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga
132
+ #
122
133
  # @param last_change_at [Time, nil]
123
134
  #
124
135
  # @param last_error [ContextDev::Models::MonitorRetrieveResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
@@ -142,7 +153,7 @@ module ContextDev
142
153
  # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
143
154
  variant :exact, -> { ContextDev::Models::MonitorRetrieveResponse::ChangeDetection::Exact }
144
155
 
145
- # Detect meaning-level changes that match a natural language query.
156
+ # Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
146
157
  variant :semantic, -> { ContextDev::Models::MonitorRetrieveResponse::ChangeDetection::Semantic }
147
158
 
148
159
  class Exact < ContextDev::Internal::Type::BaseModel
@@ -159,11 +170,6 @@ module ContextDev
159
170
  end
160
171
 
161
172
  class Semantic < ContextDev::Internal::Type::BaseModel
162
- # @!attribute query
163
- #
164
- # @return [String]
165
- required :query, String
166
-
167
173
  # @!attribute type
168
174
  #
169
175
  # @return [Symbol, :semantic]
@@ -174,10 +180,11 @@ module ContextDev
174
180
  # @return [Float, nil]
175
181
  optional :confidence_threshold, Float
176
182
 
177
- # @!method initialize(query:, confidence_threshold: nil, type: :semantic)
178
- # Detect meaning-level changes that match a natural language query.
183
+ # @!method initialize(confidence_threshold: nil, type: :semantic)
184
+ # Detect meaning-level changes to tracked page content, ignoring cosmetic or
185
+ # paraphrase-only differences. Which changes are meaningful is judged against the
186
+ # extract target's `instructions` (and `schema`, when provided).
179
187
  #
180
- # @param query [String]
181
188
  # @param confidence_threshold [Float]
182
189
  # @param type [Symbol, :semantic]
183
190
  end
@@ -285,10 +292,10 @@ module ContextDev
285
292
  # Watch a single web page.
286
293
  variant :page, -> { ContextDev::Models::MonitorRetrieveResponse::Target::Page }
287
294
 
288
- # 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. A new URL set must be observed on two consecutive runs before a change is reported, suppressing one-run crawl flaps.
295
+ # 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.
289
296
  variant :sitemap, -> { ContextDev::Models::MonitorRetrieveResponse::Target::Sitemap }
290
297
 
291
- # Watch a site's extracted structured data.
298
+ # 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.
292
299
  variant :extract, -> { ContextDev::Models::MonitorRetrieveResponse::Target::Extract }
293
300
 
294
301
  class Page < ContextDev::Internal::Type::BaseModel
@@ -351,8 +358,9 @@ module ContextDev
351
358
  # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
352
359
  # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
353
360
  # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
354
- # and its subdomains before comparison. A new URL set must be observed on two
355
- # consecutive runs before a change is reported, suppressing one-run crawl flaps.
361
+ # and its subdomains before comparison. On a detected difference the sitemap is
362
+ # re-fetched within the same run and only URLs both observations agree on are
363
+ # reported, suppressing transient crawl flaps.
356
364
  #
357
365
  # @param url [String] Sitemap URL to monitor.
358
366
  #
@@ -366,6 +374,13 @@ module ContextDev
366
374
  end
367
375
 
368
376
  class Extract < ContextDev::Internal::Type::BaseModel
377
+ # @!attribute instructions
378
+ # Natural-language instructions guiding which pages and facts to track and which
379
+ # changes to report.
380
+ #
381
+ # @return [String]
382
+ required :instructions, String
383
+
369
384
  # @!attribute type
370
385
  #
371
386
  # @return [Symbol, :extract]
@@ -382,12 +397,6 @@ module ContextDev
382
397
  # @return [Boolean, nil]
383
398
  optional :follow_subdomains, ContextDev::Internal::Type::Boolean
384
399
 
385
- # @!attribute instructions
386
- # Optional natural-language instructions guiding what to extract.
387
- #
388
- # @return [String, nil]
389
- optional :instructions, String
390
-
391
400
  # @!attribute max_depth
392
401
  # Optional maximum link depth from the starting URL (0 = only the starting page).
393
402
  #
@@ -395,35 +404,45 @@ module ContextDev
395
404
  optional :max_depth, Integer
396
405
 
397
406
  # @!attribute max_pages
398
- # Maximum number of pages to analyze during extraction.
407
+ # Maximum number of pages to track.
399
408
  #
400
409
  # @return [Integer, nil]
401
410
  optional :max_pages, Integer
402
411
 
403
412
  # @!attribute schema
404
- # JSON Schema describing the structured data to extract and watch for changes. If
405
- # omitted, a default summary + key-points schema is used.
413
+ # JSON Schema describing the data you care about. It is used three ways: it guides
414
+ # which pages are selected for tracking, it gives the change judge extra context
415
+ # on which changes matter (alongside `instructions`), and it defines the shape of
416
+ # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
417
+ # about once a day). It is not a response format for changes: change events and
418
+ # webhook payloads always contain diffs, summaries, and evidence excerpts — never
419
+ # data in this schema's shape. If omitted, a default summary + key-points schema
420
+ # is used.
406
421
  #
407
422
  # @return [Hash{Symbol=>Object}, nil]
408
423
  optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
409
424
 
410
- # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
425
+ # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
411
426
  # Some parameter documentations has been truncated, see
412
427
  # {ContextDev::Models::MonitorRetrieveResponse::Target::Extract} for more details.
413
428
  #
414
- # Watch a site's extracted structured data.
429
+ # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
430
+ # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
431
+ # track; each run re-checks exactly those pages, and confirmed content changes are
432
+ # judged for relevance against the monitor's `instructions` (and `schema`, when
433
+ # provided). The tracked page set is refreshed by a periodic re-discovery crawl.
434
+ #
435
+ # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
415
436
  #
416
437
  # @param url [String] Root URL to extract structured data from.
417
438
  #
418
439
  # @param follow_subdomains [Boolean]
419
440
  #
420
- # @param instructions [String] Optional natural-language instructions guiding what to extract.
421
- #
422
441
  # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
423
442
  #
424
- # @param max_pages [Integer] Maximum number of pages to analyze during extraction.
443
+ # @param max_pages [Integer] Maximum number of pages to track.
425
444
  #
426
- # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If
445
+ # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It is used three ways: it guides
427
446
  #
428
447
  # @param type [Symbol, :extract]
429
448
  end
@@ -432,6 +451,116 @@ module ContextDev
432
451
  # @return [Array(ContextDev::Models::MonitorRetrieveResponse::Target::Page, ContextDev::Models::MonitorRetrieveResponse::Target::Sitemap, ContextDev::Models::MonitorRetrieveResponse::Target::Extract)]
433
452
  end
434
453
 
454
+ # Current baseline: the last observed value the monitor compares new snapshots
455
+ # against. Its shape follows `target.type` (page/sitemap/extract). Only populated
456
+ # on GET /monitors/{monitor_id}; null until the first baseline run completes (and
457
+ # after a target or change_detection update, which resets the baseline).
458
+ #
459
+ # @see ContextDev::Models::MonitorRetrieveResponse#baseline
460
+ module Baseline
461
+ extend ContextDev::Internal::Type::Union
462
+
463
+ # Current baseline of a `page` monitor: the visible page text as last observed.
464
+ variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline }
465
+
466
+ # Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
467
+ variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline }
468
+
469
+ # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
470
+ variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline }
471
+
472
+ class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
473
+ # @!attribute captured_at
474
+ # When this baseline was last captured or replaced.
475
+ #
476
+ # @return [Time]
477
+ required :captured_at, Time
478
+
479
+ # @!attribute text
480
+ # The page's visible text as last observed.
481
+ #
482
+ # @return [String]
483
+ required :text, String
484
+
485
+ # @!method initialize(captured_at:, text:)
486
+ # Current baseline of a `page` monitor: the visible page text as last observed.
487
+ #
488
+ # @param captured_at [Time] When this baseline was last captured or replaced.
489
+ #
490
+ # @param text [String] The page's visible text as last observed.
491
+ end
492
+
493
+ class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
494
+ # @!attribute captured_at
495
+ # When this baseline was last captured or replaced.
496
+ #
497
+ # @return [Time]
498
+ required :captured_at, Time
499
+
500
+ # @!attribute url_count
501
+ # Number of URLs in the baseline.
502
+ #
503
+ # @return [Integer]
504
+ required :url_count, Integer
505
+
506
+ # @!attribute urls
507
+ # The sitemap URLs as last observed (sorted, normalized).
508
+ #
509
+ # @return [Array<String>]
510
+ required :urls, ContextDev::Internal::Type::ArrayOf[String]
511
+
512
+ # @!method initialize(captured_at:, url_count:, urls:)
513
+ # Current baseline of a `sitemap` monitor: the normalized URL set as last
514
+ # observed.
515
+ #
516
+ # @param captured_at [Time] When this baseline was last captured or replaced.
517
+ #
518
+ # @param url_count [Integer] Number of URLs in the baseline.
519
+ #
520
+ # @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
521
+ end
522
+
523
+ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
524
+ # @!attribute captured_at
525
+ # When this baseline was last captured or replaced.
526
+ #
527
+ # @return [Time]
528
+ required :captured_at, Time
529
+
530
+ # @!attribute data
531
+ # The extracted structured data, matching the monitor's extraction schema (same
532
+ # shape as the /web/extract endpoint's `data`). Refreshed when the monitor
533
+ # re-discovers its page set (at most about once a day); `null` when no extraction
534
+ # has been captured yet.
535
+ #
536
+ # @return [Object]
537
+ required :data, ContextDev::Internal::Type::Unknown
538
+
539
+ # @!attribute urls_analyzed
540
+ # The page URLs the monitor tracks and analyzes for changes.
541
+ #
542
+ # @return [Array<String>]
543
+ required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]
544
+
545
+ # @!method initialize(captured_at:, data:, urls_analyzed:)
546
+ # Some parameter documentations has been truncated, see
547
+ # {ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline}
548
+ # for more details.
549
+ #
550
+ # Current baseline of an `extract` monitor: the pages it tracks and the structured
551
+ # data as last extracted.
552
+ #
553
+ # @param captured_at [Time] When this baseline was last captured or replaced.
554
+ #
555
+ # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
556
+ #
557
+ # @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
558
+ end
559
+
560
+ # @!method self.variants
561
+ # @return [Array(ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline)]
562
+ end
563
+
435
564
  # @see ContextDev::Models::MonitorRetrieveResponse#last_error
436
565
  class LastError < ContextDev::Internal::Type::BaseModel
437
566
  # @!attribute code
@@ -85,7 +85,7 @@ module ContextDev
85
85
  # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
86
86
  variant :exact, -> { ContextDev::MonitorUpdateParams::ChangeDetection::Exact }
87
87
 
88
- # Detect meaning-level changes that match a natural language query.
88
+ # Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
89
89
  variant :semantic, -> { ContextDev::MonitorUpdateParams::ChangeDetection::Semantic }
90
90
 
91
91
  class Exact < ContextDev::Internal::Type::BaseModel
@@ -102,11 +102,6 @@ module ContextDev
102
102
  end
103
103
 
104
104
  class Semantic < ContextDev::Internal::Type::BaseModel
105
- # @!attribute query
106
- #
107
- # @return [String]
108
- required :query, String
109
-
110
105
  # @!attribute type
111
106
  #
112
107
  # @return [Symbol, :semantic]
@@ -117,10 +112,11 @@ module ContextDev
117
112
  # @return [Float, nil]
118
113
  optional :confidence_threshold, Float
119
114
 
120
- # @!method initialize(query:, confidence_threshold: nil, type: :semantic)
121
- # Detect meaning-level changes that match a natural language query.
115
+ # @!method initialize(confidence_threshold: nil, type: :semantic)
116
+ # Detect meaning-level changes to tracked page content, ignoring cosmetic or
117
+ # paraphrase-only differences. Which changes are meaningful is judged against the
118
+ # extract target's `instructions` (and `schema`, when provided).
122
119
  #
123
- # @param query [String]
124
120
  # @param confidence_threshold [Float]
125
121
  # @param type [Symbol, :semantic]
126
122
  end
@@ -204,10 +200,10 @@ module ContextDev
204
200
  # Watch a single web page.
205
201
  variant :page, -> { ContextDev::MonitorUpdateParams::Target::Page }
206
202
 
207
- # 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. A new URL set must be observed on two consecutive runs before a change is reported, suppressing one-run crawl flaps.
203
+ # 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.
208
204
  variant :sitemap, -> { ContextDev::MonitorUpdateParams::Target::Sitemap }
209
205
 
210
- # Watch a site's extracted structured data.
206
+ # 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.
211
207
  variant :extract, -> { ContextDev::MonitorUpdateParams::Target::Extract }
212
208
 
213
209
  class Page < ContextDev::Internal::Type::BaseModel
@@ -270,8 +266,9 @@ module ContextDev
270
266
  # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
271
267
  # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
272
268
  # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
273
- # and its subdomains before comparison. A new URL set must be observed on two
274
- # consecutive runs before a change is reported, suppressing one-run crawl flaps.
269
+ # and its subdomains before comparison. On a detected difference the sitemap is
270
+ # re-fetched within the same run and only URLs both observations agree on are
271
+ # reported, suppressing transient crawl flaps.
275
272
  #
276
273
  # @param url [String] Sitemap URL to monitor.
277
274
  #
@@ -285,6 +282,13 @@ module ContextDev
285
282
  end
286
283
 
287
284
  class Extract < ContextDev::Internal::Type::BaseModel
285
+ # @!attribute instructions
286
+ # Natural-language instructions guiding which pages and facts to track and which
287
+ # changes to report.
288
+ #
289
+ # @return [String]
290
+ required :instructions, String
291
+
288
292
  # @!attribute type
289
293
  #
290
294
  # @return [Symbol, :extract]
@@ -301,12 +305,6 @@ module ContextDev
301
305
  # @return [Boolean, nil]
302
306
  optional :follow_subdomains, ContextDev::Internal::Type::Boolean
303
307
 
304
- # @!attribute instructions
305
- # Optional natural-language instructions guiding what to extract.
306
- #
307
- # @return [String, nil]
308
- optional :instructions, String
309
-
310
308
  # @!attribute max_depth
311
309
  # Optional maximum link depth from the starting URL (0 = only the starting page).
312
310
  #
@@ -314,35 +312,45 @@ module ContextDev
314
312
  optional :max_depth, Integer
315
313
 
316
314
  # @!attribute max_pages
317
- # Maximum number of pages to analyze during extraction.
315
+ # Maximum number of pages to track.
318
316
  #
319
317
  # @return [Integer, nil]
320
318
  optional :max_pages, Integer
321
319
 
322
320
  # @!attribute schema
323
- # JSON Schema describing the structured data to extract and watch for changes. If
324
- # omitted, a default summary + key-points schema is used.
321
+ # JSON Schema describing the data you care about. It is used three ways: it guides
322
+ # which pages are selected for tracking, it gives the change judge extra context
323
+ # on which changes matter (alongside `instructions`), and it defines the shape of
324
+ # the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
325
+ # about once a day). It is not a response format for changes: change events and
326
+ # webhook payloads always contain diffs, summaries, and evidence excerpts — never
327
+ # data in this schema's shape. If omitted, a default summary + key-points schema
328
+ # is used.
325
329
  #
326
330
  # @return [Hash{Symbol=>Object}, nil]
327
331
  optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
328
332
 
329
- # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
333
+ # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
330
334
  # Some parameter documentations has been truncated, see
331
335
  # {ContextDev::Models::MonitorUpdateParams::Target::Extract} for more details.
332
336
  #
333
- # Watch a site's extracted structured data.
337
+ # Watch the monitor-relevant pages of a site for meaningful changes. A crawl
338
+ # guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
339
+ # track; each run re-checks exactly those pages, and confirmed content changes are
340
+ # judged for relevance against the monitor's `instructions` (and `schema`, when
341
+ # provided). The tracked page set is refreshed by a periodic re-discovery crawl.
342
+ #
343
+ # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
334
344
  #
335
345
  # @param url [String] Root URL to extract structured data from.
336
346
  #
337
347
  # @param follow_subdomains [Boolean]
338
348
  #
339
- # @param instructions [String] Optional natural-language instructions guiding what to extract.
340
- #
341
349
  # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
342
350
  #
343
- # @param max_pages [Integer] Maximum number of pages to analyze during extraction.
351
+ # @param max_pages [Integer] Maximum number of pages to track.
344
352
  #
345
- # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If
353
+ # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It is used three ways: it guides
346
354
  #
347
355
  # @param type [Symbol, :extract]
348
356
  end