@mastra/client-js 0.0.0-error-handler-fix-20251020202607 → 0.0.0-esbuild-bundle-worker-20260807182016

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 (127) hide show
  1. package/CHANGELOG.md +9405 -3
  2. package/LICENSE.md +15 -0
  3. package/README.md +11 -13
  4. package/dist/_types/@ai-sdk_provider/dist/index.d.ts +1587 -0
  5. package/dist/_types/@ai-sdk_provider-utils/dist/index.d.ts +379 -0
  6. package/dist/_types/@ai-sdk_ui-utils/dist/index.d.ts +820 -0
  7. package/dist/agent-learning.d.ts +182 -0
  8. package/dist/agent-learning.d.ts.map +1 -0
  9. package/dist/client.d.ts +767 -80
  10. package/dist/client.d.ts.map +1 -1
  11. package/dist/docs/SKILL.md +52 -0
  12. package/dist/docs/assets/SOURCE_MAP.json +6 -0
  13. package/dist/docs/references/docs-agents-a2a.md +340 -0
  14. package/dist/docs/references/docs-editor-overview.md +349 -0
  15. package/dist/docs/references/docs-long-running-agents-schedules.md +201 -0
  16. package/dist/docs/references/docs-long-running-agents-signals.md +426 -0
  17. package/dist/docs/references/docs-server-auth-auth0.md +262 -0
  18. package/dist/docs/references/docs-server-auth-clerk.md +154 -0
  19. package/dist/docs/references/docs-server-auth-firebase.md +294 -0
  20. package/dist/docs/references/docs-server-auth-jwt.md +116 -0
  21. package/dist/docs/references/docs-server-auth-supabase.md +139 -0
  22. package/dist/docs/references/docs-server-auth-workos.md +271 -0
  23. package/dist/docs/references/docs-server-mastra-client.md +323 -0
  24. package/dist/docs/references/reference-ai-sdk-to-ai-sdk-messages.md +97 -0
  25. package/dist/docs/references/reference-ai-sdk-to-ai-sdk-stream.md +282 -0
  26. package/dist/docs/references/reference-ai-sdk-to-ai-sdk-v4-messages.md +81 -0
  27. package/dist/docs/references/reference-ai-sdk-to-ai-sdk-v5-messages.md +78 -0
  28. package/dist/docs/references/reference-client-js-agents.md +959 -0
  29. package/dist/docs/references/reference-client-js-conversations.md +137 -0
  30. package/dist/docs/references/reference-client-js-error-handling.md +18 -0
  31. package/dist/docs/references/reference-client-js-logs.md +26 -0
  32. package/dist/docs/references/reference-client-js-mastra-client.md +96 -0
  33. package/dist/docs/references/reference-client-js-memory.md +237 -0
  34. package/dist/docs/references/reference-client-js-observability.md +183 -0
  35. package/dist/docs/references/reference-client-js-responses.md +219 -0
  36. package/dist/docs/references/reference-client-js-telemetry.md +22 -0
  37. package/dist/docs/references/reference-client-js-tools.md +46 -0
  38. package/dist/docs/references/reference-client-js-vectors.md +81 -0
  39. package/dist/docs/references/reference-client-js-workflows.md +393 -0
  40. package/dist/docs/references/reference-editor-versioning.md +130 -0
  41. package/dist/index.cjs +7638 -3257
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.ts +9 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +7606 -3252
  46. package/dist/index.js.map +1 -1
  47. package/dist/observability/collector.d.ts +45 -0
  48. package/dist/observability/collector.d.ts.map +1 -0
  49. package/dist/observability/index.d.ts +14 -0
  50. package/dist/observability/index.d.ts.map +1 -0
  51. package/dist/observability/types.d.ts +27 -0
  52. package/dist/observability/types.d.ts.map +1 -0
  53. package/dist/resources/a2a.d.ts +80 -11
  54. package/dist/resources/a2a.d.ts.map +1 -1
  55. package/dist/resources/agent-builder.d.ts +57 -72
  56. package/dist/resources/agent-builder.d.ts.map +1 -1
  57. package/dist/resources/agent-controller.d.ts +589 -0
  58. package/dist/resources/agent-controller.d.ts.map +1 -0
  59. package/dist/resources/agent.d.ts +368 -59
  60. package/dist/resources/agent.d.ts.map +1 -1
  61. package/dist/resources/base.d.ts +2 -1
  62. package/dist/resources/base.d.ts.map +1 -1
  63. package/dist/resources/channels.d.ts +63 -0
  64. package/dist/resources/channels.d.ts.map +1 -0
  65. package/dist/resources/conversations.d.ts +15 -0
  66. package/dist/resources/conversations.d.ts.map +1 -0
  67. package/dist/resources/index.d.ts +14 -0
  68. package/dist/resources/index.d.ts.map +1 -1
  69. package/dist/resources/mcp-tool.d.ts +5 -5
  70. package/dist/resources/mcp-tool.d.ts.map +1 -1
  71. package/dist/resources/memory-thread.d.ts +51 -16
  72. package/dist/resources/memory-thread.d.ts.map +1 -1
  73. package/dist/resources/observability.d.ts +222 -19
  74. package/dist/resources/observability.d.ts.map +1 -1
  75. package/dist/resources/processor-provider.d.ts +15 -0
  76. package/dist/resources/processor-provider.d.ts.map +1 -0
  77. package/dist/resources/processor.d.ts +20 -0
  78. package/dist/resources/processor.d.ts.map +1 -0
  79. package/dist/resources/responses.d.ts +22 -0
  80. package/dist/resources/responses.d.ts.map +1 -0
  81. package/dist/resources/run.d.ts +256 -0
  82. package/dist/resources/run.d.ts.map +1 -0
  83. package/dist/resources/stored-agent.d.ts +112 -0
  84. package/dist/resources/stored-agent.d.ts.map +1 -0
  85. package/dist/resources/stored-mcp-client.d.ts +30 -0
  86. package/dist/resources/stored-mcp-client.d.ts.map +1 -0
  87. package/dist/resources/stored-prompt-block.d.ts +83 -0
  88. package/dist/resources/stored-prompt-block.d.ts.map +1 -0
  89. package/dist/resources/stored-scorer.d.ts +83 -0
  90. package/dist/resources/stored-scorer.d.ts.map +1 -0
  91. package/dist/resources/stored-skill.d.ts +40 -0
  92. package/dist/resources/stored-skill.d.ts.map +1 -0
  93. package/dist/resources/stored-workflow.d.ts +18 -0
  94. package/dist/resources/stored-workflow.d.ts.map +1 -0
  95. package/dist/resources/tool-provider.d.ts +80 -0
  96. package/dist/resources/tool-provider.d.ts.map +1 -0
  97. package/dist/resources/tool.d.ts +4 -4
  98. package/dist/resources/vector.d.ts +9 -9
  99. package/dist/resources/vector.d.ts.map +1 -1
  100. package/dist/resources/workflow.d.ts +32 -231
  101. package/dist/resources/workflow.d.ts.map +1 -1
  102. package/dist/resources/workspace.d.ts +129 -0
  103. package/dist/resources/workspace.d.ts.map +1 -0
  104. package/dist/route-types.generated.d.ts +18087 -0
  105. package/dist/route-types.generated.d.ts.map +1 -0
  106. package/dist/tools.d.ts +3 -6
  107. package/dist/tools.d.ts.map +1 -1
  108. package/dist/types.d.ts +2740 -197
  109. package/dist/types.d.ts.map +1 -1
  110. package/dist/utils/client-tool-model-output.d.ts +16 -0
  111. package/dist/utils/client-tool-model-output.d.ts.map +1 -0
  112. package/dist/utils/index.d.ts +65 -4
  113. package/dist/utils/index.d.ts.map +1 -1
  114. package/dist/utils/process-a2a-stream.d.ts +4 -0
  115. package/dist/utils/process-a2a-stream.d.ts.map +1 -0
  116. package/dist/utils/process-client-tools.d.ts.map +1 -1
  117. package/dist/utils/process-mastra-stream.d.ts +8 -7
  118. package/dist/utils/process-mastra-stream.d.ts.map +1 -1
  119. package/dist/utils/stream-transforms.d.ts +9 -0
  120. package/dist/utils/stream-transforms.d.ts.map +1 -0
  121. package/dist/utils/verify-agent-card-signature.d.ts +21 -0
  122. package/dist/utils/verify-agent-card-signature.d.ts.map +1 -0
  123. package/dist/utils/zod-to-json-schema.d.ts +11 -2
  124. package/dist/utils/zod-to-json-schema.d.ts.map +1 -1
  125. package/package.json +26 -19
  126. package/dist/resources/network-memory-thread.d.ts +0 -47
  127. package/dist/resources/network-memory-thread.d.ts.map +0 -1
@@ -0,0 +1,18 @@
1
+ import type { ClientOptions, DeleteStoredWorkflowResponse, StoredWorkflowDefinition } from '../types.js';
2
+ import { BaseResource } from './base.js';
3
+ /** Resource for interacting with a specific stored workflow definition. */
4
+ export declare class StoredWorkflow extends BaseResource {
5
+ private storedWorkflowId;
6
+ constructor(options: ClientOptions, storedWorkflowId: string);
7
+ /**
8
+ * Retrieves the full stored workflow definition (schemas, graph, status, metadata)
9
+ * @returns Promise containing the stored workflow definition
10
+ */
11
+ details(): Promise<StoredWorkflowDefinition>;
12
+ /**
13
+ * Deletes the stored workflow definition and unregisters it from the server
14
+ * @returns Promise containing the deletion result
15
+ */
16
+ delete(): Promise<DeleteStoredWorkflowResponse>;
17
+ }
18
+ //# sourceMappingURL=stored-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stored-workflow.d.ts","sourceRoot":"","sources":["../../src/resources/stored-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEtG,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,2EAA2E;AAC3E,qBAAa,cAAe,SAAQ,YAAY;IAG5C,OAAO,CAAC,gBAAgB;gBADxB,OAAO,EAAE,aAAa,EACd,gBAAgB,EAAE,MAAM;IAKlC;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAI5C;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,4BAA4B,CAAC;CAKhD"}
@@ -0,0 +1,80 @@
1
+ import type { AuthorizeToolProviderParams, AuthorizeToolProviderResponse, ClientOptions, DisconnectToolProviderConnectionParams, DisconnectToolProviderConnectionResponse, GetToolProviderConnectionUsageParams, GetToolProviderConnectionUsageResponse, GetToolProviderToolSchemaResponse, ListToolProviderConnectionFieldsParams, ListToolProviderConnectionFieldsResponse, ListToolProviderConnectionsParams, ListToolProviderConnectionsResponse, ListToolProviderToolkitsResponse, ListToolProviderToolsParams, ListToolProviderToolsResponse, ToolProviderAuthStatusResponse, ToolProviderConnectionStatusParams, ToolProviderConnectionStatusResponse, ToolProviderHealthResponse, UpdateToolProviderConnectionParams, UpdateToolProviderConnectionResponse } from '../types.js';
2
+ import { BaseResource } from './base.js';
3
+ /**
4
+ * Resource for interacting with a specific tool provider.
5
+ *
6
+ * Exposes the catalog (toolkits + tools), the OAuth surface (authorize +
7
+ * auth-status + connection-status), the lifecycle surface (connections list /
8
+ * disconnect / usage / fields), and a provider-level health check.
9
+ */
10
+ export declare class ToolProvider extends BaseResource {
11
+ private providerId;
12
+ constructor(options: ClientOptions, providerId: string);
13
+ /**
14
+ * Lists available toolkits from this provider.
15
+ */
16
+ listToolkits(): Promise<ListToolProviderToolkitsResponse>;
17
+ /**
18
+ * Lists available tools from this provider, with optional filtering.
19
+ */
20
+ listTools(params?: ListToolProviderToolsParams): Promise<ListToolProviderToolsResponse>;
21
+ /**
22
+ * Gets the input schema for a specific tool.
23
+ */
24
+ getToolSchema(toolSlug: string): Promise<GetToolProviderToolSchemaResponse>;
25
+ /**
26
+ * Starts an OAuth flow for a (toolkit, connectionId) pair. Returns a
27
+ * redirect URL and an opaque auth handle to poll with `getAuthStatus`.
28
+ */
29
+ authorize(params: AuthorizeToolProviderParams): Promise<AuthorizeToolProviderResponse>;
30
+ /**
31
+ * Polls the OAuth flow status for an outstanding authorize call.
32
+ */
33
+ getAuthStatus(authId: string): Promise<ToolProviderAuthStatusResponse>;
34
+ /**
35
+ * Batch-checks whether a set of (connectionId, toolkit) tuples are
36
+ * currently connected.
37
+ */
38
+ getConnectionStatus(params: ToolProviderConnectionStatusParams): Promise<ToolProviderConnectionStatusResponse>;
39
+ /**
40
+ * Lists existing provider connections, scoped to a toolkit.
41
+ *
42
+ * Default: the connection owner is resolved server-side from the request's
43
+ * auth context. Admin callers (with `tool-providers:admin` permission) may
44
+ * pass `authorId` to target a specific author, or omit it to receive
45
+ * connections across all authors known to `tool_provider_connections` for
46
+ * this provider/toolkit. Pagination is page-based via `page` (1-indexed)
47
+ * and `perPage` (default 50, max 200).
48
+ */
49
+ listConnections(params: ListToolProviderConnectionsParams): Promise<ListToolProviderConnectionsResponse>;
50
+ /**
51
+ * Lists provider-specific fields the picker should collect before
52
+ * initiating a new connection (e.g. Confluence subdomain). Most toolkits
53
+ * return an empty array.
54
+ */
55
+ listConnectionFields(params: ListToolProviderConnectionFieldsParams): Promise<ListToolProviderConnectionFieldsResponse>;
56
+ /**
57
+ * Disconnects (revokes + deletes) a persisted connection.
58
+ *
59
+ * Without `force: true` the server refuses if any agent still pins the
60
+ * connection. With `force: true` the provider-side revoke is best-effort
61
+ * (errors are tolerated) and the local row is always removed.
62
+ */
63
+ disconnectConnection(connectionId: string, params?: DisconnectToolProviderConnectionParams): Promise<DisconnectToolProviderConnectionResponse>;
64
+ /**
65
+ * Updates the persisted display label on a connection row. Pass `label: null`
66
+ * (or an empty string) to clear the existing label. Only the connection owner
67
+ * or an admin may rename, unless the row is `scope: 'shared'`.
68
+ */
69
+ updateConnection(connectionId: string, params: UpdateToolProviderConnectionParams): Promise<UpdateToolProviderConnectionResponse>;
70
+ /**
71
+ * Lists the agents that currently pin a given connection. Used by the
72
+ * picker to warn the user before disconnecting a shared account.
73
+ */
74
+ getConnectionUsage(connectionId: string, params?: GetToolProviderConnectionUsageParams): Promise<GetToolProviderConnectionUsageResponse>;
75
+ /**
76
+ * Returns provider-level health (config, reachability, etc.).
77
+ */
78
+ getHealth(): Promise<ToolProviderHealthResponse>;
79
+ }
80
+ //# sourceMappingURL=tool-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-provider.d.ts","sourceRoot":"","sources":["../../src/resources/tool-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,sCAAsC,EACtC,wCAAwC,EACxC,oCAAoC,EACpC,sCAAsC,EACtC,iCAAiC,EACjC,sCAAsC,EACtC,wCAAwC,EACxC,iCAAiC,EACjC,mCAAmC,EACnC,gCAAgC,EAChC,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,oCAAoC,EACpC,0BAA0B,EAC1B,kCAAkC,EAClC,oCAAoC,EACrC,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAG1C,OAAO,CAAC,UAAU;gBADlB,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM;IAK5B;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,gCAAgC,CAAC;IAIzD;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAsBvF;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iCAAiC,CAAC;IAM3E;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAOtF;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAMtE;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,oCAAoC,CAAC;IAO9G;;;;;;;;;OASG;IACH,eAAe,CAAC,MAAM,EAAE,iCAAiC,GAAG,OAAO,CAAC,mCAAmC,CAAC;IAoBxG;;;;OAIG;IACH,oBAAoB,CAClB,MAAM,EAAE,sCAAsC,GAC7C,OAAO,CAAC,wCAAwC,CAAC;IAQpD;;;;;;OAMG;IACH,oBAAoB,CAClB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,sCAAsC,GAC9C,OAAO,CAAC,wCAAwC,CAAC;IAmBpD;;;;OAIG;IACH,gBAAgB,CACd,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,oCAAoC,CAAC;IAUhD;;;OAGG;IACH,kBAAkB,CAChB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,oCAAoC,GAC5C,OAAO,CAAC,sCAAsC,CAAC;IAalD;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,0BAA0B,CAAC;CAGjD"}
@@ -1,4 +1,4 @@
1
- import type { RuntimeContext } from '@mastra/core/runtime-context';
1
+ import type { RequestContext } from '@mastra/core/request-context';
2
2
  import type { GetToolResponse, ClientOptions } from '../types.js';
3
3
  import { BaseResource } from './base.js';
4
4
  export declare class Tool extends BaseResource {
@@ -6,10 +6,10 @@ export declare class Tool extends BaseResource {
6
6
  constructor(options: ClientOptions, toolId: string);
7
7
  /**
8
8
  * Retrieves details about the tool
9
- * @param runtimeContext - Optional runtime context to pass as query parameter
9
+ * @param requestContext - Optional request context to pass as query parameter
10
10
  * @returns Promise containing tool details including description and schemas
11
11
  */
12
- details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetToolResponse>;
12
+ details(requestContext?: RequestContext | Record<string, any>): Promise<GetToolResponse>;
13
13
  /**
14
14
  * Executes the tool with the provided parameters
15
15
  * @param params - Parameters required for tool execution
@@ -18,7 +18,7 @@ export declare class Tool extends BaseResource {
18
18
  execute(params: {
19
19
  data: any;
20
20
  runId?: string;
21
- runtimeContext?: RuntimeContext | Record<string, any>;
21
+ requestContext?: RequestContext | Record<string, any>;
22
22
  }): Promise<any>;
23
23
  }
24
24
  //# sourceMappingURL=tool.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { RuntimeContext } from '@mastra/core/runtime-context';
1
+ import type { RequestContext } from '@mastra/core/request-context';
2
2
  import type { CreateIndexParams, GetVectorIndexResponse, QueryVectorParams, QueryVectorResponse, ClientOptions, UpsertVectorParams } from '../types.js';
3
3
  import { BaseResource } from './base.js';
4
4
  export declare class Vector extends BaseResource {
@@ -7,10 +7,10 @@ export declare class Vector extends BaseResource {
7
7
  /**
8
8
  * Retrieves details about a specific vector index
9
9
  * @param indexName - Name of the index to get details for
10
- * @param runtimeContext - Optional runtime context to pass as query parameter
10
+ * @param requestContext - Optional request context to pass as query parameter
11
11
  * @returns Promise containing vector index details
12
12
  */
13
- details(indexName: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetVectorIndexResponse>;
13
+ details(indexName: string, requestContext?: RequestContext | Record<string, any>): Promise<GetVectorIndexResponse>;
14
14
  /**
15
15
  * Deletes a vector index
16
16
  * @param indexName - Name of the index to delete
@@ -21,12 +21,10 @@ export declare class Vector extends BaseResource {
21
21
  }>;
22
22
  /**
23
23
  * Retrieves a list of all available indexes
24
- * @param runtimeContext - Optional runtime context to pass as query parameter
24
+ * @param requestContext - Optional request context to pass as query parameter
25
25
  * @returns Promise containing array of index names
26
26
  */
27
- getIndexes(runtimeContext?: RuntimeContext | Record<string, any>): Promise<{
28
- indexes: string[];
29
- }>;
27
+ getIndexes(requestContext?: RequestContext | Record<string, any>): Promise<string[]>;
30
28
  /**
31
29
  * Creates a new vector index
32
30
  * @param params - Parameters for index creation including dimension and metric
@@ -38,9 +36,11 @@ export declare class Vector extends BaseResource {
38
36
  /**
39
37
  * Upserts vectors into an index
40
38
  * @param params - Parameters containing vectors, metadata, and optional IDs
41
- * @returns Promise containing array of vector IDs
39
+ * @returns Promise containing the inserted vector IDs
42
40
  */
43
- upsert(params: UpsertVectorParams): Promise<string[]>;
41
+ upsert(params: UpsertVectorParams): Promise<{
42
+ ids: string[];
43
+ }>;
44
44
  /**
45
45
  * Queries vectors in an index
46
46
  * @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;gBADlB,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM;IAK5B;;;;;OAKG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMlH;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAMxD;;;;OAIG;IACH,UAAU,CAAC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MAAM,EAAE,CAAC;IAMpF;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAOrE;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAO9D;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAM/D"}
@@ -1,262 +1,63 @@
1
- import type { TracingOptions } from '@mastra/core/ai-tracing';
2
- import type { RuntimeContext } from '@mastra/core/runtime-context';
3
- import type { ClientOptions, GetWorkflowResponse, GetWorkflowRunsResponse, GetWorkflowRunsParams, WorkflowRunResult, WorkflowWatchResult, GetWorkflowRunByIdResponse, GetWorkflowRunExecutionResultResponse, StreamVNextChunkType } from '../types.js';
1
+ import type { RequestContext } from '@mastra/core/request-context';
2
+ import type { ClientOptions, GetWorkflowResponse, ListWorkflowRunsResponse, ListWorkflowRunsParams, GetWorkflowRunByIdResponse } from '../types.js';
4
3
  import { BaseResource } from './base.js';
4
+ import { Run } from './run.js';
5
5
  export declare class Workflow extends BaseResource {
6
6
  private workflowId;
7
7
  constructor(options: ClientOptions, workflowId: string);
8
- /**
9
- * Creates an async generator that processes a readable stream and yields workflow records
10
- * separated by the Record Separator character (\x1E)
11
- *
12
- * @param stream - The readable stream to process
13
- * @returns An async generator that yields parsed records
14
- */
15
- private streamProcessor;
16
8
  /**
17
9
  * Retrieves details about the workflow
18
- * @param runtimeContext - Optional runtime context to pass as query parameter
10
+ * @param requestContext - Optional request context to pass as query parameter
19
11
  * @returns Promise containing workflow details including steps and graphs
20
12
  */
21
- details(runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowResponse>;
13
+ details(requestContext?: RequestContext | Record<string, any>): Promise<GetWorkflowResponse>;
22
14
  /**
23
15
  * Retrieves all runs for a workflow
24
16
  * @param params - Parameters for filtering runs
25
- * @param runtimeContext - Optional runtime context to pass as query parameter
17
+ * @param requestContext - Optional request context to pass as query parameter
26
18
  * @returns Promise containing workflow runs array
27
19
  */
28
- runs(params?: GetWorkflowRunsParams, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunsResponse>;
20
+ runs(params?: ListWorkflowRunsParams, requestContext?: RequestContext | Record<string, any>): Promise<ListWorkflowRunsResponse>;
29
21
  /**
30
22
  * Retrieves a specific workflow run by its ID
31
23
  * @param runId - The ID of the workflow run to retrieve
32
- * @param runtimeContext - Optional runtime context to pass as query parameter
33
- * @returns Promise containing the workflow run details
34
- */
35
- runById(runId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunByIdResponse>;
36
- /**
37
- * Retrieves the execution result for a specific workflow run by its ID
38
- * @param runId - The ID of the workflow run to retrieve the execution result for
39
- * @param runtimeContext - Optional runtime context to pass as query parameter
40
- * @returns Promise containing the workflow run execution result
41
- */
42
- runExecutionResult(runId: string, runtimeContext?: RuntimeContext | Record<string, any>): Promise<GetWorkflowRunExecutionResultResponse>;
43
- /**
44
- * Cancels a specific workflow run by its ID
45
- * @param runId - The ID of the workflow run to cancel
24
+ * @param options - Optional configuration
25
+ * @param options.requestContext - Optional request context to pass as query parameter
26
+ * @param options.fields - Optional array of fields to return (e.g., ['result', 'steps']). Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph. Metadata fields (runId, workflowName, resourceId, createdAt, updatedAt) and status are always included.
27
+ * @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
+ * @returns Promise containing the workflow run details with metadata and processed execution state
29
+ */
30
+ runById(runId: string, options?: {
31
+ requestContext?: RequestContext | Record<string, any>;
32
+ fields?: string[];
33
+ withNestedWorkflows?: boolean;
34
+ }): Promise<GetWorkflowRunByIdResponse>;
35
+ /**
36
+ * Deletes a specific workflow run by its ID
37
+ * @param runId - The ID of the workflow run to delete
46
38
  * @returns Promise containing a success message
47
39
  */
48
- cancelRun(runId: string): Promise<{
40
+ deleteRunById(runId: string): Promise<{
49
41
  message: string;
50
42
  }>;
51
43
  /**
52
- * Sends an event to a specific workflow run by its ID
53
- * @param params - Object containing the runId, event and data
54
- * @returns Promise containing a success message
44
+ * Retrieves the input/output schema for the workflow
45
+ * @returns Promise containing parsed inputSchema and outputSchema, or null if not defined
55
46
  */
56
- sendRunEvent(params: {
57
- runId: string;
58
- event: string;
59
- data: unknown;
60
- }): Promise<{
61
- message: string;
62
- }>;
63
- /**
64
- * @deprecated Use createRunAsync() instead.
65
- * @throws {Error} Always throws an error directing users to use createRunAsync()
66
- */
67
- createRun(_params?: {
68
- runId?: string;
69
- }): Promise<{
70
- runId: string;
71
- start: (params: {
72
- inputData: Record<string, any>;
73
- runtimeContext?: RuntimeContext | Record<string, any>;
74
- }) => Promise<{
75
- message: string;
76
- }>;
77
- watch: (onRecord: (record: WorkflowWatchResult) => void) => Promise<void>;
78
- resume: (params: {
79
- step: string | string[];
80
- resumeData?: Record<string, any>;
81
- runtimeContext?: RuntimeContext | Record<string, any>;
82
- }) => Promise<{
83
- message: string;
84
- }>;
85
- stream: (params: {
86
- inputData: Record<string, any>;
87
- runtimeContext?: RuntimeContext | Record<string, any>;
88
- }) => Promise<ReadableStream>;
89
- startAsync: (params: {
90
- inputData: Record<string, any>;
91
- runtimeContext?: RuntimeContext | Record<string, any>;
92
- }) => Promise<WorkflowRunResult>;
93
- resumeAsync: (params: {
94
- step: string | string[];
95
- resumeData?: Record<string, any>;
96
- runtimeContext?: RuntimeContext | Record<string, any>;
97
- }) => Promise<WorkflowRunResult>;
47
+ getSchema(): Promise<{
48
+ inputSchema: Record<string, unknown> | null;
49
+ outputSchema: Record<string, unknown> | null;
98
50
  }>;
99
51
  /**
100
52
  * Creates a new workflow run
101
53
  * @param params - Optional object containing the optional runId
102
- * @returns Promise containing the runId of the created run with methods to control execution
103
- */
104
- createRunAsync(params?: {
105
- runId?: string;
106
- }): Promise<{
107
- runId: string;
108
- start: (params: {
109
- inputData: Record<string, any>;
110
- runtimeContext?: RuntimeContext | Record<string, any>;
111
- tracingOptions?: TracingOptions;
112
- }) => Promise<{
113
- message: string;
114
- }>;
115
- watch: (onRecord: (record: WorkflowWatchResult) => void) => Promise<void>;
116
- resume: (params: {
117
- step: string | string[];
118
- resumeData?: Record<string, any>;
119
- runtimeContext?: RuntimeContext | Record<string, any>;
120
- tracingOptions?: TracingOptions;
121
- }) => Promise<{
122
- message: string;
123
- }>;
124
- stream: (params: {
125
- inputData: Record<string, any>;
126
- runtimeContext?: RuntimeContext | Record<string, any>;
127
- }) => Promise<ReadableStream>;
128
- startAsync: (params: {
129
- inputData: Record<string, any>;
130
- runtimeContext?: RuntimeContext | Record<string, any>;
131
- tracingOptions?: TracingOptions;
132
- }) => Promise<WorkflowRunResult>;
133
- resumeAsync: (params: {
134
- step: string | string[];
135
- resumeData?: Record<string, any>;
136
- runtimeContext?: RuntimeContext | Record<string, any>;
137
- tracingOptions?: TracingOptions;
138
- }) => Promise<WorkflowRunResult>;
139
- resumeStreamVNext: (params: {
140
- step: string | string[];
141
- resumeData?: Record<string, any>;
142
- runtimeContext?: RuntimeContext | Record<string, any>;
143
- }) => Promise<ReadableStream>;
144
- }>;
145
- /**
146
- * Starts a workflow run synchronously without waiting for the workflow to complete
147
- * @param params - Object containing the runId, inputData and runtimeContext
148
- * @returns Promise containing success message
149
- */
150
- start(params: {
151
- runId: string;
152
- inputData: Record<string, any>;
153
- runtimeContext?: RuntimeContext | Record<string, any>;
154
- tracingOptions?: TracingOptions;
155
- }): Promise<{
156
- message: string;
157
- }>;
158
- /**
159
- * Resumes a suspended workflow step synchronously without waiting for the workflow to complete
160
- * @param params - Object containing the runId, step, resumeData and runtimeContext
161
- * @returns Promise containing success message
162
- */
163
- resume({ step, runId, resumeData, tracingOptions, ...rest }: {
164
- step: string | string[];
165
- runId: string;
166
- resumeData?: Record<string, any>;
167
- runtimeContext?: RuntimeContext | Record<string, any>;
168
- tracingOptions?: TracingOptions;
169
- }): Promise<{
170
- message: string;
171
- }>;
172
- /**
173
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
174
- * @param params - Object containing the optional runId, inputData and runtimeContext
175
- * @returns Promise containing the workflow execution results
176
- */
177
- startAsync(params: {
178
- runId?: string;
179
- inputData: Record<string, any>;
180
- runtimeContext?: RuntimeContext | Record<string, any>;
181
- tracingOptions?: TracingOptions;
182
- }): Promise<WorkflowRunResult>;
183
- /**
184
- * Starts a workflow run and returns a stream
185
- * @param params - Object containing the optional runId, inputData and runtimeContext
186
- * @returns Promise containing the workflow execution results
187
- */
188
- stream(params: {
189
- runId?: string;
190
- inputData: Record<string, any>;
191
- runtimeContext?: RuntimeContext | Record<string, any>;
192
- tracingOptions?: TracingOptions;
193
- }): Promise<import("stream/web").ReadableStream<{
194
- type: string;
195
- payload: any;
196
- }>>;
197
- /**
198
- * Observes workflow stream for a workflow run
199
- * @param params - Object containing the runId
200
- * @returns Promise containing the workflow execution results
201
- */
202
- observeStream(params: {
203
- runId: string;
204
- }): Promise<import("stream/web").ReadableStream<{
205
- type: string;
206
- payload: any;
207
- }>>;
208
- /**
209
- * Starts a workflow run and returns a stream
210
- * @param params - Object containing the optional runId, inputData and runtimeContext
211
- * @returns Promise containing the workflow execution results
212
- */
213
- streamVNext(params: {
214
- runId?: string;
215
- inputData?: Record<string, any>;
216
- runtimeContext?: RuntimeContext;
217
- closeOnSuspend?: boolean;
218
- tracingOptions?: TracingOptions;
219
- }): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
220
- /**
221
- * Observes workflow vNext stream for a workflow run
222
- * @param params - Object containing the runId
223
- * @returns Promise containing the workflow execution results
224
- */
225
- observeStreamVNext(params: {
226
- runId: string;
227
- }): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
228
- /**
229
- * Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
230
- * @param params - Object containing the runId, step, resumeData and runtimeContext
231
- * @returns Promise containing the workflow resume results
232
- */
233
- resumeAsync(params: {
234
- runId: string;
235
- step: string | string[];
236
- resumeData?: Record<string, any>;
237
- runtimeContext?: RuntimeContext | Record<string, any>;
238
- tracingOptions?: TracingOptions;
239
- }): Promise<WorkflowRunResult>;
240
- /**
241
- * Resumes a suspended workflow step that uses streamVNext asynchronously and returns a promise that resolves when the workflow is complete
242
- * @param params - Object containing the runId, step, resumeData and runtimeContext
243
- * @returns Promise containing the workflow resume results
244
- */
245
- resumeStreamVNext(params: {
246
- runId: string;
247
- step: string | string[];
248
- resumeData?: Record<string, any>;
249
- runtimeContext?: RuntimeContext | Record<string, any>;
250
- tracingOptions?: TracingOptions;
251
- }): Promise<ReadableStream>;
252
- /**
253
- * Watches workflow transitions in real-time
254
- * @param runId - Optional run ID to filter the watch stream
255
- * @returns AsyncGenerator that yields parsed records from the workflow watch stream
54
+ * @returns Promise containing the Run instance
256
55
  */
257
- watch({ runId }: {
56
+ createRun(params?: {
258
57
  runId?: string;
259
- }, onRecord: (record: WorkflowWatchResult) => void): Promise<void>;
58
+ resourceId?: string;
59
+ disableScorers?: boolean;
60
+ }): Promise<Run>;
260
61
  /**
261
62
  * Creates a new ReadableStream from an iterable or async iterable of objects,
262
63
  * serializing each as JSON and separating them with the record separator (\x1E).
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/resources/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,EAC1B,qCAAqC,EACrC,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,MAA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C,GAAG,IAAI,CAAC;KAC9C,CAAC;IAUF;;;;OAIG;IACG,SAAS,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE;IAuB1F;;;;;;OAMG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,cAAc;CAgBvF"}
@@ -0,0 +1,129 @@
1
+ import type { ClientOptions, WorkspaceInfoResponse, WorkspaceFsReadResponse, WorkspaceFsWriteResponse, WorkspaceFsListResponse, WorkspaceFsDeleteResponse, WorkspaceFsMkdirResponse, WorkspaceFsStatResponse, WorkspaceSearchParams, WorkspaceSearchResponse, WorkspaceIndexParams, WorkspaceIndexResponse, ListSkillsResponse, Skill, SearchSkillsParams, SearchSkillsResponse, ListSkillReferencesResponse, GetSkillReferenceResponse } from '../types.js';
2
+ import { BaseResource } from './base.js';
3
+ /**
4
+ * Resource for interacting with a specific skill via the workspace API
5
+ */
6
+ export declare class WorkspaceSkillResource extends BaseResource {
7
+ private workspaceId;
8
+ private skillName;
9
+ private skillPath?;
10
+ private basePath;
11
+ private pathQuery;
12
+ constructor(options: ClientOptions, workspaceId: string, skillName: string, skillPath?: string | undefined);
13
+ /**
14
+ * Gets the full details of this skill including instructions
15
+ * @returns Promise containing skill details
16
+ */
17
+ details(): Promise<Skill>;
18
+ /**
19
+ * Lists all reference file paths for this skill
20
+ * @returns Promise containing list of reference paths
21
+ */
22
+ listReferences(): Promise<ListSkillReferencesResponse>;
23
+ /**
24
+ * Gets the content of a specific reference file
25
+ * @param referencePath - Path to the reference file
26
+ * @returns Promise containing reference content
27
+ */
28
+ getReference(referencePath: string): Promise<GetSkillReferenceResponse>;
29
+ }
30
+ /**
31
+ * Resource for interacting with the workspace API
32
+ *
33
+ * The workspace provides:
34
+ * - Filesystem operations (read, write, list, delete, mkdir, stat)
35
+ * - Search operations (search, index)
36
+ * - Skills operations (list, get, search, references)
37
+ */
38
+ export declare class Workspace extends BaseResource {
39
+ private workspaceId;
40
+ constructor(options: ClientOptions, workspaceId: string);
41
+ /**
42
+ * Helper to build the base path for this workspace
43
+ */
44
+ private get basePath();
45
+ /**
46
+ * Gets information about the workspace and its capabilities
47
+ * @returns Promise containing workspace info
48
+ */
49
+ info(): Promise<WorkspaceInfoResponse>;
50
+ /**
51
+ * Reads a file from the workspace filesystem
52
+ * @param path - Path to the file to read
53
+ * @param encoding - Optional encoding. Server defaults to utf-8 if not specified.
54
+ * @returns Promise containing file content and metadata
55
+ */
56
+ readFile(path: string, encoding?: string): Promise<WorkspaceFsReadResponse>;
57
+ /**
58
+ * Writes content to a file in the workspace filesystem
59
+ * @param path - Path to write to
60
+ * @param content - Content to write
61
+ * @param options - Write options including encoding and recursive directory creation
62
+ * @returns Promise containing success status
63
+ */
64
+ writeFile(path: string, content: string, options?: {
65
+ encoding?: 'utf-8' | 'base64';
66
+ recursive?: boolean;
67
+ }): Promise<WorkspaceFsWriteResponse>;
68
+ /**
69
+ * Lists files and directories in the workspace
70
+ * @param path - Path to the directory to list
71
+ * @param recursive - Whether to include subdirectories
72
+ * @returns Promise containing directory listing
73
+ */
74
+ listFiles(path: string, recursive?: boolean): Promise<WorkspaceFsListResponse>;
75
+ /**
76
+ * Deletes a file or directory from the workspace
77
+ * @param path - Path to delete
78
+ * @param options - Delete options
79
+ * @returns Promise containing success status
80
+ */
81
+ delete(path: string, options?: {
82
+ recursive?: boolean;
83
+ force?: boolean;
84
+ }): Promise<WorkspaceFsDeleteResponse>;
85
+ /**
86
+ * Creates a directory in the workspace
87
+ * @param path - Directory path to create
88
+ * @param recursive - Whether to create parent directories if needed
89
+ * @returns Promise containing success status
90
+ */
91
+ mkdir(path: string, recursive?: boolean): Promise<WorkspaceFsMkdirResponse>;
92
+ /**
93
+ * Gets information about a file or directory
94
+ * @param path - Path to get info about
95
+ * @returns Promise containing file/directory stats
96
+ */
97
+ stat(path: string): Promise<WorkspaceFsStatResponse>;
98
+ /**
99
+ * Searches across indexed workspace content
100
+ * @param params - Search parameters
101
+ * @returns Promise containing search results
102
+ */
103
+ search(params: WorkspaceSearchParams): Promise<WorkspaceSearchResponse>;
104
+ /**
105
+ * Indexes content for search
106
+ * @param params - Index parameters including path and content
107
+ * @returns Promise containing success status
108
+ */
109
+ index(params: WorkspaceIndexParams): Promise<WorkspaceIndexResponse>;
110
+ /**
111
+ * Lists all discovered skills
112
+ * @returns Promise containing list of skills with metadata
113
+ */
114
+ listSkills(): Promise<ListSkillsResponse>;
115
+ /**
116
+ * Searches across all skills content
117
+ * @param params - Search parameters
118
+ * @returns Promise containing search results
119
+ */
120
+ searchSkills(params: SearchSkillsParams): Promise<SearchSkillsResponse>;
121
+ /**
122
+ * Gets a skill instance for further operations
123
+ * @param skillName - Skill name identifier
124
+ * @param skillPath - Optional skill path for disambiguation when multiple skills share the same name
125
+ * @returns WorkspaceSkillResource instance
126
+ */
127
+ getSkill(skillName: string, skillPath?: string): WorkspaceSkillResource;
128
+ }
129
+ //# sourceMappingURL=workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/resources/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,EACL,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,YAAY;IAMpD,OA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