From 68826ea12d631dd6abeb2ee4f2fcbc97269be350 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:22:44 +0000 Subject: [PATCH 1/5] feat(api): api update --- .stats.yml | 4 +- monitor.go | 536 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 526 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index f52f430..df5918b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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-6fd8cb15c904d1befd41a85ef8ffa3dfda11e60d560e466857e331e177e0c1e1.yml +openapi_spec_hash: 0f969f518e16e4fc41d00a5229705f5f config_hash: ff35e224e809656528c44163aa41bebd diff --git a/monitor.go b/monitor.go index 4d40ab3..097b019 100644 --- a/monitor.go +++ b/monitor.go @@ -193,9 +193,14 @@ type MonitorNewResponse struct { // Any of "active", "paused", "failed". Status MonitorNewResponseStatus `json:"status" api:"required"` // Discriminated union describing what the monitor watches. - Target MonitorNewResponseTargetUnion `json:"target" api:"required"` - UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` - LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` + Target MonitorNewResponseTargetUnion `json:"target" api:"required"` + UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` + // Current baseline: the last observed value the monitor compares new snapshots + // against. Its shape follows `target.type` (page/sitemap/extract). Only populated + // on GET /monitors/{monitor_id}; null until the first baseline run completes (and + // after a target or change_detection update, which resets the baseline). + Baseline MonitorNewResponseBaselineUnion `json:"baseline" api:"nullable"` + LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` // Error from the most recent failed run; null when the last run succeeded. LastError MonitorNewResponseLastError `json:"last_error" api:"nullable"` LastRunAt time.Time `json:"last_run_at" api:"nullable" format:"date-time"` @@ -215,6 +220,7 @@ type MonitorNewResponse struct { Status respjson.Field Target respjson.Field UpdatedAt respjson.Field + Baseline respjson.Field LastChangeAt respjson.Field LastError respjson.Field LastRunAt respjson.Field @@ -576,6 +582,128 @@ func (r *MonitorNewResponseTargetExtract) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// MonitorNewResponseBaselineUnion contains all possible properties and values from +// [MonitorNewResponseBaselinePageBaseline], +// [MonitorNewResponseBaselineSitemapBaseline], +// [MonitorNewResponseBaselineExtractBaseline]. +// +// Use the methods beginning with 'As' to cast the union to one of its variants. +type MonitorNewResponseBaselineUnion struct { + CapturedAt time.Time `json:"captured_at"` + // This field is from variant [MonitorNewResponseBaselinePageBaseline]. + Text string `json:"text"` + // This field is from variant [MonitorNewResponseBaselineSitemapBaseline]. + URLCount int64 `json:"url_count"` + // This field is from variant [MonitorNewResponseBaselineSitemapBaseline]. + URLs []string `json:"urls"` + // This field is from variant [MonitorNewResponseBaselineExtractBaseline]. + Data any `json:"data"` + // This field is from variant [MonitorNewResponseBaselineExtractBaseline]. + URLsAnalyzed []string `json:"urls_analyzed"` + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + URLCount respjson.Field + URLs respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + raw string + } `json:"-"` +} + +func (u MonitorNewResponseBaselineUnion) AsPageBaseline() (v MonitorNewResponseBaselinePageBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorNewResponseBaselineUnion) AsSitemapBaseline() (v MonitorNewResponseBaselineSitemapBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorNewResponseBaselineUnion) AsExtractBaseline() (v MonitorNewResponseBaselineExtractBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +// Returns the unmodified JSON received from the API +func (u MonitorNewResponseBaselineUnion) RawJSON() string { return u.JSON.raw } + +func (r *MonitorNewResponseBaselineUnion) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `page` monitor: the visible page text as last observed. +type MonitorNewResponseBaselinePageBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The page's visible text as last observed. + Text string `json:"text" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorNewResponseBaselinePageBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorNewResponseBaselinePageBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `sitemap` monitor: the normalized URL set as last +// observed. +type MonitorNewResponseBaselineSitemapBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // Number of URLs in the baseline. + URLCount int64 `json:"url_count" api:"required"` + // The sitemap URLs as last observed (sorted, normalized). + URLs []string `json:"urls" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + URLCount respjson.Field + URLs respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorNewResponseBaselineSitemapBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorNewResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of an `extract` monitor: the structured data as last extracted. +type MonitorNewResponseBaselineExtractBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The extracted structured data, matching the monitor's extraction schema (same + // shape as the /web/extract endpoint's `data`). + Data any `json:"data" api:"required"` + // URLs that were analyzed to produce the extracted data. + URLsAnalyzed []string `json:"urls_analyzed" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorNewResponseBaselineExtractBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorNewResponseBaselineExtractBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Error from the most recent failed run; null when the last run succeeded. type MonitorNewResponseLastError struct { Code string `json:"code" api:"required"` @@ -645,9 +773,14 @@ type MonitorGetResponse struct { // Any of "active", "paused", "failed". Status MonitorGetResponseStatus `json:"status" api:"required"` // Discriminated union describing what the monitor watches. - Target MonitorGetResponseTargetUnion `json:"target" api:"required"` - UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` - LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` + Target MonitorGetResponseTargetUnion `json:"target" api:"required"` + UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` + // Current baseline: the last observed value the monitor compares new snapshots + // against. Its shape follows `target.type` (page/sitemap/extract). Only populated + // on GET /monitors/{monitor_id}; null until the first baseline run completes (and + // after a target or change_detection update, which resets the baseline). + Baseline MonitorGetResponseBaselineUnion `json:"baseline" api:"nullable"` + LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` // Error from the most recent failed run; null when the last run succeeded. LastError MonitorGetResponseLastError `json:"last_error" api:"nullable"` LastRunAt time.Time `json:"last_run_at" api:"nullable" format:"date-time"` @@ -667,6 +800,7 @@ type MonitorGetResponse struct { Status respjson.Field Target respjson.Field UpdatedAt respjson.Field + Baseline respjson.Field LastChangeAt respjson.Field LastError respjson.Field LastRunAt respjson.Field @@ -1028,6 +1162,128 @@ func (r *MonitorGetResponseTargetExtract) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// MonitorGetResponseBaselineUnion contains all possible properties and values from +// [MonitorGetResponseBaselinePageBaseline], +// [MonitorGetResponseBaselineSitemapBaseline], +// [MonitorGetResponseBaselineExtractBaseline]. +// +// Use the methods beginning with 'As' to cast the union to one of its variants. +type MonitorGetResponseBaselineUnion struct { + CapturedAt time.Time `json:"captured_at"` + // This field is from variant [MonitorGetResponseBaselinePageBaseline]. + Text string `json:"text"` + // This field is from variant [MonitorGetResponseBaselineSitemapBaseline]. + URLCount int64 `json:"url_count"` + // This field is from variant [MonitorGetResponseBaselineSitemapBaseline]. + URLs []string `json:"urls"` + // This field is from variant [MonitorGetResponseBaselineExtractBaseline]. + Data any `json:"data"` + // This field is from variant [MonitorGetResponseBaselineExtractBaseline]. + URLsAnalyzed []string `json:"urls_analyzed"` + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + URLCount respjson.Field + URLs respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + raw string + } `json:"-"` +} + +func (u MonitorGetResponseBaselineUnion) AsPageBaseline() (v MonitorGetResponseBaselinePageBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorGetResponseBaselineUnion) AsSitemapBaseline() (v MonitorGetResponseBaselineSitemapBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorGetResponseBaselineUnion) AsExtractBaseline() (v MonitorGetResponseBaselineExtractBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +// Returns the unmodified JSON received from the API +func (u MonitorGetResponseBaselineUnion) RawJSON() string { return u.JSON.raw } + +func (r *MonitorGetResponseBaselineUnion) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `page` monitor: the visible page text as last observed. +type MonitorGetResponseBaselinePageBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The page's visible text as last observed. + Text string `json:"text" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorGetResponseBaselinePageBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorGetResponseBaselinePageBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `sitemap` monitor: the normalized URL set as last +// observed. +type MonitorGetResponseBaselineSitemapBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // Number of URLs in the baseline. + URLCount int64 `json:"url_count" api:"required"` + // The sitemap URLs as last observed (sorted, normalized). + URLs []string `json:"urls" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + URLCount respjson.Field + URLs respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorGetResponseBaselineSitemapBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorGetResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of an `extract` monitor: the structured data as last extracted. +type MonitorGetResponseBaselineExtractBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The extracted structured data, matching the monitor's extraction schema (same + // shape as the /web/extract endpoint's `data`). + Data any `json:"data" api:"required"` + // URLs that were analyzed to produce the extracted data. + URLsAnalyzed []string `json:"urls_analyzed" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorGetResponseBaselineExtractBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorGetResponseBaselineExtractBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Error from the most recent failed run; null when the last run succeeded. type MonitorGetResponseLastError struct { Code string `json:"code" api:"required"` @@ -1097,9 +1353,14 @@ type MonitorUpdateResponse struct { // Any of "active", "paused", "failed". Status MonitorUpdateResponseStatus `json:"status" api:"required"` // Discriminated union describing what the monitor watches. - Target MonitorUpdateResponseTargetUnion `json:"target" api:"required"` - UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` - LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` + Target MonitorUpdateResponseTargetUnion `json:"target" api:"required"` + UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` + // Current baseline: the last observed value the monitor compares new snapshots + // against. Its shape follows `target.type` (page/sitemap/extract). Only populated + // on GET /monitors/{monitor_id}; null until the first baseline run completes (and + // after a target or change_detection update, which resets the baseline). + Baseline MonitorUpdateResponseBaselineUnion `json:"baseline" api:"nullable"` + LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` // Error from the most recent failed run; null when the last run succeeded. LastError MonitorUpdateResponseLastError `json:"last_error" api:"nullable"` LastRunAt time.Time `json:"last_run_at" api:"nullable" format:"date-time"` @@ -1119,6 +1380,7 @@ type MonitorUpdateResponse struct { Status respjson.Field Target respjson.Field UpdatedAt respjson.Field + Baseline respjson.Field LastChangeAt respjson.Field LastError respjson.Field LastRunAt respjson.Field @@ -1481,6 +1743,128 @@ func (r *MonitorUpdateResponseTargetExtract) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// MonitorUpdateResponseBaselineUnion contains all possible properties and values +// from [MonitorUpdateResponseBaselinePageBaseline], +// [MonitorUpdateResponseBaselineSitemapBaseline], +// [MonitorUpdateResponseBaselineExtractBaseline]. +// +// Use the methods beginning with 'As' to cast the union to one of its variants. +type MonitorUpdateResponseBaselineUnion struct { + CapturedAt time.Time `json:"captured_at"` + // This field is from variant [MonitorUpdateResponseBaselinePageBaseline]. + Text string `json:"text"` + // This field is from variant [MonitorUpdateResponseBaselineSitemapBaseline]. + URLCount int64 `json:"url_count"` + // This field is from variant [MonitorUpdateResponseBaselineSitemapBaseline]. + URLs []string `json:"urls"` + // This field is from variant [MonitorUpdateResponseBaselineExtractBaseline]. + Data any `json:"data"` + // This field is from variant [MonitorUpdateResponseBaselineExtractBaseline]. + URLsAnalyzed []string `json:"urls_analyzed"` + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + URLCount respjson.Field + URLs respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + raw string + } `json:"-"` +} + +func (u MonitorUpdateResponseBaselineUnion) AsPageBaseline() (v MonitorUpdateResponseBaselinePageBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorUpdateResponseBaselineUnion) AsSitemapBaseline() (v MonitorUpdateResponseBaselineSitemapBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorUpdateResponseBaselineUnion) AsExtractBaseline() (v MonitorUpdateResponseBaselineExtractBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +// Returns the unmodified JSON received from the API +func (u MonitorUpdateResponseBaselineUnion) RawJSON() string { return u.JSON.raw } + +func (r *MonitorUpdateResponseBaselineUnion) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `page` monitor: the visible page text as last observed. +type MonitorUpdateResponseBaselinePageBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The page's visible text as last observed. + Text string `json:"text" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorUpdateResponseBaselinePageBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorUpdateResponseBaselinePageBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `sitemap` monitor: the normalized URL set as last +// observed. +type MonitorUpdateResponseBaselineSitemapBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // Number of URLs in the baseline. + URLCount int64 `json:"url_count" api:"required"` + // The sitemap URLs as last observed (sorted, normalized). + URLs []string `json:"urls" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + URLCount respjson.Field + URLs respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorUpdateResponseBaselineSitemapBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorUpdateResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of an `extract` monitor: the structured data as last extracted. +type MonitorUpdateResponseBaselineExtractBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The extracted structured data, matching the monitor's extraction schema (same + // shape as the /web/extract endpoint's `data`). + Data any `json:"data" api:"required"` + // URLs that were analyzed to produce the extracted data. + URLsAnalyzed []string `json:"urls_analyzed" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorUpdateResponseBaselineExtractBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorUpdateResponseBaselineExtractBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Error from the most recent failed run; null when the last run succeeded. type MonitorUpdateResponseLastError struct { Code string `json:"code" api:"required"` @@ -1570,9 +1954,14 @@ type MonitorListResponseData struct { // Any of "active", "paused", "failed". Status string `json:"status" api:"required"` // Discriminated union describing what the monitor watches. - Target MonitorListResponseDataTargetUnion `json:"target" api:"required"` - UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` - LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` + Target MonitorListResponseDataTargetUnion `json:"target" api:"required"` + UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"` + // Current baseline: the last observed value the monitor compares new snapshots + // against. Its shape follows `target.type` (page/sitemap/extract). Only populated + // on GET /monitors/{monitor_id}; null until the first baseline run completes (and + // after a target or change_detection update, which resets the baseline). + Baseline MonitorListResponseDataBaselineUnion `json:"baseline" api:"nullable"` + LastChangeAt time.Time `json:"last_change_at" api:"nullable" format:"date-time"` // Error from the most recent failed run; null when the last run succeeded. LastError MonitorListResponseDataLastError `json:"last_error" api:"nullable"` LastRunAt time.Time `json:"last_run_at" api:"nullable" format:"date-time"` @@ -1592,6 +1981,7 @@ type MonitorListResponseData struct { Status respjson.Field Target respjson.Field UpdatedAt respjson.Field + Baseline respjson.Field LastChangeAt respjson.Field LastError respjson.Field LastRunAt respjson.Field @@ -1935,6 +2325,128 @@ func (r *MonitorListResponseDataTargetExtract) UnmarshalJSON(data []byte) error return apijson.UnmarshalRoot(data, r) } +// MonitorListResponseDataBaselineUnion contains all possible properties and values +// from [MonitorListResponseDataBaselinePageBaseline], +// [MonitorListResponseDataBaselineSitemapBaseline], +// [MonitorListResponseDataBaselineExtractBaseline]. +// +// Use the methods beginning with 'As' to cast the union to one of its variants. +type MonitorListResponseDataBaselineUnion struct { + CapturedAt time.Time `json:"captured_at"` + // This field is from variant [MonitorListResponseDataBaselinePageBaseline]. + Text string `json:"text"` + // This field is from variant [MonitorListResponseDataBaselineSitemapBaseline]. + URLCount int64 `json:"url_count"` + // This field is from variant [MonitorListResponseDataBaselineSitemapBaseline]. + URLs []string `json:"urls"` + // This field is from variant [MonitorListResponseDataBaselineExtractBaseline]. + Data any `json:"data"` + // This field is from variant [MonitorListResponseDataBaselineExtractBaseline]. + URLsAnalyzed []string `json:"urls_analyzed"` + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + URLCount respjson.Field + URLs respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + raw string + } `json:"-"` +} + +func (u MonitorListResponseDataBaselineUnion) AsPageBaseline() (v MonitorListResponseDataBaselinePageBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorListResponseDataBaselineUnion) AsSitemapBaseline() (v MonitorListResponseDataBaselineSitemapBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +func (u MonitorListResponseDataBaselineUnion) AsExtractBaseline() (v MonitorListResponseDataBaselineExtractBaseline) { + apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v) + return +} + +// Returns the unmodified JSON received from the API +func (u MonitorListResponseDataBaselineUnion) RawJSON() string { return u.JSON.raw } + +func (r *MonitorListResponseDataBaselineUnion) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `page` monitor: the visible page text as last observed. +type MonitorListResponseDataBaselinePageBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The page's visible text as last observed. + Text string `json:"text" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Text respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorListResponseDataBaselinePageBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorListResponseDataBaselinePageBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of a `sitemap` monitor: the normalized URL set as last +// observed. +type MonitorListResponseDataBaselineSitemapBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // Number of URLs in the baseline. + URLCount int64 `json:"url_count" api:"required"` + // The sitemap URLs as last observed (sorted, normalized). + URLs []string `json:"urls" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + URLCount respjson.Field + URLs respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorListResponseDataBaselineSitemapBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorListResponseDataBaselineSitemapBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Current baseline of an `extract` monitor: the structured data as last extracted. +type MonitorListResponseDataBaselineExtractBaseline struct { + // When this baseline was last captured or replaced. + CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` + // The extracted structured data, matching the monitor's extraction schema (same + // shape as the /web/extract endpoint's `data`). + Data any `json:"data" api:"required"` + // URLs that were analyzed to produce the extracted data. + URLsAnalyzed []string `json:"urls_analyzed" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + CapturedAt respjson.Field + Data respjson.Field + URLsAnalyzed respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorListResponseDataBaselineExtractBaseline) RawJSON() string { return r.JSON.raw } +func (r *MonitorListResponseDataBaselineExtractBaseline) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Error from the most recent failed run; null when the last run succeeded. type MonitorListResponseDataLastError struct { Code string `json:"code" api:"required"` From 20e8c26e9bd19c65919ff1fb2e13f967cef4c060 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 00:09:49 +0000 Subject: [PATCH 2/5] feat(api): api update --- .stats.yml | 4 ++-- brand.go | 43 +++++++++++++++++++++++++++++++++++- shared/constant/constants.go | 3 +++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index df5918b..5321a02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-6fd8cb15c904d1befd41a85ef8ffa3dfda11e60d560e466857e331e177e0c1e1.yml -openapi_spec_hash: 0f969f518e16e4fc41d00a5229705f5f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fa5c7cd62da1c7cb2eddf8c6bb1f32ca7f958be5c3c315ade6ca0a669814d75a.yml +openapi_spec_hash: 8358c1a467ab971afd59d615d1e731ee config_hash: ff35e224e809656528c44163aa41bebd diff --git a/brand.go b/brand.go index 43d6e9d..f57c146 100644 --- a/brand.go +++ b/brand.go @@ -38,7 +38,9 @@ func NewBrandService(opts ...option.RequestOption) (r BrandService) { // 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. +// 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. func (r *BrandService) Get(ctx context.Context, body BrandGetParams, opts ...option.RequestOption) (res *BrandGetResponse, err error) { opts = slices.Concat(r.options, opts) path := "brand/retrieve" @@ -883,6 +885,13 @@ type BrandGetParams struct { // email. OfByTicker *BrandGetParamsBodyByTicker `json:",inline"` // This field is a request body variant, only one variant field can be set. + // 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. + OfByDirectURL *BrandGetParamsBodyByDirectURL `json:",inline"` + // This field is a request body variant, only one variant field can be set. // Identify brand data from a transaction descriptor. Cannot be combined with // domain, name, email, or ticker. OfByTransaction *BrandGetParamsBodyByTransaction `json:",inline"` @@ -895,6 +904,7 @@ func (u BrandGetParams) MarshalJSON() ([]byte, error) { u.OfByName, u.OfByEmail, u.OfByTicker, + u.OfByDirectURL, u.OfByTransaction) } func (r *BrandGetParams) UnmarshalJSON(data []byte) error { @@ -1146,6 +1156,37 @@ func init() { ) } +// 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. +// +// The properties DirectURL, Type are required. +type BrandGetParamsBodyByDirectURL struct { + // Full http(s) URL to fetch brand data from (e.g., + // 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire + // internet. + DirectURL string `json:"direct_url" api:"required" format:"uri"` + // 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). + TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"` + // Discriminator for direct-URL-based brand retrieval. + // + // This field can be elided, and will marshal its zero value as "by_direct_url". + Type constant.ByDirectURL `json:"type" default:"by_direct_url"` + paramObj +} + +func (r BrandGetParamsBodyByDirectURL) MarshalJSON() (data []byte, err error) { + type shadow BrandGetParamsBodyByDirectURL + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *BrandGetParamsBodyByDirectURL) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Identify brand data from a transaction descriptor. Cannot be combined with // domain, name, email, or ticker. // diff --git a/shared/constant/constants.go b/shared/constant/constants.go index 85b4ba2..b43d0b6 100644 --- a/shared/constant/constants.go +++ b/shared/constant/constants.go @@ -18,6 +18,7 @@ func ValueOf[T Constant[T]]() T { return t.Default() } +type ByDirectURL string // Always "by_direct_url" type ByDomain string // Always "by_domain" type ByEmail string // Always "by_email" type ByName string // Always "by_name" @@ -29,6 +30,7 @@ type Page string // Always "page" type Semantic string // Always "semantic" type Sitemap string // Always "sitemap" +func (c ByDirectURL) Default() ByDirectURL { return "by_direct_url" } func (c ByDomain) Default() ByDomain { return "by_domain" } func (c ByEmail) Default() ByEmail { return "by_email" } func (c ByName) Default() ByName { return "by_name" } @@ -40,6 +42,7 @@ func (c Page) Default() Page { return "page" } func (c Semantic) Default() Semantic { return "semantic" } func (c Sitemap) Default() Sitemap { return "sitemap" } +func (c ByDirectURL) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c ByDomain) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c ByEmail) MarshalJSON() ([]byte, error) { return marshalString(c) } func (c ByName) MarshalJSON() ([]byte, error) { return marshalString(c) } From 4938107e38ed6e3018a9548af353d8b409604fc2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 00:36:00 +0000 Subject: [PATCH 3/5] feat(api): api update --- .stats.yml | 4 +- monitor.go | 138 ++++++++++++++++++++++++++--------------------------- 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5321a02..085d46d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fa5c7cd62da1c7cb2eddf8c6bb1f32ca7f958be5c3c315ade6ca0a669814d75a.yml -openapi_spec_hash: 8358c1a467ab971afd59d615d1e731ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b075e5704110b3c03bd81b41f62b836d7624eceed7feb0ac63720dec9a4cbba4.yml +openapi_spec_hash: 5efb926e6e99163e3e42a98986da8335 config_hash: ff35e224e809656528c44163aa41bebd diff --git a/monitor.go b/monitor.go index 097b019..aa8a998 100644 --- a/monitor.go +++ b/monitor.go @@ -250,12 +250,9 @@ type MonitorNewResponseChangeDetectionUnion struct { // Any of "exact", "semantic". Type string `json:"type"` // This field is from variant [MonitorNewResponseChangeDetectionSemantic]. - Query string `json:"query"` - // This field is from variant [MonitorNewResponseChangeDetectionSemantic]. ConfidenceThreshold float64 `json:"confidence_threshold"` JSON struct { Type respjson.Field - Query respjson.Field ConfidenceThreshold respjson.Field raw string } `json:"-"` @@ -324,14 +321,14 @@ func (r *MonitorNewResponseChangeDetectionExact) UnmarshalJSON(data []byte) erro return apijson.UnmarshalRoot(data, r) } -// 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`. type MonitorNewResponseChangeDetectionSemantic struct { - Query string `json:"query" api:"required"` Type constant.Semantic `json:"type" default:"semantic"` ConfidenceThreshold float64 `json:"confidence_threshold"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Query respjson.Field Type respjson.Field ConfidenceThreshold respjson.Field ExtraFields map[string]respjson.Field @@ -414,10 +411,10 @@ type MonitorNewResponseTargetUnion struct { // This field is from variant [MonitorNewResponseTargetSitemap]. MaxURLs int64 `json:"max_urls"` // This field is from variant [MonitorNewResponseTargetExtract]. - FollowSubdomains bool `json:"follow_subdomains"` - // This field is from variant [MonitorNewResponseTargetExtract]. Instructions string `json:"instructions"` // This field is from variant [MonitorNewResponseTargetExtract]. + FollowSubdomains bool `json:"follow_subdomains"` + // This field is from variant [MonitorNewResponseTargetExtract]. MaxDepth int64 `json:"max_depth"` // This field is from variant [MonitorNewResponseTargetExtract]. MaxPages int64 `json:"max_pages"` @@ -430,8 +427,8 @@ type MonitorNewResponseTargetUnion struct { Exclude respjson.Field Include respjson.Field MaxURLs respjson.Field - FollowSubdomains respjson.Field Instructions respjson.Field + FollowSubdomains respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -549,12 +546,14 @@ func (r *MonitorNewResponseTargetSitemap) UnmarshalJSON(data []byte) error { // Watch a site's extracted structured data. type MonitorNewResponseTargetExtract struct { - Type constant.Extract `json:"type" default:"extract"` + // Natural-language instructions describing what to extract and watch. This single + // prompt scopes both the extraction and what changes get reported: only data + // captured by the schema and these instructions is compared between runs. + Instructions string `json:"instructions" api:"required"` + Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains bool `json:"follow_subdomains"` - // Optional natural-language instructions guiding what to extract. - Instructions string `json:"instructions"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` // Maximum number of pages to analyze during extraction. @@ -564,10 +563,10 @@ type MonitorNewResponseTargetExtract struct { Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Instructions respjson.Field Type respjson.Field URL respjson.Field FollowSubdomains respjson.Field - Instructions respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -830,12 +829,9 @@ type MonitorGetResponseChangeDetectionUnion struct { // Any of "exact", "semantic". Type string `json:"type"` // This field is from variant [MonitorGetResponseChangeDetectionSemantic]. - Query string `json:"query"` - // This field is from variant [MonitorGetResponseChangeDetectionSemantic]. ConfidenceThreshold float64 `json:"confidence_threshold"` JSON struct { Type respjson.Field - Query respjson.Field ConfidenceThreshold respjson.Field raw string } `json:"-"` @@ -904,14 +900,14 @@ func (r *MonitorGetResponseChangeDetectionExact) UnmarshalJSON(data []byte) erro return apijson.UnmarshalRoot(data, r) } -// 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`. type MonitorGetResponseChangeDetectionSemantic struct { - Query string `json:"query" api:"required"` Type constant.Semantic `json:"type" default:"semantic"` ConfidenceThreshold float64 `json:"confidence_threshold"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Query respjson.Field Type respjson.Field ConfidenceThreshold respjson.Field ExtraFields map[string]respjson.Field @@ -994,10 +990,10 @@ type MonitorGetResponseTargetUnion struct { // This field is from variant [MonitorGetResponseTargetSitemap]. MaxURLs int64 `json:"max_urls"` // This field is from variant [MonitorGetResponseTargetExtract]. - FollowSubdomains bool `json:"follow_subdomains"` - // This field is from variant [MonitorGetResponseTargetExtract]. Instructions string `json:"instructions"` // This field is from variant [MonitorGetResponseTargetExtract]. + FollowSubdomains bool `json:"follow_subdomains"` + // This field is from variant [MonitorGetResponseTargetExtract]. MaxDepth int64 `json:"max_depth"` // This field is from variant [MonitorGetResponseTargetExtract]. MaxPages int64 `json:"max_pages"` @@ -1010,8 +1006,8 @@ type MonitorGetResponseTargetUnion struct { Exclude respjson.Field Include respjson.Field MaxURLs respjson.Field - FollowSubdomains respjson.Field Instructions respjson.Field + FollowSubdomains respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -1129,12 +1125,14 @@ func (r *MonitorGetResponseTargetSitemap) UnmarshalJSON(data []byte) error { // Watch a site's extracted structured data. type MonitorGetResponseTargetExtract struct { - Type constant.Extract `json:"type" default:"extract"` + // Natural-language instructions describing what to extract and watch. This single + // prompt scopes both the extraction and what changes get reported: only data + // captured by the schema and these instructions is compared between runs. + Instructions string `json:"instructions" api:"required"` + Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains bool `json:"follow_subdomains"` - // Optional natural-language instructions guiding what to extract. - Instructions string `json:"instructions"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` // Maximum number of pages to analyze during extraction. @@ -1144,10 +1142,10 @@ type MonitorGetResponseTargetExtract struct { Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Instructions respjson.Field Type respjson.Field URL respjson.Field FollowSubdomains respjson.Field - Instructions respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -1410,12 +1408,9 @@ type MonitorUpdateResponseChangeDetectionUnion struct { // Any of "exact", "semantic". Type string `json:"type"` // This field is from variant [MonitorUpdateResponseChangeDetectionSemantic]. - Query string `json:"query"` - // This field is from variant [MonitorUpdateResponseChangeDetectionSemantic]. ConfidenceThreshold float64 `json:"confidence_threshold"` JSON struct { Type respjson.Field - Query respjson.Field ConfidenceThreshold respjson.Field raw string } `json:"-"` @@ -1484,14 +1479,14 @@ func (r *MonitorUpdateResponseChangeDetectionExact) UnmarshalJSON(data []byte) e return apijson.UnmarshalRoot(data, r) } -// 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`. type MonitorUpdateResponseChangeDetectionSemantic struct { - Query string `json:"query" api:"required"` Type constant.Semantic `json:"type" default:"semantic"` ConfidenceThreshold float64 `json:"confidence_threshold"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Query respjson.Field Type respjson.Field ConfidenceThreshold respjson.Field ExtraFields map[string]respjson.Field @@ -1575,10 +1570,10 @@ type MonitorUpdateResponseTargetUnion struct { // This field is from variant [MonitorUpdateResponseTargetSitemap]. MaxURLs int64 `json:"max_urls"` // This field is from variant [MonitorUpdateResponseTargetExtract]. - FollowSubdomains bool `json:"follow_subdomains"` - // This field is from variant [MonitorUpdateResponseTargetExtract]. Instructions string `json:"instructions"` // This field is from variant [MonitorUpdateResponseTargetExtract]. + FollowSubdomains bool `json:"follow_subdomains"` + // This field is from variant [MonitorUpdateResponseTargetExtract]. MaxDepth int64 `json:"max_depth"` // This field is from variant [MonitorUpdateResponseTargetExtract]. MaxPages int64 `json:"max_pages"` @@ -1591,8 +1586,8 @@ type MonitorUpdateResponseTargetUnion struct { Exclude respjson.Field Include respjson.Field MaxURLs respjson.Field - FollowSubdomains respjson.Field Instructions respjson.Field + FollowSubdomains respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -1710,12 +1705,14 @@ func (r *MonitorUpdateResponseTargetSitemap) UnmarshalJSON(data []byte) error { // Watch a site's extracted structured data. type MonitorUpdateResponseTargetExtract struct { - Type constant.Extract `json:"type" default:"extract"` + // Natural-language instructions describing what to extract and watch. This single + // prompt scopes both the extraction and what changes get reported: only data + // captured by the schema and these instructions is compared between runs. + Instructions string `json:"instructions" api:"required"` + Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains bool `json:"follow_subdomains"` - // Optional natural-language instructions guiding what to extract. - Instructions string `json:"instructions"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` // Maximum number of pages to analyze during extraction. @@ -1725,10 +1722,10 @@ type MonitorUpdateResponseTargetExtract struct { Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Instructions respjson.Field Type respjson.Field URL respjson.Field FollowSubdomains respjson.Field - Instructions respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -2011,12 +2008,9 @@ type MonitorListResponseDataChangeDetectionUnion struct { // Any of "exact", "semantic". Type string `json:"type"` // This field is from variant [MonitorListResponseDataChangeDetectionSemantic]. - Query string `json:"query"` - // This field is from variant [MonitorListResponseDataChangeDetectionSemantic]. ConfidenceThreshold float64 `json:"confidence_threshold"` JSON struct { Type respjson.Field - Query respjson.Field ConfidenceThreshold respjson.Field raw string } `json:"-"` @@ -2087,14 +2081,14 @@ func (r *MonitorListResponseDataChangeDetectionExact) UnmarshalJSON(data []byte) return apijson.UnmarshalRoot(data, r) } -// 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`. type MonitorListResponseDataChangeDetectionSemantic struct { - Query string `json:"query" api:"required"` Type constant.Semantic `json:"type" default:"semantic"` ConfidenceThreshold float64 `json:"confidence_threshold"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Query respjson.Field Type respjson.Field ConfidenceThreshold respjson.Field ExtraFields map[string]respjson.Field @@ -2157,10 +2151,10 @@ type MonitorListResponseDataTargetUnion struct { // This field is from variant [MonitorListResponseDataTargetSitemap]. MaxURLs int64 `json:"max_urls"` // This field is from variant [MonitorListResponseDataTargetExtract]. - FollowSubdomains bool `json:"follow_subdomains"` - // This field is from variant [MonitorListResponseDataTargetExtract]. Instructions string `json:"instructions"` // This field is from variant [MonitorListResponseDataTargetExtract]. + FollowSubdomains bool `json:"follow_subdomains"` + // This field is from variant [MonitorListResponseDataTargetExtract]. MaxDepth int64 `json:"max_depth"` // This field is from variant [MonitorListResponseDataTargetExtract]. MaxPages int64 `json:"max_pages"` @@ -2173,8 +2167,8 @@ type MonitorListResponseDataTargetUnion struct { Exclude respjson.Field Include respjson.Field MaxURLs respjson.Field - FollowSubdomains respjson.Field Instructions respjson.Field + FollowSubdomains respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -2292,12 +2286,14 @@ func (r *MonitorListResponseDataTargetSitemap) UnmarshalJSON(data []byte) error // Watch a site's extracted structured data. type MonitorListResponseDataTargetExtract struct { - Type constant.Extract `json:"type" default:"extract"` + // Natural-language instructions describing what to extract and watch. This single + // prompt scopes both the extraction and what changes get reported: only data + // captured by the schema and these instructions is compared between runs. + Instructions string `json:"instructions" api:"required"` + Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains bool `json:"follow_subdomains"` - // Optional natural-language instructions guiding what to extract. - Instructions string `json:"instructions"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` // Maximum number of pages to analyze during extraction. @@ -2307,10 +2303,10 @@ type MonitorListResponseDataTargetExtract struct { Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { + Instructions respjson.Field Type respjson.Field URL respjson.Field FollowSubdomains respjson.Field - Instructions respjson.Field MaxDepth respjson.Field MaxPages respjson.Field Schema respjson.Field @@ -2889,7 +2885,6 @@ type MonitorGetChangeResponse struct { MatchedURLCount int64 `json:"matched_url_count"` // At most 500 URLs are included; the corresponding count field is always exact. MatchedURLs []string `json:"matched_urls" format:"uri"` - Query string `json:"query"` RemovedURLCount int64 `json:"removed_url_count"` // At most 500 URLs are included; the corresponding count field is always exact. RemovedURLs []string `json:"removed_urls" format:"uri"` @@ -2917,7 +2912,6 @@ type MonitorGetChangeResponse struct { Importance respjson.Field MatchedURLCount respjson.Field MatchedURLs respjson.Field - Query respjson.Field RemovedURLCount respjson.Field RemovedURLs respjson.Field Tags respjson.Field @@ -3085,11 +3079,12 @@ func (r *MonitorNewParamsChangeDetectionExact) UnmarshalJSON(data []byte) error return apijson.UnmarshalRoot(data, r) } -// 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`. // -// The properties Query, Type are required. +// The property Type is required. type MonitorNewParamsChangeDetectionSemantic struct { - Query string `json:"query" api:"required"` ConfidenceThreshold param.Opt[float64] `json:"confidence_threshold,omitzero"` // This field can be elided, and will marshal its zero value as "semantic". Type constant.Semantic `json:"type" default:"semantic"` @@ -3214,13 +3209,15 @@ func (r *MonitorNewParamsTargetSitemap) UnmarshalJSON(data []byte) error { // Watch a site's extracted structured data. // -// The properties Type, URL are required. +// The properties Instructions, Type, URL are required. type MonitorNewParamsTargetExtract struct { + // Natural-language instructions describing what to extract and watch. This single + // prompt scopes both the extraction and what changes get reported: only data + // captured by the schema and these instructions is compared between runs. + Instructions string `json:"instructions" api:"required"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"` - // Optional natural-language instructions guiding what to extract. - Instructions param.Opt[string] `json:"instructions,omitzero"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth param.Opt[int64] `json:"max_depth,omitzero"` // Maximum number of pages to analyze during extraction. @@ -3339,11 +3336,12 @@ func (r *MonitorUpdateParamsChangeDetectionExact) UnmarshalJSON(data []byte) err return apijson.UnmarshalRoot(data, r) } -// 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`. // -// The properties Query, Type are required. +// The property Type is required. type MonitorUpdateParamsChangeDetectionSemantic struct { - Query string `json:"query" api:"required"` ConfidenceThreshold param.Opt[float64] `json:"confidence_threshold,omitzero"` // This field can be elided, and will marshal its zero value as "semantic". Type constant.Semantic `json:"type" default:"semantic"` @@ -3475,13 +3473,15 @@ func (r *MonitorUpdateParamsTargetSitemap) UnmarshalJSON(data []byte) error { // Watch a site's extracted structured data. // -// The properties Type, URL are required. +// The properties Instructions, Type, URL are required. type MonitorUpdateParamsTargetExtract struct { + // Natural-language instructions describing what to extract and watch. This single + // prompt scopes both the extraction and what changes get reported: only data + // captured by the schema and these instructions is compared between runs. + Instructions string `json:"instructions" api:"required"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"` - // Optional natural-language instructions guiding what to extract. - Instructions param.Opt[string] `json:"instructions,omitzero"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth param.Opt[int64] `json:"max_depth,omitzero"` // Maximum number of pages to analyze during extraction. @@ -3528,10 +3528,10 @@ type MonitorListParams struct { Tag param.Opt[string] `query:"tag,omitzero" json:"-"` // Any of "exact", "semantic". ChangeDetectionType MonitorListParamsChangeDetectionType `query:"change_detection_type,omitzero" json:"-"` - // Comma-separated fields to search with `q`. Defaults to all of them. Note `query` - // only exists on semantic monitors. + // Comma-separated fields to search with `q`. Defaults to all of them. Note + // `instructions` only exists on extract monitors. // - // Any of "name", "url", "query", "tags". + // Any of "name", "url", "instructions", "tags". SearchBy []string `query:"search_by,omitzero" json:"-"` // `prefix` for as-you-type prefix matching (default), `exact` for full-token // matching. From fe71712de5cfc8036b6ba54bfd832b9d97d5393b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 01:35:17 +0000 Subject: [PATCH 4/5] feat(api): api update --- .stats.yml | 4 +- monitor.go | 162 +++++++++++++++++++++++++++++++++-------------------- 2 files changed, 104 insertions(+), 62 deletions(-) diff --git a/.stats.yml b/.stats.yml index 085d46d..6b4e1c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b075e5704110b3c03bd81b41f62b836d7624eceed7feb0ac63720dec9a4cbba4.yml -openapi_spec_hash: 5efb926e6e99163e3e42a98986da8335 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-51ebe668b198157ccb18984017dd2fe35f7675220e8b933b03325b3c459ef2a6.yml +openapi_spec_hash: b3ed94bd6b59d4e32fc2c5aa8187d6b2 config_hash: ff35e224e809656528c44163aa41bebd diff --git a/monitor.go b/monitor.go index aa8a998..1508f47 100644 --- a/monitor.go +++ b/monitor.go @@ -514,8 +514,9 @@ func (r *MonitorNewResponseTargetPage) UnmarshalJSON(data []byte) error { // 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. type MonitorNewResponseTargetSitemap struct { Type constant.Sitemap `json:"type" default:"sitemap"` // Sitemap URL to monitor. @@ -544,11 +545,14 @@ func (r *MonitorNewResponseTargetSitemap) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// 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. type MonitorNewResponseTargetExtract struct { - // Natural-language instructions describing what to extract and watch. This single - // prompt scopes both the extraction and what changes get reported: only data - // captured by the schema and these instructions is compared between runs. + // Natural-language instructions guiding which pages and facts to track and which + // changes to report. Instructions string `json:"instructions" api:"required"` Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. @@ -556,9 +560,10 @@ type MonitorNewResponseTargetExtract struct { FollowSubdomains bool `json:"follow_subdomains"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` - // Maximum number of pages to analyze during extraction. + // Maximum number of pages to track. MaxPages int64 `json:"max_pages"` - // 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. Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -678,14 +683,17 @@ func (r *MonitorNewResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) e return apijson.UnmarshalRoot(data, r) } -// Current baseline of an `extract` monitor: the structured data as last extracted. +// Current baseline of an `extract` monitor: the pages it tracks and the structured +// data as last extracted. type MonitorNewResponseBaselineExtractBaseline struct { // When this baseline was last captured or replaced. CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` // The extracted structured data, matching the monitor's extraction schema (same - // shape as the /web/extract endpoint's `data`). + // shape as the /web/extract endpoint's `data`). Refreshed when the monitor + // re-discovers its page set (at most about once a day); `null` when no extraction + // has been captured yet. Data any `json:"data" api:"required"` - // URLs that were analyzed to produce the extracted data. + // The page URLs the monitor tracks and analyzes for changes. URLsAnalyzed []string `json:"urls_analyzed" api:"required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { @@ -1093,8 +1101,9 @@ func (r *MonitorGetResponseTargetPage) UnmarshalJSON(data []byte) error { // 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. type MonitorGetResponseTargetSitemap struct { Type constant.Sitemap `json:"type" default:"sitemap"` // Sitemap URL to monitor. @@ -1123,11 +1132,14 @@ func (r *MonitorGetResponseTargetSitemap) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// 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. type MonitorGetResponseTargetExtract struct { - // Natural-language instructions describing what to extract and watch. This single - // prompt scopes both the extraction and what changes get reported: only data - // captured by the schema and these instructions is compared between runs. + // Natural-language instructions guiding which pages and facts to track and which + // changes to report. Instructions string `json:"instructions" api:"required"` Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. @@ -1135,9 +1147,10 @@ type MonitorGetResponseTargetExtract struct { FollowSubdomains bool `json:"follow_subdomains"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` - // Maximum number of pages to analyze during extraction. + // Maximum number of pages to track. MaxPages int64 `json:"max_pages"` - // 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. Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -1257,14 +1270,17 @@ func (r *MonitorGetResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte) e return apijson.UnmarshalRoot(data, r) } -// Current baseline of an `extract` monitor: the structured data as last extracted. +// Current baseline of an `extract` monitor: the pages it tracks and the structured +// data as last extracted. type MonitorGetResponseBaselineExtractBaseline struct { // When this baseline was last captured or replaced. CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` // The extracted structured data, matching the monitor's extraction schema (same - // shape as the /web/extract endpoint's `data`). + // shape as the /web/extract endpoint's `data`). Refreshed when the monitor + // re-discovers its page set (at most about once a day); `null` when no extraction + // has been captured yet. Data any `json:"data" api:"required"` - // URLs that were analyzed to produce the extracted data. + // The page URLs the monitor tracks and analyzes for changes. URLsAnalyzed []string `json:"urls_analyzed" api:"required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { @@ -1673,8 +1689,9 @@ func (r *MonitorUpdateResponseTargetPage) UnmarshalJSON(data []byte) error { // 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. type MonitorUpdateResponseTargetSitemap struct { Type constant.Sitemap `json:"type" default:"sitemap"` // Sitemap URL to monitor. @@ -1703,11 +1720,14 @@ func (r *MonitorUpdateResponseTargetSitemap) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// 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. type MonitorUpdateResponseTargetExtract struct { - // Natural-language instructions describing what to extract and watch. This single - // prompt scopes both the extraction and what changes get reported: only data - // captured by the schema and these instructions is compared between runs. + // Natural-language instructions guiding which pages and facts to track and which + // changes to report. Instructions string `json:"instructions" api:"required"` Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. @@ -1715,9 +1735,10 @@ type MonitorUpdateResponseTargetExtract struct { FollowSubdomains bool `json:"follow_subdomains"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` - // Maximum number of pages to analyze during extraction. + // Maximum number of pages to track. MaxPages int64 `json:"max_pages"` - // 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. Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -1837,14 +1858,17 @@ func (r *MonitorUpdateResponseBaselineSitemapBaseline) UnmarshalJSON(data []byte return apijson.UnmarshalRoot(data, r) } -// Current baseline of an `extract` monitor: the structured data as last extracted. +// Current baseline of an `extract` monitor: the pages it tracks and the structured +// data as last extracted. type MonitorUpdateResponseBaselineExtractBaseline struct { // When this baseline was last captured or replaced. CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` // The extracted structured data, matching the monitor's extraction schema (same - // shape as the /web/extract endpoint's `data`). + // shape as the /web/extract endpoint's `data`). Refreshed when the monitor + // re-discovers its page set (at most about once a day); `null` when no extraction + // has been captured yet. Data any `json:"data" api:"required"` - // URLs that were analyzed to produce the extracted data. + // The page URLs the monitor tracks and analyzes for changes. URLsAnalyzed []string `json:"urls_analyzed" api:"required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { @@ -2254,8 +2278,9 @@ func (r *MonitorListResponseDataTargetPage) UnmarshalJSON(data []byte) error { // 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. type MonitorListResponseDataTargetSitemap struct { Type constant.Sitemap `json:"type" default:"sitemap"` // Sitemap URL to monitor. @@ -2284,11 +2309,14 @@ func (r *MonitorListResponseDataTargetSitemap) UnmarshalJSON(data []byte) error return apijson.UnmarshalRoot(data, r) } -// 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. type MonitorListResponseDataTargetExtract struct { - // Natural-language instructions describing what to extract and watch. This single - // prompt scopes both the extraction and what changes get reported: only data - // captured by the schema and these instructions is compared between runs. + // Natural-language instructions guiding which pages and facts to track and which + // changes to report. Instructions string `json:"instructions" api:"required"` Type constant.Extract `json:"type" default:"extract"` // Root URL to extract structured data from. @@ -2296,9 +2324,10 @@ type MonitorListResponseDataTargetExtract struct { FollowSubdomains bool `json:"follow_subdomains"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth int64 `json:"max_depth"` - // Maximum number of pages to analyze during extraction. + // Maximum number of pages to track. MaxPages int64 `json:"max_pages"` - // 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. Schema map[string]any `json:"schema"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -2418,14 +2447,17 @@ func (r *MonitorListResponseDataBaselineSitemapBaseline) UnmarshalJSON(data []by return apijson.UnmarshalRoot(data, r) } -// Current baseline of an `extract` monitor: the structured data as last extracted. +// Current baseline of an `extract` monitor: the pages it tracks and the structured +// data as last extracted. type MonitorListResponseDataBaselineExtractBaseline struct { // When this baseline was last captured or replaced. CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"` // The extracted structured data, matching the monitor's extraction schema (same - // shape as the /web/extract endpoint's `data`). + // shape as the /web/extract endpoint's `data`). Refreshed when the monitor + // re-discovers its page set (at most about once a day); `null` when no extraction + // has been captured yet. Data any `json:"data" api:"required"` - // URLs that were analyzed to produce the extracted data. + // The page URLs the monitor tracks and analyzes for changes. URLsAnalyzed []string `json:"urls_analyzed" api:"required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { @@ -3181,8 +3213,9 @@ func (r *MonitorNewParamsTargetPage) UnmarshalJSON(data []byte) error { // 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. // // The properties Type, URL are required. type MonitorNewParamsTargetSitemap struct { @@ -3207,22 +3240,26 @@ func (r *MonitorNewParamsTargetSitemap) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// 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. // // The properties Instructions, Type, URL are required. type MonitorNewParamsTargetExtract struct { - // Natural-language instructions describing what to extract and watch. This single - // prompt scopes both the extraction and what changes get reported: only data - // captured by the schema and these instructions is compared between runs. + // Natural-language instructions guiding which pages and facts to track and which + // changes to report. Instructions string `json:"instructions" api:"required"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth param.Opt[int64] `json:"max_depth,omitzero"` - // Maximum number of pages to analyze during extraction. + // Maximum number of pages to track. MaxPages param.Opt[int64] `json:"max_pages,omitzero"` - // 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. Schema map[string]any `json:"schema,omitzero"` // This field can be elided, and will marshal its zero value as "extract". @@ -3445,8 +3482,9 @@ func (r *MonitorUpdateParamsTargetPage) UnmarshalJSON(data []byte) error { // 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. // // The properties Type, URL are required. type MonitorUpdateParamsTargetSitemap struct { @@ -3471,22 +3509,26 @@ func (r *MonitorUpdateParamsTargetSitemap) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// 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. // // The properties Instructions, Type, URL are required. type MonitorUpdateParamsTargetExtract struct { - // Natural-language instructions describing what to extract and watch. This single - // prompt scopes both the extraction and what changes get reported: only data - // captured by the schema and these instructions is compared between runs. + // Natural-language instructions guiding which pages and facts to track and which + // changes to report. Instructions string `json:"instructions" api:"required"` // Root URL to extract structured data from. URL string `json:"url" api:"required" format:"uri"` FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"` // Optional maximum link depth from the starting URL (0 = only the starting page). MaxDepth param.Opt[int64] `json:"max_depth,omitzero"` - // Maximum number of pages to analyze during extraction. + // Maximum number of pages to track. MaxPages param.Opt[int64] `json:"max_pages,omitzero"` - // 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. Schema map[string]any `json:"schema,omitzero"` // This field can be elided, and will marshal its zero value as "extract". From 9b732d489ed9091de9328f947b2fadf078cc669f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 01:35:39 +0000 Subject: [PATCH 5/5] release: 2.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 11 +++++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 65f558e..656a2ef 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0" + ".": "2.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7295dcd..cf5a995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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-go-sdk/compare/v2.0.0...v2.1.0) + +### Features + +* **api:** api update ([fe71712](https://github.com/context-dot-dev/context-go-sdk/commit/fe71712de5cfc8036b6ba54bfd832b9d97d5393b)) +* **api:** api update ([4938107](https://github.com/context-dot-dev/context-go-sdk/commit/4938107e38ed6e3018a9548af353d8b409604fc2)) +* **api:** api update ([20e8c26](https://github.com/context-dot-dev/context-go-sdk/commit/20e8c26e9bd19c65919ff1fb2e13f967cef4c060)) +* **api:** api update ([68826ea](https://github.com/context-dot-dev/context-go-sdk/commit/68826ea12d631dd6abeb2ee4f2fcbc97269be350)) + ## 2.0.0 (2026-07-06) Full Changelog: [v1.5.0...v2.0.0](https://github.com/context-dot-dev/context-go-sdk/compare/v1.5.0...v2.0.0) diff --git a/README.md b/README.md index 6128cbf..d30576d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Or to pin the version: ```sh -go get -u 'github.com/context-dot-dev/context-go-sdk@v2.0.0' +go get -u 'github.com/context-dot-dev/context-go-sdk@v2.1.0' ``` diff --git a/internal/version.go b/internal/version.go index fef6622..436f832 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "2.0.0" // x-release-please-version +const PackageVersion = "2.1.0" // x-release-please-version