@mastra/duckdb 1.13.0 → 1.14.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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-storage-retention.md +21 -18
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{observability-x50aDnBm.js → observability-Bub8vOtT.js} +8 -1
- package/dist/observability-Bub8vOtT.js.map +1 -0
- package/dist/{observability-DBm19qBS.cjs → observability-DJafBDSz.cjs} +8 -1
- package/dist/observability-DJafBDSz.cjs.map +1 -0
- package/dist/storage/domains/observability/trace-query.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/observability-DBm19qBS.cjs.map +0 -1
- package/dist/observability-x50aDnBm.js.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -95,29 +95,32 @@ Set the `retention` field on the store config.
|
|
|
95
95
|
|
|
96
96
|
Each domain specifies its age-prunable tables and the timestamp column that anchors comparison, chosen so `maxAge` matches the meaning of the data. Append-only logs use creation time, live state uses last activity, and jobs or runs use completion time so in-flight work isn't pruned.
|
|
97
97
|
|
|
98
|
-
| Domain | Table key | Anchor column | `maxAge` measures
|
|
99
|
-
| ----------------- | ------------------ | ---------------- |
|
|
100
|
-
| `memory` | `threads` | `createdAt` | Thread age
|
|
101
|
-
| `memory` | `messages` | `createdAt` | Message age
|
|
102
|
-
| `memory` | `resources` | `createdAt` | Resource age
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `observability` | `
|
|
106
|
-
| `observability` | `
|
|
107
|
-
| `observability` | `
|
|
108
|
-
| `observability` | `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
98
|
+
| Domain | Table key | Anchor column | `maxAge` measures |
|
|
99
|
+
| ----------------- | ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
100
|
+
| `memory` | `threads` | `createdAt` | Thread age |
|
|
101
|
+
| `memory` | `messages` | `createdAt` | Message age |
|
|
102
|
+
| `memory` | `resources` | `createdAt` | Resource age |
|
|
103
|
+
| `memory` | `runFences` | `retiredAt` | Time since the durable agent execution holding the fence settled. Fences of running executions (`NULL`) are never pruned |
|
|
104
|
+
| `threadState` | `threadState` | `updatedAt` | Inactivity: state for still-active threads survives |
|
|
105
|
+
| `observability` | `spans` | `startedAt` | Span age |
|
|
106
|
+
| `observability` | `metrics` | `timestamp` | Metric event age (vNext only) |
|
|
107
|
+
| `observability` | `logs` | `timestamp` | Log event age (vNext only) |
|
|
108
|
+
| `observability` | `scores` | `timestamp` | Score event age (vNext only) |
|
|
109
|
+
| `observability` | `feedback` | `timestamp` | Feedback event age (vNext only) |
|
|
110
|
+
| `scores` | `scorers` | `createdAt` | Score record age |
|
|
111
|
+
| `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity, suspended or long-running workflows survive |
|
|
112
|
+
| `workflows` | `runOwnership` | `updatedAt` | Inactivity. A running durable agent execution renews its claim every 10 seconds, so keep `maxAge` well above its 30-second lease |
|
|
113
|
+
| `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion, in-flight tasks (`NULL`) are never pruned |
|
|
114
|
+
| `experiments` | `experiments` | `completedAt` | Time since completion, running experiments are never pruned |
|
|
115
|
+
| `notifications` | `notifications` | `createdAt` | Notification age |
|
|
116
|
+
| `harness` | `sessions` | `createdAt` | Session record age |
|
|
117
|
+
| `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column) |
|
|
116
118
|
|
|
117
119
|
> **Note:**
|
|
118
120
|
>
|
|
119
121
|
> - The memory `observational_memory` table has no timestamp anchor, so it can't be age-pruned and isn't a valid retention key.
|
|
120
122
|
> - Experiments prune as whole units: an aged experiment's result rows are deleted together with it (results cascade with their parent), so a run is never left partially deleted. Retention doesn't have a separate `results` key.
|
|
123
|
+
> - `runOwnership` and `runFences` hold the run fencing records of durable agents, one small record per run in each. If the `runOwnership` `maxAge` is too short, a running execution can lose its run, but an execution that lost a run still can't write. A fence is retired only when its execution settles, so the fence of a run that crashed and was never recovered is never pruned.
|
|
121
124
|
> - For `schedules`, the growth table is the fire history (`schedule_triggers`, one row per fire): schedule definitions are config and aren't pruned.
|
|
122
125
|
> - On PostgreSQL, timestamp anchors use the timezone-aware mirror columns (for example `createdAtZ`, `completedAtZ`).
|
|
123
126
|
> - DuckDB observability stores append-only events for all five signals. Its `spans` policy uses the event `timestamp` column rather than `startedAt`.
|
package/dist/index.cjs
CHANGED
|
@@ -556,7 +556,7 @@ var ObservabilityStorageDuckDB = class extends _mastra_core_storage.Observabilit
|
|
|
556
556
|
async loadDelegate() {
|
|
557
557
|
if (this.delegate) return this.delegate;
|
|
558
558
|
if (this.unavailableError) return null;
|
|
559
|
-
if (!this.loadPromise) this.loadPromise = Promise.resolve().then(() => require("./observability-
|
|
559
|
+
if (!this.loadPromise) this.loadPromise = Promise.resolve().then(() => require("./observability-DJafBDSz.cjs")).then(({ ObservabilityStorageDuckDB }) => {
|
|
560
560
|
const delegate = new ObservabilityStorageDuckDB({ db: this.db });
|
|
561
561
|
this.delegate = delegate;
|
|
562
562
|
return delegate;
|
package/dist/index.js
CHANGED
|
@@ -555,7 +555,7 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
|
|
|
555
555
|
async loadDelegate() {
|
|
556
556
|
if (this.delegate) return this.delegate;
|
|
557
557
|
if (this.unavailableError) return null;
|
|
558
|
-
if (!this.loadPromise) this.loadPromise = import("./observability-
|
|
558
|
+
if (!this.loadPromise) this.loadPromise = import("./observability-Bub8vOtT.js").then(({ ObservabilityStorageDuckDB }) => {
|
|
559
559
|
const delegate = new ObservabilityStorageDuckDB({ db: this.db });
|
|
560
560
|
this.delegate = delegate;
|
|
561
561
|
return delegate;
|
|
@@ -3034,6 +3034,13 @@ function compileScalarPredicate(predicate, registry, allowMetadata = false) {
|
|
|
3034
3034
|
]
|
|
3035
3035
|
};
|
|
3036
3036
|
}
|
|
3037
|
+
if (predicate.type === "text") {
|
|
3038
|
+
const found = `contains(${`' ' || replace(lower(regexp_replace(nfc_normalize(${field.sql}), '[^\\p{L}\\p{M}\\p{N}]+', ' ', 'g')), 'ς', 'σ') || ' '`}, ?)`;
|
|
3039
|
+
return {
|
|
3040
|
+
sql: `coalesce(${predicate.operator === "matches" ? found : `NOT ${found}`}, false)`,
|
|
3041
|
+
values: [...fieldValues, ` ${predicate.value} `]
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3037
3044
|
if (predicate.type === "membership") {
|
|
3038
3045
|
const list = predicate.values.map(() => parameterSql(field.parameterType)).join(", ");
|
|
3039
3046
|
if (predicate.operator === "in") return {
|
|
@@ -5724,4 +5731,4 @@ var ObservabilityStorageDuckDB = class ObservabilityStorageDuckDB extends Observ
|
|
|
5724
5731
|
//#endregion
|
|
5725
5732
|
export { ObservabilityStorageDuckDB };
|
|
5726
5733
|
|
|
5727
|
-
//# sourceMappingURL=observability-
|
|
5734
|
+
//# sourceMappingURL=observability-Bub8vOtT.js.map
|