@bctrl/sdk 1.0.9 → 1.0.11
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/README.md +43 -72
- package/dist/account.d.ts +4 -1
- package/dist/account.js +12 -0
- package/dist/aiTypes.d.ts +0 -3
- package/dist/bctrl.d.ts +9 -3
- package/dist/bctrl.js +18 -6
- package/dist/browserExtensionTypes.d.ts +2 -2
- package/dist/browserExtensions.js +6 -6
- package/dist/conversations.d.ts +27 -0
- package/dist/conversations.js +63 -0
- package/dist/generated/openapi-types.d.ts +7404 -6023
- package/dist/generated/tool-types.d.ts +60 -0
- package/dist/http.d.ts +5 -0
- package/dist/http.js +44 -0
- package/dist/index.d.ts +8 -7
- package/dist/index.js +7 -6
- package/dist/node.d.ts +43 -101
- package/dist/node.js +6 -8
- package/dist/proxies.d.ts +15 -1
- package/dist/proxies.js +28 -0
- package/dist/proxyTypes.d.ts +8 -2
- package/dist/runs.d.ts +13 -102
- package/dist/runs.js +21 -114
- package/dist/runtimes.d.ts +11 -53
- package/dist/runtimes.js +18 -221
- package/dist/spaces.d.ts +1 -17
- package/dist/spaces.js +0 -75
- package/dist/toolCallTypes.d.ts +2 -2
- package/dist/toolCalls.d.ts +4 -1
- package/dist/toolCalls.js +14 -0
- package/dist/tools.d.ts +13 -15
- package/dist/tools.js +24 -19
- package/dist/toolsetTypes.d.ts +1 -1
- package/dist/types.d.ts +64 -183
- package/dist/views.d.ts +12 -0
- package/dist/views.js +34 -0
- package/dist/webhooks.d.ts +30 -0
- package/dist/webhooks.js +71 -0
- package/package.json +14 -12
- package/dist/invocations.d.ts +0 -125
- package/dist/invocations.js +0 -199
- package/dist/vault.d.ts +0 -14
- package/dist/vault.js +0 -37
- package/dist/vaultTypes.d.ts +0 -9
- /package/dist/{vaultTypes.js → generated/tool-types.js} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* Generated from: openapi/sdk-openapi.json
|
|
5
|
+
* Run `pnpm generate:sdk-contracts` to regenerate.
|
|
6
|
+
*/
|
|
7
|
+
import type { components } from './openapi-types.js';
|
|
8
|
+
export interface BuiltinToolInputMap {
|
|
9
|
+
"browser.pages.activate": components['schemas']["BuiltinToolBrowserPagesActivateInput"];
|
|
10
|
+
"browser.pages.close": components['schemas']["BuiltinToolBrowserPagesCloseInput"];
|
|
11
|
+
"browser.pages.get": components['schemas']["BuiltinToolBrowserPagesGetInput"];
|
|
12
|
+
"browser.pages.list": components['schemas']["BuiltinToolBrowserPagesListInput"];
|
|
13
|
+
"browser.pages.open": components['schemas']["BuiltinToolBrowserPagesOpenInput"];
|
|
14
|
+
"captcha.solve": components['schemas']["BuiltinToolCaptchaSolveInput"];
|
|
15
|
+
"code.execute": components['schemas']["BuiltinToolCodeExecuteInput"];
|
|
16
|
+
"files.list": components['schemas']["BuiltinToolFilesListInput"];
|
|
17
|
+
"files.read_text": components['schemas']["BuiltinToolFilesReadTextInput"];
|
|
18
|
+
"human.request": components['schemas']["BuiltinToolHumanRequestInput"];
|
|
19
|
+
"run.files.export": components['schemas']["BuiltinToolRunFilesExportInput"];
|
|
20
|
+
"runtime.files.collect": components['schemas']["BuiltinToolRuntimeFilesCollectInput"];
|
|
21
|
+
"runtime.files.list": components['schemas']["BuiltinToolRuntimeFilesListInput"];
|
|
22
|
+
"runtime.files.stage": components['schemas']["BuiltinToolRuntimeFilesStageInput"];
|
|
23
|
+
"stagehand.act": components['schemas']["BuiltinToolStagehandActInput"];
|
|
24
|
+
"stagehand.extract": components['schemas']["BuiltinToolStagehandExtractInput"];
|
|
25
|
+
"stagehand.observe": components['schemas']["BuiltinToolStagehandObserveInput"];
|
|
26
|
+
"vault.secrets.delete": components['schemas']["BuiltinToolVaultSecretsDeleteInput"];
|
|
27
|
+
"vault.secrets.get": components['schemas']["BuiltinToolVaultSecretsGetInput"];
|
|
28
|
+
"vault.secrets.list": components['schemas']["BuiltinToolVaultSecretsListInput"];
|
|
29
|
+
"vault.secrets.set": components['schemas']["BuiltinToolVaultSecretsSetInput"];
|
|
30
|
+
"vault.secrets.update": components['schemas']["BuiltinToolVaultSecretsUpdateInput"];
|
|
31
|
+
"vault.secrets.value": components['schemas']["BuiltinToolVaultSecretsValueInput"];
|
|
32
|
+
"vault.totp.generate": components['schemas']["BuiltinToolVaultTotpGenerateInput"];
|
|
33
|
+
}
|
|
34
|
+
export interface BuiltinToolOutputMap {
|
|
35
|
+
"browser.pages.activate": components['schemas']["BuiltinToolBrowserPagesActivateOutput"];
|
|
36
|
+
"browser.pages.close": components['schemas']["BuiltinToolBrowserPagesCloseOutput"];
|
|
37
|
+
"browser.pages.get": components['schemas']["BuiltinToolBrowserPagesGetOutput"];
|
|
38
|
+
"browser.pages.list": components['schemas']["BuiltinToolBrowserPagesListOutput"];
|
|
39
|
+
"browser.pages.open": components['schemas']["BuiltinToolBrowserPagesOpenOutput"];
|
|
40
|
+
"captcha.solve": components['schemas']["BuiltinToolCaptchaSolveOutput"];
|
|
41
|
+
"files.list": components['schemas']["BuiltinToolFilesListOutput"];
|
|
42
|
+
"files.read_text": components['schemas']["BuiltinToolFilesReadTextOutput"];
|
|
43
|
+
"run.files.export": components['schemas']["BuiltinToolRunFilesExportOutput"];
|
|
44
|
+
"runtime.files.collect": components['schemas']["BuiltinToolRuntimeFilesCollectOutput"];
|
|
45
|
+
"runtime.files.list": components['schemas']["BuiltinToolRuntimeFilesListOutput"];
|
|
46
|
+
"runtime.files.stage": components['schemas']["BuiltinToolRuntimeFilesStageOutput"];
|
|
47
|
+
"stagehand.act": components['schemas']["BuiltinToolStagehandActOutput"];
|
|
48
|
+
"stagehand.extract": components['schemas']["BuiltinToolStagehandExtractOutput"];
|
|
49
|
+
"stagehand.observe": components['schemas']["BuiltinToolStagehandObserveOutput"];
|
|
50
|
+
"vault.secrets.delete": components['schemas']["BuiltinToolVaultSecretsDeleteOutput"];
|
|
51
|
+
"vault.secrets.get": components['schemas']["BuiltinToolVaultSecretsGetOutput"];
|
|
52
|
+
"vault.secrets.list": components['schemas']["BuiltinToolVaultSecretsListOutput"];
|
|
53
|
+
"vault.secrets.set": components['schemas']["BuiltinToolVaultSecretsSetOutput"];
|
|
54
|
+
"vault.secrets.update": components['schemas']["BuiltinToolVaultSecretsUpdateOutput"];
|
|
55
|
+
"vault.secrets.value": components['schemas']["BuiltinToolVaultSecretsValueOutput"];
|
|
56
|
+
"vault.totp.generate": components['schemas']["BuiltinToolVaultTotpGenerateOutput"];
|
|
57
|
+
}
|
|
58
|
+
export type BuiltinToolName = keyof BuiltinToolInputMap;
|
|
59
|
+
export type SyncBuiltinToolName = keyof BuiltinToolOutputMap;
|
|
60
|
+
export type AsyncBuiltinToolName = "browser.pages.activate" | "browser.pages.close" | "browser.pages.open" | "captcha.solve" | "code.execute" | "human.request" | "run.files.export" | "runtime.files.collect" | "runtime.files.stage" | "stagehand.act" | "stagehand.extract" | "stagehand.observe";
|
package/dist/http.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export interface V1RequestOptions {
|
|
|
17
17
|
export interface V1IdempotencyOptions {
|
|
18
18
|
idempotencyKey?: string;
|
|
19
19
|
}
|
|
20
|
+
export interface V1ToolInvocationOptions extends V1IdempotencyOptions {
|
|
21
|
+
/** Direct Runtime-bound Tools resolve their active Run server-side. */
|
|
22
|
+
runtimeId?: string;
|
|
23
|
+
}
|
|
20
24
|
export declare class V1HttpClient {
|
|
21
25
|
readonly baseUrl: string;
|
|
22
26
|
readonly apiKey: string;
|
|
@@ -28,5 +32,6 @@ export declare class V1HttpClient {
|
|
|
28
32
|
withSubaccount(subaccountId: string): V1HttpClient;
|
|
29
33
|
request<T>(path: string, options?: V1RequestOptions): Promise<T>;
|
|
30
34
|
raw(path: string, options?: V1RequestOptions): Promise<Response>;
|
|
35
|
+
streamSse<T>(path: string, options?: Omit<V1RequestOptions, 'method' | 'body'>): AsyncGenerator<T, void, undefined>;
|
|
31
36
|
}
|
|
32
37
|
export declare function v1IdempotencyHeaders(options?: V1IdempotencyOptions): Record<string, string> | undefined;
|
package/dist/http.js
CHANGED
|
@@ -174,6 +174,50 @@ export class V1HttpClient {
|
|
|
174
174
|
}
|
|
175
175
|
return response;
|
|
176
176
|
}
|
|
177
|
+
async *streamSse(path, options = {}) {
|
|
178
|
+
const response = await this.raw(path, {
|
|
179
|
+
...options,
|
|
180
|
+
headers: { Accept: 'text/event-stream', ...options.headers },
|
|
181
|
+
});
|
|
182
|
+
if (!response.body) {
|
|
183
|
+
throw new BctrlNetworkError('SSE response did not include a body');
|
|
184
|
+
}
|
|
185
|
+
const reader = response.body.getReader();
|
|
186
|
+
const decoder = new TextDecoder();
|
|
187
|
+
let buffer = '';
|
|
188
|
+
try {
|
|
189
|
+
while (true) {
|
|
190
|
+
const { done, value } = await reader.read();
|
|
191
|
+
buffer += decoder.decode(value, { stream: !done });
|
|
192
|
+
const normalized = buffer.replaceAll('\r\n', '\n');
|
|
193
|
+
const blocks = normalized.split('\n\n');
|
|
194
|
+
buffer = blocks.pop() ?? '';
|
|
195
|
+
for (const block of blocks) {
|
|
196
|
+
const data = block
|
|
197
|
+
.split('\n')
|
|
198
|
+
.filter((line) => line.startsWith('data:'))
|
|
199
|
+
.map((line) => line.slice(5).trimStart())
|
|
200
|
+
.join('\n');
|
|
201
|
+
if (!data || data === '[DONE]')
|
|
202
|
+
continue;
|
|
203
|
+
yield JSON.parse(data);
|
|
204
|
+
}
|
|
205
|
+
if (done)
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
const data = buffer
|
|
209
|
+
.replaceAll('\r\n', '\n')
|
|
210
|
+
.split('\n')
|
|
211
|
+
.filter((line) => line.startsWith('data:'))
|
|
212
|
+
.map((line) => line.slice(5).trimStart())
|
|
213
|
+
.join('\n');
|
|
214
|
+
if (data && data !== '[DONE]')
|
|
215
|
+
yield JSON.parse(data);
|
|
216
|
+
}
|
|
217
|
+
finally {
|
|
218
|
+
reader.releaseLock();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
177
221
|
}
|
|
178
222
|
function isRetryableStatus(status) {
|
|
179
223
|
return status === 408 || status === 429 || status >= 500;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,20 +2,21 @@ export { Bctrl, BctrlV1, type BctrlV1Options } from './bctrl.js';
|
|
|
2
2
|
export { V1AccountClient, V1ApiKeysClient, V1AuthClient, V1SubaccountsClient, V1SubaccountUsageClient, V1UsageClient, } from './account.js';
|
|
3
3
|
export { V1AiClient, V1AiCredentialsClient, V1AiModelsClient } from './ai.js';
|
|
4
4
|
export { V1BrowserExtensionsClient } from './browserExtensions.js';
|
|
5
|
+
export { V1ConversationEventsClient, V1ConversationMessagesClient, V1ConversationsClient, } from './conversations.js';
|
|
5
6
|
export { BctrlError, BctrlApiError, BctrlAuthenticationError, BctrlConflictError, BctrlNetworkError, BctrlNotFoundError, BctrlNotReadyError, BctrlPermissionError, BctrlRateLimitError, BctrlUnsupportedError, BctrlValidationError, isControllerBusy, } from './errors.js';
|
|
6
7
|
export { V1FilesClient } from './files.js';
|
|
7
8
|
export { V1HelpClient } from './help.js';
|
|
8
|
-
export {
|
|
9
|
-
export type { BrowserUseAgentOptions, V1InvocationCreateAndWaitOptions, V1InvocationWaitOptions, V1RuntimeInvocationCreateInput, StagehandActOptions, StagehandAgentOptions, StagehandExtractOptions, StagehandObserveOptions, StagehandVariablePrimitive, StagehandVariableValue, StagehandVariables, } from './invocations.js';
|
|
10
|
-
export { V1RuntimeFilesNamespaceClient, V1RuntimeHumanActionsNamespaceClient, V1RuntimeRunsNamespaceClient, V1RuntimeTargetsNamespaceClient, V1RuntimesClient, } from './runtimes.js';
|
|
9
|
+
export { V1RuntimesClient } from './runtimes.js';
|
|
11
10
|
export { V1NotificationRecipientsClient } from './notificationRecipients.js';
|
|
12
|
-
export { V1ProxiesClient, V1ProxyPoolsClient } from './proxies.js';
|
|
13
|
-
export {
|
|
11
|
+
export { V1ProxiesClient, V1ProxyGeoClient, V1ProxyLocationsClient, V1ProxyPoolsClient, } from './proxies.js';
|
|
12
|
+
export { V1RunEventsNamespaceClient, V1RunFilesNamespaceClient, V1RunTraceNamespaceClient, V1RunsClient, } from './runs.js';
|
|
14
13
|
export { toOutputSchema, type JsonSchemaLike, type JsonSchemaObject } from './schemas.js';
|
|
15
|
-
export {
|
|
14
|
+
export { V1SpacesClient } from './spaces.js';
|
|
16
15
|
export { V1ToolCallsClient } from './toolCalls.js';
|
|
17
16
|
export { passthroughJsonSchema, V1ToolsClient } from './tools.js';
|
|
17
|
+
export type { AsyncBuiltinToolName, BuiltinToolInputMap, BuiltinToolName, BuiltinToolOutputMap, SyncBuiltinToolName, } from './generated/tool-types.js';
|
|
18
18
|
export { V1ToolsetsClient } from './toolsets.js';
|
|
19
|
-
export {
|
|
19
|
+
export { V1ViewsClient } from './views.js';
|
|
20
|
+
export { V1WebhookDeliveriesClient, V1WebhookDeliveriesNamespaceClient, V1WebhooksClient, } from './webhooks.js';
|
|
20
21
|
export type * from './types.js';
|
|
21
22
|
export type * from './browserExtensionTypes.js';
|
package/dist/index.js
CHANGED
|
@@ -2,17 +2,18 @@ export { Bctrl, BctrlV1 } from './bctrl.js';
|
|
|
2
2
|
export { V1AccountClient, V1ApiKeysClient, V1AuthClient, V1SubaccountsClient, V1SubaccountUsageClient, V1UsageClient, } from './account.js';
|
|
3
3
|
export { V1AiClient, V1AiCredentialsClient, V1AiModelsClient } from './ai.js';
|
|
4
4
|
export { V1BrowserExtensionsClient } from './browserExtensions.js';
|
|
5
|
+
export { V1ConversationEventsClient, V1ConversationMessagesClient, V1ConversationsClient, } from './conversations.js';
|
|
5
6
|
export { BctrlError, BctrlApiError, BctrlAuthenticationError, BctrlConflictError, BctrlNetworkError, BctrlNotFoundError, BctrlNotReadyError, BctrlPermissionError, BctrlRateLimitError, BctrlUnsupportedError, BctrlValidationError, isControllerBusy, } from './errors.js';
|
|
6
7
|
export { V1FilesClient } from './files.js';
|
|
7
8
|
export { V1HelpClient } from './help.js';
|
|
8
|
-
export {
|
|
9
|
-
export { V1RuntimeFilesNamespaceClient, V1RuntimeHumanActionsNamespaceClient, V1RuntimeRunsNamespaceClient, V1RuntimeTargetsNamespaceClient, V1RuntimesClient, } from './runtimes.js';
|
|
9
|
+
export { V1RuntimesClient } from './runtimes.js';
|
|
10
10
|
export { V1NotificationRecipientsClient } from './notificationRecipients.js';
|
|
11
|
-
export { V1ProxiesClient, V1ProxyPoolsClient } from './proxies.js';
|
|
12
|
-
export {
|
|
11
|
+
export { V1ProxiesClient, V1ProxyGeoClient, V1ProxyLocationsClient, V1ProxyPoolsClient, } from './proxies.js';
|
|
12
|
+
export { V1RunEventsNamespaceClient, V1RunFilesNamespaceClient, V1RunTraceNamespaceClient, V1RunsClient, } from './runs.js';
|
|
13
13
|
export { toOutputSchema } from './schemas.js';
|
|
14
|
-
export {
|
|
14
|
+
export { V1SpacesClient } from './spaces.js';
|
|
15
15
|
export { V1ToolCallsClient } from './toolCalls.js';
|
|
16
16
|
export { passthroughJsonSchema, V1ToolsClient } from './tools.js';
|
|
17
17
|
export { V1ToolsetsClient } from './toolsets.js';
|
|
18
|
-
export {
|
|
18
|
+
export { V1ViewsClient } from './views.js';
|
|
19
|
+
export { V1WebhookDeliveriesClient, V1WebhookDeliveriesNamespaceClient, V1WebhooksClient, } from './webhooks.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,110 +1,52 @@
|
|
|
1
1
|
import { BctrlV1 } from './bctrl.js';
|
|
2
|
-
import type { V1ToolCreateRequest
|
|
3
|
-
type
|
|
4
|
-
|
|
2
|
+
import type { V1ToolCreateRequest } from './types.js';
|
|
3
|
+
type V1CodeToolCreateRequest = Extract<V1ToolCreateRequest, {
|
|
4
|
+
implementation: {
|
|
5
|
+
type: 'code';
|
|
6
|
+
};
|
|
5
7
|
}>;
|
|
6
|
-
export declare function
|
|
8
|
+
export declare function createCodeToolFromFile(client: BctrlV1, request: Omit<V1CodeToolCreateRequest, 'implementation'> & {
|
|
9
|
+
implementation: Omit<V1CodeToolCreateRequest['implementation'], 'source'>;
|
|
7
10
|
filePath: string;
|
|
8
11
|
}): Promise<{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
spaceId:
|
|
22
|
-
status: "enabled" | "disabled";
|
|
23
|
-
type: "builtin";
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
} | {
|
|
26
|
-
createdAt: string;
|
|
27
|
-
currentVersionId: string | null;
|
|
28
|
-
description: string | null;
|
|
29
|
-
id: string;
|
|
30
|
-
inputSchema: {
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
metadata?: import("./generated/openapi-types.js").components["schemas"]["ToolMetadata"] | null;
|
|
34
|
-
name: string;
|
|
35
|
-
outputSchema: {
|
|
36
|
-
[key: string]: unknown;
|
|
37
|
-
};
|
|
38
|
-
spaceId: string | null;
|
|
39
|
-
status: "enabled" | "disabled";
|
|
40
|
-
type: "hosted";
|
|
41
|
-
updatedAt: string;
|
|
42
|
-
} | {
|
|
43
|
-
createdAt: string;
|
|
44
|
-
description: string | null;
|
|
45
|
-
id: string;
|
|
46
|
-
inputSchema: {
|
|
47
|
-
[key: string]: unknown;
|
|
48
|
-
};
|
|
49
|
-
metadata?: import("./generated/openapi-types.js").components["schemas"]["ToolMetadata"] | null;
|
|
50
|
-
name: string;
|
|
51
|
-
outputSchema: {
|
|
52
|
-
[key: string]: unknown;
|
|
53
|
-
};
|
|
54
|
-
serverId: string;
|
|
55
|
-
spaceId: string | null;
|
|
56
|
-
status: "enabled" | "disabled";
|
|
57
|
-
toolName: string;
|
|
58
|
-
type: "mcp";
|
|
59
|
-
updatedAt: string;
|
|
12
|
+
currentRevisionId: null;
|
|
13
|
+
description: string;
|
|
14
|
+
id: "stagehand.act" | "stagehand.observe" | "stagehand.extract" | "captcha.solve" | "human.request" | "browser.pages.list" | "browser.pages.open" | "browser.pages.get" | "browser.pages.activate" | "browser.pages.close" | "runtime.files.list" | "runtime.files.stage" | "runtime.files.collect" | "run.files.export" | "files.list" | "files.read_text" | "vault.secrets.list" | "vault.secrets.get" | "vault.secrets.set" | "vault.secrets.update" | "vault.secrets.delete" | "vault.secrets.value" | "vault.totp.generate" | "code.execute";
|
|
15
|
+
implementation: {
|
|
16
|
+
name: "stagehand.act" | "stagehand.observe" | "stagehand.extract" | "captcha.solve" | "human.request" | "browser.pages.list" | "browser.pages.open" | "browser.pages.get" | "browser.pages.activate" | "browser.pages.close" | "runtime.files.list" | "runtime.files.stage" | "runtime.files.collect" | "run.files.export" | "files.list" | "files.read_text" | "vault.secrets.list" | "vault.secrets.get" | "vault.secrets.set" | "vault.secrets.update" | "vault.secrets.delete" | "vault.secrets.value" | "vault.totp.generate" | "code.execute";
|
|
17
|
+
type: "builtin";
|
|
18
|
+
};
|
|
19
|
+
inputSchema: import("./generated/openapi-types.js").components["schemas"]["JsonObject"];
|
|
20
|
+
modes: ("sync" | "async")[];
|
|
21
|
+
name: "stagehand.act" | "stagehand.observe" | "stagehand.extract" | "captcha.solve" | "human.request" | "browser.pages.list" | "browser.pages.open" | "browser.pages.get" | "browser.pages.activate" | "browser.pages.close" | "runtime.files.list" | "runtime.files.stage" | "runtime.files.collect" | "run.files.export" | "files.list" | "files.read_text" | "vault.secrets.list" | "vault.secrets.get" | "vault.secrets.set" | "vault.secrets.update" | "vault.secrets.delete" | "vault.secrets.value" | "vault.totp.generate" | "code.execute";
|
|
22
|
+
outputSchema: import("./generated/openapi-types.js").components["schemas"]["JsonObject"];
|
|
23
|
+
runtimeTypes: ("browser" | "desktop" | "spreadsheet")[];
|
|
24
|
+
spaceId: null;
|
|
60
25
|
} | {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
description: string
|
|
26
|
+
createdAt: import("./generated/openapi-types.js").components["schemas"]["Rfc3339Timestamp"];
|
|
27
|
+
currentRevisionId: string;
|
|
28
|
+
description: string;
|
|
64
29
|
id: string;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
30
|
+
implementation: {
|
|
31
|
+
language: "typescript";
|
|
32
|
+
timeoutMs: number;
|
|
33
|
+
type: "code";
|
|
34
|
+
} | {
|
|
35
|
+
authSecretName: string | null;
|
|
36
|
+
timeoutMs: number;
|
|
37
|
+
type: "webhook";
|
|
38
|
+
url: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: "workflow";
|
|
41
|
+
versionId: string;
|
|
42
|
+
workflowId: string;
|
|
43
|
+
};
|
|
44
|
+
inputSchema: import("./generated/openapi-types.js").components["schemas"]["JsonObject"];
|
|
45
|
+
modes: ("sync" | "async")[];
|
|
69
46
|
name: string;
|
|
70
|
-
outputSchema:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
status: "enabled" | "disabled";
|
|
75
|
-
timeoutSeconds?: number;
|
|
76
|
-
type: "webhook";
|
|
77
|
-
updatedAt: string;
|
|
78
|
-
url: string;
|
|
79
|
-
} | {
|
|
80
|
-
createdAt: string;
|
|
81
|
-
description: string | null;
|
|
82
|
-
id: string;
|
|
83
|
-
inputSchema: {
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
};
|
|
86
|
-
metadata?: import("./generated/openapi-types.js").components["schemas"]["ToolMetadata"] | null;
|
|
87
|
-
name: string;
|
|
88
|
-
outputSchema: {
|
|
89
|
-
[key: string]: unknown;
|
|
90
|
-
};
|
|
91
|
-
spaceId: string | null;
|
|
92
|
-
status: "enabled" | "disabled";
|
|
93
|
-
type: "workflow";
|
|
94
|
-
updatedAt: string;
|
|
95
|
-
workflowId: string;
|
|
96
|
-
}>;
|
|
97
|
-
export declare function createToolVersionFromFile(client: BctrlV1, toolId: string, request: Omit<V1ToolVersionCreateRequest, 'source'> & {
|
|
98
|
-
filePath: string;
|
|
99
|
-
}): Promise<{
|
|
100
|
-
createdAt: string;
|
|
101
|
-
current: boolean;
|
|
102
|
-
envKeys: string[];
|
|
103
|
-
id: string;
|
|
104
|
-
metadata?: import("./generated/openapi-types.js").components["schemas"]["ToolMetadata"] | null;
|
|
105
|
-
source: string;
|
|
106
|
-
timeoutSeconds: number;
|
|
107
|
-
toolId: string;
|
|
108
|
-
version: number;
|
|
47
|
+
outputSchema: import("./generated/openapi-types.js").components["schemas"]["JsonObject"];
|
|
48
|
+
runtimeTypes: ("browser" | "desktop" | "spreadsheet")[];
|
|
49
|
+
spaceId: string;
|
|
50
|
+
updatedAt: import("./generated/openapi-types.js").components["schemas"]["Rfc3339Timestamp"];
|
|
109
51
|
}>;
|
|
110
52
|
export {};
|
package/dist/node.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
|
-
export async function
|
|
2
|
+
export async function createCodeToolFromFile(client, request) {
|
|
3
3
|
const source = await readFile(request.filePath, 'utf8');
|
|
4
|
-
const { filePath: _filePath, ...rest } = request;
|
|
5
|
-
return client.tools.create({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { filePath: _filePath, ...rest } = request;
|
|
10
|
-
return client.tools.createVersion(toolId, { ...rest, source });
|
|
4
|
+
const { filePath: _filePath, implementation, ...rest } = request;
|
|
5
|
+
return client.tools.create({
|
|
6
|
+
...rest,
|
|
7
|
+
implementation: { ...implementation, source },
|
|
8
|
+
});
|
|
11
9
|
}
|
package/dist/proxies.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { V1HttpClient } from './http.js';
|
|
2
|
-
import type { V1ListEnvelope, V1Proxy, V1ProxyCreateRequest, V1ProxyDeleteResponse, V1ProxyListQuery, V1ProxyPool, V1ProxyPoolListQuery, V1ProxyTestResponse, V1ProxyUpdateRequest } from './types.js';
|
|
2
|
+
import type { V1ListEnvelope, V1Proxy, V1ProxyCreateRequest, V1ProxyDeleteResponse, V1ProxyGeoListQuery, V1ProxyListQuery, V1ProxyLocation, V1ProxyLocationListResponse, V1ProxyLocationsListQuery, V1ProxyPool, V1ProxyPoolListQuery, V1ProxyTestResponse, V1ProxyUpdateRequest } from './types.js';
|
|
3
|
+
export declare class V1ProxyGeoClient {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: V1HttpClient);
|
|
6
|
+
list(query?: V1ProxyGeoListQuery): Promise<V1ProxyLocationListResponse>;
|
|
7
|
+
iter(query?: V1ProxyGeoListQuery): AsyncGenerator<V1ProxyLocation, void, undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare class V1ProxyLocationsClient {
|
|
10
|
+
private readonly http;
|
|
11
|
+
constructor(http: V1HttpClient);
|
|
12
|
+
list(query?: V1ProxyLocationsListQuery): Promise<V1ProxyLocationListResponse>;
|
|
13
|
+
iter(query?: V1ProxyLocationsListQuery): AsyncGenerator<V1ProxyLocation, void, undefined>;
|
|
14
|
+
}
|
|
3
15
|
export declare class V1ProxyPoolsClient {
|
|
4
16
|
private readonly http;
|
|
5
17
|
constructor(http: V1HttpClient);
|
|
@@ -9,6 +21,8 @@ export declare class V1ProxyPoolsClient {
|
|
|
9
21
|
}
|
|
10
22
|
export declare class V1ProxiesClient {
|
|
11
23
|
private readonly http;
|
|
24
|
+
readonly geo: V1ProxyGeoClient;
|
|
25
|
+
readonly locations: V1ProxyLocationsClient;
|
|
12
26
|
readonly pools: V1ProxyPoolsClient;
|
|
13
27
|
constructor(http: V1HttpClient);
|
|
14
28
|
list(query?: V1ProxyListQuery): Promise<V1ListEnvelope<V1Proxy>>;
|
package/dist/proxies.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { iterateV1Pages } from './pagination.js';
|
|
2
|
+
export class V1ProxyGeoClient {
|
|
3
|
+
http;
|
|
4
|
+
constructor(http) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
}
|
|
7
|
+
list(query = {}) {
|
|
8
|
+
return this.http.request('/proxies/geo', { query });
|
|
9
|
+
}
|
|
10
|
+
iter(query = {}) {
|
|
11
|
+
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class V1ProxyLocationsClient {
|
|
15
|
+
http;
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
list(query = {}) {
|
|
20
|
+
return this.http.request('/proxies/locations', { query });
|
|
21
|
+
}
|
|
22
|
+
iter(query = {}) {
|
|
23
|
+
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
2
26
|
export class V1ProxyPoolsClient {
|
|
3
27
|
http;
|
|
4
28
|
constructor(http) {
|
|
@@ -16,9 +40,13 @@ export class V1ProxyPoolsClient {
|
|
|
16
40
|
}
|
|
17
41
|
export class V1ProxiesClient {
|
|
18
42
|
http;
|
|
43
|
+
geo;
|
|
44
|
+
locations;
|
|
19
45
|
pools;
|
|
20
46
|
constructor(http) {
|
|
21
47
|
this.http = http;
|
|
48
|
+
this.geo = new V1ProxyGeoClient(http);
|
|
49
|
+
this.locations = new V1ProxyLocationsClient(http);
|
|
22
50
|
this.pools = new V1ProxyPoolsClient(http);
|
|
23
51
|
}
|
|
24
52
|
list(query = {}) {
|
package/dist/proxyTypes.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { OpenApiQuery, OpenApiSchemas } from './openapi.js';
|
|
2
|
+
type PropertyOfUnion<T, K extends PropertyKey> = T extends unknown ? K extends keyof T ? T[K] : never : never;
|
|
2
3
|
export type V1ProxyProtocol = NonNullable<OpenApiSchemas['ProxyManagedRotatingCreateRequest']['protocol']>;
|
|
3
4
|
export type V1ProxyDnsResolution = NonNullable<OpenApiSchemas['ProxyManagedRotatingCreateRequest']['dnsResolution']>;
|
|
4
5
|
export type V1ProxyType = OpenApiSchemas['Proxy']['type'];
|
|
5
|
-
export type V1ManagedRotatingPreference = NonNullable<OpenApiSchemas['ProxyManagedRotatingCreateRequest']
|
|
6
|
+
export type V1ManagedRotatingPreference = NonNullable<PropertyOfUnion<OpenApiSchemas['ProxyManagedRotatingCreateRequest'], 'preference'>>;
|
|
6
7
|
export type V1ManagedRotatingRotation = NonNullable<OpenApiSchemas['ProxyManagedRotatingCreateRequest']['rotation']>;
|
|
7
|
-
export type V1ManagedRotatingDevice = NonNullable<OpenApiSchemas['ProxyManagedRotatingCreateRequest']
|
|
8
|
+
export type V1ManagedRotatingDevice = NonNullable<PropertyOfUnion<OpenApiSchemas['ProxyManagedRotatingCreateRequest'], 'device'>>;
|
|
8
9
|
export interface V1ProxyBase {
|
|
9
10
|
id: string;
|
|
10
11
|
name: string;
|
|
@@ -21,3 +22,8 @@ export type V1ProxyDeleteResponse = OpenApiSchemas['ProxyDeleteResponse'];
|
|
|
21
22
|
export type V1ProxyTestResponse = OpenApiSchemas['ProxyTestResponse'];
|
|
22
23
|
export type V1ProxyPool = OpenApiSchemas['ProxyPool'];
|
|
23
24
|
export type V1ProxyPoolListQuery = OpenApiQuery<'proxies.pools.list'>;
|
|
25
|
+
export type V1ProxyLocation = OpenApiSchemas['ProxyLocation'];
|
|
26
|
+
export type V1ProxyLocationListResponse = OpenApiSchemas['ProxyLocationListResponse'];
|
|
27
|
+
export type V1ProxyGeoListQuery = OpenApiQuery<'proxies.geo.list'>;
|
|
28
|
+
export type V1ProxyLocationsListQuery = OpenApiQuery<'proxies.locations.list'>;
|
|
29
|
+
export {};
|
package/dist/runs.d.ts
CHANGED
|
@@ -1,124 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { V1ListEnvelope,
|
|
1
|
+
import type { V1HttpClient } from './http.js';
|
|
2
|
+
import type { V1ListEnvelope, V1Run, V1RunDetail, V1RunEvent, V1RunEventsListQuery, V1RunFile, V1RunListQuery, V1RunGetQuery, V1RunStreamEvent, V1RunStreamQuery, V1TraceSpan, V1RunTraceListQuery } from './types.js';
|
|
3
3
|
export declare class V1RunsClient {
|
|
4
4
|
private readonly http;
|
|
5
5
|
readonly events: V1RunEventsNamespaceClient;
|
|
6
|
-
readonly
|
|
6
|
+
readonly trace: V1RunTraceNamespaceClient;
|
|
7
7
|
readonly files: V1RunFilesNamespaceClient;
|
|
8
|
-
readonly invocations: V1RunInvocationsNamespaceClient;
|
|
9
8
|
constructor(http: V1HttpClient);
|
|
10
9
|
list(query?: V1RunListQuery): Promise<V1ListEnvelope<V1Run>>;
|
|
11
10
|
iter(query?: V1RunListQuery): AsyncGenerator<V1Run, void, undefined>;
|
|
12
|
-
get(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
get(runId: string, query?: V1RunGetQuery): Promise<V1RunDetail>;
|
|
12
|
+
streamUrl(runId: string, query?: V1RunStreamQuery): string;
|
|
13
|
+
stream(runId: string, query?: V1RunStreamQuery, options?: {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}): AsyncGenerator<V1RunStreamEvent, void, undefined>;
|
|
16
16
|
}
|
|
17
17
|
export declare class V1RunEventsNamespaceClient {
|
|
18
18
|
private readonly http;
|
|
19
19
|
constructor(http: V1HttpClient);
|
|
20
20
|
list(runId: string, query?: V1RunEventsListQuery): Promise<V1ListEnvelope<V1RunEvent>>;
|
|
21
21
|
iter(runId: string, query?: V1RunEventsListQuery): AsyncGenerator<V1RunEvent, void, undefined>;
|
|
22
|
-
streamUrl(runId: string, query?: Pick<V1RunEventsListQuery, 'type' | 'status' | 'pageId' | 'contextId'>): string;
|
|
23
22
|
}
|
|
24
|
-
export declare class
|
|
23
|
+
export declare class V1RunTraceNamespaceClient {
|
|
25
24
|
private readonly http;
|
|
26
25
|
constructor(http: V1HttpClient);
|
|
27
|
-
list(runId: string, query?:
|
|
28
|
-
iter(runId: string, query?:
|
|
29
|
-
streamUrl(runId: string, query?: V1RunActivityListQuery): string;
|
|
26
|
+
list(runId: string, query?: V1RunTraceListQuery): Promise<V1ListEnvelope<V1TraceSpan>>;
|
|
27
|
+
iter(runId: string, query?: V1RunTraceListQuery): AsyncGenerator<V1TraceSpan, void, undefined>;
|
|
30
28
|
}
|
|
31
29
|
export declare class V1RunFilesNamespaceClient {
|
|
32
30
|
private readonly http;
|
|
33
31
|
constructor(http: V1HttpClient);
|
|
34
|
-
list(runId: string
|
|
35
|
-
|
|
36
|
-
createdAt: string;
|
|
37
|
-
downloadUrl: string;
|
|
38
|
-
expiresAt?: string;
|
|
39
|
-
id: string;
|
|
40
|
-
metadata?: import("./generated/openapi-types.js").components["schemas"]["JsonObject"] | null;
|
|
41
|
-
name: string;
|
|
42
|
-
path: string;
|
|
43
|
-
runId?: string;
|
|
44
|
-
runtimeId?: string;
|
|
45
|
-
sizeBytes: number;
|
|
46
|
-
source: "upload" | "runtime";
|
|
47
|
-
spaceId: string;
|
|
48
|
-
type?: string;
|
|
49
|
-
}>>;
|
|
50
|
-
iter(runId: string, query?: V1RunFilesListQuery): AsyncGenerator<{
|
|
51
|
-
contentType: string;
|
|
52
|
-
createdAt: string;
|
|
53
|
-
downloadUrl: string;
|
|
54
|
-
expiresAt?: string;
|
|
55
|
-
id: string;
|
|
56
|
-
metadata?: import("./generated/openapi-types.js").components["schemas"]["JsonObject"] | null;
|
|
57
|
-
name: string;
|
|
58
|
-
path: string;
|
|
59
|
-
runId?: string;
|
|
60
|
-
runtimeId?: string;
|
|
61
|
-
sizeBytes: number;
|
|
62
|
-
source: "upload" | "runtime";
|
|
63
|
-
spaceId: string;
|
|
64
|
-
type?: string;
|
|
65
|
-
}, void, undefined>;
|
|
66
|
-
export(runId: string, request?: V1RunFilesExportRequest, options?: V1IdempotencyOptions): Promise<V1File>;
|
|
67
|
-
}
|
|
68
|
-
export declare class V1RunInvocationsNamespaceClient {
|
|
69
|
-
private readonly http;
|
|
70
|
-
constructor(http: V1HttpClient);
|
|
71
|
-
list(runId: string, query?: V1RunInvocationsListQuery): Promise<V1ListEnvelope<{
|
|
72
|
-
action: "act" | "observe" | "extract" | "browserUse" | "stagehandAgent" | "solveCaptcha";
|
|
73
|
-
createdAt: string;
|
|
74
|
-
durationSeconds?: number | null;
|
|
75
|
-
error?: {
|
|
76
|
-
code?: string;
|
|
77
|
-
details?: {
|
|
78
|
-
[key: string]: unknown;
|
|
79
|
-
};
|
|
80
|
-
message: string;
|
|
81
|
-
} | null;
|
|
82
|
-
finishedAt?: string | null;
|
|
83
|
-
id: string;
|
|
84
|
-
runId: string;
|
|
85
|
-
runtimeId: string;
|
|
86
|
-
status: "queued" | "dispatching" | "running" | "cancelling" | "succeeded" | "failed" | "cancelled" | "timed_out";
|
|
87
|
-
}>>;
|
|
88
|
-
iter(runId: string, query?: V1RunInvocationsListQuery): AsyncGenerator<{
|
|
89
|
-
action: "act" | "observe" | "extract" | "browserUse" | "stagehandAgent" | "solveCaptcha";
|
|
90
|
-
createdAt: string;
|
|
91
|
-
durationSeconds?: number | null;
|
|
92
|
-
error?: {
|
|
93
|
-
code?: string;
|
|
94
|
-
details?: {
|
|
95
|
-
[key: string]: unknown;
|
|
96
|
-
};
|
|
97
|
-
message: string;
|
|
98
|
-
} | null;
|
|
99
|
-
finishedAt?: string | null;
|
|
100
|
-
id: string;
|
|
101
|
-
runId: string;
|
|
102
|
-
runtimeId: string;
|
|
103
|
-
status: "queued" | "dispatching" | "running" | "cancelling" | "succeeded" | "failed" | "cancelled" | "timed_out";
|
|
104
|
-
}, void, undefined>;
|
|
105
|
-
get(runId: string, invocationId: string): Promise<{
|
|
106
|
-
action: "act" | "observe" | "extract" | "browserUse" | "stagehandAgent" | "solveCaptcha";
|
|
107
|
-
createdAt: string;
|
|
108
|
-
durationSeconds?: number | null;
|
|
109
|
-
error?: {
|
|
110
|
-
code: "invocation.failed" | "invocation.cancelled" | "invocation.timed_out" | "invocation.dispatch_preparation_failed" | "invocation.dispatch_unavailable" | "invocation.captcha_not_found" | "invocation.captcha_solve_failed" | "invocation.output_validation_failed" | "invocation.stagehand_failed" | "invocation.stagehand_incomplete" | "invocation.browser_use_failed" | "invocation.browser_use_interrupted" | "invocation.browser_use_incomplete";
|
|
111
|
-
details?: {
|
|
112
|
-
[key: string]: unknown;
|
|
113
|
-
};
|
|
114
|
-
message: string;
|
|
115
|
-
} | null;
|
|
116
|
-
finishedAt?: string | null;
|
|
117
|
-
id: string;
|
|
118
|
-
output?: import("./generated/openapi-types.js").components["schemas"]["JsonValue"];
|
|
119
|
-
runId: string;
|
|
120
|
-
runtimeId: string;
|
|
121
|
-
startedAt?: string | null;
|
|
122
|
-
status: "queued" | "dispatching" | "running" | "cancelling" | "succeeded" | "failed" | "cancelled" | "timed_out";
|
|
32
|
+
list(runId: string): Promise<{
|
|
33
|
+
data: V1RunFile[];
|
|
123
34
|
}>;
|
|
124
35
|
}
|