mastra 1.28.1-alpha.2 → 1.28.1-alpha.3

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.
@@ -0,0 +1,23 @@
1
+ import type { TraceImportRecord, TraceImportSourceIdentity, TraceImportWindow } from './types.js';
2
+ export interface TraceImportReadContext extends TraceImportWindow {
3
+ source: TraceImportSourceIdentity;
4
+ importId: string;
5
+ signal?: AbortSignal;
6
+ onRetry: () => void;
7
+ }
8
+ /**
9
+ * Boundary between a source provider and the shared trace import pipeline.
10
+ *
11
+ * Implementations own authentication, pagination, source tree reconstruction,
12
+ * source-specific validation, field mapping, and stable destination IDs. They
13
+ * yield complete Mastra traces or an explicit skip reason.
14
+ *
15
+ * The shared importer owns common validation, preparation, batching, upload,
16
+ * resume, verification, reporting, and cleanup. It must not import raw
17
+ * provider types or contain provider-specific behavior.
18
+ */
19
+ export interface TraceImportProvider {
20
+ identify(signal?: AbortSignal): Promise<TraceImportSourceIdentity>;
21
+ read(context: TraceImportReadContext): AsyncIterable<TraceImportRecord>;
22
+ }
23
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/commands/traces/import/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAElG,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,MAAM,EAAE,yBAAyB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACnE,IAAI,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;CACzE"}
@@ -0,0 +1,69 @@
1
+ import type { SpanType } from '@mastra/core/observability';
2
+ /** String values accepted by Mastra's canonical SpanType enum. */
3
+ export type TraceImportSpanType = `${SpanType}`;
4
+ /**
5
+ * Provider-neutral span shape accepted by the trace import pipeline.
6
+ *
7
+ * Provider adapters must convert their source records into this shape before
8
+ * yielding them. The shared importer never reads provider-specific records.
9
+ */
10
+ export interface TraceImportSpan {
11
+ traceId: string;
12
+ spanId: string;
13
+ parentSpanId: string | null;
14
+ name: string;
15
+ spanType: TraceImportSpanType;
16
+ startedAt: string;
17
+ endedAt: string;
18
+ isEvent: boolean;
19
+ attributes?: Record<string, unknown>;
20
+ metadata: Record<string, unknown>;
21
+ tags?: string[];
22
+ input?: unknown;
23
+ output?: unknown;
24
+ error?: {
25
+ message: string;
26
+ name?: string;
27
+ details?: Record<string, unknown>;
28
+ } | null;
29
+ }
30
+ /** A complete source trace after conversion into Mastra spans. */
31
+ export interface TraceImportTrace {
32
+ /** Original provider trace ID, retained for reporting and debugging. */
33
+ sourceTraceId: string;
34
+ spans: TraceImportSpan[];
35
+ }
36
+ /** A source trace that an adapter could not safely convert. */
37
+ export interface SkippedTrace {
38
+ sourceTraceId: string | null;
39
+ spanCount: number;
40
+ reason: string;
41
+ detail?: string;
42
+ traceName?: string;
43
+ sourceSpanIds?: string[];
44
+ }
45
+ /** The only two record kinds visible to the shared importer. */
46
+ export type TraceImportRecord = {
47
+ kind: 'trace';
48
+ trace: TraceImportTrace;
49
+ warnings?: string[];
50
+ } | {
51
+ kind: 'skipped';
52
+ skipped: SkippedTrace;
53
+ };
54
+ export interface TraceImportWindow {
55
+ cutoffAt: string;
56
+ snapshotAt: string;
57
+ }
58
+ /**
59
+ * Non-secret source identity persisted with an import so resume can confirm it
60
+ * is still reading the same project with the same mapping and ID strategies.
61
+ */
62
+ export interface TraceImportSourceIdentity {
63
+ provider: string;
64
+ baseUrl: string;
65
+ projectId: string;
66
+ mapperVersion: string;
67
+ idAlgorithmVersion: string;
68
+ }
69
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/traces/import/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,kEAAkE;AAClE,MAAM,MAAM,mBAAmB,GAAG,GAAG,QAAQ,EAAE,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,GAAG,IAAI,CAAC;CACV;AAED,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AAED,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,gEAAgE;AAChE,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
@@ -3,7 +3,7 @@ name: mastra
3
3
  description: Documentation for mastra. Use when working with mastra APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "mastra"
6
- version: "1.28.1-alpha.2"
6
+ version: "1.28.1-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.28.1-alpha.2",
2
+ "version": "1.28.1-alpha.3",
3
3
  "package": "mastra",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -1 +1 @@
1
- import{J as t}from"./index-CzP5UcOK.js";import{c as p,d as i}from"./index-CzP5UcOK.js";function n(){const e={cache:new Map,regexConstructor:()=>{throw new Error("JavaScriptRawEngine: only support precompiled grammar")}};return{createScanner(r){return new t(r,e)},createString(r){return{content:r}}}}export{t as JavaScriptScanner,n as createJavaScriptRawEngine,p as createJavaScriptRegexEngine,i as defaultJavaScriptRegexConstructor};
1
+ import{J as t}from"./index-CvZN_eVy.js";import{c as p,d as i}from"./index-CvZN_eVy.js";function n(){const e={cache:new Map,regexConstructor:()=>{throw new Error("JavaScriptRawEngine: only support precompiled grammar")}};return{createScanner(r){return new t(r,e)},createString(r){return{content:r}}}}export{t as JavaScriptScanner,n as createJavaScriptRawEngine,p as createJavaScriptRegexEngine,i as defaultJavaScriptRegexConstructor};