@mastra/client-js 0.0.0-expose-more-playground-ui-20250502141824 → 0.0.0-extract-tool-ui-inp-playground-ui-20251023135343

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 (68) hide show
  1. package/CHANGELOG.md +2266 -2
  2. package/LICENSE.md +11 -42
  3. package/README.md +7 -8
  4. package/dist/client.d.ts +278 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/example.d.ts +2 -0
  7. package/dist/example.d.ts.map +1 -0
  8. package/dist/index.cjs +2699 -278
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +5 -715
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +2698 -283
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/a2a.d.ts +41 -0
  15. package/dist/resources/a2a.d.ts.map +1 -0
  16. package/dist/resources/agent-builder.d.ts +160 -0
  17. package/dist/resources/agent-builder.d.ts.map +1 -0
  18. package/dist/resources/agent.d.ts +200 -0
  19. package/dist/resources/agent.d.ts.map +1 -0
  20. package/dist/resources/base.d.ts +13 -0
  21. package/dist/resources/base.d.ts.map +1 -0
  22. package/dist/resources/index.d.ts +11 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/mcp-tool.d.ts +28 -0
  25. package/dist/resources/mcp-tool.d.ts.map +1 -0
  26. package/dist/resources/memory-thread.d.ts +53 -0
  27. package/dist/resources/memory-thread.d.ts.map +1 -0
  28. package/dist/resources/network-memory-thread.d.ts +47 -0
  29. package/dist/resources/network-memory-thread.d.ts.map +1 -0
  30. package/dist/resources/observability.d.ts +35 -0
  31. package/dist/resources/observability.d.ts.map +1 -0
  32. package/dist/resources/tool.d.ts +24 -0
  33. package/dist/resources/tool.d.ts.map +1 -0
  34. package/dist/resources/vector.d.ts +51 -0
  35. package/dist/resources/vector.d.ts.map +1 -0
  36. package/dist/resources/workflow.d.ts +269 -0
  37. package/dist/resources/workflow.d.ts.map +1 -0
  38. package/dist/tools.d.ts +22 -0
  39. package/dist/tools.d.ts.map +1 -0
  40. package/dist/types.d.ts +479 -0
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/utils/index.d.ts +5 -0
  43. package/dist/utils/index.d.ts.map +1 -0
  44. package/dist/utils/process-client-tools.d.ts +3 -0
  45. package/dist/utils/process-client-tools.d.ts.map +1 -0
  46. package/dist/utils/process-mastra-stream.d.ts +11 -0
  47. package/dist/utils/process-mastra-stream.d.ts.map +1 -0
  48. package/dist/utils/zod-to-json-schema.d.ts +3 -0
  49. package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
  50. package/package.json +38 -19
  51. package/dist/index.d.cts +0 -715
  52. package/eslint.config.js +0 -6
  53. package/src/client.ts +0 -232
  54. package/src/example.ts +0 -65
  55. package/src/index.test.ts +0 -710
  56. package/src/index.ts +0 -2
  57. package/src/resources/agent.ts +0 -204
  58. package/src/resources/base.ts +0 -70
  59. package/src/resources/index.ts +0 -8
  60. package/src/resources/memory-thread.ts +0 -53
  61. package/src/resources/network.ts +0 -92
  62. package/src/resources/tool.ts +0 -38
  63. package/src/resources/vector.ts +0 -83
  64. package/src/resources/vnext-workflow.ts +0 -234
  65. package/src/resources/workflow.ts +0 -223
  66. package/src/types.ts +0 -252
  67. package/tsconfig.json +0 -5
  68. package/vitest.config.js +0 -8
