context.dev 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
  5. data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
  6. data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
  7. data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
  8. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
  9. data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
  10. data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
  11. data/lib/context_dev/models/monitor_create_params.rb +6 -5
  12. data/lib/context_dev/models/monitor_create_response.rb +6 -5
  13. data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
  14. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
  15. data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
  16. data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
  17. data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
  18. data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
  19. data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
  20. data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
  21. data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
  22. data/lib/context_dev/models/monitor_list_params.rb +18 -19
  23. data/lib/context_dev/models/monitor_list_response.rb +6 -5
  24. data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
  25. data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
  26. data/lib/context_dev/models/monitor_retrieve_response.rb +6 -5
  27. data/lib/context_dev/models/monitor_update_params.rb +6 -5
  28. data/lib/context_dev/models/monitor_update_response.rb +6 -5
  29. data/lib/context_dev/models/parse_handle_params.rb +199 -33
  30. data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
  31. data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
  32. data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
  33. data/lib/context_dev/models/web_extract_params.rb +19 -1
  34. data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
  35. data/lib/context_dev/models/web_screenshot_params.rb +69 -18
  36. data/lib/context_dev/models/web_screenshot_response.rb +3 -2
  37. data/lib/context_dev/models/web_search_params.rb +9 -1
  38. data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
  39. data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
  40. data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
  41. data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
  42. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
  43. data/lib/context_dev/models.rb +4 -0
  44. data/lib/context_dev/resources/ai.rb +3 -1
  45. data/lib/context_dev/resources/brand.rb +6 -2
  46. data/lib/context_dev/resources/industry.rb +6 -2
  47. data/lib/context_dev/resources/monitors.rb +70 -32
  48. data/lib/context_dev/resources/parse.rb +15 -11
  49. data/lib/context_dev/resources/utility.rb +3 -1
  50. data/lib/context_dev/resources/web.rb +104 -55
  51. data/lib/context_dev/version.rb +1 -1
  52. data/lib/context_dev.rb +4 -0
  53. data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
  54. data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
  55. data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
  56. data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
  57. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
  58. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
  59. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
  60. data/rbi/context_dev/models/monitor_create_params.rbi +6 -4
  61. data/rbi/context_dev/models/monitor_create_response.rbi +6 -4
  62. data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
  63. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
  64. data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
  65. data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
  66. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
  67. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
  68. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
  69. data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
  70. data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
  71. data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
  72. data/rbi/context_dev/models/monitor_list_response.rbi +6 -4
  73. data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
  74. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
  75. data/rbi/context_dev/models/monitor_retrieve_response.rbi +6 -4
  76. data/rbi/context_dev/models/monitor_update_params.rbi +6 -4
  77. data/rbi/context_dev/models/monitor_update_response.rbi +6 -4
  78. data/rbi/context_dev/models/parse_handle_params.rbi +400 -46
  79. data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
  80. data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
  81. data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
  82. data/rbi/context_dev/models/web_extract_params.rbi +26 -0
  83. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
  84. data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
  85. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
  86. data/rbi/context_dev/models/web_search_params.rbi +11 -0
  87. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
  88. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
  89. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
  90. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
  91. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
  92. data/rbi/context_dev/models.rbi +4 -0
  93. data/rbi/context_dev/resources/ai.rbi +3 -0
  94. data/rbi/context_dev/resources/brand.rbi +9 -1
  95. data/rbi/context_dev/resources/industry.rbi +10 -0
  96. data/rbi/context_dev/resources/monitors.rbi +55 -11
  97. data/rbi/context_dev/resources/parse.rbi +46 -19
  98. data/rbi/context_dev/resources/utility.rbi +3 -0
  99. data/rbi/context_dev/resources/web.rbi +224 -48
  100. data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
  101. data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
  102. data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
  103. data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
  104. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
  105. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
  106. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
  107. data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
  108. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
  109. data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
  110. data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
  111. data/sig/context_dev/models/monitor_list_params.rbs +8 -14
  112. data/sig/context_dev/models/parse_handle_params.rbs +124 -25
  113. data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
  114. data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
  115. data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
  116. data/sig/context_dev/models/web_extract_params.rbs +14 -0
  117. data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
  118. data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
  119. data/sig/context_dev/models/web_search_params.rbs +7 -0
  120. data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
  121. data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
  122. data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
  123. data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
  124. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
  125. data/sig/context_dev/models.rbs +4 -0
  126. data/sig/context_dev/resources/ai.rbs +1 -0
  127. data/sig/context_dev/resources/brand.rbs +3 -1
  128. data/sig/context_dev/resources/industry.rbs +2 -0
  129. data/sig/context_dev/resources/monitors.rbs +12 -2
  130. data/sig/context_dev/resources/parse.rbs +8 -5
  131. data/sig/context_dev/resources/utility.rbs +1 -0
  132. data/sig/context_dev/resources/web.rbs +47 -26
  133. metadata +14 -2
