Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.0.0"
".": "2.1.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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-51ebe668b198157ccb18984017dd2fe35f7675220e8b933b03325b3c459ef2a6.yml
openapi_spec_hash: b3ed94bd6b59d4e32fc2c5aa8187d6b2
config_hash: ff35e224e809656528c44163aa41bebd
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
context.dev (2.0.0)
context.dev (2.1.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "context.dev", "~> 2.0.0"
gem "context.dev", "~> 2.1.0"
```

<!-- x-release-please-end -->
Expand Down
49 changes: 46 additions & 3 deletions lib/context_dev/models/brand_retrieve_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}]

Expand All @@ -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 }

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
57 changes: 30 additions & 27 deletions lib/context_dev/models/monitor_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -188,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
Expand Down Expand Up @@ -254,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.
#
Expand All @@ -269,6 +266,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel
end

class Extract < ContextDev::Internal::Type::BaseModel
# @!attribute instructions
# Natural-language instructions guiding which pages and facts to track and which
# changes to report.
#
# @return [String]
required :instructions, String

# @!attribute type
#
# @return [Symbol, :extract]
Expand All @@ -285,48 +289,47 @@ 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).
#
# @return [Integer, nil]
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]
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.
# 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 guiding which pages and facts to track and which c
#
# @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.
# @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
Expand Down
Loading