Skip to content

Commit 8fd71ca

Browse files
authored
Merge pull request #7 from context-dot-dev/release-please--branches--main--changes--next
release: 1.3.0
2 parents 52d02b0 + 76175eb commit 8fd71ca

22 files changed

Lines changed: 2481 additions & 10 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.2.0"
2+
".": "1.3.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 25
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4903d5902cec6a80f42b9adaa9cf0defa9805ff22d7ae96970d209a4f867e195.yml
3-
openapi_spec_hash: 1097891c23530dfe0155f23170daf973
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-021b48afe1d6e3f54c4ebe3d0da4beb3fb8b69a6d384a4aeadbc5bab7f967603.yml
3+
openapi_spec_hash: 2aa5b59d78c708b094acf29cc0d9a68a
44
config_hash: c7b0cdaba3b9797b77efd89e1754d803

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 1.3.0 (2026-06-27)
4+
5+
Full Changelog: [v1.2.0...v1.3.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.2.0...v1.3.0)
6+
7+
### Features
8+
9+
* **api:** api update ([787f92f](https://github.com/context-dot-dev/context-php-sdk/commit/787f92feb6e1fb84d0661b5ae60cf12981b4f558))
10+
* **api:** api update ([e99ca05](https://github.com/context-dot-dev/context-php-sdk/commit/e99ca05a38a1c1ceaf20a572a306d2ac550498d2))
11+
* **api:** api update ([df50f08](https://github.com/context-dot-dev/context-php-sdk/commit/df50f08fb5e0eb21378598088d745bc3ebd6b1dd))
12+
* **api:** api update ([8d1b848](https://github.com/context-dot-dev/context-php-sdk/commit/8d1b84827184cc37a49fa3c532e21c16fa7dbc47))
13+
314
## 1.2.0 (2026-06-25)
415

516
Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.1.0...v1.2.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte
1313
<!-- x-release-please-start-version -->
1414

1515
```
16-
composer require "context-dev/context-dev-php 1.2.0"
16+
composer require "context-dev/context-dev-php 1.3.0"
1717
```
1818

1919
<!-- x-release-please-end -->

src/ServiceContracts/WebContract.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
use ContextDev\Web\WebExtractFontsResponse;
1111
use ContextDev\Web\WebExtractParams\Pdf;
1212
use ContextDev\Web\WebExtractResponse;
13+
use ContextDev\Web\WebExtractStyleguideParams\ColorScheme;
1314
use ContextDev\Web\WebExtractStyleguideResponse;
15+
use ContextDev\Web\WebScreenshotParams\Country;
1416
use ContextDev\Web\WebScreenshotParams\FullScreenshot;
1517
use ContextDev\Web\WebScreenshotParams\HandleCookiePopup;
1618
use ContextDev\Web\WebScreenshotParams\Page;
@@ -114,6 +116,7 @@ public function extractFonts(
114116
/**
115117
* @api
116118
*
119+
* @param ColorScheme|value-of<ColorScheme> $colorScheme Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
117120
* @param string $directURL A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
118121
* @param string $domain Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
119122
* @param int $maxAgeMs Maximum age in milliseconds for cached data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
@@ -123,6 +126,7 @@ public function extractFonts(
123126
* @throws APIException
124127
*/
125128
public function extractStyleguide(
129+
ColorScheme|string|null $colorScheme = null,
126130
?string $directURL = null,
127131
?string $domain = null,
128132
int $maxAgeMs = 7776000000,
@@ -133,6 +137,8 @@ public function extractStyleguide(
133137
/**
134138
* @api
135139
*
140+
* @param \ContextDev\Web\WebScreenshotParams\ColorScheme|value-of<\ContextDev\Web\WebScreenshotParams\ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.
141+
* @param Country|value-of<Country> $country Two-letter ISO 3166-1 alpha-2 country code for the website request location. When provided, Context.dev fetches the target page from that country.
136142
* @param string $directURL A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.
137143
* @param string $domain Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
138144
* @param FullScreenshot|value-of<FullScreenshot> $fullScreenshot Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).
@@ -148,6 +154,8 @@ public function extractStyleguide(
148154
* @throws APIException
149155
*/
150156
public function screenshot(
157+
\ContextDev\Web\WebScreenshotParams\ColorScheme|string|null $colorScheme = null,
158+
Country|string|null $country = null,
151159
?string $directURL = null,
152160
?string $domain = null,
153161
FullScreenshot|string|null $fullScreenshot = null,
@@ -164,11 +172,13 @@ public function screenshot(
164172
/**
165173
* @api
166174
*
167-
* @param string $query natural-language search query
175+
* @param string $query Search query. Accepts natural language as well as Google-style search operators such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.
176+
* @param \ContextDev\Web\WebSearchParams\Country|value-of<\ContextDev\Web\WebSearchParams\Country> $country Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
168177
* @param list<string> $excludeDomains Blocklist — drop results from these domains. Example: ["pinterest.com", "reddit.com"].
169178
* @param Freshness|value-of<Freshness> $freshness restrict results to content published within this window
170179
* @param list<string> $includeDomains Allowlist — only return results from these domains. Example: ["arxiv.org", "github.com"].
171180
* @param MarkdownOptions|MarkdownOptionsShape $markdownOptions Inline Markdown scraping for each result. Set `enabled: true` to activate.
181+
* @param int $numResults Number of results to request and return (10–100). Defaults to 10.
172182
* @param bool $queryFanout expand the query into multiple parallel variants for broader recall
173183
* @param int $timeoutMs 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).
174184
* @param RequestOpts|null $requestOptions
@@ -177,10 +187,12 @@ public function screenshot(
177187
*/
178188
public function search(
179189
string $query,
190+
\ContextDev\Web\WebSearchParams\Country|string|null $country = null,
180191
?array $excludeDomains = null,
181192
Freshness|string|null $freshness = null,
182193
?array $includeDomains = null,
183194
MarkdownOptions|array|null $markdownOptions = null,
195+
int $numResults = 10,
184196
?bool $queryFanout = null,
185197
?int $timeoutMs = null,
186198
RequestOptions|array|null $requestOptions = null,
@@ -190,6 +202,7 @@ public function search(
190202
* @api
191203
*
192204
* @param string $url The starting URL for the crawl (must include http:// or https:// protocol)
205+
* @param \ContextDev\Web\WebWebCrawlMdParams\Country|value-of<\ContextDev\Web\WebWebCrawlMdParams\Country> $country Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location. Must be one of Context.dev's supported countries. When provided, Context.dev fetches the target page from that country.
193206
* @param list<string> $excludeSelectors CSS selectors to remove before each crawled page is converted to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
194207
* @param bool $followSubdomains When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com). www and apex are always treated as equivalent.
195208
* @param bool $includeFrames when true, the contents of iframes are rendered to Markdown for each crawled page
@@ -212,6 +225,7 @@ public function search(
212225
*/
213226
public function webCrawlMd(
214227
string $url,
228+
\ContextDev\Web\WebWebCrawlMdParams\Country|string|null $country = null,
215229
?array $excludeSelectors = null,
216230
bool $followSubdomains = false,
217231
bool $includeFrames = false,
@@ -237,6 +251,7 @@ public function webCrawlMd(
237251
* @api
238252
*
239253
* @param string $url Full URL to scrape (must include http:// or https:// protocol)
254+
* @param \ContextDev\Web\WebWebScrapeHTMLParams\Country|value-of<\ContextDev\Web\WebWebScrapeHTMLParams\Country> $country Two-letter ISO 3166-1 alpha-2 country code for the website request location. When provided, Context.dev fetches the target page from that country.
240255
* @param list<string> $excludeSelectors CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
241256
* @param array<string,string> $headers Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.
242257
* @param bool $includeFrames when true, iframes are rendered inline into the returned HTML
@@ -252,6 +267,7 @@ public function webCrawlMd(
252267
*/
253268
public function webScrapeHTML(
254269
string $url,
270+
\ContextDev\Web\WebWebScrapeHTMLParams\Country|string|null $country = null,
255271
?array $excludeSelectors = null,
256272
?array $headers = null,
257273
bool $includeFrames = false,
@@ -293,6 +309,7 @@ public function webScrapeImages(
293309
* @api
294310
*
295311
* @param string $url Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)
312+
* @param \ContextDev\Web\WebWebScrapeMdParams\Country|value-of<\ContextDev\Web\WebWebScrapeMdParams\Country> $country Two-letter ISO 3166-1 alpha-2 country code for the website request location. When provided, Context.dev fetches the target page from that country.
296313
* @param list<string> $excludeSelectors CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
297314
* @param array<string,string> $headers Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.
298315
* @param bool $includeFrames when true, the contents of iframes are rendered to Markdown
@@ -311,6 +328,7 @@ public function webScrapeImages(
311328
*/
312329
public function webScrapeMd(
313330
string $url,
331+
\ContextDev\Web\WebWebScrapeMdParams\Country|string|null $country = null,
314332
?array $excludeSelectors = null,
315333
?array $headers = null,
316334
bool $includeFrames = false,

src/Services/WebRawService.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
use ContextDev\Web\WebExtractParams\Pdf;
1919
use ContextDev\Web\WebExtractResponse;
2020
use ContextDev\Web\WebExtractStyleguideParams;
21+
use ContextDev\Web\WebExtractStyleguideParams\ColorScheme;
2122
use ContextDev\Web\WebExtractStyleguideResponse;
2223
use ContextDev\Web\WebScreenshotParams;
24+
use ContextDev\Web\WebScreenshotParams\Country;
2325
use ContextDev\Web\WebScreenshotParams\FullScreenshot;
2426
use ContextDev\Web\WebScreenshotParams\HandleCookiePopup;
2527
use ContextDev\Web\WebScreenshotParams\Page;
@@ -179,7 +181,11 @@ public function extractFonts(
179181
* Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.
180182
*
181183
* @param array{
182-
* directURL?: string, domain?: string, maxAgeMs?: int, timeoutMs?: int
184+
* colorScheme?: ColorScheme|value-of<ColorScheme>,
185+
* directURL?: string,
186+
* domain?: string,
187+
* maxAgeMs?: int,
188+
* timeoutMs?: int,
183189
* }|WebExtractStyleguideParams $params
184190
* @param RequestOpts|null $requestOptions
185191
*
@@ -215,6 +221,8 @@ public function extractStyleguide(
215221
* Capture a screenshot of a website.
216222
*
217223
* @param array{
224+
* colorScheme?: WebScreenshotParams\ColorScheme|value-of<WebScreenshotParams\ColorScheme>,
225+
* country?: value-of<Country>,
218226
* directURL?: string,
219227
* domain?: string,
220228
* fullScreenshot?: FullScreenshot|value-of<FullScreenshot>,
@@ -261,10 +269,12 @@ public function screenshot(
261269
*
262270
* @param array{
263271
* query: string,
272+
* country?: value-of<WebSearchParams\Country>,
264273
* excludeDomains?: list<string>,
265274
* freshness?: Freshness|value-of<Freshness>,
266275
* includeDomains?: list<string>,
267276
* markdownOptions?: MarkdownOptions|MarkdownOptionsShape,
277+
* numResults?: int,
268278
* queryFanout?: bool,
269279
* timeoutMs?: int,
270280
* }|WebSearchParams $params
@@ -300,6 +310,7 @@ public function search(
300310
*
301311
* @param array{
302312
* url: string,
313+
* country?: value-of<WebWebCrawlMdParams\Country>,
303314
* excludeSelectors?: list<string>,
304315
* followSubdomains?: bool,
305316
* includeFrames?: bool,
@@ -349,6 +360,7 @@ public function webCrawlMd(
349360
*
350361
* @param array{
351362
* url: string,
363+
* country?: value-of<WebWebScrapeHTMLParams\Country>,
352364
* excludeSelectors?: list<string>,
353365
* headers?: array<string,string>,
354366
* includeFrames?: bool,
@@ -429,6 +441,7 @@ public function webScrapeImages(
429441
*
430442
* @param array{
431443
* url: string,
444+
* country?: value-of<WebWebScrapeMdParams\Country>,
432445
* excludeSelectors?: list<string>,
433446
* headers?: array<string,string>,
434447
* includeFrames?: bool,

0 commit comments

Comments
 (0)