@mastra/client-js 1.47.0-alpha.2 → 1.47.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.
Files changed (46) hide show
  1. package/dist/client.d.ts +45 -201
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/docs/SKILL.md +1 -1
  4. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  5. package/dist/docs/references/reference-client-js-mastra-client.md +1 -1
  6. package/dist/index.cjs +57 -35
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +58 -36
  11. package/dist/index.js.map +1 -1
  12. package/dist/resources/a2a.d.ts +5 -1
  13. package/dist/resources/a2a.d.ts.map +1 -1
  14. package/dist/resources/agent-builder.d.ts +25 -40
  15. package/dist/resources/agent-builder.d.ts.map +1 -1
  16. package/dist/resources/agent-controller.d.ts +5 -4
  17. package/dist/resources/agent-controller.d.ts.map +1 -1
  18. package/dist/resources/agent.d.ts +32 -70
  19. package/dist/resources/agent.d.ts.map +1 -1
  20. package/dist/resources/channels.d.ts +13 -31
  21. package/dist/resources/channels.d.ts.map +1 -1
  22. package/dist/resources/conversations.d.ts +6 -3
  23. package/dist/resources/conversations.d.ts.map +1 -1
  24. package/dist/resources/mcp-tool.d.ts +3 -5
  25. package/dist/resources/mcp-tool.d.ts.map +1 -1
  26. package/dist/resources/memory-thread.d.ts +6 -11
  27. package/dist/resources/memory-thread.d.ts.map +1 -1
  28. package/dist/resources/observability-route-types.d.ts +88 -0
  29. package/dist/resources/observability-route-types.d.ts.map +1 -0
  30. package/dist/resources/observability.d.ts +6 -9
  31. package/dist/resources/observability.d.ts.map +1 -1
  32. package/dist/resources/responses.d.ts +5 -2
  33. package/dist/resources/responses.d.ts.map +1 -1
  34. package/dist/resources/run.d.ts +21 -57
  35. package/dist/resources/run.d.ts.map +1 -1
  36. package/dist/resources/tool.d.ts +6 -4
  37. package/dist/resources/tool.d.ts.map +1 -1
  38. package/dist/resources/vector.d.ts +5 -10
  39. package/dist/resources/vector.d.ts.map +1 -1
  40. package/dist/resources/workflow.d.ts +8 -10
  41. package/dist/resources/workflow.d.ts.map +1 -1
  42. package/dist/route-types.generated.d.ts +2750 -2127
  43. package/dist/route-types.generated.d.ts.map +1 -1
  44. package/dist/types.d.ts +230 -1598
  45. package/dist/types.d.ts.map +1 -1
  46. package/package.json +5 -5
@@ -1,4 +1,5 @@
1
1
  import type { RequestContext } from '@mastra/core/request-context';
2
+ import type { PathParams, RouteResponse } from '../route-types.generated.js';
2
3
  import type { CreateIndexParams, GetVectorIndexResponse, QueryVectorParams, QueryVectorResponse, ClientOptions, UpsertVectorParams } from '../types.js';
3
4
  import { BaseResource } from './base.js';
