@mastra/client-js 0.1.13 → 0.1.14-alpha.1

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.1.13-alpha.3 build /home/runner/work/mastra/mastra/client-sdks/client-js
2
+ > @mastra/client-js@0.1.14-alpha.1 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
- ESM dist/index.js 21.58 KB
13
- ESM ⚡️ Build success in 957ms
14
- CJS dist/index.cjs 21.76 KB
15
- CJS ⚡️ Build success in 957ms
12
+ ESM dist/index.js 21.61 KB
13
+ ESM ⚡️ Build success in 859ms
14
+ CJS dist/index.cjs 21.79 KB
15
+ CJS ⚡️ Build success in 860ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 11249ms
18
- DTS dist/index.d.ts 19.18 KB
19
- DTS dist/index.d.cts 19.18 KB
17
+ DTS ⚡️ Build success in 12860ms
18
+ DTS dist/index.d.ts 18.89 KB
19
+ DTS dist/index.d.cts 18.89 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 0.1.14-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [619c39d]
8
+ - Updated dependencies [fe56be0]
9
+ - Updated dependencies [a0967a0]
10
+ - Updated dependencies [fca3b21]
11
+ - Updated dependencies [0118361]
12
+ - Updated dependencies [619c39d]
13
+ - @mastra/core@0.8.0-alpha.1
14
+
15
+ ## 0.1.14-alpha.0
16
+
17
+ ### Patch Changes
18
+
19
+ - 8076ecf: Unify workflow watch/start response
20
+ - Updated dependencies [107bcfe]
21
+ - Updated dependencies [5b4e19f]
22
+ - Updated dependencies [7599d77]
23
+ - Updated dependencies [cafae83]
24
+ - Updated dependencies [8076ecf]
25
+ - Updated dependencies [304397c]
26
+ - @mastra/core@0.7.1-alpha.0
27
+
3
28
  ## 0.1.13
4
29
 
