@arcadeai/arcadejs 0.2.1 → 0.2.2

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 (52) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/index.d.mts +2 -3
  4. package/index.d.ts +2 -3
  5. package/index.d.ts.map +1 -1
  6. package/index.js +1 -0
  7. package/index.js.map +1 -1
  8. package/index.mjs +2 -1
  9. package/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.ts +1 -1
  12. package/resources/index.d.ts.map +1 -1
  13. package/resources/index.js +2 -1
  14. package/resources/index.js.map +1 -1
  15. package/resources/index.mjs +1 -1
  16. package/resources/index.mjs.map +1 -1
  17. package/resources/shared.d.ts +0 -12
  18. package/resources/shared.d.ts.map +1 -1
  19. package/resources/shared.js +0 -5
  20. package/resources/shared.js.map +1 -1
  21. package/resources/shared.mjs +1 -3
  22. package/resources/shared.mjs.map +1 -1
  23. package/resources/tools/formatted.d.ts +2 -2
  24. package/resources/tools/index.d.ts +2 -1
  25. package/resources/tools/index.d.ts.map +1 -1
  26. package/resources/tools/index.js +4 -1
  27. package/resources/tools/index.js.map +1 -1
  28. package/resources/tools/index.mjs +2 -1
  29. package/resources/tools/index.mjs.map +1 -1
  30. package/resources/tools/scheduled.d.ts +57 -0
  31. package/resources/tools/scheduled.d.ts.map +1 -0
  32. package/resources/tools/scheduled.js +21 -0
  33. package/resources/tools/scheduled.js.map +1 -0
  34. package/resources/tools/scheduled.mjs +17 -0
  35. package/resources/tools/scheduled.mjs.map +1 -0
  36. package/resources/tools/tools.d.ts +225 -49
  37. package/resources/tools/tools.d.ts.map +1 -1
  38. package/resources/tools/tools.js +11 -4
  39. package/resources/tools/tools.js.map +1 -1
  40. package/resources/tools/tools.mjs +9 -3
  41. package/resources/tools/tools.mjs.map +1 -1
  42. package/src/index.ts +13 -15
  43. package/src/resources/index.ts +6 -7
  44. package/src/resources/shared.ts +0 -19
  45. package/src/resources/tools/formatted.ts +2 -2
  46. package/src/resources/tools/index.ts +7 -7
  47. package/src/resources/tools/scheduled.ts +92 -0
  48. package/src/resources/tools/tools.ts +321 -66
  49. package/src/version.ts +1 -1
  50. package/version.d.ts +1 -1
  51. package/version.js +1 -1
  52. package/version.mjs +1 -1
@@ -0,0 +1,92 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as ToolsAPI from './tools';
6
+
7
+ export class Scheduled extends APIResource {
8
+ /**
9
+ * Returns a page of scheduled tool executions
10
+ */
11
+ list(options?: Core.RequestOptions): Core.APIPromise<ScheduledListResponse> {
12
+ return this._client.get('/v1/tools/scheduled', options);
13
+ }
14
+
15
+ /**
16
+ * Returns the details for a specific scheduled tool execution
17
+ */
18
+ details(id: string, options?: Core.RequestOptions): Core.APIPromise<ScheduledDetailsResponse> {
19
+ return this._client.get(`/v1/tools/scheduled/${id}`, options);
20
+ }
21
+ }
22
+
23
+ export interface ScheduledListResponse {
24
+ items?: Array<ToolsAPI.ToolExecution>;
25
+
26
+ limit?: number;
27
+
28
+ offset?: number;
29
+
30
+ page_count?: number;
31
+
32
+ total_count?: number;
33
+ }
34
+
35
+ export interface ScheduledDetailsResponse {
36
+ id?: string;
37
+
38
+ attempts?: Array<ToolsAPI.ToolExecutionAttempt>;
39
+
40
+ created_at?: ScheduledDetailsResponse.CreatedAt;
41
+
42
+ execution_status?: string;
43
+
44
+ execution_type?: string;
45
+
46
+ finished_at?: ScheduledDetailsResponse.FinishedAt;
47
+
48
+ inputs?: Record<string, unknown>;
49
+
50
+ run_at?: ScheduledDetailsResponse.RunAt;
51
+
52
+ started_at?: ScheduledDetailsResponse.StartedAt;
53
+
54
+ tool_name?: string;
55
+
56
+ toolkit_name?: string;
57
+
58
+ toolkit_version?: string;
59
+
60
+ updated_at?: ScheduledDetailsResponse.UpdatedAt;
61
+
62
+ user_id?: string;
63
+ }
64
+
65
+ export namespace ScheduledDetailsResponse {
66
+ export interface CreatedAt {
67
+ 'time.Time'?: string;
68
+ }
69
+
70
+ export interface FinishedAt {
71
+ 'time.Time'?: string;
72
+ }
73
+
74
+ export interface RunAt {
75
+ 'time.Time'?: string;
76
+ }
77
+
78
+ export interface StartedAt {
79
+ 'time.Time'?: string;
80
+ }
81
+
82
+ export interface UpdatedAt {
83
+ 'time.Time'?: string;
84
+ }
85
+ }
86
+
87
+ export declare namespace Scheduled {
88
+ export {
89
+ type ScheduledListResponse as ScheduledListResponse,
90
+ type ScheduledDetailsResponse as ScheduledDetailsResponse,
91
+ };
92
+ }
@@ -4,7 +4,6 @@ import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
6
  import * as Shared from '../shared';
