@nimble-way/nimble-js 0.19.0 → 1.0.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 (255) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +10 -10
  3. package/client.d.mts +10 -39
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +10 -39
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -43
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -43
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/agents/agents.d.mts +811 -0
  13. package/resources/agents/agents.d.mts.map +1 -0
  14. package/resources/agents/agents.d.ts +811 -0
  15. package/resources/agents/agents.d.ts.map +1 -0
  16. package/resources/agents/agents.js +67 -0
  17. package/resources/agents/agents.js.map +1 -0
  18. package/resources/agents/agents.mjs +62 -0
  19. package/resources/agents/agents.mjs.map +1 -0
  20. package/resources/agents/index.d.mts +4 -0
  21. package/resources/agents/index.d.mts.map +1 -0
  22. package/resources/agents/index.d.ts +4 -0
  23. package/resources/agents/index.d.ts.map +1 -0
  24. package/resources/{task-agent → agents}/index.js +3 -3
  25. package/resources/agents/index.js.map +1 -0
  26. package/resources/{task-agent → agents}/index.mjs +1 -1
  27. package/resources/agents/index.mjs.map +1 -0
  28. package/resources/{task-agent → agents}/runs.d.mts +413 -128
  29. package/resources/agents/runs.d.mts.map +1 -0
  30. package/resources/{task-agent → agents}/runs.d.ts +413 -128
  31. package/resources/agents/runs.d.ts.map +1 -0
  32. package/resources/agents/runs.js +63 -0
  33. package/resources/agents/runs.js.map +1 -0
  34. package/resources/agents/runs.mjs +59 -0
  35. package/resources/agents/runs.mjs.map +1 -0
  36. package/resources/agents/templates.d.mts +258 -0
  37. package/resources/agents/templates.d.mts.map +1 -0
  38. package/resources/agents/templates.d.ts +258 -0
  39. package/resources/agents/templates.d.ts.map +1 -0
  40. package/resources/{task-agent → agents}/templates.js +5 -4
  41. package/resources/agents/templates.js.map +1 -0
  42. package/resources/agents/templates.mjs +19 -0
  43. package/resources/agents/templates.mjs.map +1 -0
  44. package/resources/agents.d.mts +2 -0
  45. package/resources/agents.d.mts.map +1 -0
  46. package/resources/agents.d.ts +2 -0
  47. package/resources/agents.d.ts.map +1 -0
  48. package/resources/{task-agent.js → agents.js} +2 -2
  49. package/resources/agents.js.map +1 -0
  50. package/resources/{task-agent.mjs → agents.mjs} +2 -2
  51. package/resources/agents.mjs.map +1 -0
  52. package/resources/batches.js +3 -3
  53. package/resources/batches.mjs +3 -3
  54. package/resources/crawl.js +4 -4
  55. package/resources/crawl.mjs +4 -4
  56. package/resources/domain-knowledge.js +1 -1
  57. package/resources/domain-knowledge.mjs +1 -1
  58. package/resources/extract/extract.d.mts +1243 -0
  59. package/resources/extract/extract.d.mts.map +1 -0
  60. package/resources/extract/extract.d.ts +1243 -0
  61. package/resources/extract/extract.d.ts.map +1 -0
  62. package/resources/extract/extract.js +52 -0
  63. package/resources/extract/extract.js.map +1 -0
  64. package/resources/extract/extract.mjs +47 -0
  65. package/resources/extract/extract.mjs.map +1 -0
  66. package/resources/extract/index.d.mts +3 -0
  67. package/resources/extract/index.d.mts.map +1 -0
  68. package/resources/extract/index.d.ts +3 -0
  69. package/resources/extract/index.d.ts.map +1 -0
  70. package/resources/extract/index.js +9 -0
  71. package/resources/extract/index.js.map +1 -0
  72. package/resources/extract/index.mjs +4 -0
  73. package/resources/extract/index.mjs.map +1 -0
  74. package/resources/extract/templates/generations.d.mts +364 -0
  75. package/resources/extract/templates/generations.d.mts.map +1 -0
  76. package/resources/extract/templates/generations.d.ts +364 -0
  77. package/resources/extract/templates/generations.d.ts.map +1 -0
  78. package/resources/extract/templates/generations.js +39 -0
  79. package/resources/extract/templates/generations.js.map +1 -0
  80. package/resources/extract/templates/generations.mjs +35 -0
  81. package/resources/extract/templates/generations.mjs.map +1 -0
  82. package/resources/extract/templates/index.d.mts +4 -0
  83. package/resources/extract/templates/index.d.mts.map +1 -0
  84. package/resources/extract/templates/index.d.ts +4 -0
  85. package/resources/extract/templates/index.d.ts.map +1 -0
  86. package/resources/extract/templates/index.js +11 -0
  87. package/resources/extract/templates/index.js.map +1 -0
  88. package/resources/extract/templates/index.mjs +5 -0
  89. package/resources/extract/templates/index.mjs.map +1 -0
  90. package/resources/{agent.d.ts → extract/templates/templates.d.mts} +475 -263
  91. package/resources/extract/templates/templates.d.mts.map +1 -0
  92. package/resources/{agent.d.mts → extract/templates/templates.d.ts} +475 -263
  93. package/resources/extract/templates/templates.d.ts.map +1 -0
  94. package/resources/extract/templates/templates.js +120 -0
  95. package/resources/extract/templates/templates.js.map +1 -0
  96. package/resources/extract/templates/templates.mjs +115 -0
  97. package/resources/extract/templates/templates.mjs.map +1 -0
  98. package/resources/extract/templates/versions.d.mts +226 -0
  99. package/resources/extract/templates/versions.d.mts.map +1 -0
  100. package/resources/extract/templates/versions.d.ts +226 -0
  101. package/resources/extract/templates/versions.d.ts.map +1 -0
  102. package/resources/extract/templates/versions.js +42 -0
  103. package/resources/extract/templates/versions.js.map +1 -0
  104. package/resources/extract/templates/versions.mjs +38 -0
  105. package/resources/extract/templates/versions.mjs.map +1 -0
  106. package/resources/extract/templates.d.mts +2 -0
  107. package/resources/extract/templates.d.mts.map +1 -0
  108. package/resources/extract/templates.d.ts +2 -0
  109. package/resources/extract/templates.d.ts.map +1 -0
  110. package/resources/extract/templates.js +6 -0
  111. package/resources/extract/templates.js.map +1 -0
  112. package/resources/extract/templates.mjs +3 -0
  113. package/resources/extract/templates.mjs.map +1 -0
  114. package/resources/extract.d.mts +2 -0
  115. package/resources/extract.d.mts.map +1 -0
  116. package/resources/extract.d.ts +2 -0
  117. package/resources/extract.d.ts.map +1 -0
  118. package/resources/extract.js +6 -0
  119. package/resources/extract.js.map +1 -0
  120. package/resources/extract.mjs +3 -0
  121. package/resources/extract.mjs.map +1 -0
  122. package/resources/fast-serp.js +1 -1
  123. package/resources/fast-serp.mjs +1 -1
  124. package/resources/index.d.mts +4 -4
  125. package/resources/index.d.mts.map +1 -1
  126. package/resources/index.d.ts +4 -4
  127. package/resources/index.d.ts.map +1 -1
  128. package/resources/index.js +5 -5
  129. package/resources/index.js.map +1 -1
  130. package/resources/index.mjs +2 -2
  131. package/resources/index.mjs.map +1 -1
  132. package/resources/jobs/index.d.mts +2 -2
  133. package/resources/jobs/index.d.mts.map +1 -1
  134. package/resources/jobs/index.d.ts +2 -2
  135. package/resources/jobs/index.d.ts.map +1 -1
  136. package/resources/jobs/index.js.map +1 -1
  137. package/resources/jobs/index.mjs.map +1 -1
  138. package/resources/jobs/jobs.d.mts +34 -90
  139. package/resources/jobs/jobs.d.mts.map +1 -1
  140. package/resources/jobs/jobs.d.ts +34 -90
  141. package/resources/jobs/jobs.d.ts.map +1 -1
  142. package/resources/jobs/jobs.js +10 -16
  143. package/resources/jobs/jobs.js.map +1 -1
  144. package/resources/jobs/jobs.mjs +11 -17
  145. package/resources/jobs/jobs.mjs.map +1 -1
  146. package/resources/jobs/runs/artifacts.d.mts +7 -17
  147. package/resources/jobs/runs/artifacts.d.mts.map +1 -1
  148. package/resources/jobs/runs/artifacts.d.ts +7 -17
  149. package/resources/jobs/runs/artifacts.d.ts.map +1 -1
  150. package/resources/jobs/runs/artifacts.js +8 -8
  151. package/resources/jobs/runs/artifacts.mjs +8 -8
  152. package/resources/jobs/runs/index.d.mts +1 -1
  153. package/resources/jobs/runs/index.d.mts.map +1 -1
  154. package/resources/jobs/runs/index.d.ts +1 -1
  155. package/resources/jobs/runs/index.d.ts.map +1 -1
  156. package/resources/jobs/runs/index.js.map +1 -1
  157. package/resources/jobs/runs/index.mjs.map +1 -1
  158. package/resources/jobs/runs/runs.d.mts +59 -21
  159. package/resources/jobs/runs/runs.d.mts.map +1 -1
  160. package/resources/jobs/runs/runs.d.ts +59 -21
  161. package/resources/jobs/runs/runs.d.ts.map +1 -1
  162. package/resources/jobs/runs/runs.js +12 -6
  163. package/resources/jobs/runs/runs.js.map +1 -1
  164. package/resources/jobs/runs/runs.mjs +12 -6
  165. package/resources/jobs/runs/runs.mjs.map +1 -1
  166. package/resources/media.js +2 -2
  167. package/resources/media.mjs +2 -2
  168. package/resources/serp.js +3 -3
  169. package/resources/serp.mjs +3 -3
  170. package/resources/tasks.js +3 -3
  171. package/resources/tasks.mjs +3 -3
  172. package/resources/top-level.d.mts +1 -1208
  173. package/resources/top-level.d.mts.map +1 -1
  174. package/resources/top-level.d.ts +1 -1208
  175. package/resources/top-level.d.ts.map +1 -1
  176. package/src/client.ts +41 -123
  177. package/src/resources/agents/agents.ts +1039 -0
  178. package/src/resources/agents/index.ts +30 -0
  179. package/src/resources/{task-agent → agents}/runs.ts +450 -154
  180. package/src/resources/agents/templates.ts +324 -0
  181. package/src/resources/{task-agent.ts → agents.ts} +1 -1
  182. package/src/resources/batches.ts +3 -3
  183. package/src/resources/crawl.ts +4 -4
  184. package/src/resources/domain-knowledge.ts +1 -1
  185. package/src/resources/extract/extract.ts +5182 -0
  186. package/src/resources/extract/index.ts +25 -0
  187. package/src/resources/extract/templates/generations.ts +435 -0
  188. package/src/resources/extract/templates/index.ts +29 -0
  189. package/src/resources/extract/templates/templates.ts +1176 -0
  190. package/src/resources/extract/templates/versions.ts +284 -0
  191. package/src/resources/extract/templates.ts +3 -0
  192. package/src/resources/extract.ts +3 -0
  193. package/src/resources/fast-serp.ts +1 -1
  194. package/src/resources/index.ts +16 -36
  195. package/src/resources/jobs/index.ts +1 -1
  196. package/src/resources/jobs/jobs.ts +49 -112
  197. package/src/resources/jobs/runs/artifacts.ts +11 -21
  198. package/src/resources/jobs/runs/index.ts +1 -0
  199. package/src/resources/jobs/runs/runs.ts +74 -24
  200. package/src/resources/media.ts +2 -2
  201. package/src/resources/serp.ts +3 -3
  202. package/src/resources/tasks.ts +3 -3
  203. package/src/resources/top-level.ts +88 -5192
  204. package/src/version.ts +1 -1
  205. package/version.d.mts +1 -1
  206. package/version.d.mts.map +1 -1
  207. package/version.d.ts +1 -1
  208. package/version.d.ts.map +1 -1
  209. package/version.js +1 -1
  210. package/version.js.map +1 -1
  211. package/version.mjs +1 -1
  212. package/version.mjs.map +1 -1
  213. package/resources/agent.d.mts.map +0 -1
  214. package/resources/agent.d.ts.map +0 -1
  215. package/resources/agent.js +0 -101
  216. package/resources/agent.js.map +0 -1
  217. package/resources/agent.mjs +0 -97
  218. package/resources/agent.mjs.map +0 -1
  219. package/resources/task-agent/index.d.mts +0 -4
  220. package/resources/task-agent/index.d.mts.map +0 -1
  221. package/resources/task-agent/index.d.ts +0 -4
  222. package/resources/task-agent/index.d.ts.map +0 -1
  223. package/resources/task-agent/index.js.map +0 -1
  224. package/resources/task-agent/index.mjs.map +0 -1
  225. package/resources/task-agent/runs.d.mts.map +0 -1
  226. package/resources/task-agent/runs.d.ts.map +0 -1
  227. package/resources/task-agent/runs.js +0 -65
  228. package/resources/task-agent/runs.js.map +0 -1
  229. package/resources/task-agent/runs.mjs +0 -61
  230. package/resources/task-agent/runs.mjs.map +0 -1
  231. package/resources/task-agent/task-agent.d.mts +0 -481
  232. package/resources/task-agent/task-agent.d.mts.map +0 -1
  233. package/resources/task-agent/task-agent.d.ts +0 -481
  234. package/resources/task-agent/task-agent.d.ts.map +0 -1
  235. package/resources/task-agent/task-agent.js +0 -68
  236. package/resources/task-agent/task-agent.js.map +0 -1
  237. package/resources/task-agent/task-agent.mjs +0 -63
  238. package/resources/task-agent/task-agent.mjs.map +0 -1
  239. package/resources/task-agent/templates.d.mts +0 -107
  240. package/resources/task-agent/templates.d.mts.map +0 -1
  241. package/resources/task-agent/templates.d.ts +0 -107
  242. package/resources/task-agent/templates.d.ts.map +0 -1
  243. package/resources/task-agent/templates.js.map +0 -1
  244. package/resources/task-agent/templates.mjs +0 -18
  245. package/resources/task-agent/templates.mjs.map +0 -1
  246. package/resources/task-agent.d.mts +0 -2
  247. package/resources/task-agent.d.mts.map +0 -1
  248. package/resources/task-agent.d.ts +0 -2
  249. package/resources/task-agent.d.ts.map +0 -1
  250. package/resources/task-agent.js.map +0 -1
  251. package/resources/task-agent.mjs.map +0 -1
  252. package/src/resources/agent.ts +0 -952
  253. package/src/resources/task-agent/index.ts +0 -32
  254. package/src/resources/task-agent/task-agent.ts +0 -746
  255. package/src/resources/task-agent/templates.ts +0 -172
