@bctrl/sdk 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +72 -72
  2. package/dist/account.d.ts +43 -0
  3. package/dist/account.js +100 -0
  4. package/dist/accountTypes.d.ts +126 -0
  5. package/dist/accountTypes.js +1 -0
  6. package/dist/ai.d.ts +23 -0
  7. package/dist/ai.js +51 -0
  8. package/dist/aiTypes.d.ts +97 -0
  9. package/dist/aiTypes.js +1 -0
  10. package/dist/bctrl.d.ts +35 -3
  11. package/dist/bctrl.js +74 -6
  12. package/dist/browserExtensionTypes.d.ts +45 -0
  13. package/dist/browserExtensionTypes.js +1 -0
  14. package/dist/browserExtensions.d.ts +14 -0
  15. package/dist/browserExtensions.js +53 -0
  16. package/dist/files.d.ts +6 -24
  17. package/dist/files.js +9 -56
  18. package/dist/help.d.ts +7 -0
  19. package/dist/help.js +9 -0
  20. package/dist/http.d.ts +12 -1
  21. package/dist/http.js +73 -10
  22. package/dist/index.d.ts +17 -6
  23. package/dist/index.js +15 -5
  24. package/dist/invocations.d.ts +83 -48
  25. package/dist/invocations.js +141 -102
  26. package/dist/node.d.ts +12 -0
  27. package/dist/node.js +11 -0
  28. package/dist/proxies.d.ts +21 -0
  29. package/dist/proxies.js +55 -0
  30. package/dist/proxyTypes.d.ts +119 -0
  31. package/dist/proxyTypes.js +1 -0
  32. package/dist/runs.d.ts +35 -31
  33. package/dist/runs.js +95 -38
  34. package/dist/runtimes.d.ts +41 -40
  35. package/dist/runtimes.js +115 -61
  36. package/dist/schemas.d.ts +7 -0
  37. package/dist/schemas.js +36 -0
  38. package/dist/spaces.d.ts +20 -32
  39. package/dist/spaces.js +48 -36
  40. package/dist/toolCallTypes.d.ts +41 -0
  41. package/dist/toolCallTypes.js +1 -0
  42. package/dist/toolCalls.d.ts +9 -0
  43. package/dist/toolCalls.js +16 -0
  44. package/dist/tools.d.ts +23 -0
  45. package/dist/tools.js +49 -0
  46. package/dist/toolsetTypes.d.ts +32 -0
  47. package/dist/toolsetTypes.js +1 -0
  48. package/dist/toolsets.d.ts +12 -0
  49. package/dist/toolsets.js +31 -0
  50. package/dist/types.d.ts +586 -167
  51. package/dist/utils.d.ts +2 -1
  52. package/dist/utils.js +28 -3
  53. package/dist/vault.d.ts +14 -0
  54. package/dist/vault.js +37 -0
  55. package/dist/vaultTypes.d.ts +73 -0
  56. package/dist/vaultTypes.js +1 -0
  57. package/package.json +46 -37
