@mastra/client-js 0.0.0-remove-cloud-span-transform-20250425214156 → 0.0.0-remove-unused-model-providers-api-20251030210744

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