From 99e10847896b8f97d0ef1db3bc236c2720fb65cc 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:57 +0000 Subject: [PATCH 1/6] feat(api): api update --- .stats.yml | 4 +- packages/mcp-server/src/local-docs-search.ts | 16 +- src/resources/monitors.ts | 272 +++++++++++++++++++ 3 files changed, 282 insertions(+), 10 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/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index f14b81b..4d078ab 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -1086,9 +1086,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'webhook?: { url: string; secret?: string; };', ], response: - "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", + "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", markdown: - "## create\n\n`client.monitors.create(change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }, name: string, schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }, mode?: 'web', tags?: string[], webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**post** `/monitors`\n\nCreates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.\n\n### Parameters\n\n- `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name: string`\n\n- `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `mode?: 'web'`\n Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `webhook?: { url: string; secret?: string; }`\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.create({\n change_detection: { type: 'exact' },\n name: 'Acme pricing page',\n schedule: {\n frequency: 6,\n type: 'interval',\n unit: 'hours',\n},\n target: { type: 'page', url: 'https://acme.com/pricing' },\n});\n\nconsole.log(monitor);\n```", + "## create\n\n`client.monitors.create(change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }, name: string, schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }, mode?: 'web', tags?: string[], webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**post** `/monitors`\n\nCreates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.\n\n### Parameters\n\n- `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name: string`\n\n- `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `mode?: 'web'`\n Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `webhook?: { url: string; secret?: string; }`\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.create({\n change_detection: { type: 'exact' },\n name: 'Acme pricing page',\n schedule: {\n frequency: 6,\n type: 'interval',\n unit: 'hours',\n},\n target: { type: 'page', url: 'https://acme.com/pricing' },\n});\n\nconsole.log(monitor);\n```", perLanguage: { typescript: { method: 'client.monitors.create', @@ -1148,9 +1148,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "target_type?: 'page' | 'sitemap' | 'extract';", ], response: - "{ data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }", + "{ data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }", markdown: - "## list\n\n`client.monitors.list(change_detection_type?: 'exact' | 'semantic', cursor?: string, limit?: number, q?: string, search_by?: 'name' | 'url' | 'query' | 'tags'[], search_type?: 'exact' | 'prefix', status?: 'active' | 'paused' | 'failed', tag?: string, tags?: string[], target_type?: 'page' | 'sitemap' | 'extract'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors`\n\nLists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.\n\n### Parameters\n\n- `change_detection_type?: 'exact' | 'semantic'`\n\n- `cursor?: string`\n\n- `limit?: number`\n\n- `q?: string`\n Free-text search term, matched against the fields named in `search_by`.\n\n- `search_by?: 'name' | 'url' | 'query' | 'tags'[]`\n Comma-separated fields to search with `q`. Defaults to all of them. Note `query` only exists on semantic monitors.\n\n- `search_type?: 'exact' | 'prefix'`\n `prefix` for as-you-type prefix matching (default), `exact` for full-token matching.\n\n- `status?: 'active' | 'paused' | 'failed'`\n Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `tags?: string[]`\n Comma-separated list of tags to filter by (matches monitors having any of them).\n\n- `target_type?: 'page' | 'sitemap' | 'extract'`\n\n### Returns\n\n- `{ data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitors = await client.monitors.list();\n\nconsole.log(monitors);\n```", + "## list\n\n`client.monitors.list(change_detection_type?: 'exact' | 'semantic', cursor?: string, limit?: number, q?: string, search_by?: 'name' | 'url' | 'query' | 'tags'[], search_type?: 'exact' | 'prefix', status?: 'active' | 'paused' | 'failed', tag?: string, tags?: string[], target_type?: 'page' | 'sitemap' | 'extract'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors`\n\nLists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.\n\n### Parameters\n\n- `change_detection_type?: 'exact' | 'semantic'`\n\n- `cursor?: string`\n\n- `limit?: number`\n\n- `q?: string`\n Free-text search term, matched against the fields named in `search_by`.\n\n- `search_by?: 'name' | 'url' | 'query' | 'tags'[]`\n Comma-separated fields to search with `q`. Defaults to all of them. Note `query` only exists on semantic monitors.\n\n- `search_type?: 'exact' | 'prefix'`\n `prefix` for as-you-type prefix matching (default), `exact` for full-token matching.\n\n- `status?: 'active' | 'paused' | 'failed'`\n Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `tags?: string[]`\n Comma-separated list of tags to filter by (matches monitors having any of them).\n\n- `target_type?: 'page' | 'sitemap' | 'extract'`\n\n### Returns\n\n- `{ data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitors = await client.monitors.list();\n\nconsole.log(monitors);\n```", perLanguage: { typescript: { method: 'client.monitors.list', @@ -1197,9 +1197,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.monitors.retrieve', params: ['monitor_id: string;'], response: - "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", + "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", markdown: - "## retrieve\n\n`client.monitors.retrieve(monitor_id: string): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**get** `/monitors/{monitor_id}`\n\nGet a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor);\n```", + "## retrieve\n\n`client.monitors.retrieve(monitor_id: string): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**get** `/monitors/{monitor_id}`\n\nGet a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor);\n```", perLanguage: { typescript: { method: 'client.monitors.retrieve', @@ -1256,9 +1256,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'webhook?: { url: string; secret?: string; };', ], response: - "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", + "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", markdown: - "## update\n\n`client.monitors.update(monitor_id: string, change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }, name?: string, schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, status?: 'active' | 'paused', tags?: string[], target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }, webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**patch** `/monitors/{monitor_id}`\n\nUpdates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.\n\n### Parameters\n\n- `monitor_id: string`\n\n- `change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name?: string`\n\n- `schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `status?: 'active' | 'paused'`\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `webhook?: { url: string; secret?: string; }`\n Set to null to remove the webhook.\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.update('mon_123');\n\nconsole.log(monitor);\n```", + "## update\n\n`client.monitors.update(monitor_id: string, change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }, name?: string, schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, status?: 'active' | 'paused', tags?: string[], target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }, webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**patch** `/monitors/{monitor_id}`\n\nUpdates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.\n\n### Parameters\n\n- `monitor_id: string`\n\n- `change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name?: string`\n\n- `schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `status?: 'active' | 'paused'`\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `webhook?: { url: string; secret?: string; }`\n Set to null to remove the webhook.\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.update('mon_123');\n\nconsole.log(monitor);\n```", perLanguage: { typescript: { method: 'client.monitors.update', diff --git a/src/resources/monitors.ts b/src/resources/monitors.ts index 1955e15..20e1f33 100644 --- a/src/resources/monitors.ts +++ b/src/resources/monitors.ts @@ -244,6 +244,18 @@ export interface MonitorCreateResponse { updated_at: string; + /** + * 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?: + | MonitorCreateResponse.MonitorsPageBaseline + | MonitorCreateResponse.MonitorsSitemapBaseline + | MonitorCreateResponse.MonitorsExtractBaseline + | null; + last_change_at?: string | null; /** @@ -383,6 +395,63 @@ export namespace MonitorCreateResponse { schema?: { [key: string]: unknown }; } + /** + * Current baseline of a `page` monitor: the visible page text as last observed. + */ + export interface MonitorsPageBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The page's visible text as last observed. + */ + text: string; + } + + /** + * Current baseline of a `sitemap` monitor: the normalized URL set as last + * observed. + */ + export interface MonitorsSitemapBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Number of URLs in the baseline. + */ + url_count: number; + + /** + * The sitemap URLs as last observed (sorted, normalized). + */ + urls: Array; + } + + /** + * Current baseline of an `extract` monitor: the structured data as last extracted. + */ + export interface MonitorsExtractBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The extracted structured data, matching the monitor's extraction schema (same + * shape as the /web/extract endpoint's `data`). + */ + data: unknown; + + /** + * URLs that were analyzed to produce the extracted data. + */ + urls_analyzed: Array; + } + /** * Error from the most recent failed run; null when the last run succeeded. */ @@ -459,6 +528,18 @@ export interface MonitorRetrieveResponse { updated_at: string; + /** + * 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?: + | MonitorRetrieveResponse.MonitorsPageBaseline + | MonitorRetrieveResponse.MonitorsSitemapBaseline + | MonitorRetrieveResponse.MonitorsExtractBaseline + | null; + last_change_at?: string | null; /** @@ -598,6 +679,63 @@ export namespace MonitorRetrieveResponse { schema?: { [key: string]: unknown }; } + /** + * Current baseline of a `page` monitor: the visible page text as last observed. + */ + export interface MonitorsPageBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The page's visible text as last observed. + */ + text: string; + } + + /** + * Current baseline of a `sitemap` monitor: the normalized URL set as last + * observed. + */ + export interface MonitorsSitemapBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Number of URLs in the baseline. + */ + url_count: number; + + /** + * The sitemap URLs as last observed (sorted, normalized). + */ + urls: Array; + } + + /** + * Current baseline of an `extract` monitor: the structured data as last extracted. + */ + export interface MonitorsExtractBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The extracted structured data, matching the monitor's extraction schema (same + * shape as the /web/extract endpoint's `data`). + */ + data: unknown; + + /** + * URLs that were analyzed to produce the extracted data. + */ + urls_analyzed: Array; + } + /** * Error from the most recent failed run; null when the last run succeeded. */ @@ -674,6 +812,18 @@ export interface MonitorUpdateResponse { updated_at: string; + /** + * 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?: + | MonitorUpdateResponse.MonitorsPageBaseline + | MonitorUpdateResponse.MonitorsSitemapBaseline + | MonitorUpdateResponse.MonitorsExtractBaseline + | null; + last_change_at?: string | null; /** @@ -813,6 +963,63 @@ export namespace MonitorUpdateResponse { schema?: { [key: string]: unknown }; } + /** + * Current baseline of a `page` monitor: the visible page text as last observed. + */ + export interface MonitorsPageBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The page's visible text as last observed. + */ + text: string; + } + + /** + * Current baseline of a `sitemap` monitor: the normalized URL set as last + * observed. + */ + export interface MonitorsSitemapBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Number of URLs in the baseline. + */ + url_count: number; + + /** + * The sitemap URLs as last observed (sorted, normalized). + */ + urls: Array; + } + + /** + * Current baseline of an `extract` monitor: the structured data as last extracted. + */ + export interface MonitorsExtractBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The extracted structured data, matching the monitor's extraction schema (same + * shape as the /web/extract endpoint's `data`). + */ + data: unknown; + + /** + * URLs that were analyzed to produce the extracted data. + */ + urls_analyzed: Array; + } + /** * Error from the most recent failed run; null when the last run succeeded. */ @@ -893,6 +1100,14 @@ export namespace MonitorListResponse { updated_at: string; + /** + * 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?: Data.MonitorsPageBaseline | Data.MonitorsSitemapBaseline | Data.MonitorsExtractBaseline | null; + last_change_at?: string | null; /** @@ -1032,6 +1247,63 @@ export namespace MonitorListResponse { schema?: { [key: string]: unknown }; } + /** + * Current baseline of a `page` monitor: the visible page text as last observed. + */ + export interface MonitorsPageBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The page's visible text as last observed. + */ + text: string; + } + + /** + * Current baseline of a `sitemap` monitor: the normalized URL set as last + * observed. + */ + export interface MonitorsSitemapBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * Number of URLs in the baseline. + */ + url_count: number; + + /** + * The sitemap URLs as last observed (sorted, normalized). + */ + urls: Array; + } + + /** + * Current baseline of an `extract` monitor: the structured data as last extracted. + */ + export interface MonitorsExtractBaseline { + /** + * When this baseline was last captured or replaced. + */ + captured_at: string; + + /** + * The extracted structured data, matching the monitor's extraction schema (same + * shape as the /web/extract endpoint's `data`). + */ + data: unknown; + + /** + * URLs that were analyzed to produce the extracted data. + */ + urls_analyzed: Array; + } + /** * Error from the most recent failed run; null when the last run succeeded. */ From 402e2e663d543e7f44c87ba1365015073e020d55 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:59 +0000 Subject: [PATCH 2/6] feat(api): api update --- .stats.yml | 4 +-- packages/mcp-server/src/local-docs-search.ts | 8 +++--- src/resources/brand.ts | 26 +++++++++++++++++++- 3 files changed, 31 insertions(+), 7 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/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index 4d078ab..1e2efbc 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -812,11 +812,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Retrieve brand data', description: - '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.', + 'Retrieve logos, backdrops, colors, industry, description, and more. Provide exactly one lookup identifier in the request body: a domain, company name, email address, stock ticker, transaction descriptor, or direct URL. Note: `by_direct_url` fetches brand data only from the provided URL — not from the entire internet.', stainlessPath: '(resource) brand > (method) retrieve', qualified: 'client.brand.retrieve', params: [ - "{ domain: string; type: 'by_domain'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; timeoutMS?: number; } | { name: string; type: 'by_name'; country_gl?: string; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; timeoutMS?: number; } | { email: string; type: 'by_email'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; timeoutMS?: number; } | { ticker: string; type: 'by_ticker'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; ticker_exchange?: string; timeoutMS?: number; } | { transaction_info: string; type: 'by_transaction'; city?: string; country_gl?: string; force_language?: string; high_confidence_only?: boolean; maxSpeed?: boolean; mcc?: number; phone?: number; timeoutMS?: number; };", + "{ domain: string; type: 'by_domain'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; timeoutMS?: number; } | { name: string; type: 'by_name'; country_gl?: string; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; timeoutMS?: number; } | { email: string; type: 'by_email'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; timeoutMS?: number; } | { ticker: string; type: 'by_ticker'; force_language?: string; maxAgeMs?: number; maxSpeed?: boolean; ticker_exchange?: string; timeoutMS?: number; } | { direct_url: string; type: 'by_direct_url'; timeoutMS?: number; } | { transaction_info: string; type: 'by_transaction'; city?: string; country_gl?: string; force_language?: string; high_confidence_only?: boolean; maxSpeed?: boolean; mcc?: number; phone?: number; timeoutMS?: number; };", ], response: "{ brand?: { address?: { city?: string; country?: string; country_code?: string; postal_code?: string; state_code?: string; state_province?: string; street?: string; }; backdrops?: { colors?: object[]; resolution?: object; url?: string; }[]; colors?: { hex?: string; name?: string; }[]; description?: string; domain?: string; email?: string; industries?: { eic?: object[]; }; is_nsfw?: boolean; links?: { blog?: string; careers?: string; contact?: string; pricing?: string; privacy?: string; terms?: string; }; logos?: { colors?: object[]; mode?: 'light' | 'dark' | 'has_opaque_background'; resolution?: object; type?: 'icon' | 'logo'; url?: string; }[]; phone?: string; primary_language?: string; slogan?: string; socials?: { type?: string; url?: string; }[]; stock?: { exchange?: string; ticker?: string; }; title?: string; }; code?: number; key_metadata?: { credits_consumed: number; credits_remaining: number; }; status?: string; }", @@ -844,12 +844,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ cli: { method: 'brand retrieve', example: - "context-dev brand retrieve \\\n --api-key 'My API Key' \\\n --domain domain \\\n --type by_domain \\\n --name xxx \\\n --email dev@stainless.com \\\n --ticker ticker \\\n --transaction-info xxx", + "context-dev brand retrieve \\\n --api-key 'My API Key' \\\n --domain domain \\\n --type by_domain \\\n --name xxx \\\n --email dev@stainless.com \\\n --ticker ticker \\\n --direct-url https://example.com \\\n --transaction-info xxx", }, php: { method: 'brand->retrieve', example: - "brand->retrieve(\n domain: 'domain',\n type: 'by_transaction',\n forceLanguage: 'afrikaans',\n maxAgeMs: 0,\n maxSpeed: true,\n timeoutMs: 1000,\n name: 'xxx',\n countryGl: 'country_gl',\n email: 'dev@stainless.com',\n ticker: 'ticker',\n tickerExchange: 'ticker_exchange',\n transactionInfo: 'xxx',\n city: 'city',\n highConfidenceOnly: true,\n mcc: 0,\n phone: 0,\n);\n\nvar_dump($brand);", + "brand->retrieve(\n domain: 'domain',\n type: 'by_transaction',\n forceLanguage: 'afrikaans',\n maxAgeMs: 0,\n maxSpeed: true,\n timeoutMs: 1000,\n name: 'xxx',\n countryGl: 'country_gl',\n email: 'dev@stainless.com',\n ticker: 'ticker',\n tickerExchange: 'ticker_exchange',\n directURL: 'https://example.com',\n transactionInfo: 'xxx',\n city: 'city',\n highConfidenceOnly: true,\n mcc: 0,\n phone: 0,\n);\n\nvar_dump($brand);", }, http: { example: diff --git a/src/resources/brand.ts b/src/resources/brand.ts index e5c6f0f..6a95ddc 100644 --- a/src/resources/brand.ts +++ b/src/resources/brand.ts @@ -8,7 +8,9 @@ export class Brand extends APIResource { /** * 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. * * @example * ```ts @@ -1025,6 +1027,7 @@ export type BrandRetrieveParams = | BrandRetrieveParams.BrandRetrieveByNameRequest | BrandRetrieveParams.BrandRetrieveByEmailRequest | BrandRetrieveParams.BrandRetrieveByTickerRequest + | BrandRetrieveParams.BrandRetrieveByDirectURLRequest | BrandRetrieveParams.BrandRetrieveFromTransactionRequest; export declare namespace BrandRetrieveParams { @@ -1663,6 +1666,27 @@ export declare namespace BrandRetrieveParams { timeoutMS?: number; } + export interface BrandRetrieveByDirectURLRequest { + /** + * Full http(s) URL to fetch brand data from (e.g., + * 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire + * internet. + */ + direct_url: string; + + /** + * Discriminator for direct-URL-based brand retrieval. + */ + type: 'by_direct_url'; + + /** + * 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?: number; + } + export interface BrandRetrieveFromTransactionRequest { /** * Transaction information to identify the brand. From bc07c8fff5342c52b0e01b7318f05ca2370ad9cd 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:12 +0000 Subject: [PATCH 3/6] feat(api): api update --- .stats.yml | 4 +- packages/mcp-server/src/local-docs-search.ts | 30 ++--- src/resources/monitors.ts | 116 ++++++++++--------- 3 files changed, 80 insertions(+), 70 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/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index 1e2efbc..e08400d 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -1077,18 +1077,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) monitors > (method) create', qualified: 'client.monitors.create', params: [ - "change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; };", + "change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; };", 'name: string;', "schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; };", - "target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; };", + "target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; };", "mode?: 'web';", 'tags?: string[];', 'webhook?: { url: string; secret?: string; };', ], response: - "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", + "{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", markdown: - "## create\n\n`client.monitors.create(change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }, name: string, schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }, mode?: 'web', tags?: string[], webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**post** `/monitors`\n\nCreates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.\n\n### Parameters\n\n- `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name: string`\n\n- `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `mode?: 'web'`\n Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `webhook?: { url: string; secret?: string; }`\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.create({\n change_detection: { type: 'exact' },\n name: 'Acme pricing page',\n schedule: {\n frequency: 6,\n type: 'interval',\n unit: 'hours',\n},\n target: { type: 'page', url: 'https://acme.com/pricing' },\n});\n\nconsole.log(monitor);\n```", + "## create\n\n`client.monitors.create(change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }, name: string, schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }, mode?: 'web', tags?: string[], webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**post** `/monitors`\n\nCreates a monitor. The request body is a union of the supported target/change detection combinations. The monitor runs immediately after creation to create its initial baseline.\n\n### Parameters\n\n- `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name: string`\n\n- `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `mode?: 'web'`\n Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `webhook?: { url: string; secret?: string; }`\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.create({\n change_detection: { type: 'exact' },\n name: 'Acme pricing page',\n schedule: {\n frequency: 6,\n type: 'interval',\n unit: 'hours',\n},\n target: { type: 'page', url: 'https://acme.com/pricing' },\n});\n\nconsole.log(monitor);\n```", perLanguage: { typescript: { method: 'client.monitors.create', @@ -1140,7 +1140,7 @@ const EMBEDDED_METHODS: MethodEntry[] = [ 'cursor?: string;', 'limit?: number;', 'q?: string;', - "search_by?: 'name' | 'url' | 'query' | 'tags'[];", + "search_by?: 'name' | 'url' | 'instructions' | 'tags'[];", "search_type?: 'exact' | 'prefix';", "status?: 'active' | 'paused' | 'failed';", 'tag?: string;', @@ -1148,9 +1148,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ "target_type?: 'page' | 'sitemap' | 'extract';", ], response: - "{ data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }", + "{ data: { id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }", markdown: - "## list\n\n`client.monitors.list(change_detection_type?: 'exact' | 'semantic', cursor?: string, limit?: number, q?: string, search_by?: 'name' | 'url' | 'query' | 'tags'[], search_type?: 'exact' | 'prefix', status?: 'active' | 'paused' | 'failed', tag?: string, tags?: string[], target_type?: 'page' | 'sitemap' | 'extract'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors`\n\nLists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.\n\n### Parameters\n\n- `change_detection_type?: 'exact' | 'semantic'`\n\n- `cursor?: string`\n\n- `limit?: number`\n\n- `q?: string`\n Free-text search term, matched against the fields named in `search_by`.\n\n- `search_by?: 'name' | 'url' | 'query' | 'tags'[]`\n Comma-separated fields to search with `q`. Defaults to all of them. Note `query` only exists on semantic monitors.\n\n- `search_type?: 'exact' | 'prefix'`\n `prefix` for as-you-type prefix matching (default), `exact` for full-token matching.\n\n- `status?: 'active' | 'paused' | 'failed'`\n Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `tags?: string[]`\n Comma-separated list of tags to filter by (matches monitors having any of them).\n\n- `target_type?: 'page' | 'sitemap' | 'extract'`\n\n### Returns\n\n- `{ data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitors = await client.monitors.list();\n\nconsole.log(monitors);\n```", + "## list\n\n`client.monitors.list(change_detection_type?: 'exact' | 'semantic', cursor?: string, limit?: number, q?: string, search_by?: 'name' | 'url' | 'instructions' | 'tags'[], search_type?: 'exact' | 'prefix', status?: 'active' | 'paused' | 'failed', tag?: string, tags?: string[], target_type?: 'page' | 'sitemap' | 'extract'): { data: object[]; has_more: boolean; next_cursor: string; }`\n\n**get** `/monitors`\n\nLists monitors for the authenticated organization. Supports free-text search (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus status/type/tag filters. Results are paginated via the opaque `cursor`.\n\n### Parameters\n\n- `change_detection_type?: 'exact' | 'semantic'`\n\n- `cursor?: string`\n\n- `limit?: number`\n\n- `q?: string`\n Free-text search term, matched against the fields named in `search_by`.\n\n- `search_by?: 'name' | 'url' | 'instructions' | 'tags'[]`\n Comma-separated fields to search with `q`. Defaults to all of them. Note `instructions` only exists on extract monitors.\n\n- `search_type?: 'exact' | 'prefix'`\n `prefix` for as-you-type prefix matching (default), `exact` for full-token matching.\n\n- `status?: 'active' | 'paused' | 'failed'`\n Monitor lifecycle status. `failed` means the most recent run failed (see the monitor's `last_error`); failed monitors keep running on schedule and flip back to `active` on the next successful run. Monitors are auto-`paused` after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to `active`.\n\n- `tag?: string`\n Filter to items that have this tag.\n\n- `tags?: string[]`\n Comma-separated list of tags to filter by (matches monitors having any of them).\n\n- `target_type?: 'page' | 'sitemap' | 'extract'`\n\n### Returns\n\n- `{ data: { id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]; has_more: boolean; next_cursor: string; }`\n\n - `data: { id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }[]`\n - `has_more: boolean`\n - `next_cursor: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitors = await client.monitors.list();\n\nconsole.log(monitors);\n```", perLanguage: { typescript: { method: 'client.monitors.list', @@ -1197,9 +1197,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.monitors.retrieve', params: ['monitor_id: string;'], response: - "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", + "{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", markdown: - "## retrieve\n\n`client.monitors.retrieve(monitor_id: string): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**get** `/monitors/{monitor_id}`\n\nGet a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor);\n```", + "## retrieve\n\n`client.monitors.retrieve(monitor_id: string): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**get** `/monitors/{monitor_id}`\n\nGet a monitor\n\n### Parameters\n\n- `monitor_id: string`\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.retrieve('mon_123');\n\nconsole.log(monitor);\n```", perLanguage: { typescript: { method: 'client.monitors.retrieve', @@ -1247,18 +1247,18 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.monitors.update', params: [ 'monitor_id: string;', - "change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; };", + "change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; };", 'name?: string;', "schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; };", "status?: 'active' | 'paused';", 'tags?: string[];', - "target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; };", + "target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; };", 'webhook?: { url: string; secret?: string; };', ], response: - "{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", + "{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }", markdown: - "## update\n\n`client.monitors.update(monitor_id: string, change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }, name?: string, schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, status?: 'active' | 'paused', tags?: string[], target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }, webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**patch** `/monitors/{monitor_id}`\n\nUpdates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.\n\n### Parameters\n\n- `monitor_id: string`\n\n- `change_detection?: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name?: string`\n\n- `schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `status?: 'active' | 'paused'`\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `webhook?: { url: string; secret?: string; }`\n Set to null to remove the webhook.\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { query: string; type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { type: 'extract'; url: string; follow_subdomains?: boolean; instructions?: string; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.update('mon_123');\n\nconsole.log(monitor);\n```", + "## update\n\n`client.monitors.update(monitor_id: string, change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }, name?: string, schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }, status?: 'active' | 'paused', tags?: string[], target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }, webhook?: { url: string; secret?: string; }): { id: string; change_detection: object | object; created_at: string; mode: 'web'; name: string; schedule: object; status: 'active' | 'paused' | 'failed'; target: object | object | object; updated_at: string; baseline?: object | object | object; last_change_at?: string; last_error?: object; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: object; }`\n\n**patch** `/monitors/{monitor_id}`\n\nUpdates a monitor. If `target` or `change_detection` changes, the monitor creates a new baseline. Unsupported target/change detection combinations are rejected.\n\n### Parameters\n\n- `monitor_id: string`\n\n- `change_detection?: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n Discriminated union describing how changes are detected.\n\n- `name?: string`\n\n- `schedule?: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.\n - `frequency: number`\n Number of units between runs. The resulting interval (frequency × unit) must be at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes; maximum 365 when unit is days).\n - `type: 'interval'`\n - `unit: 'minutes' | 'hours' | 'days'`\n\n- `status?: 'active' | 'paused'`\n\n- `tags?: string[]`\n User-defined tags for grouping and filtering monitors and their changes.\n\n- `target?: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n Discriminated union describing what the monitor watches.\n\n- `webhook?: { url: string; secret?: string; }`\n Set to null to remove the webhook.\n - `url: string`\n Webhook URL called when a change is detected.\n - `secret?: string`\n Signing secret used to verify webhook authenticity. Each delivery includes an `X-Context-Signature: t=,v1=` header, where the HMAC is SHA-256 over `\"{t}.{rawRequestBody}\"` keyed by this secret. Recompute it with a constant-time compare and reject stale timestamps to prevent replay. Generated by the API; cannot be set by clients.\n\n### Returns\n\n- `{ id: string; change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }; created_at: string; mode: 'web'; name: string; schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }; status: 'active' | 'paused' | 'failed'; target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }; updated_at: string; baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }; last_change_at?: string; last_error?: { code: string; message: string; }; last_run_at?: string; next_run_at?: string; tags?: string[]; webhook?: { url: string; secret?: string; }; }`\n A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).\n\n - `id: string`\n - `change_detection: { type: 'exact'; } | { type: 'semantic'; confidence_threshold?: number; }`\n - `created_at: string`\n - `mode: 'web'`\n - `name: string`\n - `schedule: { frequency: number; type: 'interval'; unit: 'minutes' | 'hours' | 'days'; }`\n - `status: 'active' | 'paused' | 'failed'`\n - `target: { type: 'page'; url: string; normalize_whitespace?: boolean; } | { type: 'sitemap'; url: string; exclude?: string[]; include?: string[]; max_urls?: number; } | { instructions: string; type: 'extract'; url: string; follow_subdomains?: boolean; max_depth?: number; max_pages?: number; schema?: object; }`\n - `updated_at: string`\n - `baseline?: { captured_at: string; text: string; } | { captured_at: string; url_count: number; urls: string[]; } | { captured_at: string; data: object; urls_analyzed: string[]; }`\n - `last_change_at?: string`\n - `last_error?: { code: string; message: string; }`\n - `last_run_at?: string`\n - `next_run_at?: string`\n - `tags?: string[]`\n - `webhook?: { url: string; secret?: string; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst monitor = await client.monitors.update('mon_123');\n\nconsole.log(monitor);\n```", perLanguage: { typescript: { method: 'client.monitors.update', @@ -1623,9 +1623,9 @@ const EMBEDDED_METHODS: MethodEntry[] = [ qualified: 'client.monitors.retrieveChange', params: ['change_id: string;'], response: - "{ id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: { after: string; before: string; url?: string; }[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; query?: string; removed_url_count?: number; removed_urls?: string[]; tags?: string[]; }", + "{ id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: { after: string; before: string; url?: string; }[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; removed_url_count?: number; removed_urls?: string[]; tags?: string[]; }", markdown: - "## retrieve_change\n\n`client.monitors.retrieveChange(change_id: string): { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: object[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; query?: string; removed_url_count?: number; removed_urls?: string[]; tags?: string[]; }`\n\n**get** `/monitors/changes/{change_id}`\n\nGet a change\n\n### Parameters\n\n- `change_id: string`\n\n### Returns\n\n- `{ id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: { after: string; before: string; url?: string; }[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; query?: string; removed_url_count?: number; removed_urls?: string[]; tags?: string[]; }`\n A detected change. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (page: `diff` + excerpts; sitemap: `added_urls`/`removed_urls`; semantic: `query`/`confidence`/`importance`/`evidence`/`matched_urls`).\n\n - `id: string`\n - `change_detection_type: 'exact' | 'semantic'`\n - `detected_at: string`\n - `mode: 'web'`\n - `monitor_id: string`\n - `run_id: string`\n - `summary: string`\n - `target_type: 'page' | 'sitemap' | 'extract'`\n - `title: string`\n - `url: string`\n - `added_url_count?: number`\n - `added_urls?: string[]`\n - `after_text_excerpt?: string`\n - `before_text_excerpt?: string`\n - `confidence?: number`\n - `diff?: string`\n - `evidence?: { after: string; before: string; url?: string; }[]`\n - `importance?: 'low' | 'medium' | 'high'`\n - `matched_url_count?: number`\n - `matched_urls?: string[]`\n - `query?: string`\n - `removed_url_count?: number`\n - `removed_urls?: string[]`\n - `tags?: string[]`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.retrieveChange('chg_123');\n\nconsole.log(response);\n```", + "## retrieve_change\n\n`client.monitors.retrieveChange(change_id: string): { id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: object[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; removed_url_count?: number; removed_urls?: string[]; tags?: string[]; }`\n\n**get** `/monitors/changes/{change_id}`\n\nGet a change\n\n### Parameters\n\n- `change_id: string`\n\n### Returns\n\n- `{ id: string; change_detection_type: 'exact' | 'semantic'; detected_at: string; mode: 'web'; monitor_id: string; run_id: string; summary: string; target_type: 'page' | 'sitemap' | 'extract'; title: string; url: string; added_url_count?: number; added_urls?: string[]; after_text_excerpt?: string; before_text_excerpt?: string; confidence?: number; diff?: string; evidence?: { after: string; before: string; url?: string; }[]; importance?: 'low' | 'medium' | 'high'; matched_url_count?: number; matched_urls?: string[]; removed_url_count?: number; removed_urls?: string[]; tags?: string[]; }`\n A detected change. `mode` is the constant `web`; `target_type` and `change_detection_type` describe the change, and which optional fields are present depends on them (page: `diff` + excerpts; sitemap: `added_urls`/`removed_urls`; semantic: `query`/`confidence`/`importance`/`evidence`/`matched_urls`).\n\n - `id: string`\n - `change_detection_type: 'exact' | 'semantic'`\n - `detected_at: string`\n - `mode: 'web'`\n - `monitor_id: string`\n - `run_id: string`\n - `summary: string`\n - `target_type: 'page' | 'sitemap' | 'extract'`\n - `title: string`\n - `url: string`\n - `added_url_count?: number`\n - `added_urls?: string[]`\n - `after_text_excerpt?: string`\n - `before_text_excerpt?: string`\n - `confidence?: number`\n - `diff?: string`\n - `evidence?: { after: string; before: string; url?: string; }[]`\n - `importance?: 'low' | 'medium' | 'high'`\n - `matched_url_count?: number`\n - `matched_urls?: string[]`\n - `removed_url_count?: number`\n - `removed_urls?: string[]`\n - `tags?: string[]`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.monitors.retrieveChange('chg_123');\n\nconsole.log(response);\n```", perLanguage: { typescript: { method: 'client.monitors.retrieveChange', diff --git a/src/resources/monitors.ts b/src/resources/monitors.ts index 20e1f33..b2e1fec 100644 --- a/src/resources/monitors.ts +++ b/src/resources/monitors.ts @@ -288,11 +288,11 @@ export namespace MonitorCreateResponse { } /** - * 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`. */ export interface MonitorsSemanticChangeDetection { - query: string; - type: 'semantic'; confidence_threshold?: number; @@ -364,6 +364,13 @@ export namespace MonitorCreateResponse { * Watch a site's extracted structured data. */ export interface MonitorsExtractTarget { + /** + * 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; + type: 'extract'; /** @@ -373,11 +380,6 @@ export namespace MonitorCreateResponse { follow_subdomains?: boolean; - /** - * Optional natural-language instructions guiding what to extract. - */ - instructions?: string; - /** * Optional maximum link depth from the starting URL (0 = only the starting page). */ @@ -572,11 +574,11 @@ export namespace MonitorRetrieveResponse { } /** - * 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`. */ export interface MonitorsSemanticChangeDetection { - query: string; - type: 'semantic'; confidence_threshold?: number; @@ -648,6 +650,13 @@ export namespace MonitorRetrieveResponse { * Watch a site's extracted structured data. */ export interface MonitorsExtractTarget { + /** + * 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; + type: 'extract'; /** @@ -657,11 +666,6 @@ export namespace MonitorRetrieveResponse { follow_subdomains?: boolean; - /** - * Optional natural-language instructions guiding what to extract. - */ - instructions?: string; - /** * Optional maximum link depth from the starting URL (0 = only the starting page). */ @@ -856,11 +860,11 @@ export namespace MonitorUpdateResponse { } /** - * 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`. */ export interface MonitorsSemanticChangeDetection { - query: string; - type: 'semantic'; confidence_threshold?: number; @@ -932,6 +936,13 @@ export namespace MonitorUpdateResponse { * Watch a site's extracted structured data. */ export interface MonitorsExtractTarget { + /** + * 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; + type: 'extract'; /** @@ -941,11 +952,6 @@ export namespace MonitorUpdateResponse { follow_subdomains?: boolean; - /** - * Optional natural-language instructions guiding what to extract. - */ - instructions?: string; - /** * Optional maximum link depth from the starting URL (0 = only the starting page). */ @@ -1140,11 +1146,11 @@ export namespace MonitorListResponse { } /** - * 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`. */ export interface MonitorsSemanticChangeDetection { - query: string; - type: 'semantic'; confidence_threshold?: number; @@ -1216,6 +1222,13 @@ export namespace MonitorListResponse { * Watch a site's extracted structured data. */ export interface MonitorsExtractTarget { + /** + * 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; + type: 'extract'; /** @@ -1225,11 +1238,6 @@ export namespace MonitorListResponse { follow_subdomains?: boolean; - /** - * Optional natural-language instructions guiding what to extract. - */ - instructions?: string; - /** * Optional maximum link depth from the starting URL (0 = only the starting page). */ @@ -1643,8 +1651,6 @@ export interface MonitorRetrieveChangeResponse { */ matched_urls?: Array; - query?: string; - removed_url_count?: number; /** @@ -1738,11 +1744,11 @@ export namespace MonitorCreateParams { } /** - * 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`. */ export interface MonitorsSemanticChangeDetection { - query: string; - type: 'semantic'; confidence_threshold?: number; @@ -1814,6 +1820,13 @@ export namespace MonitorCreateParams { * Watch a site's extracted structured data. */ export interface MonitorsExtractTarget { + /** + * 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; + type: 'extract'; /** @@ -1823,11 +1836,6 @@ export namespace MonitorCreateParams { follow_subdomains?: boolean; - /** - * Optional natural-language instructions guiding what to extract. - */ - instructions?: string; - /** * Optional maximum link depth from the starting URL (0 = only the starting page). */ @@ -1901,11 +1909,11 @@ export namespace MonitorUpdateParams { } /** - * 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`. */ export interface MonitorsSemanticChangeDetection { - query: string; - type: 'semantic'; confidence_threshold?: number; @@ -1977,6 +1985,13 @@ export namespace MonitorUpdateParams { * Watch a site's extracted structured data. */ export interface MonitorsExtractTarget { + /** + * 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; + type: 'extract'; /** @@ -1986,11 +2001,6 @@ export namespace MonitorUpdateParams { follow_subdomains?: boolean; - /** - * Optional natural-language instructions guiding what to extract. - */ - instructions?: string; - /** * Optional maximum link depth from the starting URL (0 = only the starting page). */ @@ -2032,10 +2042,10 @@ export interface MonitorListParams { q?: string; /** - * 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. */ - search_by?: Array<'name' | 'url' | 'query' | 'tags'>; + search_by?: Array<'name' | 'url' | 'instructions' | 'tags'>; /** * `prefix` for as-you-type prefix matching (default), `exact` for full-token From fb65bd76461f0ef77e32d3e8dac116cb390ba857 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:28 +0000 Subject: [PATCH 4/6] feat(api): api update --- .stats.yml | 4 +- src/resources/monitors.ts | 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/src/resources/monitors.ts b/src/resources/monitors.ts index b2e1fec..0cc5478 100644 --- a/src/resources/monitors.ts +++ b/src/resources/monitors.ts @@ -333,8 +333,9 @@ export namespace MonitorCreateResponse { /** * 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. */ export interface MonitorsSitemapTarget { type: 'sitemap'; @@ -361,13 +362,16 @@ export namespace MonitorCreateResponse { } /** - * 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. */ export interface MonitorsExtractTarget { /** - * 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; @@ -386,12 +390,13 @@ export namespace MonitorCreateResponse { max_depth?: number; /** - * Maximum number of pages to analyze during extraction. + * Maximum number of pages to track. */ max_pages?: number; /** - * 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?: { [key: string]: unknown }; @@ -434,7 +439,8 @@ export namespace MonitorCreateResponse { } /** - * 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. */ export interface MonitorsExtractBaseline { /** @@ -444,12 +450,14 @@ export namespace MonitorCreateResponse { /** * 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: unknown; /** - * URLs that were analyzed to produce the extracted data. + * The page URLs the monitor tracks and analyzes for changes. */ urls_analyzed: Array; } @@ -619,8 +627,9 @@ export namespace MonitorRetrieveResponse { /** * 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. */ export interface MonitorsSitemapTarget { type: 'sitemap'; @@ -647,13 +656,16 @@ export namespace MonitorRetrieveResponse { } /** - * 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. */ export interface MonitorsExtractTarget { /** - * 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; @@ -672,12 +684,13 @@ export namespace MonitorRetrieveResponse { max_depth?: number; /** - * Maximum number of pages to analyze during extraction. + * Maximum number of pages to track. */ max_pages?: number; /** - * 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?: { [key: string]: unknown }; @@ -720,7 +733,8 @@ export namespace MonitorRetrieveResponse { } /** - * 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. */ export interface MonitorsExtractBaseline { /** @@ -730,12 +744,14 @@ export namespace MonitorRetrieveResponse { /** * 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: unknown; /** - * URLs that were analyzed to produce the extracted data. + * The page URLs the monitor tracks and analyzes for changes. */ urls_analyzed: Array; } @@ -905,8 +921,9 @@ export namespace MonitorUpdateResponse { /** * 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. */ export interface MonitorsSitemapTarget { type: 'sitemap'; @@ -933,13 +950,16 @@ export namespace MonitorUpdateResponse { } /** - * 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. */ export interface MonitorsExtractTarget { /** - * 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; @@ -958,12 +978,13 @@ export namespace MonitorUpdateResponse { max_depth?: number; /** - * Maximum number of pages to analyze during extraction. + * Maximum number of pages to track. */ max_pages?: number; /** - * 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?: { [key: string]: unknown }; @@ -1006,7 +1027,8 @@ export namespace MonitorUpdateResponse { } /** - * 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. */ export interface MonitorsExtractBaseline { /** @@ -1016,12 +1038,14 @@ export namespace MonitorUpdateResponse { /** * 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: unknown; /** - * URLs that were analyzed to produce the extracted data. + * The page URLs the monitor tracks and analyzes for changes. */ urls_analyzed: Array; } @@ -1191,8 +1215,9 @@ export namespace MonitorListResponse { /** * 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. */ export interface MonitorsSitemapTarget { type: 'sitemap'; @@ -1219,13 +1244,16 @@ export namespace MonitorListResponse { } /** - * 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. */ export interface MonitorsExtractTarget { /** - * 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; @@ -1244,12 +1272,13 @@ export namespace MonitorListResponse { max_depth?: number; /** - * Maximum number of pages to analyze during extraction. + * Maximum number of pages to track. */ max_pages?: number; /** - * 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?: { [key: string]: unknown }; @@ -1292,7 +1321,8 @@ export namespace MonitorListResponse { } /** - * 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. */ export interface MonitorsExtractBaseline { /** @@ -1302,12 +1332,14 @@ export namespace MonitorListResponse { /** * 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: unknown; /** - * URLs that were analyzed to produce the extracted data. + * The page URLs the monitor tracks and analyzes for changes. */ urls_analyzed: Array; } @@ -1789,8 +1821,9 @@ export namespace MonitorCreateParams { /** * 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. */ export interface MonitorsSitemapTarget { type: 'sitemap'; @@ -1817,13 +1850,16 @@ export namespace MonitorCreateParams { } /** - * 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. */ export interface MonitorsExtractTarget { /** - * 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; @@ -1842,12 +1878,13 @@ export namespace MonitorCreateParams { max_depth?: number; /** - * Maximum number of pages to analyze during extraction. + * Maximum number of pages to track. */ max_pages?: number; /** - * 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?: { [key: string]: unknown }; @@ -1954,8 +1991,9 @@ export namespace MonitorUpdateParams { /** * 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. */ export interface MonitorsSitemapTarget { type: 'sitemap'; @@ -1982,13 +2020,16 @@ export namespace MonitorUpdateParams { } /** - * 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. */ export interface MonitorsExtractTarget { /** - * 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; @@ -2007,12 +2048,13 @@ export namespace MonitorUpdateParams { max_depth?: number; /** - * Maximum number of pages to analyze during extraction. + * Maximum number of pages to track. */ max_pages?: number; /** - * 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?: { [key: string]: unknown }; From c71ac97e5477184b2bbcc7c976c992a4a1902a16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 17:38:04 +0000 Subject: [PATCH 5/6] feat(api): api update --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 06fc108..38236e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1215,9 +1215,9 @@ baseline-browser-mapping@^2.9.0: integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== brace-expansion@^2.0.2: - version "2.1.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.1.tgz#c68b1c4111c76aae3a6fba55d496cee10c39dad8" - integrity sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA== + version "2.1.2" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.2.tgz#0bba2271feb7d458b0d31ad13625aaa4754431e2" + integrity sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA== dependencies: balanced-match "^1.0.0" From 7498e7f29cba90ae340acdd490fd25e2ac611392 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 17:38:30 +0000 Subject: [PATCH 6/6] release: 2.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- packages/mcp-server/manifest.json | 2 +- packages/mcp-server/package.json | 2 +- packages/mcp-server/src/server.ts | 2 +- src/version.ts | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 969d3db..a5d1cf2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.1.0" + ".": "2.2.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index db867ec..f0ec125 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 2.2.0 (2026-07-08) + +Full Changelog: [v2.1.0...v2.2.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.1.0...v2.2.0) + +### Features + +* **api:** api update ([c71ac97](https://github.com/context-dot-dev/context-typescript-sdk/commit/c71ac97e5477184b2bbcc7c976c992a4a1902a16)) +* **api:** api update ([fb65bd7](https://github.com/context-dot-dev/context-typescript-sdk/commit/fb65bd76461f0ef77e32d3e8dac116cb390ba857)) +* **api:** api update ([bc07c8f](https://github.com/context-dot-dev/context-typescript-sdk/commit/bc07c8fff5342c52b0e01b7318f05ca2370ad9cd)) +* **api:** api update ([402e2e6](https://github.com/context-dot-dev/context-typescript-sdk/commit/402e2e663d543e7f44c87ba1365015073e020d55)) +* **api:** api update ([99e1084](https://github.com/context-dot-dev/context-typescript-sdk/commit/99e10847896b8f97d0ef1db3bc236c2720fb65cc)) + ## 2.1.0 (2026-07-06) Full Changelog: [v2.0.0...v2.1.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.0.0...v2.1.0) diff --git a/package.json b/package.json index b284ce0..dab14b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "context.dev", - "version": "2.1.0", + "version": "2.2.0", "description": "The official TypeScript library for the Context Dev API", "author": "Context Dev ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index 1ddea29..d6dcf7e 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -1,7 +1,7 @@ { "dxt_version": "0.2", "name": "context.dev-mcp", - "version": "2.1.0", + "version": "2.2.0", "description": "The official MCP Server for the Context Dev API", "author": { "name": "Context Dev", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 7cba5f4..784dc11 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "context.dev-mcp", - "version": "2.1.0", + "version": "2.2.0", "description": "The official MCP Server for the Context Dev API", "author": "Context Dev ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 3dd7c13..730420a 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -28,7 +28,7 @@ export const newMcpServer = async ({ new McpServer( { name: 'context_dev_api', - version: '2.1.0', + version: '2.2.0', }, { instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }), diff --git a/src/version.ts b/src/version.ts index 09eae37..7240400 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '2.1.0'; // x-release-please-version +export const VERSION = '2.2.0'; // x-release-please-version