package/README.md CHANGED
@@ -1,72 +1,72 @@
1
- # @bctrl/sdk
2
-
3
- TypeScript SDK for BCTRL v1 spaces, browser runtimes, invocations, runs, and files.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install @bctrl/sdk
9
- ```
10
-
11
- Node 18+ is required.
12
-
13
- ## Quick start
14
-
15
- ```ts
16
- import { Bctrl } from '@bctrl/sdk';
17
-
18
- const bctrl = new Bctrl({
19
- apiKey: process.env.BCTRL_API_KEY!,
20
- });
21
-
22
- const space = await bctrl.spaces.create({
23
- name: 'my-task',
24
- region: 'us-east-1',
25
- });
26
-
27
- const createdRuntime = await space.runtimes.create({
28
- type: 'browser',
29
- name: 'browser-task',
30
- config: {
31
- profile: false,
32
- },
33
- });
34
- const started = await createdRuntime.start();
35
- console.log(started.run.id, started.browser.cdpUrl);
36
-
37
- const invocation = await started.runtime.invocations.create({
38
- provider: 'stagehand',
39
- method: 'act',
40
- input: { instruction: 'Open https://example.com' },
41
- });
42
-
43
- const result = await invocation.wait({ timeoutMs: 60_000 });
44
- console.log(result.data.status);
45
- ```
46
-
47
- The public SDK targets `https://api.bctrl.ai/v1`. For local development, pass a
48
- local origin or v1 base URL:
49
-
50
- ```ts
51
- const bctrl = new Bctrl({
52
- apiKey: process.env.BCTRL_API_KEY!,
53
- baseUrl: 'http://localhost:8787',
54
- });
55
- ```
56
-
57
- `baseUrl` may include or omit `/v1`; the client normalizes either form.
58
-
59
- ## Entry points
60
-
61
- - `@bctrl/sdk`: v1 client, resources, errors, and public types
62
-
63
- ## Documentation
64
-
65
- - SDK reference: https://platform.bctrl.ai/api-reference/sdk/overview
66
- - Product site: https://bctrl.ai
67
-
68
- ## Telemetry
69
-
70
- The published SDK does not include vendor-owned telemetry or usage analytics.
71
-
72
- If you want observability around SDK calls, instrument your application directly with your own logging or error tracking.
1
+ # @bctrl/sdk
2
+
3
+ TypeScript SDK for BCTRL v1 spaces, browser runtimes, invocations, runs, and files.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @bctrl/sdk
9
+ ```
10
+
11
+ Node 18+ is required.
12
+
13
+ ## Quick start
14
+
15
+ ```ts
16
+ import { Bctrl } from '@bctrl/sdk';
17
+ import { z } from 'zod';
18
+
19
+ const bctrl = new Bctrl({
20
+ apiKey: process.env.BCTRL_API_KEY!,
21
+ });
22
+
23
+ const runtime = await bctrl.runtimes.create({
24
+ type: 'browser',
25
+ name: 'browser-task',
26
+ });
27
+ const started = await bctrl.runtimes.start(runtime.id);
28
+ console.log(started.runId, started.connectUrl);
29
+
30
+ const invocation = await bctrl.runtimes.invocations.createAndWait(
31
+ started.runtimeId,
32
+ {
33
+ action: 'extract',
34
+ instruction: 'Extract the page title.',
35
+ schema: z.object({
36
+ title: z.string(),
37
+ }),
38
+ },
39
+ { timeoutMs: 60_000 }
40
+ );
41
+
42
+ console.log(invocation.status, invocation.output);
43
+
44
+ await bctrl.runtimes.stop(started.runtimeId);
45
+ ```
46
+
47
+ The public SDK targets `https://api.bctrl.ai/v1`. For local development, pass a
48
+ local origin or v1 base URL:
49
+
50
+ ```ts
51
+ const bctrl = new Bctrl({
52
+ apiKey: process.env.BCTRL_API_KEY!,
53
+ baseUrl: 'http://localhost:8787',
54
+ });
55
+ ```
56
+
57
+ `baseUrl` may include or omit `/v1`; the client normalizes either form.
58
+
59
+ ## Entry points
60
+
61
+ - `@bctrl/sdk`: v1 client, resources, errors, and public types
62
+
63
+ ## Documentation
64
+
65
+ - SDK reference: https://platform.bctrl.ai/api-reference/sdk/overview
66
+ - Product site: https://bctrl.ai
67
+
68
+ ## Telemetry
69
+
70
+ The published SDK does not include vendor-owned telemetry or usage analytics.
71
+
72
+ If you want observability around SDK calls, instrument your application directly with your own logging or error tracking.
@@ -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
+ }
@@ -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 {};
package/dist/ai.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import type { V1HttpClient } from './http.js';
2
+ import type { V1AiCredential, V1AiCredentialCreateRequest, V1AiCredentialDeleteResponse, V1AiCredentialListQuery, V1AiCredentialTestResponse, V1AiCredentialUpdateRequest, V1AiModelListQuery, V1AiModelListResponse, V1ListEnvelope } from './types.js';
3
+ export declare class V1AiModelsClient {
4
+ private readonly http;
5
+ constructor(http: V1HttpClient);
6
+ list(query?: V1AiModelListQuery): Promise<V1AiModelListResponse>;
7
+ }
8
+ export declare class V1AiCredentialsClient {
9
+ private readonly http;
10
+ constructor(http: V1HttpClient);
11
+ list(query?: V1AiCredentialListQuery): Promise<V1ListEnvelope<V1AiCredential>>;
12
+ iter(query?: V1AiCredentialListQuery): AsyncGenerator<V1AiCredential, void, undefined>;
13
+ create(request: V1AiCredentialCreateRequest): Promise<V1AiCredential>;
14
+ get(credentialId: string): Promise<V1AiCredential>;
15
+ update(credentialId: string, request: V1AiCredentialUpdateRequest): Promise<V1AiCredential>;
16
+ delete(credentialId: string): Promise<V1AiCredentialDeleteResponse>;
17
+ test(credentialId: string): Promise<V1AiCredentialTestResponse>;
18
+ }
19
+ export declare class V1AiClient {
20
+ readonly models: V1AiModelsClient;
21
+ readonly credentials: V1AiCredentialsClient;
22
+ constructor(http: V1HttpClient);
23
+ }
package/dist/ai.js ADDED
@@ -0,0 +1,51 @@
1
+ import { iterateV1Pages } from './pagination.js';
2
+ export class V1AiModelsClient {
3
+ http;
4
+ constructor(http) {
5
+ this.http = http;
6
+ }
7
+ list(query = {}) {
8
+ return this.http.request('/ai/models', { query });
9
+ }
10
+ }
11
+ export class V1AiCredentialsClient {
12
+ http;
13
+ constructor(http) {
14
+ this.http = http;
15
+ }
16
+ list(query = {}) {
17
+ return this.http.request('/ai/credentials', { query });
18
+ }
19
+ iter(query = {}) {
20
+ return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
21
+ }
22
+ create(request) {
23
+ return this.http.request('/ai/credentials', {
24
+ method: 'POST',
25
+ body: request,
26
+ });
27
+ }
28
+ get(credentialId) {
29
+ return this.http.request(`/ai/credentials/${encodeURIComponent(credentialId)}`);
30
+ }
31
+ update(credentialId, request) {
32
+ return this.http.request(`/ai/credentials/${encodeURIComponent(credentialId)}`, {
33
+ method: 'PATCH',
34
+ body: request,
35
+ });
36
+ }
37
+ delete(credentialId) {
38
+ return this.http.request(`/ai/credentials/${encodeURIComponent(credentialId)}`, { method: 'DELETE' });
39
+ }
40
+ test(credentialId) {
41
+ return this.http.request(`/ai/credentials/${encodeURIComponent(credentialId)}/test`, { method: 'POST' });
42
+ }
43
+ }
44
+ export class V1AiClient {
45
+ models;
46
+ credentials;
47
+ constructor(http) {
48
+ this.models = new V1AiModelsClient(http);
49
+ this.credentials = new V1AiCredentialsClient(http);
50
+ }
51
+ }
@@ -0,0 +1,97 @@
1
+ import type { JsonObject, V1PageQuery } from './types.js';
2
+ export type V1AiCredentialProvider = 'openai' | 'anthropic' | 'google' | 'azure' | 'groq' | 'deepseek' | 'mistral' | 'cerebras' | 'openrouter' | 'xai' | 'perplexity' | 'togetherai' | 'vercel-ai-gateway' | 'custom';
3
+ export type V1AiModelStatus = 'recommended' | 'supported' | 'experimental';
4
+ export type V1AiModelEngine = 'stagehand' | 'browserUse';
5
+ export interface V1AiModel {
6
+ id: string;
7
+ provider: V1AiCredentialProvider;
8
+ displayName: string;
9
+ managed: boolean;
10
+ status: V1AiModelStatus;
11
+ engines: V1AiModelEngine[];
12
+ supportsTools: boolean;
13
+ supportsVision: boolean;
14
+ supportsStructuredOutput: boolean;
15
+ supportsReasoningEffort: boolean;
16
+ supportsThinkingBudget: boolean;
17
+ }
18
+ export interface V1AiModelListQuery {
19
+ provider?: V1AiCredentialProvider;
20
+ status?: V1AiModelStatus;
21
+ managed?: boolean;
22
+ engine?: V1AiModelEngine;
23
+ }
24
+ export interface V1AiModelListResponse {
25
+ data: V1AiModel[];
26
+ }
27
+ export type V1AiCredentialStatus = 'enabled' | 'disabled';
28
+ export interface V1AiCredential {
29
+ id: string;
30
+ name: string;
31
+ provider: V1AiCredentialProvider;
32
+ status: V1AiCredentialStatus;
33
+ subaccountId?: string;
34
+ defaultModel?: string;
35
+ baseUrl?: string;
36
+ hasApiKey: boolean;
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ }
40
+ export interface V1AiCredentialListQuery extends V1PageQuery {
41
+ provider?: V1AiCredentialProvider;
42
+ name?: string;
43
+ status?: V1AiCredentialStatus;
44
+ }
45
+ export interface V1AiCredentialCreateRequest {
46
+ provider: V1AiCredentialProvider;
47
+ name?: string;
48
+ apiKey?: string;
49
+ defaultModel?: string;
50
+ baseUrl?: string;
51
+ status?: V1AiCredentialStatus;
52
+ subaccountId?: string | null;
53
+ test?: boolean;
54
+ }
55
+ export interface V1AiCredentialUpdateRequest {
56
+ name?: string;
57
+ apiKey?: string | null;
58
+ defaultModel?: string | null;
59
+ baseUrl?: string | null;
60
+ status?: V1AiCredentialStatus;
61
+ }
62
+ export interface V1AiCredentialDeleteResponse {
63
+ id: string;
64
+ deleted: true;
65
+ }
66
+ export interface V1AiCredentialTestResponse {
67
+ ok: boolean;
68
+ checkedAt: string;
69
+ latencyMs?: number;
70
+ error?: string;
71
+ }
72
+ export type V1AiModelSelectionAuth = 'managed' | {
73
+ credential: string;
74
+ } | {
75
+ apiKey: string;
76
+ };
77
+ export interface V1AiModelSelectionObject {
78
+ model: string;
79
+ auth?: V1AiModelSelectionAuth;
80
+ provider?: V1AiCredentialProvider;
81
+ baseUrl?: string;
82
+ temperature?: number;
83
+ maxTokens?: number;
84
+ topP?: number;
85
+ reasoningEffort?: 'none' | 'low' | 'medium' | 'high' | 'xhigh';
86
+ thinkingBudgetTokens?: number;
87
+ responseFormat?: 'text' | 'json';
88
+ responseSchema?: JsonObject;
89
+ providerOptions?: JsonObject;
90
+ }
91
+ export type V1AiModelSelection = string | V1AiModelSelectionObject;
92
+ export type V1AiStoredModelSelectionAuth = 'managed' | {
93
+ credential: string;
94
+ };
95
+ export type V1AiStoredModelSelection = string | (Omit<V1AiModelSelectionObject, 'auth' | 'baseUrl'> & {
96
+ auth?: V1AiStoredModelSelectionAuth;
97
+ });
@@ -0,0 +1 @@
1
+ export {};
package/dist/bctrl.d.ts CHANGED
@@ -1,23 +1,55 @@
1
+ import { V1AccountClient, V1ApiKeysClient, V1AuthClient, V1SubaccountsClient, V1UsageClient } from './account.js';
2
+ import { V1AiClient } from './ai.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 { V1InvocationsClient } from './invocations.js';
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 _ai;
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 ai(): V1AiClient;
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 };