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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25638d74c398495cbef201fdc8903b11a2e392ca235856c22af7281dadb1fcc2
|
|
4
|
+
data.tar.gz: 1c0ca0f9323f6a4a16e050a9dcd80298e70d07db776b4d3876c8c3bb359d0b0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e9ef0f156d49e0c907e8db8fcf8e5e2fe2986b83bbc92e84039664f7c6733ed719df0aa82a582af2a05046ee36a3c4e980ad6d6bd0bd64f3a887fa63237beb9
|
|
7
|
+
data.tar.gz: 25fd60ebb92056db2ba5efaf793396255ed1661a69b3ae94d1683634294d575f364e0135592e23e8ff23c57482adcce67b35a72895e8058630941c468c35247f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0 (2026-07-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.0.0...v2.1.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.0.0...v2.1.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([7fe6a1f](https://github.com/context-dot-dev/context-ruby-sdk/commit/7fe6a1fbd2977c0669b7623ba96533b43789b8ae))
|
|
10
|
+
* **api:** api update ([cd5b872](https://github.com/context-dot-dev/context-ruby-sdk/commit/cd5b8725dcd7fb06d7bd684aa4ce11b81ca4409a))
|
|
11
|
+
* **api:** api update ([bdc4962](https://github.com/context-dot-dev/context-ruby-sdk/commit/bdc4962f436086be52293ea489960b6b6158726b))
|
|
12
|
+
* **api:** api update ([531ccbe](https://github.com/context-dot-dev/context-ruby-sdk/commit/531ccbeb9770c4340641353859064b50aa6d72bc))
|
|
13
|
+
|
|
3
14
|
## 2.0.0 (2026-07-06)
|
|
4
15
|
|
|
5
16
|
Full Changelog: [v1.36.0...v2.0.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.36.0...v2.0.0)
|
data/README.md
CHANGED
|
@@ -10,11 +10,11 @@ module ContextDev
|
|
|
10
10
|
# @!attribute body
|
|
11
11
|
# Exactly one lookup type must be provided.
|
|
12
12
|
#
|
|
13
|
-
# @return [ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction]
|
|
13
|
+
# @return [ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction]
|
|
14
14
|
required :body, union: -> { ContextDev::BrandRetrieveParams::Body }
|
|
15
15
|
|
|
16
16
|
# @!method initialize(body:, request_options: {})
|
|
17
|
-
# @param body [ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction] Exactly one lookup type must be provided.
|
|
17
|
+
# @param body [ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction] Exactly one lookup type must be provided.
|
|
18
18
|
#
|
|
19
19
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
20
20
|
|
|
@@ -36,6 +36,9 @@ module ContextDev
|
|
|
36
36
|
# Retrieve brand data by stock ticker. Cannot be combined with domain, name, or email.
|
|
37
37
|
variant :by_ticker, -> { ContextDev::BrandRetrieveParams::Body::ByTicker }
|
|
38
38
|
|
|
39
|
+
# Retrieve brand data by fetching the provided URL directly. Note: if you use this, brand data is fetched only from the provided URL — not from the entire internet — so results are limited to what that single page contains. No domain resolution, database lookup, or cross-source enrichment is performed. Cannot be combined with domain, name, email, or ticker.
|
|
40
|
+
variant :by_direct_url, -> { ContextDev::BrandRetrieveParams::Body::ByDirectURL }
|
|
41
|
+
|
|
39
42
|
# Identify brand data from a transaction descriptor. Cannot be combined with domain, name, email, or ticker.
|
|
40
43
|
variant :by_transaction, -> { ContextDev::BrandRetrieveParams::Body::ByTransaction }
|
|
41
44
|
|
|
@@ -824,6 +827,46 @@ module ContextDev
|
|
|
824
827
|
end
|
|
825
828
|
end
|
|
826
829
|
|
|
830
|
+
class ByDirectURL < ContextDev::Internal::Type::BaseModel
|
|
831
|
+
# @!attribute direct_url
|
|
832
|
+
# Full http(s) URL to fetch brand data from (e.g.,
|
|
833
|
+
# 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire
|
|
834
|
+
# internet.
|
|
835
|
+
#
|
|
836
|
+
# @return [String]
|
|
837
|
+
required :direct_url, String
|
|
838
|
+
|
|
839
|
+
# @!attribute type
|
|
840
|
+
# Discriminator for direct-URL-based brand retrieval.
|
|
841
|
+
#
|
|
842
|
+
# @return [Symbol, :by_direct_url]
|
|
843
|
+
required :type, const: :by_direct_url
|
|
844
|
+
|
|
845
|
+
# @!attribute timeout_ms
|
|
846
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
847
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
848
|
+
# value is 300000ms (5 minutes).
|
|
849
|
+
#
|
|
850
|
+
# @return [Integer, nil]
|
|
851
|
+
optional :timeout_ms, Integer, api_name: :timeoutMS
|
|
852
|
+
|
|
853
|
+
# @!method initialize(direct_url:, timeout_ms: nil, type: :by_direct_url)
|
|
854
|
+
# Some parameter documentations has been truncated, see
|
|
855
|
+
# {ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL} for more details.
|
|
856
|
+
#
|
|
857
|
+
# Retrieve brand data by fetching the provided URL directly. Note: if you use
|
|
858
|
+
# this, brand data is fetched only from the provided URL — not from the entire
|
|
859
|
+
# internet — so results are limited to what that single page contains. No domain
|
|
860
|
+
# resolution, database lookup, or cross-source enrichment is performed. Cannot be
|
|
861
|
+
# combined with domain, name, email, or ticker.
|
|
862
|
+
#
|
|
863
|
+
# @param direct_url [String] Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise'
|
|
864
|
+
#
|
|
865
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
866
|
+
#
|
|
867
|
+
# @param type [Symbol, :by_direct_url] Discriminator for direct-URL-based brand retrieval.
|
|
868
|
+
end
|
|
869
|
+
|
|
827
870
|
class ByTransaction < ContextDev::Internal::Type::BaseModel
|
|
828
871
|
# @!attribute transaction_info
|
|
829
872
|
# Transaction information to identify the brand.
|
|
@@ -1049,7 +1092,7 @@ module ContextDev
|
|
|
1049
1092
|
end
|
|
1050
1093
|
|
|
1051
1094
|
# @!method self.variants
|
|
1052
|
-
# @return [Array(ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction)]
|
|
1095
|
+
# @return [Array(ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction)]
|
|
1053
1096
|
end
|
|
1054
1097
|
end
|
|
1055
1098
|
end
|
|
@@ -79,7 +79,7 @@ module ContextDev
|
|
|
79
79
|
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
|
|
80
80
|
variant :exact, -> { ContextDev::MonitorCreateParams::ChangeDetection::Exact }
|
|
81
81
|
|
|
82
|
-
# Detect meaning-level changes
|
|
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
83
|
variant :semantic, -> { ContextDev::MonitorCreateParams::ChangeDetection::Semantic }
|
|
84
84
|
|
|
85
85
|
class Exact < ContextDev::Internal::Type::BaseModel
|
|
@@ -96,11 +96,6 @@ module ContextDev
|
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
class Semantic < ContextDev::Internal::Type::BaseModel
|
|
99
|
-
# @!attribute query
|
|
100
|
-
#
|
|
101
|
-
# @return [String]
|
|
102
|
-
required :query, String
|
|
103
|
-
|
|
104
99
|
# @!attribute type
|
|
105
100
|
#
|
|
106
101
|
# @return [Symbol, :semantic]
|
|
@@ -111,10 +106,11 @@ module ContextDev
|
|
|
111
106
|
# @return [Float, nil]
|
|
112
107
|
optional :confidence_threshold, Float
|
|
113
108
|
|
|
114
|
-
# @!method initialize(
|
|
115
|
-
# Detect meaning-level changes
|
|
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`.
|
|
116
113
|
#
|
|
117
|
-
# @param query [String]
|
|
118
114
|
# @param confidence_threshold [Float]
|
|
119
115
|
# @param type [Symbol, :semantic]
|
|
120
116
|
end
|
|
@@ -188,10 +184,10 @@ module ContextDev
|
|
|
188
184
|
# Watch a single web page.
|
|
189
185
|
variant :page, -> { ContextDev::MonitorCreateParams::Target::Page }
|
|
190
186
|
|
|
191
|
-
# 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.
|
|
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.
|
|
192
188
|
variant :sitemap, -> { ContextDev::MonitorCreateParams::Target::Sitemap }
|
|
193
189
|
|
|
194
|
-
# Watch a site's
|
|
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.
|
|
195
191
|
variant :extract, -> { ContextDev::MonitorCreateParams::Target::Extract }
|
|
196
192
|
|
|
197
193
|
class Page < ContextDev::Internal::Type::BaseModel
|
|
@@ -254,8 +250,9 @@ module ContextDev
|
|
|
254
250
|
# @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
|
|
255
251
|
# Watch a sitemap for URL additions and removals. Crawled URLs are normalized
|
|
256
252
|
# (lowercased host, no trailing slash/fragment) and scoped to the monitored site
|
|
257
|
-
# and its subdomains before comparison.
|
|
258
|
-
#
|
|
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.
|
|
259
256
|
#
|
|
260
257
|
# @param url [String] Sitemap URL to monitor.
|
|
261
258
|
#
|
|
@@ -269,6 +266,13 @@ module ContextDev
|
|
|
269
266
|
end
|
|
270
267
|
|
|
271
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
|
+
|
|
272
276
|
# @!attribute type
|
|
273
277
|
#
|
|
274
278
|
# @return [Symbol, :extract]
|
|
@@ -285,12 +289,6 @@ module ContextDev
|
|
|
285
289
|
# @return [Boolean, nil]
|
|
286
290
|
optional :follow_subdomains, ContextDev::Internal::Type::Boolean
|
|
287
291
|
|
|
288
|
-
# @!attribute instructions
|
|
289
|
-
# Optional natural-language instructions guiding what to extract.
|
|
290
|
-
#
|
|
291
|
-
# @return [String, nil]
|
|
292
|
-
optional :instructions, String
|
|
293
|
-
|
|
294
292
|
# @!attribute max_depth
|
|
295
293
|
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
296
294
|
#
|
|
@@ -298,35 +296,40 @@ module ContextDev
|
|
|
298
296
|
optional :max_depth, Integer
|
|
299
297
|
|
|
300
298
|
# @!attribute max_pages
|
|
301
|
-
# Maximum number of pages to
|
|
299
|
+
# Maximum number of pages to track.
|
|
302
300
|
#
|
|
303
301
|
# @return [Integer, nil]
|
|
304
302
|
optional :max_pages, Integer
|
|
305
303
|
|
|
306
304
|
# @!attribute schema
|
|
307
|
-
# JSON Schema describing the
|
|
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
|
|
308
307
|
# omitted, a default summary + key-points schema is used.
|
|
309
308
|
#
|
|
310
309
|
# @return [Hash{Symbol=>Object}, nil]
|
|
311
310
|
optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
312
311
|
|
|
313
|
-
# @!method initialize(url:, follow_subdomains: nil,
|
|
312
|
+
# @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
|
|
314
313
|
# Some parameter documentations has been truncated, see
|
|
315
314
|
# {ContextDev::Models::MonitorCreateParams::Target::Extract} for more details.
|
|
316
315
|
#
|
|
317
|
-
# Watch a site
|
|
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
|
|
318
323
|
#
|
|
319
324
|
# @param url [String] Root URL to extract structured data from.
|
|
320
325
|
#
|
|
321
326
|
# @param follow_subdomains [Boolean]
|
|
322
327
|
#
|
|
323
|
-
# @param instructions [String] Optional natural-language instructions guiding what to extract.
|
|
324
|
-
#
|
|
325
328
|
# @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
326
329
|
#
|
|
327
|
-
# @param max_pages [Integer] Maximum number of pages to
|
|
330
|
+
# @param max_pages [Integer] Maximum number of pages to track.
|
|
328
331
|
#
|
|
329
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the
|
|
332
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
|
|
330
333
|
#
|
|
331
334
|
# @param type [Symbol, :extract]
|
|
332
335
|
end
|
|
@@ -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::MonitorCreateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline, nil]
|
|
71
|
+
optional :baseline, union: -> { ContextDev::Models::MonitorCreateResponse::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::MonitorCreateResponse::Webhook, nil]
|
|
95
104
|
optional :webhook, -> { ContextDev::Models::MonitorCreateResponse::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::MonitorCreateResponse} 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::MonitorCreateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::Target::Page, ContextDev::Models::MonitorCreateResponse::Target::Sitemap, ContextDev::Models::MonitorCreateResponse::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::MonitorCreateResponse#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::MonitorCreateResponse::Baseline::MonitorsPageBaseline }
|
|
460
|
+
|
|
461
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
|
|
462
|
+
variant -> { ContextDev::Models::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::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::MonitorCreateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline)]
|
|
557
|
+
end
|
|
558
|
+
|
|
435
559
|
# @see ContextDev::Models::MonitorCreateResponse#last_error
|
|
436
560
|
class LastError < ContextDev::Internal::Type::BaseModel
|
|
437
561
|
# @!attribute code
|
|
@@ -29,8 +29,8 @@ module ContextDev
|
|
|
29
29
|
optional :q, String
|
|
30
30
|
|
|
31
31
|
# @!attribute search_by
|
|
32
|
-
# Comma-separated fields to search with `q`. Defaults to all of them. Note
|
|
33
|
-
# only exists on
|
|
32
|
+
# Comma-separated fields to search with `q`. Defaults to all of them. Note
|
|
33
|
+
# `instructions` only exists on extract monitors.
|
|
34
34
|
#
|
|
35
35
|
# @return [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>, nil]
|
|
36
36
|
optional :search_by,
|
|
@@ -82,7 +82,7 @@ module ContextDev
|
|
|
82
82
|
#
|
|
83
83
|
# @param q [String] Free-text search term, matched against the fields named in `search_by`.
|
|
84
84
|
#
|
|
85
|
-
# @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `
|
|
85
|
+
# @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru
|
|
86
86
|
#
|
|
87
87
|
# @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
|
|
88
88
|
#
|
|
@@ -111,7 +111,7 @@ module ContextDev
|
|
|
111
111
|
|
|
112
112
|
NAME = :name
|
|
113
113
|
URL = :url
|
|
114
|
-
|
|
114
|
+
INSTRUCTIONS = :instructions
|
|
115
115
|
TAGS = :tags
|
|
116
116
|
|
|
117
117
|
# @!method self.values
|