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.1.0"
".": "2.2.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-51ebe668b198157ccb18984017dd2fe35f7675220e8b933b03325b3c459ef2a6.yml
openapi_spec_hash: b3ed94bd6b59d4e32fc2c5aa8187d6b2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-ecb277557634e2f0838ea196e2b21f11924f65e133c7977e8c2e1a603b8df466.yml
openapi_spec_hash: 798ce4cb042389a1179bf9af6fc1173d
config_hash: ff35e224e809656528c44163aa41bebd
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.2.0 (2026-07-10)

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

### Features

* **api:** api update ([14b65ba](https://github.com/context-dot-dev/context-php-sdk/commit/14b65ba7875c717bb23af5a2e980218b3ad93161))
* **api:** api update ([7638330](https://github.com/context-dot-dev/context-php-sdk/commit/7638330d9020cc4ba1326845700619d110dffe54))

## 2.1.0 (2026-07-08)

Full Changelog: [v2.0.0...v2.1.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.0.0...v2.1.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte
<!-- x-release-please-start-version -->

```
composer require "context-dev/context-dev-php 2.1.0"
composer require "context-dev/context-dev-php 2.2.0"
```

<!-- x-release-please-end -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ContextDev\Core\Contracts\BaseModel;

/**
* 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`.
* Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
*
* @phpstan-type MonitorsSemanticChangeDetectionShape = array{
* type: 'semantic', confidenceThreshold?: float|null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ContextDev\Core\Contracts\BaseModel;

/**
* 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.
* 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 for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.
*
* @phpstan-type MonitorsExtractTargetShape = array{
* instructions: string,
Expand Down Expand Up @@ -59,7 +59,7 @@ final class MonitorsExtractTarget implements BaseModel
public ?int $maxPages;

/**
* 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.
* JSON Schema describing the data you care about. It is used three ways: it guides which pages are selected for tracking, it gives the change judge extra context on which changes matter (alongside `instructions`), and it defines the shape of the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most about once a day). It is not a response format for changes: change events and webhook payloads always contain diffs, summaries, and evidence excerpts — never data in this schema's shape. If omitted, a default summary + key-points schema is used.
*
* @var array<string,mixed>|null $schema
*/
Expand Down Expand Up @@ -177,7 +177,7 @@ public function withMaxPages(int $maxPages): self
}

/**
* 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.
* JSON Schema describing the data you care about. It is used three ways: it guides which pages are selected for tracking, it gives the change judge extra context on which changes matter (alongside `instructions`), and it defines the shape of the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most about once a day). It is not a response format for changes: change events and webhook payloads always contain diffs, summaries, and evidence excerpts — never data in this schema's shape. If omitted, a default summary + key-points schema is used.
*
* @param array<string,mixed> $schema
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ContextDev\Core\Contracts\BaseModel;

/**
* 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`.
* Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
*
* @phpstan-type MonitorsSemanticChangeDetectionShape = array{
* type: 'semantic', confidenceThreshold?: float|null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ContextDev\Core\Contracts\BaseModel;

/**
* 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.
* 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 for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.
*
* @phpstan-type MonitorsExtractTargetShape = array{
* instructions: string,
Expand Down Expand Up @@ -59,7 +59,7 @@ final class MonitorsExtractTarget implements BaseModel
public ?int $maxPages;

/**
* 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.
* JSON Schema describing the data you care about. It is used three ways: it guides which pages are selected for tracking, it gives the change judge extra context on which changes matter (alongside `instructions`), and it defines the shape of the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most about once a day). It is not a response format for changes: change events and webhook payloads always contain diffs, summaries, and evidence excerpts — never data in this schema's shape. If omitted, a default summary + key-points schema is used.
*
* @var array<string,mixed>|null $schema
*/
Expand Down Expand Up @@ -177,7 +177,7 @@ public function withMaxPages(int $maxPages): self
}

/**
* 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.
* JSON Schema describing the data you care about. It is used three ways: it guides which pages are selected for tracking, it gives the change judge extra context on which changes matter (alongside `instructions`), and it defines the shape of the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most about once a day). It is not a response format for changes: change events and webhook payloads always contain diffs, summaries, and evidence excerpts — never data in this schema's shape. If omitted, a default summary + key-points schema is used.
*
* @param array<string,mixed> $schema
*/
Expand Down
26 changes: 26 additions & 0 deletions src/Monitors/MonitorListAccountRunsResponse/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
use ContextDev\Monitors\MonitorListAccountRunsResponse\Data\SkipReason;
use ContextDev\Monitors\MonitorListAccountRunsResponse\Data\Status;
use ContextDev\Monitors\MonitorListAccountRunsResponse\Data\TargetType;
use ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery;

/**
* @phpstan-import-type ErrorShape from \ContextDev\Monitors\MonitorListAccountRunsResponse\Data\Error
* @phpstan-import-type WebhookDeliveryShape from \ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery
*
* @phpstan-type DataShape = array{
* id: string,
Expand All @@ -33,6 +35,7 @@
* error?: null|Error|ErrorShape,
* skipReason?: null|SkipReason|value-of<SkipReason>,
* startedAt?: \DateTimeInterface|null,
* webhookDelivery?: null|WebhookDelivery|WebhookDeliveryShape,
* }
*/
final class Data implements BaseModel
Expand Down Expand Up @@ -105,6 +108,12 @@ final class Data implements BaseModel
#[Optional('started_at', nullable: true)]
public ?\DateTimeInterface $startedAt;

/**
* The webhook delivery attempted for a change detected by this run. Omitted when no webhook was attempted, including historical runs created before delivery tracking was added.
*/
#[Optional('webhook_delivery')]
public ?WebhookDelivery $webhookDelivery;

/**
* `new Data()` is missing required properties by the API.
*
Expand Down Expand Up @@ -154,6 +163,7 @@ public function __construct()
* @param TargetType|value-of<TargetType> $targetType
* @param Error|ErrorShape|null $error
* @param SkipReason|value-of<SkipReason>|null $skipReason
* @param WebhookDelivery|WebhookDeliveryShape|null $webhookDelivery
*/
public static function with(
string $id,
Expand All @@ -170,6 +180,7 @@ public static function with(
Error|array|null $error = null,
SkipReason|string|null $skipReason = null,
?\DateTimeInterface $startedAt = null,
WebhookDelivery|array|null $webhookDelivery = null,
): self {
$self = new self;

Expand All @@ -188,6 +199,7 @@ public static function with(
null !== $error && $self['error'] = $error;
null !== $skipReason && $self['skipReason'] = $skipReason;
null !== $startedAt && $self['startedAt'] = $startedAt;
null !== $webhookDelivery && $self['webhookDelivery'] = $webhookDelivery;

return $self;
}
Expand Down Expand Up @@ -334,4 +346,18 @@ public function withStartedAt(?\DateTimeInterface $startedAt): self

return $self;
}

/**
* The webhook delivery attempted for a change detected by this run. Omitted when no webhook was attempted, including historical runs created before delivery tracking was added.
*
* @param WebhookDelivery|WebhookDeliveryShape $webhookDelivery
*/
public function withWebhookDelivery(
WebhookDelivery|array $webhookDelivery
): self {
$self = clone $this;
$self['webhookDelivery'] = $webhookDelivery;

return $self;
}
}
166 changes: 166 additions & 0 deletions src/Monitors/MonitorListAccountRunsResponse/Data/WebhookDelivery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?php

declare(strict_types=1);

namespace ContextDev\Monitors\MonitorListAccountRunsResponse\Data;

use ContextDev\Core\Attributes\Required;
use ContextDev\Core\Concerns\SdkModel;
use ContextDev\Core\Contracts\BaseModel;
use ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery\Error;
use ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery\Status;

/**
* The webhook delivery attempted for a change detected by this run. Omitted when no webhook was attempted, including historical runs created before delivery tracking was added.
*
* @phpstan-import-type ErrorShape from \ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery\Error
*
* @phpstan-type WebhookDeliveryShape = array{
* attemptedAt: \DateTimeInterface,
* error: null|\ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery\Error|ErrorShape,
* eventID: string,
* httpStatus: int|null,
* status: \ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery\Status|value-of<\ContextDev\Monitors\MonitorListAccountRunsResponse\Data\WebhookDelivery\Status>,
* }
*/
final class WebhookDelivery implements BaseModel
{
/** @use SdkModel<WebhookDeliveryShape> */
use SdkModel;

#[Required('attempted_at')]
public \DateTimeInterface $attemptedAt;

#[Required]
public ?Error $error;

/**
* Identifier sent in the X-Context-Id header.
*/
#[Required('event_id')]
public string $eventID;

/**
* The endpoint's final HTTP response status, or null when no response was received.
*/
#[Required('http_status')]
public ?int $httpStatus;

/**
* Delivery outcome. delivered means any 2xx response; rejected means a non-2xx response; failed means no HTTP response was received; skipped_unsafe_url means the URL failed the public-endpoint safety check.
*
* @var value-of<Status> $status
*/
#[Required(
enum: Status::class,
)]
public string $status;

/**
* `new WebhookDelivery()` is missing required properties by the API.
*
* To enforce required parameters use
* ```
* WebhookDelivery::with(
* attemptedAt: ..., error: ..., eventID: ..., httpStatus: ..., status: ...
* )
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new WebhookDelivery)
* ->withAttemptedAt(...)
* ->withError(...)
* ->withEventID(...)
* ->withHTTPStatus(...)
* ->withStatus(...)
* ```
*/
public function __construct()
{
$this->initialize();
}

/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Error|ErrorShape|null $error
* @param Status|value-of<Status> $status
*/
public static function with(
\DateTimeInterface $attemptedAt,
Error|array|null $error,
string $eventID,
?int $httpStatus,
Status|string $status,
): self {
$self = new self;

$self['attemptedAt'] = $attemptedAt;
$self['error'] = $error;
$self['eventID'] = $eventID;
$self['httpStatus'] = $httpStatus;
$self['status'] = $status;

return $self;
}

public function withAttemptedAt(\DateTimeInterface $attemptedAt): self
{
$self = clone $this;
$self['attemptedAt'] = $attemptedAt;

return $self;
}

/**
* @param Error|ErrorShape|null $error
*/
public function withError(
Error|array|null $error,
): self {
$self = clone $this;
$self['error'] = $error;

return $self;
}

/**
* Identifier sent in the X-Context-Id header.
*/
public function withEventID(string $eventID): self
{
$self = clone $this;
$self['eventID'] = $eventID;

return $self;
}

/**
* The endpoint's final HTTP response status, or null when no response was received.
*/
public function withHTTPStatus(?int $httpStatus): self
{
$self = clone $this;
$self['httpStatus'] = $httpStatus;

return $self;
}

/**
* Delivery outcome. delivered means any 2xx response; rejected means a non-2xx response; failed means no HTTP response was received; skipped_unsafe_url means the URL failed the public-endpoint safety check.
*
* @param Status|value-of<Status> $status
*/
public function withStatus(
Status|string $status,
): self {
$self = clone $this;
$self['status'] = $status;

return $self;
}
}
Loading