@mastra/client-js 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256
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.
- package/CHANGELOG.md +3375 -3
- package/LICENSE.md +15 -0
- package/README.md +11 -13
- package/dist/_types/@ai-sdk_ui-utils/dist/index.d.ts +820 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +10345 -0
- package/dist/client.d.ts +397 -75
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +44 -0
- package/dist/docs/assets/SOURCE_MAP.json +6 -0
- package/dist/docs/references/docs-server-auth-auth0.md +220 -0
- package/dist/docs/references/docs-server-auth-clerk.md +132 -0
- package/dist/docs/references/docs-server-auth-firebase.md +272 -0
- package/dist/docs/references/docs-server-auth-jwt.md +110 -0
- package/dist/docs/references/docs-server-auth-supabase.md +117 -0
- package/dist/docs/references/docs-server-auth-workos.md +186 -0
- package/dist/docs/references/docs-server-mastra-client.md +243 -0
- package/dist/docs/references/reference-ai-sdk-to-ai-sdk-stream.md +231 -0
- package/dist/docs/references/reference-ai-sdk-to-ai-sdk-v4-messages.md +79 -0
- package/dist/docs/references/reference-ai-sdk-to-ai-sdk-v5-messages.md +76 -0
- package/dist/docs/references/reference-client-js-agents.md +437 -0
- package/dist/docs/references/reference-client-js-error-handling.md +16 -0
- package/dist/docs/references/reference-client-js-logs.md +24 -0
- package/dist/docs/references/reference-client-js-mastra-client.md +63 -0
- package/dist/docs/references/reference-client-js-memory.md +221 -0
- package/dist/docs/references/reference-client-js-observability.md +72 -0
- package/dist/docs/references/reference-client-js-telemetry.md +20 -0
- package/dist/docs/references/reference-client-js-tools.md +44 -0
- package/dist/docs/references/reference-client-js-vectors.md +79 -0
- package/dist/docs/references/reference-client-js-workflows.md +199 -0
- package/dist/index.cjs +4575 -1896
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4875 -2193
- package/dist/index.js.map +1 -1
- package/dist/resources/a2a.d.ts.map +1 -1
- package/dist/resources/agent-builder.d.ts +55 -62
- package/dist/resources/agent-builder.d.ts.map +1 -1
- package/dist/resources/agent.d.ts +89 -51
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/base.d.ts +2 -1
- package/dist/resources/base.d.ts.map +1 -1
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/mcp-tool.d.ts +5 -5
- package/dist/resources/mcp-tool.d.ts.map +1 -1
- package/dist/resources/memory-thread.d.ts +31 -16
- package/dist/resources/memory-thread.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +62 -19
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/resources/processor-provider.d.ts +15 -0
- package/dist/resources/processor-provider.d.ts.map +1 -0
- package/dist/resources/processor.d.ts +20 -0
- package/dist/resources/processor.d.ts.map +1 -0
- package/dist/resources/run.d.ts +210 -0
- package/dist/resources/run.d.ts.map +1 -0
- package/dist/resources/stored-agent.d.ts +83 -0
- package/dist/resources/stored-agent.d.ts.map +1 -0
- package/dist/resources/stored-mcp-client.d.ts +30 -0
- package/dist/resources/stored-mcp-client.d.ts.map +1 -0
- package/dist/resources/stored-prompt-block.d.ts +83 -0
- package/dist/resources/stored-prompt-block.d.ts.map +1 -0
- package/dist/resources/stored-scorer.d.ts +83 -0
- package/dist/resources/stored-scorer.d.ts.map +1 -0
- package/dist/resources/stored-skill.d.ts +30 -0
- package/dist/resources/stored-skill.d.ts.map +1 -0
- package/dist/resources/tool-provider.d.ts +27 -0
- package/dist/resources/tool-provider.d.ts.map +1 -0
- package/dist/resources/tool.d.ts +4 -4
- package/dist/resources/vector.d.ts +5 -5
- package/dist/resources/vector.d.ts.map +1 -1
- package/dist/resources/workflow.d.ts +32 -231
- package/dist/resources/workflow.d.ts.map +1 -1
- package/dist/resources/workspace.d.ts +125 -0
- package/dist/resources/workspace.d.ts.map +1 -0
- package/dist/tools.d.ts +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +1673 -146
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +56 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts +1 -1
- package/dist/utils/process-mastra-stream.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema.d.ts +9 -1
- package/dist/utils/zod-to-json-schema.d.ts.map +1 -1
- package/package.json +20 -18
- package/dist/resources/network-memory-thread.d.ts +0 -47
- package/dist/resources/network-memory-thread.d.ts.map +0 -1
|
@@ -1,53 +1,68 @@
|
|
|
1
|
+
import type { RequestContext } from '@mastra/core/di';
|
|
1
2
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
2
|
-
import type {
|
|
3
|
+
import type { ClientOptions, UpdateMemoryThreadParams, ListMemoryThreadMessagesParams, ListMemoryThreadMessagesResponse, CloneMemoryThreadParams, CloneMemoryThreadResponse } from '../types.js';
|
|
3
4
|
import { BaseResource } from './base.js';
|
|
5
|
+
/**
|
|
6
|
+
* MemoryThread resource for interacting with memory threads.
|
|
7
|
+
*
|
|
8
|
+
* agentId is optional - when not provided, the server will use storage directly.
|
|
9
|
+
*/
|
|
4
10
|
export declare class MemoryThread extends BaseResource {
|
|
5
11
|
private threadId;
|
|
6
|
-
private agentId
|
|
7
|
-
constructor(options: ClientOptions, threadId: string, agentId
|
|
12
|
+
private agentId?;
|
|
13
|
+
constructor(options: ClientOptions, threadId: string, agentId?: string | undefined);
|
|
14
|
+
/**
|
|
15
|
+
* Builds the query string for agentId (if provided)
|
|
16
|
+
*/
|
|
17
|
+
private getAgentIdQueryParam;
|
|
8
18
|
/**
|
|
9
19
|
* Retrieves the memory thread details
|
|
20
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
10
21
|
* @returns Promise containing thread details including title and metadata
|
|
11
22
|
*/
|
|
12
|
-
get(): Promise<StorageThreadType>;
|
|
23
|
+
get(requestContext?: RequestContext | Record<string, any>): Promise<StorageThreadType>;
|
|
13
24
|
/**
|
|
14
25
|
* Updates the memory thread properties
|
|
15
|
-
* @param params - Update parameters including title and
|
|
26
|
+
* @param params - Update parameters including title, metadata, and optional request context
|
|
16
27
|
* @returns Promise containing updated thread details
|
|
17
28
|
*/
|
|
18
29
|
update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
|
|
19
30
|
/**
|
|
20
31
|
* Deletes the memory thread
|
|
32
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
21
33
|
* @returns Promise containing deletion result
|
|
22
34
|
*/
|
|
23
|
-
delete(): Promise<{
|
|
35
|
+
delete(requestContext?: RequestContext | Record<string, any>): Promise<{
|
|
24
36
|
result: string;
|
|
25
37
|
}>;
|
|
26
38
|
/**
|
|
27
|
-
* Retrieves messages associated with the thread
|
|
28
|
-
* @param params -
|
|
29
|
-
* @returns Promise containing thread messages and UI messages
|
|
30
|
-
*/
|
|
31
|
-
getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves paginated messages associated with the thread with advanced filtering and selection options
|
|
34
|
-
* @param params - Pagination parameters including selectBy criteria, page, perPage, date ranges, and message inclusion options
|
|
39
|
+
* Retrieves paginated messages associated with the thread with filtering and ordering options
|
|
40
|
+
* @param params - Pagination parameters including page, perPage, orderBy, filter, include options, and request context
|
|
35
41
|
* @returns Promise containing paginated thread messages with pagination metadata (total, page, perPage, hasMore)
|
|
36
42
|
*/
|
|
37
|
-
|
|
43
|
+
listMessages(params?: ListMemoryThreadMessagesParams & {
|
|
44
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
45
|
+
}): Promise<ListMemoryThreadMessagesResponse>;
|
|
38
46
|
/**
|
|
39
47
|
* Deletes one or more messages from the thread
|
|
40
48
|
* @param messageIds - Can be a single message ID (string), array of message IDs,
|
|
41
49
|
* message object with id property, or array of message objects
|
|
50
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
42
51
|
* @returns Promise containing deletion result
|
|
43
52
|
*/
|
|
44
53
|
deleteMessages(messageIds: string | string[] | {
|
|
45
54
|
id: string;
|
|
46
55
|
} | {
|
|
47
56
|
id: string;
|
|
48
|
-
}[]): Promise<{
|
|
57
|
+
}[], requestContext?: RequestContext | Record<string, any>): Promise<{
|
|
49
58
|
success: boolean;
|
|
50
59
|
message: string;
|
|
51
60
|
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Clones the thread with all its messages to a new thread
|
|
63
|
+
* @param params - Clone parameters including optional new thread ID, title, metadata, and message filters
|
|
64
|
+
* @returns Promise containing the cloned thread and copied messages
|
|
65
|
+
*/
|
|
66
|
+
clone(params?: CloneMemoryThreadParams): Promise<CloneMemoryThreadResponse>;
|
|
52
67
|
}
|
|
53
68
|
//# sourceMappingURL=memory-thread.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-thread.d.ts","sourceRoot":"","sources":["../../src/resources/memory-thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EACV
|
|
1
|
+
{"version":3,"file":"memory-thread.d.ts","sourceRoot":"","sources":["../../src/resources/memory-thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,8BAA8B,EAC9B,gCAAgC,EAChC,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAG1C,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO,CAAC;gBAFhB,OAAO,EAAE,aAAa,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,YAAA;IAK1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;OAIG;IACH,GAAG,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMtF;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASpE;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAQ1F;;;;OAIG;IACH,YAAY,CACV,MAAM,GAAE,8BAA8B,GAAG;QACvC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAClD,GACL,OAAO,CAAC,gCAAgC,CAAC;IAkB5C;;;;;;OAMG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,EACjE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAejD;;;;OAIG;IACH,KAAK,CAAC,MAAM,GAAE,uBAA4B,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAShF"}
|
|
@@ -1,35 +1,78 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ListScoresResponse } from '@mastra/core/evals';
|
|
2
|
+
import type { SpanType } from '@mastra/core/observability';
|
|
3
|
+
import type { TraceRecord, ListTracesArgs, ListTracesResponse, SpanIds, PaginationArgs, SpanRecord, PaginationInfo, ScoreTracesRequest, ScoreTracesResponse } from '@mastra/core/storage';
|
|
4
|
+
import type { ClientOptions } from '../types.js';
|
|
3
5
|
import { BaseResource } from './base.js';
|
|
6
|
+
/**
|
|
7
|
+
* Legacy pagination arguments from main branch.
|
|
8
|
+
* @deprecated Use ListTracesArgs instead with the new listTraces() method.
|
|
9
|
+
*/
|
|
10
|
+
export interface LegacyPaginationArgs {
|
|
11
|
+
dateRange?: {
|
|
12
|
+
start?: Date;
|
|
13
|
+
end?: Date;
|
|
14
|
+
};
|
|
15
|
+
page?: number;
|
|
16
|
+
perPage?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Legacy traces query parameters from main branch.
|
|
20
|
+
* @deprecated Use ListTracesArgs instead with the new listTraces() method.
|
|
21
|
+
*/
|
|
22
|
+
export interface LegacyTracesPaginatedArg {
|
|
23
|
+
filters?: {
|
|
24
|
+
name?: string;
|
|
25
|
+
spanType?: SpanType;
|
|
26
|
+
entityId?: string;
|
|
27
|
+
entityType?: 'agent' | 'workflow';
|
|
28
|
+
};
|
|
29
|
+
pagination?: LegacyPaginationArgs;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Legacy response type from main branch.
|
|
33
|
+
* @deprecated Use ListTracesResponse instead.
|
|
34
|
+
*/
|
|
35
|
+
export interface LegacyGetTracesResponse {
|
|
36
|
+
spans: SpanRecord[];
|
|
37
|
+
pagination: PaginationInfo;
|
|
38
|
+
}
|
|
39
|
+
export type ListScoresBySpanParams = SpanIds & PaginationArgs;
|
|
4
40
|
export declare class Observability extends BaseResource {
|
|
5
41
|
constructor(options: ClientOptions);
|
|
6
42
|
/**
|
|
7
|
-
* Retrieves a specific
|
|
43
|
+
* Retrieves a specific trace by ID
|
|
8
44
|
* @param traceId - ID of the trace to retrieve
|
|
9
|
-
* @returns Promise containing the
|
|
45
|
+
* @returns Promise containing the trace with all its spans
|
|
46
|
+
*/
|
|
47
|
+
getTrace(traceId: string): Promise<TraceRecord>;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves paginated list of traces with optional filtering.
|
|
50
|
+
* This is the legacy API preserved for backward compatibility.
|
|
51
|
+
*
|
|
52
|
+
* @param params - Parameters for pagination and filtering (legacy format)
|
|
53
|
+
* @returns Promise containing paginated traces and pagination info
|
|
54
|
+
* @deprecated Use {@link listTraces} instead for new features like ordering and more filters.
|
|
10
55
|
*/
|
|
11
|
-
|
|
56
|
+
getTraces(params: LegacyTracesPaginatedArg): Promise<LegacyGetTracesResponse>;
|
|
12
57
|
/**
|
|
13
|
-
* Retrieves paginated list of
|
|
14
|
-
*
|
|
58
|
+
* Retrieves paginated list of traces with optional filtering and sorting.
|
|
59
|
+
* This is the new API with improved filtering options.
|
|
60
|
+
*
|
|
61
|
+
* @param params - Parameters for pagination, filtering, and ordering
|
|
15
62
|
* @returns Promise containing paginated traces and pagination info
|
|
16
63
|
*/
|
|
17
|
-
|
|
64
|
+
listTraces(params?: ListTracesArgs): Promise<ListTracesResponse>;
|
|
18
65
|
/**
|
|
19
66
|
* Retrieves scores by trace ID and span ID
|
|
20
67
|
* @param params - Parameters containing trace ID, span ID, and pagination options
|
|
21
68
|
* @returns Promise containing scores and pagination info
|
|
22
69
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}): Promise<{
|
|
31
|
-
status: string;
|
|
32
|
-
message: string;
|
|
33
|
-
}>;
|
|
70
|
+
listScoresBySpan(params: ListScoresBySpanParams): Promise<ListScoresResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Scores one or more traces using a specified scorer.
|
|
73
|
+
* @param params - Scorer name and targets to score
|
|
74
|
+
* @returns Promise containing the scoring status
|
|
75
|
+
*/
|
|
76
|
+
score(params: ScoreTracesRequest): Promise<ScoreTracesResponse>;
|
|
34
77
|
}
|
|
35
78
|
//# sourceMappingURL=observability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/resources/observability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/resources/observability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,cAAc,EACd,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtC;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,IAAI,CAAC;QACb,GAAG,CAAC,EAAE,IAAI,CAAC;KACZ,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;KACnC,CAAC;IACF,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,cAAc,CAAC;AAM9D,qBAAa,aAAc,SAAQ,YAAY;gBACjC,OAAO,EAAE,aAAa;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAI/C;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAmC7E;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,GAAE,cAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAKpE;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQ7E;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAMhE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ClientOptions, GetProcessorProviderResponse } from '../types.js';
|
|
2
|
+
import { BaseResource } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resource for interacting with a specific processor provider
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProcessorProvider extends BaseResource {
|
|
7
|
+
private providerId;
|
|
8
|
+
constructor(options: ClientOptions, providerId: string);
|
|
9
|
+
/**
|
|
10
|
+
* Gets details about this processor provider and its available processors
|
|
11
|
+
* @returns Promise containing provider info and processor list
|
|
12
|
+
*/
|
|
13
|
+
details(): Promise<GetProcessorProviderResponse>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=processor-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor-provider.d.ts","sourceRoot":"","sources":["../../src/resources/processor-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IAG/C,OAAO,CAAC,UAAU;gBADlB,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM;IAK5B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,4BAA4B,CAAC;CAGjD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
2
|
+
import type { ClientOptions, GetProcessorDetailResponse, ExecuteProcessorParams, ExecuteProcessorResponse } from '../types.js';
|
|
3
|
+
import { BaseResource } from './base.js';
|
|
4
|
+
export declare class Processor extends BaseResource {
|
|
5
|
+
private processorId;
|
|
6
|
+
constructor(options: ClientOptions, processorId: string);
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves details about the processor
|
|
9
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
10
|
+
* @returns Promise containing processor details including phases and configurations
|
|
11
|
+
*/
|
|
12
|
+
details(requestContext?: RequestContext | Record<string, any>): Promise<GetProcessorDetailResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Executes the processor with the provided parameters
|
|
15
|
+
* @param params - Parameters required for processor execution including phase and messages
|
|
16
|
+
* @returns Promise containing the processor execution results
|
|
17
|
+
*/
|
|
18
|
+
execute(params: ExecuteProcessorParams): Promise<ExecuteProcessorResponse>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/resources/processor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EACV,aAAa,EACb,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,qBAAa,SAAU,SAAQ,YAAY;IAGvC,OAAO,CAAC,WAAW;gBADnB,OAAO,EAAE,aAAa,EACd,WAAW,EAAE,MAAM;IAK7B;;;;OAIG;IACH,OAAO,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAInG;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAa3E"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { TracingOptions } from '@mastra/core/observability';
|
|
2
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
3
|
+
import type { ClientOptions, WorkflowRunResult, StreamVNextChunkType, TimeTravelParams } from '../types.js';
|
|
4
|
+
import { BaseResource } from './base.js';
|
|
5
|
+
export declare class Run extends BaseResource {
|
|
6
|
+
private workflowId;
|
|
7
|
+
readonly runId: string;
|
|
8
|
+
constructor(options: ClientOptions, workflowId: string, runId: string);
|
|
9
|
+
/**
|
|
10
|
+
* Creates a transform stream that parses RECORD_SEPARATOR-delimited JSON chunks
|
|
11
|
+
*/
|
|
12
|
+
private createChunkTransformStream;
|
|
13
|
+
/**
|
|
14
|
+
* Cancels a specific workflow run by its ID
|
|
15
|
+
* @returns Promise containing a success message
|
|
16
|
+
* @deprecated Use `cancel()` instead
|
|
17
|
+
*/
|
|
18
|
+
cancelRun(): Promise<{
|
|
19
|
+
message: string;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Cancels a workflow run.
|
|
23
|
+
*
|
|
24
|
+
* This method aborts any running steps and updates the workflow status to 'canceled' .
|
|
25
|
+
* It works for both actively running workflows and suspended/waiting workflows.
|
|
26
|
+
*
|
|
27
|
+
* ## How cancellation works
|
|
28
|
+
*
|
|
29
|
+
* When called, the workflow will:
|
|
30
|
+
* 1. **Trigger the abort signal** - Uses the standard Web API AbortSignal to notify running steps
|
|
31
|
+
* 2. **Prevent subsequent steps** - No further steps will be executed
|
|
32
|
+
*
|
|
33
|
+
* ## Abort signal behavior
|
|
34
|
+
*
|
|
35
|
+
* Steps that check the `abortSignal` parameter can respond to cancellation:
|
|
36
|
+
* - Steps can listen to the 'abort' event: `abortSignal.addEventListener('abort', callback)`
|
|
37
|
+
* - Steps can check if already aborted: `if (abortSignal.aborted) { ... }`
|
|
38
|
+
* - Useful for canceling timeouts, network requests, or long-running operations
|
|
39
|
+
*
|
|
40
|
+
* **Note:** Steps must actively check the abort signal to be canceled mid-execution.
|
|
41
|
+
* Steps that don't check the signal will run to completion, but subsequent steps won't execute.
|
|
42
|
+
*
|
|
43
|
+
* @returns Promise that resolves with `{ message: 'Workflow run canceled' }` when cancellation succeeds
|
|
44
|
+
* @throws {HTTPException} 400 - If workflow ID or run ID is missing
|
|
45
|
+
* @throws {HTTPException} 404 - If workflow or workflow run is not found
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const run = await workflow.createRun({ runId: 'run-123' });
|
|
50
|
+
* await run.cancel();
|
|
51
|
+
* // Returns: { message: 'Workflow run canceled' }
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* // Example of a step that responds to cancellation
|
|
57
|
+
* const step = createStep({
|
|
58
|
+
* id: 'long-running-step',
|
|
59
|
+
* execute: async ({ inputData, abortSignal, abort }) => {
|
|
60
|
+
* const timeout = new Promise((resolve) => {
|
|
61
|
+
* const timer = setTimeout(() => resolve('done'), 10000);
|
|
62
|
+
*
|
|
63
|
+
* // Clean up if canceled
|
|
64
|
+
* abortSignal.addEventListener('abort', () => {
|
|
65
|
+
* clearTimeout(timer);
|
|
66
|
+
* resolve('canceled');
|
|
67
|
+
* });
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* const result = await timeout;
|
|
71
|
+
*
|
|
72
|
+
* // Check if aborted after async operation
|
|
73
|
+
* if (abortSignal.aborted) {
|
|
74
|
+
* return abort(); // Stop execution
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* return { result };
|
|
78
|
+
* }
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
cancel(): Promise<{
|
|
83
|
+
message: string;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Starts a workflow run synchronously without waiting for the workflow to complete
|
|
87
|
+
* @param params - Object containing the inputData, initialState and requestContext
|
|
88
|
+
* @returns Promise containing success message
|
|
89
|
+
*/
|
|
90
|
+
start(params: {
|
|
91
|
+
inputData: Record<string, any>;
|
|
92
|
+
initialState?: Record<string, any>;
|
|
93
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
94
|
+
tracingOptions?: TracingOptions;
|
|
95
|
+
perStep?: boolean;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
message: string;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Resumes a suspended workflow step synchronously without waiting for the workflow to complete
|
|
101
|
+
* @param params - Object containing the step, resumeData and requestContext
|
|
102
|
+
* @returns Promise containing success message
|
|
103
|
+
*/
|
|
104
|
+
resume({ step, resumeData, tracingOptions, perStep, ...rest }: {
|
|
105
|
+
step?: string | string[];
|
|
106
|
+
resumeData?: Record<string, any>;
|
|
107
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
108
|
+
tracingOptions?: TracingOptions;
|
|
109
|
+
perStep?: boolean;
|
|
110
|
+
}): Promise<{
|
|
111
|
+
message: string;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
|
|
115
|
+
* @param params - Object containing the inputData, initialState and requestContext
|
|
116
|
+
* @returns Promise containing the workflow execution results
|
|
117
|
+
*/
|
|
118
|
+
startAsync(params: {
|
|
119
|
+
inputData: Record<string, any>;
|
|
120
|
+
initialState?: Record<string, any>;
|
|
121
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
122
|
+
tracingOptions?: TracingOptions;
|
|
123
|
+
resourceId?: string;
|
|
124
|
+
perStep?: boolean;
|
|
125
|
+
}): Promise<WorkflowRunResult>;
|
|
126
|
+
/**
|
|
127
|
+
* Starts a workflow run and returns a stream
|
|
128
|
+
* @param params - Object containing the inputData, initialState and requestContext
|
|
129
|
+
* @returns Promise containing the workflow execution results
|
|
130
|
+
*/
|
|
131
|
+
stream(params: {
|
|
132
|
+
inputData: Record<string, any>;
|
|
133
|
+
initialState?: Record<string, any>;
|
|
134
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
135
|
+
tracingOptions?: TracingOptions;
|
|
136
|
+
resourceId?: string;
|
|
137
|
+
perStep?: boolean;
|
|
138
|
+
closeOnSuspend?: boolean;
|
|
139
|
+
}): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
140
|
+
/**
|
|
141
|
+
* Observes workflow stream for a workflow run
|
|
142
|
+
* @returns Promise containing the workflow execution results
|
|
143
|
+
*/
|
|
144
|
+
observeStream(): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
145
|
+
/**
|
|
146
|
+
* Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
|
|
147
|
+
* @param params - Object containing the step, resumeData and requestContext
|
|
148
|
+
* @returns Promise containing the workflow resume results
|
|
149
|
+
*/
|
|
150
|
+
resumeAsync(params: {
|
|
151
|
+
step?: string | string[];
|
|
152
|
+
resumeData?: Record<string, any>;
|
|
153
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
154
|
+
tracingOptions?: TracingOptions;
|
|
155
|
+
perStep?: boolean;
|
|
156
|
+
}): Promise<WorkflowRunResult>;
|
|
157
|
+
/**
|
|
158
|
+
* Resumes a suspended workflow step that uses stream asynchronously and returns a promise that resolves when the workflow is complete
|
|
159
|
+
* @param params - Object containing the step, resumeData and requestContext
|
|
160
|
+
* @returns Promise containing the workflow resume results
|
|
161
|
+
*/
|
|
162
|
+
resumeStream(params: {
|
|
163
|
+
step?: string | string[];
|
|
164
|
+
resumeData?: Record<string, any>;
|
|
165
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
166
|
+
tracingOptions?: TracingOptions;
|
|
167
|
+
perStep?: boolean;
|
|
168
|
+
}): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
169
|
+
/**
|
|
170
|
+
* Restarts an active workflow run synchronously without waiting for the workflow to complete
|
|
171
|
+
* @param params - Object containing the requestContext
|
|
172
|
+
* @returns Promise containing success message
|
|
173
|
+
*/
|
|
174
|
+
restart(params: {
|
|
175
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
176
|
+
tracingOptions?: TracingOptions;
|
|
177
|
+
}): Promise<{
|
|
178
|
+
message: string;
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Restarts an active workflow run asynchronously
|
|
182
|
+
* @param params - optional object containing the requestContext
|
|
183
|
+
* @returns Promise containing the workflow restart results
|
|
184
|
+
*/
|
|
185
|
+
restartAsync(params?: {
|
|
186
|
+
requestContext?: RequestContext | Record<string, any>;
|
|
187
|
+
tracingOptions?: TracingOptions;
|
|
188
|
+
}): Promise<WorkflowRunResult>;
|
|
189
|
+
/**
|
|
190
|
+
* Time travels a workflow run synchronously without waiting for the workflow to complete
|
|
191
|
+
* @param params - Object containing the step, inputData, resumeData, initialState, context, nestedStepsContext, requestContext and tracingOptions
|
|
192
|
+
* @returns Promise containing success message
|
|
193
|
+
*/
|
|
194
|
+
timeTravel({ requestContext: paramsRequestContext, ...params }: TimeTravelParams): Promise<{
|
|
195
|
+
message: string;
|
|
196
|
+
}>;
|
|
197
|
+
/**
|
|
198
|
+
* Time travels a workflow run asynchronously
|
|
199
|
+
* @param params - Object containing the step, inputData, resumeData, initialState, context, nestedStepsContext, requestContext and tracingOptions
|
|
200
|
+
* @returns Promise containing the workflow time travel results
|
|
201
|
+
*/
|
|
202
|
+
timeTravelAsync({ requestContext: paramsRequestContext, ...params }: TimeTravelParams): Promise<WorkflowRunResult>;
|
|
203
|
+
/**
|
|
204
|
+
* Time travels a workflow run and returns a stream
|
|
205
|
+
* @param params - Object containing the step, inputData, resumeData, initialState, context, nestedStepsContext, requestContext and tracingOptions
|
|
206
|
+
* @returns Promise containing the workflow execution results
|
|
207
|
+
*/
|
|
208
|
+
timeTravelStream({ requestContext: paramsRequestContext, ...params }: TimeTravelParams): Promise<import("stream/web").ReadableStream<StreamVNextChunkType>>;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/resources/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGzG,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAkBtC,qBAAa,GAAI,SAAQ,YAAY;IAGjC,OAAO,CAAC,UAAU;aACF,KAAK,EAAE,MAAM;gBAF7B,OAAO,EAAE,aAAa,EACd,UAAU,EAAE,MAAM,EACV,KAAK,EAAE,MAAM;IAK/B;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAkClC;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAMzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4DG;IACH,MAAM,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAMtC;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE;QACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM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;QACpB,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACtD,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAW9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAW/G;;;;OAIG;IACH,eAAe,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAWlH;;;;OAIG;IACG,gBAAgB,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,EAAE,gBAAgB;CAyB7F"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
2
|
+
import type { ClientOptions, StoredAgentResponse, UpdateStoredAgentParams, DeleteStoredAgentResponse, AgentVersionResponse, ListAgentVersionsParams, ListAgentVersionsResponse, CreateAgentVersionParams, ActivateAgentVersionResponse, CompareVersionsResponse, DeleteAgentVersionResponse } from '../types.js';
|
|
3
|
+
import { BaseResource } from './base.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resource for interacting with a specific stored agent
|
|
6
|
+
*/
|
|
7
|
+
export declare class StoredAgent extends BaseResource {
|
|
8
|
+
private storedAgentId;
|
|
9
|
+
constructor(options: ClientOptions, storedAgentId: string);
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves details about the stored agent
|
|
12
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
13
|
+
* @param options - Optional options like status filter
|
|
14
|
+
* @returns Promise containing stored agent details
|
|
15
|
+
*/
|
|
16
|
+
details(requestContext?: RequestContext | Record<string, any>, options?: {
|
|
17
|
+
status?: 'draft' | 'published' | 'archived';
|
|
18
|
+
}): Promise<StoredAgentResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Updates the stored agent with the provided fields
|
|
21
|
+
* @param params - Fields to update
|
|
22
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
23
|
+
* @returns Promise containing the updated stored agent
|
|
24
|
+
*/
|
|
25
|
+
update(params: UpdateStoredAgentParams, requestContext?: RequestContext | Record<string, any>): Promise<StoredAgentResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Deletes the stored agent
|
|
28
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
29
|
+
* @returns Promise containing deletion confirmation
|
|
30
|
+
*/
|
|
31
|
+
delete(requestContext?: RequestContext | Record<string, any>): Promise<DeleteStoredAgentResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Lists all versions for this stored agent
|
|
34
|
+
* @param params - Optional pagination and sorting parameters
|
|
35
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
36
|
+
* @returns Promise containing paginated list of versions
|
|
37
|
+
*/
|
|
38
|
+
listVersions(params?: ListAgentVersionsParams, requestContext?: RequestContext | Record<string, any>): Promise<ListAgentVersionsResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new version snapshot for this stored agent
|
|
41
|
+
* @param params - Optional name and change message for the version
|
|
42
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
43
|
+
* @returns Promise containing the created version
|
|
44
|
+
*/
|
|
45
|
+
createVersion(params?: CreateAgentVersionParams, requestContext?: RequestContext | Record<string, any>): Promise<AgentVersionResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves a specific version by its ID
|
|
48
|
+
* @param versionId - The UUID of the version to retrieve
|
|
49
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
50
|
+
* @returns Promise containing the version details
|
|
51
|
+
*/
|
|
52
|
+
getVersion(versionId: string, requestContext?: RequestContext | Record<string, any>): Promise<AgentVersionResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Activates a specific version, making it the active version for this agent
|
|
55
|
+
* @param versionId - The UUID of the version to activate
|
|
56
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
57
|
+
* @returns Promise containing activation confirmation with success status, message, and active version ID
|
|
58
|
+
*/
|
|
59
|
+
activateVersion(versionId: string, requestContext?: RequestContext | Record<string, any>): Promise<ActivateAgentVersionResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Restores a version by creating a new version with the same configuration
|
|
62
|
+
* @param versionId - The UUID of the version to restore
|
|
63
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
64
|
+
* @returns Promise containing the newly created version
|
|
65
|
+
*/
|
|
66
|
+
restoreVersion(versionId: string, requestContext?: RequestContext | Record<string, any>): Promise<AgentVersionResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Deletes a specific version
|
|
69
|
+
* @param versionId - The UUID of the version to delete
|
|
70
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
71
|
+
* @returns Promise that resolves with deletion response
|
|
72
|
+
*/
|
|
73
|
+
deleteVersion(versionId: string, requestContext?: RequestContext | Record<string, any>): Promise<DeleteAgentVersionResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Compares two versions and returns their differences
|
|
76
|
+
* @param fromId - The UUID of the source version
|
|
77
|
+
* @param toId - The UUID of the target version
|
|
78
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
79
|
+
* @returns Promise containing the comparison results
|
|
80
|
+
*/
|
|
81
|
+
compareVersions(fromId: string, toId: string, requestContext?: RequestContext | Record<string, any>): Promise<CompareVersionsResponse>;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=stored-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-agent.d.ts","sourceRoot":"","sources":["../../src/resources/stored-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,uBAAuB,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,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAMnH;;;;;OAKG;IACH,eAAe,CACb,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC,4BAA4B,CAAC;IASxC;;;;;OAKG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC,oBAAoB,CAAC;IAShC;;;;;OAKG;IACH,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC,0BAA0B,CAAC;IAStC;;;;;;OAMG;IACH,eAAe,CACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC,uBAAuB,CAAC;CAUpC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RequestContext } from '@mastra/core/request-context';
|
|
2
|
+
import type { ClientOptions, StoredMCPClientResponse, UpdateStoredMCPClientParams, DeleteStoredMCPClientResponse } from '../types.js';
|
|
3
|
+
import { BaseResource } from './base.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resource for interacting with a specific stored MCP client
|
|
6
|
+
*/
|
|
7
|
+
export declare class StoredMCPClient extends BaseResource {
|
|
8
|
+
private storedMCPClientId;
|
|
9
|
+
constructor(options: ClientOptions, storedMCPClientId: string);
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves details about the stored MCP client
|
|
12
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
13
|
+
* @returns Promise containing stored MCP client details
|
|
14
|
+
*/
|
|
15
|
+
details(requestContext?: RequestContext | Record<string, any>): Promise<StoredMCPClientResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Updates the stored MCP client with the provided fields
|
|
18
|
+
* @param params - Fields to update
|
|
19
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
20
|
+
* @returns Promise containing the updated stored MCP client
|
|
21
|
+
*/
|
|
22
|
+
update(params: UpdateStoredMCPClientParams, requestContext?: RequestContext | Record<string, any>): Promise<StoredMCPClientResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Deletes the stored MCP client
|
|
25
|
+
* @param requestContext - Optional request context to pass as query parameter
|
|
26
|
+
* @returns Promise containing deletion confirmation
|
|
27
|
+
*/
|
|
28
|
+
delete(requestContext?: RequestContext | Record<string, any>): Promise<DeleteStoredMCPClientResponse>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=stored-mcp-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-mcp-client.d.ts","sourceRoot":"","sources":["../../src/resources/stored-mcp-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY;IAG7C,OAAO,CAAC,iBAAiB;gBADzB,OAAO,EAAE,aAAa,EACd,iBAAiB,EAAE,MAAM;IAKnC;;;;OAIG;IACH,OAAO,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAMhG;;;;;OAKG;IACH,MAAM,CACJ,MAAM,EAAE,2BAA2B,EACnC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD,OAAO,CAAC,uBAAuB,CAAC;IAUnC;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,6BAA6B,CAAC;CAQtG"}
|