@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,161 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
import * as ToolsAPI from "./tools.js";
|
|
4
|
+
import * as Shared from "./shared.js";
|
|
5
|
+
import { ToolDefinitionsOffsetPage } from "./shared.js";
|
|
6
|
+
import { type OffsetPageParams } from "../pagination.js";
|
|
7
|
+
export declare class Tools extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a list of tools, optionally filtered by toolkit or auth provider
|
|
10
|
+
*/
|
|
11
|
+
list(query?: ToolListParams, options?: Core.RequestOptions): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
|
|
12
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ToolDefinitionsOffsetPage, Shared.ToolDefinition>;
|
|
13
|
+
/**
|
|
14
|
+
* Authorizes a user for a specific tool by name
|
|
15
|
+
*/
|
|
16
|
+
authorize(body: ToolAuthorizeParams, options?: Core.RequestOptions): Core.APIPromise<Shared.AuthorizationResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Executes a tool by name and arguments
|
|
19
|
+
*/
|
|
20
|
+
execute(body: ToolExecuteParams, options?: Core.RequestOptions): Core.APIPromise<Response>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the arcade tool specification for a specific tool
|
|
23
|
+
*/
|
|
24
|
+
get(query: ToolGetParams, options?: Core.RequestOptions): Core.APIPromise<Shared.ToolDefinition>;
|
|
25
|
+
}
|
|
26
|
+
export interface AuthorizeToolRequest {
|
|
27
|
+
tool_name: string;
|
|
28
|
+
user_id: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional: if not provided, any version is used
|
|
31
|
+
*/
|
|
32
|
+
tool_version?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ExecuteToolRequest {
|
|
35
|
+
tool_name: string;
|
|
36
|
+
/**
|
|
37
|
+
* Serialized JSON string
|
|
38
|
+
*/
|
|
39
|
+
inputs?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Optional: if not provided, any version is used
|
|
42
|
+
*/
|
|
43
|
+
tool_version?: string;
|
|
44
|
+
user_id?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface Inputs {
|
|
47
|
+
parameters?: Array<Parameter>;
|
|
48
|
+
}
|
|
49
|
+
export interface Output {
|
|
50
|
+
available_modes?: Array<string>;
|
|
51
|
+
description?: string;
|
|
52
|
+
value_schema?: ValueSchema;
|
|
53
|
+
}
|
|
54
|
+
export interface Parameter {
|
|
55
|
+
name: string;
|
|
56
|
+
value_schema: ValueSchema;
|
|
57
|
+
description?: string;
|
|
58
|
+
inferrable?: boolean;
|
|
59
|
+
required?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface Requirements {
|
|
62
|
+
authorization?: Requirements.Authorization;
|
|
63
|
+
}
|
|
64
|
+
export declare namespace Requirements {
|
|
65
|
+
interface Authorization {
|
|
66
|
+
oauth2?: Authorization.Oauth2;
|
|
67
|
+
provider_id?: string;
|
|
68
|
+
provider_type?: string;
|
|
69
|
+
}
|
|
70
|
+
namespace Authorization {
|
|
71
|
+
interface Oauth2 {
|
|
72
|
+
scopes?: Array<string>;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export interface Response {
|
|
77
|
+
invocation_id: string;
|
|
78
|
+
duration?: number;
|
|
79
|
+
finished_at?: Response.FinishedAt;
|
|
80
|
+
output?: ResponseOutput;
|
|
81
|
+
success?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare namespace Response {
|
|
84
|
+
interface FinishedAt {
|
|
85
|
+
'time.Time'?: string;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export interface ResponseOutput {
|
|
89
|
+
error?: ResponseOutput.Error;
|
|
90
|
+
requires_authorization?: Shared.AuthorizationResponse;
|
|
91
|
+
value?: unknown;
|
|
92
|
+
}
|
|
93
|
+
export declare namespace ResponseOutput {
|
|
94
|
+
interface Error {
|
|
95
|
+
message: string;
|
|
96
|
+
additional_prompt_content?: string;
|
|
97
|
+
can_retry?: boolean;
|
|
98
|
+
developer_message?: string;
|
|
99
|
+
retry_after_ms?: number;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export interface ToolkitDefinition {
|
|
103
|
+
name: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
version?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ValueSchema {
|
|
108
|
+
val_type: string;
|
|
109
|
+
enum?: Array<string>;
|
|
110
|
+
inner_val_type?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface ToolListParams extends OffsetPageParams {
|
|
113
|
+
/**
|
|
114
|
+
* Toolkit name
|
|
115
|
+
*/
|
|
116
|
+
toolkit?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface ToolAuthorizeParams {
|
|
119
|
+
tool_name: string;
|
|
120
|
+
user_id: string;
|
|
121
|
+
/**
|
|
122
|
+
* Optional: if not provided, any version is used
|
|
123
|
+
*/
|
|
124
|
+
tool_version?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface ToolExecuteParams {
|
|
127
|
+
tool_name: string;
|
|
128
|
+
/**
|
|
129
|
+
* Serialized JSON string
|
|
130
|
+
*/
|
|
131
|
+
inputs?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Optional: if not provided, any version is used
|
|
134
|
+
*/
|
|
135
|
+
tool_version?: string;
|
|
136
|
+
user_id?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface ToolGetParams {
|
|
139
|
+
/**
|
|
140
|
+
* Tool ID
|
|
141
|
+
*/
|
|
142
|
+
toolId: string;
|
|
143
|
+
}
|
|
144
|
+
export declare namespace Tools {
|
|
145
|
+
export import AuthorizeToolRequest = ToolsAPI.AuthorizeToolRequest;
|
|
146
|
+
export import ExecuteToolRequest = ToolsAPI.ExecuteToolRequest;
|
|
147
|
+
export import Inputs = ToolsAPI.Inputs;
|
|
148
|
+
export import Output = ToolsAPI.Output;
|
|
149
|
+
export import Parameter = ToolsAPI.Parameter;
|
|
150
|
+
export import Requirements = ToolsAPI.Requirements;
|
|
151
|
+
export import Response = ToolsAPI.Response;
|
|
152
|
+
export import ResponseOutput = ToolsAPI.ResponseOutput;
|
|
153
|
+
export import ToolkitDefinition = ToolsAPI.ToolkitDefinition;
|
|
154
|
+
export import ValueSchema = ToolsAPI.ValueSchema;
|
|
155
|
+
export import ToolListParams = ToolsAPI.ToolListParams;
|
|
156
|
+
export import ToolAuthorizeParams = ToolsAPI.ToolAuthorizeParams;
|
|
157
|
+
export import ToolExecuteParams = ToolsAPI.ToolExecuteParams;
|
|
158
|
+
export import ToolGetParams = ToolsAPI.ToolGetParams;
|
|
159
|
+
}
|
|
160
|
+
export { ToolDefinitionsOffsetPage };
|
|
161
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,IAAI,CACF,KAAK,CAAC,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAAE,MAAM,CAAC,cAAc,CAAC;IACrE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,yBAAyB,EAAE,MAAM,CAAC,cAAc,CAAC;IAWvG;;OAEG;IACH,SAAS,CACP,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,qBAA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AM,QAAQ,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC;IAC7D,MAAM,QAAQ,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;CACtD;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ToolDefinitionsOffsetPage = exports.Tools = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
const core_1 = require("../core.js");
|
|
7
|
+
const shared_1 = require("./shared.js");
|
|
8
|
+
Object.defineProperty(exports, "ToolDefinitionsOffsetPage", { enumerable: true, get: function () { return shared_1.ToolDefinitionsOffsetPage; } });
|
|
9
|
+
class Tools extends resource_1.APIResource {
|
|
10
|
+
list(query = {}, options) {
|
|
11
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
12
|
+
return this.list({}, query);
|
|
13
|
+
}
|
|
14
|
+
return this._client.getAPIList('/v1/tools/list', shared_1.ToolDefinitionsOffsetPage, { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Authorizes a user for a specific tool by name
|
|
18
|
+
*/
|
|
19
|
+
authorize(body, options) {
|
|
20
|
+
return this._client.post('/v1/tools/authorize', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Executes a tool by name and arguments
|
|
24
|
+
*/
|
|
25
|
+
execute(body, options) {
|
|
26
|
+
return this._client.post('/v1/tools/execute', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the arcade tool specification for a specific tool
|
|
30
|
+
*/
|
|
31
|
+
get(query, options) {
|
|
32
|
+
return this._client.get('/v1/tools/definition', { query, ...options });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.Tools = Tools;
|
|
36
|
+
(function (Tools) {
|
|
37
|
+
})(Tools = exports.Tools || (exports.Tools = {}));
|
|
38
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAI3C,wCAAqD;AAwO5C,0GAxOA,kCAAyB,OAwOA;AArOlC,MAAa,KAAM,SAAQ,sBAAW;IASpC,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,kCAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;OAEG;IACH,SAAS,CACP,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAuB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,KAAoB,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AA1CD,sBA0CC;AA0KD,WAAiB,KAAK;AAetB,CAAC,EAfgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAerB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../core.mjs";
|
|
4
|
+
import { ToolDefinitionsOffsetPage } from "./shared.mjs";
|
|
5
|
+
export class Tools extends APIResource {
|
|
6
|
+
list(query = {}, options) {
|
|
7
|
+
if (isRequestOptions(query)) {
|
|
8
|
+
return this.list({}, query);
|
|
9
|
+
}
|
|
10
|
+
return this._client.getAPIList('/v1/tools/list', ToolDefinitionsOffsetPage, { query, ...options });
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Authorizes a user for a specific tool by name
|
|
14
|
+
*/
|
|
15
|
+
authorize(body, options) {
|
|
16
|
+
return this._client.post('/v1/tools/authorize', { body, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Executes a tool by name and arguments
|
|
20
|
+
*/
|
|
21
|
+
execute(body, options) {
|
|
22
|
+
return this._client.post('/v1/tools/execute', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the arcade tool specification for a specific tool
|
|
26
|
+
*/
|
|
27
|
+
get(query, options) {
|
|
28
|
+
return this._client.get('/v1/tools/definition', { query, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
(function (Tools) {
|
|
32
|
+
})(Tools || (Tools = {}));
|
|
33
|
+
export { ToolDefinitionsOffsetPage };
|
|
34
|
+
//# sourceMappingURL=tools.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.mjs","sourceRoot":"","sources":["../src/resources/tools.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,yBAAyB,EAAE;AAGpC,MAAM,OAAO,KAAM,SAAQ,WAAW;IASpC,IAAI,CACF,QAA8C,EAAE,EAChD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;OAEG;IACH,SAAS,CACP,IAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAuB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,KAAoB,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AA0KD,WAAiB,KAAK;AAetB,CAAC,EAfgB,KAAK,KAAL,KAAK,QAerB;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
package/shims/node.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import * as types from "../_shims/node-types.js";
|
|
6
|
+
declare module '../_shims/manual-types' {
|
|
7
|
+
namespace manual {
|
|
8
|
+
type Agent = types.Agent;
|
|
9
|
+
export import fetch = types.fetch;
|
|
10
|
+
type Request = types.Request;
|
|
11
|
+
type RequestInfo = types.RequestInfo;
|
|
12
|
+
type RequestInit = types.RequestInit;
|
|
13
|
+
type Response = types.Response;
|
|
14
|
+
type ResponseInit = types.ResponseInit;
|
|
15
|
+
type ResponseType = types.ResponseType;
|
|
16
|
+
type BodyInit = types.BodyInit;
|
|
17
|
+
type Headers = types.Headers;
|
|
18
|
+
type HeadersInit = types.HeadersInit;
|
|
19
|
+
type BlobPropertyBag = types.BlobPropertyBag;
|
|
20
|
+
type FilePropertyBag = types.FilePropertyBag;
|
|
21
|
+
type FileFromPathOptions = types.FileFromPathOptions;
|
|
22
|
+
export import FormData = types.FormData;
|
|
23
|
+
export import File = types.File;
|
|
24
|
+
export import Blob = types.Blob;
|
|
25
|
+
type Readable = types.Readable;
|
|
26
|
+
type FsReadStream = types.FsReadStream;
|
|
27
|
+
export import ReadableStream = types.ReadableStream;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":";;;;AACA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAK9C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,MAAM,CAAC;QAEtB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAEhC,MAAM,QAAQ,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE5D,MAAM,QAAQ,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAExC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,MAAM,QAAQ,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KACrD;CACF"}
|
package/shims/node.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
const types = __importStar(require("../_shims/node-types.js"));
|
|
28
|
+
const registry_1 = require("../_shims/registry.js");
|
|
29
|
+
const node_runtime_1 = require("../_shims/node-runtime.js");
|
|
30
|
+
(0, registry_1.setShims)((0, node_runtime_1.getRuntime)());
|
|
31
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,+DAA8C;AAC9C,oDAA8C;AAC9C,4DAAoD;AACpD,IAAA,mBAAQ,EAAC,IAAA,yBAAU,GAAE,CAAC,CAAC"}
|
package/shims/node.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.mjs","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":"OACO,KAAK,KAAK;OACV,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE;AACrB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC"}
|
package/shims/web.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as types from "../_shims/web-types.js";
|
|
2
|
+
declare module '../_shims/manual-types' {
|
|
3
|
+
namespace manual {
|
|
4
|
+
type Agent = types.Agent;
|
|
5
|
+
export import fetch = types.fetch;
|
|
6
|
+
type Request = types.Request;
|
|
7
|
+
type RequestInfo = types.RequestInfo;
|
|
8
|
+
type RequestInit = types.RequestInit;
|
|
9
|
+
type Response = types.Response;
|
|
10
|
+
type ResponseInit = types.ResponseInit;
|
|
11
|
+
type ResponseType = types.ResponseType;
|
|
12
|
+
type BodyInit = types.BodyInit;
|
|
13
|
+
type Headers = types.Headers;
|
|
14
|
+
type HeadersInit = types.HeadersInit;
|
|
15
|
+
type BlobPropertyBag = types.BlobPropertyBag;
|
|
16
|
+
type FilePropertyBag = types.FilePropertyBag;
|
|
17
|
+
type FileFromPathOptions = types.FileFromPathOptions;
|
|
18
|
+
export import FormData = types.FormData;
|
|
19
|
+
export import File = types.File;
|
|
20
|
+
export import Blob = types.Blob;
|
|
21
|
+
type Readable = types.Readable;
|
|
22
|
+
type FsReadStream = types.FsReadStream;
|
|
23
|
+
export import ReadableStream = types.ReadableStream;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAK7C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,MAAM,CAAC;QAEtB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAEhC,MAAM,QAAQ,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE5D,MAAM,QAAQ,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAExC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,MAAM,QAAQ,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KACrD;CACF"}
|
package/shims/web.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
const types = __importStar(require("../_shims/web-types.js"));
|
|
28
|
+
const registry_1 = require("../_shims/registry.js");
|
|
29
|
+
const web_runtime_1 = require("../_shims/web-runtime.js");
|
|
30
|
+
(0, registry_1.setShims)((0, web_runtime_1.getRuntime)({ manuallyImported: true }));
|
|
31
|
+
//# sourceMappingURL=web.js.map
|
package/shims/web.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,8DAA6C;AAC7C,oDAA8C;AAC9C,0DAAmD;AACnD,IAAA,mBAAQ,EAAC,IAAA,wBAAU,EAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
|
package/shims/web.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.mjs","sourceRoot":"","sources":["../src/shims/web.ts"],"names":[],"mappings":"OACO,KAAK,KAAK;OACV,EAAE,QAAQ,EAAE;OACZ,EAAE,UAAU,EAAE;AACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 👋 Wondering what everything in here does?
|
|
2
|
+
|
|
3
|
+
`@arcadeai/arcadejs` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
|
|
4
|
+
edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
|
|
5
|
+
|
|
6
|
+
To do this, `@arcadeai/arcadejs` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
|
|
7
|
+
|
|
8
|
+
It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
|
|
9
|
+
automatically select the correct shims for each environment. However, conditional exports are a fairly new
|
|
10
|
+
feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
|
|
11
|
+
|
|
12
|
+
setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
|
|
13
|
+
Unfortunately that's still the default setting, and it can result in errors like
|
|
14
|
+
getting the wrong raw `Response` type from `.asResponse()`, for example.
|
|
15
|
+
|
|
16
|
+
The user can work around these issues by manually importing one of:
|
|
17
|
+
|
|
18
|
+
- `import '@arcadeai/arcadejs/shims/node'`
|
|
19
|
+
- `import '@arcadeai/arcadejs/shims/web'`
|
|
20
|
+
|
|
21
|
+
All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
|
|
22
|
+
|
|
23
|
+
### How it works - Runtime
|
|
24
|
+
|
|
25
|
+
Runtime shims get installed by calling `setShims` exported by `@arcadeai/arcadejs/_shims/registry`.
|
|
26
|
+
|
|
27
|
+
Manually importing `@arcadeai/arcadejs/shims/node` or `@arcadeai/arcadejs/shims/web`, calls `setShims` with the respective runtime shims.
|
|
28
|
+
|
|
29
|
+
All client code imports shims from `@arcadeai/arcadejs/_shims/index`, which:
|
|
30
|
+
|
|
31
|
+
- checks if shims have been set manually
|
|
32
|
+
- if not, calls `setShims` with the shims from `@arcadeai/arcadejs/_shims/auto/runtime`
|
|
33
|
+
- re-exports the installed shims from `@arcadeai/arcadejs/_shims/registry`.
|
|
34
|
+
|
|
35
|
+
`@arcadeai/arcadejs/_shims/auto/runtime` exports web runtime shims.
|
|
36
|
+
If the `node` export condition is set, the export map replaces it with `@arcadeai/arcadejs/_shims/auto/runtime-node`.
|
|
37
|
+
|
|
38
|
+
### How it works - Type time
|
|
39
|
+
|
|
40
|
+
All client code imports shim types from `@arcadeai/arcadejs/_shims/index`, which selects the manual types from `@arcadeai/arcadejs/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@arcadeai/arcadejs/_shims/auto/types`.
|
|
41
|
+
|
|
42
|
+
`@arcadeai/arcadejs/_shims/manual-types` exports an empty namespace.
|
|
43
|
+
Manually importing `@arcadeai/arcadejs/shims/node` or `@arcadeai/arcadejs/shims/web` merges declarations into this empty namespace, so they get picked up by `@arcadeai/arcadejs/_shims/index`.
|
|
44
|
+
|
|
45
|
+
`@arcadeai/arcadejs/_shims/auto/types` exports web type definitions.
|
|
46
|
+
If the `node` export condition is set, the export map replaces it with `@arcadeai/arcadejs/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
export type Agent = any;
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
declare const _fetch: typeof fetch;
|
|
8
|
+
export { _fetch as fetch };
|
|
9
|
+
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
type _Request = Request;
|
|
12
|
+
export { _Request as Request };
|
|
13
|
+
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
type _RequestInfo = RequestInfo;
|
|
16
|
+
export { type _RequestInfo as RequestInfo };
|
|
17
|
+
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
type _RequestInit = RequestInit;
|
|
20
|
+
export { type _RequestInit as RequestInit };
|
|
21
|
+
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
type _Response = Response;
|
|
24
|
+
export { _Response as Response };
|
|
25
|
+
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
type _ResponseInit = ResponseInit;
|
|
28
|
+
export { type _ResponseInit as ResponseInit };
|
|
29
|
+
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
type _ResponseType = ResponseType;
|
|
32
|
+
export { type _ResponseType as ResponseType };
|
|
33
|
+
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
type _BodyInit = BodyInit;
|
|
36
|
+
export { type _BodyInit as BodyInit };
|
|
37
|
+
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
type _Headers = Headers;
|
|
40
|
+
export { _Headers as Headers };
|
|
41
|
+
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
type _HeadersInit = HeadersInit;
|
|
44
|
+
export { type _HeadersInit as HeadersInit };
|
|
45
|
+
|
|
46
|
+
type EndingType = 'native' | 'transparent';
|
|
47
|
+
|
|
48
|
+
export interface BlobPropertyBag {
|
|
49
|
+
endings?: EndingType;
|
|
50
|
+
type?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
|
54
|
+
lastModified?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
58
|
+
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
type _FormData = FormData;
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
declare const _FormData: typeof FormData;
|
|
63
|
+
export { _FormData as FormData };
|
|
64
|
+
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
type _File = File;
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
declare const _File: typeof File;
|
|
69
|
+
export { _File as File };
|
|
70
|
+
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
type _Blob = Blob;
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
declare const _Blob: typeof Blob;
|
|
75
|
+
export { _Blob as Blob };
|
|
76
|
+
|
|
77
|
+
export declare class Readable {
|
|
78
|
+
readable: boolean;
|
|
79
|
+
readonly readableEnded: boolean;
|
|
80
|
+
readonly readableFlowing: boolean | null;
|
|
81
|
+
readonly readableHighWaterMark: number;
|
|
82
|
+
readonly readableLength: number;
|
|
83
|
+
readonly readableObjectMode: boolean;
|
|
84
|
+
destroyed: boolean;
|
|
85
|
+
read(size?: number): any;
|
|
86
|
+
pause(): this;
|
|
87
|
+
resume(): this;
|
|
88
|
+
isPaused(): boolean;
|
|
89
|
+
destroy(error?: Error): this;
|
|
90
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export declare class FsReadStream extends Readable {
|
|
94
|
+
path: {}; // node type is string | Buffer
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
type _ReadableStream<R = any> = ReadableStream<R>;
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
declare const _ReadableStream: typeof ReadableStream;
|
|
101
|
+
export { _ReadableStream as ReadableStream };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
import { type Shims } from './registry';
|
|
5
|
+
import { getRuntime as getWebRuntime } from './web-runtime';
|
|
6
|
+
import { ReadStream as FsReadStream } from 'node:fs';
|
|
7
|
+
|
|
8
|
+
export function getRuntime(): Shims {
|
|
9
|
+
const runtime = getWebRuntime();
|
|
10
|
+
function isFsReadStream(value: any): value is FsReadStream {
|
|
11
|
+
return value instanceof FsReadStream;
|
|
12
|
+
}
|
|
13
|
+
return { ...runtime, isFsReadStream };
|
|
14
|
+
}
|