@@ -35,6 +35,23 @@ module ContextDev
35
35
  sig { params(max_links: Integer).void }
36
36
  attr_writer :max_links
37
37
 
38
+ # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
39
+ # instead of discovering the domain's sitemaps.
40
+ sig { returns(T.nilable(String)) }
41
+ attr_reader :sitemap_url
42
+
43
+ sig { params(sitemap_url: String).void }
44
+ attr_writer :sitemap_url
45
+
46
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
47
+ # recorded on the request's usage log and can be used to filter usage on the
48
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
49
+ sig { returns(T.nilable(T::Array[String])) }
50
+ attr_reader :tags
51
+
52
+ sig { params(tags: T::Array[String]).void }
53
+ attr_writer :tags
54
+
38
55
  # Optional timeout in milliseconds for the request. If the request takes longer
39
56
  # than this value, it will be aborted with a 408 status code. Maximum allowed
40
57
  # value is 300000ms (5 minutes).
@@ -52,13 +69,30 @@ module ContextDev
52
69
  sig { params(url_regex: String).void }
53
70
  attr_writer :url_regex
54
71
 
72
+ # Set to enabled to bypass shared caches and omit request and response content
73
+ # from retained usage logs. Requires zero data retention to be enabled for your
74
+ # organization (contact support@context.dev), otherwise the request fails with
75
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
76
+ sig do
77
+ returns(T.nilable(ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol))
78
+ end
79
+ attr_reader :zdr
80
+
81
+ sig do
82
+ params(zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol).void
83
+ end
84
+ attr_writer :zdr
85
+
55
86
  sig do
56
87
  params(
57
88
  domain: String,
58
89
  headers: T::Hash[Symbol, String],
59
90
  max_links: Integer,
91
+ sitemap_url: String,
92
+ tags: T::Array[String],
60
93
  timeout_ms: Integer,
61
94
  url_regex: String,
95
+ zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol,
62
96
  request_options: ContextDev::RequestOptions::OrHash
63
97
  ).returns(T.attached_class)
64
98
  end
@@ -72,6 +106,13 @@ module ContextDev
72
106
  # Maximum number of links to return from the sitemap crawl. Defaults to 10,000.
73
107
  # Minimum is 1, maximum is 100,000.
74
108
  max_links: nil,
109
+ # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
110
+ # instead of discovering the domain's sitemaps.
111
+ sitemap_url: nil,
112
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
113
+ # recorded on the request's usage log and can be used to filter usage on the
114
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
115
+ tags: nil,
75
116
  # Optional timeout in milliseconds for the request. If the request takes longer
76
117
  # than this value, it will be aborted with a 408 status code. Maximum allowed
77
118
  # value is 300000ms (5 minutes).
@@ -79,6 +120,11 @@ module ContextDev
79
120
  # Optional RE2-compatible regex pattern. Only URLs matching this pattern are
80
121
  # returned and counted against maxLinks.
81
122
  url_regex: nil,
123
+ # Set to enabled to bypass shared caches and omit request and response content
124
+ # from retained usage logs. Requires zero data retention to be enabled for your
125
+ # organization (contact support@context.dev), otherwise the request fails with
126
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
127
+ zdr: nil,
82
128
  request_options: {}
83
129
  )
84
130
  end
@@ -89,14 +135,50 @@ module ContextDev
89
135
  domain: String,
90
136
  headers: T::Hash[Symbol, String],
91
137
  max_links: Integer,
138
+ sitemap_url: String,
139
+ tags: T::Array[String],
92
140
  timeout_ms: Integer,
93
141
  url_regex: String,
142
+ zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol,
94
143
  request_options: ContextDev::RequestOptions
95
144
  }
96
145
  )
97
146
  end
98
147
  def to_hash
99
148
  end
149
+
150
+ # Set to enabled to bypass shared caches and omit request and response content
151
+ # from retained usage logs. Requires zero data retention to be enabled for your
152
+ # organization (contact support@context.dev), otherwise the request fails with
153
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
154
+ module Zdr
155
+ extend ContextDev::Internal::Type::Enum
156
+
157
+ TaggedSymbol =
158
+ T.type_alias do
159
+ T.all(Symbol, ContextDev::WebWebScrapeSitemapParams::Zdr)
160
+ end
161
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
162
+
163
+ ENABLED =
164
+ T.let(
165
+ :enabled,
166
+ ContextDev::WebWebScrapeSitemapParams::Zdr::TaggedSymbol
167
+ )
168
+ DISABLED =
169
+ T.let(
170
+ :disabled,
171
+ ContextDev::WebWebScrapeSitemapParams::Zdr::TaggedSymbol
172
+ )
173
+
174
+ sig do
175
+ override.returns(
176
+ T::Array[ContextDev::WebWebScrapeSitemapParams::Zdr::TaggedSymbol]
177
+ )
178
+ end
179
+ def self.values
180
+ end
181
+ end
100
182
  end
101
183
  end
102
184
  end
@@ -18,6 +18,10 @@ module ContextDev
18
18
 
19
19
  MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams
20
20
 
21
+ MonitorGetCreditUsageParams = ContextDev::Models::MonitorGetCreditUsageParams
22
+
23
+ MonitorGetLimitsParams = ContextDev::Models::MonitorGetLimitsParams
24
+
21
25
  MonitorListAccountChangesParams =
22
26
  ContextDev::Models::MonitorListAccountChangesParams
23
27
 
@@ -9,6 +9,7 @@ module ContextDev
9
9
  params(
10
10
  url: String,
11
11
  max_age_ms: Integer,
12
+ tags: T::Array[String],
12
13
  timeout_ms: Integer,
13
14
  request_options: ContextDev::RequestOptions::OrHash
14
15
  ).returns(ContextDev::Models::AIExtractProductResponse)
@@ -20,6 +21,8 @@ module ContextDev
20
21
  # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
21
22
  # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
22
23
  max_age_ms: nil,
24
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
25
+ tags: nil,
23
26
  # Optional timeout in milliseconds for the request. If the request takes longer
24
27
  # than this value, it will be aborted with a 408 status code. Maximum allowed
25
28
  # value is 300000ms (5 minutes).
@@ -35,7 +35,9 @@ module ContextDev
35
35
  sig do
36
36
  params(
37
37
  domain: String,
38
- max_age_ms: Integer,
38
+ max_age_ms: T.nilable(Integer),
39
+ tags: T::Array[String],
40
+ theme: ContextDev::BrandRetrieveSimplifiedParams::Theme::OrSymbol,
39
41
  timeout_ms: Integer,
40
42
  request_options: ContextDev::RequestOptions::OrHash
41
43
  ).returns(ContextDev::Models::BrandRetrieveSimplifiedResponse)
@@ -48,6 +50,12 @@ module ContextDev
48
50
  # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
49
51
  # year.
50
52
  max_age_ms: nil,
53
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
54
+ # recorded on the request's usage log and can be used to filter usage on the
55
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
56
+ tags: nil,
57
+ # Optional theme preference used when selecting brand assets.
58
+ theme: nil,
51
59
  # Optional timeout in milliseconds for the request. If the request takes longer
52
60
  # than this value, it will be aborted with a 408 status code. Maximum allowed
53
61
  # value is 300000ms (5 minutes).
@@ -9,6 +9,7 @@ module ContextDev
9
9
  input: String,
10
10
  max_results: Integer,
11
11
  min_results: Integer,
12
+ tags: T::Array[String],
12
13
  timeout_ms: Integer,
13
14
  request_options: ContextDev::RequestOptions::OrHash
14
15
  ).returns(ContextDev::Models::IndustryRetrieveNaicsResponse)
@@ -23,6 +24,10 @@ module ContextDev
23
24
  max_results: nil,
24
25
  # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
25
26
  min_results: nil,
27
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
28
+ # recorded on the request's usage log and can be used to filter usage on the
29
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
30
+ tags: nil,
26
31
  # Optional timeout in milliseconds for the request. If the request takes longer