@@ -1,234 +0,0 @@
1
- import type { RuntimeContext } from '@mastra/core/runtime-context';
2
- import type {
3
- ClientOptions,
4
- GetVNextWorkflowResponse,
5
- GetWorkflowRunsResponse,
6
- VNextWorkflowRunResult,
7
- VNextWorkflowWatchResult,
8
- } from '../types';
9
-
10
- import { BaseResource } from './base';
11
-
12
- const RECORD_SEPARATOR = '\x1E';
13
-
14
- export class VNextWorkflow extends BaseResource {
15
- constructor(
16
- options: ClientOptions,
17
- private workflowId: string,
18
- ) {
19
- super(options);
20
- }
21
-
22
- /**
23
- * Creates an async generator that processes a readable stream and yields vNext workflow records
24
- * separated by the Record Separator character (\x1E)
25
- *
26
- * @param stream - The readable stream to process
27
- * @returns An async generator that yields parsed records
28
- */
29
- private async *streamProcessor(stream: ReadableStream): AsyncGenerator<VNextWorkflowWatchResult, void, unknown> {
30
- const reader = stream.getReader();
31
-
32
- // Track if we've finished reading from the stream
33
- let doneReading = false;
34
- // Buffer to accumulate partial chunks
35
- let buffer = '';
36
-
37
- try {
38
- while (!doneReading) {
39
- // Read the next chunk from the stream
40
- const { done, value } = await reader.read();
41
- doneReading = done;
42
-
43
- // Skip processing if we're done and there's no value
44
- if (done && !value) continue;
45
-
46
- try {
47
- // Decode binary data to text
48
- const decoded = value ? new TextDecoder().decode(value) : '';
49
-
50
- // Split the combined buffer and new data by record separator
51
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR);
52
-
53
- // The last chunk might be incomplete, so save it for the next iteration
54
- buffer = chunks.pop() || '';
55
-
56
- // Process complete chunks
57
- for (const chunk of chunks) {
58
- if (chunk) {
59
- // Only process non-empty chunks
60
- if (typeof chunk === 'string') {
61
- try {
62
- const parsedChunk = JSON.parse(chunk);
63
- yield parsedChunk;
64
- } catch {
65
- // Silently ignore parsing errors to maintain stream processing
66
- // This allows the stream to continue even if one record is malformed
67
- }
68
- }
69
- }
70
- }
71
- } catch {
72
- // Silently ignore parsing errors to maintain stream processing
73
- // This allows the stream to continue even if one record is malformed
74
- }
75
- }
76
-
77
- // Process any remaining data in the buffer after stream is done
78
- if (buffer) {
79
- try {
80
- yield JSON.parse(buffer);
81
- } catch {
82
- // Ignore parsing error for final chunk
83
- }
84
- }
85
- } finally {
86
- // Always ensure we clean up the reader
87
- reader.cancel().catch(() => {
88
- // Ignore cancel errors
89
- });
90
- }
91
- }
92
-
93
- /**
94
- * Retrieves details about the vNext workflow
95
- * @returns Promise containing vNext workflow details including steps and graphs
96
- */
97
- details(): Promise<GetVNextWorkflowResponse> {
98
- return this.request(`/api/workflows/v-next/${this.workflowId}`);
99
- }
100
-
101
- /**
102
- * Retrieves all runs for a vNext workflow
103
- * @returns Promise containing vNext workflow runs array
104
- */
105
- runs(): Promise<GetWorkflowRunsResponse> {
106
- return this.request(`/api/workflows/v-next/${this.workflowId}/runs`);
107
- }
108
-
109
- /**
110
- * Creates a new vNext workflow run
111
- * @param params - Optional object containing the optional runId
112
- * @returns Promise containing the runId of the created run
113
- */
114
- createRun(params?: { runId?: string }): Promise<{ runId: string }> {
115
- const searchParams = new URLSearchParams();
116
-
117
- if (!!params?.runId) {
118
- searchParams.set('runId', params.runId);
119
- }
120
-
121
- return this.request(`/api/workflows/v-next/${this.workflowId}/create-run?${searchParams.toString()}`, {
122
- method: 'POST',
123
- });
124
- }
125
-
126
- /**
127
- * Starts a vNext workflow run synchronously without waiting for the workflow to complete
128
- * @param params - Object containing the runId, inputData and runtimeContext
129
- * @returns Promise containing success message
130
- */
131
- start(params: {
132
- runId: string;
133
- inputData: Record<string, any>;
134
- runtimeContext?: RuntimeContext;
135
- }): Promise<{ message: string }> {
136
- return this.request(`/api/workflows/v-next/${this.workflowId}/start?runId=${params.runId}`, {
137
- method: 'POST',
138
- body: { inputData: params?.inputData, runtimeContext: params.runtimeContext },
139
- });
140
- }
141
-
142
- /**
143
- * Resumes a suspended vNext workflow step synchronously without waiting for the vNext workflow to complete
144
- * @param params - Object containing the runId, step, resumeData and runtimeContext
145
- * @returns Promise containing success message
146
- */
147
- resume({
148
- step,
149
- runId,
150
- resumeData,
151
- runtimeContext,
152
- }: {
153
- step: string | string[];
154
- runId: string;
155
- resumeData?: Record<string, any>;
156
- runtimeContext?: RuntimeContext;
157
- }): Promise<{ message: string }> {
158
- return this.request(`/api/workflows/v-next/${this.workflowId}/resume?runId=${runId}`, {
159
- method: 'POST',
160
- stream: true,
161
- body: {
162
- step,
163
- resumeData,
164
- runtimeContext,
165
- },
166
- });
167
- }
168
-
169
- /**
170
- * Starts a vNext workflow run asynchronously and returns a promise that resolves when the vNext workflow is complete
171
- * @param params - Object containing the optional runId, inputData and runtimeContext
172
- * @returns Promise containing the vNext workflow execution results
173
- */
174
- startAsync(params: {
175
- runId?: string;
176
- inputData: Record<string, any>;
177
- runtimeContext?: RuntimeContext;
178
- }): Promise<VNextWorkflowRunResult> {
179
- const searchParams = new URLSearchParams();
180
-
181
- if (!!params?.runId) {
182
- searchParams.set('runId', params.runId);
183
- }
184
-
185
- return this.request(`/api/workflows/v-next/${this.workflowId}/start-async?${searchParams.toString()}`, {
186
- method: 'POST',
187
- body: { inputData: params.inputData, runtimeContext: params.runtimeContext },
188
- });
189
- }
190
-
191
- /**
192
- * Resumes a suspended vNext workflow step asynchronously and returns a promise that resolves when the vNext workflow is complete
193
- * @param params - Object containing the runId, step, resumeData and runtimeContext
194
- * @returns Promise containing the vNext workflow resume results
195
- */
196
- resumeAsync(params: {
197
- runId: string;
198
- step: string | string[];
199
- resumeData?: Record<string, any>;
200
- runtimeContext?: RuntimeContext;
201
- }): Promise<VNextWorkflowRunResult> {
202
- return this.request(`/api/workflows/v-next/${this.workflowId}/resume-async?runId=${params.runId}`, {
203
- method: 'POST',
204
- body: {
205
- step: params.step,
206
- resumeData: params.resumeData,
207
- runtimeContext: params.runtimeContext,
208
- },
209
- });
210
- }
211
-
212
- /**
213
- * Watches vNext workflow transitions in real-time
214
- * @param runId - Optional run ID to filter the watch stream
215
- * @returns AsyncGenerator that yields parsed records from the vNext workflow watch stream
216
- */
217
- async watch({ runId }: { runId?: string }, onRecord: (record: VNextWorkflowWatchResult) => void) {
218
- const response: Response = await this.request(`/api/workflows/v-next/${this.workflowId}/watch?runId=${runId}`, {
219
- stream: true,
220
- });
221
-
222
- if (!response.ok) {
223
- throw new Error(`Failed to watch vNext workflow: ${response.statusText}`);
224
- }
225
-
226
- if (!response.body) {
227
- throw new Error('Response body is null');
228
- }
229
-
230
- for await (const record of this.streamProcessor(response.body)) {
231
- onRecord(record);
232
- }
233
- }
234
- }
@@ -1,223 +0,0 @@
1
- import type { GetWorkflowResponse, ClientOptions, WorkflowRunResult, GetWorkflowRunsResponse } from '../types';
2
-
3
- import { BaseResource } from './base';
4
-
5
- const RECORD_SEPARATOR = '\x1E';
6
-
7
- export class Workflow extends BaseResource {
8
- constructor(
9
- options: ClientOptions,
10
- private workflowId: string,
11
- ) {
12
- super(options);
13
- }
14
-
15
- /**
16
- * Retrieves details about the workflow
17
- * @returns Promise containing workflow details including steps and graphs
18
- */
19
- details(): Promise<GetWorkflowResponse> {
20
- return this.request(`/api/workflows/${this.workflowId}`);
21
- }
22
-
23
- /**
24
- * Retrieves all runs for a workflow
25
- * @returns Promise containing workflow runs array
26
- */
27
- runs(): Promise<GetWorkflowRunsResponse> {
28
- return this.request(`/api/workflows/${this.workflowId}/runs`);
29
- }
30
-
31
- /**
32
- * @deprecated Use `startAsync` instead
33
- * Executes the workflow with the provided parameters
34
- * @param params - Parameters required for workflow execution
35
- * @returns Promise containing the workflow execution results
36
- */
37
- execute(params: Record<string, any>): Promise<WorkflowRunResult> {
38
- return this.request(`/api/workflows/${this.workflowId}/execute`, {
39
- method: 'POST',
40
- body: params,
41
- });
42
- }
43
-
44
- /**
45
- * Creates a new workflow run
46
- * @returns Promise containing the generated run ID
47
- */
48
- createRun(params?: { runId?: string }): Promise<{ runId: string }> {
49
- const searchParams = new URLSearchParams();
50
-
51
- if (!!params?.runId) {
52
- searchParams.set('runId', params.runId);
53
- }
54
-
55
- return this.request(`/api/workflows/${this.workflowId}/createRun?${searchParams.toString()}`, {
56
- method: 'POST',
57
- });
58
- }
59
-
60
- /**
61
- * Starts a workflow run synchronously without waiting for the workflow to complete
62
- * @param params - Object containing the runId and triggerData
63
- * @returns Promise containing success message
64
- */
65
- start(params: { runId: string; triggerData: Record<string, any> }): Promise<{ message: string }> {
66
- return this.request(`/api/workflows/${this.workflowId}/start?runId=${params.runId}`, {
67
- method: 'POST',
68
- body: params?.triggerData,
69
- });
70
- }
71
-
72
- /**
73
- * Resumes a suspended workflow step synchronously without waiting for the workflow to complete
74
- * @param stepId - ID of the step to resume
75
- * @param runId - ID of the workflow run
76
- * @param context - Context to resume the workflow with
77
- * @returns Promise containing the workflow resume results
78
- */
79
- resume({
80
- stepId,
81
- runId,
82
- context,
83
- }: {
84
- stepId: string;
85
- runId: string;
86
- context: Record<string, any>;
87
- }): Promise<{ message: string }> {
88
- return this.request(`/api/workflows/${this.workflowId}/resume?runId=${runId}`, {
89
- method: 'POST',
90
- body: {
91
- stepId,
92
- context,
93
- },
94
- });
95
- }
96
-
97
- /**
98
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
99
- * @param params - Object containing the optional runId and triggerData
100
- * @returns Promise containing the workflow execution results
101
- */
102
- startAsync(params: { runId?: string; triggerData: Record<string, any> }): Promise<WorkflowRunResult> {
103
- const searchParams = new URLSearchParams();
104
-
105
- if (!!params?.runId) {
106
- searchParams.set('runId', params.runId);
107
- }
108
-
109
- return this.request(`/api/workflows/${this.workflowId}/start-async?${searchParams.toString()}`, {
110
- method: 'POST',
111
- body: params?.triggerData,
112
- });
113
- }
114
-
115
- /**
116
- * Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
117
- * @param params - Object containing the runId, stepId, and context
118
- * @returns Promise containing the workflow resume results
119
- */
120
- resumeAsync(params: { runId: string; stepId: string; context: Record<string, any> }): Promise<WorkflowRunResult> {
121
- return this.request(`/api/workflows/${this.workflowId}/resume-async?runId=${params.runId}`, {
122
- method: 'POST',
123
- body: {
124
- stepId: params.stepId,
125
- context: params.context,
126
- },
127
- });
128
- }
129
-
130
- /**
131
- * Creates an async generator that processes a readable stream and yields records
132
- * separated by the Record Separator character (\x1E)
133
- *
134
- * @param stream - The readable stream to process
135
- * @returns An async generator that yields parsed records
136
- */
137
- private async *streamProcessor(stream: ReadableStream): AsyncGenerator<WorkflowRunResult, void, unknown> {
138
- const reader = stream.getReader();
139
-
140
- // Track if we've finished reading from the stream
141
- let doneReading = false;
142
- // Buffer to accumulate partial chunks
143
- let buffer = '';
144
-
145
- try {
146
- while (!doneReading) {
147
- // Read the next chunk from the stream
148
- const { done, value } = await reader.read();
149
- doneReading = done;
150
-
151
- // Skip processing if we're done and there's no value
152
- if (done && !value) continue;
153
-
154
- try {
155
- // Decode binary data to text
156
- const decoded = value ? new TextDecoder().decode(value) : '';
157
-
158
- // Split the combined buffer and new data by record separator
159
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR);
160
-
161
- // The last chunk might be incomplete, so save it for the next iteration
162
- buffer = chunks.pop() || '';
163
-
164
- // Process complete chunks
165
- for (const chunk of chunks) {
166
- if (chunk) {
167
- // Only process non-empty chunks
168
- if (typeof chunk === 'string') {
169
- try {
170
- const parsedChunk = JSON.parse(chunk);
171
- yield parsedChunk;
172
- } catch {
173
- // Silently ignore parsing errors to maintain stream processing
174
- // This allows the stream to continue even if one record is malformed
175
- }
176
- }
177
- }
178
- }
179
- } catch {
180
- // Silently ignore parsing errors to maintain stream processing
181
- // This allows the stream to continue even if one record is malformed
182
- }
183
- }
184
-
185
- // Process any remaining data in the buffer after stream is done
186
- if (buffer) {
187
- try {
188
- yield JSON.parse(buffer);
189
- } catch {
190
- // Ignore parsing error for final chunk
191
- }
192
- }
193
- } finally {
194
- // Always ensure we clean up the reader
195
- reader.cancel().catch(() => {
196
- // Ignore cancel errors
197
- });
198
- }
199
- }
200
-
201
- /**
202
- * Watches workflow transitions in real-time
203
- * @param runId - Optional run ID to filter the watch stream
204
- * @returns AsyncGenerator that yields parsed records from the workflow watch stream
205
- */
206
- async watch({ runId }: { runId?: string }, onRecord: (record: WorkflowRunResult) => void) {
207
- const response: Response = await this.request(`/api/workflows/${this.workflowId}/watch?runId=${runId}`, {
208
- stream: true,
209
- });
210
-
211
- if (!response.ok) {
212
- throw new Error(`Failed to watch workflow: ${response.statusText}`);
213
- }
214
-
215
- if (!response.body) {
216
- throw new Error('Response body is null');
217
- }
218
-
219
- for await (const record of this.streamProcessor(response.body)) {
220
- onRecord(record);
221
- }
222
- }
223
- }
package/src/types.ts DELETED
@@ -1,252 +0,0 @@
1
- import type {
2
- MessageType,
3
- AiMessageType,
4
- CoreMessage,
5
- QueryResult,
6
- StepAction,
7
- StepGraph,
8
- StorageThreadType,
9
- BaseLogMessage,
10
- WorkflowRunResult as CoreWorkflowRunResult,
11
- WorkflowRuns,
12
- } from '@mastra/core';
13
-
14
- import type { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
15
- import type { NewWorkflow, WatchEvent, WorkflowResult as VNextWorkflowResult } from '@mastra/core/workflows/vNext';
16
- import type { JSONSchema7 } from 'json-schema';
17
- import type { ZodSchema } from 'zod';
18
-
19
- export interface ClientOptions {
20
- /** Base URL for API requests */
21
- baseUrl: string;
22
- /** Number of retry attempts for failed requests */
23
- retries?: number;
24
- /** Initial backoff time in milliseconds between retries */
25
- backoffMs?: number;
26
- /** Maximum backoff time in milliseconds between retries */
27
- maxBackoffMs?: number;
28
- /** Custom headers to include with requests */
29
- headers?: Record<string, string>;
30
- /** Abort signal for request */
31
- }
32
-
33
- export interface RequestOptions {
34
- method?: string;
35
- headers?: Record<string, string>;
36
- body?: any;
37
- stream?: boolean;
38
- signal?: AbortSignal;
39
- }
40
-
41
- export interface GetAgentResponse {
42
- name: string;
43
- instructions: string;
44
- tools: Record<string, GetToolResponse>;
45
- provider: string;
46
- modelId: string;
47
- }
48
-
49
- export type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
50
- messages: string | string[] | CoreMessage[] | AiMessageType[];
51
- } & Partial<AgentGenerateOptions<T>>;
52
-
53
- export type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
54
- messages: string | string[] | CoreMessage[] | AiMessageType[];
55
- } & Omit<AgentStreamOptions<T>, 'onFinish' | 'onStepFinish' | 'telemetry'>;
56
-
57
- export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
58
- evals: any[];
59
- instructions: string;
60
- name: string;
61
- id: string;
62
- }
63
-
64
- export interface GetToolResponse {
65
- id: string;
66
- description: string;
67
- inputSchema: string;
68
- outputSchema: string;
69
- }
70
-
71
- export interface GetWorkflowResponse {
72
- name: string;
73
- triggerSchema: string;
74
- steps: Record<string, StepAction<any, any, any, any>>;
75
- stepGraph: StepGraph;
76
- stepSubscriberGraph: Record<string, StepGraph>;
77
- workflowId?: string;
78
- }
79
-
80
- export type GetWorkflowRunsResponse = WorkflowRuns;
81
-
82
- export type WorkflowRunResult = {
83
- activePaths: Record<string, { status: string; suspendPayload?: any; stepPath: string[] }>;
84
- results: CoreWorkflowRunResult<any, any, any>['results'];
85
- timestamp: number;
86
- runId: string;
87
- };
88
-
89
- export interface GetVNextWorkflowResponse {
90
- name: string;
91
- steps: {
92
- [key: string]: {
93
- id: string;
94
- description: string;
95
- inputSchema: string;
96
- outputSchema: string;
97
- resumeSchema: string;
98
- suspendSchema: string;
99
- };
100
- };
101
- stepGraph: NewWorkflow['serializedStepGraph'];
102
- inputSchema: string;
103
- outputSchema: string;
104
- }
105
-
106
- export type VNextWorkflowWatchResult = WatchEvent & { runId: string };
107
-
108
- export type VNextWorkflowRunResult = VNextWorkflowResult<any, any>;
109
- export interface UpsertVectorParams {
110
- indexName: string;
111
- vectors: number[][];
112
- metadata?: Record<string, any>[];
113
- ids?: string[];
114
- }
115
- export interface CreateIndexParams {
116
- indexName: string;
117
- dimension: number;
118
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
119
- }
120
-
121
- export interface QueryVectorParams {
122
- indexName: string;
123
- queryVector: number[];
124
- topK?: number;
125
- filter?: Record<string, any>;
126
- includeVector?: boolean;
127
- }
128
-
129
- export interface QueryVectorResponse {
130
- results: QueryResult[];
131
- }
132
-
133
- export interface GetVectorIndexResponse {
134
- dimension: number;
135
- metric: 'cosine' | 'euclidean' | 'dotproduct';
136
- count: number;
137
- }
138
-
139
- export interface SaveMessageToMemoryParams {
140
- messages: MessageType[];
141
- agentId: string;
142
- }
143
-
144
- export type SaveMessageToMemoryResponse = MessageType[];
145
-
146
- export interface CreateMemoryThreadParams {
147
- title: string;
148
- metadata: Record<string, any>;
149
- resourceId: string;
150
- threadId: string;
151
- agentId: string;
152
- }
153
-
154
- export type CreateMemoryThreadResponse = StorageThreadType;
155
-
156
- export interface GetMemoryThreadParams {
157
- resourceId: string;
158
- agentId: string;
159
- }
160
-
161
- export type GetMemoryThreadResponse = StorageThreadType[];
162
-
163
- export interface UpdateMemoryThreadParams {
164
- title: string;
165
- metadata: Record<string, any>;
166
- resourceId: string;
167
- }
168
-
169
- export interface GetMemoryThreadMessagesResponse {
170
- messages: CoreMessage[];
171
- uiMessages: AiMessageType[];
172
- }
173
-
174
- export interface GetLogsParams {
175
- transportId: string;
176
- }
177
-
178
- export interface GetLogParams {
179
- runId: string;
180
- transportId: string;
181
- }
182
-
183
- export type GetLogsResponse = BaseLogMessage[];
184
-
185
- export type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
186
-
187
- type SpanStatus = {
188
- code: number;
189
- };
190
-
191
- type SpanOther = {
192
- droppedAttributesCount: number;
193
- droppedEventsCount: number;
194
- droppedLinksCount: number;
195
- };
196
-
197
- type SpanEventAttributes = {
198
- key: string;
199
- value: { [key: string]: string | number | boolean | null };
200
- };
201
-
202
- type SpanEvent = {
203
- attributes: SpanEventAttributes[];
204
- name: string;
205
- timeUnixNano: string;
206
- droppedAttributesCount: number;
207
- };
208
-
209
- type Span = {
210
- id: string;
211
- parentSpanId: string | null;
212
- traceId: string;
213
- name: string;
214
- scope: string;
215
- kind: number;
216
- status: SpanStatus;
217
- events: SpanEvent[];
218
- links: any[];
219
- attributes: Record<string, string | number | boolean | null>;
220
- startTime: number;
221
- endTime: number;
222
- duration: number;
223
- other: SpanOther;
224
- createdAt: string;
225
- };
226
-
227
- export interface GetTelemetryResponse {
228
- traces: Span[];
229
- }
230
-
231
- export interface GetTelemetryParams {
232
- name?: string;
233
- scope?: string;
234
- page?: number;
235
- perPage?: number;
236
- attribute?: Record<string, string>;
237
- }
238
-
239
- export interface GetNetworkResponse {
240
- name: string;
241
- instructions: string;
242
- agents: Array<{
243
- name: string;
244
- provider: string;
245
- modelId: string;
246
- }>;
247
- routingModel: {
248
- provider: string;
249
- modelId: string;
250
- };
251
- state?: Record<string, any>;
252
- }
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.node.json",
3
- "include": ["src/**/*"],
4
- "exclude": ["node_modules", "**/*.test.ts"]
5
- }