@mastra/core 0.10.12 → 0.10.13
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/package.json +1 -1
- package/a2a.d.ts +0 -1
- package/agent.d.ts +0 -1
- package/base.d.ts +0 -1
- package/bundler.d.ts +0 -1
- package/deployer.d.ts +0 -1
- package/di.d.ts +0 -1
- package/dist/a2a/index.cjs +0 -79
- package/dist/a2a/index.d.cts +0 -780
- package/dist/a2a/index.d.ts +0 -780
- package/dist/a2a/index.js +0 -68
- package/dist/agent/index.cjs +0 -15
- package/dist/agent/index.d.cts +0 -29
- package/dist/agent/index.d.ts +0 -29
- package/dist/agent/index.js +0 -2
- package/dist/base-B_y9sMg0.d.cts +0 -162
- package/dist/base-CS5eSXbL.d.cts +0 -4117
- package/dist/base-ClrXcCRx.d.ts +0 -162
- package/dist/base-DBhKcre4.d.ts +0 -4117
- package/dist/base.cjs +0 -10
- package/dist/base.d.cts +0 -6
- package/dist/base.d.ts +0 -6
- package/dist/base.js +0 -1
- package/dist/bundler/index.cjs +0 -10
- package/dist/bundler/index.d.cts +0 -30
- package/dist/bundler/index.d.ts +0 -30
- package/dist/bundler/index.js +0 -1
- package/dist/chunk-2GRYVZ2O.cjs +0 -244
- package/dist/chunk-2HDFKWFU.js +0 -2249
- package/dist/chunk-32C7JDIZ.js +0 -1
- package/dist/chunk-4UBOJFSL.js +0 -989
- package/dist/chunk-4UWPFBC6.js +0 -88
- package/dist/chunk-4Z3OU5RY.cjs +0 -31
- package/dist/chunk-5HTMDAXP.js +0 -359
- package/dist/chunk-5IEKR756.js +0 -53
- package/dist/chunk-5YDTZN2X.js +0 -114
- package/dist/chunk-6UNGH46J.js +0 -75
- package/dist/chunk-6Y4UL5Z6.cjs +0 -94
- package/dist/chunk-7F6BQXE2.cjs +0 -425
- package/dist/chunk-7H2GET5Z.cjs +0 -668
- package/dist/chunk-7HZ6NIAF.cjs +0 -2
- package/dist/chunk-7MZNOW6W.cjs +0 -2263
- package/dist/chunk-7XQIPES3.js +0 -668
- package/dist/chunk-AKYTYALY.js +0 -70
- package/dist/chunk-ATXBSEFT.js +0 -22
- package/dist/chunk-B6TOBUS6.cjs +0 -80
- package/dist/chunk-B7SQOKEC.cjs +0 -91
- package/dist/chunk-BB4KXGBU.js +0 -83
- package/dist/chunk-BB6DPGIV.cjs +0 -6
- package/dist/chunk-C4LMN2IR.js +0 -27
- package/dist/chunk-DFFVEKIG.js +0 -407
- package/dist/chunk-E7AX3U6M.cjs +0 -659
- package/dist/chunk-EWCOOO3H.js +0 -5007
- package/dist/chunk-F2WMR75C.cjs +0 -183
- package/dist/chunk-FBKJ3652.cjs +0 -5034
- package/dist/chunk-FEYYOBBG.cjs +0 -24
- package/dist/chunk-FL5SZ2XU.js +0 -181
- package/dist/chunk-GH2KM66J.js +0 -37
- package/dist/chunk-GWFS5DAR.cjs +0 -37
- package/dist/chunk-HNEE7IF4.js +0 -60
- package/dist/chunk-HSVOEWAM.cjs +0 -2
- package/dist/chunk-J52TXHZV.cjs +0 -73
- package/dist/chunk-JNMQKJH4.js +0 -10
- package/dist/chunk-JQOMTERC.js +0 -89
- package/dist/chunk-LABUWBKX.cjs +0 -71
- package/dist/chunk-LXFZUKP3.cjs +0 -34
- package/dist/chunk-MP2QBLUJ.cjs +0 -70
- package/dist/chunk-MUNFCOMB.cjs +0 -62
- package/dist/chunk-NH5WJNNS.js +0 -1
- package/dist/chunk-P3Q73CAW.cjs +0 -55
- package/dist/chunk-PA2YIVIT.js +0 -61
- package/dist/chunk-QFTBW7ZZ.cjs +0 -2
- package/dist/chunk-QQ5K5TZE.cjs +0 -619
- package/dist/chunk-QUSEDVYI.cjs +0 -991
- package/dist/chunk-R4V75T7J.js +0 -1
- package/dist/chunk-SGGPJWRQ.js +0 -69
- package/dist/chunk-ST5RMVLG.cjs +0 -87
- package/dist/chunk-TC2SCOTE.js +0 -605
- package/dist/chunk-U64IJDC5.cjs +0 -109
- package/dist/chunk-UX3B6S2I.cjs +0 -65
- package/dist/chunk-V5D2LIF5.js +0 -68
- package/dist/chunk-VG4OPO2R.js +0 -240
- package/dist/chunk-WQNOATKB.js +0 -103
- package/dist/chunk-Y7D2JLKS.js +0 -4
- package/dist/chunk-YJEHXYK5.js +0 -657
- package/dist/chunk-YOQP5T77.js +0 -32
- package/dist/chunk-ZIZ3CVHN.cjs +0 -120
- package/dist/chunk-ZPOUMTTH.cjs +0 -362
- package/dist/chunk-ZZLBNB3U.cjs +0 -12
- package/dist/deployer/index.cjs +0 -10
- package/dist/deployer/index.d.cts +0 -19
- package/dist/deployer/index.d.ts +0 -19
- package/dist/deployer/index.js +0 -1
- package/dist/di/index.cjs +0 -10
- package/dist/di/index.d.cts +0 -1
- package/dist/di/index.d.ts +0 -1
- package/dist/di/index.js +0 -1
- package/dist/error/index.cjs +0 -22
- package/dist/error/index.d.cts +0 -86
- package/dist/error/index.d.ts +0 -86
- package/dist/error/index.js +0 -1
- package/dist/eval/index.cjs +0 -14
- package/dist/eval/index.d.cts +0 -43
- package/dist/eval/index.d.ts +0 -43
- package/dist/eval/index.js +0 -1
- package/dist/hooks/index.cjs +0 -18
- package/dist/hooks/index.d.cts +0 -33
- package/dist/hooks/index.d.ts +0 -33
- package/dist/hooks/index.js +0 -1
- package/dist/index.cjs +0 -281
- package/dist/index.d.cts +0 -92
- package/dist/index.d.ts +0 -92
- package/dist/index.js +0 -112
- package/dist/integration/index.cjs +0 -14
- package/dist/integration/index.d.cts +0 -65
- package/dist/integration/index.d.ts +0 -65
- package/dist/integration/index.js +0 -1
- package/dist/llm/index.cjs +0 -10
- package/dist/llm/index.d.cts +0 -29
- package/dist/llm/index.d.ts +0 -29
- package/dist/llm/index.js +0 -1
- package/dist/logger/index.cjs +0 -43
- package/dist/logger/index.d.cts +0 -96
- package/dist/logger/index.d.ts +0 -96
- package/dist/logger/index.js +0 -2
- package/dist/logger-B8XXh6ya.d.cts +0 -159
- package/dist/logger-Bpa2oLL4.d.ts +0 -159
- package/dist/mastra/index.cjs +0 -10
- package/dist/mastra/index.d.cts +0 -29
- package/dist/mastra/index.d.ts +0 -29
- package/dist/mastra/index.js +0 -1
- package/dist/mcp/index.cjs +0 -106
- package/dist/mcp/index.d.cts +0 -29
- package/dist/mcp/index.d.ts +0 -29
- package/dist/mcp/index.js +0 -100
- package/dist/memory/index.cjs +0 -18
- package/dist/memory/index.d.cts +0 -29
- package/dist/memory/index.d.ts +0 -29
- package/dist/memory/index.js +0 -1
- package/dist/network/index.cjs +0 -311
- package/dist/network/index.d.cts +0 -29
- package/dist/network/index.d.ts +0 -29
- package/dist/network/index.js +0 -309
- package/dist/network/vNext/index.cjs +0 -873
- package/dist/network/vNext/index.d.cts +0 -29
- package/dist/network/vNext/index.d.ts +0 -29
- package/dist/network/vNext/index.js +0 -871
- package/dist/relevance/index.cjs +0 -18
- package/dist/relevance/index.d.cts +0 -49
- package/dist/relevance/index.d.ts +0 -49
- package/dist/relevance/index.js +0 -1
- package/dist/runtime-context/index.cjs +0 -10
- package/dist/runtime-context/index.d.cts +0 -52
- package/dist/runtime-context/index.d.ts +0 -52
- package/dist/runtime-context/index.js +0 -1
- package/dist/server/index.cjs +0 -62
- package/dist/server/index.d.cts +0 -52
- package/dist/server/index.d.ts +0 -52
- package/dist/server/index.js +0 -59
- package/dist/storage/index.cjs +0 -336
- package/dist/storage/index.d.cts +0 -149
- package/dist/storage/index.d.ts +0 -149
- package/dist/storage/index.js +0 -303
- package/dist/telemetry/index.cjs +0 -30
- package/dist/telemetry/index.d.cts +0 -75
- package/dist/telemetry/index.d.ts +0 -75
- package/dist/telemetry/index.js +0 -1
- package/dist/telemetry/otel-vendor.cjs +0 -103
- package/dist/telemetry/otel-vendor.d.cts +0 -20
- package/dist/telemetry/otel-vendor.d.ts +0 -20
- package/dist/telemetry/otel-vendor.js +0 -57
- package/dist/tools/index.cjs +0 -18
- package/dist/tools/index.d.cts +0 -41
- package/dist/tools/index.d.ts +0 -41
- package/dist/tools/index.js +0 -1
- package/dist/tts/index.cjs +0 -10
- package/dist/tts/index.d.cts +0 -28
- package/dist/tts/index.d.ts +0 -28
- package/dist/tts/index.js +0 -1
- package/dist/types-Bo1uigWx.d.cts +0 -17
- package/dist/types-Bo1uigWx.d.ts +0 -17
- package/dist/utils.cjs +0 -58
- package/dist/utils.d.cts +0 -149
- package/dist/utils.d.ts +0 -149
- package/dist/utils.js +0 -1
- package/dist/vector/filter/index.cjs +0 -192
- package/dist/vector/filter/index.d.cts +0 -128
- package/dist/vector/filter/index.d.ts +0 -128
- package/dist/vector/filter/index.js +0 -190
- package/dist/vector/index.cjs +0 -10
- package/dist/vector/index.d.cts +0 -77
- package/dist/vector/index.d.ts +0 -77
- package/dist/vector/index.js +0 -1
- package/dist/voice/index.cjs +0 -18
- package/dist/voice/index.d.cts +0 -29
- package/dist/voice/index.d.ts +0 -29
- package/dist/voice/index.js +0 -1
- package/dist/workflows/constants.cjs +0 -10
- package/dist/workflows/constants.d.cts +0 -3
- package/dist/workflows/constants.d.ts +0 -3
- package/dist/workflows/constants.js +0 -1
- package/dist/workflows/index.cjs +0 -42
- package/dist/workflows/index.d.cts +0 -282
- package/dist/workflows/index.d.ts +0 -282
- package/dist/workflows/index.js +0 -1
- package/dist/workflows/legacy/index.cjs +0 -90
- package/dist/workflows/legacy/index.d.cts +0 -91
- package/dist/workflows/legacy/index.d.ts +0 -91
- package/dist/workflows/legacy/index.js +0 -1
- package/error.d.ts +0 -1
- package/eval.d.ts +0 -1
- package/hooks.d.ts +0 -1
- package/integration.d.ts +0 -1
- package/llm.d.ts +0 -1
- package/logger.d.ts +0 -1
- package/mastra.d.ts +0 -1
- package/mcp.d.ts +0 -1
- package/memory.d.ts +0 -1
- package/network/vNext.d.ts +0 -1
- package/network.d.ts +0 -1
- package/relevance.d.ts +0 -1
- package/runtime-context.d.ts +0 -1
- package/server.d.ts +0 -1
- package/storage.d.ts +0 -1
- package/telemetry/otel-vendor.d.ts +0 -1
- package/telemetry.d.ts +0 -1
- package/tools.d.ts +0 -1
- package/tts.d.ts +0 -1
- package/utils.d.ts +0 -1
- package/vector/filter.d.ts +0 -1
- package/vector.d.ts +0 -1
- package/voice.d.ts +0 -1
- package/workflows/_constants.d.ts +0 -1
- package/workflows/legacy.d.ts +0 -1
- package/workflows.d.ts +0 -1
package/dist/a2a/index.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// src/a2a/types.ts
|
|
2
|
-
var ErrorCodeParseError = -32700;
|
|
3
|
-
var ErrorCodeInvalidRequest = -32600;
|
|
4
|
-
var ErrorCodeMethodNotFound = -32601;
|
|
5
|
-
var ErrorCodeInvalidParams = -32602;
|
|
6
|
-
var ErrorCodeInternalError = -32603;
|
|
7
|
-
var ErrorCodeTaskNotFound = -32001;
|
|
8
|
-
var ErrorCodeTaskNotCancelable = -32002;
|
|
9
|
-
var ErrorCodePushNotificationNotSupported = -32003;
|
|
10
|
-
var ErrorCodeUnsupportedOperation = -32004;
|
|
11
|
-
|
|
12
|
-
// src/a2a/error.ts
|
|
13
|
-
var A2AError = class _A2AError extends Error {
|
|
14
|
-
code;
|
|
15
|
-
data;
|
|
16
|
-
taskId;
|
|
17
|
-
// Optional task ID context
|
|
18
|
-
constructor(code, message, data, taskId) {
|
|
19
|
-
super(message);
|
|
20
|
-
this.name = "A2AError";
|
|
21
|
-
this.code = code;
|
|
22
|
-
this.data = data;
|
|
23
|
-
this.taskId = taskId;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Formats the error into a standard JSON-RPC error object structure.
|
|
27
|
-
*/
|
|
28
|
-
toJSONRPCError() {
|
|
29
|
-
const errorObject = {
|
|
30
|
-
code: this.code,
|
|
31
|
-
message: this.message
|
|
32
|
-
};
|
|
33
|
-
if (this.data !== void 0) {
|
|
34
|
-
errorObject.data = this.data;
|
|
35
|
-
}
|
|
36
|
-
return errorObject;
|
|
37
|
-
}
|
|
38
|
-
// Static factory methods for common errors
|
|
39
|
-
static parseError(message, data) {
|
|
40
|
-
return new _A2AError(ErrorCodeParseError, message, data);
|
|
41
|
-
}
|
|
42
|
-
static invalidRequest(message, data) {
|
|
43
|
-
return new _A2AError(ErrorCodeInvalidRequest, message, data);
|
|
44
|
-
}
|
|
45
|
-
static methodNotFound(method) {
|
|
46
|
-
return new _A2AError(ErrorCodeMethodNotFound, `Method not found: ${method}`);
|
|
47
|
-
}
|
|
48
|
-
static invalidParams(message, data) {
|
|
49
|
-
return new _A2AError(ErrorCodeInvalidParams, message, data);
|
|
50
|
-
}
|
|
51
|
-
static internalError(message, data) {
|
|
52
|
-
return new _A2AError(ErrorCodeInternalError, message, data);
|
|
53
|
-
}
|
|
54
|
-
static taskNotFound(taskId) {
|
|
55
|
-
return new _A2AError(ErrorCodeTaskNotFound, `Task not found: ${taskId}`, void 0, taskId);
|
|
56
|
-
}
|
|
57
|
-
static taskNotCancelable(taskId) {
|
|
58
|
-
return new _A2AError(ErrorCodeTaskNotCancelable, `Task not cancelable: ${taskId}`, void 0, taskId);
|
|
59
|
-
}
|
|
60
|
-
static pushNotificationNotSupported() {
|
|
61
|
-
return new _A2AError(ErrorCodePushNotificationNotSupported, "Push Notification is not supported");
|
|
62
|
-
}
|
|
63
|
-
static unsupportedOperation(operation) {
|
|
64
|
-
return new _A2AError(ErrorCodeUnsupportedOperation, `Unsupported operation: ${operation}`);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export { A2AError, ErrorCodeInternalError, ErrorCodeInvalidParams, ErrorCodeInvalidRequest, ErrorCodeMethodNotFound, ErrorCodeParseError, ErrorCodePushNotificationNotSupported, ErrorCodeTaskNotCancelable, ErrorCodeTaskNotFound, ErrorCodeUnsupportedOperation };
|
package/dist/agent/index.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkFBKJ3652_cjs = require('../chunk-FBKJ3652.cjs');
|
|
4
|
-
var chunkQUSEDVYI_cjs = require('../chunk-QUSEDVYI.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "Agent", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkFBKJ3652_cjs.Agent; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "MessageList", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunkQUSEDVYI_cjs.MessageList; }
|
|
15
|
-
});
|
package/dist/agent/index.d.cts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export { Message as AiMessageType } from 'ai';
|
|
2
|
-
import 'json-schema';
|
|
3
|
-
import 'zod';
|
|
4
|
-
export { A as Agent, av as AgentConfig, c6 as AgentGenerateOptions, c5 as AgentMemoryOption, c7 as AgentStreamOptions, aZ as DynamicArgument, aY as MastraLanguageModel, c8 as MastraMessageContentV2, t as MastraMessageV2, c3 as MessageList, T as ToolsInput, c4 as ToolsetsInput } from '../base-CS5eSXbL.cjs';
|
|
5
|
-
import '../base-B_y9sMg0.cjs';
|
|
6
|
-
import '../types-Bo1uigWx.cjs';
|
|
7
|
-
import '../runtime-context/index.cjs';
|
|
8
|
-
import '../logger-B8XXh6ya.cjs';
|
|
9
|
-
import '../error/index.cjs';
|
|
10
|
-
import 'stream';
|
|
11
|
-
import 'sift';
|
|
12
|
-
import '@opentelemetry/api';
|
|
13
|
-
import 'xstate';
|
|
14
|
-
import 'node:events';
|
|
15
|
-
import '../vector/index.cjs';
|
|
16
|
-
import '../vector/filter/index.cjs';
|
|
17
|
-
import '@opentelemetry/sdk-trace-base';
|
|
18
|
-
import '../tts/index.cjs';
|
|
19
|
-
import 'node:http';
|
|
20
|
-
import 'hono';
|
|
21
|
-
import 'stream/web';
|
|
22
|
-
import 'events';
|
|
23
|
-
import 'node:stream/web';
|
|
24
|
-
import '../workflows/constants.cjs';
|
|
25
|
-
import 'ai/test';
|
|
26
|
-
import '../deployer/index.cjs';
|
|
27
|
-
import '../bundler/index.cjs';
|
|
28
|
-
import 'hono/cors';
|
|
29
|
-
import 'hono-openapi';
|
package/dist/agent/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export { Message as AiMessageType } from 'ai';
|
|
2
|
-
import 'json-schema';
|
|
3
|
-
import 'zod';
|
|
4
|
-
export { A as Agent, av as AgentConfig, c6 as AgentGenerateOptions, c5 as AgentMemoryOption, c7 as AgentStreamOptions, aZ as DynamicArgument, aY as MastraLanguageModel, c8 as MastraMessageContentV2, t as MastraMessageV2, c3 as MessageList, T as ToolsInput, c4 as ToolsetsInput } from '../base-DBhKcre4.js';
|
|
5
|
-
import '../base-ClrXcCRx.js';
|
|
6
|
-
import '../types-Bo1uigWx.js';
|
|
7
|
-
import '../runtime-context/index.js';
|
|
8
|
-
import '../logger-Bpa2oLL4.js';
|
|
9
|
-
import '../error/index.js';
|
|
10
|
-
import 'stream';
|
|
11
|
-
import 'sift';
|
|
12
|
-
import '@opentelemetry/api';
|
|
13
|
-
import 'xstate';
|
|
14
|
-
import 'node:events';
|
|
15
|
-
import '../vector/index.js';
|
|
16
|
-
import '../vector/filter/index.js';
|
|
17
|
-
import '@opentelemetry/sdk-trace-base';
|
|
18
|
-
import '../tts/index.js';
|
|
19
|
-
import 'node:http';
|
|
20
|
-
import 'hono';
|
|
21
|
-
import 'stream/web';
|
|
22
|
-
import 'events';
|
|
23
|
-
import 'node:stream/web';
|
|
24
|
-
import '../workflows/constants.js';
|
|
25
|
-
import 'ai/test';
|
|
26
|
-
import '../deployer/index.js';
|
|
27
|
-
import '../bundler/index.js';
|
|
28
|
-
import 'hono/cors';
|
|
29
|
-
import 'hono-openapi';
|
package/dist/agent/index.js
DELETED
package/dist/base-B_y9sMg0.d.cts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
|
-
import { Tracer, Span, BaggageEntry, Context } from '@opentelemetry/api';
|
|
3
|
-
import { R as RegisteredLogger, I as IMastraLogger } from './logger-B8XXh6ya.cjs';
|
|
4
|
-
import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
5
|
-
|
|
6
|
-
/** Sampling strategy configuration for OpenTelemetry */
|
|
7
|
-
type SamplingStrategy = {
|
|
8
|
-
/** Sample traces based on a probability between 0 and 1 */
|
|
9
|
-
type: 'ratio';
|
|
10
|
-
/** Probability between 0 and 1 (e.g., 0.1 for 10% sampling) */
|
|
11
|
-
probability: number;
|
|
12
|
-
} | {
|
|
13
|
-
/** Sample all traces */
|
|
14
|
-
type: 'always_on';
|
|
15
|
-
} | {
|
|
16
|
-
/** Don't sample any traces */
|
|
17
|
-
type: 'always_off';
|
|
18
|
-
} | {
|
|
19
|
-
/** Use parent sampling decision if available, otherwise use root sampler */
|
|
20
|
-
type: 'parent_based';
|
|
21
|
-
/** Configuration for the root sampler when no parent context exists */
|
|
22
|
-
root: {
|
|
23
|
-
/** Probability between 0 and 1 for the root sampler */
|
|
24
|
-
probability: number;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
/** Configuration options for OpenTelemetry */
|
|
28
|
-
type OtelConfig = {
|
|
29
|
-
/** Name of the service for telemetry identification */
|
|
30
|
-
serviceName?: string;
|
|
31
|
-
/** Whether telemetry is enabled. Defaults to true */
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
/** Name of the tracer to use. Defaults to 'mastra-tracer' */
|
|
34
|
-
tracerName?: string;
|
|
35
|
-
/** Sampling configuration to control trace data volume */
|
|
36
|
-
sampling?: SamplingStrategy;
|
|
37
|
-
/** Whether to disable local export */
|
|
38
|
-
disableLocalExport?: boolean;
|
|
39
|
-
/** Export configuration for sending telemetry data */
|
|
40
|
-
export?: {
|
|
41
|
-
/** Export to an OTLP (OpenTelemetry Protocol) endpoint */
|
|
42
|
-
type: 'otlp';
|
|
43
|
-
/** Whether to use gRPC or HTTP for OTLP */
|
|
44
|
-
protocol?: 'grpc' | 'http';
|
|
45
|
-
/** OTLP endpoint URL */
|
|
46
|
-
endpoint?: string;
|
|
47
|
-
/** Optional headers for OTLP requests */
|
|
48
|
-
headers?: Record<string, string>;
|
|
49
|
-
} | {
|
|
50
|
-
/** Export to console for development/debugging */
|
|
51
|
-
type: 'console';
|
|
52
|
-
} | {
|
|
53
|
-
type: 'custom';
|
|
54
|
-
tracerName?: string;
|
|
55
|
-
exporter: SpanExporter;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
type Trace = {
|
|
59
|
-
id: string;
|
|
60
|
-
parentSpanId: string;
|
|
61
|
-
name: string;
|
|
62
|
-
traceId: string;
|
|
63
|
-
scope: string;
|
|
64
|
-
kind: ReadableSpan['kind'];
|
|
65
|
-
attributes: ReadableSpan['attributes'];
|
|
66
|
-
status: ReadableSpan['status'];
|
|
67
|
-
events: ReadableSpan['events'];
|
|
68
|
-
links: ReadableSpan['links'];
|
|
69
|
-
other: Record<string, any>;
|
|
70
|
-
startTime: number;
|
|
71
|
-
endTime: number;
|
|
72
|
-
createdAt: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
declare global {
|
|
76
|
-
var __TELEMETRY__: Telemetry | undefined;
|
|
77
|
-
}
|
|
78
|
-
declare class Telemetry {
|
|
79
|
-
tracer: Tracer;
|
|
80
|
-
name: string;
|
|
81
|
-
private constructor();
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated This method does not do anything
|
|
84
|
-
*/
|
|
85
|
-
shutdown(): Promise<void>;
|
|
86
|
-
/**
|
|
87
|
-
* Initialize telemetry with the given configuration
|
|
88
|
-
* @param config - Optional telemetry configuration object
|
|
89
|
-
* @returns Telemetry instance that can be used for tracing
|
|
90
|
-
*/
|
|
91
|
-
static init(config?: OtelConfig): Telemetry;
|
|
92
|
-
static getActiveSpan(): Span | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* Get the global telemetry instance
|
|
95
|
-
* @throws {Error} If telemetry has not been initialized
|
|
96
|
-
* @returns {Telemetry} The global telemetry instance
|
|
97
|
-
*/
|
|
98
|
-
static get(): Telemetry;
|
|
99
|
-
/**
|
|
100
|
-
* Wraps a class instance with telemetry tracing
|
|
101
|
-
* @param instance The class instance to wrap
|
|
102
|
-
* @param options Optional configuration for tracing
|
|
103
|
-
* @returns Wrapped instance with all methods traced
|
|
104
|
-
*/
|
|
105
|
-
traceClass<T extends object>(instance: T, options?: {
|
|
106
|
-
/** Base name for spans (e.g. 'integration', 'agent') */
|
|
107
|
-
spanNamePrefix?: string;
|
|
108
|
-
/** Additional attributes to add to all spans */
|
|
109
|
-
attributes?: Record<string, string>;
|
|
110
|
-
/** Methods to exclude from tracing */
|
|
111
|
-
excludeMethods?: string[];
|
|
112
|
-
/** Skip tracing if telemetry is not active */
|
|
113
|
-
skipIfNoTelemetry?: boolean;
|
|
114
|
-
}): T;
|
|
115
|
-
static setBaggage(baggage: Record<string, BaggageEntry>, ctx?: Context): Context;
|
|
116
|
-
static withContext(ctx: Context, fn: () => void): void;
|
|
117
|
-
/**
|
|
118
|
-
* method to trace individual methods with proper context
|
|
119
|
-
* @param method The method to trace
|
|
120
|
-
* @param context Additional context for the trace
|
|
121
|
-
* @returns Wrapped method with tracing
|
|
122
|
-
*/
|
|
123
|
-
traceMethod<TMethod extends Function>(method: TMethod, context: {
|
|
124
|
-
spanName: string;
|
|
125
|
-
attributes?: Record<string, string>;
|
|
126
|
-
skipIfNoTelemetry?: boolean;
|
|
127
|
-
parentSpan?: Span;
|
|
128
|
-
}): TMethod;
|
|
129
|
-
getBaggageTracer(): Tracer;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
declare class MastraBase {
|
|
133
|
-
component: RegisteredLogger;
|
|
134
|
-
protected logger: IMastraLogger;
|
|
135
|
-
name?: string;
|
|
136
|
-
telemetry?: Telemetry;
|
|
137
|
-
constructor({ component, name }: {
|
|
138
|
-
component?: RegisteredLogger;
|
|
139
|
-
name?: string;
|
|
140
|
-
});
|
|
141
|
-
/**
|
|
142
|
-
* Set the logger for the agent
|
|
143
|
-
* @param logger
|
|
144
|
-
*/
|
|
145
|
-
__setLogger(logger: IMastraLogger): void;
|
|
146
|
-
/**
|
|
147
|
-
* Set the telemetry for the
|
|
148
|
-
* @param telemetry
|
|
149
|
-
*/
|
|
150
|
-
__setTelemetry(telemetry: Telemetry): void;
|
|
151
|
-
/**
|
|
152
|
-
* Get the telemetry on the vector
|
|
153
|
-
* @returns telemetry
|
|
154
|
-
*/
|
|
155
|
-
__getTelemetry(): Telemetry | undefined;
|
|
156
|
-
get experimental_telemetry(): {
|
|
157
|
-
tracer: _opentelemetry_api.Tracer;
|
|
158
|
-
isEnabled: boolean;
|
|
159
|
-
} | undefined;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export { MastraBase as M, type OtelConfig as O, type SamplingStrategy as S, type Trace as T, Telemetry as a };
|