diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dd24175..b1873145 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/context.dev-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: |- github.repository == 'stainless-sdks/context.dev-ruby' && - (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && - (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 - name: Set up Ruby diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fea34540..2601677b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "1.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 806f105f..7aefc872 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-ea89aeedfdd75f71542bcbb53880ecbc07f2656945d9ac8dce55d7bdabc5f8cc.yml -openapi_spec_hash: c4dd62c3a3dc8c59a050fb6a76ab5f1b -config_hash: 91976f3284e20f47fdb0256e128536cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml +openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14 +config_hash: 38268bb88fc4dcbb8f2f94dd138b5910 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6f83f9..dccc7cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 1.1.0 (2026-03-28) + +Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.0.0...v1.1.0) + +### Features + +* **api:** api update ([9ae9b10](https://github.com/context-dot-dev/context-ruby-sdk/commit/9ae9b108ce2737b42574a6f781103410a546f704)) +* **api:** api update ([58ed755](https://github.com/context-dot-dev/context-ruby-sdk/commit/58ed7551637936ea3c007e28af3358eb96a339ca)) + + +### Bug Fixes + +* **internal:** correct multipart form field name encoding ([221d059](https://github.com/context-dot-dev/context-ruby-sdk/commit/221d0598148243acddae6c9679c949c07e1dcd7a)) + + +### Chores + +* **ci:** support opting out of skipping builds on metadata-only commits ([aad82ac](https://github.com/context-dot-dev/context-ruby-sdk/commit/aad82ac90dd1c55ca4db05e63b70b46abded53e3)) + ## 1.0.0 (2026-03-25) Full Changelog: [v0.4.0...v1.0.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v0.4.0...v1.0.0) diff --git a/Gemfile.lock b/Gemfile.lock index be44a44b..b79b6f0c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (1.0.0) + context.dev (1.1.0) cgi connection_pool diff --git a/README.md b/README.md index b14d06d3..6928affc 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", "~> 1.0.0" +gem "context.dev", "~> 1.1.0" ``` diff --git a/lib/context_dev/internal/util.rb b/lib/context_dev/internal/util.rb index c21bacb8..bee1bf0e 100644 --- a/lib/context_dev/internal/util.rb +++ b/lib/context_dev/internal/util.rb @@ -571,8 +571,7 @@ def encode_query_params(query) y << "Content-Disposition: form-data" unless key.nil? - name = ERB::Util.url_encode(key.to_s) - y << "; name=\"#{name}\"" + y << "; name=\"#{key}\"" end case val diff --git a/lib/context_dev/models/web_web_scrape_images_response.rb b/lib/context_dev/models/web_web_scrape_images_response.rb index 59179077..7128ac1f 100644 --- a/lib/context_dev/models/web_web_scrape_images_response.rb +++ b/lib/context_dev/models/web_web_scrape_images_response.rb @@ -75,6 +75,10 @@ module Element LINK = :link SOURCE = :source VIDEO = :video + CSS = :css + OBJECT = :object + META = :meta + BACKGROUND = :background # @!method self.values # @return [Array] diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index fe9ebb9c..c483a3ff 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -32,7 +32,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :shorten_base64_images, ContextDev::Internal::Type::Boolean - # @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, request_options: {}) + # @!attribute use_main_content_only + # Extract only the main content of the page, excluding headers, footers, sidebars, + # and navigation + # + # @return [Boolean, nil] + optional :use_main_content_only, ContextDev::Internal::Type::Boolean + + # @!method initialize(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # @@ -44,6 +51,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 372cdb68..ee6d675c 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -92,7 +92,7 @@ def web_scrape_images(params) # Scrapes the given URL, converts the HTML content to Markdown, and returns the # result. # - # @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, request_options: {}) + # @overload web_scrape_md(url:, include_images: nil, include_links: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) # # @param url [String] Full URL to scrape and convert to markdown (must include http:// or https:// pro # @@ -102,6 +102,8 @@ def web_scrape_images(params) # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeMdResponse] @@ -116,7 +118,8 @@ def web_scrape_md(params) query: query.transform_keys( include_images: "includeImages", include_links: "includeLinks", - shorten_base64_images: "shortenBase64Images" + shorten_base64_images: "shortenBase64Images", + use_main_content_only: "useMainContentOnly" ), model: ContextDev::Models::WebWebScrapeMdResponse, options: options diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index 83d65aea..fbda78ec 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "1.0.0" + VERSION = "1.1.0" end diff --git a/rbi/context_dev/models/web_web_scrape_images_response.rbi b/rbi/context_dev/models/web_web_scrape_images_response.rbi index 1b770c3c..59d49ed9 100644 --- a/rbi/context_dev/models/web_web_scrape_images_response.rbi +++ b/rbi/context_dev/models/web_web_scrape_images_response.rbi @@ -172,6 +172,26 @@ module ContextDev :video, ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol ) + CSS = + T.let( + :css, + ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + OBJECT = + T.let( + :object, + ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + META = + T.let( + :meta, + ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) + BACKGROUND = + T.let( + :background, + ContextDev::Models::WebWebScrapeImagesResponse::Image::Element::TaggedSymbol + ) sig do override.returns( diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index cb70bd31..7f086479 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -37,12 +37,21 @@ module ContextDev sig { params(shorten_base64_images: T::Boolean).void } attr_writer :shorten_base64_images + # Extract only the main content of the page, excluding headers, footers, sidebars, + # and navigation + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_main_content_only + + sig { params(use_main_content_only: T::Boolean).void } + attr_writer :use_main_content_only + sig do params( url: String, include_images: T::Boolean, include_links: T::Boolean, shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -56,6 +65,9 @@ module ContextDev include_links: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # Extract only the main content of the page, excluding headers, footers, sidebars, + # and navigation + use_main_content_only: nil, request_options: {} ) end @@ -67,6 +79,7 @@ module ContextDev include_images: T::Boolean, include_links: T::Boolean, shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index a08d7bac..6afbab52 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -76,6 +76,7 @@ module ContextDev include_images: T::Boolean, include_links: T::Boolean, shorten_base64_images: T::Boolean, + use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeMdResponse) end @@ -89,6 +90,9 @@ module ContextDev include_links: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # Extract only the main content of the page, excluding headers, footers, sidebars, + # and navigation + use_main_content_only: nil, request_options: {} ) end diff --git a/sig/context_dev/models/web_web_scrape_images_response.rbs b/sig/context_dev/models/web_web_scrape_images_response.rbs index cba9274a..87f64044 100644 --- a/sig/context_dev/models/web_web_scrape_images_response.rbs +++ b/sig/context_dev/models/web_web_scrape_images_response.rbs @@ -57,7 +57,16 @@ module ContextDev type: ContextDev::Models::WebWebScrapeImagesResponse::Image::type_ } - type element = :img | :svg | :link | :source | :video + type element = + :img + | :svg + | :link + | :source + | :video + | :css + | :object + | :meta + | :background module Element extend ContextDev::Internal::Type::Enum @@ -67,6 +76,10 @@ module ContextDev LINK: :link SOURCE: :source VIDEO: :video + CSS: :css + OBJECT: :object + META: :meta + BACKGROUND: :background def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeImagesResponse::Image::element] end diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index b435802a..1d1c2d41 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -5,7 +5,8 @@ module ContextDev url: String, include_images: bool, include_links: bool, - :shorten_base64_images => bool + :shorten_base64_images => bool, + use_main_content_only: bool } & ContextDev::Internal::Type::request_parameters @@ -27,11 +28,16 @@ module ContextDev def shorten_base64_images=: (bool) -> bool + attr_reader use_main_content_only: bool? + + def use_main_content_only=: (bool) -> bool + def initialize: ( url: String, ?include_images: bool, ?include_links: bool, ?shorten_base64_images: bool, + ?use_main_content_only: bool, ?request_options: ContextDev::request_opts ) -> void @@ -40,6 +46,7 @@ module ContextDev include_images: bool, include_links: bool, :shorten_base64_images => bool, + use_main_content_only: bool, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index dd50ffa3..ccddc725 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -24,6 +24,7 @@ module ContextDev ?include_images: bool, ?include_links: bool, ?shorten_base64_images: bool, + ?use_main_content_only: bool, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeMdResponse