@mastra/mssql 0.0.0-netlify-no-bundle-20251127120354 → 0.0.0-partial-response-backport-20251204204441
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 +56 -469
- package/README.md +20 -28
- package/dist/index.cjs +680 -343
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +679 -342
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/legacy-evals/index.d.ts +20 -0
- package/dist/storage/domains/legacy-evals/index.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +43 -14
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +16 -16
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +5 -5
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/traces/index.d.ts +37 -0
- package/dist/storage/domains/traces/index.d.ts.map +1 -0
- package/dist/storage/domains/workflows/index.d.ts +4 -5
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +88 -37
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +14 -12
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { PaginationArgs, PaginationInfo, EvalRow } from '@mastra/core/storage';
|
|
3
|
+
import sql from 'mssql';
|
|
4
|
+
export declare class LegacyEvalsMSSQL extends LegacyEvalsStorage {
|
|
5
|
+
private pool;
|
|
6
|
+
private schema;
|
|
7
|
+
constructor({ pool, schema }: {
|
|
8
|
+
pool: sql.ConnectionPool;
|
|
9
|
+
schema: string;
|
|
10
|
+
});
|
|
11
|
+
/** @deprecated use getEvals instead */
|
|
12
|
+
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
13
|
+
getEvals(options?: {
|
|
14
|
+
agentName?: string;
|
|
15
|
+
type?: 'test' | 'live';
|
|
16
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
17
|
+
evals: EvalRow[];
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/legacy-evals/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,GAAG,MAAM,OAAO,CAAC;AA8BxB,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,MAAM,CAAS;gBACX,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAAE,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAM1E,uCAAuC;IACjC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA0BlF,QAAQ,CACZ,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,GAAG,cAAmB,GACtB,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CAmGlD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastra/core/memory';
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
|
-
import type {
|
|
4
|
+
import type { StorageGetMessagesArg, PaginationInfo, PaginationArgs, StorageResourceType, ThreadSortOptions } from '@mastra/core/storage';
|
|
5
5
|
import sql from 'mssql';
|
|
6
6
|
import type { StoreOperationsMSSQL } from '../operations/index.js';
|
|
7
7
|
export declare class MemoryMSSQL extends MemoryStorage {
|
|
@@ -17,10 +17,20 @@ export declare class MemoryMSSQL extends MemoryStorage {
|
|
|
17
17
|
getThreadById({ threadId }: {
|
|
18
18
|
threadId: string;
|
|
19
19
|
}): Promise<StorageThreadType | null>;
|
|
20
|
-
|
|
20
|
+
getThreadsByResourceIdPaginated(args: {
|
|
21
|
+
resourceId: string;
|
|
22
|
+
} & PaginationArgs & ThreadSortOptions): Promise<PaginationInfo & {
|
|
23
|
+
threads: StorageThreadType[];
|
|
24
|
+
}>;
|
|
21
25
|
saveThread({ thread }: {
|
|
22
26
|
thread: StorageThreadType;
|
|
23
27
|
}): Promise<StorageThreadType>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
30
|
+
*/
|
|
31
|
+
getThreadsByResourceId(args: {
|
|
32
|
+
resourceId: string;
|
|
33
|
+
} & ThreadSortOptions): Promise<StorageThreadType[]>;
|
|
24
34
|
/**
|
|
25
35
|
* Updates a thread's title and metadata, merging with existing metadata. Returns the updated thread.
|
|
26
36
|
*/
|
|
@@ -33,26 +43,45 @@ export declare class MemoryMSSQL extends MemoryStorage {
|
|
|
33
43
|
threadId: string;
|
|
34
44
|
}): Promise<void>;
|
|
35
45
|
private _getIncludedMessages;
|
|
36
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated use getMessagesPaginated instead
|
|
48
|
+
*/
|
|
49
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
50
|
+
format?: 'v1';
|
|
51
|
+
}): Promise<MastraMessageV1[]>;
|
|
52
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
53
|
+
format: 'v2';
|
|
54
|
+
}): Promise<MastraMessageV2[]>;
|
|
55
|
+
getMessagesById({ messageIds, format, }: {
|
|
37
56
|
messageIds: string[];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
format: 'v1';
|
|
58
|
+
}): Promise<MastraMessageV1[]>;
|
|
59
|
+
getMessagesById({ messageIds, format, }: {
|
|
60
|
+
messageIds: string[];
|
|
61
|
+
format?: 'v2';
|
|
62
|
+
}): Promise<MastraMessageV2[]>;
|
|
63
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
64
|
+
format?: 'v1' | 'v2';
|
|
65
|
+
}): Promise<PaginationInfo & {
|
|
66
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
46
67
|
}>;
|
|
68
|
+
saveMessages(args: {
|
|
69
|
+
messages: MastraMessageV1[];
|
|
70
|
+
format?: undefined | 'v1';
|
|
71
|
+
}): Promise<MastraMessageV1[]>;
|
|
72
|
+
saveMessages(args: {
|
|
73
|
+
messages: MastraMessageV2[];
|
|
74
|
+
format: 'v2';
|
|
75
|
+
}): Promise<MastraMessageV2[]>;
|
|
47
76
|
updateMessages({ messages, }: {
|
|
48
|
-
messages: (Partial<Omit<
|
|
77
|
+
messages: (Partial<Omit<MastraMessageV2, 'createdAt'>> & {
|
|
49
78
|
id: string;
|
|
50
79
|
content?: {
|
|
51
80
|
metadata?: MastraMessageContentV2['metadata'];
|
|
52
81
|
content?: MastraMessageContentV2['content'];
|
|
53
82
|
};
|
|
54
83
|
})[];
|
|
55
|
-
}): Promise<
|
|
84
|
+
}): Promise<MastraMessageV2[]>;
|
|
56
85
|
deleteMessages(messageIds: string[]): Promise<void>;
|
|
57
86
|
getResourceById({ resourceId }: {
|
|
58
87
|
resourceId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EACL,aAAa,EAKd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,WAAY,SAAQ,aAAa;IAC5C,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,UAAU,CAAuB;IAEzC,OAAO,CAAC,uBAAuB;gBAsBnB,EACV,IAAI,EACJ,MAAM,EACN,UAAU,GACX,EAAE;QACD,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,oBAAoB,CAAC;KAClC;IAOK,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAuC7E,+BAA+B,CAC1C,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,cAAc,GAChB,iBAAiB,GAClB,OAAO,CAAC,cAAc,GAAG;QAAE,OAAO,EAAE,iBAAiB,EAAE,CAAA;KAAE,CAAC;IAiEhD,UAAU,CAAC,EAAE,MAAM,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CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA8DjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TracingStrategy } from '@mastra/core/ai-tracing';
|
|
2
2
|
import { ObservabilityStorage } from '@mastra/core/storage';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AISpanRecord, AITraceRecord, AITracesPaginatedArg, CreateAISpanRecord, PaginationInfo, UpdateAISpanRecord } from '@mastra/core/storage';
|
|
4
4
|
import type { ConnectionPool } from 'mssql';
|
|
5
5
|
import type { StoreOperationsMSSQL } from '../operations/index.js';
|
|
6
6
|
export declare class ObservabilityMSSQL extends ObservabilityStorage {
|
|
@@ -12,32 +12,32 @@ export declare class ObservabilityMSSQL extends ObservabilityStorage {
|
|
|
12
12
|
operations: StoreOperationsMSSQL;
|
|
13
13
|
schema?: string;
|
|
14
14
|
});
|
|
15
|
-
get
|
|
16
|
-
preferred:
|
|
17
|
-
supported:
|
|
15
|
+
get aiTracingStrategy(): {
|
|
16
|
+
preferred: TracingStrategy;
|
|
17
|
+
supported: TracingStrategy[];
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
createAISpan(span: CreateAISpanRecord): Promise<void>;
|
|
20
|
+
getAITrace(traceId: string): Promise<AITraceRecord | null>;
|
|
21
|
+
updateAISpan({ spanId, traceId, updates, }: {
|
|
22
22
|
spanId: string;
|
|
23
23
|
traceId: string;
|
|
24
|
-
updates: Partial<
|
|
24
|
+
updates: Partial<UpdateAISpanRecord>;
|
|
25
25
|
}): Promise<void>;
|
|
26
|
-
|
|
26
|
+
getAITracesPaginated({ filters, pagination, }: AITracesPaginatedArg): Promise<{
|
|
27
27
|
pagination: PaginationInfo;
|
|
28
|
-
spans:
|
|
28
|
+
spans: AISpanRecord[];
|
|
29
29
|
}>;
|
|
30
|
-
|
|
31
|
-
records:
|
|
30
|
+
batchCreateAISpans(args: {
|
|
31
|
+
records: CreateAISpanRecord[];
|
|
32
32
|
}): Promise<void>;
|
|
33
|
-
|
|
33
|
+
batchUpdateAISpans(args: {
|
|
34
34
|
records: {
|
|
35
35
|
traceId: string;
|
|
36
36
|
spanId: string;
|
|
37
|
-
updates: Partial<
|
|
37
|
+
updates: Partial<UpdateAISpanRecord>;
|
|
38
38
|
}[];
|
|
39
39
|
}): Promise<void>;
|
|
40
|
-
|
|
40
|
+
batchDeleteAITraces(args: {
|
|
41
41
|
traceIds: string[];
|
|
42
42
|
}): Promise<void>;
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/observability/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/observability/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAkB,oBAAoB,EAAkB,MAAM,sBAAsB,CAAC;AAC5F,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,kBAAmB,SAAQ,oBAAoB;IACnD,IAAI,EAAE,cAAc,CAAC;IAC5B,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,EACV,IAAI,EACJ,UAAU,EACV,MAAM,GACP,EAAE;QACD,IAAI,EAAE,cAAc,CAAC;QACrB,UAAU,EAAE,oBAAoB,CAAC;QACjC,MAAM,CA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type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
2
2
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
3
3
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { ConnectionPool } from 'mssql';
|
|
@@ -18,7 +18,7 @@ export declare class ScoresMSSQL extends ScoresStorage {
|
|
|
18
18
|
saveScore(score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>): Promise<{
|
|
19
19
|
score: ScoreRowData;
|
|
20
20
|
}>;
|
|
21
|
-
|
|
21
|
+
getScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
22
22
|
scorerId: string;
|
|
23
23
|
pagination: StoragePagination;
|
|
24
24
|
entityId?: string;
|
|
@@ -28,14 +28,14 @@ export declare class ScoresMSSQL extends ScoresStorage {
|
|
|
28
28
|
pagination: PaginationInfo;
|
|
29
29
|
scores: ScoreRowData[];
|
|
30
30
|
}>;
|
|
31
|
-
|
|
31
|
+
getScoresByRunId({ runId, pagination, }: {
|
|
32
32
|
runId: string;
|
|
33
33
|
pagination: StoragePagination;
|
|
34
34
|
}): Promise<{
|
|
35
35
|
pagination: PaginationInfo;
|
|
36
36
|
scores: ScoreRowData[];
|
|
37
37
|
}>;
|
|
38
|
-
|
|
38
|
+
getScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
39
39
|
pagination: StoragePagination;
|
|
40
40
|
entityId: string;
|
|
41
41
|
entityType: string;
|
|
@@ -43,7 +43,7 @@ export declare class ScoresMSSQL extends ScoresStorage {
|
|
|
43
43
|
pagination: PaginationInfo;
|
|
44
44
|
scores: ScoreRowData[];
|
|
45
45
|
}>;
|
|
46
|
-
|
|
46
|
+
getScoresBySpan({ traceId, spanId, pagination, }: {
|
|
47
47
|
traceId: string;
|
|
48
48
|
spanId: string;
|
|
49
49
|
pagination: StoragePagination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,qBAAqB,CAAC;AAElG,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAkC,MAAM,sBAAsB,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAoB1D,qBAAa,WAAY,SAAQ,aAAa;IACrC,IAAI,EAAE,cAAc,CAAC;IAC5B,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,EACV,IAAI,EACJ,UAAU,EACV,MAAM,GACP,EAAE;QACD,IAAI,EAAE,cAAc,CAAC;QACrB,UAAU,EAAE,oBAAoB,CAAC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA0BlE,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAiExG,mBAAmB,CAAC,EACxB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAmF7D,gBAAgB,CAAC,EACrB,KAAK,EACL,UAAU,GACX,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAsD7D,mBAAmB,CAAC,EACxB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAwD7D,eAAe,CAAC,EACpB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CAwDpE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PaginationInfo, PaginationArgs } from '@mastra/core/storage';
|
|
2
|
+
import { TracesStorage } from '@mastra/core/storage';
|
|
3
|
+
import sql from 'mssql';
|
|
4
|
+
import type { StoreOperationsMSSQL } from '../operations/index.js';
|
|
5
|
+
export declare class TracesMSSQL extends TracesStorage {
|
|
6
|
+
pool: sql.ConnectionPool;
|
|
7
|
+
private operations;
|
|
8
|
+
private schema?;
|
|
9
|
+
constructor({ pool, operations, schema, }: {
|
|
10
|
+
pool: sql.ConnectionPool;
|
|
11
|
+
operations: StoreOperationsMSSQL;
|
|
12
|
+
schema?: string;
|
|
13
|
+
});
|
|
14
|
+
/** @deprecated use getTracesPaginated instead*/
|
|
15
|
+
getTraces(args: {
|
|
16
|
+
name?: string;
|
|
17
|
+
scope?: string;
|
|
18
|
+
attributes?: Record<string, string>;
|
|
19
|
+
filters?: Record<string, any>;
|
|
20
|
+
page: number;
|
|
21
|
+
perPage?: number;
|
|
22
|
+
fromDate?: Date;
|
|
23
|
+
toDate?: Date;
|
|
24
|
+
}): Promise<any[]>;
|
|
25
|
+
getTracesPaginated(args: {
|
|
26
|
+
name?: string;
|
|
27
|
+
scope?: string;
|
|
28
|
+
attributes?: Record<string, string>;
|
|
29
|
+
filters?: Record<string, any>;
|
|
30
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
31
|
+
traces: any[];
|
|
32
|
+
}>;
|
|
33
|
+
batchTraceInsert({ records }: {
|
|
34
|
+
records: Record<string, any>[];
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/traces/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,WAAY,SAAQ,aAAa;IACrC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,EACV,IAAI,EACJ,UAAU,EACV,MAAM,GACP,EAAE;QACD,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;QACzB,UAAU,EAAE,oBAAoB,CAAC;QACjC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOD,gDAAgD;IACnC,SAAS,CAAC,IAAI,EAAE;QAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,MAAM,CAAC,EAAE,IAAI,CAAC;KACf,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAWL,kBAAkB,CAC7B,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B,GAAG,cAAc,GACjB,OAAO,CACR,cAAc,GAAG;QACf,MAAM,EAAE,GAAG,EAAE,CAAC;KACf,CACF;IAgJK,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAOvF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import type { StepResult, StorageListWorkflowRunsInput, WorkflowRun, WorkflowRuns, WorkflowRunState } from '@mastra/core';
|
|
1
2
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
|
-
import type { StorageListWorkflowRunsInput, WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
3
|
-
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
3
|
import sql from 'mssql';
|
|
5
4
|
import type { StoreOperationsMSSQL } from '../operations/index.js';
|
|
6
5
|
export declare class WorkflowsMSSQL extends WorkflowsStorage {
|
|
@@ -13,12 +12,12 @@ export declare class WorkflowsMSSQL extends WorkflowsStorage {
|
|
|
13
12
|
schema: string;
|
|
14
13
|
});
|
|
15
14
|
private parseWorkflowRun;
|
|
16
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
15
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext, }: {
|
|
17
16
|
workflowName: string;
|
|
18
17
|
runId: string;
|
|
19
18
|
stepId: string;
|
|
20
19
|
result: StepResult<any, any, any, any>;
|
|
21
|
-
|
|
20
|
+
runtimeContext: Record<string, any>;
|
|
22
21
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
23
22
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
24
23
|
workflowName: string;
|
|
@@ -45,6 +44,6 @@ export declare class WorkflowsMSSQL extends WorkflowsStorage {
|
|
|
45
44
|
runId: string;
|
|
46
45
|
workflowName?: string;
|
|
47
46
|
}): Promise<WorkflowRun | null>;
|
|
48
|
-
|
|
47
|
+
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, status, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
49
48
|
}
|
|
50
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACX,YAAY,EACZ,gBAA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E,MAAM,CAAC;YACf,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAC1C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;SACzC,CAAC;KACH,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IA8EnC,uBAAuB,CAAC,EAC5B,YAAY,EACZ,KAAK,EACL,UAAU,EACV,QAAQ,GACT,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCX,oBAAoB,CAAC,EACzB,YAAY,EACZ,KAAK,GACN,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA6B9B,kBAAkB,CAAC,EACvB,KAAK,EACL,YAAY,GACb,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IA2CzB,eAAe,CAAC,EACpB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,UAAU,EACV,MAAM,GACP,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;CA4E7D"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { MastraMessageContentV2,
|
|
2
|
-
|
|
3
|
-
import type { StorageThreadType } from '@mastra/core/memory';
|
|
4
|
-
import { MastraStorage } from '@mastra/core/storage';
|
|
5
|
-
export type MastraDBMessageWithTypedContent = Omit<MastraDBMessage, 'content'> & {
|
|
1
|
+
import type { MastraMessageContentV2, MastraMessageV2 } from '@mastra/core/agent';
|
|
2
|
+
export type MastraMessageV2WithTypedContent = Omit<MastraMessageV2, 'content'> & {
|
|
6
3
|
content: MastraMessageContentV2;
|
|
7
4
|
};
|
|
8
|
-
import type {
|
|
5
|
+
import type { MastraMessageV1, StorageThreadType } from '@mastra/core/memory';
|
|
6
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/scores';
|
|
7
|
+
import { MastraStorage } from '@mastra/core/storage';
|
|
8
|
+
import type { EvalRow, PaginationInfo, StorageColumn, StorageGetMessagesArg, StorageResourceType, TABLE_NAMES, WorkflowRun, WorkflowRuns, PaginationArgs, StoragePagination, ThreadSortOptions, StorageDomains, StorageGetTracesArg, StorageGetTracesPaginatedArg, AISpanRecord, AITraceRecord, AITracesPaginatedArg, UpdateAISpanRecord, CreateIndexOptions, IndexInfo, StorageIndexStats, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
9
|
+
import type { Trace } from '@mastra/core/telemetry';
|
|
9
10
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
10
11
|
import sql from 'mssql';
|
|
11
12
|
export type MSSQLConfigType = {
|
|
12
|
-
id: string;
|
|
13
13
|
schemaName?: string;
|
|
14
14
|
} & ({
|
|
15
15
|
server: string;
|
|
@@ -36,10 +36,28 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
36
36
|
hasColumn: boolean;
|
|
37
37
|
createTable: boolean;
|
|
38
38
|
deleteMessages: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
getScoresBySpan: boolean;
|
|
40
|
+
aiTracing: boolean;
|
|
41
41
|
indexManagement: boolean;
|
|
42
42
|
};
|
|
43
|
+
/** @deprecated use getEvals instead */
|
|
44
|
+
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
45
|
+
getEvals(options?: {
|
|
46
|
+
agentName?: string;
|
|
47
|
+
type?: 'test' | 'live';
|
|
48
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
49
|
+
evals: EvalRow[];
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated use getTracesPaginated instead
|
|
53
|
+
*/
|
|
54
|
+
getTraces(args: StorageGetTracesArg): Promise<Trace[]>;
|
|
55
|
+
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
56
|
+
traces: Trace[];
|
|
57
|
+
}>;
|
|
58
|
+
batchTraceInsert({ records }: {
|
|
59
|
+
records: Record<string, any>[];
|
|
60
|
+
}): Promise<void>;
|
|
43
61
|
createTable({ tableName, schema, }: {
|
|
44
62
|
tableName: TABLE_NAMES;
|
|
45
63
|
schema: Record<string, StorageColumn>;
|
|
@@ -73,6 +91,19 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
73
91
|
getThreadById({ threadId }: {
|
|
74
92
|
threadId: string;
|
|
75
93
|
}): Promise<StorageThreadType | null>;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
96
|
+
*/
|
|
97
|
+
getThreadsByResourceId(args: {
|
|
98
|
+
resourceId: string;
|
|
99
|
+
} & ThreadSortOptions): Promise<StorageThreadType[]>;
|
|
100
|
+
getThreadsByResourceIdPaginated(args: {
|
|
101
|
+
resourceId: string;
|
|
102
|
+
page: number;
|
|
103
|
+
perPage: number;
|
|
104
|
+
} & ThreadSortOptions): Promise<PaginationInfo & {
|
|
105
|
+
threads: StorageThreadType[];
|
|
106
|
+
}>;
|
|
76
107
|
saveThread({ thread }: {
|
|
77
108
|
thread: StorageThreadType;
|
|
78
109
|
}): Promise<StorageThreadType>;
|
|
@@ -84,25 +115,45 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
84
115
|
deleteThread({ threadId }: {
|
|
85
116
|
threadId: string;
|
|
86
117
|
}): Promise<void>;
|
|
87
|
-
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated use getMessagesPaginated instead
|
|
120
|
+
*/
|
|
121
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
122
|
+
format?: 'v1';
|
|
123
|
+
}): Promise<MastraMessageV1[]>;
|
|
124
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
125
|
+
format: 'v2';
|
|
126
|
+
}): Promise<MastraMessageV2[]>;
|
|
127
|
+
getMessagesById({ messageIds, format }: {
|
|
88
128
|
messageIds: string[];
|
|
89
|
-
|
|
90
|
-
|
|
129
|
+
format: 'v1';
|
|
130
|
+
}): Promise<MastraMessageV1[]>;
|
|
131
|
+
getMessagesById({ messageIds, format }: {
|
|
132
|
+
messageIds: string[];
|
|
133
|
+
format?: 'v2';
|
|
134
|
+
}): Promise<MastraMessageV2[]>;
|
|
135
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
136
|
+
format?: 'v1' | 'v2';
|
|
137
|
+
}): Promise<PaginationInfo & {
|
|
138
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
91
139
|
}>;
|
|
92
140
|
saveMessages(args: {
|
|
93
|
-
messages:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
141
|
+
messages: MastraMessageV1[];
|
|
142
|
+
format?: undefined | 'v1';
|
|
143
|
+
}): Promise<MastraMessageV1[]>;
|
|
144
|
+
saveMessages(args: {
|
|
145
|
+
messages: MastraMessageV2[];
|
|
146
|
+
format: 'v2';
|
|
147
|
+
}): Promise<MastraMessageV2[]>;
|
|
97
148
|
updateMessages({ messages, }: {
|
|
98
|
-
messages: (Partial<Omit<
|
|
149
|
+
messages: (Partial<Omit<MastraMessageV2, 'createdAt'>> & {
|
|
99
150
|
id: string;
|
|
100
151
|
content?: {
|
|
101
152
|
metadata?: MastraMessageContentV2['metadata'];
|
|
102
153
|
content?: MastraMessageContentV2['content'];
|
|
103
154
|
};
|
|
104
155
|
})[];
|
|
105
|
-
}): Promise<
|
|
156
|
+
}): Promise<MastraMessageV2[]>;
|
|
106
157
|
deleteMessages(messageIds: string[]): Promise<void>;
|
|
107
158
|
getResourceById({ resourceId }: {
|
|
108
159
|
resourceId: string;
|
|
@@ -118,12 +169,12 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
118
169
|
/**
|
|
119
170
|
* Workflows
|
|
120
171
|
*/
|
|
121
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
172
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext, }: {
|
|
122
173
|
workflowName: string;
|
|
123
174
|
runId: string;
|
|
124
175
|
stepId: string;
|
|
125
176
|
result: StepResult<any, any, any, any>;
|
|
126
|
-
|
|
177
|
+
runtimeContext: Record<string, any>;
|
|
127
178
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
128
179
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
129
180
|
workflowName: string;
|
|
@@ -146,7 +197,7 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
146
197
|
workflowName: string;
|
|
147
198
|
runId: string;
|
|
148
199
|
}): Promise<WorkflowRunState | null>;
|
|
149
|
-
|
|
200
|
+
getWorkflowRuns(args?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
150
201
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
151
202
|
runId: string;
|
|
152
203
|
workflowName?: string;
|
|
@@ -160,31 +211,31 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
160
211
|
describeIndex(indexName: string): Promise<StorageIndexStats>;
|
|
161
212
|
dropIndex(indexName: string): Promise<void>;
|
|
162
213
|
/**
|
|
163
|
-
* Tracing / Observability
|
|
214
|
+
* AI Tracing / Observability
|
|
164
215
|
*/
|
|
165
216
|
private getObservabilityStore;
|
|
166
|
-
|
|
167
|
-
|
|
217
|
+
createAISpan(span: AISpanRecord): Promise<void>;
|
|
218
|
+
updateAISpan({ spanId, traceId, updates, }: {
|
|
168
219
|
spanId: string;
|
|
169
220
|
traceId: string;
|
|
170
|
-
updates: Partial<
|
|
221
|
+
updates: Partial<UpdateAISpanRecord>;
|
|
171
222
|
}): Promise<void>;
|
|
172
|
-
|
|
173
|
-
|
|
223
|
+
getAITrace(traceId: string): Promise<AITraceRecord | null>;
|
|
224
|
+
getAITracesPaginated(args: AITracesPaginatedArg): Promise<{
|
|
174
225
|
pagination: PaginationInfo;
|
|
175
|
-
spans:
|
|
226
|
+
spans: AISpanRecord[];
|
|
176
227
|
}>;
|
|
177
|
-
|
|
178
|
-
records:
|
|
228
|
+
batchCreateAISpans(args: {
|
|
229
|
+
records: AISpanRecord[];
|
|
179
230
|
}): Promise<void>;
|
|
180
|
-
|
|
231
|
+
batchUpdateAISpans(args: {
|
|
181
232
|
records: {
|
|
182
233
|
traceId: string;
|
|
183
234
|
spanId: string;
|
|
184
|
-
updates: Partial<
|
|
235
|
+
updates: Partial<UpdateAISpanRecord>;
|
|
185
236
|
}[];
|
|
186
237
|
}): Promise<void>;
|
|
187
|
-
|
|
238
|
+
batchDeleteAITraces(args: {
|
|
188
239
|
traceIds: string[];
|
|
189
240
|
}): Promise<void>;
|
|
190
241
|
/**
|
|
@@ -193,7 +244,7 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
193
244
|
getScoreById({ id: _id }: {
|
|
194
245
|
id: string;
|
|
195
246
|
}): Promise<ScoreRowData | null>;
|
|
196
|
-
|
|
247
|
+
getScoresByScorerId({ scorerId: _scorerId, pagination: _pagination, entityId: _entityId, entityType: _entityType, source: _source, }: {
|
|
197
248
|
scorerId: string;
|
|
198
249
|
pagination: StoragePagination;
|
|
199
250
|
entityId?: string;
|
|
@@ -206,14 +257,14 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
206
257
|
saveScore(_score: ScoreRowData): Promise<{
|
|
207
258
|
score: ScoreRowData;
|
|
208
259
|
}>;
|
|
209
|
-
|
|
260
|
+
getScoresByRunId({ runId: _runId, pagination: _pagination, }: {
|
|
210
261
|
runId: string;
|
|
211
262
|
pagination: StoragePagination;
|
|
212
263
|
}): Promise<{
|
|
213
264
|
pagination: PaginationInfo;
|
|
214
265
|
scores: ScoreRowData[];
|
|
215
266
|
}>;
|
|
216
|
-
|
|
267
|
+
getScoresByEntityId({ entityId: _entityId, entityType: _entityType, pagination: _pagination, }: {
|
|
217
268
|
pagination: StoragePagination;
|
|
218
269
|
entityId: string;
|
|
219
270
|
entityType: string;
|
|
@@ -221,7 +272,7 @@ export declare class MSSQLStore extends MastraStorage {
|
|
|
221
272
|
pagination: PaginationInfo;
|
|
222
273
|
scores: ScoreRowData[];
|
|
223
274
|
}>;
|
|
224
|
-
|
|
275
|
+
getScoresBySpan({ traceId, spanId, pagination: _pagination, }: {
|
|
225
276
|
traceId: string;
|
|
226
277
|
spanId: string;
|
|
227
278
|
pagination: StoragePagination;
|