7
- import { ToolDefinitionsOffsetPage } from '../shared';
8
7
  import * as FormattedAPI from './formatted';
9
8
  import {
10
9
  Formatted,
@@ -14,27 +13,31 @@ import {
14
13
  FormattedListResponse,
15
14
  FormattedListResponsesOffsetPage,
16
15
  } from './formatted';
17
- import { type OffsetPageParams } from '../../pagination';
16
+ import * as ScheduledAPI from './scheduled';
17
+ import { Scheduled, ScheduledDetailsResponse, ScheduledListResponse } from './scheduled';
18
+ import { OffsetPage, type OffsetPageParams } from '../../pagination';
18
19
 
19
20
  export class Tools extends APIResource {
21
+ scheduled: ScheduledAPI.Scheduled = new ScheduledAPI.Scheduled(this._client);
20
22
  formatted: FormattedAPI.Formatted = new FormattedAPI.Formatted(this._client);
21
23
 
22
24
  /**
23
- * Returns a page of tools, optionally filtered by toolkit
25
+ * Returns a page of tools from the engine configuration, optionally filtered by
26
+ * toolkit
24
27
  */
25
28
  list(
26
29
  query?: ToolListParams,
27
30
  options?: Core.RequestOptions,
28
- ): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
29
- list(options?: Core.RequestOptions): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
31
+ ): Core.PagePromise<ToolListResponsesOffsetPage, ToolListResponse>;
32
+ list(options?: Core.RequestOptions): Core.PagePromise<ToolListResponsesOffsetPage, ToolListResponse>;
30
33
  list(
31
34
  query: ToolListParams | Core.RequestOptions = {},
32
35
  options?: Core.RequestOptions,
33
- ): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition> {
36
+ ): Core.PagePromise<ToolListResponsesOffsetPage, ToolListResponse> {
34
37
  if (isRequestOptions(query)) {
35
38
  return this.list({}, query);
36
39
  }
37
- return this._client.getAPIList('/v1/tools/list', ToolDefinitionsOffsetPage, { query, ...options });
40
+ return this._client.getAPIList('/v1/tools/list', ToolListResponsesOffsetPage, { query, ...options });
38
41
  }
39
42
 
40
43
  /**
@@ -50,18 +53,20 @@ export class Tools extends APIResource {
50
53
  /**
51
54
  * Executes a tool by name and arguments
52
55
  */
53
- execute(body: ToolExecuteParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
56
+ execute(body: ToolExecuteParams, options?: Core.RequestOptions): Core.APIPromise<ExecuteToolResponse> {
54
57
  return this._client.post('/v1/tools/execute', { body, ...options });
55
58
  }
56
59
 
57
60
  /**
58
61
  * Returns the arcade tool specification for a specific tool
59
62
  */
60
- get(query: ToolGetParams, options?: Core.RequestOptions): Core.APIPromise<Shared.ToolDefinition> {
63
+ get(query: ToolGetParams, options?: Core.RequestOptions): Core.APIPromise<ToolGetResponse> {
61
64
  return this._client.get('/v1/tools/definition', { query, ...options });
62
65
  }
63
66
  }
64
67
 
68
+ export class ToolListResponsesOffsetPage extends OffsetPage<ToolListResponse> {}
69
+
65
70
  export interface AuthorizeToolRequest {
66
71
  tool_name: string;
67
72
 
@@ -82,111 +87,340 @@ export interface ExecuteToolRequest {
82
87
  inputs?: unknown;
83
88
 
84
89
  /**
85
- * Optional: if not provided, any version is used
90
+ * The time at which the tool should be run (optional). If not provided, the tool
91
+ * is run immediately
92
+ */
93
+ run_at?: ExecuteToolRequest.RunAt;
94
+
95
+ /**
96
+ * The tool version to use (optional). If not provided, any version is used
86
97
  */
87
98
  tool_version?: string;
88
99
 
89
100
  user_id?: string;
90
101
  }
91
102
 
92
- export interface Inputs {
93
- parameters?: Array<Parameter>;
103
+ export namespace ExecuteToolRequest {
104
+ /**
105
+ * The time at which the tool should be run (optional). If not provided, the tool
106
+ * is run immediately
107
+ */
108
+ export interface RunAt {
109
+ 'time.Time'?: string;
110
+ }
94
111
  }
95
112
 
96
- export interface Output {
97
- available_modes?: Array<string>;
113
+ export interface ExecuteToolResponse {
114
+ id?: string;
98
115
 
99
- description?: string;
116
+ duration?: number;
100
117
 
101
- value_schema?: ValueSchema;
118
+ execution_type?: string;
119
+
120
+ finished_at?: ExecuteToolResponse.FinishedAt;
121
+
122
+ invocation_id?: string;
123
+
124
+ output?: ResponseOutput;
125
+
126
+ run_at?: ExecuteToolResponse.RunAt;
127
+
128
+ status?: string;
129
+
130
+ /**
131
+ * Whether the request was successful. For immediately-executed requests, this will
132
+ * be true if the tool call succeeded. For scheduled requests, this will be true if
133
+ * the request was scheduled successfully.
134
+ */
135
+ success?: boolean;
102
136
  }
103
137
 
104
- export interface Parameter {
105
- name: string;
138
+ export namespace ExecuteToolResponse {
139
+ export interface FinishedAt {
140
+ 'time.Time'?: string;
141
+ }
106
142
 
107
- value_schema: ValueSchema;
143
+ export interface RunAt {
144
+ 'time.Time'?: string;
145
+ }
146
+ }
108
147
 
109
- description?: string;
148
+ export interface ResponseOutput {
149
+ error?: ResponseOutput.Error;
110
150
 
111
- inferrable?: boolean;
151
+ requires_authorization?: Shared.AuthorizationResponse;
112
152
 
113
- required?: boolean;
153
+ value?: unknown;
114
154
  }
115
155
 
116
- export interface Requirements {
117
- authorization?: Requirements.Authorization;
156
+ export namespace ResponseOutput {
157
+ export interface Error {
158
+ message: string;
159
+
160
+ additional_prompt_content?: string;
161
+
162
+ can_retry?: boolean;
163
+
164
+ developer_message?: string;
165
+
166
+ retry_after_ms?: number;
167
+ }
118
168
  }
119
169
 
120
- export namespace Requirements {
121
- export interface Authorization {
122
- oauth2?: Authorization.Oauth2;
170
+ export interface ToolExecution {
171
+ id?: string;
172
+
173
+ created_at?: ToolExecution.CreatedAt;
174
+
175
+ execution_status?: string;
176
+
177
+ execution_type?: string;
178
+
179
+ finished_at?: ToolExecution.FinishedAt;
180
+
181
+ run_at?: ToolExecution.RunAt;
182
+
183
+ started_at?: ToolExecution.StartedAt;
184
+
185
+ tool_name?: string;
186
+
187
+ toolkit_name?: string;
188
+
189
+ toolkit_version?: string;
190
+
191
+ updated_at?: ToolExecution.UpdatedAt;
123
192
 
124
- provider_id?: string;
193
+ user_id?: string;
194
+ }
125
195
 
126
- provider_type?: string;
196
+ export namespace ToolExecution {
197
+ export interface CreatedAt {
198
+ 'time.Time'?: string;
127
199
  }
128
200
 
129
- export namespace Authorization {
130
- export interface Oauth2 {
131
- scopes?: Array<string>;
132
- }
201
+ export interface FinishedAt {
202
+ 'time.Time'?: string;
133
203
  }
134
- }
135
204
 
136
- export interface Response {
137
- invocation_id: string;
205
+ export interface RunAt {
206
+ 'time.Time'?: string;
207
+ }
138
208
 
139
- duration?: number;
209
+ export interface StartedAt {
210
+ 'time.Time'?: string;
211
+ }
212
+
213
+ export interface UpdatedAt {
214
+ 'time.Time'?: string;
215
+ }
216
+ }
217
+
218
+ export interface ToolExecutionAttempt {
219
+ id?: string;
140
220
 
141
- finished_at?: Response.FinishedAt;
221
+ finished_at?: ToolExecutionAttempt.FinishedAt;
142
222
 
143
223
  output?: ResponseOutput;
144
224
 
225
+ started_at?: ToolExecutionAttempt.StartedAt;
226
+
145
227
  success?: boolean;
228
+
229
+ system_error_message?: string;
146
230
  }
147
231
 
148
- export namespace Response {
232
+ export namespace ToolExecutionAttempt {
149
233
  export interface FinishedAt {
150
234
  'time.Time'?: string;
151
235
  }
236
+
237
+ export interface StartedAt {
238
+ 'time.Time'?: string;
239
+ }
152
240
  }
153
241
 
154
- export interface ResponseOutput {
155
- error?: ResponseOutput.Error;
242
+ export interface ToolListResponse {
243
+ inputs: ToolListResponse.Inputs;
156
244
 
157
- requires_authorization?: Shared.AuthorizationResponse;
245
+ name: string;
158
246
 
159
- value?: unknown;
247
+ toolkit: ToolListResponse.Toolkit;
248
+
249
+ description?: string;
250
+
251
+ fully_qualified_name?: string;
252
+
253
+ output?: ToolListResponse.Output;
254
+
255
+ requirements?: ToolListResponse.Requirements;
160
256
  }
161
257
 
162
- export namespace ResponseOutput {
163
- export interface Error {
164
- message: string;
258
+ export namespace ToolListResponse {
259
+ export interface Inputs {
260
+ parameters?: Array<Inputs.Parameter>;
261
+ }
165
262
 
166
- additional_prompt_content?: string;
263
+ export namespace Inputs {
264
+ export interface Parameter {
265
+ name: string;
167
266
 
168
- can_retry?: boolean;
267
+ value_schema: Parameter.ValueSchema;
169
268
 
170
- developer_message?: string;
269
+ description?: string;
171
270
 
172
- retry_after_ms?: number;
271
+ inferrable?: boolean;
272
+
273
+ required?: boolean;
274
+ }
275
+
276
+ export namespace Parameter {
277
+ export interface ValueSchema {
278
+ val_type: string;
279
+
280
+ enum?: Array<string>;
281
+
282
+ inner_val_type?: string;
283
+ }
284
+ }
285
+ }
286
+
287
+ export interface Toolkit {
288
+ name: string;
289
+
290
+ description?: string;
291
+
292
+ version?: string;
293
+ }
294
+
295
+ export interface Output {
296
+ available_modes?: Array<string>;
297
+
298
+ description?: string;
299
+
300
+ value_schema?: Output.ValueSchema;
301
+ }
302
+
303
+ export namespace Output {
304
+ export interface ValueSchema {
305
+ val_type: string;
306
+
307
+ enum?: Array<string>;
308
+
309
+ inner_val_type?: string;
310
+ }
311
+ }
312
+
313
+ export interface Requirements {
314
+ authorization?: Requirements.Authorization;
315
+ }
316
+
317
+ export namespace Requirements {
318
+ export interface Authorization {
319
+ oauth2?: Authorization.Oauth2;
320
+
321
+ provider_id?: string;
322
+
323
+ provider_type?: string;
324
+ }
325
+
326
+ export namespace Authorization {
327
+ export interface Oauth2 {
328
+ scopes?: Array<string>;
329
+ }
330
+ }
173
331
  }
174
332
  }
175
333
 
176
- export interface ToolkitDefinition {
334
+ export interface ToolGetResponse {
335
+ inputs: ToolGetResponse.Inputs;
336
+
177
337
  name: string;
178
338
 
339
+ toolkit: ToolGetResponse.Toolkit;
340
+
179
341
  description?: string;
180
342
 
181
- version?: string;
343
+ fully_qualified_name?: string;
344
+
345
+ output?: ToolGetResponse.Output;
346
+
347
+ requirements?: ToolGetResponse.Requirements;
182
348
  }
183
349
 
184
- export interface ValueSchema {
185
- val_type: string;
350
+ export namespace ToolGetResponse {
351
+ export interface Inputs {
352
+ parameters?: Array<Inputs.Parameter>;
353
+ }
354
+
355
+ export namespace Inputs {
356
+ export interface Parameter {
357
+ name: string;
358
+
359
+ value_schema: Parameter.ValueSchema;
186
360
 
187
- enum?: Array<string>;
361
+ description?: string;
188
362
 
189
- inner_val_type?: string;
363
+ inferrable?: boolean;
364
+
365
+ required?: boolean;
366
+ }
367
+
368
+ export namespace Parameter {
369
+ export interface ValueSchema {
370
+ val_type: string;
371
+
372
+ enum?: Array<string>;
373
+
374
+ inner_val_type?: string;
375
+ }
376
+ }
377
+ }
378
+
379
+ export interface Toolkit {
380
+ name: string;
381
+
382
+ description?: string;
383
+
384
+ version?: string;
385
+ }
386
+
387
+ export interface Output {
388
+ available_modes?: Array<string>;
389
+
390
+ description?: string;
391
+
392
+ value_schema?: Output.ValueSchema;
393
+ }
394
+
395
+ export namespace Output {
396
+ export interface ValueSchema {
397
+ val_type: string;
398
+
399
+ enum?: Array<string>;
400
+
401
+ inner_val_type?: string;
402
+ }
403
+ }
404
+
405
+ export interface Requirements {
406
+ authorization?: Requirements.Authorization;
407
+ }
408
+
409
+ export namespace Requirements {
410
+ export interface Authorization {
411
+ oauth2?: Authorization.Oauth2;
412
+
413
+ provider_id?: string;
414
+
415
+ provider_type?: string;
416
+ }
417
+
418
+ export namespace Authorization {
419
+ export interface Oauth2 {
420
+ scopes?: Array<string>;
421
+ }
422
+ }
423
+ }
190
424
  }
191
425
 
192
426
  export interface ToolListParams extends OffsetPageParams {
@@ -216,13 +450,29 @@ export interface ToolExecuteParams {
216
450
  inputs?: unknown;
217
451
 
218
452
  /**
219
- * Optional: if not provided, any version is used
453
+ * The time at which the tool should be run (optional). If not provided, the tool
454
+ * is run immediately
455
+ */
456
+ run_at?: ToolExecuteParams.RunAt;
457
+
458
+ /**
459
+ * The tool version to use (optional). If not provided, any version is used
220
460
  */
221
461
  tool_version?: string;
222
462
 
223
463
  user_id?: string;
224
464
  }
225
465
 
466
+ export namespace ToolExecuteParams {
467
+ /**
468
+ * The time at which the tool should be run (optional). If not provided, the tool
469
+ * is run immediately
470
+ */
471
+ export interface RunAt {
472
+ 'time.Time'?: string;
473
+ }
474
+ }
475
+
226
476
  export interface ToolGetParams {
227
477
  /**
228
478
  * Tool ID
@@ -230,6 +480,8 @@ export interface ToolGetParams {
230
480
  toolId: string;
231
481
  }
232
482
 
483
+ Tools.ToolListResponsesOffsetPage = ToolListResponsesOffsetPage;
484
+ Tools.Scheduled = Scheduled;
233
485
  Tools.Formatted = Formatted;
234
486
  Tools.FormattedListResponsesOffsetPage = FormattedListResponsesOffsetPage;
235
487
 
@@ -237,20 +489,25 @@ export declare namespace Tools {
237
489
  export {
238
490
  type AuthorizeToolRequest as AuthorizeToolRequest,
239
491
  type ExecuteToolRequest as ExecuteToolRequest,
240
- type Inputs as Inputs,
241
- type Output as Output,
242
- type Parameter as Parameter,
243
- type Requirements as Requirements,
244
- type Response as Response,
492
+ type ExecuteToolResponse as ExecuteToolResponse,
245
493
  type ResponseOutput as ResponseOutput,
246
- type ToolkitDefinition as ToolkitDefinition,
247
- type ValueSchema as ValueSchema,
494
+ type ToolExecution as ToolExecution,
495
+ type ToolExecutionAttempt as ToolExecutionAttempt,
496
+ type ToolListResponse as ToolListResponse,
497
+ type ToolGetResponse as ToolGetResponse,
498
+ ToolListResponsesOffsetPage as ToolListResponsesOffsetPage,
248
499
  type ToolListParams as ToolListParams,
249
500
  type ToolAuthorizeParams as ToolAuthorizeParams,
250
501
  type ToolExecuteParams as ToolExecuteParams,
251
502
  type ToolGetParams as ToolGetParams,
252
503
  };
253
504
 
505
+ export {
506
+ Scheduled as Scheduled,
507
+ type ScheduledListResponse as ScheduledListResponse,
508
+ type ScheduledDetailsResponse as ScheduledDetailsResponse,
509
+ };
510
+
254
511
  export {
255
512
  Formatted as Formatted,
256
513
  type FormattedListResponse as FormattedListResponse,
@@ -260,5 +517,3 @@ export declare namespace Tools {
260
517
  type FormattedGetParams as FormattedGetParams,
261
518
  };
262
519
  }
263
-
264
- export { ToolDefinitionsOffsetPage };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.1'; // x-release-please-version
1
+ export const VERSION = '0.2.2'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.1";
1
+ export declare const VERSION = "0.2.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.1'; // x-release-please-version
4
+ exports.VERSION = '0.2.2'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.1'; // x-release-please-version
1
+ export const VERSION = '0.2.2'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map