context.dev 2.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/lib/context_dev/models/brand_retrieve_params.rb +46 -3
- data/lib/context_dev/models/monitor_create_params.rb +30 -27
- data/lib/context_dev/models/monitor_create_response.rb +152 -28
- data/lib/context_dev/models/monitor_list_params.rb +4 -4
- data/lib/context_dev/models/monitor_list_response.rb +152 -28
- data/lib/context_dev/models/monitor_retrieve_change_response.rb +1 -8
- data/lib/context_dev/models/monitor_retrieve_response.rb +152 -28
- data/lib/context_dev/models/monitor_update_params.rb +30 -27
- data/lib/context_dev/models/monitor_update_response.rb +152 -28
- data/lib/context_dev/resources/brand.rb +4 -2
- data/lib/context_dev/resources/monitors.rb +1 -1
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/brand_retrieve_params.rbi +67 -0
- data/rbi/context_dev/models/monitor_create_params.rbi +32 -31
- data/rbi/context_dev/models/monitor_create_response.rbi +231 -31
- data/rbi/context_dev/models/monitor_list_params.rbi +9 -6
- data/rbi/context_dev/models/monitor_list_response.rbi +235 -31
- data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +0 -9
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +231 -31
- data/rbi/context_dev/models/monitor_update_params.rbi +32 -31
- data/rbi/context_dev/models/monitor_update_response.rbi +231 -31
- data/rbi/context_dev/resources/brand.rbi +4 -1
- data/rbi/context_dev/resources/monitors.rbi +2 -2
- data/sig/context_dev/models/brand_retrieve_params.rbs +26 -0
- data/sig/context_dev/models/monitor_create_params.rbs +7 -17
- data/sig/context_dev/models/monitor_create_response.rbs +81 -17
- data/sig/context_dev/models/monitor_list_params.rbs +2 -2
- data/sig/context_dev/models/monitor_list_response.rbs +81 -17
- data/sig/context_dev/models/monitor_retrieve_change_response.rbs +0 -7
- data/sig/context_dev/models/monitor_retrieve_response.rbs +81 -17
- data/sig/context_dev/models/monitor_update_params.rbs +7 -17
- data/sig/context_dev/models/monitor_update_response.rbs +81 -17
- metadata +2 -2
|
@@ -82,6 +82,15 @@ module ContextDev
|
|
|
82
82
|
# @return [Time]
|
|
83
83
|
required :updated_at, Time
|
|
84
84
|
|
|
85
|
+
# @!attribute baseline
|
|
86
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
87
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
88
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
89
|
+
# after a target or change_detection update, which resets the baseline).
|
|
90
|
+
#
|
|
91
|
+
# @return [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil]
|
|
92
|
+
optional :baseline, union: -> { ContextDev::Models::MonitorListResponse::Data::Baseline }, nil?: true
|
|
93
|
+
|
|
85
94
|
# @!attribute last_change_at
|
|
86
95
|
#
|
|
87
96
|
# @return [Time, nil]
|
|
@@ -115,7 +124,7 @@ module ContextDev
|
|
|
115
124
|
# @return [ContextDev::Models::MonitorListResponse::Data::Webhook, nil]
|
|
116
125
|
optional :webhook, -> { ContextDev::Models::MonitorListResponse::Data::Webhook }, nil?: true
|
|
117
126
|
|
|
118
|
-
# @!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)
|
|
127
|
+
# @!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)
|
|
119
128
|
# Some parameter documentations has been truncated, see
|
|
120
129
|
# {ContextDev::Models::MonitorListResponse::Data} for more details.
|
|
121
130
|
#
|
|
@@ -140,6 +149,8 @@ module ContextDev
|
|
|
140
149
|
#
|
|
141
150
|
# @param updated_at [Time]
|
|
142
151
|
#
|
|
152
|
+
# @param baseline [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga
|
|
153
|
+
#
|
|
143
154
|
# @param last_change_at [Time, nil]
|
|
144
155
|
#
|
|
145
156
|
# @param last_error [ContextDev::Models::MonitorListResponse::Data::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
|
|
@@ -163,7 +174,7 @@ module ContextDev
|
|
|
163
174
|
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
|
|
164
175
|
variant :exact, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact }
|
|
165
176
|
|
|
166
|
-
# Detect meaning-level changes
|
|
177
|
+
# 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`.
|
|
167
178
|
variant :semantic, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic }
|
|
168
179
|
|
|
169
180
|
class Exact < ContextDev::Internal::Type::BaseModel
|
|
@@ -180,11 +191,6 @@ module ContextDev
|
|
|
180
191
|
end
|
|
181
192
|
|
|
182
193
|
class Semantic < ContextDev::Internal::Type::BaseModel
|
|
183
|
-
# @!attribute query
|
|
184
|
-
#
|
|
185
|
-
# @return [String]
|
|
186
|
-
required :query, String
|
|
187
|
-
|
|
188
194
|
# @!attribute type
|
|
189
195
|
#
|
|
190
196
|
# @return [Symbol, :semantic]
|
|
@@ -195,10 +201,11 @@ module ContextDev
|
|
|
195
201
|
# @return [Float, nil]
|
|
196
202
|
optional :confidence_threshold, Float
|
|
197
203
|
|
|
198
|
-
# @!method initialize(
|
|
199
|
-
# Detect meaning-level changes
|
|
204
|
+
# @!method initialize(confidence_threshold: nil, type: :semantic)
|
|
205
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or
|
|
206
|
+
# paraphrase-only differences. What is watched is determined by the extract
|
|
207
|
+
# target's `schema` and `instructions`.
|
|
200
208
|
#
|
|
201
|
-
# @param query [String]
|
|
202
209
|
# @param confidence_threshold [Float]
|
|
203
210
|
# @param type [Symbol, :semantic]
|
|
204
211
|
end
|
|
@@ -306,10 +313,10 @@ module ContextDev
|
|
|
306
313
|
# Watch a single web page.
|
|
307
314
|
variant :page, -> { ContextDev::Models::MonitorListResponse::Data::Target::Page }
|
|
308
315
|
|
|
309
|
-
# 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.
|
|
316
|
+
# 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.
|
|
310
317
|
variant :sitemap, -> { ContextDev::Models::MonitorListResponse::Data::Target::Sitemap }
|
|
311
318
|
|
|
312
|
-
# Watch a site's
|
|
319
|
+
# 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.
|
|
313
320
|
variant :extract, -> { ContextDev::Models::MonitorListResponse::Data::Target::Extract }
|
|
314
321
|
|
|
315
322
|
class Page < ContextDev::Internal::Type::BaseModel
|
|
@@ -372,8 +379,9 @@ module ContextDev
|
|
|
372
379
|
# @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
|
|
373
380
|
# Watch a sitemap for URL additions and removals. Crawled URLs are normalized
|
|
374
381
|
# (lowercased host, no trailing slash/fragment) and scoped to the monitored site
|
|
375
|
-
# and its subdomains before comparison.
|
|
376
|
-
#
|
|
382
|
+
# and its subdomains before comparison. On a detected difference the sitemap is
|
|
383
|
+
# re-fetched within the same run and only URLs both observations agree on are
|
|
384
|
+
# reported, suppressing transient crawl flaps.
|
|
377
385
|
#
|
|
378
386
|
# @param url [String] Sitemap URL to monitor.
|
|
379
387
|
#
|
|
@@ -387,6 +395,13 @@ module ContextDev
|
|
|
387
395
|
end
|
|
388
396
|
|
|
389
397
|
class Extract < ContextDev::Internal::Type::BaseModel
|
|
398
|
+
# @!attribute instructions
|
|
399
|
+
# Natural-language instructions guiding which pages and facts to track and which
|
|
400
|
+
# changes to report.
|
|
401
|
+
#
|
|
402
|
+
# @return [String]
|
|
403
|
+
required :instructions, String
|
|
404
|
+
|
|
390
405
|
# @!attribute type
|
|
391
406
|
#
|
|
392
407
|
# @return [Symbol, :extract]
|
|
@@ -403,12 +418,6 @@ module ContextDev
|
|
|
403
418
|
# @return [Boolean, nil]
|
|
404
419
|
optional :follow_subdomains, ContextDev::Internal::Type::Boolean
|
|
405
420
|
|
|
406
|
-
# @!attribute instructions
|
|
407
|
-
# Optional natural-language instructions guiding what to extract.
|
|
408
|
-
#
|
|
409
|
-
# @return [String, nil]
|
|
410
|
-
optional :instructions, String
|
|
411
|
-
|
|
412
421
|
# @!attribute max_depth
|
|
413
422
|
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
414
423
|
#
|
|
@@ -416,36 +425,41 @@ module ContextDev
|
|
|
416
425
|
optional :max_depth, Integer
|
|
417
426
|
|
|
418
427
|
# @!attribute max_pages
|
|
419
|
-
# Maximum number of pages to
|
|
428
|
+
# Maximum number of pages to track.
|
|
420
429
|
#
|
|
421
430
|
# @return [Integer, nil]
|
|
422
431
|
optional :max_pages, Integer
|
|
423
432
|
|
|
424
433
|
# @!attribute schema
|
|
425
|
-
# JSON Schema describing the
|
|
434
|
+
# JSON Schema describing the data you care about. It guides which pages are
|
|
435
|
+
# selected for tracking and gives the change judge context on what matters. If
|
|
426
436
|
# omitted, a default summary + key-points schema is used.
|
|
427
437
|
#
|
|
428
438
|
# @return [Hash{Symbol=>Object}, nil]
|
|
429
439
|
optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
430
440
|
|
|
431
|
-
# @!method initialize(url:, follow_subdomains: nil,
|
|
441
|
+
# @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
|
|
432
442
|
# Some parameter documentations has been truncated, see
|
|
433
443
|
# {ContextDev::Models::MonitorListResponse::Data::Target::Extract} for more
|
|
434
444
|
# details.
|
|
435
445
|
#
|
|
436
|
-
# Watch a site
|
|
446
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl
|
|
447
|
+
# guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
|
|
448
|
+
# track; each run re-checks exactly those pages, and confirmed content changes are
|
|
449
|
+
# judged against the monitor's instructions. The tracked page set is refreshed by
|
|
450
|
+
# a periodic re-discovery crawl.
|
|
451
|
+
#
|
|
452
|
+
# @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
|
|
437
453
|
#
|
|
438
454
|
# @param url [String] Root URL to extract structured data from.
|
|
439
455
|
#
|
|
440
456
|
# @param follow_subdomains [Boolean]
|
|
441
457
|
#
|
|
442
|
-
# @param instructions [String] Optional natural-language instructions guiding what to extract.
|
|
443
|
-
#
|
|
444
458
|
# @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
445
459
|
#
|
|
446
|
-
# @param max_pages [Integer] Maximum number of pages to
|
|
460
|
+
# @param max_pages [Integer] Maximum number of pages to track.
|
|
447
461
|
#
|
|
448
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the
|
|
462
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
|
|
449
463
|
#
|
|
450
464
|
# @param type [Symbol, :extract]
|
|
451
465
|
end
|
|
@@ -454,6 +468,116 @@ module ContextDev
|
|
|
454
468
|
# @return [Array(ContextDev::Models::MonitorListResponse::Data::Target::Page, ContextDev::Models::MonitorListResponse::Data::Target::Sitemap, ContextDev::Models::MonitorListResponse::Data::Target::Extract)]
|
|
455
469
|
end
|
|
456
470
|
|
|
471
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
472
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
473
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
474
|
+
# after a target or change_detection update, which resets the baseline).
|
|
475
|
+
#
|
|
476
|
+
# @see ContextDev::Models::MonitorListResponse::Data#baseline
|
|
477
|
+
module Baseline
|
|
478
|
+
extend ContextDev::Internal::Type::Union
|
|
479
|
+
|
|
480
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
481
|
+
variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline }
|
|
482
|
+
|
|
483
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
|
|
484
|
+
variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline }
|
|
485
|
+
|
|
486
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
|
|
487
|
+
variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline }
|
|
488
|
+
|
|
489
|
+
class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
|
|
490
|
+
# @!attribute captured_at
|
|
491
|
+
# When this baseline was last captured or replaced.
|
|
492
|
+
#
|
|
493
|
+
# @return [Time]
|
|
494
|
+
required :captured_at, Time
|
|
495
|
+
|
|
496
|
+
# @!attribute text
|
|
497
|
+
# The page's visible text as last observed.
|
|
498
|
+
#
|
|
499
|
+
# @return [String]
|
|
500
|
+
required :text, String
|
|
501
|
+
|
|
502
|
+
# @!method initialize(captured_at:, text:)
|
|
503
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
504
|
+
#
|
|
505
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
506
|
+
#
|
|
507
|
+
# @param text [String] The page's visible text as last observed.
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
|
|
511
|
+
# @!attribute captured_at
|
|
512
|
+
# When this baseline was last captured or replaced.
|
|
513
|
+
#
|
|
514
|
+
# @return [Time]
|
|
515
|
+
required :captured_at, Time
|
|
516
|
+
|
|
517
|
+
# @!attribute url_count
|
|
518
|
+
# Number of URLs in the baseline.
|
|
519
|
+
#
|
|
520
|
+
# @return [Integer]
|
|
521
|
+
required :url_count, Integer
|
|
522
|
+
|
|
523
|
+
# @!attribute urls
|
|
524
|
+
# The sitemap URLs as last observed (sorted, normalized).
|
|
525
|
+
#
|
|
526
|
+
# @return [Array<String>]
|
|
527
|
+
required :urls, ContextDev::Internal::Type::ArrayOf[String]
|
|
528
|
+
|
|
529
|
+
# @!method initialize(captured_at:, url_count:, urls:)
|
|
530
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last
|
|
531
|
+
# observed.
|
|
532
|
+
#
|
|
533
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
534
|
+
#
|
|
535
|
+
# @param url_count [Integer] Number of URLs in the baseline.
|
|
536
|
+
#
|
|
537
|
+
# @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
|
|
541
|
+
# @!attribute captured_at
|
|
542
|
+
# When this baseline was last captured or replaced.
|
|
543
|
+
#
|
|
544
|
+
# @return [Time]
|
|
545
|
+
required :captured_at, Time
|
|
546
|
+
|
|
547
|
+
# @!attribute data
|
|
548
|
+
# The extracted structured data, matching the monitor's extraction schema (same
|
|
549
|
+
# shape as the /web/extract endpoint's `data`). Refreshed when the monitor
|
|
550
|
+
# re-discovers its page set (at most about once a day); `null` when no extraction
|
|
551
|
+
# has been captured yet.
|
|
552
|
+
#
|
|
553
|
+
# @return [Object]
|
|
554
|
+
required :data, ContextDev::Internal::Type::Unknown
|
|
555
|
+
|
|
556
|
+
# @!attribute urls_analyzed
|
|
557
|
+
# The page URLs the monitor tracks and analyzes for changes.
|
|
558
|
+
#
|
|
559
|
+
# @return [Array<String>]
|
|
560
|
+
required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]
|
|
561
|
+
|
|
562
|
+
# @!method initialize(captured_at:, data:, urls_analyzed:)
|
|
563
|
+
# Some parameter documentations has been truncated, see
|
|
564
|
+
# {ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline}
|
|
565
|
+
# for more details.
|
|
566
|
+
#
|
|
567
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured
|
|
568
|
+
# data as last extracted.
|
|
569
|
+
#
|
|
570
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
571
|
+
#
|
|
572
|
+
# @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
|
|
573
|
+
#
|
|
574
|
+
# @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
# @!method self.variants
|
|
578
|
+
# @return [Array(ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline)]
|
|
579
|
+
end
|
|
580
|
+
|
|
457
581
|
# @see ContextDev::Models::MonitorListResponse::Data#last_error
|
|
458
582
|
class LastError < ContextDev::Internal::Type::BaseModel
|
|
459
583
|
# @!attribute code
|
|
@@ -112,11 +112,6 @@ module ContextDev
|
|
|
112
112
|
# @return [Array<String>, nil]
|
|
113
113
|
optional :matched_urls, ContextDev::Internal::Type::ArrayOf[String]
|
|
114
114
|
|
|
115
|
-
# @!attribute query
|
|
116
|
-
#
|
|
117
|
-
# @return [String, nil]
|
|
118
|
-
optional :query, String
|
|
119
|
-
|
|
120
115
|
# @!attribute removed_url_count
|
|
121
116
|
#
|
|
122
117
|
# @return [Integer, nil]
|
|
@@ -134,7 +129,7 @@ module ContextDev
|
|
|
134
129
|
# @return [Array<String>, nil]
|
|
135
130
|
optional :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
136
131
|
|
|
137
|
-
# @!method initialize(id:, change_detection_type:, detected_at:, mode:, monitor_id:, run_id:, summary:, target_type:, title:, url:, added_url_count: nil, added_urls: nil, after_text_excerpt: nil, before_text_excerpt: nil, confidence: nil, diff: nil, evidence: nil, importance: nil, matched_url_count: nil, matched_urls: nil,
|
|
132
|
+
# @!method initialize(id:, change_detection_type:, detected_at:, mode:, monitor_id:, run_id:, summary:, target_type:, title:, url:, added_url_count: nil, added_urls: nil, after_text_excerpt: nil, before_text_excerpt: nil, confidence: nil, diff: nil, evidence: nil, importance: nil, matched_url_count: nil, matched_urls: nil, removed_url_count: nil, removed_urls: nil, tags: nil)
|
|
138
133
|
# Some parameter documentations has been truncated, see
|
|
139
134
|
# {ContextDev::Models::MonitorRetrieveChangeResponse} for more details.
|
|
140
135
|
#
|
|
@@ -184,8 +179,6 @@ module ContextDev
|
|
|
184
179
|
#
|
|
185
180
|
# @param matched_urls [Array<String>] At most 500 URLs are included; the corresponding count field is always exact.
|
|
186
181
|
#
|
|
187
|
-
# @param query [String]
|
|
188
|
-
#
|
|
189
182
|
# @param removed_url_count [Integer]
|
|
190
183
|
#
|
|
191
184
|
# @param removed_urls [Array<String>] At most 500 URLs are included; the corresponding count field is always exact.
|
|
@@ -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
|
|
156
|
+
# 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`.
|
|
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(
|
|
178
|
-
# Detect meaning-level changes
|
|
183
|
+
# @!method initialize(confidence_threshold: nil, type: :semantic)
|
|
184
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or
|
|
185
|
+
# paraphrase-only differences. What is watched is determined by the extract
|
|
186
|
+
# target's `schema` and `instructions`.
|
|
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.
|
|
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
|
|
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 against the monitor's instructions. 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.
|
|
355
|
-
#
|
|
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,40 @@ module ContextDev
|
|
|
395
404
|
optional :max_depth, Integer
|
|
396
405
|
|
|
397
406
|
# @!attribute max_pages
|
|
398
|
-
# Maximum number of pages to
|
|
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
|
|
413
|
+
# JSON Schema describing the data you care about. It guides which pages are
|
|
414
|
+
# selected for tracking and gives the change judge context on what matters. If
|
|
405
415
|
# omitted, a default summary + key-points schema is used.
|
|
406
416
|
#
|
|
407
417
|
# @return [Hash{Symbol=>Object}, nil]
|
|
408
418
|
optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
409
419
|
|
|
410
|
-
# @!method initialize(url:, follow_subdomains: nil,
|
|
420
|
+
# @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
|
|
411
421
|
# Some parameter documentations has been truncated, see
|
|
412
422
|
# {ContextDev::Models::MonitorRetrieveResponse::Target::Extract} for more details.
|
|
413
423
|
#
|
|
414
|
-
# Watch a site
|
|
424
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl
|
|
425
|
+
# guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
|
|
426
|
+
# track; each run re-checks exactly those pages, and confirmed content changes are
|
|
427
|
+
# judged against the monitor's instructions. The tracked page set is refreshed by
|
|
428
|
+
# a periodic re-discovery crawl.
|
|
429
|
+
#
|
|
430
|
+
# @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
|
|
415
431
|
#
|
|
416
432
|
# @param url [String] Root URL to extract structured data from.
|
|
417
433
|
#
|
|
418
434
|
# @param follow_subdomains [Boolean]
|
|
419
435
|
#
|
|
420
|
-
# @param instructions [String] Optional natural-language instructions guiding what to extract.
|
|
421
|
-
#
|
|
422
436
|
# @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
423
437
|
#
|
|
424
|
-
# @param max_pages [Integer] Maximum number of pages to
|
|
438
|
+
# @param max_pages [Integer] Maximum number of pages to track.
|
|
425
439
|
#
|
|
426
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the
|
|
440
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
|
|
427
441
|
#
|
|
428
442
|
# @param type [Symbol, :extract]
|
|
429
443
|
end
|
|
@@ -432,6 +446,116 @@ module ContextDev
|
|
|
432
446
|
# @return [Array(ContextDev::Models::MonitorRetrieveResponse::Target::Page, ContextDev::Models::MonitorRetrieveResponse::Target::Sitemap, ContextDev::Models::MonitorRetrieveResponse::Target::Extract)]
|
|
433
447
|
end
|
|
434
448
|
|
|
449
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
450
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
451
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
452
|
+
# after a target or change_detection update, which resets the baseline).
|
|
453
|
+
#
|
|
454
|
+
# @see ContextDev::Models::MonitorRetrieveResponse#baseline
|
|
455
|
+
module Baseline
|
|
456
|
+
extend ContextDev::Internal::Type::Union
|
|
457
|
+
|
|
458
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
459
|
+
variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline }
|
|
460
|
+
|
|
461
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
|
|
462
|
+
variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline }
|
|
463
|
+
|
|
464
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
|
|
465
|
+
variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline }
|
|
466
|
+
|
|
467
|
+
class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
|
|
468
|
+
# @!attribute captured_at
|
|
469
|
+
# When this baseline was last captured or replaced.
|
|
470
|
+
#
|
|
471
|
+
# @return [Time]
|
|
472
|
+
required :captured_at, Time
|
|
473
|
+
|
|
474
|
+
# @!attribute text
|
|
475
|
+
# The page's visible text as last observed.
|
|
476
|
+
#
|
|
477
|
+
# @return [String]
|
|
478
|
+
required :text, String
|
|
479
|
+
|
|
480
|
+
# @!method initialize(captured_at:, text:)
|
|
481
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
482
|
+
#
|
|
483
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
484
|
+
#
|
|
485
|
+
# @param text [String] The page's visible text as last observed.
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
|
|
489
|
+
# @!attribute captured_at
|
|
490
|
+
# When this baseline was last captured or replaced.
|
|
491
|
+
#
|
|
492
|
+
# @return [Time]
|
|
493
|
+
required :captured_at, Time
|
|
494
|
+
|
|
495
|
+
# @!attribute url_count
|
|
496
|
+
# Number of URLs in the baseline.
|
|
497
|
+
#
|
|
498
|
+
# @return [Integer]
|
|
499
|
+
required :url_count, Integer
|
|
500
|
+
|
|
501
|
+
# @!attribute urls
|
|
502
|
+
# The sitemap URLs as last observed (sorted, normalized).
|
|
503
|
+
#
|
|
504
|
+
# @return [Array<String>]
|
|
505
|
+
required :urls, ContextDev::Internal::Type::ArrayOf[String]
|
|
506
|
+
|
|
507
|
+
# @!method initialize(captured_at:, url_count:, urls:)
|
|
508
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last
|
|
509
|
+
# observed.
|
|
510
|
+
#
|
|
511
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
512
|
+
#
|
|
513
|
+
# @param url_count [Integer] Number of URLs in the baseline.
|
|
514
|
+
#
|
|
515
|
+
# @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
|
|
519
|
+
# @!attribute captured_at
|
|
520
|
+
# When this baseline was last captured or replaced.
|
|
521
|
+
#
|
|
522
|
+
# @return [Time]
|
|
523
|
+
required :captured_at, Time
|
|
524
|
+
|
|
525
|
+
# @!attribute data
|
|
526
|
+
# The extracted structured data, matching the monitor's extraction schema (same
|
|
527
|
+
# shape as the /web/extract endpoint's `data`). Refreshed when the monitor
|
|
528
|
+
# re-discovers its page set (at most about once a day); `null` when no extraction
|
|
529
|
+
# has been captured yet.
|
|
530
|
+
#
|
|
531
|
+
# @return [Object]
|
|
532
|
+
required :data, ContextDev::Internal::Type::Unknown
|
|
533
|
+
|
|
534
|
+
# @!attribute urls_analyzed
|
|
535
|
+
# The page URLs the monitor tracks and analyzes for changes.
|
|
536
|
+
#
|
|
537
|
+
# @return [Array<String>]
|
|
538
|
+
required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]
|
|
539
|
+
|
|
540
|
+
# @!method initialize(captured_at:, data:, urls_analyzed:)
|
|
541
|
+
# Some parameter documentations has been truncated, see
|
|
542
|
+
# {ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline}
|
|
543
|
+
# for more details.
|
|
544
|
+
#
|
|
545
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured
|
|
546
|
+
# data as last extracted.
|
|
547
|
+
#
|
|
548
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
549
|
+
#
|
|
550
|
+
# @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
|
|
551
|
+
#
|
|
552
|
+
# @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
# @!method self.variants
|
|
556
|
+
# @return [Array(ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline)]
|
|
557
|
+
end
|
|
558
|
+
|
|
435
559
|
# @see ContextDev::Models::MonitorRetrieveResponse#last_error
|
|
436
560
|
class LastError < ContextDev::Internal::Type::BaseModel
|
|
437
561
|
# @!attribute code
|