@mastra/client-js 0.10.10-alpha.0 → 0.10.10-alpha.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @mastra/client-js@0.10.10-alpha.0 build /home/runner/work/mastra/mastra/client-sdks/client-js
2
+ > @mastra/client-js@0.10.10-alpha.2 build /home/runner/work/mastra/mastra/client-sdks/client-js
3
3
  > tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,11 +9,11 @@
9
9
  CLI Cleaning output folder
10
10
  ESM Build start
11
11
  CJS Build start
12
- CJS dist/index.cjs 68.75 KB
13
- CJS ⚡️ Build success in 2041ms
14
- ESM dist/index.js 68.47 KB
15
- ESM ⚡️ Build success in 2045ms
12
+ CJS dist/index.cjs 68.80 KB
13
+ CJS ⚡️ Build success in 1853ms
14
+ ESM dist/index.js 68.51 KB
15
+ ESM ⚡️ Build success in 1854ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 15849ms
18
- DTS dist/index.d.ts 40.58 KB
19
- DTS dist/index.d.cts 40.58 KB
17
+ DTS ⚡️ Build success in 15925ms
18
+ DTS dist/index.d.ts 40.65 KB
19
+ DTS dist/index.d.cts 40.65 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 0.10.10-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 18da791: Add abortSignal to client SDK options
8
+ - Updated dependencies [2873c7f]
9
+ - Updated dependencies [1c1c6a1]
10
+ - Updated dependencies [565cc0c]
11
+ - @mastra/core@0.10.11-alpha.2
12
+
13
+ ## 0.10.10-alpha.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [7f6e403]
18
+ - @mastra/core@0.10.11-alpha.1
19
+
3
20
  ## 0.10.10-alpha.0
4
21
 
5
22
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -258,6 +258,7 @@ var BaseResource = class {
258
258
  // TODO: Bring this back once we figure out what we/users need to do to make this work with cross-origin requests
259
259
  // 'x-mastra-client-type': 'js',
260
260
  },
261
+ signal: this.options.abortSignal,
261
262
  body: options.body instanceof FormData ? options.body : options.body ? JSON.stringify(options.body) : void 0
262
263
  });
263
264
  if (!response.ok) {
package/dist/index.d.cts CHANGED
@@ -23,13 +23,14 @@ interface ClientOptions {
23
23
  maxBackoffMs?: number;
24
24
  /** Custom headers to include with requests */
25
25
  headers?: Record<string, string>;
26
+ /** Abort signal for request */
27
+ abortSignal?: AbortSignal;
26
28
  }
27
29
  interface RequestOptions {
28
30
  method?: string;
29
31
  headers?: Record<string, string>;
30
32
  body?: any;
31
33
  stream?: boolean;
32
- signal?: AbortSignal;
33
34
  }
34
35
  type WithoutMethods<T> = {
35
36
  [K in keyof T as T[K] extends (...args: any[]) => any ? never : T[K] extends {
@@ -52,14 +53,14 @@ type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> =
52
53
  experimental_output?: T;
53
54
  runtimeContext?: RuntimeContext | Record<string, any>;
54
55
  clientTools?: ToolsInput;
55
- } & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools'>>;
56
+ } & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
56
57
  type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
57
58
  messages: string | string[] | CoreMessage[] | AiMessageType[];
58
59
  output?: T;
59
60
  experimental_output?: T;
60
61
  runtimeContext?: RuntimeContext | Record<string, any>;
61
62
  clientTools?: ToolsInput;
62
- } & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools'>>;
63
+ } & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
63
64
  interface GetEvalsByAgentIdResponse extends GetAgentResponse {
64
65
  evals: any[];
65
66
  instructions: string;
package/dist/index.d.ts CHANGED
@@ -23,13 +23,14 @@ interface ClientOptions {
23
23
  maxBackoffMs?: number;
24
24
  /** Custom headers to include with requests */
25
25
  headers?: Record<string, string>;
26
+ /** Abort signal for request */
27
+ abortSignal?: AbortSignal;
26
28
  }
27
29
  interface RequestOptions {
28
30
  method?: string;
29
31
  headers?: Record<string, string>;
30
32
  body?: any;
31
33
  stream?: boolean;
32
- signal?: AbortSignal;
33
34
  }
34
35
  type WithoutMethods<T> = {
35
36
  [K in keyof T as T[K] extends (...args: any[]) => any ? never : T[K] extends {
@@ -52,14 +53,14 @@ type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> =
52
53
  experimental_output?: T;
53
54
  runtimeContext?: RuntimeContext | Record<string, any>;
54
55
  clientTools?: ToolsInput;
55
- } & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools'>>;
56
+ } & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
56
57
  type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
57
58
  messages: string | string[] | CoreMessage[] | AiMessageType[];
58
59
  output?: T;
59
60
  experimental_output?: T;
60
61
  runtimeContext?: RuntimeContext | Record<string, any>;
61
62
  clientTools?: ToolsInput;
62
- } & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools'>>;
63
+ } & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
63
64
  interface GetEvalsByAgentIdResponse extends GetAgentResponse {
64
65
  evals: any[];
65
66
  instructions: string;
package/dist/index.js CHANGED
@@ -252,6 +252,7 @@ var BaseResource = class {
252
252
  // TODO: Bring this back once we figure out what we/users need to do to make this work with cross-origin requests
253
253
  // 'x-mastra-client-type': 'js',
254
254
  },
255
+ signal: this.options.abortSignal,
255
256
  body: options.body instanceof FormData ? options.body : options.body ? JSON.stringify(options.body) : void 0
256
257
  });
