@onkernel/sdk 0.109.0 → 0.111.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 (85) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/auth/connections.d.mts +26 -8
  12. package/resources/auth/connections.d.mts.map +1 -1
  13. package/resources/auth/connections.d.ts +26 -8
  14. package/resources/auth/connections.d.ts.map +1 -1
  15. package/resources/browsers/telemetry.d.mts +13 -4
  16. package/resources/browsers/telemetry.d.mts.map +1 -1
  17. package/resources/browsers/telemetry.d.ts +13 -4
  18. package/resources/browsers/telemetry.d.ts.map +1 -1
  19. package/resources/index.d.mts +1 -0
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +1 -0
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js +3 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs +1 -0
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/search/contents.d.mts +267 -0
  28. package/resources/search/contents.d.mts.map +1 -0
  29. package/resources/search/contents.d.ts +267 -0
  30. package/resources/search/contents.d.ts.map +1 -0
  31. package/resources/search/contents.js +31 -0
  32. package/resources/search/contents.js.map +1 -0
  33. package/resources/search/contents.mjs +27 -0
  34. package/resources/search/contents.mjs.map +1 -0
  35. package/resources/search/index.d.mts +4 -0
  36. package/resources/search/index.d.mts.map +1 -0
  37. package/resources/search/index.d.ts +4 -0
  38. package/resources/search/index.d.ts.map +1 -0
  39. package/resources/search/index.js +11 -0
  40. package/resources/search/index.js.map +1 -0
  41. package/resources/search/index.mjs +5 -0
  42. package/resources/search/index.mjs.map +1 -0
  43. package/resources/search/providers.d.mts +141 -0
  44. package/resources/search/providers.d.mts.map +1 -0
  45. package/resources/search/providers.d.ts +141 -0
  46. package/resources/search/providers.d.ts.map +1 -0
  47. package/resources/search/providers.js +25 -0
  48. package/resources/search/providers.js.map +1 -0
  49. package/resources/search/providers.mjs +21 -0
  50. package/resources/search/providers.mjs.map +1 -0
  51. package/resources/search/search.d.mts +1187 -0
  52. package/resources/search/search.d.mts.map +1 -0
  53. package/resources/search/search.d.ts +1187 -0
  54. package/resources/search/search.d.ts.map +1 -0
  55. package/resources/search/search.js +58 -0
  56. package/resources/search/search.js.map +1 -0
  57. package/resources/search/search.mjs +53 -0
  58. package/resources/search/search.mjs.map +1 -0
  59. package/resources/search.d.mts +2 -0
  60. package/resources/search.d.mts.map +1 -0
  61. package/resources/search.d.ts +2 -0
  62. package/resources/search.d.ts.map +1 -0
  63. package/resources/search.js +6 -0
  64. package/resources/search.js.map +1 -0
  65. package/resources/search.mjs +3 -0
  66. package/resources/search.mjs.map +1 -0
  67. package/resources/vaults/items.d.mts +35 -14
  68. package/resources/vaults/items.d.mts.map +1 -1
  69. package/resources/vaults/items.d.ts +35 -14
  70. package/resources/vaults/items.d.ts.map +1 -1
  71. package/src/client.ts +30 -0
  72. package/src/resources/auth/connections.ts +28 -7
  73. package/src/resources/browsers/telemetry.ts +17 -4
  74. package/src/resources/index.ts +12 -0
  75. package/src/resources/search/contents.ts +327 -0
  76. package/src/resources/search/index.ts +16 -0
  77. package/src/resources/search/providers.ts +197 -0
  78. package/src/resources/search/search.ts +1496 -0
  79. package/src/resources/search.ts +3 -0
  80. package/src/resources/vaults/items.ts +43 -14
  81. package/src/version.ts +1 -1
  82. package/version.d.mts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
@@ -0,0 +1,267 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as SearchAPI from "./search.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ /**
6
+ * Search the web and retrieve content for selected results.
7
+ */
8
+ export declare class Contents extends APIResource {
9
+ /**
10
+ * Deferred result-content retrieval is reserved but not available in this release.
11
+ * Requests return 404 until the retrieval implementation is shipped. X-Request-Id
12
+ * identifies this request separately from the search resource.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * await client.search.contents.fetch('srch_abc123');
17
+ * ```
18
+ */
19
+ fetch(id: string, body: ContentFetchParams, options?: RequestOptions): APIPromise<void>;
20
+ }
21
+ export interface FetchRequest {
22
+ /**
23
+ * Defaults to source:auto when omitted.
24
+ */
25
+ content?: FetchRequest.Content;
26
+ /**
27
+ * Maximum number of search results to fetch when result_ids is omitted, starting
28
+ * from rank 1. Mutually exclusive with result_ids.
29
+ */
30
+ limit?: number;
31
+ /**
32
+ * Kernel-generated IDs from the referenced retained search, in desired response
33
+ * order. They are not provider-standard IDs. Mutually exclusive with limit.
34
+ */
35
+ result_ids?: Array<string>;
36
+ /**
37
+ * Overall deadline across all selected results.
38
+ */
39
+ timeout_ms?: number;
40
+ }
41
+ export declare namespace FetchRequest {
42
+ /**
43
+ * Defaults to source:auto when omitted.
44
+ */
45
+ interface Content {
46
+ /**
47
+ * Invalid with source=provider. Supplying browser_id requires source=browser so
48
+ * the chosen identity is not bypassed.
49
+ */
50
+ browser?: Content.Browser;
51
+ format?: 'markdown' | 'text';
52
+ /**
53
+ * Maximum acceptable age of cached page content, measured from origin retrieval. 0
54
+ * forces a live fetch. Governs the Kernel content cache, which is scoped to the
55
+ * caller organization and project and separated by retrieval context; fetches
56
+ * through a caller-supplied browser_id bypass that cache. Mapped to the provider
57
+ * freshness control when source is provider and the provider supports one;
58
+ * otherwise provider content age is reported as unknown via fetched_at.
59
+ */
60
+ max_age_hours?: number;
61
+ /**
62
+ * Per-result Unicode character limit after extraction.
63
+ */
64
+ max_chars?: number;
65
+ /**
66
+ * provider uses the search provider's native content retrieval; browser fetches
67
+ * each URL through a Kernel browser; auto prefers Kernel browser retrieval and
68
+ * falls back to provider-native content when browser retrieval is unavailable or
69
+ * unsuitable. Defaults to auto for both inline and deferred retrieval. Deferred
70
+ * provider retrieval requires post_hoc capability; an explicit provider source
71
+ * without it is a 400. Missing documents produce per-result unavailable outcomes,
72
+ * not request failures.
73
+ */
74
+ source?: 'auto' | 'provider' | 'browser';
75
+ /**
76
+ * Per-result deadline including capacity acquisition, retrieval, and extraction.
77
+ * Also bounded by the overall request deadline.
78
+ */
79
+ timeout_ms?: number;
80
+ }
81
+ namespace Content {
82
+ /**
83
+ * Invalid with source=provider. Supplying browser_id requires source=browser so
84
+ * the chosen identity is not bypassed.
85
+ */
86
+ interface Browser {
87
+ /**
88
+ * Existing browser session ID authorized for the caller and selected project.
89
+ * Reuses its cookies, proxy, and browser configuration. Kernel does not delete a
90
+ * caller-supplied browser. Render mode uses a temporary tab; website activity may
91
+ * still change shared cookies and storage. When omitted, Kernel obtains isolated
92
+ * browser capacity in the caller's account and releases it after retrieval. That
93
+ * capacity is not retained for later interaction. Existing browser quotas apply.
94
+ */
95
+ browser_id?: string;
96
+ /**
97
+ * Curl uses the browser HTTP stack without navigation or JavaScript execution.
98
+ * Render navigates a temporary page and extracts from its DOM. The selected mode
99
+ * is used for the retrieval.
100
+ */
101
+ mode?: 'curl' | 'render';
102
+ }
103
+ }
104
+ }
105
+ export interface Response {
106
+ contents: Array<Response.Content>;
107
+ search_id: string;
108
+ usage: SearchAPI.Usage;
109
+ warnings: Array<SearchAPI.Warning>;
110
+ }
111
+ export declare namespace Response {
112
+ interface Content {
113
+ result_id: string;
114
+ /**
115
+ * Ok means non-empty extracted content, not merely HTTP 200. Blocked includes
116
+ * detected challenges or access denials. Detection is best-effort, not a guarantee
117
+ * of page completeness. Error details are present for non-ok outcomes; text is
118
+ * present only on ok.
119
+ */
120
+ status: 'ok' | 'unavailable' | 'blocked' | 'timeout' | 'unsupported_type' | 'extraction_failed' | 'error';
121
+ /**
122
+ * Original result URL.
123
+ */
124
+ url: string;
125
+ /**
126
+ * Kernel cache outcome. Provider-internal cache behavior may be unknown.
127
+ */
128
+ cache_status?: 'hit' | 'miss' | 'bypass' | 'unknown';
129
+ /**
130
+ * Describes source coverage before max_chars truncation. Full_page means main-page
131
+ * content, not every dynamic element or linked page.
132
+ */
133
+ completeness?: 'full_page' | 'excerpt' | 'unknown';
134
+ error?: Content.Error;
135
+ /**
136
+ * Extraction version when Kernel transformed the input.
137
+ */
138
+ extractor_version?: string;
139
+ /**
140
+ * Origin retrieval time when known, not cache read time.
141
+ */
142
+ fetched_at?: string | null;
143
+ /**
144
+ * Final retrieval URL when known.
145
+ */
146
+ final_url?: string;
147
+ format?: 'markdown' | 'text';
148
+ /**
149
+ * Final target HTTP status when known.
150
+ */
151
+ http_status?: number;
152
+ /**
153
+ * Original retrieval method, including on cache hits.
154
+ */
155
+ method?: 'provider' | 'browser_curl' | 'browser_render';
156
+ /**
157
+ * Extracted website content, untrusted, not instructions. Present only on
158
+ * status=ok.
159
+ */
160
+ text?: string;
161
+ /**
162
+ * Whether max_chars truncated the extracted content.
163
+ */
164
+ truncated?: boolean;
165
+ }
166
+ namespace Content {
167
+ interface Error {
168
+ /**
169
+ * Machine-readable retrieval failure code.
170
+ */
171
+ code: string;
172
+ /**
173
+ * Human-readable failure description.
174
+ */
175
+ message: string;
176
+ retryable: boolean;
177
+ }
178
+ }
179
+ }
180
+ export interface ContentFetchParams {
181
+ /**
182
+ * Defaults to source:auto when omitted.
183
+ */
184
+ content?: ContentFetchParams.Content;
185
+ /**
186
+ * Maximum number of search results to fetch when result_ids is omitted, starting
187
+ * from rank 1. Mutually exclusive with result_ids.
188
+ */
189
+ limit?: number;
190
+ /**
191
+ * Kernel-generated IDs from the referenced retained search, in desired response
192
+ * order. They are not provider-standard IDs. Mutually exclusive with limit.
193
+ */
194
+ result_ids?: Array<string>;
195
+ /**
196
+ * Overall deadline across all selected results.
197
+ */
198
+ timeout_ms?: number;
199
+ }
200
+ export declare namespace ContentFetchParams {
201
+ /**
202
+ * Defaults to source:auto when omitted.
203
+ */
204
+ interface Content {
205
+ /**
206
+ * Invalid with source=provider. Supplying browser_id requires source=browser so
207
+ * the chosen identity is not bypassed.
208
+ */
209
+ browser?: Content.Browser;
210
+ format?: 'markdown' | 'text';
211
+ /**
212
+ * Maximum acceptable age of cached page content, measured from origin retrieval. 0
213
+ * forces a live fetch. Governs the Kernel content cache, which is scoped to the
214
+ * caller organization and project and separated by retrieval context; fetches
215
+ * through a caller-supplied browser_id bypass that cache. Mapped to the provider
216
+ * freshness control when source is provider and the provider supports one;
217
+ * otherwise provider content age is reported as unknown via fetched_at.
218
+ */
219
+ max_age_hours?: number;
220
+ /**
221
+ * Per-result Unicode character limit after extraction.
222
+ */
223
+ max_chars?: number;
224
+ /**
225
+ * provider uses the search provider's native content retrieval; browser fetches
226
+ * each URL through a Kernel browser; auto prefers Kernel browser retrieval and
227
+ * falls back to provider-native content when browser retrieval is unavailable or
228
+ * unsuitable. Defaults to auto for both inline and deferred retrieval. Deferred
229
+ * provider retrieval requires post_hoc capability; an explicit provider source
230
+ * without it is a 400. Missing documents produce per-result unavailable outcomes,
231
+ * not request failures.
232
+ */
233
+ source?: 'auto' | 'provider' | 'browser';
234
+ /**
235
+ * Per-result deadline including capacity acquisition, retrieval, and extraction.
236
+ * Also bounded by the overall request deadline.
237
+ */
238
+ timeout_ms?: number;
239
+ }
240
+ namespace Content {
241
+ /**
242
+ * Invalid with source=provider. Supplying browser_id requires source=browser so
243
+ * the chosen identity is not bypassed.
244
+ */
245
+ interface Browser {
246
+ /**
247
+ * Existing browser session ID authorized for the caller and selected project.
248
+ * Reuses its cookies, proxy, and browser configuration. Kernel does not delete a
249
+ * caller-supplied browser. Render mode uses a temporary tab; website activity may
250
+ * still change shared cookies and storage. When omitted, Kernel obtains isolated
251
+ * browser capacity in the caller's account and releases it after retrieval. That
252
+ * capacity is not retained for later interaction. Existing browser quotas apply.
253
+ */
254
+ browser_id?: string;
255
+ /**
256
+ * Curl uses the browser HTTP stack without navigation or JavaScript execution.
257
+ * Render navigates a temporary page and extracts from its DOM. The selected mode
258
+ * is used for the retrieval.
259
+ */
260
+ mode?: 'curl' | 'render';
261
+ }
262
+ }
263
+ }
264
+ export declare namespace Contents {
265
+ export { type FetchRequest as FetchRequest, type Response as Response, type ContentFetchParams as ContentFetchParams, };
266
+ }
267
+ //# sourceMappingURL=contents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contents.d.ts","sourceRoot":"","sources":["../../src/resources/search/contents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,SAAS,oBAAiB;AACtC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOxF;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC;IAE/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,yBAAiB,YAAY,CAAC;IAC5B;;OAEG;IACH,UAAiB,OAAO;QACtB;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;QAE1B,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;QAE7B;;;;;;;WAOG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;;;;;;WAQG;QACH,MAAM,CAAC,EAAE,M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AAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Contents = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ /**
9
+ * Search the web and retrieve content for selected results.
10
+ */
11
+ class Contents extends resource_1.APIResource {
12
+ /**
13
+ * Deferred result-content retrieval is reserved but not available in this release.
14
+ * Requests return 404 until the retrieval implementation is shipped. X-Request-Id
15
+ * identifies this request separately from the search resource.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * await client.search.contents.fetch('srch_abc123');
20
+ * ```
21
+ */
22
+ fetch(id, body, options) {
23
+ return this._client.post((0, path_1.path) `/search/${id}/contents`, {
24
+ body,
25
+ ...options,
26
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
27
+ });
28
+ }
29
+ }
30
+ exports.Contents = Contents;
31
+ //# sourceMappingURL=contents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contents.js","sourceRoot":"","sources":["../../src/resources/search/contents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAsD;AAEtD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAwB;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,EAAE,WAAW,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAlBD,4BAkBC"}
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ /**
6
+ * Search the web and retrieve content for selected results.
7
+ */
8
+ export class Contents extends APIResource {
9
+ /**
10
+ * Deferred result-content retrieval is reserved but not available in this release.
11
+ * Requests return 404 until the retrieval implementation is shipped. X-Request-Id
12
+ * identifies this request separately from the search resource.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * await client.search.contents.fetch('srch_abc123');
17
+ * ```
18
+ */
19
+ fetch(id, body, options) {
20
+ return this._client.post(path `/search/${id}/contents`, {
21
+ body,
22
+ ...options,
23
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
24
+ });
25
+ }
26
+ }
27
+ //# sourceMappingURL=contents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contents.mjs","sourceRoot":"","sources":["../../src/resources/search/contents.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAwB;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,EAAE,WAAW,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { Contents, type FetchRequest, type Response, type ContentFetchParams } from "./contents.mjs";
2
+ export { Providers, type Provider, type ProviderListResponse, type ProviderListParams } from "./providers.mjs";
3
+ export { SearchResource, type Attempt, type ProviderTarget, type Request, type Result, type Search, type Strategy, type Usage, type Warning, type SearchCreateParams, } from "./search.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/search/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,uBAAmB;AACjG,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,wBAAoB;AAC3G,OAAO,EACL,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,kBAAkB,GACxB,qBAAiB"}
@@ -0,0 +1,4 @@
1
+ export { Contents, type FetchRequest, type Response, type ContentFetchParams } from "./contents.js";
2
+ export { Providers, type Provider, type ProviderListResponse, type ProviderListParams } from "./providers.js";
3
+ export { SearchResource, type Attempt, type ProviderTarget, type Request, type Result, type Search, type Strategy, type Usage, type Warning, type SearchCreateParams, } from "./search.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/search/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,sBAAmB;AACjG,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,uBAAoB;AAC3G,OAAO,EACL,cAAc,EACd,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,kBAAkB,GACxB,oBAAiB"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SearchResource = exports.Providers = exports.Contents = void 0;
5
+ var contents_1 = require("./contents.js");
6
+ Object.defineProperty(exports, "Contents", { enumerable: true, get: function () { return contents_1.Contents; } });
7
+ var providers_1 = require("./providers.js");
8
+ Object.defineProperty(exports, "Providers", { enumerable: true, get: function () { return providers_1.Providers; } });
9
+ var search_1 = require("./search.js");
10
+ Object.defineProperty(exports, "SearchResource", { enumerable: true, get: function () { return search_1.SearchResource; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/search/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAAiG;AAAxF,oGAAA,QAAQ,OAAA;AACjB,4CAA2G;AAAlG,sGAAA,SAAS,OAAA;AAClB,sCAWkB;AAVhB,wGAAA,cAAc,OAAA"}
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Contents } from "./contents.mjs";
3
+ export { Providers } from "./providers.mjs";
4
+ export { SearchResource, } from "./search.mjs";
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/search/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,QAAQ,EAA6D,uBAAmB;AACjG,OAAO,EAAE,SAAS,EAAqE,wBAAoB;AAC3G,OAAO,EACL,cAAc,GAUf,qBAAiB"}
@@ -0,0 +1,141 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ /**
5
+ * Search the web and retrieve content for selected results.
6
+ */
7
+ export declare class Providers extends APIResource {
8
+ /**
9
+ * Lists providers, capabilities, and machine-readable native-option schemas. Auto
10
+ * and fallback are strategies, not provider entries. The list is not paginated and
11
+ * contains no latency benchmarks. X-Request-Id identifies the request.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const providers = await client.search.providers.list();
16
+ * ```
17
+ */
18
+ list(query?: ProviderListParams | null | undefined, options?: RequestOptions): APIPromise<ProviderListResponse>;
19
+ }
20
+ export interface Provider {
21
+ content: Provider.Content;
22
+ max_results_cap: number;
23
+ params: Provider.Params;
24
+ provider_options: Provider.ProviderOptions;
25
+ slug: string;
26
+ /**
27
+ * Provider-specific limitations, conditional filter support, and warnings about
28
+ * search modes.
29
+ */
30
+ notes?: Array<string>;
31
+ }
32
+ export declare namespace Provider {
33
+ interface Content {
34
+ /**
35
+ * Can enforce the requested maximum content age.
36
+ */
37
+ freshness_control: boolean;
38
+ /**
39
+ * Supports content retrieval with the search request.
40
+ */
41
+ inline: boolean;
42
+ /**
43
+ * Supports content retrieval after the search completes.
44
+ */
45
+ post_hoc: boolean;
46
+ }
47
+ interface Params {
48
+ country: Params.Country;
49
+ end_date: Params.EndDate;
50
+ exclude_domains: Params.ExcludeDomains;
51
+ include_domains: Params.IncludeDomains;
52
+ language: Params.Language;
53
+ recency: Params.Recency;
54
+ safe_search: Params.SafeSearch;
55
+ start_date: Params.StartDate;
56
+ }
57
+ namespace Params {
58
+ interface Country {
59
+ support: 'native' | 'emulated' | 'unsupported';
60
+ /**
61
+ * Translation behavior, limitations, and precision.
62
+ */
63
+ notes?: string;
64
+ }
65
+ interface EndDate {
66
+ support: 'native' | 'emulated' | 'unsupported';
67
+ /**
68
+ * Translation behavior, limitations, and precision.
69
+ */
70
+ notes?: string;
71
+ }
72
+ interface ExcludeDomains {
73
+ support: 'native' | 'emulated' | 'unsupported';
74
+ /**
75
+ * Translation behavior, limitations, and precision.
76
+ */
77
+ notes?: string;
78
+ }
79
+ interface IncludeDomains {
80
+ support: 'native' | 'emulated' | 'unsupported';
81
+ /**
82
+ * Translation behavior, limitations, and precision.
83
+ */
84
+ notes?: string;
85
+ }
86
+ interface Language {
87
+ support: 'native' | 'emulated' | 'unsupported';
88
+ /**
89
+ * Translation behavior, limitations, and precision.
90
+ */
91
+ notes?: string;
92
+ }
93
+ interface Recency {
94
+ support: 'native' | 'emulated' | 'unsupported';
95
+ /**
96
+ * Translation behavior, limitations, and precision.
97
+ */
98
+ notes?: string;
99
+ }
100
+ interface SafeSearch {
101
+ support: 'native' | 'emulated' | 'unsupported';
102
+ /**
103
+ * Translation behavior, limitations, and precision.
104
+ */
105
+ notes?: string;
106
+ }
107
+ interface StartDate {
108
+ support: 'native' | 'emulated' | 'unsupported';
109
+ /**
110
+ * Translation behavior, limitations, and precision.
111
+ */
112
+ notes?: string;
113
+ }
114
+ }
115
+ interface ProviderOptions {
116
+ /**
117
+ * JSON Schema for the provider-native options accepted by POST /search.
118
+ */
119
+ schema: {
120
+ [key: string]: unknown;
121
+ };
122
+ /**
123
+ * OpenAPI component name for the matching typed provider-options schema.
124
+ */
125
+ schema_ref: string;
126
+ examples?: Array<{
127
+ [key: string]: unknown;
128
+ }>;
129
+ }
130
+ }
131
+ export type ProviderListResponse = Array<Provider>;
132
+ export interface ProviderListParams {
133
+ /**
134
+ * Optional concrete provider slug filter. Omit to list every provider.
135
+ */
136
+ slug?: 'brave' | 'exa' | 'perplexity' | 'context' | 'parallel' | 'valyu' | 'octen' | 'you' | 'tavily' | 'serpapi';
137
+ }
138
+ export declare namespace Providers {
139
+ export { type Provider as Provider, type ProviderListResponse as ProviderListResponse, type ProviderListParams as ProviderListParams, };
140
+ }
141
+ //# sourceMappingURL=providers.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.mts","sourceRoot":"","sources":["../../src/resources/search/providers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;OASG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;CAGpC;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;IAE1B,eAAe,EAAE,MAAM,CAAC;IAExB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;IAExB,gBAAgB,EAAE,QAAQ,CAAC,eAAe,CAAC;IAE3C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,yBAAiB,QAAQ,CAAC;IACxB,UAAiB,OAAO;QACtB;;WAEG;QACH,iBAAiB,EAAE,OAAO,CAAC;QAE3B;;WAEG;QACH,MAAM,EAAE,OAAO,CAAC;QAEhB;;WAEG;QACH,QAAQ,EAAE,OAAO,CAAC;KACnB;IAED,UAAiB,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;QAExB,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC;QAEzB,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC;QAEvC,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC;QAEvC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;QAE1B,OAAO,EAAE,MAAM,CAAC,OAAO,CAA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