@bctrl/sdk 1.0.3 → 1.0.5
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 +5 -8
- package/dist/account.d.ts +43 -0
- package/dist/account.js +100 -0
- package/dist/accountTypes.d.ts +126 -0
- package/dist/accountTypes.js +1 -0
- package/dist/aiProviderTypes.d.ts +58 -0
- package/dist/aiProviderTypes.js +1 -0
- package/dist/aiProviders.d.ts +13 -0
- package/dist/aiProviders.js +36 -0
- package/dist/bctrl.d.ts +35 -3
- package/dist/bctrl.js +74 -6
- package/dist/browserExtensionTypes.d.ts +45 -0
- package/dist/browserExtensionTypes.js +1 -0
- package/dist/browserExtensions.d.ts +14 -0
- package/dist/browserExtensions.js +53 -0
- package/dist/files.d.ts +6 -24
- package/dist/files.js +9 -56
- package/dist/help.d.ts +7 -0
- package/dist/help.js +9 -0
- package/dist/http.d.ts +12 -1
- package/dist/http.js +73 -10
- package/dist/index.d.ts +17 -6
- package/dist/index.js +15 -5
- package/dist/invocations.d.ts +85 -47
- package/dist/invocations.js +144 -102
- package/dist/node.d.ts +12 -0
- package/dist/node.js +11 -0
- package/dist/proxies.d.ts +21 -0
- package/dist/proxies.js +55 -0
- package/dist/proxyTypes.d.ts +114 -0
- package/dist/proxyTypes.js +1 -0
- package/dist/runs.d.ts +35 -31
- package/dist/runs.js +95 -38
- package/dist/runtimes.d.ts +26 -62
- package/dist/runtimes.js +65 -112
- package/dist/schemas.d.ts +7 -0
- package/dist/schemas.js +36 -0
- package/dist/spaces.d.ts +20 -32
- package/dist/spaces.js +48 -36
- package/dist/toolCallTypes.d.ts +41 -0
- package/dist/toolCallTypes.js +1 -0
- package/dist/toolCalls.d.ts +9 -0
- package/dist/toolCalls.js +16 -0
- package/dist/tools.d.ts +23 -0
- package/dist/tools.js +49 -0
- package/dist/toolsetTypes.d.ts +32 -0
- package/dist/toolsetTypes.js +1 -0
- package/dist/toolsets.d.ts +12 -0
- package/dist/toolsets.js +31 -0
- package/dist/types.d.ts +509 -186
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +28 -3
- package/dist/vault.d.ts +14 -0
- package/dist/vault.js +37 -0
- package/dist/vaultTypes.d.ts +73 -0
- package/dist/vaultTypes.js +1 -0
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -21,22 +21,19 @@ const bctrl = new Bctrl({
|
|
|
21
21
|
|
|
22
22
|
const space = await bctrl.spaces.create({
|
|
23
23
|
name: 'my-task',
|
|
24
|
-
region: 'us-east-1',
|
|
25
24
|
});
|
|
26
25
|
|
|
27
|
-
const
|
|
26
|
+
const createdRuntime = await space.runtimes.create({
|
|
28
27
|
type: 'browser',
|
|
29
28
|
name: 'browser-task',
|
|
30
29
|
config: {
|
|
31
|
-
|
|
30
|
+
profile: false,
|
|
32
31
|
},
|
|
33
32
|
});
|
|
34
|
-
const
|
|
33
|
+
const started = await createdRuntime.start();
|
|
34
|
+
console.log(started.run.id, started.browser.cdpUrl);
|
|
35
35
|
|
|
36
|
-
const
|
|
37
|
-
console.log(connection.wsUrl);
|
|
38
|
-
|
|
39
|
-
const invocation = await browser.invocations.create({
|
|
36
|
+
const invocation = await started.runtime.invocations.create({
|
|
40
37
|
provider: 'stagehand',
|
|
41
38
|
method: 'act',
|
|
42
39
|
input: { instruction: 'Open https://example.com' },
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { V1HttpClient } from './http.js';
|
|
2
|
+
import type { V1AccountUsage, V1ApiKey, V1ApiKeyCreateRequest, V1ApiKeyCreateResponse, V1ApiKeyDeleteResponse, V1ApiKeyListQuery, V1AuthWhoamiResponse, V1ListEnvelope, V1Subaccount, V1SubaccountArchiveResponse, V1SubaccountCreateRequest, V1SubaccountGetQuery, V1SubaccountListQuery, V1SubaccountUpdateRequest, V1SubaccountUsage, V1SubaccountUsageListQuery } from './types.js';
|
|
3
|
+
export declare class V1AuthClient {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: V1HttpClient);
|
|
6
|
+
whoami(): Promise<V1AuthWhoamiResponse>;
|
|
7
|
+
}
|
|
8
|
+
export declare class V1ApiKeysClient {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: V1HttpClient);
|
|
11
|
+
list(query?: V1ApiKeyListQuery): Promise<V1ListEnvelope<V1ApiKey>>;
|
|
12
|
+
iter(query?: V1ApiKeyListQuery): AsyncGenerator<V1ApiKey, void, undefined>;
|
|
13
|
+
create(request?: V1ApiKeyCreateRequest): Promise<V1ApiKeyCreateResponse>;
|
|
14
|
+
delete(keyId: string): Promise<V1ApiKeyDeleteResponse>;
|
|
15
|
+
}
|
|
16
|
+
export declare class V1SubaccountUsageClient {
|
|
17
|
+
private readonly http;
|
|
18
|
+
constructor(http: V1HttpClient);
|
|
19
|
+
list(query?: V1SubaccountUsageListQuery): Promise<V1ListEnvelope<V1SubaccountUsage>>;
|
|
20
|
+
iter(query?: V1SubaccountUsageListQuery): AsyncGenerator<V1SubaccountUsage, void, undefined>;
|
|
21
|
+
}
|
|
22
|
+
export declare class V1SubaccountsClient {
|
|
23
|
+
private readonly http;
|
|
24
|
+
readonly usage: V1SubaccountUsageClient;
|
|
25
|
+
constructor(http: V1HttpClient);
|
|
26
|
+
list(query?: V1SubaccountListQuery): Promise<V1ListEnvelope<V1Subaccount>>;
|
|
27
|
+
iter(query?: V1SubaccountListQuery): AsyncGenerator<V1Subaccount, void, undefined>;
|
|
28
|
+
create(request: V1SubaccountCreateRequest): Promise<V1Subaccount>;
|
|
29
|
+
get(subaccountId: string, query?: V1SubaccountGetQuery): Promise<V1Subaccount>;
|
|
30
|
+
update(subaccountId: string, request: V1SubaccountUpdateRequest): Promise<V1Subaccount>;
|
|
31
|
+
archive(subaccountId: string): Promise<V1SubaccountArchiveResponse>;
|
|
32
|
+
}
|
|
33
|
+
export declare class V1UsageClient {
|
|
34
|
+
private readonly http;
|
|
35
|
+
constructor(http: V1HttpClient);
|
|
36
|
+
get(): Promise<V1AccountUsage>;
|
|
37
|
+
}
|
|
38
|
+
export declare class V1AccountClient {
|
|
39
|
+
readonly apiKeys: V1ApiKeysClient;
|
|
40
|
+
readonly subaccounts: V1SubaccountsClient;
|
|
41
|
+
readonly usage: V1UsageClient;
|
|
42
|
+
constructor(http: V1HttpClient);
|
|
43
|
+
}
|
package/dist/account.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { iterateV1Pages } from './pagination.js';
|
|
2
|
+
export class V1AuthClient {
|
|
3
|
+
http;
|
|
4
|
+
constructor(http) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
}
|
|
7
|
+
whoami() {
|
|
8
|
+
return this.http.request('/auth/whoami');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export class V1ApiKeysClient {
|
|
12
|
+
http;
|
|
13
|
+
constructor(http) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
}
|
|
16
|
+
list(query = {}) {
|
|
17
|
+
return this.http.request('/api-keys', { query });
|
|
18
|
+
}
|
|
19
|
+
iter(query = {}) {
|
|
20
|
+
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
21
|
+
}
|
|
22
|
+
create(request = {}) {
|
|
23
|
+
return this.http.request('/api-keys', {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
body: request,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
delete(keyId) {
|
|
29
|
+
return this.http.request(`/api-keys/${encodeURIComponent(keyId)}`, {
|
|
30
|
+
method: 'DELETE',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export class V1SubaccountUsageClient {
|
|
35
|
+
http;
|
|
36
|
+
constructor(http) {
|
|
37
|
+
this.http = http;
|
|
38
|
+
}
|
|
39
|
+
list(query = {}) {
|
|
40
|
+
return this.http.request('/subaccounts/usage', {
|
|
41
|
+
query,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
iter(query = {}) {
|
|
45
|
+
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class V1SubaccountsClient {
|
|
49
|
+
http;
|
|
50
|
+
usage;
|
|
51
|
+
constructor(http) {
|
|
52
|
+
this.http = http;
|
|
53
|
+
this.usage = new V1SubaccountUsageClient(http);
|
|
54
|
+
}
|
|
55
|
+
list(query = {}) {
|
|
56
|
+
return this.http.request('/subaccounts', { query });
|
|
57
|
+
}
|
|
58
|
+
iter(query = {}) {
|
|
59
|
+
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
60
|
+
}
|
|
61
|
+
create(request) {
|
|
62
|
+
return this.http.request('/subaccounts', {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
body: request,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
get(subaccountId, query = {}) {
|
|
68
|
+
return this.http.request(`/subaccounts/${encodeURIComponent(subaccountId)}`, {
|
|
69
|
+
query,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
update(subaccountId, request) {
|
|
73
|
+
return this.http.request(`/subaccounts/${encodeURIComponent(subaccountId)}`, {
|
|
74
|
+
method: 'PATCH',
|
|
75
|
+
body: request,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
archive(subaccountId) {
|
|
79
|
+
return this.http.request(`/subaccounts/${encodeURIComponent(subaccountId)}/archive`, { method: 'POST' });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export class V1UsageClient {
|
|
83
|
+
http;
|
|
84
|
+
constructor(http) {
|
|
85
|
+
this.http = http;
|
|
86
|
+
}
|
|
87
|
+
get() {
|
|
88
|
+
return this.http.request('/usage');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export class V1AccountClient {
|
|
92
|
+
apiKeys;
|
|
93
|
+
subaccounts;
|
|
94
|
+
usage;
|
|
95
|
+
constructor(http) {
|
|
96
|
+
this.apiKeys = new V1ApiKeysClient(http);
|
|
97
|
+
this.subaccounts = new V1SubaccountsClient(http);
|
|
98
|
+
this.usage = new V1UsageClient(http);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { JsonObject, V1ListEnvelope, V1PageQuery } from './types.js';
|
|
2
|
+
export type V1AuthScope = 'organization' | 'subaccount';
|
|
3
|
+
export type V1Plan = 'free' | 'developer' | 'business' | 'enterprise';
|
|
4
|
+
export interface V1AuthWhoamiResponse {
|
|
5
|
+
email: string | null;
|
|
6
|
+
scope: V1AuthScope;
|
|
7
|
+
organizationId: string;
|
|
8
|
+
subaccountId: string | null;
|
|
9
|
+
defaultSpaceId: string;
|
|
10
|
+
plan: V1Plan;
|
|
11
|
+
keyId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface V1ApiKey {
|
|
14
|
+
id: string;
|
|
15
|
+
keyKind: 'organization' | 'subaccount';
|
|
16
|
+
subaccountId: string | null;
|
|
17
|
+
name: string | null;
|
|
18
|
+
keyPrefix: string;
|
|
19
|
+
scopes: '*'[];
|
|
20
|
+
expiresAt: string | null;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
lastUsedAt: string | null;
|
|
24
|
+
usageCount: number;
|
|
25
|
+
}
|
|
26
|
+
export interface V1ApiKeyListQuery extends V1PageQuery {
|
|
27
|
+
subaccountId?: string;
|
|
28
|
+
keyKind?: V1ApiKey['keyKind'];
|
|
29
|
+
}
|
|
30
|
+
export interface V1ApiKeyCreateRequest {
|
|
31
|
+
name?: string;
|
|
32
|
+
subaccountId?: string;
|
|
33
|
+
scopes?: '*'[];
|
|
34
|
+
expiresAt?: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface V1ApiKeyCreateResponse {
|
|
37
|
+
data: V1ApiKey;
|
|
38
|
+
secret: string;
|
|
39
|
+
}
|
|
40
|
+
export interface V1ApiKeyDeleteResponse {
|
|
41
|
+
id: string;
|
|
42
|
+
deleted: true;
|
|
43
|
+
}
|
|
44
|
+
export interface V1AccountUsage {
|
|
45
|
+
organizationId: string;
|
|
46
|
+
isBlocked: boolean;
|
|
47
|
+
blockedReasons: string[];
|
|
48
|
+
cycle: {
|
|
49
|
+
startedAt: string | null;
|
|
50
|
+
endsAt: string | null;
|
|
51
|
+
};
|
|
52
|
+
credits: {
|
|
53
|
+
monthlyLimit: number;
|
|
54
|
+
monthlyUsed: number;
|
|
55
|
+
monthlyRemaining: number;
|
|
56
|
+
purchasedRemaining: number;
|
|
57
|
+
available: number;
|
|
58
|
+
outstandingDebt: number;
|
|
59
|
+
effectiveBalance: number;
|
|
60
|
+
breakdown: JsonObject;
|
|
61
|
+
};
|
|
62
|
+
computedAt: string;
|
|
63
|
+
}
|
|
64
|
+
export interface V1SubaccountLimits {
|
|
65
|
+
monthlyCredits?: number | null;
|
|
66
|
+
maxConcurrentRuntimes?: number | null;
|
|
67
|
+
maxRuntimeMinutes?: number | null;
|
|
68
|
+
}
|
|
69
|
+
export interface V1Subaccount {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
status: 'active' | 'archived';
|
|
73
|
+
externalId?: string | null;
|
|
74
|
+
metadata?: JsonObject | null;
|
|
75
|
+
archivedAt?: string | null;
|
|
76
|
+
defaultSpaceId: string;
|
|
77
|
+
limits: V1SubaccountLimits;
|
|
78
|
+
usage?: V1SubaccountUsage;
|
|
79
|
+
createdAt: string;
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
}
|
|
82
|
+
export interface V1SubaccountListQuery extends V1PageQuery {
|
|
83
|
+
status?: V1Subaccount['status'];
|
|
84
|
+
externalId?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface V1SubaccountCreateRequest {
|
|
87
|
+
name: string;
|
|
88
|
+
externalId?: string;
|
|
89
|
+
metadata?: JsonObject;
|
|
90
|
+
limits?: V1SubaccountLimits;
|
|
91
|
+
}
|
|
92
|
+
export interface V1SubaccountUpdateRequest {
|
|
93
|
+
name?: string;
|
|
94
|
+
externalId?: string | null;
|
|
95
|
+
metadata?: JsonObject | null;
|
|
96
|
+
limits?: V1SubaccountLimits;
|
|
97
|
+
}
|
|
98
|
+
export interface V1SubaccountGetQuery {
|
|
99
|
+
include?: 'usage' | 'usage'[];
|
|
100
|
+
}
|
|
101
|
+
export interface V1SubaccountArchiveResponse {
|
|
102
|
+
id: string;
|
|
103
|
+
archived: true;
|
|
104
|
+
}
|
|
105
|
+
export interface V1SubaccountUsage {
|
|
106
|
+
subaccountId: string;
|
|
107
|
+
isBlocked: boolean;
|
|
108
|
+
blockedReasons: string[];
|
|
109
|
+
cycle: {
|
|
110
|
+
startedAt: string | null;
|
|
111
|
+
endsAt: string | null;
|
|
112
|
+
};
|
|
113
|
+
credits: {
|
|
114
|
+
monthlyLimit: number;
|
|
115
|
+
monthlyUsed: number;
|
|
116
|
+
monthlyRemaining: number;
|
|
117
|
+
purchasedRemaining: number;
|
|
118
|
+
available: number;
|
|
119
|
+
breakdown: JsonObject;
|
|
120
|
+
};
|
|
121
|
+
computedAt: string;
|
|
122
|
+
}
|
|
123
|
+
export type V1SubaccountUsageListQuery = V1PageQuery & {
|
|
124
|
+
subaccountId?: string;
|
|
125
|
+
};
|
|
126
|
+
export type V1SubaccountUsageListResponse = V1ListEnvelope<V1SubaccountUsage>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { V1PageQuery } from './types.js';
|
|
2
|
+
export type V1AiProviderProvider = 'openai' | 'anthropic' | 'google' | 'groq' | 'deepseek' | 'mistral' | 'cerebras' | 'openrouter' | 'xai' | 'perplexity' | 'togetherai' | 'vercel-ai-gateway' | 'custom';
|
|
3
|
+
export type V1AiProviderStatus = 'enabled' | 'disabled';
|
|
4
|
+
export interface V1AiProviderModel {
|
|
5
|
+
id: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
inputModalities?: string[];
|
|
8
|
+
outputModalities?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface V1AiProvider {
|
|
11
|
+
id: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
provider: V1AiProviderProvider;
|
|
14
|
+
status: V1AiProviderStatus;
|
|
15
|
+
subaccountId?: string;
|
|
16
|
+
defaultModel?: string;
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
hasApiKey: boolean;
|
|
19
|
+
models?: V1AiProviderModel[];
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export interface V1AiProviderListQuery extends V1PageQuery {
|
|
24
|
+
provider?: V1AiProviderProvider;
|
|
25
|
+
status?: V1AiProviderStatus;
|
|
26
|
+
include?: 'models' | 'models'[];
|
|
27
|
+
subaccountId?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface V1AiProviderGetQuery {
|
|
30
|
+
include?: 'models' | 'models'[];
|
|
31
|
+
}
|
|
32
|
+
export interface V1AiProviderCreateRequest {
|
|
33
|
+
provider: V1AiProviderProvider;
|
|
34
|
+
name?: string;
|
|
35
|
+
apiKey?: string;
|
|
36
|
+
defaultModel?: string;
|
|
37
|
+
baseUrl?: string;
|
|
38
|
+
status?: V1AiProviderStatus;
|
|
39
|
+
subaccountId?: string | null;
|
|
40
|
+
test?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface V1AiProviderUpdateRequest {
|
|
43
|
+
name?: string;
|
|
44
|
+
apiKey?: string | null;
|
|
45
|
+
defaultModel?: string | null;
|
|
46
|
+
baseUrl?: string | null;
|
|
47
|
+
status?: V1AiProviderStatus;
|
|
48
|
+
}
|
|
49
|
+
export interface V1AiProviderDeleteResponse {
|
|
50
|
+
id: string;
|
|
51
|
+
deleted: true;
|
|
52
|
+
}
|
|
53
|
+
export interface V1AiProviderTestResponse {
|
|
54
|
+
ok: boolean;
|
|
55
|
+
checkedAt: string;
|
|
56
|
+
latencyMs?: number;
|
|
57
|
+
error?: string;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { V1HttpClient } from './http.js';
|
|
2
|
+
import type { V1AiProvider, V1AiProviderCreateRequest, V1AiProviderDeleteResponse, V1AiProviderGetQuery, V1AiProviderListQuery, V1AiProviderTestResponse, V1AiProviderUpdateRequest, V1ListEnvelope } from './types.js';
|
|
3
|
+
export declare class V1AiProvidersClient {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: V1HttpClient);
|
|
6
|
+
list(query?: V1AiProviderListQuery): Promise<V1ListEnvelope<V1AiProvider>>;
|
|
7
|
+
iter(query?: V1AiProviderListQuery): AsyncGenerator<V1AiProvider, void, undefined>;
|
|
8
|
+
create(request: V1AiProviderCreateRequest): Promise<V1AiProvider>;
|
|
9
|
+
get(aiProviderId: string, query?: V1AiProviderGetQuery): Promise<V1AiProvider>;
|
|
10
|
+
update(aiProviderId: string, request: V1AiProviderUpdateRequest): Promise<V1AiProvider>;
|
|
11
|
+
delete(aiProviderId: string): Promise<V1AiProviderDeleteResponse>;
|
|
12
|
+
test(aiProviderId: string): Promise<V1AiProviderTestResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { iterateV1Pages } from './pagination.js';
|
|
2
|
+
export class V1AiProvidersClient {
|
|
3
|
+
http;
|
|
4
|
+
constructor(http) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
}
|
|
7
|
+
list(query = {}) {
|
|
8
|
+
return this.http.request('/ai-providers', { query });
|
|
9
|
+
}
|
|
10
|
+
iter(query = {}) {
|
|
11
|
+
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return this.http.request('/ai-providers', {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
body: request,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
get(aiProviderId, query = {}) {
|
|
20
|
+
return this.http.request(`/ai-providers/${encodeURIComponent(aiProviderId)}`, {
|
|
21
|
+
query,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
update(aiProviderId, request) {
|
|
25
|
+
return this.http.request(`/ai-providers/${encodeURIComponent(aiProviderId)}`, {
|
|
26
|
+
method: 'PATCH',
|
|
27
|
+
body: request,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
delete(aiProviderId) {
|
|
31
|
+
return this.http.request(`/ai-providers/${encodeURIComponent(aiProviderId)}`, { method: 'DELETE' });
|
|
32
|
+
}
|
|
33
|
+
test(aiProviderId) {
|
|
34
|
+
return this.http.request(`/ai-providers/${encodeURIComponent(aiProviderId)}/test`, { method: 'POST' });
|
|
35
|
+
}
|
|
36
|
+
}
|
package/dist/bctrl.d.ts
CHANGED
|
@@ -1,23 +1,55 @@
|
|
|
1
|
+
import { V1AccountClient, V1ApiKeysClient, V1AuthClient, V1SubaccountsClient, V1UsageClient } from './account.js';
|
|
2
|
+
import { V1AiProvidersClient } from './aiProviders.js';
|
|
3
|
+
import { V1BrowserExtensionsClient } from './browserExtensions.js';
|
|
1
4
|
import { V1FilesClient } from './files.js';
|
|
5
|
+
import { V1HelpClient } from './help.js';
|
|
2
6
|
import { type V1ClientOptions } from './http.js';
|
|
3
|
-
import {
|
|
7
|
+
import { V1ProxiesClient } from './proxies.js';
|
|
4
8
|
import { V1RunsClient } from './runs.js';
|
|
5
9
|
import { V1RuntimesClient } from './runtimes.js';
|
|
6
10
|
import { V1SpacesClient } from './spaces.js';
|
|
11
|
+
import { V1ToolCallsClient } from './toolCalls.js';
|
|
12
|
+
import { V1ToolsClient } from './tools.js';
|
|
13
|
+
import { V1ToolsetsClient } from './toolsets.js';
|
|
14
|
+
import { V1VaultClient } from './vault.js';
|
|
7
15
|
export type BctrlV1Options = V1ClientOptions;
|
|
8
16
|
export declare class BctrlV1 {
|
|
9
17
|
private readonly http;
|
|
10
18
|
private _spaces;
|
|
11
19
|
private _runtimes;
|
|
12
20
|
private _runs;
|
|
13
|
-
private _invocations;
|
|
14
21
|
private _files;
|
|
22
|
+
private _help;
|
|
23
|
+
private _tools;
|
|
24
|
+
private _toolsets;
|
|
25
|
+
private _toolCalls;
|
|
26
|
+
private _vault;
|
|
27
|
+
private _proxies;
|
|
28
|
+
private _browserExtensions;
|
|
29
|
+
private _aiProviders;
|
|
30
|
+
private _account;
|
|
31
|
+
private _apiKeys;
|
|
32
|
+
private _auth;
|
|
33
|
+
private _subaccounts;
|
|
34
|
+
private _usage;
|
|
15
35
|
static isControllerBusy(error: unknown): boolean;
|
|
16
36
|
constructor(options?: BctrlV1Options);
|
|
17
37
|
get spaces(): V1SpacesClient;
|
|
18
38
|
get runtimes(): V1RuntimesClient;
|
|
19
39
|
get runs(): V1RunsClient;
|
|
20
|
-
get invocations(): V1InvocationsClient;
|
|
21
40
|
get files(): V1FilesClient;
|
|
41
|
+
get help(): V1HelpClient;
|
|
42
|
+
get tools(): V1ToolsClient;
|
|
43
|
+
get toolsets(): V1ToolsetsClient;
|
|
44
|
+
get toolCalls(): V1ToolCallsClient;
|
|
45
|
+
get vault(): V1VaultClient;
|
|
46
|
+
get proxies(): V1ProxiesClient;
|
|
47
|
+
get browserExtensions(): V1BrowserExtensionsClient;
|
|
48
|
+
get aiProviders(): V1AiProvidersClient;
|
|
49
|
+
get account(): V1AccountClient;
|
|
50
|
+
get apiKeys(): V1ApiKeysClient;
|
|
51
|
+
get auth(): V1AuthClient;
|
|
52
|
+
get subaccounts(): V1SubaccountsClient;
|
|
53
|
+
get usage(): V1UsageClient;
|
|
22
54
|
}
|
|
23
55
|
export { BctrlV1 as Bctrl };
|
package/dist/bctrl.js
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
|
+
import { V1AccountClient, V1ApiKeysClient, V1AuthClient, V1SubaccountsClient, V1UsageClient, } from './account.js';
|
|
2
|
+
import { V1AiProvidersClient } from './aiProviders.js';
|
|
3
|
+
import { V1BrowserExtensionsClient } from './browserExtensions.js';
|
|
1
4
|
import { isControllerBusy } from './errors.js';
|
|
2
5
|
import { V1FilesClient } from './files.js';
|
|
6
|
+
import { V1HelpClient } from './help.js';
|
|
3
7
|
import { V1HttpClient } from './http.js';
|
|
4
|
-
import {
|
|
8
|
+
import { V1ProxiesClient } from './proxies.js';
|
|
5
9
|
import { V1RunsClient } from './runs.js';
|
|
6
10
|
import { V1RuntimesClient } from './runtimes.js';
|
|
7
11
|
import { V1SpacesClient } from './spaces.js';
|
|
12
|
+
import { V1ToolCallsClient } from './toolCalls.js';
|
|
13
|
+
import { V1ToolsClient } from './tools.js';
|
|
14
|
+
import { V1ToolsetsClient } from './toolsets.js';
|
|
15
|
+
import { V1VaultClient } from './vault.js';
|
|
8
16
|
export class BctrlV1 {
|
|
9
17
|
http;
|
|
10
18
|
_spaces = null;
|
|
11
19
|
_runtimes = null;
|
|
12
20
|
_runs = null;
|
|
13
|
-
_invocations = null;
|
|
14
21
|
_files = null;
|
|
22
|
+
_help = null;
|
|
23
|
+
_tools = null;
|
|
24
|
+
_toolsets = null;
|
|
25
|
+
_toolCalls = null;
|
|
26
|
+
_vault = null;
|
|
27
|
+
_proxies = null;
|
|
28
|
+
_browserExtensions = null;
|
|
29
|
+
_aiProviders = null;
|
|
30
|
+
_account = null;
|
|
31
|
+
_apiKeys = null;
|
|
32
|
+
_auth = null;
|
|
33
|
+
_subaccounts = null;
|
|
34
|
+
_usage = null;
|
|
15
35
|
static isControllerBusy(error) {
|
|
16
36
|
return isControllerBusy(error);
|
|
17
37
|
}
|
|
@@ -30,13 +50,61 @@ export class BctrlV1 {
|
|
|
30
50
|
this._runs ??= new V1RunsClient(this.http);
|
|
31
51
|
return this._runs;
|
|
32
52
|
}
|
|
33
|
-
get invocations() {
|
|
34
|
-
this._invocations ??= new V1InvocationsClient(this.http);
|
|
35
|
-
return this._invocations;
|
|
36
|
-
}
|
|
37
53
|
get files() {
|
|
38
54
|
this._files ??= new V1FilesClient(this.http);
|
|
39
55
|
return this._files;
|
|
40
56
|
}
|
|
57
|
+
get help() {
|
|
58
|
+
this._help ??= new V1HelpClient(this.http);
|
|
59
|
+
return this._help;
|
|
60
|
+
}
|
|
61
|
+
get tools() {
|
|
62
|
+
this._tools ??= new V1ToolsClient(this.http);
|
|
63
|
+
return this._tools;
|
|
64
|
+
}
|
|
65
|
+
get toolsets() {
|
|
66
|
+
this._toolsets ??= new V1ToolsetsClient(this.http);
|
|
67
|
+
return this._toolsets;
|
|
68
|
+
}
|
|
69
|
+
get toolCalls() {
|
|
70
|
+
this._toolCalls ??= new V1ToolCallsClient(this.http);
|
|
71
|
+
return this._toolCalls;
|
|
72
|
+
}
|
|
73
|
+
get vault() {
|
|
74
|
+
this._vault ??= new V1VaultClient(this.http);
|
|
75
|
+
return this._vault;
|
|
76
|
+
}
|
|
77
|
+
get proxies() {
|
|
78
|
+
this._proxies ??= new V1ProxiesClient(this.http);
|
|
79
|
+
return this._proxies;
|
|
80
|
+
}
|
|
81
|
+
get browserExtensions() {
|
|
82
|
+
this._browserExtensions ??= new V1BrowserExtensionsClient(this.http);
|
|
83
|
+
return this._browserExtensions;
|
|
84
|
+
}
|
|
85
|
+
get aiProviders() {
|
|
86
|
+
this._aiProviders ??= new V1AiProvidersClient(this.http);
|
|
87
|
+
return this._aiProviders;
|
|
88
|
+
}
|
|
89
|
+
get account() {
|
|
90
|
+
this._account ??= new V1AccountClient(this.http);
|
|
91
|
+
return this._account;
|
|
92
|
+
}
|
|
93
|
+
get apiKeys() {
|
|
94
|
+
this._apiKeys ??= new V1ApiKeysClient(this.http);
|
|
95
|
+
return this._apiKeys;
|
|
96
|
+
}
|
|
97
|
+
get auth() {
|
|
98
|
+
this._auth ??= new V1AuthClient(this.http);
|
|
99
|
+
return this._auth;
|
|
100
|
+
}
|
|
101
|
+
get subaccounts() {
|
|
102
|
+
this._subaccounts ??= new V1SubaccountsClient(this.http);
|
|
103
|
+
return this._subaccounts;
|
|
104
|
+
}
|
|
105
|
+
get usage() {
|
|
106
|
+
this._usage ??= new V1UsageClient(this.http);
|
|
107
|
+
return this._usage;
|
|
108
|
+
}
|
|
41
109
|
}
|
|
42
110
|
export { BctrlV1 as Bctrl };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { V1PageQuery } from './types.js';
|
|
2
|
+
export type V1BrowserExtensionFormat = 'crx';
|
|
3
|
+
export type V1BrowserExtensionSource = 'upload' | 'url';
|
|
4
|
+
export interface V1BrowserExtension {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
format: V1BrowserExtensionFormat;
|
|
9
|
+
subaccountId?: string;
|
|
10
|
+
sourceUrl?: string;
|
|
11
|
+
sizeBytes?: number;
|
|
12
|
+
contentHash?: string;
|
|
13
|
+
profileCount: number;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export interface V1BrowserExtensionListQuery extends V1PageQuery {
|
|
18
|
+
subaccountId?: string;
|
|
19
|
+
q?: string;
|
|
20
|
+
format?: V1BrowserExtensionFormat;
|
|
21
|
+
source?: V1BrowserExtensionSource;
|
|
22
|
+
}
|
|
23
|
+
export interface V1BrowserExtensionUploadRequest {
|
|
24
|
+
/** Packed Chromium extension package. Only .crx is supported today. */
|
|
25
|
+
file: Blob;
|
|
26
|
+
/** Optional display name. Defaults to manifest.name. */
|
|
27
|
+
name?: string;
|
|
28
|
+
/** Parent/org keys may create inside a child subaccount. */
|
|
29
|
+
subaccountId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface V1BrowserExtensionImportRequest {
|
|
32
|
+
/** Chrome Web Store detail URL. */
|
|
33
|
+
url: string;
|
|
34
|
+
/** Optional display name. Defaults to manifest.name. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** Parent/org keys may create inside a child subaccount. */
|
|
37
|
+
subaccountId?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface V1BrowserExtensionUpdateRequest {
|
|
40
|
+
name: string;
|
|
41
|
+
}
|
|
42
|
+
export interface V1BrowserExtensionDeleteResponse {
|
|
43
|
+
id: string;
|
|
44
|
+
deleted: true;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { V1HttpClient } from './http.js';
|
|
2
|
+
import type { V1BrowserExtension, V1BrowserExtensionDeleteResponse, V1BrowserExtensionImportRequest, V1BrowserExtensionListQuery, V1BrowserExtensionUpdateRequest, V1BrowserExtensionUploadRequest } from './browserExtensionTypes.js';
|
|
3
|
+
import type { V1ListEnvelope } from './types.js';
|
|
4
|
+
export declare class V1BrowserExtensionsClient {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: V1HttpClient);
|
|
7
|
+
list(query?: V1BrowserExtensionListQuery): Promise<V1ListEnvelope<V1BrowserExtension>>;
|
|
8
|
+
iter(query?: V1BrowserExtensionListQuery): AsyncGenerator<V1BrowserExtension, void, undefined>;
|
|
9
|
+
get(extensionId: string): Promise<V1BrowserExtension>;
|
|
10
|
+
upload(request: V1BrowserExtensionUploadRequest): Promise<V1BrowserExtension>;
|
|
11
|
+
import(request: V1BrowserExtensionImportRequest): Promise<V1BrowserExtension>;
|
|
12
|
+
update(extensionId: string, request: V1BrowserExtensionUpdateRequest): Promise<V1BrowserExtension>;
|
|
13
|
+
delete(extensionId: string): Promise<V1BrowserExtensionDeleteResponse>;
|
|
14
|
+
}
|