27
32
  # than this value, it will be aborted with a 408 status code. Maximum allowed
28
33
  # value is 300000ms (5 minutes).
@@ -39,6 +44,7 @@ module ContextDev
39
44
  input: String,
40
45
  max_results: Integer,
41
46
  min_results: Integer,
47
+ tags: T::Array[String],
42
48
  timeout_ms: Integer,
43
49
  type: ContextDev::IndustryRetrieveSicParams::Type::OrSymbol,
44
50
  request_options: ContextDev::RequestOptions::OrHash
@@ -53,6 +59,10 @@ module ContextDev
53
59
  max_results: nil,
54
60
  # Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
55
61
  min_results: nil,
62
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
63
+ # recorded on the request's usage log and can be used to filter usage on the
64
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
65
+ tags: nil,
56
66
  # Optional timeout in milliseconds for the request. If the request takes longer
57
67
  # than this value, it will be aborted with a 408 status code. Maximum allowed
58
68
  # value is 300000ms (5 minutes).
@@ -45,6 +45,7 @@ module ContextDev
45
45
  # described by `target` and `change_detection`.
46
46
  mode: nil,
47
47
  # User-defined tags for grouping and filtering monitors and their changes.
48
+ # Duplicates are removed.
48
49
  tags: nil,
49
50
  webhook: nil,
50
51
  request_options: {}
@@ -97,6 +98,7 @@ module ContextDev
97
98
  schedule: nil,
98
99
  status: nil,
99
100
  # User-defined tags for grouping and filtering monitors and their changes.
101
+ # Duplicates are removed.
100
102
  tags: nil,
101
103
  # Discriminated union describing what the monitor watches.
102
104
  target: nil,
@@ -117,18 +119,23 @@ module ContextDev
117
119
  limit: Integer,
118
120
  q: String,
119
121
  search_by:
120
- T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol],
122
+ T.nilable(
123
+ T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol]
124
+ ),
121
125
  search_type: ContextDev::MonitorListParams::SearchType::OrSymbol,
122
126
  status: ContextDev::MonitorListParams::Status::OrSymbol,
123
127
  tag: String,
124
- tags: T::Array[String],
128
+ tags: T.nilable(T::Array[String]),
125
129
  target_type: ContextDev::MonitorListParams::TargetType::OrSymbol,
126
130
  request_options: ContextDev::RequestOptions::OrHash
127
131
  ).returns(ContextDev::Models::MonitorListResponse)
128
132
  end
129
133
  def list(
134
+ # Filter by change detection type.
130
135
  change_detection_type: nil,
136
+ # Opaque pagination cursor from a previous response.
131
137
  cursor: nil,
138
+ # Maximum number of items to return per page (1-100). Defaults to 25.
132
139
  limit: nil,
133
140
  # Free-text search term, matched against the fields named in `search_by`.
134
141
  q: nil,
@@ -138,16 +145,13 @@ module ContextDev
138
145
  # `prefix` for as-you-type prefix matching (default), `exact` for full-token
139
146
  # matching.
140
147
  search_type: nil,
141
- # Monitor lifecycle status. `failed` means the most recent run failed (see the
142
- # monitor's `last_error`); failed monitors keep running on schedule and flip back
143
- # to `active` on the next successful run. Monitors are auto-`paused` after
144
- # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
145
- # status to `active`.
148
+ # Filter monitors by lifecycle status.
146
149
  status: nil,
147
150
  # Filter to items that have this tag.
148
151
  tag: nil,
149
152
  # Comma-separated list of tags to filter by (matches monitors having any of them).
150
153
  tags: nil,
154
+ # Filter by target type.
151
155
  target_type: nil,
152
156
  request_options: {}
153
157
  )
@@ -163,6 +167,33 @@ module ContextDev
163
167
  def delete(monitor_id, request_options: {})
164
168
  end
165
169
 
