@mastra/pg 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3220 -3
- package/LICENSE.md +15 -0
- package/README.md +72 -20
- package/dist/docs/SKILL.md +40 -0
- package/dist/docs/assets/SOURCE_MAP.json +6 -0
- package/dist/docs/references/docs-memory-semantic-recall.md +288 -0
- package/dist/docs/references/docs-memory-storage.md +261 -0
- package/dist/docs/references/docs-memory-working-memory.md +400 -0
- package/dist/docs/references/docs-rag-overview.md +72 -0
- package/dist/docs/references/docs-rag-retrieval.md +515 -0
- package/dist/docs/references/docs-rag-vector-databases.md +645 -0
- package/dist/docs/references/reference-memory-memory-class.md +147 -0
- package/dist/docs/references/reference-processors-message-history-processor.md +85 -0
- package/dist/docs/references/reference-processors-semantic-recall-processor.md +117 -0
- package/dist/docs/references/reference-processors-working-memory-processor.md +152 -0
- package/dist/docs/references/reference-rag-metadata-filters.md +216 -0
- package/dist/docs/references/reference-storage-composite.md +235 -0
- package/dist/docs/references/reference-storage-dynamodb.md +282 -0
- package/dist/docs/references/reference-storage-postgresql.md +526 -0
- package/dist/docs/references/reference-tools-vector-query-tool.md +459 -0
- package/dist/docs/references/reference-vectors-pg.md +408 -0
- package/dist/index.cjs +11374 -2692
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11362 -2694
- package/dist/index.js.map +1 -1
- package/dist/shared/config.d.ts +122 -31
- package/dist/shared/config.d.ts.map +1 -1
- package/dist/storage/client.d.ts +91 -0
- package/dist/storage/client.d.ts.map +1 -0
- package/dist/storage/db/constraint-utils.d.ts +16 -0
- package/dist/storage/db/constraint-utils.d.ts.map +1 -0
- package/dist/storage/db/index.d.ts +235 -0
- package/dist/storage/db/index.d.ts.map +1 -0
- package/dist/storage/domains/agents/index.d.ts +52 -0
- package/dist/storage/domains/agents/index.d.ts.map +1 -0
- package/dist/storage/domains/blobs/index.d.ts +17 -0
- package/dist/storage/domains/blobs/index.d.ts.map +1 -0
- package/dist/storage/domains/datasets/index.d.ts +48 -0
- package/dist/storage/domains/datasets/index.d.ts.map +1 -0
- package/dist/storage/domains/experiments/index.d.ts +34 -0
- package/dist/storage/domains/experiments/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-clients/index.d.ts +33 -0
- package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-servers/index.d.ts +33 -0
- package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts +74 -55
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +65 -39
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/prompt-blocks/index.d.ts +43 -0
- package/dist/storage/domains/prompt-blocks/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 +40 -33
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/skills/index.d.ts +33 -0
- package/dist/storage/domains/skills/index.d.ts.map +1 -0
- package/dist/storage/domains/utils.d.ts +1 -5
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +42 -30
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/domains/workspaces/index.d.ts +33 -0
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +66 -255
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/performance-indexes/performance-test.d.ts +3 -1
- package/dist/storage/performance-indexes/performance-test.d.ts.map +1 -1
- package/dist/storage/test-utils.d.ts.map +1 -1
- package/dist/vector/index.d.ts +45 -7
- package/dist/vector/index.d.ts.map +1 -1
- package/dist/vector/sql-builder.d.ts +4 -0
- package/dist/vector/sql-builder.d.ts.map +1 -1
- package/dist/vector/types.d.ts +10 -0
- package/dist/vector/types.d.ts.map +1 -1
- package/package.json +18 -15
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -20
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/operations/index.d.ts +0 -118
- package/dist/storage/domains/operations/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -23
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
|
@@ -1,55 +1,62 @@
|
|
|
1
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/
|
|
2
|
-
import type {
|
|
1
|
+
import type { ListScoresResponse, SaveScorePayload, ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
2
|
+
import type { StoragePagination, CreateIndexOptions } from '@mastra/core/storage';
|
|
3
3
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
|
-
import type {
|
|
5
|
-
import type { StoreOperationsPG } from '../operations/index.js';
|
|
4
|
+
import type { PgDomainConfig } from '../../db/index.js';
|
|
6
5
|
export declare class ScoresPG extends ScoresStorage {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
#private;
|
|
7
|
+
/** Tables managed by this domain */
|
|
8
|
+
static readonly MANAGED_TABLES: readonly ["mastra_scorers"];
|
|
9
|
+
constructor(config: PgDomainConfig);
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns default index definitions for the scores domain tables.
|
|
13
|
+
* @param schemaPrefix - Prefix for index names (e.g. "my_schema_" or "")
|
|
14
|
+
*/
|
|
15
|
+
static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[];
|
|
16
|
+
/**
|
|
17
|
+
* Returns all DDL statements for this domain: table and indexes.
|
|
18
|
+
* Used by exportSchemas to produce a complete, reproducible schema export.
|
|
19
|
+
*/
|
|
20
|
+
static getExportDDL(schemaName?: string): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Returns default index definitions for this instance's schema.
|
|
23
|
+
*/
|
|
24
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
25
|
+
/**
|
|
26
|
+
* Creates default indexes for optimal query performance.
|
|
27
|
+
*/
|
|
28
|
+
createDefaultIndexes(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
31
|
+
*/
|
|
32
|
+
createCustomIndexes(): Promise<void>;
|
|
33
|
+
dangerouslyClearAll(): Promise<void>;
|
|
15
34
|
getScoreById({ id }: {
|
|
16
35
|
id: string;
|
|
17
36
|
}): Promise<ScoreRowData | null>;
|
|
18
|
-
|
|
37
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
19
38
|
scorerId: string;
|
|
20
39
|
pagination: StoragePagination;
|
|
21
40
|
entityId?: string;
|
|
22
41
|
entityType?: string;
|
|
23
42
|
source?: ScoringSource;
|
|
24
|
-
}): Promise<
|
|
25
|
-
|
|
26
|
-
scores: ScoreRowData[];
|
|
27
|
-
}>;
|
|
28
|
-
saveScore(score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>): Promise<{
|
|
43
|
+
}): Promise<ListScoresResponse>;
|
|
44
|
+
saveScore(score: SaveScorePayload): Promise<{
|
|
29
45
|
score: ScoreRowData;
|
|
30
46
|
}>;
|
|
31
|
-
|
|
47
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
32
48
|
runId: string;
|
|
33
49
|
pagination: StoragePagination;
|
|
34
|
-
}): Promise<
|
|
35
|
-
|
|
36
|
-
scores: ScoreRowData[];
|
|
37
|
-
}>;
|
|
38
|
-
getScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
50
|
+
}): Promise<ListScoresResponse>;
|
|
51
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
39
52
|
pagination: StoragePagination;
|
|
40
53
|
entityId: string;
|
|
41
54
|
entityType: string;
|
|
42
|
-
}): Promise<
|
|
43
|
-
|
|
44
|
-
scores: ScoreRowData[];
|
|
45
|
-
}>;
|
|
46
|
-
getScoresBySpan({ traceId, spanId, pagination, }: {
|
|
55
|
+
}): Promise<ListScoresResponse>;
|
|
56
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
47
57
|
traceId: string;
|
|
48
58
|
spanId: string;
|
|
49
59
|
pagination: StoragePagination;
|
|
50
|
-
}): Promise<
|
|
51
|
-
pagination: PaginationInfo;
|
|
52
|
-
scores: ScoreRowData[];
|
|
53
|
-
}>;
|
|
60
|
+
}): Promise<ListScoresResponse>;
|
|
54
61
|
}
|
|
55
62
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAIL,aAAa,EAId,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAwB/C,qBAAa,QAAS,SAAQ,aAAa;;IAMzC,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,cAAc,8BAA4B;gBAE9C,MAAM,EAAE,cAAc;IAU5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAA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M,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA0ChC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SkillsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageSkillType, StorageCreateSkillInput, StorageUpdateSkillInput, StorageListSkillsInput, StorageListSkillsOutput, CreateIndexOptions } from '@mastra/core/storage';
|
|
3
|
+
import type { SkillVersion, CreateSkillVersionInput, ListSkillVersionsInput, ListSkillVersionsOutput } from '@mastra/core/storage/domains/skills';
|
|
4
|
+
import type { PgDomainConfig } from '../../db/index.js';
|
|
5
|
+
export declare class SkillsPG extends SkillsStorage {
|
|
6
|
+
#private;
|
|
7
|
+
static readonly MANAGED_TABLES: readonly ["mastra_skills", "mastra_skill_versions"];
|
|
8
|
+
constructor(config: PgDomainConfig);
|
|
9
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
10
|
+
createDefaultIndexes(): Promise<void>;
|
|
11
|
+
init(): Promise<void>;
|
|
12
|
+
createCustomIndexes(): Promise<void>;
|
|
13
|
+
dangerouslyClearAll(): Promise<void>;
|
|
14
|
+
getById(id: string): Promise<StorageSkillType | null>;
|
|
15
|
+
create(input: {
|
|
16
|
+
skill: StorageCreateSkillInput;
|
|
17
|
+
}): Promise<StorageSkillType>;
|
|
18
|
+
update(input: StorageUpdateSkillInput): Promise<StorageSkillType>;
|
|
19
|
+
delete(id: string): Promise<void>;
|
|
20
|
+
list(args?: StorageListSkillsInput): Promise<StorageListSkillsOutput>;
|
|
21
|
+
createVersion(input: CreateSkillVersionInput): Promise<SkillVersion>;
|
|
22
|
+
getVersion(id: string): Promise<SkillVersion | null>;
|
|
23
|
+
getVersionByNumber(skillId: string, versionNumber: number): Promise<SkillVersion | null>;
|
|
24
|
+
getLatestVersion(skillId: string): Promise<SkillVersion | null>;
|
|
25
|
+
listVersions(input: ListSkillVersionsInput): Promise<ListSkillVersionsOutput>;
|
|
26
|
+
deleteVersion(id: string): Promise<void>;
|
|
27
|
+
deleteVersionsByParentId(entityId: string): Promise<void>;
|
|
28
|
+
countVersions(skillId: string): Promise<number>;
|
|
29
|
+
private parseJson;
|
|
30
|
+
private parseSkillRow;
|
|
31
|
+
private parseVersionRow;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/skills/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EAOd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB/C,qBAAa,QAAS,SAAQ,aAAa;;IAMzC,MAAM,CAAC,QAAQ,CAAC,cAAc,sDAAiD;gBAEnE,MAAM,EAAE,cAAc;IASlC,0BAA0B,IAAI,kBAAkB,EAAE;IAW5C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAarC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAarB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAapC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IASpC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAwBrD,MAAM,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgE5E,MAAM,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAqIjE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBjC,IAAI,CAAC,IAAI,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAmFrE,aAAa,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyDpE,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA2BpD,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA8BxF,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA8B/D,YAAY,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAqE7E,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBxC,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA4BrD,OAAO,CAAC,SAAS;IA4BjB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,eAAe;CAqBxB"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StorageColumn, TABLE_NAMES } from '@mastra/core/storage';
|
|
2
2
|
export declare function getSchemaName(schema?: string): string | undefined;
|
|
3
3
|
export declare function getTableName({ indexName, schemaName }: {
|
|
4
4
|
indexName: string;
|
|
5
5
|
schemaName?: string;
|
|
6
6
|
}): string;
|
|
7
|
-
/**
|
|
8
|
-
* Build date range filter for queries
|
|
9
|
-
*/
|
|
10
|
-
export declare function buildDateRangeFilter(dateRange: PaginationArgs['dateRange'], fieldName: string): Record<string, any>;
|
|
11
7
|
/**
|
|
12
8
|
* Prepare WHERE clause for PostgreSQL queries
|
|
13
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIvE,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,sBAE5C;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,UAKjG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GACtC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CA6B9B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EACrC,SAAS,EACT,MAAM,GACP,EAAE;IACD,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B,GAAG,CAAC,CA+BJ"}
|
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
import type { StepResult, WorkflowRun, WorkflowRuns, WorkflowRunState } from '@mastra/core';
|
|
2
1
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
import type { UpdateWorkflowStateOptions, StorageListWorkflowRunsInput, WorkflowRun, WorkflowRuns, CreateIndexOptions } from '@mastra/core/storage';
|
|
3
|
+
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
|
+
import type { PgDomainConfig } from '../../db/index.js';
|
|
5
5
|
export declare class WorkflowsPG extends WorkflowsStorage {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
#private;
|
|
7
|
+
/** Tables managed by this domain */
|
|
8
|
+
static readonly MANAGED_TABLES: readonly ["mastra_workflow_snapshot"];
|
|
9
|
+
constructor(config: PgDomainConfig);
|
|
10
|
+
supportsConcurrentUpdates(): boolean;
|
|
11
|
+
private parseWorkflowRun;
|
|
12
|
+
/**
|
|
13
|
+
* Returns all DDL statements for this domain: table with unique constraint.
|
|
14
|
+
* Used by exportSchemas to produce a complete, reproducible schema export.
|
|
15
|
+
*/
|
|
16
|
+
static getExportDDL(schemaName?: string): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Returns default index definitions for the workflows domain tables.
|
|
19
|
+
* Currently no default indexes are defined for workflows.
|
|
20
|
+
*/
|
|
21
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
22
|
+
/**
|
|
23
|
+
* Creates default indexes for optimal query performance.
|
|
24
|
+
* Currently no default indexes are defined for workflows.
|
|
25
|
+
*/
|
|
26
|
+
createDefaultIndexes(): Promise<void>;
|
|
27
|
+
init(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates custom user-defined indexes for this domain's tables.
|
|
30
|
+
*/
|
|
31
|
+
createCustomIndexes(): Promise<void>;
|
|
32
|
+
dangerouslyClearAll(): Promise<void>;
|
|
33
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
15
34
|
workflowName: string;
|
|
16
35
|
runId: string;
|
|
17
36
|
stepId: string;
|
|
18
37
|
result: StepResult<any, any, any, any>;
|
|
19
|
-
|
|
38
|
+
requestContext: Record<string, any>;
|
|
20
39
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
21
|
-
updateWorkflowState({}: {
|
|
40
|
+
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
22
41
|
workflowName: string;
|
|
23
42
|
runId: string;
|
|
24
|
-
opts:
|
|
25
|
-
status: string;
|
|
26
|
-
result?: StepResult<any, any, any, any>;
|
|
27
|
-
error?: string;
|
|
28
|
-
suspendedPaths?: Record<string, number[]>;
|
|
29
|
-
waitingPaths?: Record<string, number[]>;
|
|
30
|
-
};
|
|
43
|
+
opts: UpdateWorkflowStateOptions;
|
|
31
44
|
}): Promise<WorkflowRunState | undefined>;
|
|
32
|
-
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
|
|
45
|
+
persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, createdAt, updatedAt, }: {
|
|
33
46
|
workflowName: string;
|
|
34
47
|
runId: string;
|
|
35
48
|
resourceId?: string;
|
|
36
49
|
snapshot: WorkflowRunState;
|
|
50
|
+
createdAt?: Date;
|
|
51
|
+
updatedAt?: Date;
|
|
37
52
|
}): Promise<void>;
|
|
38
53
|
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
39
54
|
workflowName: string;
|
|
@@ -43,13 +58,10 @@ export declare class WorkflowsPG extends WorkflowsStorage {
|
|
|
43
58
|
runId: string;
|
|
44
59
|
workflowName?: string;
|
|
45
60
|
}): Promise<WorkflowRun | null>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
offset?: number;
|
|
52
|
-
resourceId?: string;
|
|
53
|
-
}): Promise<WorkflowRuns>;
|
|
61
|
+
deleteWorkflowRunById({ runId, workflowName }: {
|
|
62
|
+
runId: string;
|
|
63
|
+
workflowName: string;
|
|
64
|
+
}): Promise<void>;
|
|
65
|
+
listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, status, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
54
66
|
}
|
|
55
67
|
//# 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":"AACA,OAAO,EAIL,gBAAgB,EAEjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,WAAW,EACX,YAAY,EACZ,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAqB/C,qBAAa,WAAY,SAAQ,gBAAgB;;IAM/C,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,cAAc,wCAAsC;gBAExD,MAAM,EAAE,cAAc;IAUlC,yBAAyB,IAAI,OAAO;IAIpC,OAAO,CAAC,gBAAgB;IAmBxB;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAgBlD;;;OAGG;IACH,0BAA0B,IAAI,kBAAkB,EAAE;IAIlD;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOrC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAepC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,qBAAqB,CAAC,EAC1B,YAAY,EACZ,KAAK,EACL,MAAM,EACN,MA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C,WAAW,GAAG,IAAI,CAAC;IAmDzB,qBAAqB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBtG,gBAAgB,CAAC,EACrB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,UAAU,EACV,MAAM,GACP,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;CA6F7D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { WorkspacesStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { StorageWorkspaceType, StorageCreateWorkspaceInput, StorageUpdateWorkspaceInput, StorageListWorkspacesInput, StorageListWorkspacesOutput, CreateIndexOptions } from '@mastra/core/storage';
|
|
3
|
+
import type { WorkspaceVersion, CreateWorkspaceVersionInput, ListWorkspaceVersionsInput, ListWorkspaceVersionsOutput } from '@mastra/core/storage/domains/workspaces';
|
|
4
|
+
import type { PgDomainConfig } from '../../db/index.js';
|
|
5
|
+
export declare class WorkspacesPG extends WorkspacesStorage {
|
|
6
|
+
#private;
|
|
7
|
+
static readonly MANAGED_TABLES: readonly ["mastra_workspaces", "mastra_workspace_versions"];
|
|
8
|
+
constructor(config: PgDomainConfig);
|
|
9
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
10
|
+
createDefaultIndexes(): Promise<void>;
|
|
11
|
+
init(): Promise<void>;
|
|
12
|
+
createCustomIndexes(): Promise<void>;
|
|
13
|
+
dangerouslyClearAll(): Promise<void>;
|
|
14
|
+
getById(id: string): Promise<StorageWorkspaceType | null>;
|
|
15
|
+
create(input: {
|
|
16
|
+
workspace: StorageCreateWorkspaceInput;
|
|
17
|
+
}): Promise<StorageWorkspaceType>;
|
|
18
|
+
update(input: StorageUpdateWorkspaceInput): Promise<StorageWorkspaceType>;
|
|
19
|
+
delete(id: string): Promise<void>;
|
|
20
|
+
list(args?: StorageListWorkspacesInput): Promise<StorageListWorkspacesOutput>;
|
|
21
|
+
createVersion(input: CreateWorkspaceVersionInput): Promise<WorkspaceVersion>;
|
|
22
|
+
getVersion(id: string): Promise<WorkspaceVersion | null>;
|
|
23
|
+
getVersionByNumber(workspaceId: string, versionNumber: number): Promise<WorkspaceVersion | null>;
|
|
24
|
+
getLatestVersion(workspaceId: string): Promise<WorkspaceVersion | null>;
|
|
25
|
+
listVersions(input: ListWorkspaceVersionsInput): Promise<ListWorkspaceVersionsOutput>;
|
|
26
|
+
deleteVersion(id: string): Promise<void>;
|
|
27
|
+
deleteVersionsByParentId(entityId: string): Promise<void>;
|
|
28
|
+
countVersions(workspaceId: string): Promise<number>;
|
|
29
|
+
private parseJson;
|
|
30
|
+
private parseWorkspaceRow;
|
|
31
|
+
private parseVersionRow;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workspaces/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAOlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAgB/C,qBAAa,YAAa,SAAQ,iBAAiB;;IAMjD,MAAM,CAAC,QAAQ,CAAC,cAAc,8DAAyD;gBAE3E,MAAM,EAAE,cAAc;IASlC,0BAA0B,IAAI,kBAAkB,EAAE;IAW5C,oBAAoB,IAAI,OAAO,CAAC,IAAI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