@arcadeai/arcadejs 0.1.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.
- package/CHANGELOG.md +64 -0
- package/LICENSE +201 -0
- package/README.md +305 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +242 -0
- package/core.d.ts.map +1 -0
- package/core.js +903 -0
- package/core.js.map +1 -0
- package/core.mjs +871 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +146 -0
- package/index.d.ts +146 -0
- package/index.d.ts.map +1 -0
- package/index.js +118 -0
- package/index.js.map +1 -0
- package/index.mjs +90 -0
- package/index.mjs.map +1 -0
- package/package.json +103 -0
- package/pagination.d.ts +26 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +46 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +42 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/auth.d.ts +68 -0
- package/resources/auth.d.ts.map +1 -0
- package/resources/auth.js +25 -0
- package/resources/auth.js.map +1 -0
- package/resources/auth.mjs +21 -0
- package/resources/auth.mjs.map +1 -0
- package/resources/chat/chat.d.ts +136 -0
- package/resources/chat/chat.d.ts.map +1 -0
- package/resources/chat/chat.js +40 -0
- package/resources/chat/chat.js.map +1 -0
- package/resources/chat/chat.mjs +13 -0
- package/resources/chat/chat.mjs.map +1 -0
- package/resources/chat/completions.d.ts +76 -0
- package/resources/chat/completions.d.ts.map +1 -0
- package/resources/chat/completions.js +17 -0
- package/resources/chat/completions.js.map +1 -0
- package/resources/chat/completions.mjs +13 -0
- package/resources/chat/completions.mjs.map +1 -0
- package/resources/chat/index.d.ts +3 -0
- package/resources/chat/index.d.ts.map +1 -0
- package/resources/chat/index.js +9 -0
- package/resources/chat/index.js.map +1 -0
- package/resources/chat/index.mjs +4 -0
- package/resources/chat/index.mjs.map +1 -0
- package/resources/health.d.ts +16 -0
- package/resources/health.d.ts.map +1 -0
- package/resources/health.js +17 -0
- package/resources/health.js.map +1 -0
- package/resources/health.mjs +13 -0
- package/resources/health.mjs.map +1 -0
- package/resources/index.d.ts +6 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +28 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -0
- package/resources/shared.d.ts +30 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +9 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +5 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/tools/definition.d.ts +24 -0
- package/resources/tools/definition.d.ts.map +1 -0
- package/resources/tools/definition.js +17 -0
- package/resources/tools/definition.js.map +1 -0
- package/resources/tools/definition.mjs +13 -0
- package/resources/tools/definition.mjs.map +1 -0
- package/resources/tools/formatted.d.ts +48 -0
- package/resources/tools/formatted.d.ts.map +1 -0
- package/resources/tools/formatted.js +56 -0
- package/resources/tools/formatted.js.map +1 -0
- package/resources/tools/formatted.mjs +28 -0
- package/resources/tools/formatted.mjs.map +1 -0
- package/resources/tools/index.d.ts +3 -0
- package/resources/tools/index.d.ts.map +1 -0
- package/resources/tools/index.js +10 -0
- package/resources/tools/index.js.map +1 -0
- package/resources/tools/index.mjs +4 -0
- package/resources/tools/index.mjs.map +1 -0
- package/resources/tools/tools.d.ts +169 -0
- package/resources/tools/tools.d.ts.map +1 -0
- package/resources/tools/tools.js +68 -0
- package/resources/tools/tools.js.map +1 -0
- package/resources/tools/tools.mjs +41 -0
- package/resources/tools/tools.mjs.map +1 -0
- package/resources/tools.d.ts +161 -0
- package/resources/tools.d.ts.map +1 -0
- package/resources/tools.js +38 -0
- package/resources/tools.js.map +1 -0
- package/resources/tools.mjs +34 -0
- package/resources/tools.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1196 -0
- package/src/error.ts +146 -0
- package/src/index.ts +227 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +79 -0
- package/src/resource.ts +11 -0
- package/src/resources/auth.ts +97 -0
- package/src/resources/chat/chat.ts +186 -0
- package/src/resources/chat/completions.ts +102 -0
- package/src/resources/chat/index.ts +4 -0
- package/src/resources/health.ts +22 -0
- package/src/resources/index.ts +23 -0
- package/src/resources/shared.ts +46 -0
- package/src/resources/tools/definition.ts +31 -0
- package/src/resources/tools/formatted.ts +78 -0
- package/src/resources/tools/index.ts +27 -0
- package/src/resources/tools/tools.ts +249 -0
- package/src/resources/tools.ts +240 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as ToolsAPI from './tools';
|
|
7
|
+
import * as Shared from '../shared';
|
|
8
|
+
import { ToolDefinitionsOffsetPage } from '../shared';
|
|
9
|
+
import * as FormattedAPI from './formatted';
|
|
10
|
+
import { type OffsetPageParams } from '../../pagination';
|
|
11
|
+
|
|
12
|
+
export class Tools extends APIResource {
|
|
13
|
+
formatted: FormattedAPI.Formatted = new FormattedAPI.Formatted(this._client);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns a page of tools, optionally filtered by toolkit
|
|
17
|
+
*/
|
|
18
|
+
list(
|
|
19
|
+
query?: ToolListParams,
|
|
20
|
+
options?: Core.RequestOptions,
|
|
21
|
+
): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
|
|
22
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
|
|
23
|
+
list(
|
|
24
|
+
query: ToolListParams | Core.RequestOptions = {},
|
|
25
|
+
options?: Core.RequestOptions,
|
|
26
|
+
): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition> {
|
|
27
|
+
if (isRequestOptions(query)) {
|
|
28
|
+
return this.list({}, query);
|
|
29
|
+
}
|
|
30
|
+
return this._client.getAPIList('/v1/tools/list', ToolDefinitionsOffsetPage, { query, ...options });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Authorizes a user for a specific tool by name
|
|
35
|
+
*/
|
|
36
|
+
authorize(
|
|
37
|
+
body: ToolAuthorizeParams,
|
|
38
|
+
options?: Core.RequestOptions,
|
|
39
|
+
): Core.APIPromise<Shared.AuthorizationResponse> {
|
|
40
|
+
return this._client.post('/v1/tools/authorize', { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Executes a tool by name and arguments
|
|
45
|
+
*/
|
|
46
|
+
execute(body: ToolExecuteParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
|
|
47
|
+
return this._client.post('/v1/tools/execute', { body, ...options });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns the arcade tool specification for a specific tool
|
|
52
|
+
*/
|
|
53
|
+
get(query: ToolGetParams, options?: Core.RequestOptions): Core.APIPromise<Shared.ToolDefinition> {
|
|
54
|
+
return this._client.get('/v1/tools/definition', { query, ...options });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface AuthorizeToolRequest {
|
|
59
|
+
tool_name: string;
|
|
60
|
+
|
|
61
|
+
user_id: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Optional: if not provided, any version is used
|
|
65
|
+
*/
|
|
66
|
+
tool_version?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ExecuteToolRequest {
|
|
70
|
+
tool_name: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* JSON input to the tool, if any
|
|
74
|
+
*/
|
|
75
|
+
inputs?: unknown;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Optional: if not provided, any version is used
|
|
79
|
+
*/
|
|
80
|
+
tool_version?: string;
|
|
81
|
+
|
|
82
|
+
user_id?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface Inputs {
|
|
86
|
+
parameters?: Array<Parameter>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Output {
|
|
90
|
+
available_modes?: Array<string>;
|
|
91
|
+
|
|
92
|
+
description?: string;
|
|
93
|
+
|
|
94
|
+
value_schema?: ValueSchema;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface Parameter {
|
|
98
|
+
name: string;
|
|
99
|
+
|
|
100
|
+
value_schema: ValueSchema;
|
|
101
|
+
|
|
102
|
+
description?: string;
|
|
103
|
+
|
|
104
|
+
inferrable?: boolean;
|
|
105
|
+
|
|
106
|
+
required?: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface Requirements {
|
|
110
|
+
authorization?: Requirements.Authorization;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export namespace Requirements {
|
|
114
|
+
export interface Authorization {
|
|
115
|
+
oauth2?: Authorization.Oauth2;
|
|
116
|
+
|
|
117
|
+
provider_id?: string;
|
|
118
|
+
|
|
119
|
+
provider_type?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export namespace Authorization {
|
|
123
|
+
export interface Oauth2 {
|
|
124
|
+
scopes?: Array<string>;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface Response {
|
|
130
|
+
invocation_id: string;
|
|
131
|
+
|
|
132
|
+
duration?: number;
|
|
133
|
+
|
|
134
|
+
finished_at?: Response.FinishedAt;
|
|
135
|
+
|
|
136
|
+
output?: ResponseOutput;
|
|
137
|
+
|
|
138
|
+
success?: boolean;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export namespace Response {
|
|
142
|
+
export interface FinishedAt {
|
|
143
|
+
'time.Time'?: string;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ResponseOutput {
|
|
148
|
+
error?: ResponseOutput.Error;
|
|
149
|
+
|
|
150
|
+
requires_authorization?: Shared.AuthorizationResponse;
|
|
151
|
+
|
|
152
|
+
value?: unknown;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export namespace ResponseOutput {
|
|
156
|
+
export interface Error {
|
|
157
|
+
message: string;
|
|
158
|
+
|
|
159
|
+
additional_prompt_content?: string;
|
|
160
|
+
|
|
161
|
+
can_retry?: boolean;
|
|
162
|
+
|
|
163
|
+
developer_message?: string;
|
|
164
|
+
|
|
165
|
+
retry_after_ms?: number;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface ToolkitDefinition {
|
|
170
|
+
name: string;
|
|
171
|
+
|
|
172
|
+
description?: string;
|
|
173
|
+
|
|
174
|
+
version?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface ValueSchema {
|
|
178
|
+
val_type: string;
|
|
179
|
+
|
|
180
|
+
enum?: Array<string>;
|
|
181
|
+
|
|
182
|
+
inner_val_type?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface ToolListParams extends OffsetPageParams {
|
|
186
|
+
/**
|
|
187
|
+
* Toolkit name
|
|
188
|
+
*/
|
|
189
|
+
toolkit?: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface ToolAuthorizeParams {
|
|
193
|
+
tool_name: string;
|
|
194
|
+
|
|
195
|
+
user_id: string;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Optional: if not provided, any version is used
|
|
199
|
+
*/
|
|
200
|
+
tool_version?: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface ToolExecuteParams {
|
|
204
|
+
tool_name: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* JSON input to the tool, if any
|
|
208
|
+
*/
|
|
209
|
+
inputs?: unknown;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Optional: if not provided, any version is used
|
|
213
|
+
*/
|
|
214
|
+
tool_version?: string;
|
|
215
|
+
|
|
216
|
+
user_id?: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface ToolGetParams {
|
|
220
|
+
/**
|
|
221
|
+
* Tool ID
|
|
222
|
+
*/
|
|
223
|
+
toolId: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export namespace Tools {
|
|
227
|
+
export import AuthorizeToolRequest = ToolsAPI.AuthorizeToolRequest;
|
|
228
|
+
export import ExecuteToolRequest = ToolsAPI.ExecuteToolRequest;
|
|
229
|
+
export import Inputs = ToolsAPI.Inputs;
|
|
230
|
+
export import Output = ToolsAPI.Output;
|
|
231
|
+
export import Parameter = ToolsAPI.Parameter;
|
|
232
|
+
export import Requirements = ToolsAPI.Requirements;
|
|
233
|
+
export import Response = ToolsAPI.Response;
|
|
234
|
+
export import ResponseOutput = ToolsAPI.ResponseOutput;
|
|
235
|
+
export import ToolkitDefinition = ToolsAPI.ToolkitDefinition;
|
|
236
|
+
export import ValueSchema = ToolsAPI.ValueSchema;
|
|
237
|
+
export import ToolListParams = ToolsAPI.ToolListParams;
|
|
238
|
+
export import ToolAuthorizeParams = ToolsAPI.ToolAuthorizeParams;
|
|
239
|
+
export import ToolExecuteParams = ToolsAPI.ToolExecuteParams;
|
|
240
|
+
export import ToolGetParams = ToolsAPI.ToolGetParams;
|
|
241
|
+
export import Formatted = FormattedAPI.Formatted;
|
|
242
|
+
export import FormattedListResponse = FormattedAPI.FormattedListResponse;
|
|
243
|
+
export import FormattedGetResponse = FormattedAPI.FormattedGetResponse;
|
|
244
|
+
export import FormattedListResponsesOffsetPage = FormattedAPI.FormattedListResponsesOffsetPage;
|
|
245
|
+
export import FormattedListParams = FormattedAPI.FormattedListParams;
|
|
246
|
+
export import FormattedGetParams = FormattedAPI.FormattedGetParams;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export { ToolDefinitionsOffsetPage };
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import { isRequestOptions } from '../core';
|
|
5
|
+
import * as Core from '../core';
|
|
6
|
+
import * as ToolsAPI from './tools';
|
|
7
|
+
import * as Shared from './shared';
|
|
8
|
+
import { ToolDefinitionsOffsetPage } from './shared';
|
|
9
|
+
import { type OffsetPageParams } from '../pagination';
|
|
10
|
+
|
|
11
|
+
export class Tools extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a list of tools, optionally filtered by toolkit or auth provider
|
|
14
|
+
*/
|
|
15
|
+
list(
|
|
16
|
+
query?: ToolListParams,
|
|
17
|
+
options?: Core.RequestOptions,
|
|
18
|
+
): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
|
|
19
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
|
|
20
|
+
list(
|
|
21
|
+
query: ToolListParams | Core.RequestOptions = {},
|
|
22
|
+
options?: Core.RequestOptions,
|
|
23
|
+
): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition> {
|
|
24
|
+
if (isRequestOptions(query)) {
|
|
25
|
+
return this.list({}, query);
|
|
26
|
+
}
|
|
27
|
+
return this._client.getAPIList('/v1/tools/list', ToolDefinitionsOffsetPage, { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Authorizes a user for a specific tool by name
|
|
32
|
+
*/
|
|
33
|
+
authorize(
|
|
34
|
+
body: ToolAuthorizeParams,
|
|
35
|
+
options?: Core.RequestOptions,
|
|
36
|
+
): Core.APIPromise<Shared.AuthorizationResponse> {
|
|
37
|
+
return this._client.post('/v1/tools/authorize', { body, ...options });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Executes a tool by name and arguments
|
|
42
|
+
*/
|
|
43
|
+
execute(body: ToolExecuteParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
|
|
44
|
+
return this._client.post('/v1/tools/execute', { body, ...options });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns the arcade tool specification for a specific tool
|
|
49
|
+
*/
|
|
50
|
+
get(query: ToolGetParams, options?: Core.RequestOptions): Core.APIPromise<Shared.ToolDefinition> {
|
|
51
|
+
return this._client.get('/v1/tools/definition', { query, ...options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface AuthorizeToolRequest {
|
|
56
|
+
tool_name: string;
|
|
57
|
+
|
|
58
|
+
user_id: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Optional: if not provided, any version is used
|
|
62
|
+
*/
|
|
63
|
+
tool_version?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ExecuteToolRequest {
|
|
67
|
+
tool_name: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Serialized JSON string
|
|
71
|
+
*/
|
|
72
|
+
inputs?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Optional: if not provided, any version is used
|
|
76
|
+
*/
|
|
77
|
+
tool_version?: string;
|
|
78
|
+
|
|
79
|
+
user_id?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface Inputs {
|
|
83
|
+
parameters?: Array<Parameter>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface Output {
|
|
87
|
+
available_modes?: Array<string>;
|
|
88
|
+
|
|
89
|
+
description?: string;
|
|
90
|
+
|
|
91
|
+
value_schema?: ValueSchema;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface Parameter {
|
|
95
|
+
name: string;
|
|
96
|
+
|
|
97
|
+
value_schema: ValueSchema;
|
|
98
|
+
|
|
99
|
+
description?: string;
|
|
100
|
+
|
|
101
|
+
inferrable?: boolean;
|
|
102
|
+
|
|
103
|
+
required?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface Requirements {
|
|
107
|
+
authorization?: Requirements.Authorization;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export namespace Requirements {
|
|
111
|
+
export interface Authorization {
|
|
112
|
+
oauth2?: Authorization.Oauth2;
|
|
113
|
+
|
|
114
|
+
provider_id?: string;
|
|
115
|
+
|
|
116
|
+
provider_type?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export namespace Authorization {
|
|
120
|
+
export interface Oauth2 {
|
|
121
|
+
scopes?: Array<string>;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface Response {
|
|
127
|
+
invocation_id: string;
|
|
128
|
+
|
|
129
|
+
duration?: number;
|
|
130
|
+
|
|
131
|
+
finished_at?: Response.FinishedAt;
|
|
132
|
+
|
|
133
|
+
output?: ResponseOutput;
|
|
134
|
+
|
|
135
|
+
success?: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export namespace Response {
|
|
139
|
+
export interface FinishedAt {
|
|
140
|
+
'time.Time'?: string;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface ResponseOutput {
|
|
145
|
+
error?: ResponseOutput.Error;
|
|
146
|
+
|
|
147
|
+
requires_authorization?: Shared.AuthorizationResponse;
|
|
148
|
+
|
|
149
|
+
value?: unknown;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export namespace ResponseOutput {
|
|
153
|
+
export interface Error {
|
|
154
|
+
message: string;
|
|
155
|
+
|
|
156
|
+
additional_prompt_content?: string;
|
|
157
|
+
|
|
158
|
+
can_retry?: boolean;
|
|
159
|
+
|
|
160
|
+
developer_message?: string;
|
|
161
|
+
|
|
162
|
+
retry_after_ms?: number;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface ToolkitDefinition {
|
|
167
|
+
name: string;
|
|
168
|
+
|
|
169
|
+
description?: string;
|
|
170
|
+
|
|
171
|
+
version?: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface ValueSchema {
|
|
175
|
+
val_type: string;
|
|
176
|
+
|
|
177
|
+
enum?: Array<string>;
|
|
178
|
+
|
|
179
|
+
inner_val_type?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface ToolListParams extends OffsetPageParams {
|
|
183
|
+
/**
|
|
184
|
+
* Toolkit name
|
|
185
|
+
*/
|
|
186
|
+
toolkit?: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface ToolAuthorizeParams {
|
|
190
|
+
tool_name: string;
|
|
191
|
+
|
|
192
|
+
user_id: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Optional: if not provided, any version is used
|
|
196
|
+
*/
|
|
197
|
+
tool_version?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface ToolExecuteParams {
|
|
201
|
+
tool_name: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Serialized JSON string
|
|
205
|
+
*/
|
|
206
|
+
inputs?: string;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Optional: if not provided, any version is used
|
|
210
|
+
*/
|
|
211
|
+
tool_version?: string;
|
|
212
|
+
|
|
213
|
+
user_id?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface ToolGetParams {
|
|
217
|
+
/**
|
|
218
|
+
* Tool ID
|
|
219
|
+
*/
|
|
220
|
+
toolId: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export namespace Tools {
|
|
224
|
+
export import AuthorizeToolRequest = ToolsAPI.AuthorizeToolRequest;
|
|
225
|
+
export import ExecuteToolRequest = ToolsAPI.ExecuteToolRequest;
|
|
226
|
+
export import Inputs = ToolsAPI.Inputs;
|
|
227
|
+
export import Output = ToolsAPI.Output;
|
|
228
|
+
export import Parameter = ToolsAPI.Parameter;
|
|
229
|
+
export import Requirements = ToolsAPI.Requirements;
|
|
230
|
+
export import Response = ToolsAPI.Response;
|
|
231
|
+
export import ResponseOutput = ToolsAPI.ResponseOutput;
|
|
232
|
+
export import ToolkitDefinition = ToolsAPI.ToolkitDefinition;
|
|
233
|
+
export import ValueSchema = ToolsAPI.ValueSchema;
|
|
234
|
+
export import ToolListParams = ToolsAPI.ToolListParams;
|
|
235
|
+
export import ToolAuthorizeParams = ToolsAPI.ToolAuthorizeParams;
|
|
236
|
+
export import ToolExecuteParams = ToolsAPI.ToolExecuteParams;
|
|
237
|
+
export import ToolGetParams = ToolsAPI.ToolGetParams;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export { ToolDefinitionsOffsetPage };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/node-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/node-runtime';
|
|
5
|
+
setShims(getRuntime());
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/shims/web.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/web-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/web-runtime';
|
|
5
|
+
setShims(getRuntime({ manuallyImported: true }));
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
// this config is included in the published src directory to prevent TS errors
|
|
3
|
+
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
+
// via declaration maps
|
|
5
|
+
"include": ["index.ts"],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"target": "es2015",
|
|
8
|
+
"lib": ["DOM"],
|
|
9
|
+
"moduleResolution": "node"
|
|
10
|
+
}
|
|
11
|
+
}
|