5
30
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -482,7 +482,7 @@ var Workflow = class extends BaseResource {
482
482
  if (record.trim().length > 0) {
483
483
  try {
484
484
  const parsedRecord = JSON.parse(record);
485
- const isWorkflowCompleted = parsedRecord?.activePaths?.every(
485
+ const isWorkflowCompleted = Object.values(parsedRecord?.activePaths || {}).every(
486
486
  (path) => path.status === "completed" || path.status === "suspended" || path.status === "failed" || path.status === "skipped"
487
487
  );
488
488
  if (isWorkflowCompleted) {
@@ -490,7 +490,7 @@ var Workflow = class extends BaseResource {
490
490
  }
491
491
  yield parsedRecord;
492
492
  } catch (e) {
493
- throw new Error(`Could not parse record: ${record}`);
493
+ throw new Error(`Could not parse record: ${record}, ${e}`);
494
494
  }
495
495
  }
496
496
  }
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
1
+ import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, WorkflowRunResult as WorkflowRunResult$1, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
2
2
  import { JSONSchema7 } from 'json-schema';
3
3
  import { ZodSchema } from 'zod';
4
4
  import { processDataStream } from '@ai-sdk/ui-utils';
@@ -53,27 +53,13 @@ interface GetWorkflowResponse {
53
53
  stepSubscriberGraph: Record<string, StepGraph>;
54
54
  }
55
55
  type WorkflowRunResult = {
56
- activePaths: Array<{
57
- stepId: string;
56
+ activePaths: Record<string, {
57
+ status: string;
58
+ suspendPayload?: any;
58
59
  stepPath: string[];
59
- status: 'completed' | 'suspended' | 'pending';
60
60
  }>;
61
- context: {
62
- steps: Record<string, {
63
- status: 'success';
64
- output: any;
65
- [key: string]: any;
66
- } | {
67
- status: 'pending';
68
- [key: string]: any;
69
- } | {
70
- status: 'suspended';
71
- suspendPayload: any;
72
- [key: string]: any;
73
- }>;
74
- };
61
+ results: WorkflowRunResult$1<any, any, any>['results'];
75
62
  timestamp: number;
76
- suspendedSteps: Record<string, any>;
77
63
  runId: string;
78
64
  };
79
65
  interface UpsertVectorParams {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
1
+ import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, WorkflowRunResult as WorkflowRunResult$1, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
2
2
  import { JSONSchema7 } from 'json-schema';
3
3
  import { ZodSchema } from 'zod';
4
4
  import { processDataStream } from '@ai-sdk/ui-utils';
@@ -53,27 +53,13 @@ interface GetWorkflowResponse {
53
53
  stepSubscriberGraph: Record<string, StepGraph>;
54
54
  }
55
55
  type WorkflowRunResult = {
56
- activePaths: Array<{
57
- stepId: string;
56
+ activePaths: Record<string, {
57
+ status: string;
58
+ suspendPayload?: any;
58
59
  stepPath: string[];
59
- status: 'completed' | 'suspended' | 'pending';
60
60
  }>;
61
- context: {
62
- steps: Record<string, {
63
- status: 'success';
64
- output: any;
65
- [key: string]: any;
66
- } | {
67
- status: 'pending';
68
- [key: string]: any;
69
- } | {
70
- status: 'suspended';
71
- suspendPayload: any;
72
- [key: string]: any;
73
- }>;
74
- };
61
+ results: WorkflowRunResult$1<any, any, any>['results'];
75
62
  timestamp: number;
76
- suspendedSteps: Record<string, any>;
77
63
  runId: string;
78
64
  };
79
65
  interface UpsertVectorParams {
package/dist/index.js CHANGED
@@ -480,7 +480,7 @@ var Workflow = class extends BaseResource {
480
480
  if (record.trim().length > 0) {
481
481
  try {
482
482
  const parsedRecord = JSON.parse(record);
483
- const isWorkflowCompleted = parsedRecord?.activePaths?.every(
483
+ const isWorkflowCompleted = Object.values(parsedRecord?.activePaths || {}).every(
484
484
  (path) => path.status === "completed" || path.status === "suspended" || path.status === "failed" || path.status === "skipped"
485
485
  );
486
486
  if (isWorkflowCompleted) {
@@ -488,7 +488,7 @@ var Workflow = class extends BaseResource {
488
488
  }
489
489
  yield parsedRecord;
490
490
  } catch (e) {
491
- throw new Error(`Could not parse record: ${record}`);
491
+ throw new Error(`Could not parse record: ${record}, ${e}`);
492
492
  }
493
493
  }
494
494
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/client-js",
3
- "version": "0.1.13",
3
+ "version": "0.1.14-alpha.1",
4
4
  "description": "The official TypeScript library for the Mastra Client API",
5
5
  "author": "",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "json-schema": "^0.4.0",
27
27
  "zod": "^3.24.2",
28
28
  "zod-to-json-schema": "^3.24.3",
29
- "@mastra/core": "^0.7.0"
29
+ "@mastra/core": "^0.8.0-alpha.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@babel/preset-env": "^7.26.9",
@@ -155,7 +155,7 @@ export class Workflow extends BaseResource {
155
155
  const parsedRecord = JSON.parse(record);
156
156
 
157
157
  //Check to see if all steps are completed and cancel reader
158
- const isWorkflowCompleted = parsedRecord?.activePaths?.every(
158
+ const isWorkflowCompleted = Object.values(parsedRecord?.activePaths || {}).every(
159
159
  (path: any) =>
160
160
  path.status === 'completed' ||
161
161
  path.status === 'suspended' ||
@@ -167,7 +167,7 @@ export class Workflow extends BaseResource {
167
167
  }
168
168
  yield parsedRecord;
169
169
  } catch (e) {
170
- throw new Error(`Could not parse record: ${record}`);
170
+ throw new Error(`Could not parse record: ${record}, ${e}`);
171
171
  }
172
172
  }
173
173
  }
package/src/types.ts CHANGED
@@ -7,6 +7,7 @@ import type {
7
7
  StepGraph,
8
8
  StorageThreadType,
9
9
  BaseLogMessage,
10
+ WorkflowRunResult as CoreWorkflowRunResult,
10
11
  } from '@mastra/core';
11
12
 
12
13
  import type { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
@@ -71,35 +72,11 @@ export interface GetWorkflowResponse {
71
72
  }
72
73
 
73
74
  export type WorkflowRunResult = {
74
- activePaths: Array<{
75
- stepId: string;
76
- stepPath: string[];
77
- status: 'completed' | 'suspended' | 'pending';
78
- }>;
79
- context: {
80
- steps: Record<
81
- string,
82
- | {
83
- status: 'success';
84
- output: any;
85
- [key: string]: any;
86
- }
87
- | {
88
- status: 'pending';
89
- [key: string]: any;
90
- }
91
- | {
92
- status: 'suspended';
93
- suspendPayload: any;
94
- [key: string]: any;
95
- }
96
- >;
97
- };
75
+ activePaths: Record<string, { status: string; suspendPayload?: any; stepPath: string[] }>;
76
+ results: CoreWorkflowRunResult<any, any, any>['results'];
98
77
  timestamp: number;
99
- suspendedSteps: Record<string, any>;
100
78
  runId: string;
101
79
  };
102
-
103
80
  export interface UpsertVectorParams {
104
81
  indexName: string;
105
82
  vectors: number[][];