@mastra/pg 1.12.1 → 1.13.0-alpha.1
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 +91 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +2 -2
- package/dist/docs/references/reference-storage-composite.md +34 -2
- package/dist/docs/references/reference-storage-postgresql.md +1 -1
- package/dist/index.cjs +3837 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3836 -149
- package/dist/index.js.map +1 -1
- package/dist/{storage → shared}/pool-config.d.ts +10 -2
- package/dist/shared/pool-config.d.ts.map +1 -0
- package/dist/storage/domains/agents/index.d.ts.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/dist/storage/domains/blobs/index.d.ts +1 -0
- package/dist/storage/domains/blobs/index.d.ts.map +1 -1
- package/dist/storage/domains/mcp-clients/index.d.ts +2 -0
- package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -1
- package/dist/storage/domains/mcp-servers/index.d.ts +2 -0
- package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/v-next/ddl.d.ts +55 -0
- package/dist/storage/domains/observability/v-next/ddl.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/discovery.d.ts +52 -0
- package/dist/storage/domains/observability/v-next/discovery.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/feedback.d.ts +17 -0
- package/dist/storage/domains/observability/v-next/feedback.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/filters.d.ts +29 -0
- package/dist/storage/domains/observability/v-next/filters.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/helpers.d.ts +33 -0
- package/dist/storage/domains/observability/v-next/helpers.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/index.d.ts +104 -0
- package/dist/storage/domains/observability/v-next/index.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/listing.d.ts +53 -0
- package/dist/storage/domains/observability/v-next/listing.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/logs.d.ts +8 -0
- package/dist/storage/domains/observability/v-next/logs.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/metrics.d.ts +19 -0
- package/dist/storage/domains/observability/v-next/metrics.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/olap.d.ts +93 -0
- package/dist/storage/domains/observability/v-next/olap.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/partitioning.d.ts +76 -0
- package/dist/storage/domains/observability/v-next/partitioning.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/pg-errors.d.ts +25 -0
- package/dist/storage/domains/observability/v-next/pg-errors.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/polling.d.ts +28 -0
- package/dist/storage/domains/observability/v-next/polling.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/scores.d.ts +17 -0
- package/dist/storage/domains/observability/v-next/scores.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/signal-schema.d.ts +776 -0
- package/dist/storage/domains/observability/v-next/signal-schema.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/sql.d.ts +31 -0
- package/dist/storage/domains/observability/v-next/sql.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/traces.d.ts +16 -0
- package/dist/storage/domains/observability/v-next/traces.d.ts.map +1 -0
- package/dist/storage/domains/observability/v-next/tracing.d.ts +19 -0
- package/dist/storage/domains/observability/v-next/tracing.d.ts.map +1 -0
- package/dist/storage/domains/skills/index.d.ts +2 -0
- package/dist/storage/domains/skills/index.d.ts.map +1 -1
- package/dist/storage/domains/tool-provider-connections/index.d.ts +20 -0
- package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/domains/workspaces/index.d.ts +2 -0
- package/dist/storage/domains/workspaces/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +89 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +9 -7
- package/dist/storage/pool-config.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal-schema.d.ts","sourceRoot":"","sources":["../../../../../src/storage/domains/observability/v-next/signal-schema.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAEtH,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAqCD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Ca,CAAC;AAE7C,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBW,CAAC;AAE7C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYc,CAAC;AAE7C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeY,CAAC;AAE7C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBS,CAAC;AAE7C,eAAO,MAAM,8BAA8B,8KAejC,CAAC;AAYX,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAE/E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAE3E;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE9E;AAsBD,eAAO,MAAM,aAAa,aAAyD,CAAC;AACpF,eAAO,MAAM,kBAAkB,aAA0D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,aAAyC,CAAC;AAC3E,eAAO,MAAM,mBAAmB,aAAwC,CAAC;AACzE,eAAO,MAAM,sBAAsB,aAA2C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL helpers for the v-next Postgres observability domain.
|
|
3
|
+
*
|
|
4
|
+
* Provides a multi-row INSERT builder with `ON CONFLICT DO NOTHING` for
|
|
5
|
+
* insert-only retry idempotency, and explicit jsonb / text[] casts so the
|
|
6
|
+
* pg driver doesn't have to guess column types.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Build a multi-row INSERT with explicit column types and ON CONFLICT DO NOTHING.
|
|
10
|
+
*
|
|
11
|
+
* @param schema Schema name.
|
|
12
|
+
* @param table Table name.
|
|
13
|
+
* @param records Array of records (each is a column-name → value object).
|
|
14
|
+
* All records must have identical key sets.
|
|
15
|
+
* @returns { text, values } ready to pass to `client.query`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildInsert(schema: string, table: string, records: Record<string, unknown>[]): {
|
|
18
|
+
text: string;
|
|
19
|
+
values: unknown[];
|
|
20
|
+
} | null;
|
|
21
|
+
/**
|
|
22
|
+
* Standard SELECT column list for tracing tables. The select projects every
|
|
23
|
+
* column the row→record converters expect.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SPAN_SELECT_COLUMNS: string;
|
|
26
|
+
export declare const SPAN_LIGHT_SELECT_COLUMNS: string;
|
|
27
|
+
export declare const METRIC_SELECT_COLUMNS: string;
|
|
28
|
+
export declare const LOG_SELECT_COLUMNS: string;
|
|
29
|
+
export declare const SCORE_SELECT_COLUMNS: string;
|
|
30
|
+
export declare const FEEDBACK_SELECT_COLUMNS: string;
|
|
31
|
+
//# sourceMappingURL=sql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../../../../src/storage/domains/observability/v-next/sql.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2BH;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,IAAI,CA+B5C;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QACU,CAAC;AAE3C,eAAO,MAAM,yBAAyB,QACqB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,QACU,CAAC;AAE7C,eAAO,MAAM,kBAAkB,QACU,CAAC;AAE1C,eAAO,MAAM,oBAAoB,QACU,CAAC;AAE5C,eAAO,MAAM,uBAAuB,QACU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trace / branch list reads for the v-next Postgres observability domain.
|
|
3
|
+
*
|
|
4
|
+
* - `listTraces` / `getRootSpan` filter by `parentSpanId IS NULL`. The partial
|
|
5
|
+
* indexes declared in ddl.ts make this predicate selective enough to act as
|
|
6
|
+
* the root-span projection without a separate table.
|
|
7
|
+
* - `listBranches` filters by `spanType IN (BRANCH_SPAN_TYPES)` (or the
|
|
8
|
+
* user-supplied spanType when it's a branch type). Branches include nested
|
|
9
|
+
* anchors as well as root spans of the listed types.
|
|
10
|
+
*/
|
|
11
|
+
import type { GetRootSpanArgs, GetRootSpanResponse, ListBranchesArgs, ListBranchesResponse, ListTracesArgs, ListTracesResponse } from '@mastra/core/storage';
|
|
12
|
+
import type { DbClient } from '../../../client.js';
|
|
13
|
+
export declare function getRootSpan(client: DbClient, schema: string, args: GetRootSpanArgs): Promise<GetRootSpanResponse | null>;
|
|
14
|
+
export declare function listTraces(client: DbClient, schema: string, args: ListTracesArgs): Promise<ListTracesResponse>;
|
|
15
|
+
export declare function listBranches(client: DbClient, schema: string, args: ListBranchesArgs): Promise<ListBranchesResponse>;
|
|
16
|
+
//# sourceMappingURL=traces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traces.d.ts","sourceRoot":"","sources":["../../../../../src/storage/domains/observability/v-next/traces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAgBhD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAYrC;AA8ID,wBAAsB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAUpH;AAuSD,wBAAsB,YAAY,CAChC,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,oBAAoB,CAAC,CAU/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracing operations for the v-next Postgres observability domain.
|
|
3
|
+
*
|
|
4
|
+
* Insert-only: only ended spans are persisted. Retry idempotency is provided
|
|
5
|
+
* by `ON CONFLICT ("traceId", "spanId", "endedAt") DO NOTHING` on the
|
|
6
|
+
* partitioned span table.
|
|
7
|
+
*/
|
|
8
|
+
import type { BatchCreateSpansArgs, BatchDeleteTracesArgs, CreateSpanArgs, GetSpansArgs, GetSpansResponse, GetSpanArgs, GetSpanResponse, GetTraceArgs, GetTraceResponse, GetTraceLightResponse } from '@mastra/core/storage';
|
|
9
|
+
import type { DbClient } from '../../../client.js';
|
|
10
|
+
export declare function createSpan(client: DbClient, schema: string, args: CreateSpanArgs): Promise<void>;
|
|
11
|
+
export declare function batchCreateSpans(client: DbClient, schema: string, args: BatchCreateSpansArgs): Promise<void>;
|
|
12
|
+
export declare function getSpans(client: DbClient, schema: string, args: GetSpansArgs): Promise<GetSpansResponse>;
|
|
13
|
+
export declare function getSpan(client: DbClient, schema: string, args: GetSpanArgs): Promise<GetSpanResponse | null>;
|
|
14
|
+
export declare function getTrace(client: DbClient, schema: string, args: GetTraceArgs): Promise<GetTraceResponse | null>;
|
|
15
|
+
export declare function getTraceLight(client: DbClient, schema: string, args: GetTraceArgs): Promise<GetTraceLightResponse | null>;
|
|
16
|
+
export declare function batchDeleteTraces(client: DbClient, schema: string, args: BatchDeleteTracesArgs): Promise<void>;
|
|
17
|
+
/** Truncate the span_events table. */
|
|
18
|
+
export declare function dangerouslyClearTracing(client: DbClient, schema: string): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../../src/storage/domains/observability/v-next/tracing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAShD,wBAAsB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAItG;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKlH;AAMD,wBAAsB,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgB9G;AAED,wBAAsB,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAYlH;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAWrH;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAcvC;AAMD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpH;AAED,sCAAsC;AACtC,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK7F"}
|
|
@@ -6,6 +6,8 @@ export declare class SkillsPG extends SkillsStorage {
|
|
|
6
6
|
#private;
|
|
7
7
|
static readonly MANAGED_TABLES: readonly ["mastra_skills", "mastra_skill_versions"];
|
|
8
8
|
constructor(config: PgDomainConfig);
|
|
9
|
+
static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[];
|
|
10
|
+
static getExportDDL(schemaName?: string): string[];
|
|
9
11
|
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
10
12
|
createDefaultIndexes(): Promise<void>;
|
|
11
13
|
init(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/skills/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EAQd,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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/skills/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EAQd,MAAM,sBAAsB,CA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AAC;IA0DpE,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;IA4E7E,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,aAAa;IAarB,OAAO,CAAC,eAAe;CAsBxB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ToolProviderConnectionsStorage } from '@mastra/core/storage';
|
|
2
|
+
import type { CreateIndexOptions, StorageDeleteToolProviderConnectionInput, StorageListToolProviderConnectionsInput, StorageToolProviderConnection, StorageToolProviderConnectionKey, StorageUpsertToolProviderConnectionInput } from '@mastra/core/storage';
|
|
3
|
+
import type { PgDomainConfig } from '../../db/index.js';
|
|
4
|
+
export declare class ToolProviderConnectionsPG extends ToolProviderConnectionsStorage {
|
|
5
|
+
#private;
|
|
6
|
+
static readonly MANAGED_TABLES: readonly ["mastra_tool_provider_connections"];
|
|
7
|
+
constructor(config: PgDomainConfig);
|
|
8
|
+
init(): Promise<void>;
|
|
9
|
+
static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[];
|
|
10
|
+
static getExportDDL(schemaName?: string): string[];
|
|
11
|
+
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
12
|
+
createDefaultIndexes(): Promise<void>;
|
|
13
|
+
createCustomIndexes(): Promise<void>;
|
|
14
|
+
dangerouslyClearAll(): Promise<void>;
|
|
15
|
+
getConnectionById({ authorId, providerId, connectionId, }: StorageToolProviderConnectionKey): Promise<StorageToolProviderConnection | null>;
|
|
16
|
+
upsertConnection(input: StorageUpsertToolProviderConnectionInput): Promise<StorageToolProviderConnection>;
|
|
17
|
+
listConnectionsByAuthor({ authorId, providerId, toolkit, scope, }: StorageListToolProviderConnectionsInput): Promise<StorageToolProviderConnection[]>;
|
|
18
|
+
deleteConnection({ authorId, providerId, connectionId, }: StorageDeleteToolProviderConnectionInput): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/tool-provider-connections/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,EAI/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,kBAAkB,EAClB,wCAAwC,EACxC,uCAAuC,EACvC,6BAA6B,EAC7B,gCAAgC,EAEhC,wCAAwC,EACzC,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAuB/C,qBAAa,yBAA0B,SAAQ,8BAA8B;;IAM3E,MAAM,CAAC,QAAQ,CAAC,cAAc,gDAA8C;gBAEhE,MAAM,EAAE,cAAc;IAW5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAU3B,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB,EAAE;IAUtE,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAsBlD,0BAA0B,IAAI,kBAAkB,EAAE;IAK5C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWrC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWpC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,iBAAiB,CAAC,EACtB,QAAQ,EACR,UAAU,EACV,YAAY,GACb,EAAE,gCAAgC,GAAG,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC;IAyB7E,gBAAgB,CAAC,KAAK,EAAE,wCAAwC,GAAG,OAAO,CAAC,6BAA6B,CAAC;IA0DzG,uBAAuB,CAAC,EAC5B,QAAQ,EACR,UAAU,EACV,OAAO,EACP,KAAK,GACN,EAAE,uCAAuC,GAAG,OAAO,CAAC,6BAA6B,EAAE,CAAC;IAyC/E,gBAAgB,CAAC,EACrB,QAAQ,EACR,UAAU,EACV,YAAY,GACb,EAAE,wCAAwC,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,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;AAW/C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAa5D;AAED,qBAAa,WAAY,SAAQ,gBAAgB;;IAM/C,oCAAoC;IACpC,MAAM,CAAC,QAAQ,CAAC,cAAc,wCAAsC;gBAExD,MAAM,EAAE,cAAc;IAUlC,yBAAyB,IAAI,OAAO;IAIpC,OAAO,CAA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C;QAC3B,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,SAAS,CAAC,EAAE,IAAI,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BX,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;IAoB9B,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;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"}
|
|
@@ -6,6 +6,8 @@ export declare class WorkspacesPG extends WorkspacesStorage {
|
|
|
6
6
|
#private;
|
|
7
7
|
static readonly MANAGED_TABLES: readonly ["mastra_workspaces", "mastra_workspace_versions"];
|
|
8
8
|
constructor(config: PgDomainConfig);
|
|
9
|
+
static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[];
|
|
10
|
+
static getExportDDL(schemaName?: string): string[];
|
|
9
11
|
getDefaultIndexDefinitions(): CreateIndexOptions[];
|
|
10
12
|
createDefaultIndexes(): Promise<void>;
|
|
11
13
|
init(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workspaces/index.ts"],"names":[],"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Domains } from '@mastra/core/storage';
|
|
3
4
|
import { Pool } from 'pg';
|
|
@@ -15,11 +16,14 @@ import { MCPServersPG } from './domains/mcp-servers/index.js';
|
|
|
15
16
|
import { MemoryPG } from './domains/memory/index.js';
|
|
16
17
|
import { NotificationsPG } from './domains/notifications/index.js';
|
|
17
18
|
import { ObservabilityPG } from './domains/observability/index.js';
|
|
19
|
+
import { ObservabilityStoragePostgresVNext } from './domains/observability/v-next/index.js';
|
|
20
|
+
import type { VNextPostgresObservabilityConfig } from './domains/observability/v-next/index.js';
|
|
18
21
|
import { PromptBlocksPG } from './domains/prompt-blocks/index.js';
|
|
19
22
|
import { SchedulesPG } from './domains/schedules/index.js';
|
|
20
23
|
import { ScorerDefinitionsPG } from './domains/scorer-definitions/index.js';
|
|
21
24
|
import { ScoresPG } from './domains/scores/index.js';
|
|
22
25
|
import { SkillsPG } from './domains/skills/index.js';
|
|
26
|
+
import { ToolProviderConnectionsPG } from './domains/tool-provider-connections/index.js';
|
|
23
27
|
import { WorkflowsPG } from './domains/workflows/index.js';
|
|
24
28
|
import { WorkspacesPG } from './domains/workspaces/index.js';
|
|
25
29
|
/**
|
|
@@ -28,7 +32,8 @@ import { WorkspacesPG } from './domains/workspaces/index.js';
|
|
|
28
32
|
* via a static getExportDDL method, ensuring a single source of truth.
|
|
29
33
|
*/
|
|
30
34
|
export declare function exportSchemas(schemaName?: string): string;
|
|
31
|
-
export { AgentsPG, BackgroundTasksPG, BlobsPG, ChannelsPG, DatasetsPG, ExperimentsPG, MCPClientsPG, MCPServersPG, MemoryPG, NotificationsPG, ObservabilityPG, PromptBlocksPG, ScorerDefinitionsPG, ScoresPG, SchedulesPG, SkillsPG, FavoritesPG, WorkflowsPG, WorkspacesPG, };
|
|
35
|
+
export { AgentsPG, BackgroundTasksPG, BlobsPG, ChannelsPG, DatasetsPG, ExperimentsPG, MCPClientsPG, MCPServersPG, MemoryPG, NotificationsPG, ObservabilityPG, ObservabilityStoragePostgresVNext, PromptBlocksPG, ScorerDefinitionsPG, ScoresPG, SchedulesPG, SkillsPG, FavoritesPG, ToolProviderConnectionsPG, WorkflowsPG, WorkspacesPG, };
|
|
36
|
+
export type { VNextPostgresObservabilityConfig };
|
|
32
37
|
export { PoolAdapter } from './client.js';
|
|
33
38
|
export type { DbClient, TxClient, QueryValues, Pool, PoolClient, QueryResult } from './client.js';
|
|
34
39
|
export type { PgDomainConfig, PgDomainClientConfig, PgDomainPoolConfig, PgDomainRestConfig } from './db/index.js';
|
|
@@ -80,6 +85,89 @@ export declare class PostgresStore extends MastraCompositeStore {
|
|
|
80
85
|
/**
|
|
81
86
|
* Closes the connection pool if it was created by this store.
|
|
82
87
|
* If a pool was passed in via config, it will not be closed.
|
|
88
|
+
* Safe to call multiple times — subsequent calls are no-ops.
|
|
89
|
+
*/
|
|
90
|
+
close(): Promise<void>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Required connection config for the v-next observability domain. Accepts
|
|
94
|
+
* the same connection shapes as `PostgresStoreConfig` (pool /
|
|
95
|
+
* connectionString / host+port / Cloud SQL connector) plus the
|
|
96
|
+
* vNext-specific options.
|
|
97
|
+
*
|
|
98
|
+
* Required by design — `PostgresStoreVNext` will not implicitly share the
|
|
99
|
+
* primary connection. Callers who want to share must pass identical
|
|
100
|
+
* connection details here, and they'll receive a runtime warning every time
|
|
101
|
+
* the store is constructed (and again on every init() over the same logger).
|
|
102
|
+
*/
|
|
103
|
+
export type PostgresStoreVNextObservabilityConfig = ({
|
|
104
|
+
pool: Pool;
|
|
105
|
+
} | {
|
|
106
|
+
connectionString: string;
|
|
107
|
+
ssl?: ConnectionOptions | boolean;
|
|
108
|
+
max?: number;
|
|
109
|
+
idleTimeoutMillis?: number;
|
|
110
|
+
} | {
|
|
111
|
+
host: string;
|
|
112
|
+
port?: number;
|
|
113
|
+
database: string;
|
|
114
|
+
user: string;
|
|
115
|
+
password: string;
|
|
116
|
+
ssl?: ConnectionOptions | boolean;
|
|
117
|
+
max?: number;
|
|
118
|
+
idleTimeoutMillis?: number;
|
|
119
|
+
}) & {
|
|
120
|
+
schemaName?: string;
|
|
121
|
+
partitioning?: VNextPostgresObservabilityConfig['partitioning'];
|
|
122
|
+
discovery?: VNextPostgresObservabilityConfig['discovery'];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Postgres storage adapter that uses the v-next observability domain.
|
|
126
|
+
*
|
|
127
|
+
* Composes a primary `PostgresStore` (memory / workflows / scores / agents /
|
|
128
|
+
* etc.) with an `ObservabilityStoragePostgresVNext` for logs, metrics,
|
|
129
|
+
* scores, feedback, and traces.
|
|
130
|
+
*
|
|
131
|
+
* The `observability` connection is **required**: every caller has to make
|
|
132
|
+
* an explicit decision about where observability data goes. For production,
|
|
133
|
+
* point it at a dedicated Postgres instance. For local development you can
|
|
134
|
+
* pass the same connection details as the primary store — you'll get a
|
|
135
|
+
* runtime warning every time the store is constructed.
|
|
136
|
+
*
|
|
137
|
+
* IMPORTANT: this adapter is intended for **low-volume production**
|
|
138
|
+
* workloads only. For high-volume agent workloads, use the ClickHouse
|
|
139
|
+
* adapter — Postgres (with or without TimescaleDB) cannot keep up past
|
|
140
|
+
* roughly 1,500 calls/sec sustained on a single primary.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* import { Mastra } from '@mastra/core';
|
|
145
|
+
* import { PostgresStoreVNext } from '@mastra/pg';
|
|
146
|
+
*
|
|
147
|
+
* export const mastra = new Mastra({
|
|
148
|
+
* storage: new PostgresStoreVNext({
|
|
149
|
+
* id: 'app',
|
|
150
|
+
* connectionString: process.env.DATABASE_URL!,
|
|
151
|
+
* observability: {
|
|
152
|
+
* connectionString: process.env.OBSERVABILITY_DATABASE_URL!,
|
|
153
|
+
* },
|
|
154
|
+
* }),
|
|
155
|
+
* });
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
export declare class PostgresStoreVNext extends PostgresStore {
|
|
159
|
+
#private;
|
|
160
|
+
constructor(config: PostgresStoreConfig & {
|
|
161
|
+
/**
|
|
162
|
+
* Connection config for the vNext observability domain. Required.
|
|
163
|
+
* Pass a dedicated connection in production; reusing the primary
|
|
164
|
+
* connection logs a runtime warning every construction.
|
|
165
|
+
*/
|
|
166
|
+
observability: PostgresStoreVNextObservabilityConfig;
|
|
167
|
+
});
|
|
168
|
+
/**
|
|
169
|
+
* Closes both the primary pool (when owned) and the observability pool
|
|
170
|
+
* (when this store created it). Safe to call multiple times.
|
|
83
171
|
*/
|
|
84
172
|
close(): Promise<void>;
|
|
85
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAwB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAQ1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;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IACpB,YAAY,CAAC,EAAE,gCAAgC,CAAC,cAAc,CAAC,CAAC;IAChE,SAAS,CAAC,EAAE,gCAAgC,CAAC,WAAW,CAAC,CAAC;CAC3D,CAAC;AAqCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;;gBAMjD,MAAM,EAAE,mBAAmB,GAAG;QAC5B;;;;WAIG;QACH,aAAa,EAAE,qCAAqC,CAAC;KACtD;IAsDH;;;OAGG;IACY,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAOtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAqC,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vector/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAqC,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,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c,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAkHpG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/pg",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0-alpha.1",
|
|
4
4
|
"description": "Postgres provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"async-mutex": "^0.5.0",
|
|
24
|
-
"pg": "^8.
|
|
24
|
+
"pg": "^8.21.0",
|
|
25
25
|
"pg-connection-string": "^2.12.0",
|
|
26
26
|
"xxhash-wasm": "^1.1.0"
|
|
27
27
|
},
|
|
@@ -30,14 +30,15 @@
|
|
|
30
30
|
"@types/pg": "^8.18.0",
|
|
31
31
|
"@vitest/coverage-v8": "4.1.5",
|
|
32
32
|
"@vitest/ui": "4.1.5",
|
|
33
|
-
"eslint": "^10.
|
|
33
|
+
"eslint": "^10.4.1",
|
|
34
34
|
"tsup": "^8.5.1",
|
|
35
|
+
"tsx": "^4.22.4",
|
|
35
36
|
"typescript": "^6.0.3",
|
|
36
37
|
"vitest": "4.1.5",
|
|
37
|
-
"@internal/lint": "0.0.
|
|
38
|
-
"@internal/storage-test-utils": "0.0.
|
|
39
|
-
"@internal/types-builder": "0.0.
|
|
40
|
-
"@mastra/core": "1.
|
|
38
|
+
"@internal/lint": "0.0.103",
|
|
39
|
+
"@internal/storage-test-utils": "0.0.99",
|
|
40
|
+
"@internal/types-builder": "0.0.78",
|
|
41
|
+
"@mastra/core": "1.42.0-alpha.4"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
44
|
"@mastra/core": ">=1.34.0-0 <2.0.0-0"
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
"build:lib": "tsup --silent --config tsup.config.ts",
|
|
63
64
|
"build:watch": "pnpm build:lib --watch",
|
|
64
65
|
"pretest": "docker compose up -d && (for i in $(seq 1 30); do docker compose exec -T db pg_isready -U postgres && break || (sleep 1; [ $i -eq 30 ] && exit 1); done)",
|
|
66
|
+
"pretest:vnext": "docker compose -f docker-compose.vnext.yaml up -d && (for i in $(seq 1 30); do docker compose -f docker-compose.vnext.yaml exec -T timescale pg_isready -U postgres && docker compose -f docker-compose.vnext.yaml exec -T partman pg_isready -U postgres && break || (sleep 1; [ $i -eq 30 ] && exit 1); done)",
|
|
65
67
|
"test": "vitest run",
|
|
66
68
|
"pretest:perf": "docker compose -f docker-compose.perf.yaml up -d && (for i in $(seq 1 30); do docker compose -f docker-compose.perf.yaml exec -T db pg_isready -U postgres && break || (sleep 1; [ $i -eq 30 ] && exit 1); done)",
|
|
67
69
|
"test:perf": "NODE_OPTIONS='--max-old-space-size=16384' vitest run -c vitest.perf.config.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pool-config.d.ts","sourceRoot":"","sources":["../../src/storage/pool-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAGrC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,sBAAsB,EAC9B,QAAQ,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACnD,UAAU,CAYZ"}
|