257
258
  if (!response.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/client-js",
3
- "version": "0.10.10-alpha.0",
3
+ "version": "0.10.10-alpha.2",
4
4
  "description": "The official TypeScript library for the Mastra Client API",
5
5
  "author": "",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "rxjs": "7.8.1",
34
34
  "zod": "^3.25.67",
35
35
  "zod-to-json-schema": "^3.24.5",
36
- "@mastra/core": "0.10.11-alpha.0"
36
+ "@mastra/core": "0.10.11-alpha.2"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "zod": "^3.0.0"
@@ -30,6 +30,7 @@ export class BaseResource {
30
30
  // TODO: Bring this back once we figure out what we/users need to do to make this work with cross-origin requests
31
31
  // 'x-mastra-client-type': 'js',
32
32
  },
33
+ signal: this.options.abortSignal,
33
34
  body:
34
35
  options.body instanceof FormData ? options.body : options.body ? JSON.stringify(options.body) : undefined,
35
36
  });
package/src/types.ts CHANGED
@@ -34,6 +34,7 @@ export interface ClientOptions {
34
34
  /** Custom headers to include with requests */
35
35
  headers?: Record<string, string>;
36
36
  /** Abort signal for request */
37
+ abortSignal?: AbortSignal;
37
38
  }
38
39
 
39
40
  export interface RequestOptions {
@@ -41,7 +42,6 @@ export interface RequestOptions {
41
42
  headers?: Record<string, string>;
42
43
  body?: any;
43
44
  stream?: boolean;
44
- signal?: AbortSignal;
45
45
  }
46
46
 
47
47
  type WithoutMethods<T> = {
@@ -71,7 +71,9 @@ export type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undef
71
71
  experimental_output?: T;
72
72
  runtimeContext?: RuntimeContext | Record<string, any>;
73
73
  clientTools?: ToolsInput;
74
- } & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools'>>;
74
+ } & WithoutMethods<
75
+ Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>
76
+ >;
75
77
 
76
78
  export type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
77
79
  messages: string | string[] | CoreMessage[] | AiMessageType[];
@@ -79,7 +81,9 @@ export type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefin
79
81
  experimental_output?: T;
80
82
  runtimeContext?: RuntimeContext | Record<string, any>;
81
83
  clientTools?: ToolsInput;
82
- } & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools'>>;
84
+ } & WithoutMethods<
85
+ Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>
86
+ >;
83
87
 
84
88
  export interface GetEvalsByAgentIdResponse extends GetAgentResponse {
85
89
  evals: any[];