@mastra/pg 1.12.1-alpha.0 → 1.13.0-alpha.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/dist/docs/SKILL.md +1 -1
  3. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  4. package/dist/docs/references/reference-storage-composite.md +1 -1
  5. package/dist/docs/references/reference-storage-postgresql.md +1 -1
  6. package/dist/index.cjs +3851 -157
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +3850 -159
  9. package/dist/index.js.map +1 -1
  10. package/dist/storage/domains/agents/index.d.ts.map +1 -1
  11. package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
  12. package/dist/storage/domains/blobs/index.d.ts +1 -0
  13. package/dist/storage/domains/blobs/index.d.ts.map +1 -1
  14. package/dist/storage/domains/mcp-clients/index.d.ts +2 -0
  15. package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -1
  16. package/dist/storage/domains/mcp-servers/index.d.ts +2 -0
  17. package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -1
  18. package/dist/storage/domains/observability/v-next/ddl.d.ts +55 -0
  19. package/dist/storage/domains/observability/v-next/ddl.d.ts.map +1 -0
  20. package/dist/storage/domains/observability/v-next/discovery.d.ts +52 -0
  21. package/dist/storage/domains/observability/v-next/discovery.d.ts.map +1 -0
  22. package/dist/storage/domains/observability/v-next/feedback.d.ts +17 -0
  23. package/dist/storage/domains/observability/v-next/feedback.d.ts.map +1 -0
  24. package/dist/storage/domains/observability/v-next/filters.d.ts +29 -0
  25. package/dist/storage/domains/observability/v-next/filters.d.ts.map +1 -0
  26. package/dist/storage/domains/observability/v-next/helpers.d.ts +33 -0
  27. package/dist/storage/domains/observability/v-next/helpers.d.ts.map +1 -0
  28. package/dist/storage/domains/observability/v-next/index.d.ts +104 -0
  29. package/dist/storage/domains/observability/v-next/index.d.ts.map +1 -0
  30. package/dist/storage/domains/observability/v-next/listing.d.ts +53 -0
  31. package/dist/storage/domains/observability/v-next/listing.d.ts.map +1 -0
  32. package/dist/storage/domains/observability/v-next/logs.d.ts +8 -0
  33. package/dist/storage/domains/observability/v-next/logs.d.ts.map +1 -0
  34. package/dist/storage/domains/observability/v-next/metrics.d.ts +19 -0
  35. package/dist/storage/domains/observability/v-next/metrics.d.ts.map +1 -0
  36. package/dist/storage/domains/observability/v-next/olap.d.ts +93 -0
  37. package/dist/storage/domains/observability/v-next/olap.d.ts.map +1 -0
  38. package/dist/storage/domains/observability/v-next/partitioning.d.ts +76 -0
  39. package/dist/storage/domains/observability/v-next/partitioning.d.ts.map +1 -0
  40. package/dist/storage/domains/observability/v-next/pg-errors.d.ts +25 -0
  41. package/dist/storage/domains/observability/v-next/pg-errors.d.ts.map +1 -0
  42. package/dist/storage/domains/observability/v-next/polling.d.ts +28 -0
  43. package/dist/storage/domains/observability/v-next/polling.d.ts.map +1 -0
  44. package/dist/storage/domains/observability/v-next/scores.d.ts +17 -0
  45. package/dist/storage/domains/observability/v-next/scores.d.ts.map +1 -0
  46. package/dist/storage/domains/observability/v-next/signal-schema.d.ts +776 -0
  47. package/dist/storage/domains/observability/v-next/signal-schema.d.ts.map +1 -0
  48. package/dist/storage/domains/observability/v-next/sql.d.ts +31 -0
  49. package/dist/storage/domains/observability/v-next/sql.d.ts.map +1 -0
  50. package/dist/storage/domains/observability/v-next/traces.d.ts +16 -0
  51. package/dist/storage/domains/observability/v-next/traces.d.ts.map +1 -0
  52. package/dist/storage/domains/observability/v-next/tracing.d.ts +19 -0
  53. package/dist/storage/domains/observability/v-next/tracing.d.ts.map +1 -0
  54. package/dist/storage/domains/skills/index.d.ts +2 -0
  55. package/dist/storage/domains/skills/index.d.ts.map +1 -1
  56. package/dist/storage/domains/tool-provider-connections/index.d.ts +20 -0
  57. package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
  58. package/dist/storage/domains/workspaces/index.d.ts +2 -0
  59. package/dist/storage/domains/workspaces/index.d.ts.map +1 -1
  60. package/dist/storage/index.d.ts +89 -1
  61. package/dist/storage/index.d.ts.map +1 -1
  62. package/dist/storage/pool-config.d.ts +7 -2
  63. package/dist/storage/pool-config.d.ts.map +1 -1
  64. package/package.json +8 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,86 @@
1
1
  # @mastra/pg
2
2
 