170
+ # Returns credits charged per monitor over an optional [since, until] window,
171
+ # newest spenders first.
172
+ sig do
173
+ params(
174
+ since: Time,
175
+ until_: Time,
176
+ request_options: ContextDev::RequestOptions::OrHash
177
+ ).returns(ContextDev::Models::MonitorGetCreditUsageResponse)
178
+ end
179
+ def get_credit_usage(
180
+ # Only include items at or after this ISO 8601 timestamp.
181
+ since: nil,
182
+ # Only include items before this ISO 8601 timestamp.
183
+ until_: nil,
184
+ request_options: {}
185
+ )
186
+ end
187
+
188
+ # Returns how many monitors the account has and the maximum it allows.
189
+ sig do
190
+ params(request_options: ContextDev::RequestOptions::OrHash).returns(
191
+ ContextDev::Models::MonitorGetLimitsResponse
192
+ )
193
+ end
194
+ def get_limits(request_options: {})
195
+ end
196
+
166
197
  # Returns an account-wide feed of detected changes across monitors.
167
198
  sig do
168
199
  params(
@@ -180,14 +211,21 @@ module ContextDev
180
211
  ).returns(ContextDev::Models::MonitorListAccountChangesResponse)
181
212
  end
182
213
  def list_account_changes(
214
+ # Filter by change detection type.
183
215
  change_detection_type: nil,
216
+ # Opaque pagination cursor from a previous response.
184
217
  cursor: nil,
218
+ # Maximum number of items to return per page (1-100). Defaults to 25.
185
219
  limit: nil,
220
+ # Filter changes to a single monitor.
186
221
  monitor_id: nil,
222
+ # Only include items at or after this ISO 8601 timestamp.
187
223
  since: nil,
188
224
  # Filter to items that have this tag.
189
225
  tag: nil,
226
+ # Filter by target type.
190
227
  target_type: nil,
228
+ # Only include items before this ISO 8601 timestamp.
191
229
  until_: nil,
192
230
  request_options: {}
193
231
  )
@@ -203,10 +241,11 @@ module ContextDev
203
241
  ).returns(ContextDev::Models::MonitorListAccountRunsResponse)
204
242
  end
205
243
  def list_account_runs(
244
+ # Opaque pagination cursor from a previous response.
206
245
  cursor: nil,
246
+ # Maximum number of items to return per page (1-100). Defaults to 25.
207
247
  limit: nil,
208
- # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
209
- # (insufficient credits, monitor paused, or superseded by a concurrent run).
248
+ # Filter runs by lifecycle status.
210
249
  status: nil,
211
250
  request_options: {}
212
251
  )
@@ -226,11 +265,15 @@ module ContextDev
226
265
  end
227
266
  def list_changes(
228
267
  monitor_id,
268
+ # Opaque pagination cursor from a previous response.
229
269
  cursor: nil,
270
+ # Maximum number of items to return per page (1-100). Defaults to 25.
230
271
  limit: nil,
272
+ # Only include items at or after this ISO 8601 timestamp.
231
273
  since: nil,
232
274
  # Filter to items that have this tag.
233
275
  tag: nil,
276
+ # Only include items before this ISO 8601 timestamp.
234
277
  until_: nil,
235
278
  request_options: {}
236
279
  )
@@ -248,10 +291,11 @@ module ContextDev
248
291
  end
249
292
  def list_runs(
250
293
  monitor_id,
294
+ # Opaque pagination cursor from a previous response.
251
295
  cursor: nil,
296
+ # Maximum number of items to return per page (1-100). Defaults to 25.
252
297
  limit: nil,
253
- # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
254
- # (insufficient credits, monitor paused, or superseded by a concurrent run).
298
+ # Filter runs by lifecycle status.
255
299
  status: nil,
256
300
  request_options: {}
257
301
  )
@@ -4,47 +4,74 @@ module ContextDev
4
4
  module Resources
5
5
  class Parse
6
6
  # Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes
7
- # into LLM-usable Markdown. The base request costs 1 credit. When OCR runs
8
- # (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no
9
- # OCR ends up running still cost 1 credit.
7
+ # into LLM-usable Markdown.
10
8
  sig do
11
9
  params(
12
10
  body: ContextDev::Internal::FileInput,
11
+ client: String,
13
12
  extension: ContextDev::ParseHandleParams::Extension::OrSymbol,
14
- include_images: T::Boolean,
15
- include_links: T::Boolean,
16
- ocr: T::Boolean,
13
+ include_images:
14
+ T.any(
15
+ T::Boolean,
16
+ ContextDev::ParseHandleParams::IncludeImages::OrSymbol
17
+ ),
18
+ include_links:
19
+ T.any(
20
+ T::Boolean,
21
+ ContextDev::ParseHandleParams::IncludeLinks::OrSymbol
22
+ ),
23
+ ocr: T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol),
17
24
  pdf: ContextDev::ParseHandleParams::Pdf::OrHash,
