@mastra/mysql 0.0.0
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/README.md +81 -0
- package/dist/index.cjs +10820 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10803 -0
- package/dist/index.js.map +1 -0
- package/dist/storage/domains/agents/index.d.ts +62 -0
- package/dist/storage/domains/agents/index.d.ts.map +1 -0
- package/dist/storage/domains/background-tasks/index.d.ts +33 -0
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -0
- package/dist/storage/domains/blobs/index.d.ts +22 -0
- package/dist/storage/domains/blobs/index.d.ts.map +1 -0
- package/dist/storage/domains/channels/index.d.ts +34 -0
- package/dist/storage/domains/channels/index.d.ts.map +1 -0
- package/dist/storage/domains/datasets/index.d.ts +75 -0
- package/dist/storage/domains/datasets/index.d.ts.map +1 -0
- package/dist/storage/domains/experiments/index.d.ts +63 -0
- package/dist/storage/domains/experiments/index.d.ts.map +1 -0
- package/dist/storage/domains/favorites/index.d.ts +49 -0
- package/dist/storage/domains/favorites/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-clients/index.d.ts +61 -0
- package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-servers/index.d.ts +61 -0
- package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +110 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -0
- package/dist/storage/domains/observability/index.d.ts +35 -0
- package/dist/storage/domains/observability/index.d.ts.map +1 -0
- package/dist/storage/domains/operations/index.d.ts +106 -0
- package/dist/storage/domains/operations/index.d.ts.map +1 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts +42 -0
- package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -0
- package/dist/storage/domains/schedules/index.d.ts +33 -0
- package/dist/storage/domains/schedules/index.d.ts.map +1 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts +43 -0
- package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
- package/dist/storage/domains/scores/index.d.ts +87 -0
- package/dist/storage/domains/scores/index.d.ts.map +1 -0
- package/dist/storage/domains/skills/index.d.ts +61 -0
- package/dist/storage/domains/skills/index.d.ts.map +1 -0
- package/dist/storage/domains/tool-provider-connections/index.d.ts +46 -0
- package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
- package/dist/storage/domains/utils.d.ts +40 -0
- package/dist/storage/domains/utils.d.ts.map +1 -0
- package/dist/storage/domains/workflows/index.d.ts +78 -0
- package/dist/storage/domains/workflows/index.d.ts.map +1 -0
- package/dist/storage/domains/workspaces/index.d.ts +61 -0
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +58 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AgentsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageAgentType, StorageCreateAgentInput, StorageUpdateAgentInput, StorageListAgentsInput, StorageListAgentsOutput, CreateIndexOptions, AgentVersion, CreateVersionInput, ListVersionsInput, ListVersionsOutput } from '@mastra/core/storage';
|
|
3
|
+
import type { Pool } from 'mysql2/promise';
|
|
4
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
5
|
+
export declare class AgentsMySQL extends AgentsStorage {
|
|
6
|
+
#private;
|
|
7
|
+
private pool;
|
|
8
|
+
private operations;
|
|
9
|
+
/** Tables managed by this domain */
|
|
10
|
+
static readonly MANAGED_TABLES: readonly ["mastra_agents", "mastra_agent_versions"];
|
|
11
|
+
/**
|
|
12
|
+
* Returns default index definitions for the agents domain tables.
|
|
13
|
+
* Currently no default indexes are defined for agents.
|
|
14
|
+
*/
|
|
15
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
16
|
+
/**
|
|
17
|
+
* Exports DDL statements for all managed tables.
|
|
18
|
+
*/
|
|
19
|
+
static getExportDDL(): string[];
|
|
20
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
21
|
+
pool: Pool;
|
|
22
|
+
operations: StoreOperationsMySQL;
|
|
23
|
+
skipDefaultIndexes?: boolean;
|
|
24
|
+
indexes?: CreateIndexOptions[];
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Returns default index definitions for the agents domain tables.
|
|
28
|
+
*/
|
|
29
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
30
|
+
/**
|
|
31
|
+
* Creates default indexes for optimal query performance.
|
|
32
|
+
* Currently no default indexes are defined for agents.
|
|
33
|
+
*/
|
|
34
|
+
createDefaultIndexes(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
37
|
+
*/
|
|
38
|
+
createCustomIndexes(): Promise<void>;
|
|
39
|
+
init(): Promise<void>;
|
|
40
|
+
dangerouslyClearAll(): Promise<void>;
|
|
41
|
+
private safeParseJSON;
|
|
42
|
+
private parseRow;
|
|
43
|
+
getById(id: string): Promise<StorageAgentType | null>;
|
|
44
|
+
create(input: {
|
|
45
|
+
agent: StorageCreateAgentInput;
|
|
46
|
+
}): Promise<StorageAgentType>;
|
|
47
|
+
update(input: StorageUpdateAgentInput): Promise<StorageAgentType>;
|
|
48
|
+
delete(id: string): Promise<void>;
|
|
49
|
+
list(args?: StorageListAgentsInput): Promise<StorageListAgentsOutput>;
|
|
50
|
+
createVersion(input: CreateVersionInput): Promise<AgentVersion>;
|
|
51
|
+
getVersion(id: string): Promise<AgentVersion | null>;
|
|
52
|
+
getVersionByNumber(agentId: string, versionNumber: number): Promise<AgentVersion | null>;
|
|
53
|
+
getLatestVersion(agentId: string): Promise<AgentVersion | null>;
|
|
54
|
+
listVersions(input: ListVersionsInput): Promise<ListVersionsOutput>;
|
|
55
|
+
deleteVersion(id: string): Promise<void>;
|
|
56
|
+
deleteVersionsByParentId(entityId: string): Promise<void>;
|
|
57
|
+
countVersions(agentId: string): Promise<number>;
|
|
58
|
+
private serializeInstructions;
|
|
59
|
+
private deserializeInstructions;
|
|
60
|
+
private parseVersionRow;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/agents/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EAUd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,qBAAa,WAAY,SAAQ,aAAa;;IAC5C,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,UAAU,CAAuB;IAIzC,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,cAAc,sDAAiD;IAE/E;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,GAAE,MAAW,GAAG,kBAAkB,EAAE;IAItE;;OAEG;IACH,MAAM,CAAC,YAAY,IAAI,MAAM,EAAE;gBAOnB,EACV,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,OAAO,GACR,EAAE;QACD,IAAI,EAAE,IAAI,CAAC;QACX,UAAU,EAAE,oBAAoB,CAAC;QACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAChC;IAQD;;OAEG;IACH,0BAA0B,IAAI,kBAAkB,EAAE;IAIlD;;;OA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O,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BrD,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,eAAe;CA4BxB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { BackgroundTask, TaskFilter, TaskListResult, UpdateBackgroundTask } from '@mastra/core/background-tasks';
|
|
2
|
+
import { BackgroundTasksStorage } from '@mastra/core/storage';
|
|
3
|
+
import type { CreateIndexOptions } from '@mastra/core/storage';
|
|
4
|
+
import type { Pool } from 'mysql2/promise';
|
|
5
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
6
|
+
export declare class BackgroundTasksMySQL extends BackgroundTasksStorage {
|
|
7
|
+
#private;
|
|
8
|
+
private pool;
|
|
9
|
+
private operations;
|
|
10
|
+
static readonly MANAGED_TABLES: readonly ["mastra_background_tasks"];
|
|
11
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
12
|
+
pool: Pool;
|
|
13
|
+
operations: StoreOperationsMySQL;
|
|
14
|
+
skipDefaultIndexes?: boolean;
|
|
15
|
+
indexes?: CreateIndexOptions[];
|
|
16
|
+
});
|
|
17
|
+
init(): Promise<void>;
|
|
18
|
+
static getDefaultIndexDefs(prefix?: string): CreateIndexOptions[];
|
|
19
|
+
static getExportDDL(): string[];
|
|
20
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
21
|
+
createDefaultIndexes(): Promise<void>;
|
|
22
|
+
createCustomIndexes(): Promise<void>;
|
|
23
|
+
dangerouslyClearAll(): Promise<void>;
|
|
24
|
+
createTask(task: BackgroundTask): Promise<void>;
|
|
25
|
+
updateTask(taskId: string, update: UpdateBackgroundTask): Promise<void>;
|
|
26
|
+
getTask(taskId: string): Promise<BackgroundTask | null>;
|
|
27
|
+
listTasks(filter: TaskFilter): Promise<TaskListResult>;
|
|
28
|
+
deleteTask(taskId: string): Promise<void>;
|
|
29
|
+
deleteTasks(filter: TaskFilter): Promise<void>;
|
|
30
|
+
getRunningCount(): Promise<number>;
|
|
31
|
+
getRunningCountByAgent(agentId: string): Promise<number>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/background-tasks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,UAAU,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAyC,MAAM,sBAAsB,CAAC;AACrG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AA6C1D,qBAAa,oBAAqB,SAAQ,sBAAsB;;IAC9D,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,UAAU,CAAuB;IAIzC,MAAM,CAAC,QAAQ,CAAC,cAAc,uCAAqC;gBAEvD,EACV,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,OAAO,GACR,EAAE;QACD,IAAI,EAAE,IAAI,CAAC;QACX,UAAU,EAAE,oBAAoB,CAAC;QACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAChC;IAUK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B,MAAM,CAAC,mBAAmB,CAAC,MAAM,GAAE,MAAW,GAAG,kBAAkB,EAAE;IAyBrE,MAAM,CAAC,YAAY,IAAI,MAAM,EAAE;IAiB/B,0BAA0B,IAAI,kBAAkB,EAAE;IAI5C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOrC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOpC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B/C,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8CvE,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IASvD,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAsFtD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzC,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA4C9C,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAQlC,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAO/D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Pool } from 'mysql2/promise';
|
|
2
|
+
import { BlobStore } from '@mastra/core/storage';
|
|
3
|
+
import type { StorageBlobEntry } from '@mastra/core/storage';
|
|
4
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
5
|
+
export declare class BlobsMySQL extends BlobStore {
|
|
6
|
+
#private;
|
|
7
|
+
private pool;
|
|
8
|
+
private operations;
|
|
9
|
+
constructor({ pool, operations }: {
|
|
10
|
+
pool: Pool;
|
|
11
|
+
operations: StoreOperationsMySQL;
|
|
12
|
+
});
|
|
13
|
+
init(): Promise<void>;
|
|
14
|
+
put(entry: StorageBlobEntry): Promise<void>;
|
|
15
|
+
get(hash: string): Promise<StorageBlobEntry | null>;
|
|
16
|
+
has(hash: string): Promise<boolean>;
|
|
17
|
+
delete(hash: string): Promise<boolean>;
|
|
18
|
+
putMany(entries: StorageBlobEntry[]): Promise<void>;
|
|
19
|
+
getMany(hashes: string[]): Promise<Map<string, StorageBlobEntry>>;
|
|
20
|
+
dangerouslyClearAll(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/blobs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAyC,MAAM,sBAAsB,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,UAAW,SAAQ,SAAS;;IACvC,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,UAAU,CAAuB;gBAE7B,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,UAAU,EAAE,oBAAoB,CAAA;KAAE;IAM5E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,GAAG,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IASnD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQnC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQtC,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAcnD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAoBjE,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChannelsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { ChannelInstallation, ChannelConfig, CreateIndexOptions } from '@mastra/core/storage';
|
|
3
|
+
import type { Pool } from 'mysql2/promise';
|
|
4
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
5
|
+
export declare class ChannelsMySQL extends ChannelsStorage {
|
|
6
|
+
#private;
|
|
7
|
+
private pool;
|
|
8
|
+
private operations;
|
|
9
|
+
static readonly MANAGED_TABLES: readonly ["mastra_channel_installations", "mastra_channel_config"];
|
|
10
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
11
|
+
pool: Pool;
|
|
12
|
+
operations: StoreOperationsMySQL;
|
|
13
|
+
skipDefaultIndexes?: boolean;
|
|
14
|
+
indexes?: CreateIndexOptions[];
|
|
15
|
+
});
|
|
16
|
+
init(): Promise<void>;
|
|
17
|
+
static getDefaultIndexDefs(prefix?: string): CreateIndexOptions[];
|
|
18
|
+
static getExportDDL(): string[];
|
|
19
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
20
|
+
createDefaultIndexes(): Promise<void>;
|
|
21
|
+
createCustomIndexes(): Promise<void>;
|
|
22
|
+
dangerouslyClearAll(): Promise<void>;
|
|
23
|
+
saveInstallation(installation: ChannelInstallation): Promise<void>;
|
|
24
|
+
getInstallation(id: string): Promise<ChannelInstallation | null>;
|
|
25
|
+
getInstallationByAgent(platform: string, agentId: string): Promise<ChannelInstallation | null>;
|
|
26
|
+
getInstallationByWebhookId(webhookId: string): Promise<ChannelInstallation | null>;
|
|
27
|
+
listInstallations(platform: string): Promise<ChannelInstallation[]>;
|
|
28
|
+
deleteInstallation(id: string): Promise<void>;
|
|
29
|
+
saveConfig(config: ChannelConfig): Promise<void>;
|
|
30
|
+
getConfig(platform: string): Promise<ChannelConfig | null>;
|
|
31
|
+
deleteConfig(platform: string): Promise<void>;
|
|
32
|
+
private parseInstallationRow;
|
|
33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AAmB,GAAG,IAAI,CAAC;IAShE,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAS9F,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IASlF,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQnE,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO7C,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhD,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAc1D,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOnD,OAAO,CAAC,oBAAoB;CAc7B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DatasetsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, DatasetRecord, DatasetItem, DatasetItemRow, DatasetVersion, CreateDatasetInput, UpdateDatasetInput, AddDatasetItemInput, UpdateDatasetItemInput, ListDatasetsInput, ListDatasetsOutput, ListDatasetItemsInput, ListDatasetItemsOutput, ListDatasetVersionsInput, ListDatasetVersionsOutput, BatchInsertItemsInput, BatchDeleteItemsInput } from '@mastra/core/storage';
|
|
3
|
+
import type { Pool } from 'mysql2/promise';
|
|
4
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
5
|
+
export declare class DatasetsMySQL extends DatasetsStorage {
|
|
6
|
+
#private;
|
|
7
|
+
private pool;
|
|
8
|
+
private operations;
|
|
9
|
+
/** Tables managed by this domain */
|
|
10
|
+
static readonly MANAGED_TABLES: readonly ["mastra_datasets", "mastra_dataset_items", "mastra_dataset_versions"];
|
|
11
|
+
/**
|
|
12
|
+
* Returns default index definitions for the datasets domain tables.
|
|
13
|
+
* Currently no default indexes are defined for datasets.
|
|
14
|
+
*/
|
|
15
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
16
|
+
/**
|
|
17
|
+
* Exports DDL statements for all managed tables.
|
|
18
|
+
*/
|
|
19
|
+
static getExportDDL(): string[];
|
|
20
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
21
|
+
pool: Pool;
|
|
22
|
+
operations: StoreOperationsMySQL;
|
|
23
|
+
skipDefaultIndexes?: boolean;
|
|
24
|
+
indexes?: CreateIndexOptions[];
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Returns default index definitions for the datasets domain tables.
|
|
28
|
+
*/
|
|
29
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
30
|
+
/**
|
|
31
|
+
* Creates default indexes for optimal query performance.
|
|
32
|
+
* Currently no default indexes are defined for datasets.
|
|
33
|
+
*/
|
|
34
|
+
createDefaultIndexes(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
37
|
+
*/
|
|
38
|
+
createCustomIndexes(): Promise<void>;
|
|
39
|
+
init(): Promise<void>;
|
|
40
|
+
dangerouslyClearAll(): Promise<void>;
|
|
41
|
+
private mapDataset;
|
|
42
|
+
private mapItem;
|
|
43
|
+
private mapItemFull;
|
|
44
|
+
private mapVersion;
|
|
45
|
+
createDataset(input: CreateDatasetInput): Promise<DatasetRecord>;
|
|
46
|
+
getDatasetById({ id }: {
|
|
47
|
+
id: string;
|
|
48
|
+
}): Promise<DatasetRecord | null>;
|
|
49
|
+
protected _doUpdateDataset(args: UpdateDatasetInput): Promise<DatasetRecord>;
|
|
50
|
+
deleteDataset({ id }: {
|
|
51
|
+
id: string;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
listDatasets(args: ListDatasetsInput): Promise<ListDatasetsOutput>;
|
|
54
|
+
protected _doAddItem(args: AddDatasetItemInput): Promise<DatasetItem>;
|
|
55
|
+
protected _doUpdateItem(args: UpdateDatasetItemInput): Promise<DatasetItem>;
|
|
56
|
+
protected _doDeleteItem({ id, datasetId }: {
|
|
57
|
+
id: string;
|
|
58
|
+
datasetId: string;
|
|
59
|
+
}): Promise<void>;
|
|
60
|
+
getItemById(args: {
|
|
61
|
+
id: string;
|
|
62
|
+
datasetVersion?: number;
|
|
63
|
+
}): Promise<DatasetItem | null>;
|
|
64
|
+
getItemsByVersion({ datasetId, version }: {
|
|
65
|
+
datasetId: string;
|
|
66
|
+
version: number;
|
|
67
|
+
}): Promise<DatasetItem[]>;
|
|
68
|
+
getItemHistory(itemId: string): Promise<DatasetItemRow[]>;
|
|
69
|
+
listItems(args: ListDatasetItemsInput): Promise<ListDatasetItemsOutput>;
|
|
70
|
+
createDatasetVersion(datasetId: string, version: number): Promise<DatasetVersion>;
|
|
71
|
+
listDatasetVersions(input: ListDatasetVersionsInput): Promise<ListDatasetVersionsOutput>;
|
|
72
|
+
protected _doBatchInsertItems(input: BatchInsertItemsInput): Promise<DatasetItem[]>;
|
|
73
|
+
protected _doBatchDeleteItems(input: BatchDeleteItemsInput): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/datasets/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAUL,eAAe,EAGhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,sBAAsB,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AAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;CAwFjF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ExperimentsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, Experiment, ExperimentResult, ExperimentReviewCounts, CreateExperimentInput, UpdateExperimentInput, AddExperimentResultInput, UpdateExperimentResultInput, ListExperimentsInput, ListExperimentsOutput, ListExperimentResultsInput, ListExperimentResultsOutput } from '@mastra/core/storage';
|
|
3
|
+
import type { Pool } from 'mysql2/promise';
|
|
4
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
5
|
+
export declare class ExperimentsMySQL extends ExperimentsStorage {
|
|
6
|
+
#private;
|
|
7
|
+
private pool;
|
|
8
|
+
private operations;
|
|
9
|
+
/** Tables managed by this domain */
|
|
10
|
+
static readonly MANAGED_TABLES: readonly ["mastra_experiments", "mastra_experiment_results"];
|
|
11
|
+
/**
|
|
12
|
+
* Returns default index definitions for the experiments domain tables.
|
|
13
|
+
* Currently no default indexes are defined for experiments.
|
|
14
|
+
*/
|
|
15
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
16
|
+
/**
|
|
17
|
+
* Exports DDL statements for all managed tables.
|
|
18
|
+
*/
|
|
19
|
+
static getExportDDL(): string[];
|
|
20
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
21
|
+
pool: Pool;
|
|
22
|
+
operations: StoreOperationsMySQL;
|
|
23
|
+
skipDefaultIndexes?: boolean;
|
|
24
|
+
indexes?: CreateIndexOptions[];
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Returns default index definitions for the experiments domain tables.
|
|
28
|
+
*/
|
|
29
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
30
|
+
/**
|
|
31
|
+
* Creates default indexes for optimal query performance.
|
|
32
|
+
* Currently no default indexes are defined for experiments.
|
|
33
|
+
*/
|
|
34
|
+
createDefaultIndexes(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
37
|
+
*/
|
|
38
|
+
createCustomIndexes(): Promise<void>;
|
|
39
|
+
init(): Promise<void>;
|
|
40
|
+
dangerouslyClearAll(): Promise<void>;
|
|
41
|
+
private mapExperiment;
|
|
42
|
+
private mapExperimentResult;
|
|
43
|
+
createExperiment(input: CreateExperimentInput): Promise<Experiment>;
|
|
44
|
+
updateExperiment(input: UpdateExperimentInput): Promise<Experiment>;
|
|
45
|
+
getExperimentById(args: {
|
|
46
|
+
id: string;
|
|
47
|
+
}): Promise<Experiment | null>;
|
|
48
|
+
listExperiments(args: ListExperimentsInput): Promise<ListExperimentsOutput>;
|
|
49
|
+
deleteExperiment(args: {
|
|
50
|
+
id: string;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
addExperimentResult(input: AddExperimentResultInput): Promise<ExperimentResult>;
|
|
53
|
+
getExperimentResultById(args: {
|
|
54
|
+
id: string;
|
|
55
|
+
}): Promise<ExperimentResult | null>;
|
|
56
|
+
updateExperimentResult(input: UpdateExperimentResultInput): Promise<ExperimentResult>;
|
|
57
|
+
getReviewSummary(): Promise<ExperimentReviewCounts[]>;
|
|
58
|
+
listExperimentResults(args: ListExperimentResultsInput): Promise<ListExperimentResultsOutput>;
|
|
59
|
+
deleteExperimentResults(args: {
|
|
60
|
+
experimentId: string;
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/experiments/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,kBAAkB,EAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,2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AAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAmBnE,eAAe,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA0D3E,gBAAgB,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA4CrD,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuD/E,uBAAuB,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAmB/E,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA+CrF,gBAAgB,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAqCrD,qBAAqB,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAkD7F,uBAAuB,CAAC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB7E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FavoritesStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, StorageDeleteFavoritesForEntityInput, StorageIsFavoritedBatchInput, StorageListFavoritesInput, StorageFavoriteKey } from '@mastra/core/storage';
|
|
3
|
+
import type { FavoriteToggleResult } from '@mastra/core/storage/domains/favorites';
|
|
4
|
+
import type { Pool } from 'mysql2/promise';
|
|
5
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
6
|
+
export declare class FavoritesMySQL extends FavoritesStorage {
|
|
7
|
+
#private;
|
|
8
|
+
private pool;
|
|
9
|
+
private operations;
|
|
10
|
+
/** Tables managed by this domain */
|
|
11
|
+
static readonly MANAGED_TABLES: readonly ["mastra_favorites"];
|
|
12
|
+
/**
|
|
13
|
+
* Returns default index definitions for the favorites domain tables.
|
|
14
|
+
* Currently no default indexes are defined for favorites.
|
|
15
|
+
*/
|
|
16
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
17
|
+
/**
|
|
18
|
+
* Exports DDL statements for all managed tables.
|
|
19
|
+
*/
|
|
20
|
+
static getExportDDL(): string[];
|
|
21
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
22
|
+
pool: Pool;
|
|
23
|
+
operations: StoreOperationsMySQL;
|
|
24
|
+
skipDefaultIndexes?: boolean;
|
|
25
|
+
indexes?: CreateIndexOptions[];
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Returns default index definitions for the favorites domain tables.
|
|
29
|
+
*/
|
|
30
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
31
|
+
/**
|
|
32
|
+
* Creates default indexes for optimal query performance.
|
|
33
|
+
* Currently no default indexes are defined for favorites.
|
|
34
|
+
*/
|
|
35
|
+
createDefaultIndexes(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
38
|
+
*/
|
|
39
|
+
createCustomIndexes(): Promise<void>;
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
dangerouslyClearAll(): Promise<void>;
|
|
42
|
+
favorite(input: StorageFavoriteKey): Promise<FavoriteToggleResult>;
|
|
43
|
+
unfavorite(input: StorageFavoriteKey): Promise<FavoriteToggleResult>;
|
|
44
|
+
isFavorited(input: StorageFavoriteKey): Promise<boolean>;
|
|
45
|
+
isFavoritedBatch(input: StorageIsFavoritedBatchInput): Promise<Set<string>>;
|
|
46
|
+
listFavoritedIds(input: StorageListFavoritesInput): Promise<string[]>;
|
|
47
|
+
deleteFavoritesForEntity(input: StorageDeleteFavoritesForEntityInput): Promise<number>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 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AAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAyDlE,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAuDpE,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAoBxD,gBAAgB,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IA+B3E,gBAAgB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBrE,wBAAwB,CAAC,KAAK,EAAE,oCAAoC,GAAG,OAAO,CAAC,MAAM,CAAC;CA4B7F"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { MCPClientsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, StorageMCPClientType, StorageCreateMCPClientInput, StorageUpdateMCPClientInput, StorageListMCPClientsInput, StorageListMCPClientsOutput } from '@mastra/core/storage';
|
|
3
|
+
import type { MCPClientVersion, CreateMCPClientVersionInput, ListMCPClientVersionsInput, ListMCPClientVersionsOutput } from '@mastra/core/storage/domains/mcp-clients';
|
|
4
|
+
import type { Pool } from 'mysql2/promise';
|
|
5
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
6
|
+
export declare class MCPClientsMySQL extends MCPClientsStorage {
|
|
7
|
+
#private;
|
|
8
|
+
private pool;
|
|
9
|
+
private operations;
|
|
10
|
+
/** Tables managed by this domain */
|
|
11
|
+
static readonly MANAGED_TABLES: readonly ["mastra_mcp_clients", "mastra_mcp_client_versions"];
|
|
12
|
+
/**
|
|
13
|
+
* Returns default index definitions for the mcp-clients domain tables.
|
|
14
|
+
* Currently no default indexes are defined for mcp-clients.
|
|
15
|
+
*/
|
|
16
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
17
|
+
/**
|
|
18
|
+
* Exports DDL statements for all managed tables.
|
|
19
|
+
*/
|
|
20
|
+
static getExportDDL(): string[];
|
|
21
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
22
|
+
pool: Pool;
|
|
23
|
+
operations: StoreOperationsMySQL;
|
|
24
|
+
skipDefaultIndexes?: boolean;
|
|
25
|
+
indexes?: CreateIndexOptions[];
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Returns default index definitions for the mcp-clients domain tables.
|
|
29
|
+
*/
|
|
30
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
31
|
+
/**
|
|
32
|
+
* Creates default indexes for optimal query performance.
|
|
33
|
+
* Currently no default indexes are defined for mcp-clients.
|
|
34
|
+
*/
|
|
35
|
+
createDefaultIndexes(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
38
|
+
*/
|
|
39
|
+
createCustomIndexes(): Promise<void>;
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
dangerouslyClearAll(): Promise<void>;
|
|
42
|
+
private safeParseJSON;
|
|
43
|
+
private parseClientRow;
|
|
44
|
+
private parseVersionRow;
|
|
45
|
+
getById(id: string): Promise<StorageMCPClientType | null>;
|
|
46
|
+
create(input: {
|
|
47
|
+
mcpClient: StorageCreateMCPClientInput;
|
|
48
|
+
}): Promise<StorageMCPClientType>;
|
|
49
|
+
update(input: StorageUpdateMCPClientInput): Promise<StorageMCPClientType>;
|
|
50
|
+
delete(id: string): Promise<void>;
|
|
51
|
+
list(args?: StorageListMCPClientsInput): Promise<StorageListMCPClientsOutput>;
|
|
52
|
+
createVersion(input: CreateMCPClientVersionInput): Promise<MCPClientVersion>;
|
|
53
|
+
getVersion(id: string): Promise<MCPClientVersion | null>;
|
|
54
|
+
getVersionByNumber(mcpClientId: string, versionNumber: number): Promise<MCPClientVersion | null>;
|
|
55
|
+
getLatestVersion(mcpClientId: string): Promise<MCPClientVersion | null>;
|
|
56
|
+
listVersions(input: ListMCPClientVersionsInput): Promise<ListMCPClientVersionsOutput>;
|
|
57
|
+
deleteVersion(id: string): Promise<void>;
|
|
58
|
+
deleteVersionsByParentId(entityId: string): Promise<void>;
|
|
59
|
+
countVersions(mcpClientId: string): Promise<number>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/mcp-clients/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EASlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAiB,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,qBAAa,eAAgB,SAAQ,iBAAiB;;IACpD,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,UAAU,CAAuB;IAIzC,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,cAAc,gEAA2D;IAEzF;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,GAAE,MAAW,GAAG,kBAAkB,EAAE;IAItE;;OAEG;IACH,MAAM,CAAC,YAAY,IAAI,MAAM,EAAE;gBAOnB,EACV,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,OAAO,GACR,EAAE;QACD,IAAI,EAAE,IAAI,CAAC;QACX,UAAU,EAAE,oBAAoB,CAAC;QACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;K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;IAgBxC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzD,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB1D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { MCPServersStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, StorageMCPServerType, StorageCreateMCPServerInput, StorageUpdateMCPServerInput, StorageListMCPServersInput, StorageListMCPServersOutput } from '@mastra/core/storage';
|
|
3
|
+
import type { MCPServerVersion, CreateMCPServerVersionInput, ListMCPServerVersionsInput, ListMCPServerVersionsOutput } from '@mastra/core/storage/domains/mcp-servers';
|
|
4
|
+
import type { Pool } from 'mysql2/promise';
|
|
5
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
6
|
+
export declare class MCPServersMySQL extends MCPServersStorage {
|
|
7
|
+
#private;
|
|
8
|
+
private pool;
|
|
9
|
+
private operations;
|
|
10
|
+
/** Tables managed by this domain */
|
|
11
|
+
static readonly MANAGED_TABLES: readonly ["mastra_mcp_servers", "mastra_mcp_server_versions"];
|
|
12
|
+
/**
|
|
13
|
+
* Returns default index definitions for the mcp-servers domain tables.
|
|
14
|
+
* Currently no default indexes are defined for mcp-servers.
|
|
15
|
+
*/
|
|
16
|
+
static getDefaultIndexDefs(_prefix?: string): CreateIndexOptions[];
|
|
17
|
+
/**
|
|
18
|
+
* Exports DDL statements for all managed tables.
|
|
19
|
+
*/
|
|
20
|
+
static getExportDDL(): string[];
|
|
21
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
22
|
+
pool: Pool;
|
|
23
|
+
operations: StoreOperationsMySQL;
|
|
24
|
+
skipDefaultIndexes?: boolean;
|
|
25
|
+
indexes?: CreateIndexOptions[];
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Returns default index definitions for the mcp-servers domain tables.
|
|
29
|
+
*/
|
|
30
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
31
|
+
/**
|
|
32
|
+
* Creates default indexes for optimal query performance.
|
|
33
|
+
* Currently no default indexes are defined for mcp-servers.
|
|
34
|
+
*/
|
|
35
|
+
createDefaultIndexes(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
38
|
+
*/
|
|
39
|
+
createCustomIndexes(): Promise<void>;
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
dangerouslyClearAll(): Promise<void>;
|
|
42
|
+
private safeParseJSON;
|
|
43
|
+
private parseServerRow;
|
|
44
|
+
private parseVersionRow;
|
|
45
|
+
getById(id: string): Promise<StorageMCPServerType | null>;
|
|
46
|
+
create(input: {
|
|
47
|
+
mcpServer: StorageCreateMCPServerInput;
|
|
48
|
+
}): Promise<StorageMCPServerType>;
|
|
49
|
+
update(input: StorageUpdateMCPServerInput): Promise<StorageMCPServerType>;
|
|
50
|
+
delete(id: string): Promise<void>;
|
|
51
|
+
list(args?: StorageListMCPServersInput): Promise<StorageListMCPServersOutput>;
|
|
52
|
+
createVersion(input: CreateMCPServerVersionInput): Promise<MCPServerVersion>;
|
|
53
|
+
getVersion(id: string): Promise<MCPServerVersion | null>;
|
|
54
|
+
getVersionByNumber(mcpServerId: string, versionNumber: number): Promise<MCPServerVersion | null>;
|
|
55
|
+
getLatestVersion(mcpServerId: string): Promise<MCPServerVersion | null>;
|
|
56
|
+
listVersions(input: ListMCPServerVersionsInput): Promise<ListMCPServerVersionsOutput>;
|
|
57
|
+
deleteVersion(id: string): Promise<void>;
|
|
58
|
+
deleteVersionsByParentId(entityId: string): Promise<void>;
|
|
59
|
+
countVersions(mcpServerId: string): Promise<number>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/mcp-servers/index.ts"],"names":[],"mapp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;IAYtB,OAAO,CAAC,eAAe;IAyBjB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAoBzD,MAAM,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,2BAA2B,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA2DxF,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA8CzE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBjC,IAAI,CAAC,IAAI,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA6E7E,aAAa,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuC5E,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAoBxD,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAwBhG,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAsBvE,YAAY,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAwCrF,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBxC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzD,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB1D"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { MastraDBMessage, MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
|
+
import type { StorageThreadType } from '@mastra/core/memory';
|
|
3
|
+
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
|
+
import type { CreateIndexOptions, CreateObservationalMemoryInput, CreateReflectionGenerationInput, ObservationalMemoryHistoryOptions, ObservationalMemoryRecord, PaginationArgs, PaginationInfo, StorageCloneThreadInput, StorageCloneThreadOutput, StorageListMessagesByResourceIdInput, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsInput, StorageListThreadsOutput, StorageResourceType, SwapBufferedReflectionToActiveInput, SwapBufferedToActiveInput, SwapBufferedToActiveResult, ThreadSortOptions, UpdateActiveObservationsInput, UpdateBufferedObservationsInput, UpdateBufferedReflectionInput } from '@mastra/core/storage';
|
|
5
|
+
import type { Pool } from 'mysql2/promise';
|
|
6
|
+
import type { StoreOperationsMySQL } from '../operations/index.js';
|
|
7
|
+
export declare class MemoryMySQL extends MemoryStorage {
|
|
8
|
+
#private;
|
|
9
|
+
readonly supportsObservationalMemory = true;
|
|
10
|
+
private pool;
|
|
11
|
+
private operations;
|
|
12
|
+
static readonly MANAGED_TABLES: readonly ["mastra_threads", "mastra_messages", "mastra_resources"];
|
|
13
|
+
constructor({ pool, operations, skipDefaultIndexes, indexes, }: {
|
|
14
|
+
pool: Pool;
|
|
15
|
+
operations: StoreOperationsMySQL;
|
|
16
|
+
skipDefaultIndexes?: boolean;
|
|
17
|
+
indexes?: CreateIndexOptions[];
|
|
18
|
+
});
|
|
19
|
+
init(): Promise<void>;
|
|
20
|
+
static getDefaultIndexDefs(prefix?: string): CreateIndexOptions[];
|
|
21
|
+
static getExportDDL(): string[];
|
|
22
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
23
|
+
createDefaultIndexes(): Promise<void>;
|
|
24
|
+
createCustomIndexes(): Promise<void>;
|
|
25
|
+
dangerouslyClearAll(): Promise<void>;
|
|
26
|
+
private mapThread;
|
|
27
|
+
private mapMessage;
|
|
28
|
+
private fetchMessagesForThread;
|
|
29
|
+
/**
|
|
30
|
+
* Fetches included messages by ID, discovering their thread automatically.
|
|
31
|
+
* This handles cross-thread includes where the include item doesn't specify a threadId.
|
|
32
|
+
*/
|
|
33
|
+
private _getIncludedMessages;
|
|
34
|
+
private collectIncludeMessages;
|
|
35
|
+
private upsertThread;
|
|
36
|
+
getThreadById({ threadId, resourceId, }: {
|
|
37
|
+
threadId: string;
|
|
38
|
+
resourceId?: string;
|
|
39
|
+
}): Promise<StorageThreadType | null>;
|
|
40
|
+
listThreads(args: StorageListThreadsInput): Promise<StorageListThreadsOutput>;
|
|
41
|
+
getThreadsByResourceId(args: {
|
|
42
|
+
resourceId: string;
|
|
43
|
+
} & ThreadSortOptions): Promise<StorageThreadType[]>;
|
|
44
|
+
getThreadsByResourceIdPaginated(args: {
|
|
45
|
+
resourceId: string;
|
|
46
|
+
} & PaginationArgs & ThreadSortOptions): Promise<PaginationInfo & {
|
|
47
|
+
threads: StorageThreadType[];
|
|
48
|
+
}>;
|
|
49
|
+
saveThread({ thread }: {
|
|
50
|
+
thread: StorageThreadType;
|
|
51
|
+
}): Promise<StorageThreadType>;
|
|
52
|
+
updateThread({ id, title, metadata, }: {
|
|
53
|
+
id: string;
|
|
54
|
+
title: string;
|
|
55
|
+
metadata: Record<string, unknown>;
|
|
56
|
+
}): Promise<StorageThreadType>;
|
|
57
|
+
deleteThread({ threadId }: {
|
|
58
|
+
threadId: string;
|
|
59
|
+
}): Promise<void>;
|
|
60
|
+
listMessagesById({ messageIds }: {
|
|
61
|
+
messageIds: string[];
|
|
62
|
+
}): Promise<{
|
|
63
|
+
messages: MastraDBMessage[];
|
|
64
|
+
}>;
|
|
65
|
+
saveMessages(args: {
|
|
66
|
+
messages: MastraDBMessage[];
|
|
67
|
+
}): Promise<{
|
|
68
|
+
messages: MastraDBMessage[];
|
|
69
|
+
}>;
|
|
70
|
+
updateMessages(args: {
|
|
71
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
72
|
+
id: string;
|
|
73
|
+
content?: Partial<MastraMessageContentV2>;
|
|
74
|
+
})[];
|
|
75
|
+
}): Promise<MastraDBMessage[]>;
|
|
76
|
+
deleteMessages(messageIds: string[]): Promise<void>;
|
|
77
|
+
cloneThread(args: StorageCloneThreadInput): Promise<StorageCloneThreadOutput>;
|
|
78
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
79
|
+
listMessagesByResourceId(args: StorageListMessagesByResourceIdInput): Promise<StorageListMessagesOutput>;
|
|
80
|
+
getResourceById({ resourceId }: {
|
|
81
|
+
resourceId: string;
|
|
82
|
+
}): Promise<StorageResourceType | null>;
|
|
83
|
+
saveResource({ resource }: {
|
|
84
|
+
resource: StorageResourceType;
|
|
85
|
+
}): Promise<StorageResourceType>;
|
|
86
|
+
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
87
|
+
resourceId: string;
|
|
88
|
+
workingMemory?: string;
|
|
89
|
+
metadata?: Record<string, unknown>;
|
|
90
|
+
}): Promise<StorageResourceType>;
|
|
91
|
+
getObservationalMemory(threadId: string | null, resourceId: string): Promise<ObservationalMemoryRecord | null>;
|
|
92
|
+
getObservationalMemoryHistory(threadId: string | null, resourceId: string, limit?: number, options?: ObservationalMemoryHistoryOptions): Promise<ObservationalMemoryRecord[]>;
|
|
93
|
+
initializeObservationalMemory(input: CreateObservationalMemoryInput): Promise<ObservationalMemoryRecord>;
|
|
94
|
+
updateActiveObservations(input: UpdateActiveObservationsInput): Promise<void>;
|
|
95
|
+
createReflectionGeneration(input: CreateReflectionGenerationInput): Promise<ObservationalMemoryRecord>;
|
|
96
|
+
setReflectingFlag(id: string, isReflecting: boolean): Promise<void>;
|
|
97
|
+
setObservingFlag(id: string, isObserving: boolean): Promise<void>;
|
|
98
|
+
setBufferingObservationFlag(id: string, isBuffering: boolean, lastBufferedAtTokens?: number): Promise<void>;
|
|
99
|
+
setBufferingReflectionFlag(id: string, isBuffering: boolean): Promise<void>;
|
|
100
|
+
clearObservationalMemory(threadId: string | null, resourceId: string): Promise<void>;
|
|
101
|
+
setPendingMessageTokens(id: string, tokenCount: number): Promise<void>;
|
|
102
|
+
updateBufferedObservations(input: UpdateBufferedObservationsInput): Promise<void>;
|
|
103
|
+
swapBufferedToActive(input: SwapBufferedToActiveInput): Promise<SwapBufferedToActiveResult>;
|
|
104
|
+
updateBufferedReflection(input: UpdateBufferedReflectionInput): Promise<void>;
|
|
105
|
+
swapBufferedReflectionToActive(input: SwapBufferedReflectionToActiveInput): Promise<ObservationalMemoryRecord>;
|
|
106
|
+
private updateOMFlag;
|
|
107
|
+
private getOMKey;
|
|
108
|
+
private parseOMRow;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=index.d.ts.map
|