4
5
  export declare class Vector extends BaseResource {
@@ -10,15 +11,13 @@ export declare class Vector extends BaseResource {
10
11
  * @param requestContext - Optional request context to pass as query parameter
11
12
  * @returns Promise containing vector index details
12
13
  */
13
- details(indexName: string, requestContext?: RequestContext | Record<string, any>): Promise<GetVectorIndexResponse>;
14
+ details(indexName: PathParams<'GET /vector/:vectorName/indexes/:indexName'>['indexName'], requestContext?: RequestContext | Record<string, any>): Promise<GetVectorIndexResponse>;
14
15
  /**
15
16
  * Deletes a vector index
16
17
  * @param indexName - Name of the index to delete
17
18
  * @returns Promise indicating deletion success
18
19
  */
19
- delete(indexName: string): Promise<{
20
- success: boolean;
21
- }>;
20
+ delete(indexName: PathParams<'DELETE /vector/:vectorName/indexes/:indexName'>['indexName']): Promise<RouteResponse<'DELETE /vector/:vectorName/indexes/:indexName'>>;
22
21
  /**
23
22
  * Retrieves a list of all available indexes
24
23
  * @param requestContext - Optional request context to pass as query parameter
@@ -30,17 +29,13 @@ export declare class Vector extends BaseResource {
30
29
  * @param params - Parameters for index creation including dimension and metric
31
30
  * @returns Promise indicating creation success
32
31
  */
33
- createIndex(params: CreateIndexParams): Promise<{
34
- success: boolean;
35
- }>;
32
+ createIndex(params: CreateIndexParams): Promise<RouteResponse<'POST /vector/:vectorName/create-index'>>;
36
33
  /**
37
34
  * Upserts vectors into an index
38
35
  * @param params - Parameters containing vectors, metadata, and optional IDs
39
36
  * @returns Promise containing the inserted vector IDs
40
37
  */
41
- upsert(params: UpsertVectorParams): Promise<{
42
- ids: string[];
43
- }>;
38
+ upsert(params: UpsertVectorParams): Promise<RouteResponse<'POST /vector/:vectorName/upsert'>>;
44
39
  /**
45
40
  * Queries vectors in an index
46
41
  * @param params - Query parameters including query vector and search options
@@ -1 +1 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../src/resources/vector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,MAAO,SAAQ,YAAY;IAGpC,OAAO,CAAC,UAAU;IAFpB,YACE,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM,EAG3B;IAED;;;;;OAKG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAIjH;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAIvD;IAED;;;;OAIG;IACH,UAAU,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAInF;IAED;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,iBAAiB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,OAAO,CAAC,MAAM,EAAE,CAAC,CAInF;IAED;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,uCAAuC,CAAC,CAAC,CAKtG;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,iCAAiC,CAAC,CAAC,CAK5F;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAK7D;CACF"}
@@ -1,10 +1,13 @@
1
1
  import type { RequestContext } from '@mastra/core/request-context';
2
+ import type { Body, PathParams, QueryParams, RouteResponse } from '../route-types.generated.js';
2
3
  import type { ClientOptions, GetWorkflowResponse, ListWorkflowRunsResponse, ListWorkflowRunsParams, GetWorkflowRunByIdResponse } from '../types.js';
3
4
  import { BaseResource } from './base.js';
4
5
  import { Run } from './run.js';
6
+ type WorkflowId = PathParams<'GET /workflows/:workflowId'>['workflowId'];
7
+ type WorkflowRunId = PathParams<'GET /workflows/:workflowId/runs/:runId'>['runId'];
5
8
  export declare class Workflow extends BaseResource {
6
9
  private workflowId;
7
- constructor(options: ClientOptions, workflowId: string);
10
+ constructor(options: ClientOptions, workflowId: WorkflowId);
8
11
  /**
9
12
  * Retrieves details about the workflow
10
13
  * @param requestContext - Optional request context to pass as query parameter
@@ -27,7 +30,7 @@ export declare class Workflow extends BaseResource {
27
30
  * @param options.withNestedWorkflows - Whether to include nested workflow data in steps. Defaults to true. Set to false for better performance when you don't need nested workflow details.
28
31
  * @returns Promise containing the workflow run details with metadata and processed execution state
29
32
  */
30
- runById(runId: string, options?: {
33
+ runById(runId: WorkflowRunId, options?: {
31
34
  requestContext?: RequestContext | Record<string, any>;
32
35
  fields?: string[];
33
36
  withNestedWorkflows?: boolean;
@@ -37,9 +40,7 @@ export declare class Workflow extends BaseResource {
37
40
  * @param runId - The ID of the workflow run to delete
38
41
  * @returns Promise containing a success message
39
42
  */
40
- deleteRunById(runId: string): Promise<{
41
- message: string;
42
- }>;
43
+ deleteRunById(runId: WorkflowRunId): Promise<RouteResponse<'DELETE /workflows/:workflowId/runs/:runId'>>;
43
44
  /**
44
45
  * Retrieves the input/output schema for the workflow
45
46
  * @returns Promise containing parsed inputSchema and outputSchema, or null if not defined
@@ -53,11 +54,7 @@ export declare class Workflow extends BaseResource {
53
54
  * @param params - Optional object containing the optional runId
54
55
  * @returns Promise containing the Run instance
55
56
  */
56
- createRun(params?: {
57
- runId?: string;
58
- resourceId?: string;
59
- disableScorers?: boolean;
60
- }): Promise<Run>;
57
+ createRun(params?: QueryParams<'POST /workflows/:workflowId/create-run'> & Body<'POST /workflows/:workflowId/create-run'>): Promise<Run>;
61
58
  /**
62
59
  * Creates a new ReadableStream from an iterable or async iterable of objects,
63
60
  * serializing each as JSON and separating them with the record separator (\x1E).
@@ -67,4 +64,5 @@ export declare class Workflow extends BaseResource {
67
64
  */
68
65
  static createRecordStream(records: Iterable<any> | AsyncIterable<any>): ReadableStream;
69
66
  }
67
+ export {};
70
68
  //# sourceMappingURL=workflow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/resources/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5B,qBAAa,QAAS,SAAQ,YAAY;IAGtC,OAAO,CAAC,UAAU;IAFpB,YACE,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM,EAG3B;IAED;;;;OAIG;IACH,OAAO,CAAC,cAAc,CAAC,EAAE,cAAc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