@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
package/dist/runs.js
CHANGED
|
@@ -1,75 +1,22 @@
|
|
|
1
|
-
import { v1IdempotencyHeaders } from './http.js';
|
|
2
1
|
import { iterateV1Pages } from './pagination.js';
|
|
3
|
-
|
|
4
|
-
http;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.runId = runId;
|
|
9
|
-
}
|
|
10
|
-
list(query = {}) {
|
|
11
|
-
return this.http.request(`/runs/${encodeURIComponent(this.runId)}/events`, { query });
|
|
12
|
-
}
|
|
13
|
-
iter(query = {}) {
|
|
14
|
-
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
15
|
-
}
|
|
16
|
-
streamUrl(query = {}) {
|
|
17
|
-
const url = new URL(`${this.http.baseUrl}/runs/${encodeURIComponent(this.runId)}/events/stream`);
|
|
18
|
-
for (const [key, value] of Object.entries(query)) {
|
|
19
|
-
if (value === undefined)
|
|
20
|
-
continue;
|
|
21
|
-
if (Array.isArray(value)) {
|
|
22
|
-
for (const item of value)
|
|
23
|
-
url.searchParams.append(key, item);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
url.searchParams.set(key, value);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return url.toString();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
class V1RunActivityClient {
|
|
33
|
-
http;
|
|
34
|
-
runId;
|
|
35
|
-
constructor(http, runId) {
|
|
36
|
-
this.http = http;
|
|
37
|
-
this.runId = runId;
|
|
38
|
-
}
|
|
39
|
-
list(query = {}) {
|
|
40
|
-
return this.http.request(`/runs/${encodeURIComponent(this.runId)}/activity`, { query });
|
|
41
|
-
}
|
|
42
|
-
iter(query = {}) {
|
|
43
|
-
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
44
|
-
}
|
|
45
|
-
streamUrl(query = {}) {
|
|
46
|
-
const url = new URL(`${this.http.baseUrl}/runs/${encodeURIComponent(this.runId)}/activity/stream`);
|
|
47
|
-
for (const [key, value] of Object.entries(query)) {
|
|
48
|
-
if (value === undefined)
|
|
49
|
-
continue;
|
|
50
|
-
if (Array.isArray(value)) {
|
|
51
|
-
for (const item of value)
|
|
52
|
-
url.searchParams.append(key, String(item));
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
url.searchParams.set(key, String(value));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return url.toString();
|
|
2
|
+
function streamUrl(http, runId, query) {
|
|
3
|
+
const url = new URL(`${http.baseUrl}/runs/${encodeURIComponent(runId)}/stream`);
|
|
4
|
+
for (const [key, value] of Object.entries(query)) {
|
|
5
|
+
if (value !== undefined)
|
|
6
|
+
url.searchParams.set(key, String(value));
|
|
59
7
|
}
|
|
8
|
+
return url.toString();
|
|
60
9
|
}
|
|
61
10
|
export class V1RunsClient {
|
|
62
11
|
http;
|
|
63
12
|
events;
|
|
64
|
-
|
|
13
|
+
trace;
|
|
65
14
|
files;
|
|
66
|
-
invocations;
|
|
67
15
|
constructor(http) {
|
|
68
16
|
this.http = http;
|
|
69
17
|
this.events = new V1RunEventsNamespaceClient(http);
|
|
70
|
-
this.
|
|
18
|
+
this.trace = new V1RunTraceNamespaceClient(http);
|
|
71
19
|
this.files = new V1RunFilesNamespaceClient(http);
|
|
72
|
-
this.invocations = new V1RunInvocationsNamespaceClient(http);
|
|
73
20
|
}
|
|
74
21
|
list(query = {}) {
|
|
75
22
|
return this.http.request('/runs', { query });
|
|
@@ -77,23 +24,14 @@ export class V1RunsClient {
|
|
|
77
24
|
iter(query = {}) {
|
|
78
25
|
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
79
26
|
}
|
|
80
|
-
get(
|
|
81
|
-
return this.http.request(`/runs/${encodeURIComponent(
|
|
82
|
-
}
|
|
83
|
-
usage(id) {
|
|
84
|
-
return this.http.request(`/runs/${encodeURIComponent(id)}/usage`);
|
|
27
|
+
get(runId, query = {}) {
|
|
28
|
+
return this.http.request(`/runs/${encodeURIComponent(runId)}`, { query });
|
|
85
29
|
}
|
|
86
|
-
|
|
87
|
-
return this.http
|
|
88
|
-
method: 'POST',
|
|
89
|
-
body: request ?? {},
|
|
90
|
-
});
|
|
30
|
+
streamUrl(runId, query = {}) {
|
|
31
|
+
return streamUrl(this.http, runId, query);
|
|
91
32
|
}
|
|
92
|
-
|
|
93
|
-
return this.http.
|
|
94
|
-
method: 'POST',
|
|
95
|
-
body: request ?? {},
|
|
96
|
-
});
|
|
33
|
+
stream(runId, query = {}, options = {}) {
|
|
34
|
+
return this.http.streamSse(`/runs/${encodeURIComponent(runId)}/stream`, { query, signal: options.signal });
|
|
97
35
|
}
|
|
98
36
|
}
|
|
99
37
|
export class V1RunEventsNamespaceClient {
|
|
@@ -102,61 +40,30 @@ export class V1RunEventsNamespaceClient {
|
|
|
102
40
|
this.http = http;
|
|
103
41
|
}
|
|
104
42
|
list(runId, query = {}) {
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
iter(runId, query = {}) {
|
|
108
|
-
return new V1RunEventsClient(this.http, runId).iter(query);
|
|
109
|
-
}
|
|
110
|
-
streamUrl(runId, query = {}) {
|
|
111
|
-
return new V1RunEventsClient(this.http, runId).streamUrl(query);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export class V1RunActivityNamespaceClient {
|
|
115
|
-
http;
|
|
116
|
-
constructor(http) {
|
|
117
|
-
this.http = http;
|
|
118
|
-
}
|
|
119
|
-
list(runId, query = {}) {
|
|
120
|
-
return new V1RunActivityClient(this.http, runId).list(query);
|
|
43
|
+
return this.http.request(`/runs/${encodeURIComponent(runId)}/events`, { query });
|
|
121
44
|
}
|
|
122
45
|
iter(runId, query = {}) {
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
streamUrl(runId, query = {}) {
|
|
126
|
-
return new V1RunActivityClient(this.http, runId).streamUrl(query);
|
|
46
|
+
return iterateV1Pages(query, (pageQuery) => this.list(runId, pageQuery));
|
|
127
47
|
}
|
|
128
48
|
}
|
|
129
|
-
export class
|
|
49
|
+
export class V1RunTraceNamespaceClient {
|
|
130
50
|
http;
|
|
131
51
|
constructor(http) {
|
|
132
52
|
this.http = http;
|
|
133
53
|
}
|
|
134
54
|
list(runId, query = {}) {
|
|
135
|
-
return this.http.request(`/runs/${encodeURIComponent(runId)}/
|
|
55
|
+
return this.http.request(`/runs/${encodeURIComponent(runId)}/trace`, { query });
|
|
136
56
|
}
|
|
137
57
|
iter(runId, query = {}) {
|
|
138
58
|
return iterateV1Pages(query, (pageQuery) => this.list(runId, pageQuery));
|
|
139
59
|
}
|
|
140
|
-
export(runId, request = {}, options) {
|
|
141
|
-
return this.http.request(`/runs/${encodeURIComponent(runId)}/files/export`, {
|
|
142
|
-
method: 'POST',
|
|
143
|
-
body: request,
|
|
144
|
-
headers: v1IdempotencyHeaders(options),
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
60
|
}
|
|
148
|
-
export class
|
|
61
|
+
export class V1RunFilesNamespaceClient {
|
|
149
62
|
http;
|
|
150
63
|
constructor(http) {
|
|
151
64
|
this.http = http;
|
|
152
65
|
}
|
|
153
|
-
list(runId
|
|
154
|
-
return this.http.request(`/runs/${encodeURIComponent(runId)}/
|
|
155
|
-
}
|
|
156
|
-
iter(runId, query = {}) {
|
|
157
|
-
return iterateV1Pages(query, (pageQuery) => this.list(runId, pageQuery));
|
|
158
|
-
}
|
|
159
|
-
get(runId, invocationId) {
|
|
160
|
-
return this.http.request(`/runs/${encodeURIComponent(runId)}/invocations/${encodeURIComponent(invocationId)}`);
|
|
66
|
+
list(runId) {
|
|
67
|
+
return this.http.request(`/runs/${encodeURIComponent(runId)}/files`);
|
|
161
68
|
}
|
|
162
69
|
}
|
package/dist/runtimes.d.ts
CHANGED
|
@@ -1,61 +1,19 @@
|
|
|
1
1
|
import { type V1HttpClient, type V1IdempotencyOptions } from './http.js';
|
|
2
|
-
import {
|
|
3
|
-
import type { V1ListEnvelope, V1File, V1HumanAction, V1HumanActionCreateRequest, V1HumanActionWaitRequest, V1HumanActionWaitResponse, V1Runtime, V1RuntimeCreateRequest, V1RuntimeDeleteResponse, V1RuntimeFileCollectRequest, V1RuntimeFilesListQuery, V1RuntimeFileStageRequest, V1RuntimeFileUploadRequest, V1RuntimeStagedFile, V1RuntimeListQuery, V1RuntimeRunListQuery, V1RuntimeStartResponse, V1RuntimeStopResponse, V1RuntimeTarget, V1RuntimeTargetCreateRequest, V1RuntimeUpdateRequest, V1RunSummary, V1SpaceRuntimeCreateRequest } from './types.js';
|
|
2
|
+
import type { V1ListEnvelope, V1Runtime, V1RuntimeCreateRequest, V1RuntimeCreateResponse, V1RuntimeDeleteResponse, V1RuntimeGetQuery, V1RuntimeListQuery, V1RuntimeStartResponse, V1RuntimeStopResponse, V1RuntimeSummary, V1RuntimeUpdateRequest } from './types.js';
|
|
4
3
|
export type V1RuntimeStartResult = V1RuntimeStartResponse;
|
|
5
4
|
export declare class V1RuntimesClient {
|
|
6
5
|
private readonly http;
|
|
7
|
-
readonly files: V1RuntimeFilesNamespaceClient;
|
|
8
|
-
readonly runs: V1RuntimeRunsNamespaceClient;
|
|
9
|
-
readonly invocations: V1RuntimeInvocationsNamespaceClient;
|
|
10
|
-
readonly targets: V1RuntimeTargetsNamespaceClient;
|
|
11
|
-
readonly humanAction: V1RuntimeHumanActionsNamespaceClient;
|
|
12
|
-
readonly humanActions: V1RuntimeHumanActionsNamespaceClient;
|
|
13
6
|
constructor(http: V1HttpClient);
|
|
14
|
-
list(query?: V1RuntimeListQuery): Promise<V1ListEnvelope<
|
|
15
|
-
iter(query?: V1RuntimeListQuery): AsyncGenerator<
|
|
16
|
-
create(request: V1RuntimeCreateRequest): Promise<
|
|
17
|
-
|
|
18
|
-
update(
|
|
19
|
-
delete(
|
|
7
|
+
list(query?: V1RuntimeListQuery): Promise<V1ListEnvelope<V1RuntimeSummary>>;
|
|
8
|
+
iter(query?: V1RuntimeListQuery): AsyncGenerator<V1RuntimeSummary, void, undefined>;
|
|
9
|
+
create(request: V1RuntimeCreateRequest, options?: V1IdempotencyOptions): Promise<V1RuntimeCreateResponse>;
|
|
10
|
+
get(runtimeId: string, query?: V1RuntimeGetQuery): Promise<V1Runtime>;
|
|
11
|
+
update(runtimeId: string, request: V1RuntimeUpdateRequest): Promise<V1Runtime>;
|
|
12
|
+
delete(runtimeId: string, options?: {
|
|
20
13
|
force?: boolean;
|
|
21
14
|
}): Promise<V1RuntimeDeleteResponse>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare class V1RuntimeRunsNamespaceClient {
|
|
27
|
-
private readonly http;
|
|
28
|
-
constructor(http: V1HttpClient);
|
|
29
|
-
list(runtimeId: string, query?: V1RuntimeRunListQuery): Promise<V1ListEnvelope<V1RunSummary>>;
|
|
30
|
-
iter(runtimeId: string, query?: V1RuntimeRunListQuery): AsyncGenerator<V1RunSummary, void, undefined>;
|
|
31
|
-
}
|
|
32
|
-
export declare class V1RuntimeFilesNamespaceClient {
|
|
33
|
-
private readonly http;
|
|
34
|
-
constructor(http: V1HttpClient);
|
|
35
|
-
list(runtimeId: string, query?: V1RuntimeFilesListQuery): Promise<V1ListEnvelope<V1File>>;
|
|
36
|
-
iter(runtimeId: string, query?: V1RuntimeFilesListQuery): AsyncGenerator<V1File, void, undefined>;
|
|
37
|
-
upload(runtimeId: string, request: V1RuntimeFileUploadRequest): Promise<V1RuntimeStagedFile>;
|
|
38
|
-
stage(runtimeId: string, request: V1RuntimeFileStageRequest): Promise<V1RuntimeStagedFile>;
|
|
39
|
-
collect(runtimeId: string, request: V1RuntimeFileCollectRequest): Promise<V1File>;
|
|
40
|
-
}
|
|
41
|
-
export declare class V1RuntimeHumanActionsNamespaceClient {
|
|
42
|
-
private readonly http;
|
|
43
|
-
constructor(http: V1HttpClient);
|
|
44
|
-
create(runtimeId: string, request: V1HumanActionCreateRequest): Promise<V1HumanAction>;
|
|
45
|
-
get(runtimeId: string): Promise<V1HumanAction>;
|
|
46
|
-
complete(runtimeId: string): Promise<V1HumanAction>;
|
|
47
|
-
cancel(runtimeId: string): Promise<V1HumanAction>;
|
|
48
|
-
wait(runtimeId: string, request?: V1HumanActionWaitRequest): Promise<V1HumanActionWaitResponse>;
|
|
49
|
-
}
|
|
50
|
-
export declare class V1RuntimeTargetsNamespaceClient {
|
|
51
|
-
private readonly http;
|
|
52
|
-
constructor(http: V1HttpClient);
|
|
53
|
-
list(runtimeId: string): Promise<V1ListEnvelope<V1RuntimeTarget>>;
|
|
54
|
-
create(runtimeId: string, request?: V1RuntimeTargetCreateRequest): Promise<V1RuntimeTarget>;
|
|
55
|
-
get(runtimeId: string, targetId: string): Promise<V1RuntimeTarget>;
|
|
56
|
-
activate(runtimeId: string, targetId: string): Promise<V1RuntimeTarget>;
|
|
57
|
-
delete(runtimeId: string, targetId: string): Promise<{
|
|
58
|
-
id: string;
|
|
59
|
-
deleted: boolean;
|
|
60
|
-
}>;
|
|
15
|
+
start(runtimeId: string, options?: V1IdempotencyOptions & {
|
|
16
|
+
recording?: boolean;
|
|
17
|
+
}): Promise<V1RuntimeStartResponse>;
|
|
18
|
+
stop(runtimeId: string): Promise<V1RuntimeStopResponse>;
|
|
61
19
|
}
|
package/dist/runtimes.js
CHANGED
|
@@ -1,137 +1,9 @@
|
|
|
1
1
|
import { v1IdempotencyHeaders } from './http.js';
|
|
2
|
-
import { V1RuntimeInvocationsNamespaceClient } from './invocations.js';
|
|
3
2
|
import { iterateV1Pages } from './pagination.js';
|
|
4
|
-
class V1RuntimeRunsClient {
|
|
5
|
-
http;
|
|
6
|
-
runtimeId;
|
|
7
|
-
constructor(http, runtimeId) {
|
|
8
|
-
this.http = http;
|
|
9
|
-
this.runtimeId = runtimeId;
|
|
10
|
-
}
|
|
11
|
-
list(query = {}) {
|
|
12
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/runs`, { query });
|
|
13
|
-
}
|
|
14
|
-
iter(query = {}) {
|
|
15
|
-
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
class V1RuntimeFilesClient {
|
|
19
|
-
http;
|
|
20
|
-
runtimeId;
|
|
21
|
-
constructor(http, runtimeId) {
|
|
22
|
-
this.http = http;
|
|
23
|
-
this.runtimeId = runtimeId;
|
|
24
|
-
}
|
|
25
|
-
list(query = {}) {
|
|
26
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/files`, { query });
|
|
27
|
-
}
|
|
28
|
-
iter(query = {}) {
|
|
29
|
-
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
30
|
-
}
|
|
31
|
-
async upload(request) {
|
|
32
|
-
const form = new FormData();
|
|
33
|
-
if (request.name) {
|
|
34
|
-
form.set('file', request.file, request.name);
|
|
35
|
-
form.set('name', request.name);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
form.set('file', request.file);
|
|
39
|
-
}
|
|
40
|
-
if (request.destinationPath)
|
|
41
|
-
form.set('destinationPath', request.destinationPath);
|
|
42
|
-
if (request.runtimePath)
|
|
43
|
-
form.set('runtimePath', request.runtimePath);
|
|
44
|
-
if (request.metadata)
|
|
45
|
-
form.set('metadata', JSON.stringify(request.metadata));
|
|
46
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/files/upload`, {
|
|
47
|
-
method: 'POST',
|
|
48
|
-
body: form,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
stage(request) {
|
|
52
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/files/stage`, {
|
|
53
|
-
method: 'POST',
|
|
54
|
-
body: request,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
collect(request) {
|
|
58
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/files/collect`, {
|
|
59
|
-
method: 'POST',
|
|
60
|
-
body: request,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
class V1RuntimeTargetsClient {
|
|
65
|
-
http;
|
|
66
|
-
runtimeId;
|
|
67
|
-
constructor(http, runtimeId) {
|
|
68
|
-
this.http = http;
|
|
69
|
-
this.runtimeId = runtimeId;
|
|
70
|
-
}
|
|
71
|
-
list() {
|
|
72
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/targets`);
|
|
73
|
-
}
|
|
74
|
-
create(request = {}) {
|
|
75
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/targets`, {
|
|
76
|
-
method: 'POST',
|
|
77
|
-
body: request,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
get(targetId) {
|
|
81
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/targets/${encodeURIComponent(targetId)}`);
|
|
82
|
-
}
|
|
83
|
-
activate(targetId) {
|
|
84
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/targets/${encodeURIComponent(targetId)}/activate`, { method: 'POST' });
|
|
85
|
-
}
|
|
86
|
-
delete(targetId) {
|
|
87
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/targets/${encodeURIComponent(targetId)}`, { method: 'DELETE' });
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
class V1RuntimeHumanActionsClient {
|
|
91
|
-
http;
|
|
92
|
-
runtimeId;
|
|
93
|
-
constructor(http, runtimeId) {
|
|
94
|
-
this.http = http;
|
|
95
|
-
this.runtimeId = runtimeId;
|
|
96
|
-
}
|
|
97
|
-
create(request) {
|
|
98
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/human-actions`, {
|
|
99
|
-
method: 'POST',
|
|
100
|
-
body: request,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
get() {
|
|
104
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/human-actions`);
|
|
105
|
-
}
|
|
106
|
-
complete() {
|
|
107
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/human-actions/complete`, { method: 'POST' });
|
|
108
|
-
}
|
|
109
|
-
cancel() {
|
|
110
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/human-actions/cancel`, { method: 'POST' });
|
|
111
|
-
}
|
|
112
|
-
wait(request = {}) {
|
|
113
|
-
return this.http.request(`/runtimes/${encodeURIComponent(this.runtimeId)}/human-actions/wait`, {
|
|
114
|
-
method: 'POST',
|
|
115
|
-
body: request,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
3
|
export class V1RuntimesClient {
|
|
120
4
|
http;
|
|
121
|
-
files;
|
|
122
|
-
runs;
|
|
123
|
-
invocations;
|
|
124
|
-
targets;
|
|
125
|
-
humanAction;
|
|
126
|
-
humanActions;
|
|
127
5
|
constructor(http) {
|
|
128
6
|
this.http = http;
|
|
129
|
-
this.files = new V1RuntimeFilesNamespaceClient(http);
|
|
130
|
-
this.runs = new V1RuntimeRunsNamespaceClient(http);
|
|
131
|
-
this.invocations = new V1RuntimeInvocationsNamespaceClient(http);
|
|
132
|
-
this.targets = new V1RuntimeTargetsNamespaceClient(http);
|
|
133
|
-
this.humanAction = new V1RuntimeHumanActionsNamespaceClient(http);
|
|
134
|
-
this.humanActions = this.humanAction;
|
|
135
7
|
}
|
|
136
8
|
list(query = {}) {
|
|
137
9
|
return this.http.request('/runtimes', { query });
|
|
@@ -139,114 +11,39 @@ export class V1RuntimesClient {
|
|
|
139
11
|
iter(query = {}) {
|
|
140
12
|
return iterateV1Pages(query, (pageQuery) => this.list(pageQuery));
|
|
141
13
|
}
|
|
142
|
-
|
|
14
|
+
create(request, options) {
|
|
143
15
|
return this.http.request('/runtimes', {
|
|
144
16
|
method: 'POST',
|
|
145
17
|
body: request,
|
|
18
|
+
headers: v1IdempotencyHeaders(options),
|
|
146
19
|
});
|
|
147
20
|
}
|
|
148
|
-
|
|
149
|
-
return this.http.request(
|
|
150
|
-
method: 'POST',
|
|
151
|
-
body: { ...request, spaceId },
|
|
152
|
-
});
|
|
21
|
+
get(runtimeId, query = {}) {
|
|
22
|
+
return this.http.request(`/runtimes/${encodeURIComponent(runtimeId)}`, { query });
|
|
153
23
|
}
|
|
154
|
-
update(
|
|
155
|
-
return this.http.request(`/runtimes/${encodeURIComponent(
|
|
24
|
+
update(runtimeId, request) {
|
|
25
|
+
return this.http.request(`/runtimes/${encodeURIComponent(runtimeId)}`, {
|
|
156
26
|
method: 'PATCH',
|
|
157
27
|
body: request,
|
|
158
28
|
});
|
|
159
29
|
}
|
|
160
|
-
delete(
|
|
161
|
-
return this.http.request(`/runtimes/${encodeURIComponent(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
30
|
+
delete(runtimeId, options = {}) {
|
|
31
|
+
return this.http.request(`/runtimes/${encodeURIComponent(runtimeId)}`, {
|
|
32
|
+
method: 'DELETE',
|
|
33
|
+
query: options,
|
|
34
|
+
});
|
|
165
35
|
}
|
|
166
|
-
|
|
167
|
-
|
|
36
|
+
start(runtimeId, options = {}) {
|
|
37
|
+
const { recording, ...idempotency } = options;
|
|
38
|
+
return this.http.request(`/runtimes/${encodeURIComponent(runtimeId)}/start`, {
|
|
168
39
|
method: 'POST',
|
|
40
|
+
...(recording === undefined ? {} : { body: { recording } }),
|
|
41
|
+
headers: v1IdempotencyHeaders(idempotency),
|
|
169
42
|
});
|
|
170
43
|
}
|
|
171
|
-
|
|
172
|
-
return this.http.request(`/runtimes/${encodeURIComponent(
|
|
44
|
+
stop(runtimeId) {
|
|
45
|
+
return this.http.request(`/runtimes/${encodeURIComponent(runtimeId)}/stop`, {
|
|
173
46
|
method: 'POST',
|
|
174
|
-
headers: v1IdempotencyHeaders(options),
|
|
175
47
|
});
|
|
176
48
|
}
|
|
177
49
|
}
|
|
178
|
-
export class V1RuntimeRunsNamespaceClient {
|
|
179
|
-
http;
|
|
180
|
-
constructor(http) {
|
|
181
|
-
this.http = http;
|
|
182
|
-
}
|
|
183
|
-
list(runtimeId, query = {}) {
|
|
184
|
-
return new V1RuntimeRunsClient(this.http, runtimeId).list(query);
|
|
185
|
-
}
|
|
186
|
-
iter(runtimeId, query = {}) {
|
|
187
|
-
return new V1RuntimeRunsClient(this.http, runtimeId).iter(query);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
export class V1RuntimeFilesNamespaceClient {
|
|
191
|
-
http;
|
|
192
|
-
constructor(http) {
|
|
193
|
-
this.http = http;
|
|
194
|
-
}
|
|
195
|
-
list(runtimeId, query = {}) {
|
|
196
|
-
return new V1RuntimeFilesClient(this.http, runtimeId).list(query);
|
|
197
|
-
}
|
|
198
|
-
iter(runtimeId, query = {}) {
|
|
199
|
-
return new V1RuntimeFilesClient(this.http, runtimeId).iter(query);
|
|
200
|
-
}
|
|
201
|
-
upload(runtimeId, request) {
|
|
202
|
-
return new V1RuntimeFilesClient(this.http, runtimeId).upload(request);
|
|
203
|
-
}
|
|
204
|
-
stage(runtimeId, request) {
|
|
205
|
-
return new V1RuntimeFilesClient(this.http, runtimeId).stage(request);
|
|
206
|
-
}
|
|
207
|
-
collect(runtimeId, request) {
|
|
208
|
-
return new V1RuntimeFilesClient(this.http, runtimeId).collect(request);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
export class V1RuntimeHumanActionsNamespaceClient {
|
|
212
|
-
http;
|
|
213
|
-
constructor(http) {
|
|
214
|
-
this.http = http;
|
|
215
|
-
}
|
|
216
|
-
create(runtimeId, request) {
|
|
217
|
-
return new V1RuntimeHumanActionsClient(this.http, runtimeId).create(request);
|
|
218
|
-
}
|
|
219
|
-
get(runtimeId) {
|
|
220
|
-
return new V1RuntimeHumanActionsClient(this.http, runtimeId).get();
|
|
221
|
-
}
|
|
222
|
-
complete(runtimeId) {
|
|
223
|
-
return new V1RuntimeHumanActionsClient(this.http, runtimeId).complete();
|
|
224
|
-
}
|
|
225
|
-
cancel(runtimeId) {
|
|
226
|
-
return new V1RuntimeHumanActionsClient(this.http, runtimeId).cancel();
|
|
227
|
-
}
|
|
228
|
-
wait(runtimeId, request = {}) {
|
|
229
|
-
return new V1RuntimeHumanActionsClient(this.http, runtimeId).wait(request);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
export class V1RuntimeTargetsNamespaceClient {
|
|
233
|
-
http;
|
|
234
|
-
constructor(http) {
|
|
235
|
-
this.http = http;
|
|
236
|
-
}
|
|
237
|
-
list(runtimeId) {
|
|
238
|
-
return new V1RuntimeTargetsClient(this.http, runtimeId).list();
|
|
239
|
-
}
|
|
240
|
-
create(runtimeId, request = {}) {
|
|
241
|
-
return new V1RuntimeTargetsClient(this.http, runtimeId).create(request);
|
|
242
|
-
}
|
|
243
|
-
get(runtimeId, targetId) {
|
|
244
|
-
return new V1RuntimeTargetsClient(this.http, runtimeId).get(targetId);
|
|
245
|
-
}
|
|
246
|
-
activate(runtimeId, targetId) {
|
|
247
|
-
return new V1RuntimeTargetsClient(this.http, runtimeId).activate(targetId);
|
|
248
|
-
}
|
|
249
|
-
delete(runtimeId, targetId) {
|
|
250
|
-
return new V1RuntimeTargetsClient(this.http, runtimeId).delete(targetId);
|
|
251
|
-
}
|
|
252
|
-
}
|
package/dist/spaces.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { V1HttpClient } from './http.js';
|
|
2
|
-
import {
|
|
3
|
-
import type { V1ListEnvelope, V1Runtime, V1RuntimeListQuery, V1Space, V1SpaceCreateRequest, V1SpaceDeleteResponse, V1SpaceEnvironment, V1SpaceEnvironmentUpdateRequest, V1SpaceListQuery, V1SpaceRuntimeCreateRequest, V1SpaceUpdateRequest } from './types.js';
|
|
2
|
+
import type { V1ListEnvelope, V1Space, V1SpaceCreateRequest, V1SpaceDeleteResponse, V1SpaceListQuery, V1SpaceUpdateRequest } from './types.js';
|
|
4
3
|
export declare class V1SpacesClient {
|
|
5
4
|
private readonly http;
|
|
6
|
-
readonly environment: V1SpaceEnvironmentNamespaceClient;
|
|
7
|
-
readonly runtimes: V1SpaceRuntimesNamespaceClient;
|
|
8
5
|
constructor(http: V1HttpClient);
|
|
9
6
|
list(query?: V1SpaceListQuery): Promise<V1ListEnvelope<V1Space>>;
|
|
10
7
|
iter(query?: V1SpaceListQuery): AsyncGenerator<V1Space, void, undefined>;
|
|
@@ -13,16 +10,3 @@ export declare class V1SpacesClient {
|
|
|
13
10
|
update(id: string, request: V1SpaceUpdateRequest): Promise<V1Space>;
|
|
14
11
|
delete(id: string): Promise<V1SpaceDeleteResponse>;
|
|
15
12
|
}
|
|
16
|
-
export declare class V1SpaceEnvironmentNamespaceClient {
|
|
17
|
-
private readonly http;
|
|
18
|
-
constructor(http: V1HttpClient);
|
|
19
|
-
get(spaceId: string): Promise<V1SpaceEnvironment>;
|
|
20
|
-
update(spaceId: string, request: V1SpaceEnvironmentUpdateRequest): Promise<V1SpaceEnvironment>;
|
|
21
|
-
}
|
|
22
|
-
export declare class V1SpaceRuntimesNamespaceClient {
|
|
23
|
-
private readonly http;
|
|
24
|
-
constructor(http: V1HttpClient);
|
|
25
|
-
list(spaceId: string, query?: Omit<V1RuntimeListQuery, 'spaceId'>): ReturnType<V1RuntimesClient['list']>;
|
|
26
|
-
iter(spaceId: string, query?: Omit<V1RuntimeListQuery, 'spaceId'>): ReturnType<V1RuntimesClient['iter']>;
|
|
27
|
-
create(spaceId: string, request: V1SpaceRuntimeCreateRequest): Promise<V1Runtime>;
|
|
28
|
-
}
|
package/dist/spaces.js
CHANGED
|
@@ -1,56 +1,8 @@
|
|
|
1
1
|
import { iterateV1Pages } from './pagination.js';
|
|
2
|
-
import { V1RuntimesClient } from './runtimes.js';
|
|
3
|
-
class V1SpaceEnvironmentClient {
|
|
4
|
-
http;
|
|
5
|
-
spaceId;
|
|
6
|
-
constructor(http, spaceId) {
|
|
7
|
-
this.http = http;
|
|
8
|
-
this.spaceId = spaceId;
|
|
9
|
-
}
|
|
10
|
-
get() {
|
|
11
|
-
return this.http.request(`/spaces/${encodeURIComponent(this.spaceId)}/environment`);
|
|
12
|
-
}
|
|
13
|
-
update(request) {
|
|
14
|
-
return this.http.request(`/spaces/${encodeURIComponent(this.spaceId)}/environment`, {
|
|
15
|
-
method: 'PATCH',
|
|
16
|
-
body: request,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
class V1SpaceRuntimesClient {
|
|
21
|
-
http;
|
|
22
|
-
spaceId;
|
|
23
|
-
constructor(http, spaceId) {
|
|
24
|
-
this.http = http;
|
|
25
|
-
this.spaceId = spaceId;
|
|
26
|
-
}
|
|
27
|
-
list(query = {}) {
|
|
28
|
-
return new V1RuntimesClient(this.http).list({ ...query, spaceId: this.spaceId });
|
|
29
|
-
}
|
|
30
|
-
iter(query = {}) {
|
|
31
|
-
return new V1RuntimesClient(this.http).iter({ ...query, spaceId: this.spaceId });
|
|
32
|
-
}
|
|
33
|
-
create(request) {
|
|
34
|
-
return new V1RuntimesClient(this.http).createInSpace(this.spaceId, request);
|
|
35
|
-
}
|
|
36
|
-
get(runtimeId) {
|
|
37
|
-
return new V1RuntimesClient(this.http).get(runtimeId);
|
|
38
|
-
}
|
|
39
|
-
stop(runtimeId) {
|
|
40
|
-
return new V1RuntimesClient(this.http).stop(runtimeId);
|
|
41
|
-
}
|
|
42
|
-
start(runtimeId) {
|
|
43
|
-
return new V1RuntimesClient(this.http).start(runtimeId);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
2
|
export class V1SpacesClient {
|
|
47
3
|
http;
|
|
48
|
-
environment;
|
|
49
|
-
runtimes;
|
|
50
4
|
constructor(http) {
|
|
51
5
|
this.http = http;
|
|
52
|
-
this.environment = new V1SpaceEnvironmentNamespaceClient(http);
|
|
53
|
-
this.runtimes = new V1SpaceRuntimesNamespaceClient(http);
|
|
54
6
|
}
|
|
55
7
|
list(query = {}) {
|
|
56
8
|
return this.http.request('/spaces', { query });
|
|
@@ -79,30 +31,3 @@ export class V1SpacesClient {
|
|
|
79
31
|
});
|
|
80
32
|
}
|
|
81
33
|
}
|
|
82
|
-
export class V1SpaceEnvironmentNamespaceClient {
|
|
83
|
-
http;
|
|
84
|
-
constructor(http) {
|
|
85
|
-
this.http = http;
|
|
86
|
-
}
|
|
87
|
-
get(spaceId) {
|
|
88
|
-
return new V1SpaceEnvironmentClient(this.http, spaceId).get();
|
|
89
|
-
}
|
|
90
|
-
update(spaceId, request) {
|
|
91
|
-
return new V1SpaceEnvironmentClient(this.http, spaceId).update(request);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export class V1SpaceRuntimesNamespaceClient {
|
|
95
|
-
http;
|
|
96
|
-
constructor(http) {
|
|
97
|
-
this.http = http;
|
|
98
|
-
}
|
|
99
|
-
list(spaceId, query = {}) {
|
|
100
|
-
return new V1RuntimesClient(this.http).list({ ...query, spaceId });
|
|
101
|
-
}
|
|
102
|
-
iter(spaceId, query = {}) {
|
|
103
|
-
return new V1RuntimesClient(this.http).iter({ ...query, spaceId });
|
|
104
|
-
}
|
|
105
|
-
create(spaceId, request) {
|
|
106
|
-
return new V1RuntimesClient(this.http).createInSpace(spaceId, request);
|
|
107
|
-
}
|
|
108
|
-
}
|
package/dist/toolCallTypes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OpenApiQuery, OpenApiSchemas } from './openapi.js';
|
|
2
|
-
export type
|
|
2
|
+
export type V1ToolCallCallerType = OpenApiSchemas['ToolCall']['callerType'];
|
|
3
3
|
export type V1ToolCallStatus = OpenApiSchemas['ToolCall']['status'];
|
|
4
|
-
export type
|
|
4
|
+
export type V1ToolName = OpenApiSchemas['ToolCall']['tool'];
|
|
5
5
|
export type V1ToolCall = OpenApiSchemas['ToolCall'];
|
|
6
6
|
export type V1ToolCallListQuery = OpenApiQuery<'tool-calls.list'>;
|
package/dist/toolCalls.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { V1HttpClient } from './http.js';
|
|
2
|
-
import type { V1ListEnvelope, V1ToolCall, V1ToolCallListQuery } from './types.js';
|
|
2
|
+
import type { JsonValue, V1ListEnvelope, V1ToolCall, V1ToolCallListQuery, V1ToolCallResultQuery } from './types.js';
|
|
3
3
|
export declare class V1ToolCallsClient {
|
|
4
4
|
private readonly http;
|
|
5
5
|
constructor(http: V1HttpClient);
|
|
6
6
|
list(query?: V1ToolCallListQuery): Promise<V1ListEnvelope<V1ToolCall>>;
|
|
7
7
|
iter(query?: V1ToolCallListQuery): AsyncGenerator<V1ToolCall, void, undefined>;
|
|
8
8
|
get(toolCallId: string): Promise<V1ToolCall>;
|
|
9
|
+
cancel(toolCallId: string): Promise<V1ToolCall>;
|
|
10
|
+
respond(toolCallId: string, response: JsonValue): Promise<V1ToolCall>;
|
|
11
|
+
result(toolCallId: string, query?: V1ToolCallResultQuery): Promise<JsonValue | V1ToolCall>;
|
|
9
12
|
}
|