@arcadeai/arcadejs 0.2.2 → 1.0.0-rc.1

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 (75) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +2 -3
  3. package/core.d.ts.map +1 -1
  4. package/core.js +10 -1
  5. package/core.js.map +1 -1
  6. package/core.mjs +10 -1
  7. package/core.mjs.map +1 -1
  8. package/index.d.mts +9 -8
  9. package/index.d.ts +9 -8
  10. package/index.d.ts.map +1 -1
  11. package/index.js.map +1 -1
  12. package/index.mjs.map +1 -1
  13. package/package.json +1 -1
  14. package/resources/auth.d.ts +73 -9
  15. package/resources/auth.d.ts.map +1 -1
  16. package/resources/auth.js +81 -1
  17. package/resources/auth.js.map +1 -1
  18. package/resources/auth.mjs +79 -0
  19. package/resources/auth.mjs.map +1 -1
  20. package/resources/chat/chat.d.ts +5 -2
  21. package/resources/chat/chat.d.ts.map +1 -1
  22. package/resources/chat/chat.js.map +1 -1
  23. package/resources/chat/chat.mjs.map +1 -1
  24. package/resources/chat/completions.d.ts +4 -1
  25. package/resources/chat/completions.d.ts.map +1 -1
  26. package/resources/index.d.ts +1 -1
  27. package/resources/index.d.ts.map +1 -1
  28. package/resources/index.js +2 -1
  29. package/resources/index.js.map +1 -1
  30. package/resources/index.mjs +1 -1
  31. package/resources/index.mjs.map +1 -1
  32. package/resources/shared.d.ts +8 -10
  33. package/resources/shared.d.ts.map +1 -1
  34. package/resources/tools/formatted.d.ts +2 -5
  35. package/resources/tools/formatted.d.ts.map +1 -1
  36. package/resources/tools/formatted.js +6 -6
  37. package/resources/tools/formatted.js.map +1 -1
  38. package/resources/tools/formatted.mjs +6 -6
  39. package/resources/tools/formatted.mjs.map +1 -1
  40. package/resources/tools/index.d.ts +2 -2
  41. package/resources/tools/index.d.ts.map +1 -1
  42. package/resources/tools/index.js +2 -1
  43. package/resources/tools/index.js.map +1 -1
  44. package/resources/tools/index.mjs +1 -1
  45. package/resources/tools/index.mjs.map +1 -1
  46. package/resources/tools/scheduled.d.ts +15 -33
  47. package/resources/tools/scheduled.d.ts.map +1 -1
  48. package/resources/tools/scheduled.js +11 -8
  49. package/resources/tools/scheduled.js.map +1 -1
  50. package/resources/tools/scheduled.mjs +10 -7
  51. package/resources/tools/scheduled.mjs.map +1 -1
  52. package/resources/tools/tools.d.ts +75 -126
  53. package/resources/tools/tools.d.ts.map +1 -1
  54. package/resources/tools/tools.js +7 -4
  55. package/resources/tools/tools.js.map +1 -1
  56. package/resources/tools/tools.mjs +5 -3
  57. package/resources/tools/tools.mjs.map +1 -1
  58. package/src/core.ts +11 -1
  59. package/src/index.ts +9 -10
  60. package/src/resources/auth.ts +127 -8
  61. package/src/resources/chat/chat.ts +6 -2
  62. package/src/resources/chat/completions.ts +5 -1
  63. package/src/resources/index.ts +2 -2
  64. package/src/resources/shared.ts +10 -12
  65. package/src/resources/tools/formatted.ts +12 -8
  66. package/src/resources/tools/index.ts +3 -3
  67. package/src/resources/tools/scheduled.ts +30 -46
  68. package/src/resources/tools/tools.ts +93 -156
  69. package/src/version.ts +1 -1
  70. package/version.d.ts +1 -1
  71. package/version.d.ts.map +1 -1
  72. package/version.js +1 -1
  73. package/version.js.map +1 -1
  74. package/version.mjs +1 -1
  75. package/version.mjs.map +1 -1
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
+ import * as ToolsAPI from './tools';
6
7
  import * as Shared from '../shared';