3
+ ## 1.13.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add the v-next observability storage domain for `@mastra/pg`, an insert-only, ([#16760](https://github.com/mastra-ai/mastra/pull/16760))
8
+ partitioned Postgres adapter for low-volume observability (~100 calls/sec,
9
+ up to roughly 1,500 calls/sec sustained on a single primary).
10
+
11
+ The new `PostgresStoreVNext` composes a primary `PostgresStore` (memory,
12
+ workflows, scores, agents, etc.) with an `ObservabilityStoragePostgresVNext`
13
+ for spans, logs, metrics, scores, and feedback. All observability writes go
14
+ through a single multi-row `INSERT ... ON CONFLICT DO NOTHING` path. Storage
15
+ is partitioned per day with three modes auto-detected at `init()` time:
16
+ TimescaleDB hypertables, pg_partman (4.x or 5.x), or native Postgres range
17
+ partitions. Root-span lookups are served by partial indexes, and OLAP queries
18
+ (aggregates, breakdowns, time-series, percentiles) prune partitions by
19
+ `timestamp`. A small discovery cache table powers stale-while-revalidate
20
+ lookups for entity names/types/labels.
21
+
22
+ The `observability` connection is **required** — callers always make an
23
+ explicit decision about where observability data lives. For production,
24
+ point it at a dedicated Postgres instance to keep OLAP scans from
25
+ contending with your primary OLTP workload. Reusing the primary
26
+ connection works for local development and logs a runtime warning on every
27
+ construction.
28
+
29
+ ```typescript
30
+ import { Mastra } from '@mastra/core';
31
+ import { PostgresStoreVNext } from '@mastra/pg';
32
+
33
+ export const mastra = new Mastra({
34
+ storage: new PostgresStoreVNext({
35
+ id: 'app',
36
+ connectionString: process.env.DATABASE_URL!,
37
+ observability: {
38
+ connectionString: process.env.OBSERVABILITY_DATABASE_URL!,
39
+ },
40
+ }),
41
+ });
42
+ ```
43
+
44
+ Delta polling uses Postgres transaction IDs and a safe transaction horizon so
45
+ concurrent writers cannot cause late-committing rows to be skipped. The
46
+ `observability-delta-polling` feature flag is opt-in.
47
+
48
+ `ensureNativePartitions()` swallows the `42P07 relation already exists`
49
+ error around `CREATE TABLE IF NOT EXISTS … PARTITION OF`, matching the
50
+ existing guard used for base-table and index DDL. This makes concurrent
51
+ `init()` from two processes (serverless cold-start, blue/green overlap, two
52
+ stores sharing a schema) idempotent instead of letting the loser surface an
53
+ unhandled duplicate-relation error.
54
+
55
+ ### Patch Changes
56
+
57
+ - Added full Agent Builder storage support to the PostgreSQL adapter, bringing it to parity with libSQL. ([#17596](https://github.com/mastra-ai/mastra/pull/17596))
58
+
59
+ Previously, projects using PostgreSQL could not store tool provider connections or agent tool providers, and several Agent Builder tables were missing from the exported schema.
60
+ - Added storage for tool provider connections, so connections can be created, read, listed by author, and deleted on PostgreSQL.
61
+ - Agent versions now persist their tool providers on PostgreSQL across save and load.
62
+ - Fixed schema export so all Agent Builder tables are included.
63
+
64
+ - Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f)]:
65
+ - @mastra/core@1.42.0-alpha.0
66
+
67
+ ## 1.12.1
68
+
69
+ ### Patch Changes
70
+
71
+ - Added notification inbox storage support for Postgres stores. ([#17241](https://github.com/mastra-ai/mastra/pull/17241))
72
+
73
+ ```ts
74
+ import { PostgresStore } from '@mastra/pg';
75
+
76
+ const storage = new PostgresStore({ connectionString: process.env.POSTGRES_URL! });
77
+ ```
78
+
79
+ Agents using this store can persist thread-scoped notification inbox records for notification signals.
80
+
81
+ - Updated dependencies [[`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
82
+ - @mastra/core@1.39.0
83
+
3
84
  ## 1.12.1-alpha.0
4
85
 
5
86
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-pg
3
3
  description: Documentation for @mastra/pg. Use when working with @mastra/pg APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/pg"
6
- version: "1.12.1-alpha.0"
6
+ version: "1.13.0-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.12.1-alpha.0",
2
+ "version": "1.13.0-alpha.0",
3
3
  "package": "@mastra/pg",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -242,4 +242,4 @@ const storage = new MastraCompositeStore({
242
242
 
243
243
  > **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that have not migrated. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for details.
244
244
 
245
- > **Info:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/tracing/exporters/mastra-storage) for the full list of supported providers.
245
+ > **Info:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
@@ -140,7 +140,7 @@ The storage implementation handles schema creation and updates automatically. It
140
140
 
141
141
  PostgreSQL supports observability and can handle low trace volumes. Throughput capacity depends on deployment factors such as hardware, schema design, indexing, and retention policies, and should be validated for your specific environment. For high-volume production environments, consider:
142
142
 
143
- - Using the `insert-only` [tracing strategy](https://mastra.ai/docs/observability/tracing/exporters/mastra-storage) to reduce database write operations
143
+ - Using the `insert-only` [tracing strategy](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) to reduce database write operations
144
144
  - Setting up table partitioning for efficient data retention
145
145
  - Migrating observability to [ClickHouse via composite storage](https://mastra.ai/reference/storage/composite) if you need to scale further
146
146