@agent-api/sdk 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +23 -4
- package/dist/client.d.ts +2 -0
- package/dist/client.js +3 -0
- package/dist/internal/http.d.ts +6 -0
- package/dist/internal/http.js +18 -7
- package/dist/resources/volumes.d.ts +25 -0
- package/dist/resources/volumes.js +75 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/input.d.ts +4 -1
- package/dist/types/responses.d.ts +2 -0
- package/dist/types/streaming.d.ts +1 -1
- package/dist/types/tools.d.ts +7 -1
- package/dist/types/volumes.d.ts +67 -0
- package/dist/types/volumes.js +1 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog — @agent-api/sdk
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `user` on create-run params; `input_document` content parts in TypeScript types.
|
|
8
|
+
- `response.requires_action` in streaming event types.
|
|
9
|
+
- `readFile(..., { format: "raw" })` for binary volume files (`VolumeFileRaw` with `ArrayBuffer` content).
|
|
10
|
+
- Route manifest coverage for volume rename, usage reconcile, and directory create/delete.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- README and route manifest now list all volume resource methods implemented since 1.0.1.
|
|
15
|
+
|
|
16
|
+
## 1.0.1
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Durable volume resource methods for volume CRUD, entry listing/search, and file read/write/delete operations.
|
|
21
|
+
- `volume_id` create-run parameter for attaching an existing durable volume to agent runs.
|
|
22
|
+
|
|
3
23
|
## 1.0.0
|
|
4
24
|
|
|
5
25
|
### Added
|
|
@@ -11,3 +31,4 @@
|
|
|
11
31
|
### Notes
|
|
12
32
|
|
|
13
33
|
- Independent from the Python `cloudsway-agent` package; version and release tags are separate.
|
|
34
|
+
- Registry: https://www.npmjs.com/package/@agent-api/sdk
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Production JavaScript/TypeScript SDK for the Managed Agent API.
|
|
4
4
|
|
|
5
|
+
**Published on npm:** [`@agent-api/sdk`](https://www.npmjs.com/package/@agent-api/sdk) (v1.0.2)
|
|
6
|
+
|
|
5
7
|
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -44,7 +46,7 @@ src/
|
|
|
44
46
|
errors.ts # Typed error hierarchy + retry helpers
|
|
45
47
|
pagination.ts # Cursor pagination utilities
|
|
46
48
|
streaming.ts # SSE parser
|
|
47
|
-
resources/ # responses, models, presets, tools
|
|
49
|
+
resources/ # responses, models, presets, tools, volumes
|
|
48
50
|
types/ # Request/response TypeScript types
|
|
49
51
|
internal/http.ts # Retries, timeouts, User-Agent
|
|
50
52
|
```
|
|
@@ -57,6 +59,23 @@ src/
|
|
|
57
59
|
| `client.models` | `list` |
|
|
58
60
|
| `client.presets` | `list` |
|
|
59
61
|
| `client.tools` | `list` |
|
|
62
|
+
| `client.volumes` | `list`, `create`, `retrieve`, `update`, `delete`, `listEntries`, `searchEntries`, `readFile`, `writeFile`, `deleteFile`, `reconcileUsage`, `createDirectory`, `deleteDirectory` |
|
|
63
|
+
|
|
64
|
+
## Durable Volumes
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
const volume = await client.volumes.create({ name: "research-notes" });
|
|
68
|
+
|
|
69
|
+
await client.volumes.writeFile(volume.volume_id, "notes/summary.md", "# Summary\n");
|
|
70
|
+
const file = await client.volumes.readFile(volume.volume_id, "notes/summary.md");
|
|
71
|
+
const binary = await client.volumes.readFile(volume.volume_id, "assets/logo.png", { format: "raw" });
|
|
72
|
+
|
|
73
|
+
const response = await client.agent.create({
|
|
74
|
+
preset: "pro-search",
|
|
75
|
+
input: "Use the attached workspace volume.",
|
|
76
|
+
volume_id: volume.volume_id,
|
|
77
|
+
});
|
|
78
|
+
```
|
|
60
79
|
|
|
61
80
|
## Production features
|
|
62
81
|
|
|
@@ -110,6 +129,6 @@ AGENT_API_INTEGRATION=1 AGENT_API_KEY=sk-... AGENT_API_BASE_URL=https://api.agen
|
|
|
110
129
|
|
|
111
130
|
## Scope
|
|
112
131
|
|
|
113
|
-
The SDK covers the public agent/Responses API and discovery
|
|
114
|
-
auth, workspace administration, and internal audit records
|
|
115
|
-
out of scope.
|
|
132
|
+
The SDK covers the public agent/Responses API, durable volume APIs, and discovery
|
|
133
|
+
endpoints. Console auth, workspace administration, and internal audit records
|
|
134
|
+
are intentionally out of scope.
|
package/dist/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ModelsResource } from "./resources/models.js";
|
|
|
2
2
|
import { PresetsResource } from "./resources/presets.js";
|
|
3
3
|
import { ResponsesResource } from "./resources/responses.js";
|
|
4
4
|
import { ToolsResource } from "./resources/tools.js";
|
|
5
|
+
import { VolumesResource } from "./resources/volumes.js";
|
|
5
6
|
import type { ClientOptions } from "./types/common.js";
|
|
6
7
|
import { VERSION } from "./version.js";
|
|
7
8
|
export declare const DEFAULT_TIMEOUT_MS = 600000;
|
|
@@ -19,6 +20,7 @@ export declare class AgentAPI {
|
|
|
19
20
|
readonly models: ModelsResource;
|
|
20
21
|
readonly presets: PresetsResource;
|
|
21
22
|
readonly tools: ToolsResource;
|
|
23
|
+
readonly volumes: VolumesResource;
|
|
22
24
|
private readonly http;
|
|
23
25
|
constructor(options?: ClientOptions);
|
|
24
26
|
}
|
package/dist/client.js
CHANGED
|
@@ -5,6 +5,7 @@ import { ModelsResource } from "./resources/models.js";
|
|
|
5
5
|
import { PresetsResource } from "./resources/presets.js";
|
|
6
6
|
import { ResponsesResource } from "./resources/responses.js";
|
|
7
7
|
import { ToolsResource } from "./resources/tools.js";
|
|
8
|
+
import { VolumesResource } from "./resources/volumes.js";
|
|
8
9
|
import { VERSION } from "./version.js";
|
|
9
10
|
export const DEFAULT_TIMEOUT_MS = 600_000;
|
|
10
11
|
export const DEFAULT_STREAM_TIMEOUT_MS = 3_600_000;
|
|
@@ -21,6 +22,7 @@ export class AgentAPI {
|
|
|
21
22
|
models;
|
|
22
23
|
presets;
|
|
23
24
|
tools;
|
|
25
|
+
volumes;
|
|
24
26
|
http;
|
|
25
27
|
constructor(options = {}) {
|
|
26
28
|
this.apiKey = options.apiKey ?? readEnv("AGENT_API_KEY");
|
|
@@ -47,6 +49,7 @@ export class AgentAPI {
|
|
|
47
49
|
this.models = new ModelsResource(this.http);
|
|
48
50
|
this.presets = new PresetsResource(this.http);
|
|
49
51
|
this.tools = new ToolsResource(this.http);
|
|
52
|
+
this.volumes = new VolumesResource(this.http);
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
export { VERSION };
|
package/dist/internal/http.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export declare class HTTPClient {
|
|
|
12
12
|
private readonly options;
|
|
13
13
|
constructor(options: HTTPClientOptions);
|
|
14
14
|
request<T>(method: string, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
15
|
+
requestRaw<T>(method: string, path: string, body: BodyInit, options?: RequestOptions): Promise<T>;
|
|
16
|
+
requestVoid(method: string, path: string, options?: RequestOptions): Promise<void>;
|
|
17
|
+
requestBinary(method: string, path: string, options?: RequestOptions): Promise<{
|
|
18
|
+
body: ArrayBuffer;
|
|
19
|
+
headers: Headers;
|
|
20
|
+
}>;
|
|
15
21
|
stream<T>(path: string, body: unknown, options?: RequestOptions): Promise<AsyncIterable<T>>;
|
|
16
22
|
private fetchWithRetry;
|
|
17
23
|
private fetchOnce;
|
package/dist/internal/http.js
CHANGED
|
@@ -7,19 +7,30 @@ export class HTTPClient {
|
|
|
7
7
|
this.options = options;
|
|
8
8
|
}
|
|
9
9
|
async request(method, path, body, options = {}) {
|
|
10
|
-
const response = await this.fetchWithRetry(method, path, body, options, false);
|
|
10
|
+
const response = await this.fetchWithRetry(method, path, body, options, false, false);
|
|
11
11
|
return (await response.json());
|
|
12
12
|
}
|
|
13
|
+
async requestRaw(method, path, body, options = {}) {
|
|
14
|
+
const response = await this.fetchWithRetry(method, path, body, options, false, true);
|
|
15
|
+
return (await response.json());
|
|
16
|
+
}
|
|
17
|
+
async requestVoid(method, path, options = {}) {
|
|
18
|
+
await this.fetchWithRetry(method, path, undefined, options, false, false);
|
|
19
|
+
}
|
|
20
|
+
async requestBinary(method, path, options = {}) {
|
|
21
|
+
const response = await this.fetchWithRetry(method, path, undefined, options, false, false);
|
|
22
|
+
return { body: await response.arrayBuffer(), headers: response.headers };
|
|
23
|
+
}
|
|
13
24
|
async stream(path, body, options = {}) {
|
|
14
|
-
const response = await this.fetchWithRetry("POST", path, body, options, true);
|
|
25
|
+
const response = await this.fetchWithRetry("POST", path, body, options, true, false);
|
|
15
26
|
return parseSSE(response);
|
|
16
27
|
}
|
|
17
|
-
async fetchWithRetry(method, path, body, options, stream) {
|
|
28
|
+
async fetchWithRetry(method, path, body, options, stream, rawBody) {
|
|
18
29
|
const maxRetries = options.maxRetries ?? this.options.maxRetries;
|
|
19
30
|
let attempt = 0;
|
|
20
31
|
for (;;) {
|
|
21
32
|
try {
|
|
22
|
-
return await this.fetchOnce(method, path, body, options, stream);
|
|
33
|
+
return await this.fetchOnce(method, path, body, options, stream, rawBody);
|
|
23
34
|
}
|
|
24
35
|
catch (error) {
|
|
25
36
|
if (!(error instanceof APIError) || attempt >= maxRetries) {
|
|
@@ -36,7 +47,7 @@ export class HTTPClient {
|
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
49
|
}
|
|
39
|
-
async fetchOnce(method, path, body, options, stream) {
|
|
50
|
+
async fetchOnce(method, path, body, options, stream, rawBody) {
|
|
40
51
|
const controller = new AbortController();
|
|
41
52
|
const timeout = options.timeout ?? (stream ? this.options.streamTimeout : this.options.timeout);
|
|
42
53
|
const timeoutID = setTimeout(() => controller.abort(), timeout);
|
|
@@ -47,7 +58,7 @@ export class HTTPClient {
|
|
|
47
58
|
...this.options.defaultHeaders,
|
|
48
59
|
...options.headers,
|
|
49
60
|
};
|
|
50
|
-
if (body !== undefined) {
|
|
61
|
+
if (body !== undefined && !rawBody) {
|
|
51
62
|
headers["Content-Type"] = "application/json";
|
|
52
63
|
}
|
|
53
64
|
if (this.options.apiKey) {
|
|
@@ -56,7 +67,7 @@ export class HTTPClient {
|
|
|
56
67
|
const response = await this.options.fetchImpl(`${this.options.baseURL}${path}`, {
|
|
57
68
|
method,
|
|
58
69
|
headers,
|
|
59
|
-
body: body === undefined ? undefined : JSON.stringify(body),
|
|
70
|
+
body: body === undefined ? undefined : rawBody ? body : JSON.stringify(body),
|
|
60
71
|
signal: controller.signal,
|
|
61
72
|
});
|
|
62
73
|
if (!response.ok) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HTTPClient } from "../internal/http.js";
|
|
2
|
+
import type { RequestOptions } from "../types/common.js";
|
|
3
|
+
import type { CreateVolumeParams, ListVolumeEntriesParams, ListVolumeEntriesResponse, ListVolumesParams, ListVolumesResponse, ReadVolumeFileParams, ReadVolumeFileRawParams, SearchVolumeEntriesParams, VolumeFileRead, VolumeFileRaw, VolumeFileWrite, VolumeInfo } from "../types/volumes.js";
|
|
4
|
+
export declare class VolumesResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HTTPClient);
|
|
7
|
+
list(params?: ListVolumesParams, options?: RequestOptions): Promise<ListVolumesResponse>;
|
|
8
|
+
create(params?: CreateVolumeParams, options?: RequestOptions): Promise<VolumeInfo>;
|
|
9
|
+
retrieve(volumeID: string, options?: RequestOptions): Promise<VolumeInfo>;
|
|
10
|
+
update(volumeID: string, params: {
|
|
11
|
+
name: string;
|
|
12
|
+
}, options?: RequestOptions): Promise<VolumeInfo>;
|
|
13
|
+
delete(volumeID: string, options?: RequestOptions): Promise<void>;
|
|
14
|
+
listEntries(volumeID: string, params?: ListVolumeEntriesParams, options?: RequestOptions): Promise<ListVolumeEntriesResponse>;
|
|
15
|
+
searchEntries(volumeID: string, params: SearchVolumeEntriesParams, options?: RequestOptions): Promise<ListVolumeEntriesResponse>;
|
|
16
|
+
readFile(volumeID: string, path: string, params: ReadVolumeFileRawParams, options?: RequestOptions): Promise<VolumeFileRaw>;
|
|
17
|
+
readFile(volumeID: string, path: string, params?: ReadVolumeFileParams, options?: RequestOptions): Promise<VolumeFileRead>;
|
|
18
|
+
writeFile(volumeID: string, path: string, content: string | ArrayBuffer | Blob, options?: RequestOptions): Promise<VolumeFileWrite>;
|
|
19
|
+
deleteFile(volumeID: string, path: string, options?: RequestOptions): Promise<void>;
|
|
20
|
+
reconcileUsage(volumeID: string, options?: RequestOptions): Promise<VolumeInfo>;
|
|
21
|
+
createDirectory(volumeID: string, path: string, options?: RequestOptions): Promise<{
|
|
22
|
+
path: string;
|
|
23
|
+
}>;
|
|
24
|
+
deleteDirectory(volumeID: string, path: string, options?: RequestOptions): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { buildQuery } from "../internal/query.js";
|
|
2
|
+
export class VolumesResource {
|
|
3
|
+
http;
|
|
4
|
+
constructor(http) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
}
|
|
7
|
+
list(params = {}, options) {
|
|
8
|
+
return this.http.request("GET", `/v1/volumes${buildQuery({ limit: params.limit, page_token: params.page_token })}`, undefined, options);
|
|
9
|
+
}
|
|
10
|
+
create(params = {}, options) {
|
|
11
|
+
return this.http.request("POST", "/v1/volumes", params, options);
|
|
12
|
+
}
|
|
13
|
+
retrieve(volumeID, options) {
|
|
14
|
+
return this.http.request("GET", `/v1/volumes/${encodeURIComponent(volumeID)}`, undefined, options);
|
|
15
|
+
}
|
|
16
|
+
update(volumeID, params, options) {
|
|
17
|
+
return this.http.request("PATCH", `/v1/volumes/${encodeURIComponent(volumeID)}`, params, options);
|
|
18
|
+
}
|
|
19
|
+
delete(volumeID, options) {
|
|
20
|
+
return this.http.requestVoid("DELETE", `/v1/volumes/${encodeURIComponent(volumeID)}`, options);
|
|
21
|
+
}
|
|
22
|
+
listEntries(volumeID, params = {}, options) {
|
|
23
|
+
return this.http.request("GET", `/v1/volumes/${encodeURIComponent(volumeID)}/entries${buildQuery({
|
|
24
|
+
path: params.path,
|
|
25
|
+
limit: params.limit,
|
|
26
|
+
page_token: params.page_token,
|
|
27
|
+
})}`, undefined, options);
|
|
28
|
+
}
|
|
29
|
+
searchEntries(volumeID, params, options) {
|
|
30
|
+
return this.http.request("GET", `/v1/volumes/${encodeURIComponent(volumeID)}/search${buildQuery({
|
|
31
|
+
query: params.query,
|
|
32
|
+
path: params.path,
|
|
33
|
+
limit: params.limit,
|
|
34
|
+
page_token: params.page_token,
|
|
35
|
+
})}`, undefined, options);
|
|
36
|
+
}
|
|
37
|
+
readFile(volumeID, path, params = {}, options) {
|
|
38
|
+
const url = `/v1/volumes/${encodeURIComponent(volumeID)}/files/${volumePath(path)}${buildQuery({
|
|
39
|
+
max_bytes: params.max_bytes,
|
|
40
|
+
format: params.format,
|
|
41
|
+
})}`;
|
|
42
|
+
if (params.format === "raw") {
|
|
43
|
+
return this.http.requestBinary("GET", url, options).then(({ body, headers }) => ({
|
|
44
|
+
path,
|
|
45
|
+
size: Number(headers.get("X-Volume-Size") ?? body.byteLength),
|
|
46
|
+
truncated: headers.get("X-Volume-Truncated") === "true",
|
|
47
|
+
content: body,
|
|
48
|
+
content_type: headers.get("Content-Type") ?? undefined,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
return this.http.request("GET", url, undefined, options);
|
|
52
|
+
}
|
|
53
|
+
writeFile(volumeID, path, content, options) {
|
|
54
|
+
return this.http.requestRaw("PUT", `/v1/volumes/${encodeURIComponent(volumeID)}/files/${volumePath(path)}`, content, options);
|
|
55
|
+
}
|
|
56
|
+
deleteFile(volumeID, path, options) {
|
|
57
|
+
return this.http.requestVoid("DELETE", `/v1/volumes/${encodeURIComponent(volumeID)}/files/${volumePath(path)}`, options);
|
|
58
|
+
}
|
|
59
|
+
reconcileUsage(volumeID, options) {
|
|
60
|
+
return this.http.request("POST", `/v1/volumes/${encodeURIComponent(volumeID)}/usage/reconcile`, undefined, options);
|
|
61
|
+
}
|
|
62
|
+
createDirectory(volumeID, path, options) {
|
|
63
|
+
return this.http.request("POST", `/v1/volumes/${encodeURIComponent(volumeID)}/directories`, { path }, options);
|
|
64
|
+
}
|
|
65
|
+
deleteDirectory(volumeID, path, options) {
|
|
66
|
+
return this.http.requestVoid("DELETE", `/v1/volumes/${encodeURIComponent(volumeID)}/directories/${volumePath(path)}`, options);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function volumePath(path) {
|
|
70
|
+
return path
|
|
71
|
+
.split("/")
|
|
72
|
+
.filter(Boolean)
|
|
73
|
+
.map((part) => encodeURIComponent(part))
|
|
74
|
+
.join("/");
|
|
75
|
+
}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
package/dist/types/input.d.ts
CHANGED
|
@@ -6,9 +6,12 @@ export interface Annotation {
|
|
|
6
6
|
end_index?: number;
|
|
7
7
|
}
|
|
8
8
|
export interface ContentPart {
|
|
9
|
-
type: "input_text" | "output_text" | "input_image";
|
|
9
|
+
type: "input_text" | "output_text" | "input_image" | "input_document";
|
|
10
10
|
text?: string;
|
|
11
11
|
image_url?: string;
|
|
12
|
+
mime_type?: string;
|
|
13
|
+
filename?: string;
|
|
14
|
+
document_url?: string;
|
|
12
15
|
annotations?: Annotation[];
|
|
13
16
|
logprobs?: unknown[];
|
|
14
17
|
}
|
|
@@ -18,10 +18,12 @@ export interface ResponseCreateParamsBase {
|
|
|
18
18
|
metadata?: Record<string, unknown>;
|
|
19
19
|
store?: boolean;
|
|
20
20
|
previous_response_id?: string;
|
|
21
|
+
volume_id?: string;
|
|
21
22
|
prompt_cache_key?: string;
|
|
22
23
|
memory?: MemoryOptions;
|
|
23
24
|
plan_mode_preference?: AgentCapabilityPreference;
|
|
24
25
|
sub_agent_preference?: AgentCapabilityPreference;
|
|
26
|
+
user?: string;
|
|
25
27
|
stream?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export interface ResponseCreateParamsNonStreaming extends ResponseCreateParamsBase {
|
|
@@ -17,7 +17,7 @@ export interface ResponseModelCallEvent {
|
|
|
17
17
|
model_chain?: string[];
|
|
18
18
|
attempt_count?: number;
|
|
19
19
|
}
|
|
20
|
-
export type ResponseStreamEventType = "response.created" | "response.in_progress" | "response.completed" | "response.failed" | "response.plan.updated" | "response.output_item.added" | "response.output_item.done" | "response.output_text.delta" | "response.output_text.done" | "response.reasoning.started" | "response.reasoning.search_queries" | "response.reasoning.search_results" | "response.reasoning.fetch_url_queries" | "response.reasoning.fetch_url_results" | "response.reasoning.stopped" | "response.tool.invocation.completed" | "response.step.completed" | "response.step.failed" | "response.step.skipped" | "response.model.requested" | "response.model.completed" | "response.model.failed";
|
|
20
|
+
export type ResponseStreamEventType = "response.created" | "response.in_progress" | "response.completed" | "response.failed" | "response.requires_action" | "response.plan.updated" | "response.output_item.added" | "response.output_item.done" | "response.output_text.delta" | "response.output_text.done" | "response.reasoning.started" | "response.reasoning.search_queries" | "response.reasoning.search_results" | "response.reasoning.fetch_url_queries" | "response.reasoning.fetch_url_results" | "response.reasoning.stopped" | "response.tool.invocation.completed" | "response.step.completed" | "response.step.failed" | "response.step.skipped" | "response.model.requested" | "response.model.completed" | "response.model.failed";
|
|
21
21
|
export interface ResponseStreamEvent {
|
|
22
22
|
type: ResponseStreamEventType;
|
|
23
23
|
sequence_number: number;
|
package/dist/types/tools.d.ts
CHANGED
|
@@ -10,6 +10,12 @@ export interface SmartWebSearchTool {
|
|
|
10
10
|
max_tokens?: number;
|
|
11
11
|
max_tokens_per_page?: number;
|
|
12
12
|
}
|
|
13
|
+
export interface LiteWebSearchTool {
|
|
14
|
+
name: "lite_web_search";
|
|
15
|
+
type?: "search";
|
|
16
|
+
max_tokens?: number;
|
|
17
|
+
max_tokens_per_page?: number;
|
|
18
|
+
}
|
|
13
19
|
export interface FetchURLTool {
|
|
14
20
|
name: "fetch_url";
|
|
15
21
|
type?: "url_reader";
|
|
@@ -27,7 +33,7 @@ export interface SkillTool {
|
|
|
27
33
|
version?: string;
|
|
28
34
|
arguments?: Record<string, unknown>;
|
|
29
35
|
}
|
|
30
|
-
export type Tool = WebSearchTool | SmartWebSearchTool | FetchURLTool | FunctionTool | SkillTool;
|
|
36
|
+
export type Tool = WebSearchTool | SmartWebSearchTool | LiteWebSearchTool | FetchURLTool | FunctionTool | SkillTool;
|
|
31
37
|
export interface PublicTool {
|
|
32
38
|
object: "tool";
|
|
33
39
|
name: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface VolumeInfo {
|
|
2
|
+
volume_id: string;
|
|
3
|
+
tenant_id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
oss_prefix?: string;
|
|
6
|
+
bytes_used?: number;
|
|
7
|
+
object_count?: number;
|
|
8
|
+
usage_reconciled_at_unix?: number;
|
|
9
|
+
created_at_unix?: number;
|
|
10
|
+
updated_at_unix?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface VolumeEntry {
|
|
13
|
+
path: string;
|
|
14
|
+
is_dir: boolean;
|
|
15
|
+
size: number;
|
|
16
|
+
modified_at_unix?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ListVolumesParams {
|
|
19
|
+
limit?: number;
|
|
20
|
+
page_token?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ListVolumesResponse {
|
|
23
|
+
object: "list";
|
|
24
|
+
data: VolumeInfo[];
|
|
25
|
+
next_page_token?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CreateVolumeParams {
|
|
28
|
+
name?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ListVolumeEntriesParams {
|
|
31
|
+
path?: string;
|
|
32
|
+
limit?: number;
|
|
33
|
+
page_token?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface SearchVolumeEntriesParams extends ListVolumeEntriesParams {
|
|
36
|
+
query: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ListVolumeEntriesResponse {
|
|
39
|
+
object: "list";
|
|
40
|
+
entries: VolumeEntry[];
|
|
41
|
+
next_page_token?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ReadVolumeFileParams {
|
|
44
|
+
max_bytes?: number;
|
|
45
|
+
format?: "json";
|
|
46
|
+
}
|
|
47
|
+
export interface ReadVolumeFileRawParams {
|
|
48
|
+
max_bytes?: number;
|
|
49
|
+
format: "raw";
|
|
50
|
+
}
|
|
51
|
+
export interface VolumeFileRead {
|
|
52
|
+
path: string;
|
|
53
|
+
size: number;
|
|
54
|
+
truncated: boolean;
|
|
55
|
+
content: string;
|
|
56
|
+
}
|
|
57
|
+
export interface VolumeFileRaw {
|
|
58
|
+
path: string;
|
|
59
|
+
size: number;
|
|
60
|
+
truncated: boolean;
|
|
61
|
+
content: ArrayBuffer;
|
|
62
|
+
content_type?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface VolumeFileWrite {
|
|
65
|
+
path: string;
|
|
66
|
+
size: number;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
2
|
-
export declare const USER_AGENT = "@agent-api/sdk/1.0.
|
|
1
|
+
export declare const VERSION = "1.0.2";
|
|
2
|
+
export declare const USER_AGENT = "@agent-api/sdk/1.0.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = "1.0.
|
|
1
|
+
export const VERSION = "1.0.2";
|
|
2
2
|
export const USER_AGENT = `@agent-api/sdk/${VERSION}`;
|