@mastra/client-js 0.1.0-alpha.2 → 0.1.0-alpha.4
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/.eslintrc.js +10 -0
- package/.prettierignore +3 -0
- package/.prettierrc.json +26 -0
- package/LICENSE +44 -201
- package/README.md +90 -271
- package/dist/index.d.mts +359 -0
- package/dist/index.mjs +399 -0
- package/package.json +30 -95
- package/src/client.ts +201 -0
- package/src/index.test.ts +528 -0
- package/src/index.ts +2 -200
- package/src/resources/agent.ts +97 -0
- package/src/resources/index.ts +5 -14
- package/src/resources/memory-thread.ts +51 -0
- package/src/resources/tool.ts +28 -0
- package/src/resources/vector.ts +79 -0
- package/src/resources/workflow.ts +28 -0
- package/src/types.ts +135 -0
- package/tsconfig.json +29 -0
- package/vitest.config.js +8 -0
- package/CHANGELOG.md +0 -29
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -81
- package/_shims/index.js +0 -13
- package/_shims/index.mjs +0 -7
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -241
- package/core.d.ts.map +0 -1
- package/core.js +0 -908
- package/core.js.map +0 -1
- package/core.mjs +0 -876
- package/core.mjs.map +0 -1
- package/error.d.ts +0 -47
- package/error.d.ts.map +0 -1
- package/error.js +0 -113
- package/error.js.map +0 -1
- package/error.mjs +0 -97
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -121
- package/index.d.ts +0 -121
- package/index.d.ts.map +0 -1
- package/index.js +0 -131
- package/index.js.map +0 -1
- package/index.mjs +0 -88
- package/index.mjs.map +0 -1
- package/resource.d.ts +0 -6
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -11
- package/resource.js.map +0 -1
- package/resource.mjs +0 -7
- package/resource.mjs.map +0 -1
- package/resources/agents/agents.d.ts +0 -41
- package/resources/agents/agents.d.ts.map +0 -1
- package/resources/agents/agents.js +0 -74
- package/resources/agents/agents.js.map +0 -1
- package/resources/agents/agents.mjs +0 -47
- package/resources/agents/agents.mjs.map +0 -1
- package/resources/agents/index.d.ts +0 -3
- package/resources/agents/index.d.ts.map +0 -1
- package/resources/agents/index.js +0 -9
- package/resources/agents/index.js.map +0 -1
- package/resources/agents/index.mjs +0 -4
- package/resources/agents/index.mjs.map +0 -1
- package/resources/agents/tools.d.ts +0 -17
- package/resources/agents/tools.d.ts.map +0 -1
- package/resources/agents/tools.js +0 -19
- package/resources/agents/tools.js.map +0 -1
- package/resources/agents/tools.mjs +0 -15
- package/resources/agents/tools.mjs.map +0 -1
- package/resources/index.d.ts +0 -8
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -19
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -9
- package/resources/index.mjs.map +0 -1
- package/resources/logs.d.ts +0 -13
- package/resources/logs.d.ts.map +0 -1
- package/resources/logs.js +0 -24
- package/resources/logs.js.map +0 -1
- package/resources/logs.mjs +0 -20
- package/resources/logs.mjs.map +0 -1
- package/resources/memory/index.d.ts +0 -4
- package/resources/memory/index.d.ts.map +0 -1
- package/resources/memory/index.js +0 -11
- package/resources/memory/index.js.map +0 -1
- package/resources/memory/index.mjs +0 -5
- package/resources/memory/index.mjs.map +0 -1
- package/resources/memory/memory.d.ts +0 -23
- package/resources/memory/memory.d.ts.map +0 -1
- package/resources/memory/memory.js +0 -53
- package/resources/memory/memory.js.map +0 -1
- package/resources/memory/memory.mjs +0 -26
- package/resources/memory/memory.mjs.map +0 -1
- package/resources/memory/status.d.ts +0 -9
- package/resources/memory/status.d.ts.map +0 -1
- package/resources/memory/status.js +0 -18
- package/resources/memory/status.js.map +0 -1
- package/resources/memory/status.mjs +0 -14
- package/resources/memory/status.mjs.map +0 -1
- package/resources/memory/threads/index.d.ts +0 -3
- package/resources/memory/threads/index.d.ts.map +0 -1
- package/resources/memory/threads/index.js +0 -9
- package/resources/memory/threads/index.js.map +0 -1
- package/resources/memory/threads/index.mjs +0 -4
- package/resources/memory/threads/index.mjs.map +0 -1
- package/resources/memory/threads/messages.d.ts +0 -9
- package/resources/memory/threads/messages.d.ts.map +0 -1
- package/resources/memory/threads/messages.js +0 -18
- package/resources/memory/threads/messages.js.map +0 -1
- package/resources/memory/threads/messages.mjs +0 -14
- package/resources/memory/threads/messages.mjs.map +0 -1
- package/resources/memory/threads/threads.d.ts +0 -45
- package/resources/memory/threads/threads.d.ts.map +0 -1
- package/resources/memory/threads/threads.js +0 -104
- package/resources/memory/threads/threads.js.map +0 -1
- package/resources/memory/threads/threads.mjs +0 -77
- package/resources/memory/threads/threads.mjs.map +0 -1
- package/resources/syncs.d.ts +0 -15
- package/resources/syncs.d.ts.map +0 -1
- package/resources/syncs.js +0 -19
- package/resources/syncs.js.map +0 -1
- package/resources/syncs.mjs +0 -15
- package/resources/syncs.mjs.map +0 -1
- package/resources/system.d.ts +0 -9
- package/resources/system.d.ts.map +0 -1
- package/resources/system.js +0 -15
- package/resources/system.js.map +0 -1
- package/resources/system.mjs +0 -11
- package/resources/system.mjs.map +0 -1
- package/resources/tools/index.d.ts +0 -3
- package/resources/tools/index.d.ts.map +0 -1
- package/resources/tools/index.js +0 -9
- package/resources/tools/index.js.map +0 -1
- package/resources/tools/index.mjs +0 -4
- package/resources/tools/index.mjs.map +0 -1
- package/resources/tools/result.d.ts +0 -9
- package/resources/tools/result.d.ts.map +0 -1
- package/resources/tools/result.js +0 -18
- package/resources/tools/result.js.map +0 -1
- package/resources/tools/result.mjs +0 -14
- package/resources/tools/result.mjs.map +0 -1
- package/resources/tools/tools.d.ts +0 -29
- package/resources/tools/tools.d.ts.map +0 -1
- package/resources/tools/tools.js +0 -64
- package/resources/tools/tools.js.map +0 -1
- package/resources/tools/tools.mjs +0 -37
- package/resources/tools/tools.mjs.map +0 -1
- package/resources/workflows.d.ts +0 -23
- package/resources/workflows.d.ts.map +0 -1
- package/resources/workflows.js +0 -37
- package/resources/workflows.js.map +0 -1
- package/resources/workflows.mjs +0 -33
- package/resources/workflows.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -81
- package/src/_shims/index.js +0 -13
- package/src/_shims/index.mjs +0 -7
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1201
- package/src/error.ts +0 -130
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -11
- package/src/resources/agents/agents.ts +0 -83
- package/src/resources/agents/index.ts +0 -4
- package/src/resources/agents/tools.ts +0 -34
- package/src/resources/logs.ts +0 -23
- package/src/resources/memory/index.ts +0 -5
- package/src/resources/memory/memory.ts +0 -43
- package/src/resources/memory/status.ts +0 -16
- package/src/resources/memory/threads/index.ts +0 -4
- package/src/resources/memory/threads/messages.ts +0 -16
- package/src/resources/memory/threads/threads.ts +0 -105
- package/src/resources/syncs.ts +0 -25
- package/src/resources/system.ts +0 -13
- package/src/resources/tools/index.ts +0 -4
- package/src/resources/tools/result.ts +0 -16
- package/src/resources/tools/tools.ts +0 -54
- package/src/resources/workflows.ts +0 -49
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -255
- package/src/version.ts +0 -1
- package/uploads.d.ts +0 -75
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -171
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -158
- package/uploads.mjs.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
package/src/error.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { castToError, Headers } from './core';
|
|
4
|
-
|
|
5
|
-
export class MastraClientError extends Error {}
|
|
6
|
-
|
|
7
|
-
export class APIError<
|
|
8
|
-
TStatus extends number | undefined = number | undefined,
|
|
9
|
-
THeaders extends Headers | undefined = Headers | undefined,
|
|
10
|
-
TError extends Object | undefined = Object | undefined,
|
|
11
|
-
> extends MastraClientError {
|
|
12
|
-
/** HTTP status for the response that caused the error */
|
|
13
|
-
readonly status: TStatus;
|
|
14
|
-
/** HTTP headers for the response that caused the error */
|
|
15
|
-
readonly headers: THeaders;
|
|
16
|
-
/** JSON body of the response that caused the error */
|
|
17
|
-
readonly error: TError;
|
|
18
|
-
|
|
19
|
-
constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
|
|
20
|
-
super(`${APIError.makeMessage(status, error, message)}`);
|
|
21
|
-
this.status = status;
|
|
22
|
-
this.headers = headers;
|
|
23
|
-
this.error = error;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
private static makeMessage(status: number | undefined, error: any, message: string | undefined) {
|
|
27
|
-
const msg =
|
|
28
|
-
error?.message ?
|
|
29
|
-
typeof error.message === 'string' ?
|
|
30
|
-
error.message
|
|
31
|
-
: JSON.stringify(error.message)
|
|
32
|
-
: error ? JSON.stringify(error)
|
|
33
|
-
: message;
|
|
34
|
-
|
|
35
|
-
if (status && msg) {
|
|
36
|
-
return `${status} ${msg}`;
|
|
37
|
-
}
|
|
38
|
-
if (status) {
|
|
39
|
-
return `${status} status code (no body)`;
|
|
40
|
-
}
|
|
41
|
-
if (msg) {
|
|
42
|
-
return msg;
|
|
43
|
-
}
|
|
44
|
-
return '(no status code or body)';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static generate(
|
|
48
|
-
status: number | undefined,
|
|
49
|
-
errorResponse: Object | undefined,
|
|
50
|
-
message: string | undefined,
|
|
51
|
-
headers: Headers | undefined,
|
|
52
|
-
): APIError {
|
|
53
|
-
if (!status || !headers) {
|
|
54
|
-
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const error = errorResponse as Record<string, any>;
|
|
58
|
-
|
|
59
|
-
if (status === 400) {
|
|
60
|
-
return new BadRequestError(status, error, message, headers);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (status === 401) {
|
|
64
|
-
return new AuthenticationError(status, error, message, headers);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (status === 403) {
|
|
68
|
-
return new PermissionDeniedError(status, error, message, headers);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (status === 404) {
|
|
72
|
-
return new NotFoundError(status, error, message, headers);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (status === 409) {
|
|
76
|
-
return new ConflictError(status, error, message, headers);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (status === 422) {
|
|
80
|
-
return new UnprocessableEntityError(status, error, message, headers);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (status === 429) {
|
|
84
|
-
return new RateLimitError(status, error, message, headers);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (status >= 500) {
|
|
88
|
-
return new InternalServerError(status, error, message, headers);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return new APIError(status, error, message, headers);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export class APIUserAbortError extends APIError<undefined, undefined, undefined> {
|
|
96
|
-
constructor({ message }: { message?: string } = {}) {
|
|
97
|
-
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export class APIConnectionError extends APIError<undefined, undefined, undefined> {
|
|
102
|
-
constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
|
|
103
|
-
super(undefined, undefined, message || 'Connection error.', undefined);
|
|
104
|
-
// in some environments the 'cause' property is already declared
|
|
105
|
-
// @ts-ignore
|
|
106
|
-
if (cause) this.cause = cause;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export class APIConnectionTimeoutError extends APIConnectionError {
|
|
111
|
-
constructor({ message }: { message?: string } = {}) {
|
|
112
|
-
super({ message: message ?? 'Request timed out.' });
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export class BadRequestError extends APIError<400, Headers> {}
|
|
117
|
-
|
|
118
|
-
export class AuthenticationError extends APIError<401, Headers> {}
|
|
119
|
-
|
|
120
|
-
export class PermissionDeniedError extends APIError<403, Headers> {}
|
|
121
|
-
|
|
122
|
-
export class NotFoundError extends APIError<404, Headers> {}
|
|
123
|
-
|
|
124
|
-
export class ConflictError extends APIError<409, Headers> {}
|
|
125
|
-
|
|
126
|
-
export class UnprocessableEntityError extends APIError<422, Headers> {}
|
|
127
|
-
|
|
128
|
-
export class RateLimitError extends APIError<429, Headers> {}
|
|
129
|
-
|
|
130
|
-
export class InternalServerError extends APIError<number, Headers> {}
|
package/src/lib/.keep
DELETED
package/src/resource.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import type { MastraClient } from './index';
|
|
4
|
-
|
|
5
|
-
export class APIResource {
|
|
6
|
-
protected _client: MastraClient;
|
|
7
|
-
|
|
8
|
-
constructor(client: MastraClient) {
|
|
9
|
-
this._client = client;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
5
|
-
import * as ToolsAPI from './tools';
|
|
6
|
-
import { ToolExecuteParams, Tools } from './tools';
|
|
7
|
-
|
|
8
|
-
export class Agents extends APIResource {
|
|
9
|
-
tools: ToolsAPI.Tools = new ToolsAPI.Tools(this._client);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Get agent by ID
|
|
13
|
-
*/
|
|
14
|
-
retrieve(agentId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
15
|
-
return this._client.get(`/api/agents/${agentId}`, {
|
|
16
|
-
...options,
|
|
17
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get all available agents
|
|
23
|
-
*/
|
|
24
|
-
list(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
25
|
-
return this._client.get('/api/agents', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Generate a response from an agent
|
|
30
|
-
*/
|
|
31
|
-
generate(agentId: string, body: AgentGenerateParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
32
|
-
return this._client.post(`/api/agents/${agentId}/generate`, {
|
|
33
|
-
body,
|
|
34
|
-
...options,
|
|
35
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Stream a response from an agent
|
|
41
|
-
*/
|
|
42
|
-
stream(agentId: string, body: AgentStreamParams, options?: Core.RequestOptions): Core.APIPromise<string> {
|
|
43
|
-
return this._client.post(`/api/agents/${agentId}/stream`, {
|
|
44
|
-
body,
|
|
45
|
-
...options,
|
|
46
|
-
headers: { Accept: 'text/x-unknown', ...options?.headers },
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type AgentStreamResponse = Core.Uploadable;
|
|
52
|
-
|
|
53
|
-
export interface AgentGenerateParams {
|
|
54
|
-
messages: Array<unknown>;
|
|
55
|
-
|
|
56
|
-
output?: unknown;
|
|
57
|
-
|
|
58
|
-
resourceid?: string;
|
|
59
|
-
|
|
60
|
-
threadId?: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface AgentStreamParams {
|
|
64
|
-
messages: Array<unknown>;
|
|
65
|
-
|
|
66
|
-
output?: unknown;
|
|
67
|
-
|
|
68
|
-
resourceid?: string;
|
|
69
|
-
|
|
70
|
-
threadId?: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
Agents.Tools = Tools;
|
|
74
|
-
|
|
75
|
-
export declare namespace Agents {
|
|
76
|
-
export {
|
|
77
|
-
type AgentStreamResponse as AgentStreamResponse,
|
|
78
|
-
type AgentGenerateParams as AgentGenerateParams,
|
|
79
|
-
type AgentStreamParams as AgentStreamParams,
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export { Tools as Tools, type ToolExecuteParams as ToolExecuteParams };
|
|
83
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
5
|
-
|
|
6
|
-
export class Tools extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Execute a tool through an agent
|
|
9
|
-
*/
|
|
10
|
-
execute(
|
|
11
|
-
agentId: string,
|
|
12
|
-
toolId: string,
|
|
13
|
-
body: ToolExecuteParams,
|
|
14
|
-
options?: Core.RequestOptions,
|
|
15
|
-
): Core.APIPromise<void> {
|
|
16
|
-
return this._client.post(`/api/agents/${agentId}/tools/${toolId}/execute`, {
|
|
17
|
-
body,
|
|
18
|
-
...options,
|
|
19
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ToolExecuteParams {
|
|
25
|
-
args: unknown;
|
|
26
|
-
|
|
27
|
-
resourceid?: string;
|
|
28
|
-
|
|
29
|
-
threadId?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export declare namespace Tools {
|
|
33
|
-
export { type ToolExecuteParams as ToolExecuteParams };
|
|
34
|
-
}
|
package/src/resources/logs.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../resource';
|
|
4
|
-
import * as Core from '../core';
|
|
5
|
-
|
|
6
|
-
export class Logs extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Get logs by run ID
|
|
9
|
-
*/
|
|
10
|
-
retrieve(runId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.get(`/api/logs/${runId}`, {
|
|
12
|
-
...options,
|
|
13
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get all logs
|
|
19
|
-
*/
|
|
20
|
-
list(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
21
|
-
return this._client.get('/api/logs', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export { Memory, type MemorySaveMessagesParams } from './memory';
|
|
4
|
-
export { Status } from './status';
|
|
5
|
-
export { Threads, type ThreadUpdateParams, type ThreadToolResultParams } from './threads/index';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
5
|
-
import * as StatusAPI from './status';
|
|
6
|
-
import { Status } from './status';
|
|
7
|
-
import * as ThreadsAPI from './threads/threads';
|
|
8
|
-
import { ThreadToolResultParams, ThreadUpdateParams, Threads } from './threads/threads';
|
|
9
|
-
|
|
10
|
-
export class Memory extends APIResource {
|
|
11
|
-
status: StatusAPI.Status = new StatusAPI.Status(this._client);
|
|
12
|
-
threads: ThreadsAPI.Threads = new ThreadsAPI.Threads(this._client);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Save messages
|
|
16
|
-
*/
|
|
17
|
-
saveMessages(body: MemorySaveMessagesParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
18
|
-
return this._client.post('/api/memory/save-messages', {
|
|
19
|
-
body,
|
|
20
|
-
...options,
|
|
21
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface MemorySaveMessagesParams {
|
|
27
|
-
messages: Array<unknown>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
Memory.Status = Status;
|
|
31
|
-
Memory.Threads = Threads;
|
|
32
|
-
|
|
33
|
-
export declare namespace Memory {
|
|
34
|
-
export { type MemorySaveMessagesParams as MemorySaveMessagesParams };
|
|
35
|
-
|
|
36
|
-
export { Status as Status };
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
Threads as Threads,
|
|
40
|
-
type ThreadUpdateParams as ThreadUpdateParams,
|
|
41
|
-
type ThreadToolResultParams as ThreadToolResultParams,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
5
|
-
|
|
6
|
-
export class Status extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Get memory status
|
|
9
|
-
*/
|
|
10
|
-
retrieve(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.get('/api/memory/status', {
|
|
12
|
-
...options,
|
|
13
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
5
|
-
|
|
6
|
-
export class Messages extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Get messages for a thread
|
|
9
|
-
*/
|
|
10
|
-
list(threadId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.get(`/api/memory/threads/${threadId}/messages`, {
|
|
12
|
-
...options,
|
|
13
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
5
|
-
import * as MessagesAPI from './messages';
|
|
6
|
-
import { Messages } from './messages';
|
|
7
|
-
|
|
8
|
-
export class Threads extends APIResource {
|
|
9
|
-
messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Create a new thread
|
|
13
|
-
*/
|
|
14
|
-
create(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
15
|
-
return this._client.post('/api/memory/threads', {
|
|
16
|
-
...options,
|
|
17
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get thread by ID
|
|
23
|
-
*/
|
|
24
|
-
retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
25
|
-
return this._client.get(`/api/memory/threads/${threadId}`, {
|
|
26
|
-
...options,
|
|
27
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Update a thread
|
|
33
|
-
*/
|
|
34
|
-
update(threadId: string, body: ThreadUpdateParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
35
|
-
return this._client.patch(`/api/memory/threads/${threadId}`, {
|
|
36
|
-
body,
|
|
37
|
-
...options,
|
|
38
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get all threads
|
|
44
|
-
*/
|
|
45
|
-
list(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
46
|
-
return this._client.get('/api/memory/threads', {
|
|
47
|
-
...options,
|
|
48
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Delete a thread
|
|
54
|
-
*/
|
|
55
|
-
delete(threadId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
56
|
-
return this._client.delete(`/api/memory/threads/${threadId}`, {
|
|
57
|
-
...options,
|
|
58
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Get context window for a thread
|
|
64
|
-
*/
|
|
65
|
-
contextWindow(threadId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
66
|
-
return this._client.get(`/api/memory/threads/${threadId}/context-window`, {
|
|
67
|
-
...options,
|
|
68
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Get tool execution result for a thread
|
|
74
|
-
*/
|
|
75
|
-
toolResult(
|
|
76
|
-
threadId: string,
|
|
77
|
-
body: ThreadToolResultParams,
|
|
78
|
-
options?: Core.RequestOptions,
|
|
79
|
-
): Core.APIPromise<void> {
|
|
80
|
-
return this._client.post(`/api/memory/threads/${threadId}/tool-result`, {
|
|
81
|
-
body,
|
|
82
|
-
...options,
|
|
83
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export type ThreadUpdateParams = unknown;
|
|
89
|
-
|
|
90
|
-
export interface ThreadToolResultParams {
|
|
91
|
-
resultId: string;
|
|
92
|
-
|
|
93
|
-
toolId: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
Threads.Messages = Messages;
|
|
97
|
-
|
|
98
|
-
export declare namespace Threads {
|
|
99
|
-
export {
|
|
100
|
-
type ThreadUpdateParams as ThreadUpdateParams,
|
|
101
|
-
type ThreadToolResultParams as ThreadToolResultParams,
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export { Messages as Messages };
|
|
105
|
-
}
|
package/src/resources/syncs.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../resource';
|
|
4
|
-
import * as Core from '../core';
|
|
5
|
-
|
|
6
|
-
export class Syncs extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Execute a sync
|
|
9
|
-
*/
|
|
10
|
-
execute(syncId: string, body: SyncExecuteParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.post(`/api/syncs/${syncId}/execute`, {
|
|
12
|
-
body,
|
|
13
|
-
...options,
|
|
14
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface SyncExecuteParams {
|
|
20
|
-
input?: unknown;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export declare namespace Syncs {
|
|
24
|
-
export { type SyncExecuteParams as SyncExecuteParams };
|
|
25
|
-
}
|
package/src/resources/system.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../resource';
|
|
4
|
-
import * as Core from '../core';
|
|
5
|
-
|
|
6
|
-
export class System extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Get API status
|
|
9
|
-
*/
|
|
10
|
-
retrieveStatus(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.get('/api', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
5
|
-
|
|
6
|
-
export class Result extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Get tool execution result
|
|
9
|
-
*/
|
|
10
|
-
retrieve(toolId: string, resultId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.get(`/api/tools/${toolId}/result/${resultId}`, {
|
|
12
|
-
...options,
|
|
13
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
5
|
-
import * as ResultAPI from './result';
|
|
6
|
-
import { Result } from './result';
|
|
7
|
-
|
|
8
|
-
export class Tools extends APIResource {
|
|
9
|
-
result: ResultAPI.Result = new ResultAPI.Result(this._client);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Get tool by ID
|
|
13
|
-
*/
|
|
14
|
-
retrieve(toolId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
15
|
-
return this._client.get(`/api/tools/${toolId}`, {
|
|
16
|
-
...options,
|
|
17
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get all tools
|
|
23
|
-
*/
|
|
24
|
-
list(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
25
|
-
return this._client.get('/api/tools', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Execute a tool
|
|
30
|
-
*/
|
|
31
|
-
execute(toolId: string, body: ToolExecuteParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
32
|
-
return this._client.post(`/api/tools/${toolId}/execute`, {
|
|
33
|
-
body,
|
|
34
|
-
...options,
|
|
35
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface ToolExecuteParams {
|
|
41
|
-
args: unknown;
|
|
42
|
-
|
|
43
|
-
resourceid?: string;
|
|
44
|
-
|
|
45
|
-
threadId?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Tools.Result = Result;
|
|
49
|
-
|
|
50
|
-
export declare namespace Tools {
|
|
51
|
-
export { type ToolExecuteParams as ToolExecuteParams };
|
|
52
|
-
|
|
53
|
-
export { Result as Result };
|
|
54
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../resource';
|
|
4
|
-
import * as Core from '../core';
|
|
5
|
-
|
|
6
|
-
export class Workflows extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Get workflow by ID
|
|
9
|
-
*/
|
|
10
|
-
retrieve(workflowId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
11
|
-
return this._client.get(`/api/workflows/${workflowId}`, {
|
|
12
|
-
...options,
|
|
13
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get all workflows
|
|
19
|
-
*/
|
|
20
|
-
list(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
21
|
-
return this._client.get('/api/workflows', {
|
|
22
|
-
...options,
|
|
23
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Execute a workflow
|
|
29
|
-
*/
|
|
30
|
-
execute(
|
|
31
|
-
workflowId: string,
|
|
32
|
-
body: WorkflowExecuteParams,
|
|
33
|
-
options?: Core.RequestOptions,
|
|
34
|
-
): Core.APIPromise<void> {
|
|
35
|
-
return this._client.post(`/api/workflows/${workflowId}/execute`, {
|
|
36
|
-
body,
|
|
37
|
-
...options,
|
|
38
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface WorkflowExecuteParams {
|
|
44
|
-
input?: unknown;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export declare namespace Workflows {
|
|
48
|
-
export { type WorkflowExecuteParams as WorkflowExecuteParams };
|
|
49
|
-
}
|