7
8
  import * as FormattedAPI from './formatted';
8
9
  import {
@@ -14,7 +15,7 @@ import {
14
15
  FormattedListResponsesOffsetPage,
15
16
  } from './formatted';
16
17
  import * as ScheduledAPI from './scheduled';
17
- import { Scheduled, ScheduledDetailsResponse, ScheduledListResponse } from './scheduled';
18
+ import { Scheduled, ScheduledGetResponse, ScheduledListParams } from './scheduled';
18
19
  import { OffsetPage, type OffsetPageParams } from '../../pagination';
19
20
 
20
21
  export class Tools extends APIResource {
@@ -37,7 +38,7 @@ export class Tools extends APIResource {
37
38
  if (isRequestOptions(query)) {
38
39
  return this.list({}, query);
39
40
  }
40
- return this._client.getAPIList('/v1/tools/list', ToolListResponsesOffsetPage, { query, ...options });
41
+ return this._client.getAPIList('/v1/tools', ToolListResponsesOffsetPage, { query, ...options });
41
42
  }
42
43
 
43
44
  /**
@@ -46,7 +47,7 @@ export class Tools extends APIResource {
46
47
  authorize(
47
48
  body: ToolAuthorizeParams,
48
49
  options?: Core.RequestOptions,
49
- ): Core.APIPromise<Shared.AuthorizationResponse> {
50
+ ): Core.APIPromise<Shared.AuthAuthorizationResponse> {
50
51
  return this._client.post('/v1/tools/authorize', { body, ...options });
51
52
  }
52
53
 
@@ -60,22 +61,27 @@ export class Tools extends APIResource {
60
61
  /**
61
62
  * Returns the arcade tool specification for a specific tool
62
63
  */
63
- get(query: ToolGetParams, options?: Core.RequestOptions): Core.APIPromise<ToolGetResponse> {
64
- return this._client.get('/v1/tools/definition', { query, ...options });
64
+ get(name: string, options?: Core.RequestOptions): Core.APIPromise<ToolGetResponse> {
65
+ return this._client.get(`/v1/tools/${name}`, options);
65
66
  }
66
67
  }
67
68
 
68
69
  export class ToolListResponsesOffsetPage extends OffsetPage<ToolListResponse> {}
69
70
 
71
+ export class ToolExecutionsOffsetPage extends OffsetPage<ToolExecution> {}
72
+
70
73
  export interface AuthorizeToolRequest {
71
74
  tool_name: string;
72
75
 
73
- user_id: string;
74
-
75
76
  /**
76
77
  * Optional: if not provided, any version is used
77
78
  */
78
79
  tool_version?: string;
80
+
81
+ /**
82
+ * Required only when calling with an API key
83
+ */
84
+ user_id?: string;
79
85
  }
80
86
 
81
87
  export interface ExecuteToolRequest {
@@ -84,13 +90,13 @@ export interface ExecuteToolRequest {
84
90
  /**
85
91
  * JSON input to the tool, if any
86
92
  */
87
- inputs?: unknown;
93
+ input?: Record<string, unknown>;
88
94
 
89
95
  /**
90
96
  * The time at which the tool should be run (optional). If not provided, the tool
91
97
  * is run immediately
92
98
  */
93
- run_at?: ExecuteToolRequest.RunAt;
99
+ run_at?: string;
94
100
 
95
101
  /**
96
102
  * The tool version to use (optional). If not provided, any version is used
@@ -100,30 +106,20 @@ export interface ExecuteToolRequest {
100
106
  user_id?: string;
101
107
  }
102
108
 
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
- }
111
- }
112
-
113
109
  export interface ExecuteToolResponse {
114
110
  id?: string;
115
111
 
116
112
  duration?: number;
117
113
 
118
- execution_type?: string;
114
+ execution_id?: string;
119
115
 
120
- finished_at?: ExecuteToolResponse.FinishedAt;
116
+ execution_type?: string;
121
117
 
122
- invocation_id?: string;
118
+ finished_at?: string;
123
119
 
124
- output?: ResponseOutput;
120
+ output?: ExecuteToolResponse.Output;
125
121
 
126
- run_at?: ExecuteToolResponse.RunAt;
122
+ run_at?: string;
127
123
 
128
124
  status?: string;
129
125
 
@@ -136,51 +132,43 @@ export interface ExecuteToolResponse {
136
132
  }
137
133
 
138
134
  export namespace ExecuteToolResponse {
139
- export interface FinishedAt {
140
- 'time.Time'?: string;
141
- }
142
-
143
- export interface RunAt {
144
- 'time.Time'?: string;
145
- }
146
- }
147
-
148
- export interface ResponseOutput {
149
- error?: ResponseOutput.Error;
135
+ export interface Output {
136
+ authorization?: Shared.AuthAuthorizationResponse;
150
137
 
151
- requires_authorization?: Shared.AuthorizationResponse;
138
+ error?: Output.Error;
152
139
 
153
- value?: unknown;
154
- }
140
+ value?: unknown;
141
+ }
155
142
 
156
- export namespace ResponseOutput {
157
- export interface Error {
158
- message: string;
143
+ export namespace Output {
144
+ export interface Error {
145
+ message: string;
159
146
 
160
- additional_prompt_content?: string;
147
+ additional_prompt_content?: string;
161
148
 
162
- can_retry?: boolean;
149
+ can_retry?: boolean;
163
150
 
164
- developer_message?: string;
151
+ developer_message?: string;
165
152
 
166
- retry_after_ms?: number;
153
+ retry_after_ms?: number;
154
+ }
167
155
  }
168
156
  }
169
157
 
170
158
  export interface ToolExecution {
171
159
  id?: string;
172
160
 
173
- created_at?: ToolExecution.CreatedAt;
161
+ created_at?: string;
174
162
 
175
163
  execution_status?: string;
176
164
 
177
165
  execution_type?: string;
178
166
 
179
- finished_at?: ToolExecution.FinishedAt;
167
+ finished_at?: string;
180
168
 
181
- run_at?: ToolExecution.RunAt;
169
+ run_at?: string;
182
170
 
183
- started_at?: ToolExecution.StartedAt;
171
+ started_at?: string;
184
172
 
185
173
  tool_name?: string;
186
174
 
@@ -188,41 +176,19 @@ export interface ToolExecution {
188
176
 
189
177
  toolkit_version?: string;
190
178
 
191
- updated_at?: ToolExecution.UpdatedAt;
179
+ updated_at?: string;
192
180
 
193
181
  user_id?: string;
194
182
  }
195
183
 
196
- export namespace ToolExecution {
197
- export interface CreatedAt {
198
- 'time.Time'?: string;
199
- }
200
-
201
- export interface FinishedAt {
202
- 'time.Time'?: string;
203
- }
204
-
205
- export interface RunAt {
206
- 'time.Time'?: string;
207
- }
208
-
209
- export interface StartedAt {
210
- 'time.Time'?: string;
211
- }
212
-
213
- export interface UpdatedAt {
214
- 'time.Time'?: string;
215
- }
216
- }
217
-
218
184
  export interface ToolExecutionAttempt {
219
185
  id?: string;
220
186
 
221
- finished_at?: ToolExecutionAttempt.FinishedAt;
187
+ finished_at?: string;
222
188
 
223
- output?: ResponseOutput;
189
+ output?: ToolExecutionAttempt.Output;
224
190
 
225
- started_at?: ToolExecutionAttempt.StartedAt;
191
+ started_at?: string;
226
192
 
227
193
  success?: boolean;
228
194
 
@@ -230,17 +196,39 @@ export interface ToolExecutionAttempt {
230
196
  }
231
197
 
232
198
  export namespace ToolExecutionAttempt {
233
- export interface FinishedAt {
234
- 'time.Time'?: string;
199
+ export interface Output {
200
+ authorization?: Shared.AuthAuthorizationResponse;
201
+
202
+ error?: Output.Error;
203
+
204
+ value?: unknown;
235
205
  }
236
206
 
237
- export interface StartedAt {
238
- 'time.Time'?: string;
207
+ export namespace Output {
208
+ export interface Error {
209
+ message: string;
210
+
211
+ additional_prompt_content?: string;
212
+
213
+ can_retry?: boolean;
214
+
215
+ developer_message?: string;
216
+
217
+ retry_after_ms?: number;
218
+ }
239
219
  }
240
220
  }
241
221
 
222
+ export interface ValueSchema {
223
+ val_type: string;
224
+
225
+ enum?: Array<string>;
226
+
227
+ inner_val_type?: string;
228
+ }
229
+
242
230
  export interface ToolListResponse {
243
- inputs: ToolListResponse.Inputs;
231
+ input: ToolListResponse.Input;
244
232
 
245
233
  name: string;
246
234
 
@@ -256,15 +244,15 @@ export interface ToolListResponse {
256
244
  }
257
245
 
258
246
  export namespace ToolListResponse {
259
- export interface Inputs {
260
- parameters?: Array<Inputs.Parameter>;
247
+ export interface Input {
248
+ parameters?: Array<Input.Parameter>;
261
249
  }
262
250
 
263
- export namespace Inputs {
251
+ export namespace Input {
264
252
  export interface Parameter {
265
253
  name: string;
266
254
 
267
- value_schema: Parameter.ValueSchema;
255
+ value_schema: ToolsAPI.ValueSchema;
268
256
 
269
257
  description?: string;
270
258
 
@@ -272,16 +260,6 @@ export namespace ToolListResponse {
272
260
 
273
261
  required?: boolean;
274
262
  }
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
263
  }
286
264
 
287
265
  export interface Toolkit {
@@ -297,17 +275,7 @@ export namespace ToolListResponse {
297
275
 
298
276
  description?: string;
299
277
 
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
- }
278
+ value_schema?: ToolsAPI.ValueSchema;
311
279
  }
312
280
 
313
281
  export interface Requirements {
@@ -316,6 +284,8 @@ export namespace ToolListResponse {
316
284
 
317
285
  export namespace Requirements {
318
286
  export interface Authorization {
287
+ id?: string;
288
+
319
289
  oauth2?: Authorization.Oauth2;
320
290
 
321
291
  provider_id?: string;
@@ -332,7 +302,7 @@ export namespace ToolListResponse {
332
302
  }
333
303
 
334
304
  export interface ToolGetResponse {
335
- inputs: ToolGetResponse.Inputs;
305
+ input: ToolGetResponse.Input;
336
306
 
337
307
  name: string;
338
308
 
@@ -348,15 +318,15 @@ export interface ToolGetResponse {
348
318
  }
349
319
 
350
320
  export namespace ToolGetResponse {
351
- export interface Inputs {
352
- parameters?: Array<Inputs.Parameter>;
321
+ export interface Input {
322
+ parameters?: Array<Input.Parameter>;
353
323
  }
354
324
 
355
- export namespace Inputs {
325
+ export namespace Input {
356
326
  export interface Parameter {
357
327
  name: string;
358
328
 
359
- value_schema: Parameter.ValueSchema;
329
+ value_schema: ToolsAPI.ValueSchema;
360
330
 
361
331
  description?: string;
362
332
 
@@ -364,16 +334,6 @@ export namespace ToolGetResponse {
364
334
 
365
335
  required?: boolean;
366
336
  }
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
337
  }
378
338
 
379
339
  export interface Toolkit {
@@ -389,17 +349,7 @@ export namespace ToolGetResponse {
389
349
 
390
350
  description?: string;
391
351
 
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
- }
352
+ value_schema?: ToolsAPI.ValueSchema;
403
353
  }
404
354
 
405
355
  export interface Requirements {
@@ -408,6 +358,8 @@ export namespace ToolGetResponse {
408
358
 
409
359
  export namespace Requirements {
410
360
  export interface Authorization {
361
+ id?: string;
362
+
411
363
  oauth2?: Authorization.Oauth2;
412
364
 
413
365
  provider_id?: string;
@@ -433,12 +385,15 @@ export interface ToolListParams extends OffsetPageParams {
433
385
  export interface ToolAuthorizeParams {
434
386
  tool_name: string;
435
387
 
436
- user_id: string;
437
-
438
388
  /**
439
389
  * Optional: if not provided, any version is used
440
390
  */
441
391
  tool_version?: string;
392
+
393
+ /**
394
+ * Required only when calling with an API key
395
+ */
396
+ user_id?: string;
442
397
  }
443
398
 
444
399
  export interface ToolExecuteParams {
@@ -447,13 +402,13 @@ export interface ToolExecuteParams {
447
402
  /**
448
403
  * JSON input to the tool, if any
449
404
  */
450
- inputs?: unknown;
405
+ input?: Record<string, unknown>;
451
406
 
452
407
  /**
453
408
  * The time at which the tool should be run (optional). If not provided, the tool
454
409
  * is run immediately
455
410
  */
456
- run_at?: ToolExecuteParams.RunAt;
411
+ run_at?: string;
457
412
 
458
413
  /**
459
414
  * The tool version to use (optional). If not provided, any version is used
@@ -463,23 +418,6 @@ export interface ToolExecuteParams {
463
418
  user_id?: string;
464
419
  }
465
420
 
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
-
476
- export interface ToolGetParams {
477
- /**
478
- * Tool ID
479
- */
480
- toolId: string;
481
- }
482
-
483
421
  Tools.ToolListResponsesOffsetPage = ToolListResponsesOffsetPage;
484
422
  Tools.Scheduled = Scheduled;
485
423
  Tools.Formatted = Formatted;
@@ -490,22 +428,21 @@ export declare namespace Tools {
490
428
  type AuthorizeToolRequest as AuthorizeToolRequest,
491
429
  type ExecuteToolRequest as ExecuteToolRequest,
492
430
  type ExecuteToolResponse as ExecuteToolResponse,
493
- type ResponseOutput as ResponseOutput,
494
431
  type ToolExecution as ToolExecution,
495
432
  type ToolExecutionAttempt as ToolExecutionAttempt,
433
+ type ValueSchema as ValueSchema,
496
434
  type ToolListResponse as ToolListResponse,
497
435
  type ToolGetResponse as ToolGetResponse,
498
436
  ToolListResponsesOffsetPage as ToolListResponsesOffsetPage,
499
437
  type ToolListParams as ToolListParams,
500
438
  type ToolAuthorizeParams as ToolAuthorizeParams,
501
439
  type ToolExecuteParams as ToolExecuteParams,
502
- type ToolGetParams as ToolGetParams,
503
440
  };
504
441
 
505
442
  export {
506
443
  Scheduled as Scheduled,
507
- type ScheduledListResponse as ScheduledListResponse,
508
- type ScheduledDetailsResponse as ScheduledDetailsResponse,
444
+ type ScheduledGetResponse as ScheduledGetResponse,
445
+ type ScheduledListParams as ScheduledListParams,
509
446
  };
510
447
 
511
448
  export {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.2'; // x-release-please-version
1
+ export const VERSION = '1.0.0-rc.1'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.2";
1
+ export declare const VERSION = "1.0.0-rc.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,eAAe,CAAC"}
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.2'; // x-release-please-version
4
+ exports.VERSION = '1.0.0-rc.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,YAAY,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.2'; // x-release-please-version
1
+ export const VERSION = '1.0.0-rc.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,2BAA2B"}