Skip to content

Commit 43899a3

Browse files
authored
Merge pull request #9 from context-dot-dev/release-please--branches--main--changes--next
release: 2.1.0
2 parents 2b8b904 + ad709f0 commit 43899a3

54 files changed

Lines changed: 1855 additions & 393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0"
2+
".": "2.1.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: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7dbd739a81e6aaf7fc7ef1858606e7d572d309af55082a66431d9292e655e66f.yml
3-
openapi_spec_hash: a6374d5d718a7bd9d3d54fb657e2bd9d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-51ebe668b198157ccb18984017dd2fe35f7675220e8b933b03325b3c459ef2a6.yml
3+
openapi_spec_hash: b3ed94bd6b59d4e32fc2c5aa8187d6b2
44
config_hash: ff35e224e809656528c44163aa41bebd

CHANGELOG.md

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

3+
## 2.1.0 (2026-07-08)
4+
5+
Full Changelog: [v2.0.0...v2.1.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.0.0...v2.1.0)
6+
7+
### Features
8+
9+
* **api:** api update ([efb4692](https://github.com/context-dot-dev/context-php-sdk/commit/efb469262cfa86a8b362131a90c0ccacabf3e7c9))
10+
* **api:** api update ([5e090db](https://github.com/context-dot-dev/context-php-sdk/commit/5e090db2c8b5430cf5818984c928831952dcbb32))
11+
* **api:** api update ([3503b7b](https://github.com/context-dot-dev/context-php-sdk/commit/3503b7b911e5e6992406040ecb82c6d8f7711243))
12+
* **api:** api update ([5b92377](https://github.com/context-dot-dev/context-php-sdk/commit/5b9237711f3ad827a51e6166d71e69fab8fd37dd))
13+
314
## 2.0.0 (2026-07-06)
415

516
Full Changelog: [v1.3.0...v2.0.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.3.0...v2.0.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 2.0.0"
16+
composer require "context-dev/context-dev-php 2.1.0"
1717
```
1818

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

src/Brand/BrandRetrieveParams.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use ContextDev\Core\Contracts\BaseModel;
1414

1515
/**
16-
* 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.
16+
* 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, transaction descriptor, or direct URL. Note: `by_direct_url` fetches brand data only from the provided URL — not from the entire internet.
1717
*
1818
* @see ContextDev\Services\BrandService::retrieve()
1919
*
@@ -29,6 +29,7 @@
2929
* email: string,
3030
* ticker: string,
3131
* tickerExchange?: string|null,
32+
* directURL: string,
3233
* transactionInfo: string,
3334
* city?: string|null,
3435
* highConfidenceOnly?: bool|null,
@@ -108,6 +109,12 @@ final class BrandRetrieveParams implements BaseModel
108109
#[Optional('ticker_exchange')]
109110
public ?string $tickerExchange;
110111

112+
/**
113+
* Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire internet.
114+
*/
115+
#[Required('direct_url')]
116+
public string $directURL;
117+
111118
/**
112119
* Transaction information to identify the brand.
113120
*/
@@ -149,6 +156,7 @@ final class BrandRetrieveParams implements BaseModel
149156
* name: ...,
150157
* email: ...,
151158
* ticker: ...,
159+
* directURL: ...,
152160
* transactionInfo: ...,
153161
* )
154162
* ```
@@ -162,6 +170,7 @@ final class BrandRetrieveParams implements BaseModel
162170
* ->withName(...)
163171
* ->withEmail(...)
164172
* ->withTicker(...)
173+
* ->withDirectURL(...)
165174
* ->withTransactionInfo(...)
166175
* ```
167176
*/
@@ -184,6 +193,7 @@ public static function with(
184193
string $name,
185194
string $email,
186195
string $ticker,
196+
string $directURL,
187197
string $transactionInfo,
188198
ForceLanguage|string|null $forceLanguage = null,
189199
?int $maxAgeMs = null,
@@ -203,6 +213,7 @@ public static function with(
203213
$self['name'] = $name;
204214
$self['email'] = $email;
205215
$self['ticker'] = $ticker;
216+
$self['directURL'] = $directURL;
206217
$self['transactionInfo'] = $transactionInfo;
207218

208219
null !== $forceLanguage && $self['forceLanguage'] = $forceLanguage;
@@ -342,6 +353,17 @@ public function withTickerExchange(string $tickerExchange): self
342353
return $self;
343354
}
344355

356+
/**
357+
* Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire internet.
358+
*/
359+
public function withDirectURL(string $directURL): self
360+
{
361+
$self = clone $this;
362+
$self['directURL'] = $directURL;
363+
364+
return $self;
365+
}
366+
345367
/**
346368
* Transaction information to identify the brand.
347369
*/

src/Monitors/MonitorCreateParams/ChangeDetection/MonitorsSemanticChangeDetection.php

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
use ContextDev\Core\Contracts\BaseModel;
1111

1212
/**
13-
* Detect meaning-level changes that match a natural language query.
13+
* 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`.
1414
*
1515
* @phpstan-type MonitorsSemanticChangeDetectionShape = array{
16-
* query: string, type: 'semantic', confidenceThreshold?: float|null
16+
* type: 'semantic', confidenceThreshold?: float|null
1717
* }
1818
*/
1919
final class MonitorsSemanticChangeDetection implements BaseModel
@@ -25,26 +25,9 @@ final class MonitorsSemanticChangeDetection implements BaseModel
2525
#[Required]
2626
public string $type = 'semantic';
2727

28-
#[Required]
29-
public string $query;
30-
3128
#[Optional('confidence_threshold')]
3229
public ?float $confidenceThreshold;
3330

34-
/**
35-
* `new MonitorsSemanticChangeDetection()` is missing required properties by the API.
36-
*
37-
* To enforce required parameters use
38-
* ```
39-
* MonitorsSemanticChangeDetection::with(query: ...)
40-
* ```
41-
*
42-
* Otherwise ensure the following setters are called
43-
*
44-
* ```
45-
* (new MonitorsSemanticChangeDetection)->withQuery(...)
46-
* ```
47-
*/
4831
public function __construct()
4932
{
5033
$this->initialize();
@@ -55,27 +38,15 @@ public function __construct()
5538
*
5639
* You must use named parameters to construct any parameters with a default value.
5740
*/
58-
public static function with(
59-
string $query,
60-
?float $confidenceThreshold = null
61-
): self {
41+
public static function with(?float $confidenceThreshold = null): self
42+
{
6243
$self = new self;
6344

64-
$self['query'] = $query;
65-
6645
null !== $confidenceThreshold && $self['confidenceThreshold'] = $confidenceThreshold;
6746

6847
return $self;
6948
}
7049

71-
public function withQuery(string $query): self
72-
{
73-
$self = clone $this;
74-
$self['query'] = $query;
75-
76-
return $self;
77-
}
78-
7950
/**
8051
* @param 'semantic' $type
8152
*/

src/Monitors/MonitorCreateParams/Target/MonitorsExtractTarget.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
use ContextDev\Core\Contracts\BaseModel;
1111

1212
/**
13-
* Watch a site's extracted structured data.
13+
* 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.
1414
*
1515
* @phpstan-type MonitorsExtractTargetShape = array{
16+
* instructions: string,
1617
* type: 'extract',
1718
* url: string,
1819
* followSubdomains?: bool|null,
19-
* instructions?: string|null,
2020
* maxDepth?: int|null,
2121
* maxPages?: int|null,
2222
* schema?: array<string,mixed>|null,
@@ -31,6 +31,12 @@ final class MonitorsExtractTarget implements BaseModel
3131
#[Required]
3232
public string $type = 'extract';
3333

34+
/**
35+
* Natural-language instructions guiding which pages and facts to track and which changes to report.
36+
*/
37+
#[Required]
38+
public string $instructions;
39+
3440
/**
3541
* Root URL to extract structured data from.
3642
*/
@@ -40,26 +46,20 @@ final class MonitorsExtractTarget implements BaseModel
4046
#[Optional('follow_subdomains')]
4147
public ?bool $followSubdomains;
4248

43-
/**
44-
* Optional natural-language instructions guiding what to extract.
45-
*/
46-
#[Optional]
47-
public ?string $instructions;
48-
4949
/**
5050
* Optional maximum link depth from the starting URL (0 = only the starting page).
5151
*/
5252
#[Optional('max_depth')]
5353
public ?int $maxDepth;
5454

5555
/**
56-
* Maximum number of pages to analyze during extraction.
56+
* Maximum number of pages to track.
5757
*/
5858
#[Optional('max_pages')]
5959
public ?int $maxPages;
6060

6161
/**
62-
* JSON Schema describing the structured data to extract and watch for changes. If omitted, a default summary + key-points schema is used.
62+
* 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.
6363
*
6464
* @var array<string,mixed>|null $schema
6565
*/
@@ -71,13 +71,13 @@ final class MonitorsExtractTarget implements BaseModel
7171
*
7272
* To enforce required parameters use
7373
* ```
74-
* MonitorsExtractTarget::with(url: ...)
74+
* MonitorsExtractTarget::with(instructions: ..., url: ...)
7575
* ```
7676
*
7777
* Otherwise ensure the following setters are called
7878
*
7979
* ```
80-
* (new MonitorsExtractTarget)->withURL(...)
80+
* (new MonitorsExtractTarget)->withInstructions(...)->withURL(...)
8181
* ```
8282
*/
8383
public function __construct()
@@ -93,26 +93,37 @@ public function __construct()
9393
* @param array<string,mixed>|null $schema
9494
*/
9595
public static function with(
96+
string $instructions,
9697
string $url,
9798
?bool $followSubdomains = null,
98-
?string $instructions = null,
9999
?int $maxDepth = null,
100100
?int $maxPages = null,
101101
?array $schema = null,
102102
): self {
103103
$self = new self;
104104

105+
$self['instructions'] = $instructions;
105106
$self['url'] = $url;
106107

107108
null !== $followSubdomains && $self['followSubdomains'] = $followSubdomains;
108-
null !== $instructions && $self['instructions'] = $instructions;
109109
null !== $maxDepth && $self['maxDepth'] = $maxDepth;
110110
null !== $maxPages && $self['maxPages'] = $maxPages;
111111
null !== $schema && $self['schema'] = $schema;
112112

113113
return $self;
114114
}
115115

116+
/**
117+
* Natural-language instructions guiding which pages and facts to track and which changes to report.
118+
*/
119+
public function withInstructions(string $instructions): self
120+
{
121+
$self = clone $this;
122+
$self['instructions'] = $instructions;
123+
124+
return $self;
125+
}
126+
116127
/**
117128
* @param 'extract' $type
118129
*/
@@ -143,17 +154,6 @@ public function withFollowSubdomains(bool $followSubdomains): self
143154
return $self;
144155
}
145156

146-
/**
147-
* Optional natural-language instructions guiding what to extract.
148-
*/
149-
public function withInstructions(string $instructions): self
150-
{
151-
$self = clone $this;
152-
$self['instructions'] = $instructions;
153-
154-
return $self;
155-
}
156-
157157
/**
158158
* Optional maximum link depth from the starting URL (0 = only the starting page).
159159
*/
@@ -166,7 +166,7 @@ public function withMaxDepth(int $maxDepth): self
166166
}
167167

168168
/**
169-
* Maximum number of pages to analyze during extraction.
169+
* Maximum number of pages to track.
170170
*/
171171
public function withMaxPages(int $maxPages): self
172172
{
@@ -177,7 +177,7 @@ public function withMaxPages(int $maxPages): self
177177
}
178178

179179
/**
180-
* JSON Schema describing the structured data to extract and watch for changes. If omitted, a default summary + key-points schema is used.
180+
* 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.
181181
*
182182
* @param array<string,mixed> $schema
183183
*/

src/Monitors/MonitorCreateParams/Target/MonitorsSitemapTarget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use ContextDev\Core\Contracts\BaseModel;
1111

1212
/**
13-
* 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.
13+
* 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.
1414
*
1515
* @phpstan-type MonitorsSitemapTargetShape = array{
1616
* type: 'sitemap',

src/Monitors/MonitorGetChangeResponse.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
* importance?: null|Importance|value-of<Importance>,
4141
* matchedURLCount?: int|null,
4242
* matchedURLs?: list<string>|null,
43-
* query?: string|null,
4443
* removedURLCount?: int|null,
4544
* removedURLs?: list<string>|null,
4645
* tags?: list<string>|null,
@@ -136,9 +135,6 @@ final class MonitorGetChangeResponse implements BaseModel
136135
#[Optional('matched_urls', list: 'string')]
137136
public ?array $matchedURLs;
138137

139-
#[Optional]
140-
public ?string $query;
141-
142138
#[Optional('removed_url_count')]
143139
public ?int $removedURLCount;
144140

@@ -234,7 +230,6 @@ public static function with(
234230
Importance|string|null $importance = null,
235231
?int $matchedURLCount = null,
236232
?array $matchedURLs = null,
237-
?string $query = null,
238233
?int $removedURLCount = null,
239234
?array $removedURLs = null,
240235
?array $tags = null,
@@ -262,7 +257,6 @@ public static function with(
262257
null !== $importance && $self['importance'] = $importance;
263258
null !== $matchedURLCount && $self['matchedURLCount'] = $matchedURLCount;
264259
null !== $matchedURLs && $self['matchedURLs'] = $matchedURLs;
265-
null !== $query && $self['query'] = $query;
266260
null !== $removedURLCount && $self['removedURLCount'] = $removedURLCount;
267261
null !== $removedURLs && $self['removedURLs'] = $removedURLs;
268262
null !== $tags && $self['tags'] = $tags;
@@ -464,14 +458,6 @@ public function withMatchedURLs(array $matchedURLs): self
464458
return $self;
465459
}
466460

467-
public function withQuery(string $query): self
468-
{
469-
$self = clone $this;
470-
$self['query'] = $query;
471-
472-
return $self;
473-
}
474-
475461
public function withRemovedURLCount(int $removedURLCount): self
476462
{
477463
$self = clone $this;

0 commit comments

Comments
 (0)