From 531ccbeb9770c4340641353859064b50aa6d72bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:23:07 +0000 Subject: [PATCH 1/5] feat(api): api update --- .stats.yml | 4 +- .../models/monitor_create_response.rb | 120 ++++++++++- .../models/monitor_list_response.rb | 120 ++++++++++- .../models/monitor_retrieve_response.rb | 120 ++++++++++- .../models/monitor_update_response.rb | 120 ++++++++++- .../models/monitor_create_response.rbi | 194 +++++++++++++++++ .../models/monitor_list_response.rbi | 198 ++++++++++++++++++ .../models/monitor_retrieve_response.rbi | 194 +++++++++++++++++ .../models/monitor_update_response.rbi | 194 +++++++++++++++++ .../models/monitor_create_response.rbs | 74 +++++++ .../models/monitor_list_response.rbs | 74 +++++++ .../models/monitor_retrieve_response.rbs | 74 +++++++ .../models/monitor_update_response.rbs | 74 +++++++ test/context_dev/resources/monitors_test.rb | 3 + 14 files changed, 1557 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index f52f4302..df5918bb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7dbd739a81e6aaf7fc7ef1858606e7d572d309af55082a66431d9292e655e66f.yml -openapi_spec_hash: a6374d5d718a7bd9d3d54fb657e2bd9d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-6fd8cb15c904d1befd41a85ef8ffa3dfda11e60d560e466857e331e177e0c1e1.yml +openapi_spec_hash: 0f969f518e16e4fc41d00a5229705f5f config_hash: ff35e224e809656528c44163aa41bebd diff --git a/lib/context_dev/models/monitor_create_response.rb b/lib/context_dev/models/monitor_create_response.rb index 2f91665f..20d4bbe8 100644 --- a/lib/context_dev/models/monitor_create_response.rb +++ b/lib/context_dev/models/monitor_create_response.rb @@ -61,6 +61,15 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel # @return [Time] required :updated_at, Time + # @!attribute baseline + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @return [ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline, nil] + optional :baseline, union: -> { ContextDev::Models::MonitorCreateResponse::Baseline }, nil?: true + # @!attribute last_change_at # # @return [Time, nil] @@ -94,7 +103,7 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::MonitorCreateResponse::Webhook, nil] optional :webhook, -> { ContextDev::Models::MonitorCreateResponse::Webhook }, nil?: true - # @!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) + # @!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) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorCreateResponse} for more details. # @@ -119,6 +128,8 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel # # @param updated_at [Time] # + # @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 + # # @param last_change_at [Time, nil] # # @param last_error [ContextDev::Models::MonitorCreateResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded. @@ -432,6 +443,113 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Array(ContextDev::Models::MonitorCreateResponse::Target::Page, ContextDev::Models::MonitorCreateResponse::Target::Sitemap, ContextDev::Models::MonitorCreateResponse::Target::Extract)] end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @see ContextDev::Models::MonitorCreateResponse#baseline + module Baseline + extend ContextDev::Internal::Type::Union + + # Current baseline of a `page` monitor: the visible page text as last observed. + variant -> { ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline } + + # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. + variant -> { ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline } + + # Current baseline of an `extract` monitor: the structured data as last extracted. + variant -> { ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute text + # The page's visible text as last observed. + # + # @return [String] + required :text, String + + # @!method initialize(captured_at:, text:) + # Current baseline of a `page` monitor: the visible page text as last observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param text [String] The page's visible text as last observed. + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute url_count + # Number of URLs in the baseline. + # + # @return [Integer] + required :url_count, Integer + + # @!attribute urls + # The sitemap URLs as last observed (sorted, normalized). + # + # @return [Array] + required :urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, url_count:, urls:) + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param url_count [Integer] Number of URLs in the baseline. + # + # @param urls [Array] The sitemap URLs as last observed (sorted, normalized). + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute data + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + # + # @return [Object] + required :data, ContextDev::Internal::Type::Unknown + + # @!attribute urls_analyzed + # URLs that were analyzed to produce the extracted data. + # + # @return [Array] + required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, data:, urls_analyzed:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline} + # for more details. + # + # Current baseline of an `extract` monitor: the structured data as last extracted. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh + # + # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + end + + # @!method self.variants + # @return [Array(ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline)] + end + # @see ContextDev::Models::MonitorCreateResponse#last_error class LastError < ContextDev::Internal::Type::BaseModel # @!attribute code diff --git a/lib/context_dev/models/monitor_list_response.rb b/lib/context_dev/models/monitor_list_response.rb index 3fe47a25..9b62a4db 100644 --- a/lib/context_dev/models/monitor_list_response.rb +++ b/lib/context_dev/models/monitor_list_response.rb @@ -82,6 +82,15 @@ class Data < ContextDev::Internal::Type::BaseModel # @return [Time] required :updated_at, Time + # @!attribute baseline + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @return [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil] + optional :baseline, union: -> { ContextDev::Models::MonitorListResponse::Data::Baseline }, nil?: true + # @!attribute last_change_at # # @return [Time, nil] @@ -115,7 +124,7 @@ class Data < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::MonitorListResponse::Data::Webhook, nil] optional :webhook, -> { ContextDev::Models::MonitorListResponse::Data::Webhook }, nil?: true - # @!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) + # @!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) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorListResponse::Data} for more details. # @@ -140,6 +149,8 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param updated_at [Time] # + # @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 + # # @param last_change_at [Time, nil] # # @param last_error [ContextDev::Models::MonitorListResponse::Data::LastError, nil] Error from the most recent failed run; null when the last run succeeded. @@ -454,6 +465,113 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Array(ContextDev::Models::MonitorListResponse::Data::Target::Page, ContextDev::Models::MonitorListResponse::Data::Target::Sitemap, ContextDev::Models::MonitorListResponse::Data::Target::Extract)] end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @see ContextDev::Models::MonitorListResponse::Data#baseline + module Baseline + extend ContextDev::Internal::Type::Union + + # Current baseline of a `page` monitor: the visible page text as last observed. + variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline } + + # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. + variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline } + + # Current baseline of an `extract` monitor: the structured data as last extracted. + variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute text + # The page's visible text as last observed. + # + # @return [String] + required :text, String + + # @!method initialize(captured_at:, text:) + # Current baseline of a `page` monitor: the visible page text as last observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param text [String] The page's visible text as last observed. + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute url_count + # Number of URLs in the baseline. + # + # @return [Integer] + required :url_count, Integer + + # @!attribute urls + # The sitemap URLs as last observed (sorted, normalized). + # + # @return [Array] + required :urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, url_count:, urls:) + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param url_count [Integer] Number of URLs in the baseline. + # + # @param urls [Array] The sitemap URLs as last observed (sorted, normalized). + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute data + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + # + # @return [Object] + required :data, ContextDev::Internal::Type::Unknown + + # @!attribute urls_analyzed + # URLs that were analyzed to produce the extracted data. + # + # @return [Array] + required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, data:, urls_analyzed:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline} + # for more details. + # + # Current baseline of an `extract` monitor: the structured data as last extracted. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh + # + # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + end + + # @!method self.variants + # @return [Array(ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline)] + end + # @see ContextDev::Models::MonitorListResponse::Data#last_error class LastError < ContextDev::Internal::Type::BaseModel # @!attribute code diff --git a/lib/context_dev/models/monitor_retrieve_response.rb b/lib/context_dev/models/monitor_retrieve_response.rb index b9bf3398..74a6a053 100644 --- a/lib/context_dev/models/monitor_retrieve_response.rb +++ b/lib/context_dev/models/monitor_retrieve_response.rb @@ -61,6 +61,15 @@ class MonitorRetrieveResponse < ContextDev::Internal::Type::BaseModel # @return [Time] required :updated_at, Time + # @!attribute baseline + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @return [ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline, nil] + optional :baseline, union: -> { ContextDev::Models::MonitorRetrieveResponse::Baseline }, nil?: true + # @!attribute last_change_at # # @return [Time, nil] @@ -94,7 +103,7 @@ class MonitorRetrieveResponse < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::MonitorRetrieveResponse::Webhook, nil] optional :webhook, -> { ContextDev::Models::MonitorRetrieveResponse::Webhook }, nil?: true - # @!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) + # @!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) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorRetrieveResponse} for more details. # @@ -119,6 +128,8 @@ class MonitorRetrieveResponse < ContextDev::Internal::Type::BaseModel # # @param updated_at [Time] # + # @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 + # # @param last_change_at [Time, nil] # # @param last_error [ContextDev::Models::MonitorRetrieveResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded. @@ -432,6 +443,113 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Array(ContextDev::Models::MonitorRetrieveResponse::Target::Page, ContextDev::Models::MonitorRetrieveResponse::Target::Sitemap, ContextDev::Models::MonitorRetrieveResponse::Target::Extract)] end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @see ContextDev::Models::MonitorRetrieveResponse#baseline + module Baseline + extend ContextDev::Internal::Type::Union + + # Current baseline of a `page` monitor: the visible page text as last observed. + variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline } + + # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. + variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline } + + # Current baseline of an `extract` monitor: the structured data as last extracted. + variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute text + # The page's visible text as last observed. + # + # @return [String] + required :text, String + + # @!method initialize(captured_at:, text:) + # Current baseline of a `page` monitor: the visible page text as last observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param text [String] The page's visible text as last observed. + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute url_count + # Number of URLs in the baseline. + # + # @return [Integer] + required :url_count, Integer + + # @!attribute urls + # The sitemap URLs as last observed (sorted, normalized). + # + # @return [Array] + required :urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, url_count:, urls:) + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param url_count [Integer] Number of URLs in the baseline. + # + # @param urls [Array] The sitemap URLs as last observed (sorted, normalized). + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute data + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + # + # @return [Object] + required :data, ContextDev::Internal::Type::Unknown + + # @!attribute urls_analyzed + # URLs that were analyzed to produce the extracted data. + # + # @return [Array] + required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, data:, urls_analyzed:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline} + # for more details. + # + # Current baseline of an `extract` monitor: the structured data as last extracted. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh + # + # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + end + + # @!method self.variants + # @return [Array(ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline)] + end + # @see ContextDev::Models::MonitorRetrieveResponse#last_error class LastError < ContextDev::Internal::Type::BaseModel # @!attribute code diff --git a/lib/context_dev/models/monitor_update_response.rb b/lib/context_dev/models/monitor_update_response.rb index 581baa24..40196467 100644 --- a/lib/context_dev/models/monitor_update_response.rb +++ b/lib/context_dev/models/monitor_update_response.rb @@ -61,6 +61,15 @@ class MonitorUpdateResponse < ContextDev::Internal::Type::BaseModel # @return [Time] required :updated_at, Time + # @!attribute baseline + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @return [ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline, nil] + optional :baseline, union: -> { ContextDev::Models::MonitorUpdateResponse::Baseline }, nil?: true + # @!attribute last_change_at # # @return [Time, nil] @@ -94,7 +103,7 @@ class MonitorUpdateResponse < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::MonitorUpdateResponse::Webhook, nil] optional :webhook, -> { ContextDev::Models::MonitorUpdateResponse::Webhook }, nil?: true - # @!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) + # @!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) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorUpdateResponse} for more details. # @@ -119,6 +128,8 @@ class MonitorUpdateResponse < ContextDev::Internal::Type::BaseModel # # @param updated_at [Time] # + # @param baseline [ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga + # # @param last_change_at [Time, nil] # # @param last_error [ContextDev::Models::MonitorUpdateResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded. @@ -432,6 +443,113 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Array(ContextDev::Models::MonitorUpdateResponse::Target::Page, ContextDev::Models::MonitorUpdateResponse::Target::Sitemap, ContextDev::Models::MonitorUpdateResponse::Target::Extract)] end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + # + # @see ContextDev::Models::MonitorUpdateResponse#baseline + module Baseline + extend ContextDev::Internal::Type::Union + + # Current baseline of a `page` monitor: the visible page text as last observed. + variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline } + + # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. + variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline } + + # Current baseline of an `extract` monitor: the structured data as last extracted. + variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute text + # The page's visible text as last observed. + # + # @return [String] + required :text, String + + # @!method initialize(captured_at:, text:) + # Current baseline of a `page` monitor: the visible page text as last observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param text [String] The page's visible text as last observed. + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute url_count + # Number of URLs in the baseline. + # + # @return [Integer] + required :url_count, Integer + + # @!attribute urls + # The sitemap URLs as last observed (sorted, normalized). + # + # @return [Array] + required :urls, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, url_count:, urls:) + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param url_count [Integer] Number of URLs in the baseline. + # + # @param urls [Array] The sitemap URLs as last observed (sorted, normalized). + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + # @!attribute captured_at + # When this baseline was last captured or replaced. + # + # @return [Time] + required :captured_at, Time + + # @!attribute data + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + # + # @return [Object] + required :data, ContextDev::Internal::Type::Unknown + + # @!attribute urls_analyzed + # URLs that were analyzed to produce the extracted data. + # + # @return [Array] + required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] + + # @!method initialize(captured_at:, data:, urls_analyzed:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline} + # for more details. + # + # Current baseline of an `extract` monitor: the structured data as last extracted. + # + # @param captured_at [Time] When this baseline was last captured or replaced. + # + # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh + # + # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + end + + # @!method self.variants + # @return [Array(ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline)] + end + # @see ContextDev::Models::MonitorUpdateResponse#last_error class LastError < ContextDev::Internal::Type::BaseModel # @!attribute code diff --git a/rbi/context_dev/models/monitor_create_response.rbi b/rbi/context_dev/models/monitor_create_response.rbi index 63f1f64b..6367b337 100644 --- a/rbi/context_dev/models/monitor_create_response.rbi +++ b/rbi/context_dev/models/monitor_create_response.rbi @@ -67,6 +67,19 @@ module ContextDev sig { returns(Time) } attr_accessor :updated_at + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + sig do + returns( + T.nilable( + ContextDev::Models::MonitorCreateResponse::Baseline::Variants + ) + ) + end + attr_accessor :baseline + sig { returns(T.nilable(Time)) } attr_accessor :last_change_at @@ -137,6 +150,14 @@ module ContextDev ContextDev::Models::MonitorCreateResponse::Target::Extract::OrHash ), updated_at: Time, + baseline: + T.nilable( + T.any( + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline::OrHash, + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline::OrHash, + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline::OrHash + ) + ), last_change_at: T.nilable(Time), last_error: T.nilable( @@ -173,6 +194,11 @@ module ContextDev # Discriminated union describing what the monitor watches. target:, updated_at:, + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + baseline: nil, last_change_at: nil, # Error from the most recent failed run; null when the last run succeeded. last_error: nil, @@ -199,6 +225,10 @@ module ContextDev ContextDev::Models::MonitorCreateResponse::Status::TaggedSymbol, target: ContextDev::Models::MonitorCreateResponse::Target::Variants, updated_at: Time, + baseline: + T.nilable( + ContextDev::Models::MonitorCreateResponse::Baseline::Variants + ), last_change_at: T.nilable(Time), last_error: T.nilable(ContextDev::Models::MonitorCreateResponse::LastError), @@ -749,6 +779,170 @@ module ContextDev end end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + module Baseline + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline, + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline + ) + end + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The page's visible text as last observed. + sig { returns(String) } + attr_accessor :text + + # Current baseline of a `page` monitor: the visible page text as last observed. + sig do + params(captured_at: Time, text: String).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The page's visible text as last observed. + text: + ) + end + + sig { override.returns({ captured_at: Time, text: String }) } + def to_hash + end + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # Number of URLs in the baseline. + sig { returns(Integer) } + attr_accessor :url_count + + # The sitemap URLs as last observed (sorted, normalized). + sig { returns(T::Array[String]) } + attr_accessor :urls + + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + sig do + params( + captured_at: Time, + url_count: Integer, + urls: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # Number of URLs in the baseline. + url_count:, + # The sitemap URLs as last observed (sorted, normalized). + urls: + ) + end + + sig do + override.returns( + { captured_at: Time, url_count: Integer, urls: T::Array[String] } + ) + end + def to_hash + end + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + sig { returns(T.anything) } + attr_accessor :data + + # URLs that were analyzed to produce the extracted data. + sig { returns(T::Array[String]) } + attr_accessor :urls_analyzed + + # Current baseline of an `extract` monitor: the structured data as last extracted. + sig do + params( + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + data:, + # URLs that were analyzed to produce the extracted data. + urls_analyzed: + ) + end + + sig do + override.returns( + { + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorCreateResponse::Baseline::Variants + ] + ) + end + def self.variants + end + end + class LastError < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/context_dev/models/monitor_list_response.rbi b/rbi/context_dev/models/monitor_list_response.rbi index 25b53e59..6021b632 100644 --- a/rbi/context_dev/models/monitor_list_response.rbi +++ b/rbi/context_dev/models/monitor_list_response.rbi @@ -114,6 +114,19 @@ module ContextDev sig { returns(Time) } attr_accessor :updated_at + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + sig do + returns( + T.nilable( + ContextDev::Models::MonitorListResponse::Data::Baseline::Variants + ) + ) + end + attr_accessor :baseline + sig { returns(T.nilable(Time)) } attr_accessor :last_change_at @@ -190,6 +203,14 @@ module ContextDev ContextDev::Models::MonitorListResponse::Data::Target::Extract::OrHash ), updated_at: Time, + baseline: + T.nilable( + T.any( + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline::OrHash, + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline::OrHash, + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline::OrHash + ) + ), last_change_at: T.nilable(Time), last_error: T.nilable( @@ -226,6 +247,11 @@ module ContextDev # Discriminated union describing what the monitor watches. target:, updated_at:, + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + baseline: nil, last_change_at: nil, # Error from the most recent failed run; null when the last run succeeded. last_error: nil, @@ -254,6 +280,10 @@ module ContextDev target: ContextDev::Models::MonitorListResponse::Data::Target::Variants, updated_at: Time, + baseline: + T.nilable( + ContextDev::Models::MonitorListResponse::Data::Baseline::Variants + ), last_change_at: T.nilable(Time), last_error: T.nilable( @@ -811,6 +841,174 @@ module ContextDev end end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + module Baseline + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline + ) + end + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The page's visible text as last observed. + sig { returns(String) } + attr_accessor :text + + # Current baseline of a `page` monitor: the visible page text as last observed. + sig do + params(captured_at: Time, text: String).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The page's visible text as last observed. + text: + ) + end + + sig { override.returns({ captured_at: Time, text: String }) } + def to_hash + end + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # Number of URLs in the baseline. + sig { returns(Integer) } + attr_accessor :url_count + + # The sitemap URLs as last observed (sorted, normalized). + sig { returns(T::Array[String]) } + attr_accessor :urls + + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + sig do + params( + captured_at: Time, + url_count: Integer, + urls: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # Number of URLs in the baseline. + url_count:, + # The sitemap URLs as last observed (sorted, normalized). + urls: + ) + end + + sig do + override.returns( + { + captured_at: Time, + url_count: Integer, + urls: T::Array[String] + } + ) + end + def to_hash + end + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + sig { returns(T.anything) } + attr_accessor :data + + # URLs that were analyzed to produce the extracted data. + sig { returns(T::Array[String]) } + attr_accessor :urls_analyzed + + # Current baseline of an `extract` monitor: the structured data as last extracted. + sig do + params( + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + data:, + # URLs that were analyzed to produce the extracted data. + urls_analyzed: + ) + end + + sig do + override.returns( + { + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorListResponse::Data::Baseline::Variants + ] + ) + end + def self.variants + end + end + class LastError < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/context_dev/models/monitor_retrieve_response.rbi b/rbi/context_dev/models/monitor_retrieve_response.rbi index 881048ed..ff2fbbec 100644 --- a/rbi/context_dev/models/monitor_retrieve_response.rbi +++ b/rbi/context_dev/models/monitor_retrieve_response.rbi @@ -70,6 +70,19 @@ module ContextDev sig { returns(Time) } attr_accessor :updated_at + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + sig do + returns( + T.nilable( + ContextDev::Models::MonitorRetrieveResponse::Baseline::Variants + ) + ) + end + attr_accessor :baseline + sig { returns(T.nilable(Time)) } attr_accessor :last_change_at @@ -143,6 +156,14 @@ module ContextDev ContextDev::Models::MonitorRetrieveResponse::Target::Extract::OrHash ), updated_at: Time, + baseline: + T.nilable( + T.any( + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline::OrHash, + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline::OrHash, + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline::OrHash + ) + ), last_change_at: T.nilable(Time), last_error: T.nilable( @@ -179,6 +200,11 @@ module ContextDev # Discriminated union describing what the monitor watches. target:, updated_at:, + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + baseline: nil, last_change_at: nil, # Error from the most recent failed run; null when the last run succeeded. last_error: nil, @@ -207,6 +233,10 @@ module ContextDev target: ContextDev::Models::MonitorRetrieveResponse::Target::Variants, updated_at: Time, + baseline: + T.nilable( + ContextDev::Models::MonitorRetrieveResponse::Baseline::Variants + ), last_change_at: T.nilable(Time), last_error: T.nilable(ContextDev::Models::MonitorRetrieveResponse::LastError), @@ -757,6 +787,170 @@ module ContextDev end end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + module Baseline + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline + ) + end + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The page's visible text as last observed. + sig { returns(String) } + attr_accessor :text + + # Current baseline of a `page` monitor: the visible page text as last observed. + sig do + params(captured_at: Time, text: String).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The page's visible text as last observed. + text: + ) + end + + sig { override.returns({ captured_at: Time, text: String }) } + def to_hash + end + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # Number of URLs in the baseline. + sig { returns(Integer) } + attr_accessor :url_count + + # The sitemap URLs as last observed (sorted, normalized). + sig { returns(T::Array[String]) } + attr_accessor :urls + + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + sig do + params( + captured_at: Time, + url_count: Integer, + urls: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # Number of URLs in the baseline. + url_count:, + # The sitemap URLs as last observed (sorted, normalized). + urls: + ) + end + + sig do + override.returns( + { captured_at: Time, url_count: Integer, urls: T::Array[String] } + ) + end + def to_hash + end + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + sig { returns(T.anything) } + attr_accessor :data + + # URLs that were analyzed to produce the extracted data. + sig { returns(T::Array[String]) } + attr_accessor :urls_analyzed + + # Current baseline of an `extract` monitor: the structured data as last extracted. + sig do + params( + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + data:, + # URLs that were analyzed to produce the extracted data. + urls_analyzed: + ) + end + + sig do + override.returns( + { + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorRetrieveResponse::Baseline::Variants + ] + ) + end + def self.variants + end + end + class LastError < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/context_dev/models/monitor_update_response.rbi b/rbi/context_dev/models/monitor_update_response.rbi index 77be8d5d..98adaff9 100644 --- a/rbi/context_dev/models/monitor_update_response.rbi +++ b/rbi/context_dev/models/monitor_update_response.rbi @@ -67,6 +67,19 @@ module ContextDev sig { returns(Time) } attr_accessor :updated_at + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + sig do + returns( + T.nilable( + ContextDev::Models::MonitorUpdateResponse::Baseline::Variants + ) + ) + end + attr_accessor :baseline + sig { returns(T.nilable(Time)) } attr_accessor :last_change_at @@ -137,6 +150,14 @@ module ContextDev ContextDev::Models::MonitorUpdateResponse::Target::Extract::OrHash ), updated_at: Time, + baseline: + T.nilable( + T.any( + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline::OrHash, + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline::OrHash, + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline::OrHash + ) + ), last_change_at: T.nilable(Time), last_error: T.nilable( @@ -173,6 +194,11 @@ module ContextDev # Discriminated union describing what the monitor watches. target:, updated_at:, + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + baseline: nil, last_change_at: nil, # Error from the most recent failed run; null when the last run succeeded. last_error: nil, @@ -199,6 +225,10 @@ module ContextDev ContextDev::Models::MonitorUpdateResponse::Status::TaggedSymbol, target: ContextDev::Models::MonitorUpdateResponse::Target::Variants, updated_at: Time, + baseline: + T.nilable( + ContextDev::Models::MonitorUpdateResponse::Baseline::Variants + ), last_change_at: T.nilable(Time), last_error: T.nilable(ContextDev::Models::MonitorUpdateResponse::LastError), @@ -749,6 +779,170 @@ module ContextDev end end + # Current baseline: the last observed value the monitor compares new snapshots + # against. Its shape follows `target.type` (page/sitemap/extract). Only populated + # on GET /monitors/{monitor_id}; null until the first baseline run completes (and + # after a target or change_detection update, which resets the baseline). + module Baseline + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline + ) + end + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The page's visible text as last observed. + sig { returns(String) } + attr_accessor :text + + # Current baseline of a `page` monitor: the visible page text as last observed. + sig do + params(captured_at: Time, text: String).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The page's visible text as last observed. + text: + ) + end + + sig { override.returns({ captured_at: Time, text: String }) } + def to_hash + end + end + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # Number of URLs in the baseline. + sig { returns(Integer) } + attr_accessor :url_count + + # The sitemap URLs as last observed (sorted, normalized). + sig { returns(T::Array[String]) } + attr_accessor :urls + + # Current baseline of a `sitemap` monitor: the normalized URL set as last + # observed. + sig do + params( + captured_at: Time, + url_count: Integer, + urls: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # Number of URLs in the baseline. + url_count:, + # The sitemap URLs as last observed (sorted, normalized). + urls: + ) + end + + sig do + override.returns( + { captured_at: Time, url_count: Integer, urls: T::Array[String] } + ) + end + def to_hash + end + end + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline, + ContextDev::Internal::AnyHash + ) + end + + # When this baseline was last captured or replaced. + sig { returns(Time) } + attr_accessor :captured_at + + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + sig { returns(T.anything) } + attr_accessor :data + + # URLs that were analyzed to produce the extracted data. + sig { returns(T::Array[String]) } + attr_accessor :urls_analyzed + + # Current baseline of an `extract` monitor: the structured data as last extracted. + sig do + params( + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # When this baseline was last captured or replaced. + captured_at:, + # The extracted structured data, matching the monitor's extraction schema (same + # shape as the /web/extract endpoint's `data`). + data:, + # URLs that were analyzed to produce the extracted data. + urls_analyzed: + ) + end + + sig do + override.returns( + { + captured_at: Time, + data: T.anything, + urls_analyzed: T::Array[String] + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorUpdateResponse::Baseline::Variants + ] + ) + end + def self.variants + end + end + class LastError < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/sig/context_dev/models/monitor_create_response.rbs b/sig/context_dev/models/monitor_create_response.rbs index 138e72a3..4054372c 100644 --- a/sig/context_dev/models/monitor_create_response.rbs +++ b/sig/context_dev/models/monitor_create_response.rbs @@ -11,6 +11,7 @@ module ContextDev status: ContextDev::Models::MonitorCreateResponse::status, target: ContextDev::Models::MonitorCreateResponse::target, updated_at: Time, + baseline: ContextDev::Models::MonitorCreateResponse::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorCreateResponse::LastError?, last_run_at: Time?, @@ -38,6 +39,8 @@ module ContextDev attr_accessor updated_at: Time + attr_accessor baseline: ContextDev::Models::MonitorCreateResponse::baseline? + attr_accessor last_change_at: Time? attr_accessor last_error: ContextDev::Models::MonitorCreateResponse::LastError? @@ -62,6 +65,7 @@ module ContextDev status: ContextDev::Models::MonitorCreateResponse::status, target: ContextDev::Models::MonitorCreateResponse::target, updated_at: Time, + ?baseline: ContextDev::Models::MonitorCreateResponse::baseline?, ?last_change_at: Time?, ?last_error: ContextDev::Models::MonitorCreateResponse::LastError?, ?last_run_at: Time?, @@ -80,6 +84,7 @@ module ContextDev status: ContextDev::Models::MonitorCreateResponse::status, target: ContextDev::Models::MonitorCreateResponse::target, updated_at: Time, + baseline: ContextDev::Models::MonitorCreateResponse::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorCreateResponse::LastError?, last_run_at: Time?, @@ -339,6 +344,75 @@ module ContextDev def self?.variants: -> ::Array[ContextDev::Models::MonitorCreateResponse::target] end + type baseline = + ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline + | ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline + | ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline + + module Baseline + extend ContextDev::Internal::Type::Union + + type monitors_page_baseline = { captured_at: Time, text: String } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor text: String + + def initialize: (captured_at: Time, text: String) -> void + + def to_hash: -> { captured_at: Time, text: String } + end + + type monitors_sitemap_baseline = + { captured_at: Time, url_count: Integer, urls: ::Array[String] } + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor url_count: Integer + + attr_accessor urls: ::Array[String] + + def initialize: ( + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + } + end + + type monitors_extract_baseline = + { captured_at: Time, data: top, urls_analyzed: ::Array[String] } + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor data: top + + attr_accessor urls_analyzed: ::Array[String] + + def initialize: ( + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + } + end + + def self?.variants: -> ::Array[ContextDev::Models::MonitorCreateResponse::baseline] + end + type last_error = { code: String, message: String } class LastError < ContextDev::Internal::Type::BaseModel diff --git a/sig/context_dev/models/monitor_list_response.rbs b/sig/context_dev/models/monitor_list_response.rbs index b15fc375..c53ea1c8 100644 --- a/sig/context_dev/models/monitor_list_response.rbs +++ b/sig/context_dev/models/monitor_list_response.rbs @@ -37,6 +37,7 @@ module ContextDev status: ContextDev::Models::MonitorListResponse::Data::status, target: ContextDev::Models::MonitorListResponse::Data::target, updated_at: Time, + baseline: ContextDev::Models::MonitorListResponse::Data::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorListResponse::Data::LastError?, last_run_at: Time?, @@ -64,6 +65,8 @@ module ContextDev attr_accessor updated_at: Time + attr_accessor baseline: ContextDev::Models::MonitorListResponse::Data::baseline? + attr_accessor last_change_at: Time? attr_accessor last_error: ContextDev::Models::MonitorListResponse::Data::LastError? @@ -88,6 +91,7 @@ module ContextDev status: ContextDev::Models::MonitorListResponse::Data::status, target: ContextDev::Models::MonitorListResponse::Data::target, updated_at: Time, + ?baseline: ContextDev::Models::MonitorListResponse::Data::baseline?, ?last_change_at: Time?, ?last_error: ContextDev::Models::MonitorListResponse::Data::LastError?, ?last_run_at: Time?, @@ -106,6 +110,7 @@ module ContextDev status: ContextDev::Models::MonitorListResponse::Data::status, target: ContextDev::Models::MonitorListResponse::Data::target, updated_at: Time, + baseline: ContextDev::Models::MonitorListResponse::Data::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorListResponse::Data::LastError?, last_run_at: Time?, @@ -365,6 +370,75 @@ module ContextDev def self?.variants: -> ::Array[ContextDev::Models::MonitorListResponse::Data::target] end + type baseline = + ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline + | ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline + | ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline + + module Baseline + extend ContextDev::Internal::Type::Union + + type monitors_page_baseline = { captured_at: Time, text: String } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor text: String + + def initialize: (captured_at: Time, text: String) -> void + + def to_hash: -> { captured_at: Time, text: String } + end + + type monitors_sitemap_baseline = + { captured_at: Time, url_count: Integer, urls: ::Array[String] } + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor url_count: Integer + + attr_accessor urls: ::Array[String] + + def initialize: ( + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + } + end + + type monitors_extract_baseline = + { captured_at: Time, data: top, urls_analyzed: ::Array[String] } + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor data: top + + attr_accessor urls_analyzed: ::Array[String] + + def initialize: ( + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + } + end + + def self?.variants: -> ::Array[ContextDev::Models::MonitorListResponse::Data::baseline] + end + type last_error = { code: String, message: String } class LastError < ContextDev::Internal::Type::BaseModel diff --git a/sig/context_dev/models/monitor_retrieve_response.rbs b/sig/context_dev/models/monitor_retrieve_response.rbs index 85b0a972..5b9d8f8f 100644 --- a/sig/context_dev/models/monitor_retrieve_response.rbs +++ b/sig/context_dev/models/monitor_retrieve_response.rbs @@ -11,6 +11,7 @@ module ContextDev status: ContextDev::Models::MonitorRetrieveResponse::status, target: ContextDev::Models::MonitorRetrieveResponse::target, updated_at: Time, + baseline: ContextDev::Models::MonitorRetrieveResponse::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorRetrieveResponse::LastError?, last_run_at: Time?, @@ -38,6 +39,8 @@ module ContextDev attr_accessor updated_at: Time + attr_accessor baseline: ContextDev::Models::MonitorRetrieveResponse::baseline? + attr_accessor last_change_at: Time? attr_accessor last_error: ContextDev::Models::MonitorRetrieveResponse::LastError? @@ -62,6 +65,7 @@ module ContextDev status: ContextDev::Models::MonitorRetrieveResponse::status, target: ContextDev::Models::MonitorRetrieveResponse::target, updated_at: Time, + ?baseline: ContextDev::Models::MonitorRetrieveResponse::baseline?, ?last_change_at: Time?, ?last_error: ContextDev::Models::MonitorRetrieveResponse::LastError?, ?last_run_at: Time?, @@ -80,6 +84,7 @@ module ContextDev status: ContextDev::Models::MonitorRetrieveResponse::status, target: ContextDev::Models::MonitorRetrieveResponse::target, updated_at: Time, + baseline: ContextDev::Models::MonitorRetrieveResponse::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorRetrieveResponse::LastError?, last_run_at: Time?, @@ -339,6 +344,75 @@ module ContextDev def self?.variants: -> ::Array[ContextDev::Models::MonitorRetrieveResponse::target] end + type baseline = + ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsPageBaseline + | ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline + | ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline + + module Baseline + extend ContextDev::Internal::Type::Union + + type monitors_page_baseline = { captured_at: Time, text: String } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor text: String + + def initialize: (captured_at: Time, text: String) -> void + + def to_hash: -> { captured_at: Time, text: String } + end + + type monitors_sitemap_baseline = + { captured_at: Time, url_count: Integer, urls: ::Array[String] } + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor url_count: Integer + + attr_accessor urls: ::Array[String] + + def initialize: ( + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + } + end + + type monitors_extract_baseline = + { captured_at: Time, data: top, urls_analyzed: ::Array[String] } + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor data: top + + attr_accessor urls_analyzed: ::Array[String] + + def initialize: ( + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + } + end + + def self?.variants: -> ::Array[ContextDev::Models::MonitorRetrieveResponse::baseline] + end + type last_error = { code: String, message: String } class LastError < ContextDev::Internal::Type::BaseModel diff --git a/sig/context_dev/models/monitor_update_response.rbs b/sig/context_dev/models/monitor_update_response.rbs index 5a63ecd5..630550d6 100644 --- a/sig/context_dev/models/monitor_update_response.rbs +++ b/sig/context_dev/models/monitor_update_response.rbs @@ -11,6 +11,7 @@ module ContextDev status: ContextDev::Models::MonitorUpdateResponse::status, target: ContextDev::Models::MonitorUpdateResponse::target, updated_at: Time, + baseline: ContextDev::Models::MonitorUpdateResponse::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorUpdateResponse::LastError?, last_run_at: Time?, @@ -38,6 +39,8 @@ module ContextDev attr_accessor updated_at: Time + attr_accessor baseline: ContextDev::Models::MonitorUpdateResponse::baseline? + attr_accessor last_change_at: Time? attr_accessor last_error: ContextDev::Models::MonitorUpdateResponse::LastError? @@ -62,6 +65,7 @@ module ContextDev status: ContextDev::Models::MonitorUpdateResponse::status, target: ContextDev::Models::MonitorUpdateResponse::target, updated_at: Time, + ?baseline: ContextDev::Models::MonitorUpdateResponse::baseline?, ?last_change_at: Time?, ?last_error: ContextDev::Models::MonitorUpdateResponse::LastError?, ?last_run_at: Time?, @@ -80,6 +84,7 @@ module ContextDev status: ContextDev::Models::MonitorUpdateResponse::status, target: ContextDev::Models::MonitorUpdateResponse::target, updated_at: Time, + baseline: ContextDev::Models::MonitorUpdateResponse::baseline?, last_change_at: Time?, last_error: ContextDev::Models::MonitorUpdateResponse::LastError?, last_run_at: Time?, @@ -339,6 +344,75 @@ module ContextDev def self?.variants: -> ::Array[ContextDev::Models::MonitorUpdateResponse::target] end + type baseline = + ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline + | ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline + | ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline + + module Baseline + extend ContextDev::Internal::Type::Union + + type monitors_page_baseline = { captured_at: Time, text: String } + + class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor text: String + + def initialize: (captured_at: Time, text: String) -> void + + def to_hash: -> { captured_at: Time, text: String } + end + + type monitors_sitemap_baseline = + { captured_at: Time, url_count: Integer, urls: ::Array[String] } + + class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor url_count: Integer + + attr_accessor urls: ::Array[String] + + def initialize: ( + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + url_count: Integer, + urls: ::Array[String] + } + end + + type monitors_extract_baseline = + { captured_at: Time, data: top, urls_analyzed: ::Array[String] } + + class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel + attr_accessor captured_at: Time + + attr_accessor data: top + + attr_accessor urls_analyzed: ::Array[String] + + def initialize: ( + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + ) -> void + + def to_hash: -> { + captured_at: Time, + data: top, + urls_analyzed: ::Array[String] + } + end + + def self?.variants: -> ::Array[ContextDev::Models::MonitorUpdateResponse::baseline] + end + type last_error = { code: String, message: String } class LastError < ContextDev::Internal::Type::BaseModel diff --git a/test/context_dev/resources/monitors_test.rb b/test/context_dev/resources/monitors_test.rb index 14c23d0d..734ed692 100644 --- a/test/context_dev/resources/monitors_test.rb +++ b/test/context_dev/resources/monitors_test.rb @@ -29,6 +29,7 @@ def test_create_required_params status: ContextDev::Models::MonitorCreateResponse::Status, target: ContextDev::Models::MonitorCreateResponse::Target, updated_at: Time, + baseline: ContextDev::Models::MonitorCreateResponse::Baseline | nil, last_change_at: Time | nil, last_error: ContextDev::Models::MonitorCreateResponse::LastError | nil, last_run_at: Time | nil, @@ -59,6 +60,7 @@ def test_retrieve status: ContextDev::Models::MonitorRetrieveResponse::Status, target: ContextDev::Models::MonitorRetrieveResponse::Target, updated_at: Time, + baseline: ContextDev::Models::MonitorRetrieveResponse::Baseline | nil, last_change_at: Time | nil, last_error: ContextDev::Models::MonitorRetrieveResponse::LastError | nil, last_run_at: Time | nil, @@ -89,6 +91,7 @@ def test_update status: ContextDev::Models::MonitorUpdateResponse::Status, target: ContextDev::Models::MonitorUpdateResponse::Target, updated_at: Time, + baseline: ContextDev::Models::MonitorUpdateResponse::Baseline | nil, last_change_at: Time | nil, last_error: ContextDev::Models::MonitorUpdateResponse::LastError | nil, last_run_at: Time | nil, From bdc4962f436086be52293ea489960b6b6158726b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 00:10:13 +0000 Subject: [PATCH 2/5] feat(api): api update --- .stats.yml | 4 +- .../models/brand_retrieve_params.rb | 49 +++++++++++++- lib/context_dev/resources/brand.rb | 6 +- .../models/brand_retrieve_params.rbi | 67 +++++++++++++++++++ rbi/context_dev/resources/brand.rbi | 5 +- .../models/brand_retrieve_params.rbs | 26 +++++++ 6 files changed, 149 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index df5918bb..5321a028 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-6fd8cb15c904d1befd41a85ef8ffa3dfda11e60d560e466857e331e177e0c1e1.yml -openapi_spec_hash: 0f969f518e16e4fc41d00a5229705f5f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fa5c7cd62da1c7cb2eddf8c6bb1f32ca7f958be5c3c315ade6ca0a669814d75a.yml +openapi_spec_hash: 8358c1a467ab971afd59d615d1e731ee config_hash: ff35e224e809656528c44163aa41bebd diff --git a/lib/context_dev/models/brand_retrieve_params.rb b/lib/context_dev/models/brand_retrieve_params.rb index dd108b90..fc3b3815 100644 --- a/lib/context_dev/models/brand_retrieve_params.rb +++ b/lib/context_dev/models/brand_retrieve_params.rb @@ -10,11 +10,11 @@ class BrandRetrieveParams < ContextDev::Internal::Type::BaseModel # @!attribute body # Exactly one lookup type must be provided. # - # @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] + # @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] required :body, union: -> { ContextDev::BrandRetrieveParams::Body } # @!method initialize(body:, request_options: {}) - # @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. + # @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. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] @@ -36,6 +36,9 @@ module Body # Retrieve brand data by stock ticker. Cannot be combined with domain, name, or email. variant :by_ticker, -> { ContextDev::BrandRetrieveParams::Body::ByTicker } + # 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. + variant :by_direct_url, -> { ContextDev::BrandRetrieveParams::Body::ByDirectURL } + # Identify brand data from a transaction descriptor. Cannot be combined with domain, name, email, or ticker. variant :by_transaction, -> { ContextDev::BrandRetrieveParams::Body::ByTransaction } @@ -824,6 +827,46 @@ module ForceLanguage end end + class ByDirectURL < ContextDev::Internal::Type::BaseModel + # @!attribute direct_url + # Full http(s) URL to fetch brand data from (e.g., + # 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire + # internet. + # + # @return [String] + required :direct_url, String + + # @!attribute type + # Discriminator for direct-URL-based brand retrieval. + # + # @return [Symbol, :by_direct_url] + required :type, const: :by_direct_url + + # @!attribute timeout_ms + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + # + # @return [Integer, nil] + optional :timeout_ms, Integer, api_name: :timeoutMS + + # @!method initialize(direct_url:, timeout_ms: nil, type: :by_direct_url) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL} for more details. + # + # 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. + # + # @param direct_url [String] Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise' + # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # + # @param type [Symbol, :by_direct_url] Discriminator for direct-URL-based brand retrieval. + end + class ByTransaction < ContextDev::Internal::Type::BaseModel # @!attribute transaction_info # Transaction information to identify the brand. @@ -1049,7 +1092,7 @@ module ForceLanguage end # @!method self.variants - # @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)] + # @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)] end end end diff --git a/lib/context_dev/resources/brand.rb b/lib/context_dev/resources/brand.rb index 942294d4..ff61691e 100644 --- a/lib/context_dev/resources/brand.rb +++ b/lib/context_dev/resources/brand.rb @@ -5,11 +5,13 @@ module Resources class Brand # Retrieve logos, backdrops, colors, industry, description, and more. Provide # exactly one lookup identifier in the request body: a domain, company name, email - # address, stock ticker, or transaction descriptor. + # address, stock ticker, transaction descriptor, or direct URL. Note: + # `by_direct_url` fetches brand data only from the provided URL — not from the + # entire internet. # # @overload retrieve(body:, request_options: {}) # - # @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. + # @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. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/rbi/context_dev/models/brand_retrieve_params.rbi b/rbi/context_dev/models/brand_retrieve_params.rbi index cea2505b..6dc2222f 100644 --- a/rbi/context_dev/models/brand_retrieve_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_params.rbi @@ -19,6 +19,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName, ContextDev::BrandRetrieveParams::Body::ByEmail, ContextDev::BrandRetrieveParams::Body::ByTicker, + ContextDev::BrandRetrieveParams::Body::ByDirectURL, ContextDev::BrandRetrieveParams::Body::ByTransaction ) ) @@ -33,6 +34,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName::OrHash, ContextDev::BrandRetrieveParams::Body::ByEmail::OrHash, ContextDev::BrandRetrieveParams::Body::ByTicker::OrHash, + ContextDev::BrandRetrieveParams::Body::ByDirectURL::OrHash, ContextDev::BrandRetrieveParams::Body::ByTransaction::OrHash ), request_options: ContextDev::RequestOptions::OrHash @@ -54,6 +56,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName, ContextDev::BrandRetrieveParams::Body::ByEmail, ContextDev::BrandRetrieveParams::Body::ByTicker, + ContextDev::BrandRetrieveParams::Body::ByDirectURL, ContextDev::BrandRetrieveParams::Body::ByTransaction ), request_options: ContextDev::RequestOptions @@ -74,6 +77,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName, ContextDev::BrandRetrieveParams::Body::ByEmail, ContextDev::BrandRetrieveParams::Body::ByTicker, + ContextDev::BrandRetrieveParams::Body::ByDirectURL, ContextDev::BrandRetrieveParams::Body::ByTransaction ) end @@ -3054,6 +3058,69 @@ module ContextDev end end + class ByDirectURL < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::BrandRetrieveParams::Body::ByDirectURL, + ContextDev::Internal::AnyHash + ) + end + + # Full http(s) URL to fetch brand data from (e.g., + # 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire + # internet. + sig { returns(String) } + attr_accessor :direct_url + + # Discriminator for direct-URL-based brand retrieval. + sig { returns(Symbol) } + attr_accessor :type + + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + + # 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. + sig do + params( + direct_url: String, + timeout_ms: Integer, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Full http(s) URL to fetch brand data from (e.g., + # 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire + # internet. + direct_url:, + # Optional timeout in milliseconds for the request. If the request takes longer + # than this value, it will be aborted with a 408 status code. Maximum allowed + # value is 300000ms (5 minutes). + timeout_ms: nil, + # Discriminator for direct-URL-based brand retrieval. + type: :by_direct_url + ) + end + + sig do + override.returns( + { direct_url: String, type: Symbol, timeout_ms: Integer } + ) + end + def to_hash + end + end + class ByTransaction < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/context_dev/resources/brand.rbi b/rbi/context_dev/resources/brand.rbi index dd150a50..d4e653e1 100644 --- a/rbi/context_dev/resources/brand.rbi +++ b/rbi/context_dev/resources/brand.rbi @@ -5,7 +5,9 @@ module ContextDev class Brand # Retrieve logos, backdrops, colors, industry, description, and more. Provide # exactly one lookup identifier in the request body: a domain, company name, email - # address, stock ticker, or transaction descriptor. + # address, stock ticker, transaction descriptor, or direct URL. Note: + # `by_direct_url` fetches brand data only from the provided URL — not from the + # entire internet. sig do params( body: @@ -14,6 +16,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName::OrHash, ContextDev::BrandRetrieveParams::Body::ByEmail::OrHash, ContextDev::BrandRetrieveParams::Body::ByTicker::OrHash, + ContextDev::BrandRetrieveParams::Body::ByDirectURL::OrHash, ContextDev::BrandRetrieveParams::Body::ByTransaction::OrHash ), request_options: ContextDev::RequestOptions::OrHash diff --git a/sig/context_dev/models/brand_retrieve_params.rbs b/sig/context_dev/models/brand_retrieve_params.rbs index 20131a52..0316a417 100644 --- a/sig/context_dev/models/brand_retrieve_params.rbs +++ b/sig/context_dev/models/brand_retrieve_params.rbs @@ -25,6 +25,7 @@ module ContextDev | ContextDev::BrandRetrieveParams::Body::ByName | ContextDev::BrandRetrieveParams::Body::ByEmail | ContextDev::BrandRetrieveParams::Body::ByTicker + | ContextDev::BrandRetrieveParams::Body::ByDirectURL | ContextDev::BrandRetrieveParams::Body::ByTransaction module Body @@ -1248,6 +1249,31 @@ module ContextDev end end + type by_direct_url = + { direct_url: String, type: :by_direct_url, timeout_ms: Integer } + + class ByDirectURL < ContextDev::Internal::Type::BaseModel + attr_accessor direct_url: String + + attr_accessor type: :by_direct_url + + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + + def initialize: ( + direct_url: String, + ?timeout_ms: Integer, + ?type: :by_direct_url + ) -> void + + def to_hash: -> { + direct_url: String, + type: :by_direct_url, + timeout_ms: Integer + } + end + type by_transaction = { transaction_info: String, From cd5b8725dcd7fb06d7bd684aa4ce11b81ca4409a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 00:36:21 +0000 Subject: [PATCH 3/5] feat(api): api update --- .stats.yml | 4 +- .../models/monitor_create_params.rb | 34 +++++++------- .../models/monitor_create_response.rb | 34 +++++++------- lib/context_dev/models/monitor_list_params.rb | 8 ++-- .../models/monitor_list_response.rb | 34 +++++++------- .../monitor_retrieve_change_response.rb | 9 +--- .../models/monitor_retrieve_response.rb | 34 +++++++------- .../models/monitor_update_params.rb | 34 +++++++------- .../models/monitor_update_response.rb | 34 +++++++------- lib/context_dev/resources/monitors.rb | 2 +- .../models/monitor_create_params.rbi | 44 +++++++++---------- .../models/monitor_create_response.rbi | 44 +++++++++---------- .../models/monitor_list_params.rbi | 15 ++++--- .../models/monitor_list_response.rbi | 44 +++++++++---------- .../monitor_retrieve_change_response.rbi | 9 ---- .../models/monitor_retrieve_response.rbi | 44 +++++++++---------- .../models/monitor_update_params.rbi | 44 +++++++++---------- .../models/monitor_update_response.rbi | 44 +++++++++---------- rbi/context_dev/resources/monitors.rbi | 4 +- .../models/monitor_create_params.rbs | 24 +++------- .../models/monitor_create_response.rbs | 24 +++------- .../models/monitor_list_params.rbs | 4 +- .../models/monitor_list_response.rbs | 24 +++------- .../monitor_retrieve_change_response.rbs | 7 --- .../models/monitor_retrieve_response.rbs | 24 +++------- .../models/monitor_update_params.rbs | 24 +++------- .../models/monitor_update_response.rbs | 24 +++------- test/context_dev/resources/monitors_test.rb | 1 - 28 files changed, 279 insertions(+), 396 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5321a028..085d46dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fa5c7cd62da1c7cb2eddf8c6bb1f32ca7f958be5c3c315ade6ca0a669814d75a.yml -openapi_spec_hash: 8358c1a467ab971afd59d615d1e731ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b075e5704110b3c03bd81b41f62b836d7624eceed7feb0ac63720dec9a4cbba4.yml +openapi_spec_hash: 5efb926e6e99163e3e42a98986da8335 config_hash: ff35e224e809656528c44163aa41bebd diff --git a/lib/context_dev/models/monitor_create_params.rb b/lib/context_dev/models/monitor_create_params.rb index fe1368b1..b6cf87e1 100644 --- a/lib/context_dev/models/monitor_create_params.rb +++ b/lib/context_dev/models/monitor_create_params.rb @@ -79,7 +79,7 @@ module ChangeDetection # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. variant :exact, -> { ContextDev::MonitorCreateParams::ChangeDetection::Exact } - # Detect meaning-level changes that match a natural language query. + # 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`. variant :semantic, -> { ContextDev::MonitorCreateParams::ChangeDetection::Semantic } class Exact < ContextDev::Internal::Type::BaseModel @@ -96,11 +96,6 @@ class Exact < ContextDev::Internal::Type::BaseModel end class Semantic < ContextDev::Internal::Type::BaseModel - # @!attribute query - # - # @return [String] - required :query, String - # @!attribute type # # @return [Symbol, :semantic] @@ -111,10 +106,11 @@ class Semantic < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :confidence_threshold, Float - # @!method initialize(query:, confidence_threshold: nil, type: :semantic) - # Detect meaning-level changes that match a natural language query. + # @!method initialize(confidence_threshold: nil, type: :semantic) + # 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`. # - # @param query [String] # @param confidence_threshold [Float] # @param type [Symbol, :semantic] end @@ -269,6 +265,14 @@ class Sitemap < ContextDev::Internal::Type::BaseModel end class Extract < ContextDev::Internal::Type::BaseModel + # @!attribute instructions + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + # + # @return [String] + required :instructions, String + # @!attribute type # # @return [Symbol, :extract] @@ -285,12 +289,6 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :follow_subdomains, ContextDev::Internal::Type::Boolean - # @!attribute instructions - # Optional natural-language instructions guiding what to extract. - # - # @return [String, nil] - optional :instructions, String - # @!attribute max_depth # Optional maximum link depth from the starting URL (0 = only the starting page). # @@ -310,18 +308,18 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) + # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorCreateParams::Target::Extract} for more details. # # Watch a site's extracted structured data. # + # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # # @param url [String] Root URL to extract structured data from. # # @param follow_subdomains [Boolean] # - # @param instructions [String] Optional natural-language instructions guiding what to extract. - # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # # @param max_pages [Integer] Maximum number of pages to analyze during extraction. diff --git a/lib/context_dev/models/monitor_create_response.rb b/lib/context_dev/models/monitor_create_response.rb index 20d4bbe8..daff1f41 100644 --- a/lib/context_dev/models/monitor_create_response.rb +++ b/lib/context_dev/models/monitor_create_response.rb @@ -153,7 +153,7 @@ module ChangeDetection # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. variant :exact, -> { ContextDev::Models::MonitorCreateResponse::ChangeDetection::Exact } - # Detect meaning-level changes that match a natural language query. + # 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`. variant :semantic, -> { ContextDev::Models::MonitorCreateResponse::ChangeDetection::Semantic } class Exact < ContextDev::Internal::Type::BaseModel @@ -170,11 +170,6 @@ class Exact < ContextDev::Internal::Type::BaseModel end class Semantic < ContextDev::Internal::Type::BaseModel - # @!attribute query - # - # @return [String] - required :query, String - # @!attribute type # # @return [Symbol, :semantic] @@ -185,10 +180,11 @@ class Semantic < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :confidence_threshold, Float - # @!method initialize(query:, confidence_threshold: nil, type: :semantic) - # Detect meaning-level changes that match a natural language query. + # @!method initialize(confidence_threshold: nil, type: :semantic) + # 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`. # - # @param query [String] # @param confidence_threshold [Float] # @param type [Symbol, :semantic] end @@ -377,6 +373,14 @@ class Sitemap < ContextDev::Internal::Type::BaseModel end class Extract < ContextDev::Internal::Type::BaseModel + # @!attribute instructions + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + # + # @return [String] + required :instructions, String + # @!attribute type # # @return [Symbol, :extract] @@ -393,12 +397,6 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :follow_subdomains, ContextDev::Internal::Type::Boolean - # @!attribute instructions - # Optional natural-language instructions guiding what to extract. - # - # @return [String, nil] - optional :instructions, String - # @!attribute max_depth # Optional maximum link depth from the starting URL (0 = only the starting page). # @@ -418,18 +416,18 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) + # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorCreateResponse::Target::Extract} for more details. # # Watch a site's extracted structured data. # + # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # # @param url [String] Root URL to extract structured data from. # # @param follow_subdomains [Boolean] # - # @param instructions [String] Optional natural-language instructions guiding what to extract. - # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # # @param max_pages [Integer] Maximum number of pages to analyze during extraction. diff --git a/lib/context_dev/models/monitor_list_params.rb b/lib/context_dev/models/monitor_list_params.rb index b4ff363f..079222c3 100644 --- a/lib/context_dev/models/monitor_list_params.rb +++ b/lib/context_dev/models/monitor_list_params.rb @@ -29,8 +29,8 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel optional :q, String # @!attribute search_by - # Comma-separated fields to search with `q`. Defaults to all of them. Note `query` - # only exists on semantic monitors. + # Comma-separated fields to search with `q`. Defaults to all of them. Note + # `instructions` only exists on extract monitors. # # @return [Array, nil] optional :search_by, @@ -82,7 +82,7 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel # # @param q [String] Free-text search term, matched against the fields named in `search_by`. # - # @param search_by [Array] Comma-separated fields to search with `q`. Defaults to all of them. Note `query` + # @param search_by [Array] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru # # @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match # @@ -111,7 +111,7 @@ module SearchBy NAME = :name URL = :url - QUERY = :query + INSTRUCTIONS = :instructions TAGS = :tags # @!method self.values diff --git a/lib/context_dev/models/monitor_list_response.rb b/lib/context_dev/models/monitor_list_response.rb index 9b62a4db..1c7eb174 100644 --- a/lib/context_dev/models/monitor_list_response.rb +++ b/lib/context_dev/models/monitor_list_response.rb @@ -174,7 +174,7 @@ module ChangeDetection # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. variant :exact, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact } - # Detect meaning-level changes that match a natural language query. + # 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`. variant :semantic, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic } class Exact < ContextDev::Internal::Type::BaseModel @@ -191,11 +191,6 @@ class Exact < ContextDev::Internal::Type::BaseModel end class Semantic < ContextDev::Internal::Type::BaseModel - # @!attribute query - # - # @return [String] - required :query, String - # @!attribute type # # @return [Symbol, :semantic] @@ -206,10 +201,11 @@ class Semantic < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :confidence_threshold, Float - # @!method initialize(query:, confidence_threshold: nil, type: :semantic) - # Detect meaning-level changes that match a natural language query. + # @!method initialize(confidence_threshold: nil, type: :semantic) + # 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`. # - # @param query [String] # @param confidence_threshold [Float] # @param type [Symbol, :semantic] end @@ -398,6 +394,14 @@ class Sitemap < ContextDev::Internal::Type::BaseModel end class Extract < ContextDev::Internal::Type::BaseModel + # @!attribute instructions + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + # + # @return [String] + required :instructions, String + # @!attribute type # # @return [Symbol, :extract] @@ -414,12 +418,6 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :follow_subdomains, ContextDev::Internal::Type::Boolean - # @!attribute instructions - # Optional natural-language instructions guiding what to extract. - # - # @return [String, nil] - optional :instructions, String - # @!attribute max_depth # Optional maximum link depth from the starting URL (0 = only the starting page). # @@ -439,19 +437,19 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) + # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorListResponse::Data::Target::Extract} for more # details. # # Watch a site's extracted structured data. # + # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # # @param url [String] Root URL to extract structured data from. # # @param follow_subdomains [Boolean] # - # @param instructions [String] Optional natural-language instructions guiding what to extract. - # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # # @param max_pages [Integer] Maximum number of pages to analyze during extraction. diff --git a/lib/context_dev/models/monitor_retrieve_change_response.rb b/lib/context_dev/models/monitor_retrieve_change_response.rb index e4dbfc97..36a71cb2 100644 --- a/lib/context_dev/models/monitor_retrieve_change_response.rb +++ b/lib/context_dev/models/monitor_retrieve_change_response.rb @@ -112,11 +112,6 @@ class MonitorRetrieveChangeResponse < ContextDev::Internal::Type::BaseModel # @return [Array, nil] optional :matched_urls, ContextDev::Internal::Type::ArrayOf[String] - # @!attribute query - # - # @return [String, nil] - optional :query, String - # @!attribute removed_url_count # # @return [Integer, nil] @@ -134,7 +129,7 @@ class MonitorRetrieveChangeResponse < ContextDev::Internal::Type::BaseModel # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] - # @!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, query: nil, removed_url_count: nil, removed_urls: nil, tags: nil) + # @!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) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorRetrieveChangeResponse} for more details. # @@ -184,8 +179,6 @@ class MonitorRetrieveChangeResponse < ContextDev::Internal::Type::BaseModel # # @param matched_urls [Array] At most 500 URLs are included; the corresponding count field is always exact. # - # @param query [String] - # # @param removed_url_count [Integer] # # @param removed_urls [Array] At most 500 URLs are included; the corresponding count field is always exact. diff --git a/lib/context_dev/models/monitor_retrieve_response.rb b/lib/context_dev/models/monitor_retrieve_response.rb index 74a6a053..d5230450 100644 --- a/lib/context_dev/models/monitor_retrieve_response.rb +++ b/lib/context_dev/models/monitor_retrieve_response.rb @@ -153,7 +153,7 @@ module ChangeDetection # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. variant :exact, -> { ContextDev::Models::MonitorRetrieveResponse::ChangeDetection::Exact } - # Detect meaning-level changes that match a natural language query. + # 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`. variant :semantic, -> { ContextDev::Models::MonitorRetrieveResponse::ChangeDetection::Semantic } class Exact < ContextDev::Internal::Type::BaseModel @@ -170,11 +170,6 @@ class Exact < ContextDev::Internal::Type::BaseModel end class Semantic < ContextDev::Internal::Type::BaseModel - # @!attribute query - # - # @return [String] - required :query, String - # @!attribute type # # @return [Symbol, :semantic] @@ -185,10 +180,11 @@ class Semantic < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :confidence_threshold, Float - # @!method initialize(query:, confidence_threshold: nil, type: :semantic) - # Detect meaning-level changes that match a natural language query. + # @!method initialize(confidence_threshold: nil, type: :semantic) + # 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`. # - # @param query [String] # @param confidence_threshold [Float] # @param type [Symbol, :semantic] end @@ -377,6 +373,14 @@ class Sitemap < ContextDev::Internal::Type::BaseModel end class Extract < ContextDev::Internal::Type::BaseModel + # @!attribute instructions + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + # + # @return [String] + required :instructions, String + # @!attribute type # # @return [Symbol, :extract] @@ -393,12 +397,6 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :follow_subdomains, ContextDev::Internal::Type::Boolean - # @!attribute instructions - # Optional natural-language instructions guiding what to extract. - # - # @return [String, nil] - optional :instructions, String - # @!attribute max_depth # Optional maximum link depth from the starting URL (0 = only the starting page). # @@ -418,18 +416,18 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) + # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorRetrieveResponse::Target::Extract} for more details. # # Watch a site's extracted structured data. # + # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # # @param url [String] Root URL to extract structured data from. # # @param follow_subdomains [Boolean] # - # @param instructions [String] Optional natural-language instructions guiding what to extract. - # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # # @param max_pages [Integer] Maximum number of pages to analyze during extraction. diff --git a/lib/context_dev/models/monitor_update_params.rb b/lib/context_dev/models/monitor_update_params.rb index 43d89578..817892a2 100644 --- a/lib/context_dev/models/monitor_update_params.rb +++ b/lib/context_dev/models/monitor_update_params.rb @@ -85,7 +85,7 @@ module ChangeDetection # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. variant :exact, -> { ContextDev::MonitorUpdateParams::ChangeDetection::Exact } - # Detect meaning-level changes that match a natural language query. + # 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`. variant :semantic, -> { ContextDev::MonitorUpdateParams::ChangeDetection::Semantic } class Exact < ContextDev::Internal::Type::BaseModel @@ -102,11 +102,6 @@ class Exact < ContextDev::Internal::Type::BaseModel end class Semantic < ContextDev::Internal::Type::BaseModel - # @!attribute query - # - # @return [String] - required :query, String - # @!attribute type # # @return [Symbol, :semantic] @@ -117,10 +112,11 @@ class Semantic < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :confidence_threshold, Float - # @!method initialize(query:, confidence_threshold: nil, type: :semantic) - # Detect meaning-level changes that match a natural language query. + # @!method initialize(confidence_threshold: nil, type: :semantic) + # 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`. # - # @param query [String] # @param confidence_threshold [Float] # @param type [Symbol, :semantic] end @@ -285,6 +281,14 @@ class Sitemap < ContextDev::Internal::Type::BaseModel end class Extract < ContextDev::Internal::Type::BaseModel + # @!attribute instructions + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + # + # @return [String] + required :instructions, String + # @!attribute type # # @return [Symbol, :extract] @@ -301,12 +305,6 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :follow_subdomains, ContextDev::Internal::Type::Boolean - # @!attribute instructions - # Optional natural-language instructions guiding what to extract. - # - # @return [String, nil] - optional :instructions, String - # @!attribute max_depth # Optional maximum link depth from the starting URL (0 = only the starting page). # @@ -326,18 +324,18 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) + # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorUpdateParams::Target::Extract} for more details. # # Watch a site's extracted structured data. # + # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # # @param url [String] Root URL to extract structured data from. # # @param follow_subdomains [Boolean] # - # @param instructions [String] Optional natural-language instructions guiding what to extract. - # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # # @param max_pages [Integer] Maximum number of pages to analyze during extraction. diff --git a/lib/context_dev/models/monitor_update_response.rb b/lib/context_dev/models/monitor_update_response.rb index 40196467..941c4196 100644 --- a/lib/context_dev/models/monitor_update_response.rb +++ b/lib/context_dev/models/monitor_update_response.rb @@ -153,7 +153,7 @@ module ChangeDetection # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals. variant :exact, -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Exact } - # Detect meaning-level changes that match a natural language query. + # 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`. variant :semantic, -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Semantic } class Exact < ContextDev::Internal::Type::BaseModel @@ -170,11 +170,6 @@ class Exact < ContextDev::Internal::Type::BaseModel end class Semantic < ContextDev::Internal::Type::BaseModel - # @!attribute query - # - # @return [String] - required :query, String - # @!attribute type # # @return [Symbol, :semantic] @@ -185,10 +180,11 @@ class Semantic < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :confidence_threshold, Float - # @!method initialize(query:, confidence_threshold: nil, type: :semantic) - # Detect meaning-level changes that match a natural language query. + # @!method initialize(confidence_threshold: nil, type: :semantic) + # 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`. # - # @param query [String] # @param confidence_threshold [Float] # @param type [Symbol, :semantic] end @@ -377,6 +373,14 @@ class Sitemap < ContextDev::Internal::Type::BaseModel end class Extract < ContextDev::Internal::Type::BaseModel + # @!attribute instructions + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + # + # @return [String] + required :instructions, String + # @!attribute type # # @return [Symbol, :extract] @@ -393,12 +397,6 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :follow_subdomains, ContextDev::Internal::Type::Boolean - # @!attribute instructions - # Optional natural-language instructions guiding what to extract. - # - # @return [String, nil] - optional :instructions, String - # @!attribute max_depth # Optional maximum link depth from the starting URL (0 = only the starting page). # @@ -418,18 +416,18 @@ class Extract < ContextDev::Internal::Type::BaseModel # @return [Hash{Symbol=>Object}, nil] optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown] - # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) + # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorUpdateResponse::Target::Extract} for more details. # # Watch a site's extracted structured data. # + # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # # @param url [String] Root URL to extract structured data from. # # @param follow_subdomains [Boolean] # - # @param instructions [String] Optional natural-language instructions guiding what to extract. - # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # # @param max_pages [Integer] Maximum number of pages to analyze during extraction. diff --git a/lib/context_dev/resources/monitors.rb b/lib/context_dev/resources/monitors.rb index 73fa1761..baaab6e9 100644 --- a/lib/context_dev/resources/monitors.rb +++ b/lib/context_dev/resources/monitors.rb @@ -122,7 +122,7 @@ def update(monitor_id, params = {}) # # @param q [String] Free-text search term, matched against the fields named in `search_by`. # - # @param search_by [Array] Comma-separated fields to search with `q`. Defaults to all of them. Note `query` + # @param search_by [Array] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru # # @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match # diff --git a/rbi/context_dev/models/monitor_create_params.rbi b/rbi/context_dev/models/monitor_create_params.rbi index ce117cfd..35c10f19 100644 --- a/rbi/context_dev/models/monitor_create_params.rbi +++ b/rbi/context_dev/models/monitor_create_params.rbi @@ -186,9 +186,6 @@ module ContextDev ) end - sig { returns(String) } - attr_accessor :query - sig { returns(Symbol) } attr_accessor :type @@ -198,21 +195,19 @@ module ContextDev sig { params(confidence_threshold: Float).void } attr_writer :confidence_threshold - # Detect meaning-level changes that match a natural language query. + # 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`. sig do - params( - query: String, - confidence_threshold: Float, - type: Symbol - ).returns(T.attached_class) + params(confidence_threshold: Float, type: Symbol).returns( + T.attached_class + ) end - def self.new(query:, confidence_threshold: nil, type: :semantic) + def self.new(confidence_threshold: nil, type: :semantic) end sig do - override.returns( - { query: String, type: Symbol, confidence_threshold: Float } - ) + override.returns({ type: Symbol, confidence_threshold: Float }) end def to_hash end @@ -494,6 +489,12 @@ module ContextDev ) end + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + sig { returns(String) } + attr_accessor :instructions + sig { returns(Symbol) } attr_accessor :type @@ -507,13 +508,6 @@ module ContextDev sig { params(follow_subdomains: T::Boolean).void } attr_writer :follow_subdomains - # Optional natural-language instructions guiding what to extract. - sig { returns(T.nilable(String)) } - attr_reader :instructions - - sig { params(instructions: String).void } - attr_writer :instructions - # Optional maximum link depth from the starting URL (0 = only the starting page). sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -539,9 +533,9 @@ module ContextDev # Watch a site's extracted structured data. sig do params( + instructions: String, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything], @@ -549,11 +543,13 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, - # Optional natural-language instructions guiding what to extract. - instructions: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, # Maximum number of pages to analyze during extraction. @@ -568,10 +564,10 @@ module ContextDev sig do override.returns( { + instructions: String, type: Symbol, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything] diff --git a/rbi/context_dev/models/monitor_create_response.rbi b/rbi/context_dev/models/monitor_create_response.rbi index 6367b337..f776c4c2 100644 --- a/rbi/context_dev/models/monitor_create_response.rbi +++ b/rbi/context_dev/models/monitor_create_response.rbi @@ -287,9 +287,6 @@ module ContextDev ) end - sig { returns(String) } - attr_accessor :query - sig { returns(Symbol) } attr_accessor :type @@ -299,21 +296,19 @@ module ContextDev sig { params(confidence_threshold: Float).void } attr_writer :confidence_threshold - # Detect meaning-level changes that match a natural language query. + # 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`. sig do - params( - query: String, - confidence_threshold: Float, - type: Symbol - ).returns(T.attached_class) + params(confidence_threshold: Float, type: Symbol).returns( + T.attached_class + ) end - def self.new(query:, confidence_threshold: nil, type: :semantic) + def self.new(confidence_threshold: nil, type: :semantic) end sig do - override.returns( - { query: String, type: Symbol, confidence_threshold: Float } - ) + override.returns({ type: Symbol, confidence_threshold: Float }) end def to_hash end @@ -680,6 +675,12 @@ module ContextDev ) end + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + sig { returns(String) } + attr_accessor :instructions + sig { returns(Symbol) } attr_accessor :type @@ -693,13 +694,6 @@ module ContextDev sig { params(follow_subdomains: T::Boolean).void } attr_writer :follow_subdomains - # Optional natural-language instructions guiding what to extract. - sig { returns(T.nilable(String)) } - attr_reader :instructions - - sig { params(instructions: String).void } - attr_writer :instructions - # Optional maximum link depth from the starting URL (0 = only the starting page). sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -725,9 +719,9 @@ module ContextDev # Watch a site's extracted structured data. sig do params( + instructions: String, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything], @@ -735,11 +729,13 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, - # Optional natural-language instructions guiding what to extract. - instructions: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, # Maximum number of pages to analyze during extraction. @@ -754,10 +750,10 @@ module ContextDev sig do override.returns( { + instructions: String, type: Symbol, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything] diff --git a/rbi/context_dev/models/monitor_list_params.rbi b/rbi/context_dev/models/monitor_list_params.rbi index 717f5260..dfabf2cf 100644 --- a/rbi/context_dev/models/monitor_list_params.rbi +++ b/rbi/context_dev/models/monitor_list_params.rbi @@ -47,8 +47,8 @@ module ContextDev sig { params(q: String).void } attr_writer :q - # Comma-separated fields to search with `q`. Defaults to all of them. Note `query` - # only exists on semantic monitors. + # Comma-separated fields to search with `q`. Defaults to all of them. Note + # `instructions` only exists on extract monitors. sig do returns( T.nilable(T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol]) @@ -141,8 +141,8 @@ module ContextDev limit: nil, # Free-text search term, matched against the fields named in `search_by`. q: nil, - # Comma-separated fields to search with `q`. Defaults to all of them. Note `query` - # only exists on semantic monitors. + # Comma-separated fields to search with `q`. Defaults to all of them. Note + # `instructions` only exists on extract monitors. search_by: nil, # `prefix` for as-you-type prefix matching (default), `exact` for full-token # matching. @@ -227,8 +227,11 @@ module ContextDev NAME = T.let(:name, ContextDev::MonitorListParams::SearchBy::TaggedSymbol) URL = T.let(:url, ContextDev::MonitorListParams::SearchBy::TaggedSymbol) - QUERY = - T.let(:query, ContextDev::MonitorListParams::SearchBy::TaggedSymbol) + INSTRUCTIONS = + T.let( + :instructions, + ContextDev::MonitorListParams::SearchBy::TaggedSymbol + ) TAGS = T.let(:tags, ContextDev::MonitorListParams::SearchBy::TaggedSymbol) diff --git a/rbi/context_dev/models/monitor_list_response.rbi b/rbi/context_dev/models/monitor_list_response.rbi index 6021b632..d55d6e1c 100644 --- a/rbi/context_dev/models/monitor_list_response.rbi +++ b/rbi/context_dev/models/monitor_list_response.rbi @@ -346,9 +346,6 @@ module ContextDev ) end - sig { returns(String) } - attr_accessor :query - sig { returns(Symbol) } attr_accessor :type @@ -358,21 +355,19 @@ module ContextDev sig { params(confidence_threshold: Float).void } attr_writer :confidence_threshold - # Detect meaning-level changes that match a natural language query. + # 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`. sig do - params( - query: String, - confidence_threshold: Float, - type: Symbol - ).returns(T.attached_class) + params(confidence_threshold: Float, type: Symbol).returns( + T.attached_class + ) end - def self.new(query:, confidence_threshold: nil, type: :semantic) + def self.new(confidence_threshold: nil, type: :semantic) end sig do - override.returns( - { query: String, type: Symbol, confidence_threshold: Float } - ) + override.returns({ type: Symbol, confidence_threshold: Float }) end def to_hash end @@ -742,6 +737,12 @@ module ContextDev ) end + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + sig { returns(String) } + attr_accessor :instructions + sig { returns(Symbol) } attr_accessor :type @@ -755,13 +756,6 @@ module ContextDev sig { params(follow_subdomains: T::Boolean).void } attr_writer :follow_subdomains - # Optional natural-language instructions guiding what to extract. - sig { returns(T.nilable(String)) } - attr_reader :instructions - - sig { params(instructions: String).void } - attr_writer :instructions - # Optional maximum link depth from the starting URL (0 = only the starting page). sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -787,9 +781,9 @@ module ContextDev # Watch a site's extracted structured data. sig do params( + instructions: String, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything], @@ -797,11 +791,13 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, - # Optional natural-language instructions guiding what to extract. - instructions: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, # Maximum number of pages to analyze during extraction. @@ -816,10 +812,10 @@ module ContextDev sig do override.returns( { + instructions: String, type: Symbol, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything] diff --git a/rbi/context_dev/models/monitor_retrieve_change_response.rbi b/rbi/context_dev/models/monitor_retrieve_change_response.rbi index a3bb1177..cfa48154 100644 --- a/rbi/context_dev/models/monitor_retrieve_change_response.rbi +++ b/rbi/context_dev/models/monitor_retrieve_change_response.rbi @@ -145,12 +145,6 @@ module ContextDev sig { params(matched_urls: T::Array[String]).void } attr_writer :matched_urls - sig { returns(T.nilable(String)) } - attr_reader :query - - sig { params(query: String).void } - attr_writer :query - sig { returns(T.nilable(Integer)) } attr_reader :removed_url_count @@ -205,7 +199,6 @@ module ContextDev ContextDev::Models::MonitorRetrieveChangeResponse::Importance::OrSymbol, matched_url_count: Integer, matched_urls: T::Array[String], - query: String, removed_url_count: Integer, removed_urls: T::Array[String], tags: T::Array[String] @@ -238,7 +231,6 @@ module ContextDev matched_url_count: nil, # At most 500 URLs are included; the corresponding count field is always exact. matched_urls: nil, - query: nil, removed_url_count: nil, # At most 500 URLs are included; the corresponding count field is always exact. removed_urls: nil, @@ -277,7 +269,6 @@ module ContextDev ContextDev::Models::MonitorRetrieveChangeResponse::Importance::TaggedSymbol, matched_url_count: Integer, matched_urls: T::Array[String], - query: String, removed_url_count: Integer, removed_urls: T::Array[String], tags: T::Array[String] diff --git a/rbi/context_dev/models/monitor_retrieve_response.rbi b/rbi/context_dev/models/monitor_retrieve_response.rbi index ff2fbbec..f38e8da2 100644 --- a/rbi/context_dev/models/monitor_retrieve_response.rbi +++ b/rbi/context_dev/models/monitor_retrieve_response.rbi @@ -295,9 +295,6 @@ module ContextDev ) end - sig { returns(String) } - attr_accessor :query - sig { returns(Symbol) } attr_accessor :type @@ -307,21 +304,19 @@ module ContextDev sig { params(confidence_threshold: Float).void } attr_writer :confidence_threshold - # Detect meaning-level changes that match a natural language query. + # 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`. sig do - params( - query: String, - confidence_threshold: Float, - type: Symbol - ).returns(T.attached_class) + params(confidence_threshold: Float, type: Symbol).returns( + T.attached_class + ) end - def self.new(query:, confidence_threshold: nil, type: :semantic) + def self.new(confidence_threshold: nil, type: :semantic) end sig do - override.returns( - { query: String, type: Symbol, confidence_threshold: Float } - ) + override.returns({ type: Symbol, confidence_threshold: Float }) end def to_hash end @@ -688,6 +683,12 @@ module ContextDev ) end + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + sig { returns(String) } + attr_accessor :instructions + sig { returns(Symbol) } attr_accessor :type @@ -701,13 +702,6 @@ module ContextDev sig { params(follow_subdomains: T::Boolean).void } attr_writer :follow_subdomains - # Optional natural-language instructions guiding what to extract. - sig { returns(T.nilable(String)) } - attr_reader :instructions - - sig { params(instructions: String).void } - attr_writer :instructions - # Optional maximum link depth from the starting URL (0 = only the starting page). sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -733,9 +727,9 @@ module ContextDev # Watch a site's extracted structured data. sig do params( + instructions: String, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything], @@ -743,11 +737,13 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, - # Optional natural-language instructions guiding what to extract. - instructions: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, # Maximum number of pages to analyze during extraction. @@ -762,10 +758,10 @@ module ContextDev sig do override.returns( { + instructions: String, type: Symbol, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything] diff --git a/rbi/context_dev/models/monitor_update_params.rbi b/rbi/context_dev/models/monitor_update_params.rbi index 395c2703..13e795cd 100644 --- a/rbi/context_dev/models/monitor_update_params.rbi +++ b/rbi/context_dev/models/monitor_update_params.rbi @@ -222,9 +222,6 @@ module ContextDev ) end - sig { returns(String) } - attr_accessor :query - sig { returns(Symbol) } attr_accessor :type @@ -234,21 +231,19 @@ module ContextDev sig { params(confidence_threshold: Float).void } attr_writer :confidence_threshold - # Detect meaning-level changes that match a natural language query. + # 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`. sig do - params( - query: String, - confidence_threshold: Float, - type: Symbol - ).returns(T.attached_class) + params(confidence_threshold: Float, type: Symbol).returns( + T.attached_class + ) end - def self.new(query:, confidence_threshold: nil, type: :semantic) + def self.new(confidence_threshold: nil, type: :semantic) end sig do - override.returns( - { query: String, type: Symbol, confidence_threshold: Float } - ) + override.returns({ type: Symbol, confidence_threshold: Float }) end def to_hash end @@ -553,6 +548,12 @@ module ContextDev ) end + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + sig { returns(String) } + attr_accessor :instructions + sig { returns(Symbol) } attr_accessor :type @@ -566,13 +567,6 @@ module ContextDev sig { params(follow_subdomains: T::Boolean).void } attr_writer :follow_subdomains - # Optional natural-language instructions guiding what to extract. - sig { returns(T.nilable(String)) } - attr_reader :instructions - - sig { params(instructions: String).void } - attr_writer :instructions - # Optional maximum link depth from the starting URL (0 = only the starting page). sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -598,9 +592,9 @@ module ContextDev # Watch a site's extracted structured data. sig do params( + instructions: String, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything], @@ -608,11 +602,13 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, - # Optional natural-language instructions guiding what to extract. - instructions: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, # Maximum number of pages to analyze during extraction. @@ -627,10 +623,10 @@ module ContextDev sig do override.returns( { + instructions: String, type: Symbol, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything] diff --git a/rbi/context_dev/models/monitor_update_response.rbi b/rbi/context_dev/models/monitor_update_response.rbi index 98adaff9..462ebdfe 100644 --- a/rbi/context_dev/models/monitor_update_response.rbi +++ b/rbi/context_dev/models/monitor_update_response.rbi @@ -287,9 +287,6 @@ module ContextDev ) end - sig { returns(String) } - attr_accessor :query - sig { returns(Symbol) } attr_accessor :type @@ -299,21 +296,19 @@ module ContextDev sig { params(confidence_threshold: Float).void } attr_writer :confidence_threshold - # Detect meaning-level changes that match a natural language query. + # 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`. sig do - params( - query: String, - confidence_threshold: Float, - type: Symbol - ).returns(T.attached_class) + params(confidence_threshold: Float, type: Symbol).returns( + T.attached_class + ) end - def self.new(query:, confidence_threshold: nil, type: :semantic) + def self.new(confidence_threshold: nil, type: :semantic) end sig do - override.returns( - { query: String, type: Symbol, confidence_threshold: Float } - ) + override.returns({ type: Symbol, confidence_threshold: Float }) end def to_hash end @@ -680,6 +675,12 @@ module ContextDev ) end + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + sig { returns(String) } + attr_accessor :instructions + sig { returns(Symbol) } attr_accessor :type @@ -693,13 +694,6 @@ module ContextDev sig { params(follow_subdomains: T::Boolean).void } attr_writer :follow_subdomains - # Optional natural-language instructions guiding what to extract. - sig { returns(T.nilable(String)) } - attr_reader :instructions - - sig { params(instructions: String).void } - attr_writer :instructions - # Optional maximum link depth from the starting URL (0 = only the starting page). sig { returns(T.nilable(Integer)) } attr_reader :max_depth @@ -725,9 +719,9 @@ module ContextDev # Watch a site's extracted structured data. sig do params( + instructions: String, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything], @@ -735,11 +729,13 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Natural-language instructions describing what to extract and watch. This single + # prompt scopes both the extraction and what changes get reported: only data + # captured by the schema and these instructions is compared between runs. + instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, - # Optional natural-language instructions guiding what to extract. - instructions: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, # Maximum number of pages to analyze during extraction. @@ -754,10 +750,10 @@ module ContextDev sig do override.returns( { + instructions: String, type: Symbol, url: String, follow_subdomains: T::Boolean, - instructions: String, max_depth: Integer, max_pages: Integer, schema: T::Hash[Symbol, T.anything] diff --git a/rbi/context_dev/resources/monitors.rbi b/rbi/context_dev/resources/monitors.rbi index 0485be14..92b6b8bd 100644 --- a/rbi/context_dev/resources/monitors.rbi +++ b/rbi/context_dev/resources/monitors.rbi @@ -131,8 +131,8 @@ module ContextDev limit: nil, # Free-text search term, matched against the fields named in `search_by`. q: nil, - # Comma-separated fields to search with `q`. Defaults to all of them. Note `query` - # only exists on semantic monitors. + # Comma-separated fields to search with `q`. Defaults to all of them. Note + # `instructions` only exists on extract monitors. search_by: nil, # `prefix` for as-you-type prefix matching (default), `exact` for full-token # matching. diff --git a/sig/context_dev/models/monitor_create_params.rbs b/sig/context_dev/models/monitor_create_params.rbs index d171615b..b6e48e4e 100644 --- a/sig/context_dev/models/monitor_create_params.rbs +++ b/sig/context_dev/models/monitor_create_params.rbs @@ -75,12 +75,9 @@ module ContextDev def to_hash: -> { type: :exact } end - type semantic = - { query: String, type: :semantic, confidence_threshold: Float } + type semantic = { type: :semantic, confidence_threshold: Float } class Semantic < ContextDev::Internal::Type::BaseModel - attr_accessor query: String - attr_accessor type: :semantic attr_reader confidence_threshold: Float? @@ -88,16 +85,11 @@ module ContextDev def confidence_threshold=: (Float) -> Float def initialize: ( - query: String, ?confidence_threshold: Float, ?type: :semantic ) -> void - def to_hash: -> { - query: String, - type: :semantic, - confidence_threshold: Float - } + def to_hash: -> { type: :semantic, confidence_threshold: Float } end def self?.variants: -> ::Array[ContextDev::Models::MonitorCreateParams::change_detection] @@ -229,16 +221,18 @@ module ContextDev type extract = { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] } class Extract < ContextDev::Internal::Type::BaseModel + attr_accessor instructions: String + attr_accessor type: :extract attr_accessor url: String @@ -247,10 +241,6 @@ module ContextDev def follow_subdomains=: (bool) -> bool - attr_reader instructions: String? - - def instructions=: (String) -> String - attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -264,9 +254,9 @@ module ContextDev def schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: ( + instructions: String, url: String, ?follow_subdomains: bool, - ?instructions: String, ?max_depth: Integer, ?max_pages: Integer, ?schema: ::Hash[Symbol, top], @@ -274,10 +264,10 @@ module ContextDev ) -> void def to_hash: -> { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] diff --git a/sig/context_dev/models/monitor_create_response.rbs b/sig/context_dev/models/monitor_create_response.rbs index 4054372c..5da4f02d 100644 --- a/sig/context_dev/models/monitor_create_response.rbs +++ b/sig/context_dev/models/monitor_create_response.rbs @@ -110,12 +110,9 @@ module ContextDev def to_hash: -> { type: :exact } end - type semantic = - { query: String, type: :semantic, confidence_threshold: Float } + type semantic = { type: :semantic, confidence_threshold: Float } class Semantic < ContextDev::Internal::Type::BaseModel - attr_accessor query: String - attr_accessor type: :semantic attr_reader confidence_threshold: Float? @@ -123,16 +120,11 @@ module ContextDev def confidence_threshold=: (Float) -> Float def initialize: ( - query: String, ?confidence_threshold: Float, ?type: :semantic ) -> void - def to_hash: -> { - query: String, - type: :semantic, - confidence_threshold: Float - } + def to_hash: -> { type: :semantic, confidence_threshold: Float } end def self?.variants: -> ::Array[ContextDev::Models::MonitorCreateResponse::change_detection] @@ -286,16 +278,18 @@ module ContextDev type extract = { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] } class Extract < ContextDev::Internal::Type::BaseModel + attr_accessor instructions: String + attr_accessor type: :extract attr_accessor url: String @@ -304,10 +298,6 @@ module ContextDev def follow_subdomains=: (bool) -> bool - attr_reader instructions: String? - - def instructions=: (String) -> String - attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -321,9 +311,9 @@ module ContextDev def schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: ( + instructions: String, url: String, ?follow_subdomains: bool, - ?instructions: String, ?max_depth: Integer, ?max_pages: Integer, ?schema: ::Hash[Symbol, top], @@ -331,10 +321,10 @@ module ContextDev ) -> void def to_hash: -> { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] diff --git a/sig/context_dev/models/monitor_list_params.rbs b/sig/context_dev/models/monitor_list_params.rbs index 2e9543ec..25fc6296 100644 --- a/sig/context_dev/models/monitor_list_params.rbs +++ b/sig/context_dev/models/monitor_list_params.rbs @@ -108,14 +108,14 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::MonitorListParams::change_detection_type] end - type search_by = :name | :url | :query | :tags + type search_by = :name | :url | :instructions | :tags module SearchBy extend ContextDev::Internal::Type::Enum NAME: :name URL: :url - QUERY: :query + INSTRUCTIONS: :instructions TAGS: :tags def self?.values: -> ::Array[ContextDev::Models::MonitorListParams::search_by] diff --git a/sig/context_dev/models/monitor_list_response.rbs b/sig/context_dev/models/monitor_list_response.rbs index c53ea1c8..4a2c304a 100644 --- a/sig/context_dev/models/monitor_list_response.rbs +++ b/sig/context_dev/models/monitor_list_response.rbs @@ -136,12 +136,9 @@ module ContextDev def to_hash: -> { type: :exact } end - type semantic = - { query: String, type: :semantic, confidence_threshold: Float } + type semantic = { type: :semantic, confidence_threshold: Float } class Semantic < ContextDev::Internal::Type::BaseModel - attr_accessor query: String - attr_accessor type: :semantic attr_reader confidence_threshold: Float? @@ -149,16 +146,11 @@ module ContextDev def confidence_threshold=: (Float) -> Float def initialize: ( - query: String, ?confidence_threshold: Float, ?type: :semantic ) -> void - def to_hash: -> { - query: String, - type: :semantic, - confidence_threshold: Float - } + def to_hash: -> { type: :semantic, confidence_threshold: Float } end def self?.variants: -> ::Array[ContextDev::Models::MonitorListResponse::Data::change_detection] @@ -312,16 +304,18 @@ module ContextDev type extract = { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] } class Extract < ContextDev::Internal::Type::BaseModel + attr_accessor instructions: String + attr_accessor type: :extract attr_accessor url: String @@ -330,10 +324,6 @@ module ContextDev def follow_subdomains=: (bool) -> bool - attr_reader instructions: String? - - def instructions=: (String) -> String - attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -347,9 +337,9 @@ module ContextDev def schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: ( + instructions: String, url: String, ?follow_subdomains: bool, - ?instructions: String, ?max_depth: Integer, ?max_pages: Integer, ?schema: ::Hash[Symbol, top], @@ -357,10 +347,10 @@ module ContextDev ) -> void def to_hash: -> { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] diff --git a/sig/context_dev/models/monitor_retrieve_change_response.rbs b/sig/context_dev/models/monitor_retrieve_change_response.rbs index 036ce95d..fce957ac 100644 --- a/sig/context_dev/models/monitor_retrieve_change_response.rbs +++ b/sig/context_dev/models/monitor_retrieve_change_response.rbs @@ -22,7 +22,6 @@ module ContextDev importance: ContextDev::Models::MonitorRetrieveChangeResponse::importance, matched_url_count: Integer, matched_urls: ::Array[String], - query: String, removed_url_count: Integer, removed_urls: ::Array[String], tags: ::Array[String] @@ -93,10 +92,6 @@ module ContextDev def matched_urls=: (::Array[String]) -> ::Array[String] - attr_reader query: String? - - def query=: (String) -> String - attr_reader removed_url_count: Integer? def removed_url_count=: (Integer) -> Integer @@ -130,7 +125,6 @@ module ContextDev ?importance: ContextDev::Models::MonitorRetrieveChangeResponse::importance, ?matched_url_count: Integer, ?matched_urls: ::Array[String], - ?query: String, ?removed_url_count: Integer, ?removed_urls: ::Array[String], ?tags: ::Array[String] @@ -157,7 +151,6 @@ module ContextDev importance: ContextDev::Models::MonitorRetrieveChangeResponse::importance, matched_url_count: Integer, matched_urls: ::Array[String], - query: String, removed_url_count: Integer, removed_urls: ::Array[String], tags: ::Array[String] diff --git a/sig/context_dev/models/monitor_retrieve_response.rbs b/sig/context_dev/models/monitor_retrieve_response.rbs index 5b9d8f8f..a125a997 100644 --- a/sig/context_dev/models/monitor_retrieve_response.rbs +++ b/sig/context_dev/models/monitor_retrieve_response.rbs @@ -110,12 +110,9 @@ module ContextDev def to_hash: -> { type: :exact } end - type semantic = - { query: String, type: :semantic, confidence_threshold: Float } + type semantic = { type: :semantic, confidence_threshold: Float } class Semantic < ContextDev::Internal::Type::BaseModel - attr_accessor query: String - attr_accessor type: :semantic attr_reader confidence_threshold: Float? @@ -123,16 +120,11 @@ module ContextDev def confidence_threshold=: (Float) -> Float def initialize: ( - query: String, ?confidence_threshold: Float, ?type: :semantic ) -> void - def to_hash: -> { - query: String, - type: :semantic, - confidence_threshold: Float - } + def to_hash: -> { type: :semantic, confidence_threshold: Float } end def self?.variants: -> ::Array[ContextDev::Models::MonitorRetrieveResponse::change_detection] @@ -286,16 +278,18 @@ module ContextDev type extract = { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] } class Extract < ContextDev::Internal::Type::BaseModel + attr_accessor instructions: String + attr_accessor type: :extract attr_accessor url: String @@ -304,10 +298,6 @@ module ContextDev def follow_subdomains=: (bool) -> bool - attr_reader instructions: String? - - def instructions=: (String) -> String - attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -321,9 +311,9 @@ module ContextDev def schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: ( + instructions: String, url: String, ?follow_subdomains: bool, - ?instructions: String, ?max_depth: Integer, ?max_pages: Integer, ?schema: ::Hash[Symbol, top], @@ -331,10 +321,10 @@ module ContextDev ) -> void def to_hash: -> { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] diff --git a/sig/context_dev/models/monitor_update_params.rbs b/sig/context_dev/models/monitor_update_params.rbs index 91d6918e..35cb1462 100644 --- a/sig/context_dev/models/monitor_update_params.rbs +++ b/sig/context_dev/models/monitor_update_params.rbs @@ -94,12 +94,9 @@ module ContextDev def to_hash: -> { type: :exact } end - type semantic = - { query: String, type: :semantic, confidence_threshold: Float } + type semantic = { type: :semantic, confidence_threshold: Float } class Semantic < ContextDev::Internal::Type::BaseModel - attr_accessor query: String - attr_accessor type: :semantic attr_reader confidence_threshold: Float? @@ -107,16 +104,11 @@ module ContextDev def confidence_threshold=: (Float) -> Float def initialize: ( - query: String, ?confidence_threshold: Float, ?type: :semantic ) -> void - def to_hash: -> { - query: String, - type: :semantic, - confidence_threshold: Float - } + def to_hash: -> { type: :semantic, confidence_threshold: Float } end def self?.variants: -> ::Array[ContextDev::Models::MonitorUpdateParams::change_detection] @@ -259,16 +251,18 @@ module ContextDev type extract = { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] } class Extract < ContextDev::Internal::Type::BaseModel + attr_accessor instructions: String + attr_accessor type: :extract attr_accessor url: String @@ -277,10 +271,6 @@ module ContextDev def follow_subdomains=: (bool) -> bool - attr_reader instructions: String? - - def instructions=: (String) -> String - attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -294,9 +284,9 @@ module ContextDev def schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: ( + instructions: String, url: String, ?follow_subdomains: bool, - ?instructions: String, ?max_depth: Integer, ?max_pages: Integer, ?schema: ::Hash[Symbol, top], @@ -304,10 +294,10 @@ module ContextDev ) -> void def to_hash: -> { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] diff --git a/sig/context_dev/models/monitor_update_response.rbs b/sig/context_dev/models/monitor_update_response.rbs index 630550d6..e473c21d 100644 --- a/sig/context_dev/models/monitor_update_response.rbs +++ b/sig/context_dev/models/monitor_update_response.rbs @@ -110,12 +110,9 @@ module ContextDev def to_hash: -> { type: :exact } end - type semantic = - { query: String, type: :semantic, confidence_threshold: Float } + type semantic = { type: :semantic, confidence_threshold: Float } class Semantic < ContextDev::Internal::Type::BaseModel - attr_accessor query: String - attr_accessor type: :semantic attr_reader confidence_threshold: Float? @@ -123,16 +120,11 @@ module ContextDev def confidence_threshold=: (Float) -> Float def initialize: ( - query: String, ?confidence_threshold: Float, ?type: :semantic ) -> void - def to_hash: -> { - query: String, - type: :semantic, - confidence_threshold: Float - } + def to_hash: -> { type: :semantic, confidence_threshold: Float } end def self?.variants: -> ::Array[ContextDev::Models::MonitorUpdateResponse::change_detection] @@ -286,16 +278,18 @@ module ContextDev type extract = { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] } class Extract < ContextDev::Internal::Type::BaseModel + attr_accessor instructions: String + attr_accessor type: :extract attr_accessor url: String @@ -304,10 +298,6 @@ module ContextDev def follow_subdomains=: (bool) -> bool - attr_reader instructions: String? - - def instructions=: (String) -> String - attr_reader max_depth: Integer? def max_depth=: (Integer) -> Integer @@ -321,9 +311,9 @@ module ContextDev def schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] def initialize: ( + instructions: String, url: String, ?follow_subdomains: bool, - ?instructions: String, ?max_depth: Integer, ?max_pages: Integer, ?schema: ::Hash[Symbol, top], @@ -331,10 +321,10 @@ module ContextDev ) -> void def to_hash: -> { + instructions: String, type: :extract, url: String, follow_subdomains: bool, - instructions: String, max_depth: Integer, max_pages: Integer, schema: ::Hash[Symbol, top] diff --git a/test/context_dev/resources/monitors_test.rb b/test/context_dev/resources/monitors_test.rb index 734ed692..ef45e4b5 100644 --- a/test/context_dev/resources/monitors_test.rb +++ b/test/context_dev/resources/monitors_test.rb @@ -240,7 +240,6 @@ def test_retrieve_change importance: ContextDev::Models::MonitorRetrieveChangeResponse::Importance | nil, matched_url_count: Integer | nil, matched_urls: ^(ContextDev::Internal::Type::ArrayOf[String]) | nil, - query: String | nil, removed_url_count: Integer | nil, removed_urls: ^(ContextDev::Internal::Type::ArrayOf[String]) | nil, tags: ^(ContextDev::Internal::Type::ArrayOf[String]) | nil From 7fe6a1fbd2977c0669b7623ba96533b43789b8ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 01:35:41 +0000 Subject: [PATCH 4/5] feat(api): api update --- .stats.yml | 4 +- .../models/monitor_create_params.rb | 31 +++++++------ .../models/monitor_create_response.rb | 44 ++++++++++-------- .../models/monitor_list_response.rb | 44 ++++++++++-------- .../models/monitor_retrieve_response.rb | 44 ++++++++++-------- .../models/monitor_update_params.rb | 31 +++++++------ .../models/monitor_update_response.rb | 44 ++++++++++-------- .../models/monitor_create_params.rbi | 31 +++++++------ .../models/monitor_create_response.rbi | 46 +++++++++++-------- .../models/monitor_list_response.rbi | 46 +++++++++++-------- .../models/monitor_retrieve_response.rbi | 46 +++++++++++-------- .../models/monitor_update_params.rbi | 31 +++++++------ .../models/monitor_update_response.rbi | 46 +++++++++++-------- 13 files changed, 290 insertions(+), 198 deletions(-) diff --git a/.stats.yml b/.stats.yml index 085d46dd..6b4e1c45 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b075e5704110b3c03bd81b41f62b836d7624eceed7feb0ac63720dec9a4cbba4.yml -openapi_spec_hash: 5efb926e6e99163e3e42a98986da8335 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-51ebe668b198157ccb18984017dd2fe35f7675220e8b933b03325b3c459ef2a6.yml +openapi_spec_hash: b3ed94bd6b59d4e32fc2c5aa8187d6b2 config_hash: ff35e224e809656528c44163aa41bebd diff --git a/lib/context_dev/models/monitor_create_params.rb b/lib/context_dev/models/monitor_create_params.rb index b6cf87e1..9817736e 100644 --- a/lib/context_dev/models/monitor_create_params.rb +++ b/lib/context_dev/models/monitor_create_params.rb @@ -184,10 +184,10 @@ module Target # Watch a single web page. variant :page, -> { ContextDev::MonitorCreateParams::Target::Page } - # 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. + # 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. variant :sitemap, -> { ContextDev::MonitorCreateParams::Target::Sitemap } - # Watch a site's extracted structured data. + # 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. variant :extract, -> { ContextDev::MonitorCreateParams::Target::Extract } class Page < ContextDev::Internal::Type::BaseModel @@ -250,8 +250,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap) # 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. + # 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. # # @param url [String] Sitemap URL to monitor. # @@ -266,9 +267,8 @@ class Sitemap < ContextDev::Internal::Type::BaseModel class Extract < ContextDev::Internal::Type::BaseModel # @!attribute instructions - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. # # @return [String] required :instructions, String @@ -296,13 +296,14 @@ class Extract < ContextDev::Internal::Type::BaseModel optional :max_depth, Integer # @!attribute max_pages - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. # # @return [Integer, nil] optional :max_pages, Integer # @!attribute schema - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. # # @return [Hash{Symbol=>Object}, nil] @@ -312,9 +313,13 @@ class Extract < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorCreateParams::Target::Extract} for more details. # - # Watch a site's extracted structured data. + # 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. # - # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c # # @param url [String] Root URL to extract structured data from. # @@ -322,9 +327,9 @@ class Extract < ContextDev::Internal::Type::BaseModel # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # - # @param max_pages [Integer] Maximum number of pages to analyze during extraction. + # @param max_pages [Integer] Maximum number of pages to track. # - # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If + # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select # # @param type [Symbol, :extract] end diff --git a/lib/context_dev/models/monitor_create_response.rb b/lib/context_dev/models/monitor_create_response.rb index daff1f41..95104c97 100644 --- a/lib/context_dev/models/monitor_create_response.rb +++ b/lib/context_dev/models/monitor_create_response.rb @@ -292,10 +292,10 @@ module Target # Watch a single web page. variant :page, -> { ContextDev::Models::MonitorCreateResponse::Target::Page } - # 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. + # 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. variant :sitemap, -> { ContextDev::Models::MonitorCreateResponse::Target::Sitemap } - # Watch a site's extracted structured data. + # 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. variant :extract, -> { ContextDev::Models::MonitorCreateResponse::Target::Extract } class Page < ContextDev::Internal::Type::BaseModel @@ -358,8 +358,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap) # 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. + # 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. # # @param url [String] Sitemap URL to monitor. # @@ -374,9 +375,8 @@ class Sitemap < ContextDev::Internal::Type::BaseModel class Extract < ContextDev::Internal::Type::BaseModel # @!attribute instructions - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. # # @return [String] required :instructions, String @@ -404,13 +404,14 @@ class Extract < ContextDev::Internal::Type::BaseModel optional :max_depth, Integer # @!attribute max_pages - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. # # @return [Integer, nil] optional :max_pages, Integer # @!attribute schema - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. # # @return [Hash{Symbol=>Object}, nil] @@ -420,9 +421,13 @@ class Extract < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorCreateResponse::Target::Extract} for more details. # - # Watch a site's extracted structured data. + # 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. # - # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c # # @param url [String] Root URL to extract structured data from. # @@ -430,9 +435,9 @@ class Extract < ContextDev::Internal::Type::BaseModel # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # - # @param max_pages [Integer] Maximum number of pages to analyze during extraction. + # @param max_pages [Integer] Maximum number of pages to track. # - # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If + # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select # # @param type [Symbol, :extract] end @@ -456,7 +461,7 @@ module Baseline # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. variant -> { ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsSitemapBaseline } - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted. variant -> { ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline } class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel @@ -519,13 +524,15 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # @!attribute data # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. # # @return [Object] required :data, ContextDev::Internal::Type::Unknown # @!attribute urls_analyzed - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. # # @return [Array] required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] @@ -535,13 +542,14 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # {ContextDev::Models::MonitorCreateResponse::Baseline::MonitorsExtractBaseline} # for more details. # - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. # # @param captured_at [Time] When this baseline was last captured or replaced. # # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh # - # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + # @param urls_analyzed [Array] The page URLs the monitor tracks and analyzes for changes. end # @!method self.variants diff --git a/lib/context_dev/models/monitor_list_response.rb b/lib/context_dev/models/monitor_list_response.rb index 1c7eb174..8eeb68c0 100644 --- a/lib/context_dev/models/monitor_list_response.rb +++ b/lib/context_dev/models/monitor_list_response.rb @@ -313,10 +313,10 @@ module Target # Watch a single web page. variant :page, -> { ContextDev::Models::MonitorListResponse::Data::Target::Page } - # 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. + # 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. variant :sitemap, -> { ContextDev::Models::MonitorListResponse::Data::Target::Sitemap } - # Watch a site's extracted structured data. + # 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. variant :extract, -> { ContextDev::Models::MonitorListResponse::Data::Target::Extract } class Page < ContextDev::Internal::Type::BaseModel @@ -379,8 +379,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap) # 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. + # 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. # # @param url [String] Sitemap URL to monitor. # @@ -395,9 +396,8 @@ class Sitemap < ContextDev::Internal::Type::BaseModel class Extract < ContextDev::Internal::Type::BaseModel # @!attribute instructions - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. # # @return [String] required :instructions, String @@ -425,13 +425,14 @@ class Extract < ContextDev::Internal::Type::BaseModel optional :max_depth, Integer # @!attribute max_pages - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. # # @return [Integer, nil] optional :max_pages, Integer # @!attribute schema - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. # # @return [Hash{Symbol=>Object}, nil] @@ -442,9 +443,13 @@ class Extract < ContextDev::Internal::Type::BaseModel # {ContextDev::Models::MonitorListResponse::Data::Target::Extract} for more # details. # - # Watch a site's extracted structured data. + # 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. # - # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c # # @param url [String] Root URL to extract structured data from. # @@ -452,9 +457,9 @@ class Extract < ContextDev::Internal::Type::BaseModel # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # - # @param max_pages [Integer] Maximum number of pages to analyze during extraction. + # @param max_pages [Integer] Maximum number of pages to track. # - # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If + # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select # # @param type [Symbol, :extract] end @@ -478,7 +483,7 @@ module Baseline # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline } - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted. variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline } class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel @@ -541,13 +546,15 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # @!attribute data # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. # # @return [Object] required :data, ContextDev::Internal::Type::Unknown # @!attribute urls_analyzed - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. # # @return [Array] required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] @@ -557,13 +564,14 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # {ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline} # for more details. # - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. # # @param captured_at [Time] When this baseline was last captured or replaced. # # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh # - # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + # @param urls_analyzed [Array] The page URLs the monitor tracks and analyzes for changes. end # @!method self.variants diff --git a/lib/context_dev/models/monitor_retrieve_response.rb b/lib/context_dev/models/monitor_retrieve_response.rb index d5230450..d62c3602 100644 --- a/lib/context_dev/models/monitor_retrieve_response.rb +++ b/lib/context_dev/models/monitor_retrieve_response.rb @@ -292,10 +292,10 @@ module Target # Watch a single web page. variant :page, -> { ContextDev::Models::MonitorRetrieveResponse::Target::Page } - # 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. + # 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. variant :sitemap, -> { ContextDev::Models::MonitorRetrieveResponse::Target::Sitemap } - # Watch a site's extracted structured data. + # 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. variant :extract, -> { ContextDev::Models::MonitorRetrieveResponse::Target::Extract } class Page < ContextDev::Internal::Type::BaseModel @@ -358,8 +358,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap) # 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. + # 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. # # @param url [String] Sitemap URL to monitor. # @@ -374,9 +375,8 @@ class Sitemap < ContextDev::Internal::Type::BaseModel class Extract < ContextDev::Internal::Type::BaseModel # @!attribute instructions - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. # # @return [String] required :instructions, String @@ -404,13 +404,14 @@ class Extract < ContextDev::Internal::Type::BaseModel optional :max_depth, Integer # @!attribute max_pages - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. # # @return [Integer, nil] optional :max_pages, Integer # @!attribute schema - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. # # @return [Hash{Symbol=>Object}, nil] @@ -420,9 +421,13 @@ class Extract < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorRetrieveResponse::Target::Extract} for more details. # - # Watch a site's extracted structured data. + # 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. # - # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c # # @param url [String] Root URL to extract structured data from. # @@ -430,9 +435,9 @@ class Extract < ContextDev::Internal::Type::BaseModel # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # - # @param max_pages [Integer] Maximum number of pages to analyze during extraction. + # @param max_pages [Integer] Maximum number of pages to track. # - # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If + # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select # # @param type [Symbol, :extract] end @@ -456,7 +461,7 @@ module Baseline # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsSitemapBaseline } - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted. variant -> { ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline } class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel @@ -519,13 +524,15 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # @!attribute data # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. # # @return [Object] required :data, ContextDev::Internal::Type::Unknown # @!attribute urls_analyzed - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. # # @return [Array] required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] @@ -535,13 +542,14 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # {ContextDev::Models::MonitorRetrieveResponse::Baseline::MonitorsExtractBaseline} # for more details. # - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. # # @param captured_at [Time] When this baseline was last captured or replaced. # # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh # - # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + # @param urls_analyzed [Array] The page URLs the monitor tracks and analyzes for changes. end # @!method self.variants diff --git a/lib/context_dev/models/monitor_update_params.rb b/lib/context_dev/models/monitor_update_params.rb index 817892a2..e695ab81 100644 --- a/lib/context_dev/models/monitor_update_params.rb +++ b/lib/context_dev/models/monitor_update_params.rb @@ -200,10 +200,10 @@ module Target # Watch a single web page. variant :page, -> { ContextDev::MonitorUpdateParams::Target::Page } - # 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. + # 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. variant :sitemap, -> { ContextDev::MonitorUpdateParams::Target::Sitemap } - # Watch a site's extracted structured data. + # 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. variant :extract, -> { ContextDev::MonitorUpdateParams::Target::Extract } class Page < ContextDev::Internal::Type::BaseModel @@ -266,8 +266,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap) # 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. + # 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. # # @param url [String] Sitemap URL to monitor. # @@ -282,9 +283,8 @@ class Sitemap < ContextDev::Internal::Type::BaseModel class Extract < ContextDev::Internal::Type::BaseModel # @!attribute instructions - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. # # @return [String] required :instructions, String @@ -312,13 +312,14 @@ class Extract < ContextDev::Internal::Type::BaseModel optional :max_depth, Integer # @!attribute max_pages - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. # # @return [Integer, nil] optional :max_pages, Integer # @!attribute schema - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. # # @return [Hash{Symbol=>Object}, nil] @@ -328,9 +329,13 @@ class Extract < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorUpdateParams::Target::Extract} for more details. # - # Watch a site's extracted structured data. + # 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. # - # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c # # @param url [String] Root URL to extract structured data from. # @@ -338,9 +343,9 @@ class Extract < ContextDev::Internal::Type::BaseModel # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # - # @param max_pages [Integer] Maximum number of pages to analyze during extraction. + # @param max_pages [Integer] Maximum number of pages to track. # - # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If + # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select # # @param type [Symbol, :extract] end diff --git a/lib/context_dev/models/monitor_update_response.rb b/lib/context_dev/models/monitor_update_response.rb index 941c4196..128bc0ea 100644 --- a/lib/context_dev/models/monitor_update_response.rb +++ b/lib/context_dev/models/monitor_update_response.rb @@ -292,10 +292,10 @@ module Target # Watch a single web page. variant :page, -> { ContextDev::Models::MonitorUpdateResponse::Target::Page } - # 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. + # 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. variant :sitemap, -> { ContextDev::Models::MonitorUpdateResponse::Target::Sitemap } - # Watch a site's extracted structured data. + # 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. variant :extract, -> { ContextDev::Models::MonitorUpdateResponse::Target::Extract } class Page < ContextDev::Internal::Type::BaseModel @@ -358,8 +358,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap) # 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. + # 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. # # @param url [String] Sitemap URL to monitor. # @@ -374,9 +375,8 @@ class Sitemap < ContextDev::Internal::Type::BaseModel class Extract < ContextDev::Internal::Type::BaseModel # @!attribute instructions - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. # # @return [String] required :instructions, String @@ -404,13 +404,14 @@ class Extract < ContextDev::Internal::Type::BaseModel optional :max_depth, Integer # @!attribute max_pages - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. # # @return [Integer, nil] optional :max_pages, Integer # @!attribute schema - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. # # @return [Hash{Symbol=>Object}, nil] @@ -420,9 +421,13 @@ class Extract < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorUpdateResponse::Target::Extract} for more details. # - # Watch a site's extracted structured data. + # 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. # - # @param instructions [String] Natural-language instructions describing what to extract and watch. This single + # @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c # # @param url [String] Root URL to extract structured data from. # @@ -430,9 +435,9 @@ class Extract < ContextDev::Internal::Type::BaseModel # # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page). # - # @param max_pages [Integer] Maximum number of pages to analyze during extraction. + # @param max_pages [Integer] Maximum number of pages to track. # - # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If + # @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select # # @param type [Symbol, :extract] end @@ -456,7 +461,7 @@ module Baseline # Current baseline of a `sitemap` monitor: the normalized URL set as last observed. variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline } - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted. variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline } class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel @@ -519,13 +524,15 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # @!attribute data # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. # # @return [Object] required :data, ContextDev::Internal::Type::Unknown # @!attribute urls_analyzed - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. # # @return [Array] required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String] @@ -535,13 +542,14 @@ class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel # {ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline} # for more details. # - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. # # @param captured_at [Time] When this baseline was last captured or replaced. # # @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh # - # @param urls_analyzed [Array] URLs that were analyzed to produce the extracted data. + # @param urls_analyzed [Array] The page URLs the monitor tracks and analyzes for changes. end # @!method self.variants diff --git a/rbi/context_dev/models/monitor_create_params.rbi b/rbi/context_dev/models/monitor_create_params.rbi index 35c10f19..0fdb3237 100644 --- a/rbi/context_dev/models/monitor_create_params.rbi +++ b/rbi/context_dev/models/monitor_create_params.rbi @@ -441,8 +441,9 @@ module ContextDev # 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. + # 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. sig do params( url: String, @@ -489,9 +490,8 @@ module ContextDev ) end - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. sig { returns(String) } attr_accessor :instructions @@ -515,14 +515,15 @@ module ContextDev sig { params(max_depth: Integer).void } attr_writer :max_depth - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. sig { returns(T.nilable(Integer)) } attr_reader :max_pages sig { params(max_pages: Integer).void } attr_writer :max_pages - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :schema @@ -530,7 +531,11 @@ module ContextDev sig { params(schema: T::Hash[Symbol, T.anything]).void } attr_writer :schema - # Watch a site's extracted structured data. + # 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. sig do params( instructions: String, @@ -543,18 +548,18 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. max_pages: nil, - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. schema: nil, type: :extract diff --git a/rbi/context_dev/models/monitor_create_response.rbi b/rbi/context_dev/models/monitor_create_response.rbi index f776c4c2..4e4c6acf 100644 --- a/rbi/context_dev/models/monitor_create_response.rbi +++ b/rbi/context_dev/models/monitor_create_response.rbi @@ -627,8 +627,9 @@ module ContextDev # 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. + # 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. sig do params( url: String, @@ -675,9 +676,8 @@ module ContextDev ) end - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. sig { returns(String) } attr_accessor :instructions @@ -701,14 +701,15 @@ module ContextDev sig { params(max_depth: Integer).void } attr_writer :max_depth - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. sig { returns(T.nilable(Integer)) } attr_reader :max_pages sig { params(max_pages: Integer).void } attr_writer :max_pages - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :schema @@ -716,7 +717,11 @@ module ContextDev sig { params(schema: T::Hash[Symbol, T.anything]).void } attr_writer :schema - # Watch a site's extracted structured data. + # 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. sig do params( instructions: String, @@ -729,18 +734,18 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. max_pages: nil, - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. schema: nil, type: :extract @@ -888,15 +893,18 @@ module ContextDev attr_accessor :captured_at # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. sig { returns(T.anything) } attr_accessor :data - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. sig { returns(T::Array[String]) } attr_accessor :urls_analyzed - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. sig do params( captured_at: Time, @@ -908,9 +916,11 @@ module ContextDev # When this baseline was last captured or replaced. captured_at:, # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. data:, - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. urls_analyzed: ) end diff --git a/rbi/context_dev/models/monitor_list_response.rbi b/rbi/context_dev/models/monitor_list_response.rbi index d55d6e1c..f0a94ad2 100644 --- a/rbi/context_dev/models/monitor_list_response.rbi +++ b/rbi/context_dev/models/monitor_list_response.rbi @@ -689,8 +689,9 @@ module ContextDev # 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. + # 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. sig do params( url: String, @@ -737,9 +738,8 @@ module ContextDev ) end - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. sig { returns(String) } attr_accessor :instructions @@ -763,14 +763,15 @@ module ContextDev sig { params(max_depth: Integer).void } attr_writer :max_depth - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. sig { returns(T.nilable(Integer)) } attr_reader :max_pages sig { params(max_pages: Integer).void } attr_writer :max_pages - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :schema @@ -778,7 +779,11 @@ module ContextDev sig { params(schema: T::Hash[Symbol, T.anything]).void } attr_writer :schema - # Watch a site's extracted structured data. + # 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. sig do params( instructions: String, @@ -791,18 +796,18 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. max_pages: nil, - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. schema: nil, type: :extract @@ -954,15 +959,18 @@ module ContextDev attr_accessor :captured_at # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. sig { returns(T.anything) } attr_accessor :data - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. sig { returns(T::Array[String]) } attr_accessor :urls_analyzed - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. sig do params( captured_at: Time, @@ -974,9 +982,11 @@ module ContextDev # When this baseline was last captured or replaced. captured_at:, # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. data:, - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. urls_analyzed: ) end diff --git a/rbi/context_dev/models/monitor_retrieve_response.rbi b/rbi/context_dev/models/monitor_retrieve_response.rbi index f38e8da2..3c5640f8 100644 --- a/rbi/context_dev/models/monitor_retrieve_response.rbi +++ b/rbi/context_dev/models/monitor_retrieve_response.rbi @@ -635,8 +635,9 @@ module ContextDev # 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. + # 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. sig do params( url: String, @@ -683,9 +684,8 @@ module ContextDev ) end - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. sig { returns(String) } attr_accessor :instructions @@ -709,14 +709,15 @@ module ContextDev sig { params(max_depth: Integer).void } attr_writer :max_depth - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. sig { returns(T.nilable(Integer)) } attr_reader :max_pages sig { params(max_pages: Integer).void } attr_writer :max_pages - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :schema @@ -724,7 +725,11 @@ module ContextDev sig { params(schema: T::Hash[Symbol, T.anything]).void } attr_writer :schema - # Watch a site's extracted structured data. + # 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. sig do params( instructions: String, @@ -737,18 +742,18 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. max_pages: nil, - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. schema: nil, type: :extract @@ -896,15 +901,18 @@ module ContextDev attr_accessor :captured_at # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. sig { returns(T.anything) } attr_accessor :data - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. sig { returns(T::Array[String]) } attr_accessor :urls_analyzed - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. sig do params( captured_at: Time, @@ -916,9 +924,11 @@ module ContextDev # When this baseline was last captured or replaced. captured_at:, # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. data:, - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. urls_analyzed: ) end diff --git a/rbi/context_dev/models/monitor_update_params.rbi b/rbi/context_dev/models/monitor_update_params.rbi index 13e795cd..1bec6147 100644 --- a/rbi/context_dev/models/monitor_update_params.rbi +++ b/rbi/context_dev/models/monitor_update_params.rbi @@ -500,8 +500,9 @@ module ContextDev # 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. + # 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. sig do params( url: String, @@ -548,9 +549,8 @@ module ContextDev ) end - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. sig { returns(String) } attr_accessor :instructions @@ -574,14 +574,15 @@ module ContextDev sig { params(max_depth: Integer).void } attr_writer :max_depth - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. sig { returns(T.nilable(Integer)) } attr_reader :max_pages sig { params(max_pages: Integer).void } attr_writer :max_pages - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :schema @@ -589,7 +590,11 @@ module ContextDev sig { params(schema: T::Hash[Symbol, T.anything]).void } attr_writer :schema - # Watch a site's extracted structured data. + # 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. sig do params( instructions: String, @@ -602,18 +607,18 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. max_pages: nil, - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. schema: nil, type: :extract diff --git a/rbi/context_dev/models/monitor_update_response.rbi b/rbi/context_dev/models/monitor_update_response.rbi index 462ebdfe..3430297d 100644 --- a/rbi/context_dev/models/monitor_update_response.rbi +++ b/rbi/context_dev/models/monitor_update_response.rbi @@ -627,8 +627,9 @@ module ContextDev # 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. + # 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. sig do params( url: String, @@ -675,9 +676,8 @@ module ContextDev ) end - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. sig { returns(String) } attr_accessor :instructions @@ -701,14 +701,15 @@ module ContextDev sig { params(max_depth: Integer).void } attr_writer :max_depth - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. sig { returns(T.nilable(Integer)) } attr_reader :max_pages sig { params(max_pages: Integer).void } attr_writer :max_pages - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :schema @@ -716,7 +717,11 @@ module ContextDev sig { params(schema: T::Hash[Symbol, T.anything]).void } attr_writer :schema - # Watch a site's extracted structured data. + # 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. sig do params( instructions: String, @@ -729,18 +734,18 @@ module ContextDev ).returns(T.attached_class) end def self.new( - # Natural-language instructions describing what to extract and watch. This single - # prompt scopes both the extraction and what changes get reported: only data - # captured by the schema and these instructions is compared between runs. + # Natural-language instructions guiding which pages and facts to track and which + # changes to report. instructions:, # Root URL to extract structured data from. url:, follow_subdomains: nil, # Optional maximum link depth from the starting URL (0 = only the starting page). max_depth: nil, - # Maximum number of pages to analyze during extraction. + # Maximum number of pages to track. max_pages: nil, - # JSON Schema describing the structured data to extract and watch for changes. If + # JSON Schema describing the data you care about. It guides which pages are + # selected for tracking and gives the change judge context on what matters. If # omitted, a default summary + key-points schema is used. schema: nil, type: :extract @@ -888,15 +893,18 @@ module ContextDev attr_accessor :captured_at # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. sig { returns(T.anything) } attr_accessor :data - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. sig { returns(T::Array[String]) } attr_accessor :urls_analyzed - # Current baseline of an `extract` monitor: the structured data as last extracted. + # Current baseline of an `extract` monitor: the pages it tracks and the structured + # data as last extracted. sig do params( captured_at: Time, @@ -908,9 +916,11 @@ module ContextDev # When this baseline was last captured or replaced. captured_at:, # The extracted structured data, matching the monitor's extraction schema (same - # shape as the /web/extract endpoint's `data`). + # shape as the /web/extract endpoint's `data`). Refreshed when the monitor + # re-discovers its page set (at most about once a day); `null` when no extraction + # has been captured yet. data:, - # URLs that were analyzed to produce the extracted data. + # The page URLs the monitor tracks and analyzes for changes. urls_analyzed: ) end From 072298e90cc37184a0cdfade8cf1440dd93fb07d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 01:36:07 +0000 Subject: [PATCH 5/5] release: 2.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 11 +++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/context_dev/version.rb | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 65f558e7..656a2ef1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0" + ".": "2.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f8e7111..d3d23d11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 2.1.0 (2026-07-08) + +Full Changelog: [v2.0.0...v2.1.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.0.0...v2.1.0) + +### Features + +* **api:** api update ([7fe6a1f](https://github.com/context-dot-dev/context-ruby-sdk/commit/7fe6a1fbd2977c0669b7623ba96533b43789b8ae)) +* **api:** api update ([cd5b872](https://github.com/context-dot-dev/context-ruby-sdk/commit/cd5b8725dcd7fb06d7bd684aa4ce11b81ca4409a)) +* **api:** api update ([bdc4962](https://github.com/context-dot-dev/context-ruby-sdk/commit/bdc4962f436086be52293ea489960b6b6158726b)) +* **api:** api update ([531ccbe](https://github.com/context-dot-dev/context-ruby-sdk/commit/531ccbeb9770c4340641353859064b50aa6d72bc)) + ## 2.0.0 (2026-07-06) Full Changelog: [v1.36.0...v2.0.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.36.0...v2.0.0) diff --git a/Gemfile.lock b/Gemfile.lock index eb9b2de9..1bd5153d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (2.0.0) + context.dev (2.1.0) cgi connection_pool diff --git a/README.md b/README.md index 86d0d37d..b6f51859 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "context.dev", "~> 2.0.0" +gem "context.dev", "~> 2.1.0" ``` diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index e2988dcd..f956e87b 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "2.0.0" + VERSION = "2.1.0" end