@@ -1,221 +1,543 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import { APIPromise } from "../core/api-promise.mjs";
3
- import { RequestOptions } from "../internal/request-options.mjs";
4
- export declare class Agent extends APIResource {
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import * as GenerationsAPI from "./generations.js";
3
+ import { GenerationCreateParams, GenerationCreateResponse, GenerationGetResponse, Generations } from "./generations.js";
4
+ import * as VersionsAPI from "./versions.js";
5
+ import { VersionGetParams, VersionGetResponse, VersionListParams, VersionListResponse, Versions } from "./versions.js";
6
+ import { APIPromise } from "../../../core/api-promise.js";
7
+ import { RequestOptions } from "../../../internal/request-options.js";
8
+ export declare class Templates extends APIResource {
9
+ generations: GenerationsAPI.Generations;
10
+ versions: VersionsAPI.Versions;
5
11
  /**
6
- * List Agent Templates
12
+ * Patch Extract Template Public V2
7
13
  *
8
14
  * @example
9
15
  * ```ts
10
- * const agents = await client.agent.list();
16
+ * const template = await client.extract.templates.update(
17
+ * 'extract_template_name',
18
+ * { body: [{ op: 'add', path: 'path' }] },
19
+ * );
11
20
  * ```
12
21
  */
13
- list(query?: AgentListParams | null | undefined, options?: RequestOptions): APIPromise<AgentListResponse>;
22
+ update(extractTemplateName: string, params: TemplateUpdateParams, options?: RequestOptions): APIPromise<TemplateUpdateResponse>;
14
23
  /**
15
- * Create Agent Generation
24
+ * List Extract Templates Public V2
16
25
  *
17
26
  * @example
18
27
  * ```ts
19
- * const response = await client.agent.generate({
20
- * prompt: 'prompt',
21
- * url: 'url',
22
- * });
28
+ * const templates = await client.extract.templates.list();
23
29
  * ```
24
30
  */
25
- generate(body: AgentGenerateParams, options?: RequestOptions): APIPromise<AgentGenerateResponse>;
31
+ list(query?: TemplateListParams | null | undefined, options?: RequestOptions): APIPromise<TemplateListResponse>;
26
32
  /**
27
- * Get Agent Template
33
+ * Delete Extract Template Public V2
28
34
  *
29
35
  * @example
30
36
  * ```ts
31
- * const agent = await client.agent.get('template_name');
37
+ * await client.extract.templates.delete(
38
+ * 'extract_template_name',
39
+ * );
32
40
  * ```
33
41
  */
34
- get(templateName: string, options?: RequestOptions): APIPromise<AgentGetResponse>;
42
+ delete(extractTemplateName: string, options?: RequestOptions): APIPromise<void>;
35
43
  /**
36
- * Get Agent Generation
44
+ * Execute Extraction Template Async Endpoint
37
45
  *
38
46
  * @example
39
47
  * ```ts
40
- * const response = await client.agent.getGeneration(
41
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
42
- * );
48
+ * const response = await client.extract.templates.async({
49
+ * params: { foo: 'bar' },
50
+ * template: 'template',
51
+ * });
43
52
  * ```
44
53
  */
45
- getGeneration(generationID: string, options?: RequestOptions): APIPromise<AgentGetGenerationResponse>;
54
+ async(body: TemplateAsyncParams, options?: RequestOptions): APIPromise<TemplateAsyncResponse>;
46
55
  /**
47
- * Execute WSA Realtime Endpoint
56
+ * Execute Extraction Template Batch Endpoint
48
57
  *
49
58
  * @example
50
59
  * ```ts
51
- * const response = await client.agent.run({
52
- * agent: 'agent',
53
- * params: { foo: 'bar' },
60
+ * const response = await client.extract.templates.batch({
61
+ * inputs: [{}],
62
+ * shared_inputs: { template: 'template' },
54
63
  * });
55
64
  * ```
56
65
  */
57
- run(body: AgentRunParams, options?: RequestOptions): APIPromise<AgentRunResponse>;
66
+ batch(body: TemplateBatchParams, options?: RequestOptions): APIPromise<TemplateBatchResponse>;
58
67
  /**
59
- * Execute WSA Async Endpoint
68
+ * Get Extract Template Public V2
60
69
  *
61
70
  * @example
62
71
  * ```ts
63
- * const response = await client.agent.runAsync({
64
- * agent: 'agent',
65
- * params: { foo: 'bar' },
66
- * });
72
+ * const template = await client.extract.templates.get(
73
+ * 'extract_template_name',
74
+ * );
67
75
  * ```
68
76
  */
69
- runAsync(body: AgentRunAsyncParams, options?: RequestOptions): APIPromise<AgentRunAsyncResponse>;
77
+ get(extractTemplateName: string, options?: RequestOptions): APIPromise<TemplateGetResponse>;
70
78
  /**
71
- * Execute WSA Batch Endpoint
79
+ * Execute Extraction Template Realtime Endpoint
72
80
  *
73
81
  * @example
74
82
  * ```ts
75
- * const response = await client.agent.runBatch({
76
- * inputs: [{}],
77
- * shared_inputs: { agent: 'agent' },
83
+ * const response = await client.extract.templates.run({
84
+ * params: { foo: 'bar' },
85
+ * template: 'template',
78
86
  * });
79
87
  * ```
80
88
  */
81
- runBatch(body: AgentRunBatchParams, options?: RequestOptions): APIPromise<AgentRunBatchResponse>;
82
- }
83
- export type AgentListResponse = Array<AgentListResponse.AgentListResponseItem>;
84
- export declare namespace AgentListResponse {
85
- interface AgentListResponseItem {
86
- display_name: string;
87
- is_public: boolean;
88
- name: string;
89
- description?: string | null;
90
- domain?: string | null;
91
- entity_type?: string | null;
92
- managed_by?: string | null;
93
- vertical?: string | null;
94
- }
89
+ run(body: TemplateRunParams, options?: RequestOptions): APIPromise<TemplateRunResponse>;
95
90
  }
96
- export interface AgentGenerateResponse {
91
+ export interface TemplateUpdateResponse {
92
+ /**
93
+ * Unique extract template identifier.
94
+ */
97
95
  id: string;
98
- status: string;
99
- agent_name?: string | null;
100
- completed_at?: string | null;
101
- created_at?: string | null;
102
- error?: string | null;
103
- generated_version?: AgentGenerateResponse.GeneratedVersion | null;
104
- generated_version_id?: string | null;
105
- source_version_id?: string | null;
106
- started_at?: string | null;
107
- summary?: string | null;
96
+ /**
97
+ * When the extract template was created.
98
+ */
99
+ created_at: string;
100
+ /**
101
+ * Stable extract template name.
102
+ */
103
+ name: string;
104
+ /**
105
+ * When the extract template was last updated.
106
+ */
107
+ updated_at: string;
108
+ /**
109
+ * Published version details, when available.
110
+ */
111
+ published_version?: TemplateUpdateResponse.PublishedVersion | null;
112
+ /**
113
+ * Identifier of the published version.
114
+ */
115
+ published_version_id?: string | null;
108
116
  }
109
- export declare namespace AgentGenerateResponse {
110
- interface GeneratedVersion {
117
+ export declare namespace TemplateUpdateResponse {
118
+ /**
119
+ * Published version details, when available.
120
+ */
121
+ interface PublishedVersion {
122
+ /**
123
+ * Unique extract template version identifier.
124
+ */
111
125
  id: string;
112
- agent_name: string;
126
+ /**
127
+ * When the version was created.
128
+ */
113
129
  created_at: string;
130
+ /**
131
+ * JSON schema describing accepted input parameters.
132
+ */
114
133
  input_schema: {
115
134
  [key: string]: unknown;
116
135
  };
117
- metadata: GeneratedVersion.Metadata;
136
+ /**
137
+ * Metadata associated with this version.
138
+ */
139
+ metadata: PublishedVersion.Metadata;
140
+ /**
141
+ * Extract template name this version belongs to.
142
+ */
143
+ name: string;
144
+ /**
145
+ * JSON schema describing extracted output.
146
+ */
118
147
  output_schema: {
119
148
  [key: string]: unknown;
120
149
  };
150
+ /**
151
+ * Monotonic version number for the extract template.
152
+ */
121
153
  version_number: number;
122
- samples?: Array<GeneratedVersion.Sample> | null;
154
+ /**
155
+ * Sample input and output pairs for the version.
156
+ */
157
+ samples?: Array<PublishedVersion.Sample> | null;
123
158
  }
124
- namespace GeneratedVersion {
159
+ namespace PublishedVersion {
160
+ /**
161
+ * Metadata associated with this version.
162
+ */
125
163
  interface Metadata {
164
+ /**
165
+ * Data source associated with the version.
166
+ */
126
167
  data_source?: string | null;
168
+ /**
169
+ * Version description shown to users.
170
+ */
127
171
  description?: string | null;
172
+ /**
173
+ * Human-friendly version display name.
174
+ */
128
175
  display_name?: string | null;
176
+ /**
177
+ * Domain associated with the version.
178
+ */
129
179
  domain?: string | null;
180
+ /**
181
+ * Entity type produced by the version.
182
+ */
130
183
  entity_type?: string | null;
184
+ /**
185
+ * Tags associated with the version.
186
+ */
131
187
  tags?: Array<string>;
188
+ /**
189
+ * Business vertical associated with the version.
190
+ */
132
191
  vertical?: string | null;
133
192
  }
134
193
  interface Sample {
194
+ /**
195
+ * Sample input parameters for the version.
196
+ */
135
197
  input?: unknown;
198
+ /**
199
+ * Sample output produced by the version.
200
+ */
136
201
  output?: unknown;
137
202
  }
138
203
  }
139
204
  }
140
- export interface AgentGetResponse {
141
- display_name: string;
142
- is_public: boolean;
143
- name: string;
144
- description?: string | null;
145
- domain?: string | null;
146
- entity_type?: string | null;
147
- feature_flags?: AgentGetResponse.FeatureFlags;
148
- input_properties?: Array<AgentGetResponse.InputProperty> | null;
149
- managed_by?: string | null;
150
- output_schema?: {
151
- [key: string]: unknown;
152
- } | null;
153
- vertical?: string | null;
205
+ export interface TemplateListResponse {
206
+ /**
207
+ * Items returned in this page.
208
+ */
209
+ items: Array<TemplateListResponse.Item>;
210
+ /**
211
+ * Maximum number of items returned.
212
+ */
213
+ limit: number;
214
+ /**
215
+ * Number of items skipped before this page.
216
+ */
217
+ offset: number;
218
+ /**
219
+ * Total number of items matching the query.
220
+ */
221
+ total: number;
154
222
  }
155
- export declare namespace AgentGetResponse {
156
- interface FeatureFlags {
157
- is_localization_supported?: boolean;
158
- is_pagination_supported?: boolean;
223
+ export declare namespace TemplateListResponse {
224
+ interface Item {
225
+ /**
226
+ * Unique extract template identifier.
227
+ */
228
+ id: string;
229
+ /**
230
+ * When the extract template was created.
231
+ */
232
+ created_at: string;
233
+ /**
234
+ * Stable extract template name.
235
+ */
236
+ name: string;
237
+ /**
238
+ * When the extract template was last updated.
239
+ */
240
+ updated_at: string;
241
+ /**
242
+ * Published version details, when available.
243
+ */
244
+ published_version?: Item.PublishedVersion | null;
245
+ /**
246
+ * Identifier of the published version.
247
+ */
248
+ published_version_id?: string | null;
159
249
  }
160
- interface InputProperty {
161
- default?: string | boolean | number | null;
162
- description?: string | null;
163
- examples?: Array<unknown> | null;
164
- is_localization_param?: boolean;
165
- is_pagination_param?: boolean;
166
- name?: string;
167
- required?: boolean;
168
- rules?: Array<string> | null;
169
- type?: string;
250
+ namespace Item {
251
+ /**
252
+ * Published version details, when available.
253
+ */
254
+ interface PublishedVersion {
255
+ /**
256
+ * Unique extract template version identifier.
257
+ */
258
+ id: string;
259
+ /**
260
+ * When the version was created.
261
+ */
262
+ created_at: string;
263
+ /**
264
+ * JSON schema describing accepted input parameters.
265
+ */
266
+ input_schema: {
267
+ [key: string]: unknown;
268
+ };
269
+ /**
270
+ * Metadata associated with this version.
271
+ */
272
+ metadata: PublishedVersion.Metadata;
273
+ /**
274
+ * Extract template name this version belongs to.
275
+ */
276
+ name: string;
277
+ /**
278
+ * JSON schema describing extracted output.
279
+ */
280
+ output_schema: {
281
+ [key: string]: unknown;
282
+ };
283
+ /**
284
+ * Monotonic version number for the extract template.
285
+ */
286
+ version_number: number;
287
+ /**
288
+ * Sample input and output pairs for the version.
289
+ */
290
+ samples?: Array<PublishedVersion.Sample> | null;
291
+ }
292
+ namespace PublishedVersion {
293
+ /**
294
+ * Metadata associated with this version.
295
+ */
296
+ interface Metadata {
297
+ /**
298
+ * Data source associated with the version.
299
+ */
300
+ data_source?: string | null;
301
+ /**
302
+ * Version description shown to users.
303
+ */
304
+ description?: string | null;
305
+ /**
306
+ * Human-friendly version display name.
307
+ */
308
+ display_name?: string | null;
309
+ /**
310
+ * Domain associated with the version.
311
+ */
312
+ domain?: string | null;
313
+ /**
314
+ * Entity type produced by the version.
315
+ */
316
+ entity_type?: string | null;
317
+ /**
318
+ * Tags associated with the version.
319
+ */
320
+ tags?: Array<string>;
321
+ /**
322
+ * Business vertical associated with the version.
323
+ */
324
+ vertical?: string | null;
325
+ }
326
+ interface Sample {
327
+ /**
328
+ * Sample input parameters for the version.
329
+ */
330
+ input?: unknown;
331
+ /**
332
+ * Sample output produced by the version.
333
+ */
334
+ output?: unknown;
335
+ }
336
+ }
170
337
  }
171
338
  }
172
- export interface AgentGetGenerationResponse {
339
+ export interface TemplateAsyncResponse {
340
+ status: 'success';
341
+ task: {
342
+ [key: string]: unknown;
343
+ };
344
+ }
345
+ /**
346
+ * Response when a batch of extract tasks is created successfully.
347
+ */
348
+ export interface TemplateBatchResponse {
349
+ /**
350
+ * Unique identifier for the batch.
351
+ */
352
+ batch_id: string;
353
+ /**
354
+ * Number of tasks in the batch.
355
+ */
356
+ batch_size: number;
357
+ /**
358
+ * List of created tasks.
359
+ */
360
+ tasks: Array<TemplateBatchResponse.Task>;
361
+ }
362
+ export declare namespace TemplateBatchResponse {
363
+ interface Task {
364
+ /**
365
+ * Unique task identifier.
366
+ */
367
+ id: string;
368
+ _query: unknown;
369
+ /**
370
+ * Timestamp when the task was created.
371
+ */
372
+ created_at: string;
373
+ /**
374
+ * Original input data for the task.
375
+ */
376
+ input: unknown;
377
+ /**
378
+ * Current state of the task.
379
+ */
380
+ state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
381
+ /**
382
+ * URL for checking the task status.
383
+ */
384
+ status_url: string;
385
+ /**
386
+ * Account name that owns the task.
387
+ */
388
+ account_name?: string;
389
+ api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
390
+ /**
391
+ * Batch ID if this task is part of a batch.
392
+ */
393
+ batch_id?: string | null;
394
+ /**
395
+ * URL for downloading the task results.
396
+ */
397
+ download_url?: string | null;
398
+ /**
399
+ * Error message if the task failed.
400
+ */
401
+ error?: string | null;
402
+ /**
403
+ * Classification of the error type.
404
+ */
405
+ error_type?: string | null;
406
+ /**
407
+ * Timestamp when the task was last modified.
408
+ */
409
+ modified_at?: string;
410
+ /**
411
+ * Storage location of the output data.
412
+ */
413
+ output_url?: string | null;
414
+ /**
415
+ * Queue name the task was submitted to.
416
+ */
417
+ queue?: string;
418
+ /**
419
+ * HTTP status code from the task execution.
420
+ */
421
+ status_code?: number;
422
+ }
423
+ }
424
+ export interface TemplateGetResponse {
425
+ /**
426
+ * Unique extract template identifier.
427
+ */
173
428
  id: string;
174
- status: string;
175
- agent_name?: string | null;
176
- completed_at?: string | null;
177
- created_at?: string | null;
178
- error?: string | null;
179
- generated_version?: AgentGetGenerationResponse.GeneratedVersion | null;
180
- generated_version_id?: string | null;
181
- source_version_id?: string | null;
182
- started_at?: string | null;
183
- summary?: string | null;
429
+ /**
430
+ * When the extract template was created.
431
+ */
432
+ created_at: string;
433
+ /**
434
+ * Stable extract template name.
435
+ */
436
+ name: string;
437
+ /**
438
+ * When the extract template was last updated.
439
+ */
440
+ updated_at: string;
441
+ /**
442
+ * Published version details, when available.
443
+ */
444
+ published_version?: TemplateGetResponse.PublishedVersion | null;
445
+ /**
446
+ * Identifier of the published version.
447
+ */
448
+ published_version_id?: string | null;
184
449
  }
185
- export declare namespace AgentGetGenerationResponse {
186
- interface GeneratedVersion {
450
+ export declare namespace TemplateGetResponse {
451
+ /**
452
+ * Published version details, when available.
453
+ */
454
+ interface PublishedVersion {
455
+ /**
456
+ * Unique extract template version identifier.
457
+ */
187
458
  id: string;
188
- agent_name: string;
459
+ /**
460
+ * When the version was created.
461
+ */
189
462
  created_at: string;
463
+ /**
464
+ * JSON schema describing accepted input parameters.
465
+ */
190
466
  input_schema: {
191
467
  [key: string]: unknown;
192
468
  };
193
- metadata: GeneratedVersion.Metadata;
469
+ /**
470
+ * Metadata associated with this version.
471
+ */
472
+ metadata: PublishedVersion.Metadata;
473
+ /**
474
+ * Extract template name this version belongs to.
475
+ */
476
+ name: string;
477
+ /**
478
+ * JSON schema describing extracted output.
479
+ */
194
480
  output_schema: {
195
481
  [key: string]: unknown;
196
482
  };
483
+ /**
484
+ * Monotonic version number for the extract template.
485
+ */
197
486
  version_number: number;
198
- samples?: Array<GeneratedVersion.Sample> | null;
487
+ /**
488
+ * Sample input and output pairs for the version.
489
+ */
490
+ samples?: Array<PublishedVersion.Sample> | null;
199
491
  }
200
- namespace GeneratedVersion {
492
+ namespace PublishedVersion {
493
+ /**
494
+ * Metadata associated with this version.
495
+ */
201
496
  interface Metadata {
497
+ /**
498
+ * Data source associated with the version.
499
+ */
202
500
  data_source?: string | null;
501
+ /**
502
+ * Version description shown to users.
503
+ */
203
504
  description?: string | null;
505
+ /**
506
+ * Human-friendly version display name.
507
+ */
204
508
  display_name?: string | null;
509
+ /**
510
+ * Domain associated with the version.
511
+ */
205
512
  domain?: string | null;
513
+ /**
514
+ * Entity type produced by the version.
515
+ */
206
516
  entity_type?: string | null;
517
+ /**
518
+ * Tags associated with the version.
519
+ */
207
520
  tags?: Array<string>;
521
+ /**
522
+ * Business vertical associated with the version.
523
+ */
208
524
  vertical?: string | null;
209
525
  }
210
526
  interface Sample {
527
+ /**
528
+ * Sample input parameters for the version.
529
+ */
211
530
  input?: unknown;
531
+ /**
532
+ * Sample output produced by the version.
533
+ */
212
534
  output?: unknown;
213
535
  }
214
536
  }
215
537
  }
216
- export interface AgentRunResponse {
217
- data: AgentRunResponse.Data;
218
- metadata: AgentRunResponse.Metadata;
538
+ export interface TemplateRunResponse {
539
+ data: TemplateRunResponse.Data;
540
+ metadata: TemplateRunResponse.Metadata;
219
541
  /**
220
542
  * The status of the task.
221
543
  */
@@ -228,11 +550,11 @@ export interface AgentRunResponse {
228
550
  * The final URL.
229
551
  */
230
552
  url: string;
231
- debug?: AgentRunResponse.Debug;
553
+ debug?: TemplateRunResponse.Debug;
232
554
  /**
233
555
  * Pagination information if applicable.
234
556
  */
235
- pagination?: AgentRunResponse.NextPageParams | Array<AgentRunResponse.UnionMember1>;
557
+ pagination?: TemplateRunResponse.NextPageParams | Array<TemplateRunResponse.UnionMember1>;
236
558
  /**
237
559
  * The HTTP status code of the task.
238
560
  */
@@ -242,7 +564,7 @@ export interface AgentRunResponse {
242
564
  */
243
565
  warnings?: Array<string>;
244
566
  }
245
- export declare namespace AgentRunResponse {
567
+ export declare namespace TemplateRunResponse {
246
568
  interface Data {
247
569
  /**
248
570
  * Browser actions execution results. Present only when browser_actions were
@@ -450,155 +772,32 @@ export declare namespace AgentRunResponse {
450
772
  };
451
773
  }
452
774
  }
453
- export interface AgentRunAsyncResponse {
454
- status: 'success';
455
- task: {
456
- [key: string]: unknown;
457
- };
458
- }
459
- /**
460
- * Response when a batch of extract tasks is created successfully.
461
- */
462
- export interface AgentRunBatchResponse {
463
- /**
464
- * Unique identifier for the batch.
465
- */
466
- batch_id: string;
775
+ export interface TemplateUpdateParams {
467
776
  /**
468
- * Number of tasks in the batch.
777
+ * A JSON Patch document per RFC 6902 — a JSON array of patch operations.
469
778
  */
470
- batch_size: number;
779
+ body: Array<TemplateUpdateParams.Body>;
780
+ }
781
+ export declare namespace TemplateUpdateParams {
471
782
  /**
472
- * List of created tasks.
783
+ * A single JSON Patch operation per RFC 6902.
473
784
  */
474
- tasks: Array<AgentRunBatchResponse.Task>;
475
- }
476
- export declare namespace AgentRunBatchResponse {
477
- interface Task {
478
- /**
479
- * Unique task identifier.
480
- */
481
- id: string;
482
- _query: unknown;
483
- /**
484
- * Timestamp when the task was created.
485
- */
486
- created_at: string;
487
- /**
488
- * Original input data for the task.
489
- */
490
- input: unknown;
491
- /**
492
- * Current state of the task.
493
- */
494
- state: 'pending' | 'queued' | 'in_progress' | 'success' | 'error';
495
- /**
496
- * URL for checking the task status.
497
- */
498
- status_url: string;
499
- /**
500
- * Account name that owns the task.
501
- */
502
- account_name?: string;
503
- api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp' | 'labs';
504
- /**
505
- * Batch ID if this task is part of a batch.
506
- */
507
- batch_id?: string | null;
508
- /**
509
- * URL for downloading the task results.
510
- */
511
- download_url?: string | null;
512
- /**
513
- * Error message if the task failed.
514
- */
515
- error?: string | null;
516
- /**
517
- * Classification of the error type.
518
- */
519
- error_type?: string | null;
520
- /**
521
- * Timestamp when the task was last modified.
522
- */
523
- modified_at?: string;
524
- /**
525
- * Storage location of the output data.
526
- */
527
- output_url?: string | null;
528
- /**
529
- * Queue name the task was submitted to.
530
- */
531
- queue?: string;
532
- /**
533
- * HTTP status code from the task execution.
534
- */
535
- status_code?: number;
785
+ interface Body {
786
+ op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
787
+ path: string;
788
+ from?: string | null;
789
+ value?: unknown;
536
790
  }
537
791
  }
538
- export interface AgentListParams {
539
- /**
540
- * Number of results per page
541
- */
792
+ export interface TemplateListParams {
542
793
  limit?: number;
543
- /**
544
- * Filter templates by attribution
545
- */
546
- managed_by?: 'nimble' | 'community' | 'self_managed' | null;
547
- /**
548
- * Pagination offset
549
- */
550
794
  offset?: number;
551
- /**
552
- * Filter by privacy level
553
- */
554
- privacy?: 'public' | 'private' | 'all' | null;
555
- /**
556
- * Search templates by name, domain, or vertical
557
- */
558
- search?: string | null;
559
795
  }
560
- export type AgentGenerateParams = AgentGenerateParams.CrustCreateAgentGenerationRequest | AgentGenerateParams.CrustCreateAgentRefinementRequest;
561
- export declare namespace AgentGenerateParams {
562
- interface CrustCreateAgentGenerationRequest {
563
- prompt: string;
564
- url: string;
565
- input_schema?: {
566
- [key: string]: unknown;
567
- };
568
- metadata?: CrustCreateAgentGenerationRequest.Metadata | null;
569
- name?: string | null;
570
- output_schema?: {
571
- [key: string]: unknown;
572
- };
573
- }
574
- namespace CrustCreateAgentGenerationRequest {
575
- interface Metadata {
576
- description?: string | null;
577
- display_name?: string | null;
578
- tags?: Array<string>;
579
- }
580
- }
581
- interface CrustCreateAgentRefinementRequest {
582
- from_agent: string;
583
- prompt: string;
584
- }
585
- }
586
- export interface AgentRunParams {
587
- agent: string;
588
- params: {
589
- [key: string]: unknown;
590
- };
591
- /**
592
- * Response formats to include. All disabled by default.
593
- */
594
- formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
595
- localization?: boolean;
596
- }
597
- export interface AgentRunAsyncParams {
598
- agent: string;
796
+ export interface TemplateAsyncParams {
599
797
  params: {
600
798
  [key: string]: unknown;
601
799
  };
800
+ template: string;
602
801
  /**
603
802
  * URL to call back when async operation completes
604
803
  */
@@ -625,11 +824,11 @@ export interface AgentRunAsyncParams {
625
824
  */
626
825
  storage_url?: string;
627
826
  }
628
- export interface AgentRunBatchParams {
629
- inputs: Array<AgentRunBatchParams.Input>;
630
- shared_inputs: AgentRunBatchParams.SharedInputs;
827
+ export interface TemplateBatchParams {
828
+ inputs: Array<TemplateBatchParams.Input>;
829
+ shared_inputs: TemplateBatchParams.SharedInputs;
631
830
  }
632
- export declare namespace AgentRunBatchParams {
831
+ export declare namespace TemplateBatchParams {
633
832
  interface Input {
634
833
  /**
635
834
  * Response formats to include. All disabled by default.
@@ -641,7 +840,7 @@ export declare namespace AgentRunBatchParams {
641
840
  };
642
841
  }
643
842
  interface SharedInputs {
644
- agent: string;
843
+ template: string;
645
844
  /**
646
845
  * Response formats to include. All disabled by default.
647
846
  */
@@ -652,7 +851,20 @@ export declare namespace AgentRunBatchParams {
652
851
  };
653
852
  }
654
853
  }
655
- export declare namespace Agent {
656
- export { type AgentListResponse as AgentListResponse, type AgentGenerateResponse as AgentGenerateResponse, type AgentGetResponse as AgentGetResponse, type AgentGetGenerationResponse as AgentGetGenerationResponse, type AgentRunResponse as AgentRunResponse, type AgentRunAsyncResponse as AgentRunAsyncResponse, type AgentRunBatchResponse as AgentRunBatchResponse, type AgentListParams as AgentListParams, type AgentGenerateParams as AgentGenerateParams, type AgentRunParams as AgentRunParams, type AgentRunAsyncParams as AgentRunAsyncParams, type AgentRunBatchParams as AgentRunBatchParams, };
854
+ export interface TemplateRunParams {
855
+ params: {
856
+ [key: string]: unknown;
857
+ };
858
+ template: string;
859
+ /**
860
+ * Response formats to include. All disabled by default.
861
+ */
862
+ formats?: Array<'html' | 'markdown' | 'screenshot' | 'headers' | 'links'>;
863
+ localization?: boolean;
864
+ }
865
+ export declare namespace Templates {
866
+ export { type TemplateUpdateResponse as TemplateUpdateResponse, type TemplateListResponse as TemplateListResponse, type TemplateAsyncResponse as TemplateAsyncResponse, type TemplateBatchResponse as TemplateBatchResponse, type TemplateGetResponse as TemplateGetResponse, type TemplateRunResponse as TemplateRunResponse, type TemplateUpdateParams as TemplateUpdateParams, type TemplateListParams as TemplateListParams, type TemplateAsyncParams as TemplateAsyncParams, type TemplateBatchParams as TemplateBatchParams, type TemplateRunParams as TemplateRunParams, };
867
+ export { Generations as Generations, type GenerationCreateResponse as GenerationCreateResponse, type GenerationGetResponse as GenerationGetResponse, type GenerationCreateParams as GenerationCreateParams, };
868
+ export { Versions as Versions, type VersionListResponse as VersionListResponse, type VersionGetResponse as VersionGetResponse, type VersionListParams as VersionListParams, type VersionGetParams as VersionGetParams, };
657
869
  }
658
- //# sourceMappingURL=agent.d.mts.map
870
+ //# sourceMappingURL=templates.d.ts.map