18
- shorten_base64_images: T::Boolean,
19
- use_main_content_only: T::Boolean,
25
+ shorten_base64_images:
26
+ T.any(
27
+ T::Boolean,
28
+ ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol
29
+ ),
30
+ tags: T::Array[String],
31
+ use_main_content_only:
32
+ T.any(
33
+ T::Boolean,
34
+ ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol
35
+ ),
36
+ zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol,
20
37
  request_options: ContextDev::RequestOptions::OrHash
21
38
  ).returns(ContextDev::Models::ParseHandleResponse)
22
39
  end
23
40
  def handle(
24
41
  # Body param
25
42
  body:,
26
- # Query param: Optional file extension hint. Case-insensitive; a leading dot is
27
- # accepted (e.g. ".pdf").
43
+ # Query param: Optional client identifier used for usage attribution.
44
+ client: nil,
45
+ # Query param: Optional file extension hint, such as pdf, docx, xlsx, pptx, html,
46
+ # json, csv, md, py, rtf, jpg, png, or txt.
28
47
  extension: nil,
29
48
  # Query param: Include image references in Markdown output
30
49
  include_images: nil,
31
50
  # Query param: Preserve hyperlinks in Markdown output
32
51
  include_links: nil,
33
- # Query param: Gates all OCR. When true, PDFs get embedded-image OCR (recognized
34
- # text inserted at each image's position in page reading order, preserving the
35
- # text layer; pdf.start/pdf.end limit the page range), scanned PDFs with no text
36
- # layer get full-document OCR, and raster images get their visible text
37
- # transcribed. When false, no OCR runs: scanned PDFs may yield no content and
38
- # images return only format/dimension metadata. Calls where OCR actually runs cost
39
- # 5 credits instead of 1.
52
+ # Query param: When true for PDF inputs, detect and OCR images embedded in the
53
+ # selected pages, inserting recognized text at each image's position in page
54
+ # reading order while preserving the PDF text layer. pdf.start/pdf.end limit the
55
+ # inclusive page range. When false, all OCR is disabled, including the automatic
56
+ # scanned-PDF fallback.
40
57
  ocr: nil,
41
- # Query param: PDF page-range controls. Use start/end to limit parsing (and OCR
42
- # when ocr=true) to an inclusive 1-based page range.
58
+ # Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end":
59
+ # 5}.
43
60
  pdf: nil,
44
61
  # Query param: Shorten base64-encoded image data in the Markdown output
45
62
  shorten_base64_images: nil,
63
+ # Query param: Optional comma-separated caller-defined tags for tracking this
64
+ # request. Tags are recorded on the request's usage log and can be used to filter
65
+ # usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
66
+ tags: nil,
46
67
  # Query param: Extract only the main content from HTML-like inputs
47
68
  use_main_content_only: nil,
69
+ # Query param: Set to enabled to bypass shared caches and omit request and
70
+ # response content from retained usage logs. Requires zero data retention to be
71
+ # enabled for your organization (contact support@context.dev), otherwise the
72
+ # request fails with ZDR_NOT_ENABLED. Successful ZDR responses include
73
+ # X-Context-ZDR: true.
74
+ zdr: nil,
48
75
  request_options: {}
49
76
  )
50
77
  end
@@ -15,6 +15,7 @@ module ContextDev
15
15
  ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier::OrHash
16
16
  ),
17
17
  type: ContextDev::UtilityPrefetchParams::Type::OrSymbol,
18
+ tags: T::Array[String],
18
19
  timeout_ms: Integer,
19
20
  request_options: ContextDev::RequestOptions::OrHash
20
21
  ).returns(ContextDev::Models::UtilityPrefetchResponse)
@@ -24,6 +25,8 @@ module ContextDev
24
25
  identifier:,
25
26
  # What to prefetch. Currently only 'brand' is supported.
26
27
  type:,
28
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
29
+ tags: nil,
27
30
  # Optional timeout in milliseconds for the request. If the request takes longer
28
31
  # than this value, it will be aborted with a 408 status code. Maximum allowed
29
32
  # value is 300000ms (5 minutes).