@mastra/libsql 1.20.0-alpha.3 → 1.20.1-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.
- package/CHANGELOG.md +92 -0
- package/dist/docs/SKILL.md +6 -9
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/{docs-agents-agent-approval.md → docs-agents-human-in-the-loop.md} +11 -9
- package/dist/docs/references/docs-agents-networks.md +3 -3
- package/dist/docs/references/docs-deployment-workers.md +253 -7
- package/dist/docs/references/docs-memory-memory-processors.md +1 -1
- package/dist/docs/references/docs-memory-message-history.md +3 -3
- package/dist/docs/references/docs-memory-overview.md +4 -4
- package/dist/docs/references/docs-memory-semantic-recall.md +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +3 -3
- package/dist/docs/references/{docs-storage-overview.md → docs-storage.md} +8 -7
- package/dist/docs/references/{docs-editor-overview.md → docs-studio-editor.md} +3 -1
- package/dist/docs/references/docs-workflows-snapshots.md +1 -1
- package/dist/docs/references/integrations-channels-github.md +1 -1
- package/dist/docs/references/{guides-agent-frameworks-ai-sdk.md → reference-ai-sdk-overview.md} +1 -1
- package/dist/docs/references/reference-core-mastra-class.md +1 -1
- package/dist/docs/references/reference-file-based-agents-memory.md +2 -2
- package/dist/docs/references/reference-file-based-agents-storage.md +3 -3
- package/dist/docs/references/reference-memory-memory-class.md +1 -0
- package/dist/docs/references/reference-storage-retention.md +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/agents/index.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -270,7 +270,7 @@ Supported embedding models:
|
|
|
270
270
|
|
|
271
271
|
- **OpenAI**: `text-embedding-3-small`, `text-embedding-3-large`, `text-embedding-ada-002`
|
|
272
272
|
- **Google**: `gemini-embedding-001`
|
|
273
|
-
- **OpenRouter**: Access embedding models from
|
|
273
|
+
- **OpenRouter**: Access embedding models from multiple providers
|
|
274
274
|
|
|
275
275
|
```ts
|
|
276
276
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# Working
|
|
3
|
+
# Working memory
|
|
4
4
|
|
|
5
5
|
While [message history](https://mastra.ai/docs/memory/message-history) and [semantic recall](https://mastra.ai/docs/memory/semantic-recall) help agents remember conversations, working memory allows them to maintain persistent information about users across interactions.
|
|
6
6
|
|
|
@@ -213,7 +213,7 @@ const paragraphMemory = new Memory({
|
|
|
213
213
|
|
|
214
214
|
## Structured working memory
|
|
215
215
|
|
|
216
|
-
Working memory can also be defined using a structured schema instead of a Markdown template.
|
|
216
|
+
Working memory can also be defined using a structured schema instead of a Markdown template. A [Standard JSON Schema](https://standardschema.dev/json-schema) ([Zod](https://zod.dev/), [Valibot](https://valibot.dev/), [ArkType](https://arktype.io/), etc.). When using a schema, the agent will see and update working memory as a JSON object matching your schema.
|
|
217
217
|
|
|
218
218
|
**Requirement:** You must specify either `template` or `schema`, but not both.
|
|
219
219
|
|
|
@@ -400,7 +400,7 @@ const response = await agent.generate('What do you know about me?', {
|
|
|
400
400
|
|
|
401
401
|
## Opt in to state signals (experimental)
|
|
402
402
|
|
|
403
|
-
By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/
|
|
403
|
+
By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/harness/signals) instead by setting `useStateSignals: true`:
|
|
404
404
|
|
|
405
405
|
```typescript
|
|
406
406
|
const memory = new Memory({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# Storage
|
|
3
|
+
# Storage
|
|
4
4
|
|
|
5
5
|
Storage is the persistence layer for the Mastra runtime. It keeps memory, workflow state, observability data, eval results, schedules, and long-running agent state available after a process restarts.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Storage powers:
|
|
|
10
10
|
- [Workflows](https://mastra.ai/docs/workflows/overview): Durable snapshots for suspended and resumed workflow runs.
|
|
11
11
|
- [Observability](https://mastra.ai/docs/observability/overview): Traces, spans, metrics, logs, and feedback.
|
|
12
12
|
- [Evals](https://mastra.ai/docs/evals/overview): Scores, datasets, experiments, and evaluation results.
|
|
13
|
-
- [Long-running agents](https://mastra.ai/docs/
|
|
13
|
+
- [Long-running agents](https://mastra.ai/docs/harness/durable-agents): Background tasks, schedules, goals, and thread state.
|
|
14
14
|
|
|
15
15
|
## When to configure storage
|
|
16
16
|
|
|
@@ -188,25 +188,26 @@ You can also route `observability` to a dedicated analytics backend. See the [ob
|
|
|
188
188
|
|
|
189
189
|
## Supported providers
|
|
190
190
|
|
|
191
|
-
Each provider page includes installation instructions, configuration parameters, and usage examples
|
|
191
|
+
Each provider page includes installation instructions, configuration parameters, and usage examples. libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
192
192
|
|
|
193
|
+
- [Aurora DSQL](https://mastra.ai/integrations/databases/aurora-dsql)
|
|
194
|
+
- [ClickHouse](https://mastra.ai/integrations/databases/clickhouse)
|
|
193
195
|
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
|
|
194
|
-
- [Cloudflare KV
|
|
196
|
+
- [Cloudflare KV](https://mastra.ai/integrations/databases/cloudflare-kv)
|
|
195
197
|
- [Convex](https://mastra.ai/integrations/databases/convex)
|
|
198
|
+
- [DuckDB](https://mastra.ai/integrations/databases/duckdb)
|
|
196
199
|
- [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
|
|
197
200
|
- [Google Cloud Spanner](https://mastra.ai/integrations/databases/spanner)
|
|
198
201
|
- [LanceDB](https://mastra.ai/integrations/databases/lancedb)
|
|
199
202
|
- [libSQL](https://mastra.ai/integrations/databases/libsql)
|
|
200
|
-
- [Microsoft SQL Server](https://mastra.ai/integrations/databases/mssql)
|
|
201
203
|
- [MongoDB](https://mastra.ai/integrations/databases/mongodb)
|
|
204
|
+
- [MSSQL](https://mastra.ai/integrations/databases/mssql)
|
|
202
205
|
- [Neon Postgres](https://mastra.ai/integrations/databases/neon)
|
|
203
206
|
- [OracleDB](https://mastra.ai/integrations/databases/oracledb)
|
|
204
207
|
- [PostgreSQL](https://mastra.ai/integrations/databases/postgresql)
|
|
205
208
|
- [Redis](https://mastra.ai/integrations/databases/redis)
|
|
206
209
|
- [Upstash](https://mastra.ai/integrations/databases/upstash)
|
|
207
210
|
|
|
208
|
-
> **Tip:** libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
209
|
-
|
|
210
211
|
## Next steps
|
|
211
212
|
|
|
212
213
|
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
@@ -14,6 +14,8 @@ A [deployed Studio](https://mastra.ai/docs/studio/deployment) makes Editor avail
|
|
|
14
14
|
|
|
15
15
|
Use Editor when an agent is defined in code but the people responsible for its behavior shouldn't edit the codebase. It works well when instructions or tools change often and need testing before they reach users. If developers own every change and release agent configuration with the application, keep the [agent configuration in code](https://mastra.ai/docs/agents/overview) instead.
|
|
16
16
|
|
|
17
|
+
Use [Agent Builder](https://agent-builder.mastra.ai) instead when collaborators need to create and manage fully stored agents in a browser rather than start from agents defined in code.
|
|
18
|
+
|
|
17
19
|
## Quickstart
|
|
18
20
|
|
|
19
21
|
Install `@mastra/editor`. This quickstart uses LibSQL to store Editor changes:
|
|
@@ -304,7 +306,7 @@ Version selection supports:
|
|
|
304
306
|
- Compare two versions in an A/B test.
|
|
305
307
|
- Give a draft to a small group before publishing it for everyone.
|
|
306
308
|
- Keep production on the published version while staging uses the latest draft.
|
|
307
|
-
- Pin a customer to a
|
|
309
|
+
- Pin a customer to a specific version.
|
|
308
310
|
|
|
309
311
|
The same version controls work when a supervisor calls sub-agents. Developers can test a draft sub-agent without changing the rest of the system.
|
|
310
312
|
|
|
@@ -147,7 +147,7 @@ export const mastra = new Mastra({
|
|
|
147
147
|
- [Upstash Storage](https://mastra.ai/integrations/databases/upstash)
|
|
148
148
|
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
|
|
149
149
|
- [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
|
|
150
|
-
- [More storage providers](https://mastra.ai/docs/storage
|
|
150
|
+
- [More storage providers](https://mastra.ai/docs/storage)
|
|
151
151
|
|
|
152
152
|
## Best practices
|
|
153
153
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# GitHub
|
|
4
4
|
|
|
5
|
-
The `@mastra/github-signals` provider lets an agent follow pull requests (PRs). It polls subscribed PRs and sends [notification signals](https://mastra.ai/docs/
|
|
5
|
+
The `@mastra/github-signals` provider lets an agent follow pull requests (PRs). It polls subscribed PRs and sends [notification signals](https://mastra.ai/docs/harness/signals) to the agent thread when relevant activity occurs.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
package/dist/docs/references/{guides-agent-frameworks-ai-sdk.md → reference-ai-sdk-overview.md}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# AI SDK
|
|
4
4
|
|
|
5
|
-
If you're already using the [Vercel AI SDK](https://sdk.vercel.ai) directly and want to add Mastra capabilities like [processors](https://mastra.ai/docs/agents/processors) or [memory](https://mastra.ai/docs/memory/memory-processors) without switching to the full Mastra agent API, [`withMastra()`](https://mastra.ai/reference/ai-sdk/with-mastra) lets you wrap any AI SDK model with these features. This is useful when you want to keep your existing AI SDK code but add input/output processing
|
|
5
|
+
If you're already using the [Vercel AI SDK](https://sdk.vercel.ai) directly and want to add Mastra capabilities like [processors](https://mastra.ai/docs/agents/processors) or [memory](https://mastra.ai/docs/memory/memory-processors) without switching to the full Mastra agent API, [`withMastra()`](https://mastra.ai/reference/ai-sdk/with-mastra) lets you wrap any AI SDK model with these features. This is useful when you want to keep your existing AI SDK code but add input/output processing and conversation persistence, including content filtering.
|
|
6
6
|
|
|
7
7
|
> **Tip:** If you want to use Mastra together with AI SDK UI (e.g. `useChat()`), visit the [AI SDK UI guide](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui).
|
|
8
8
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The `Mastra` class is the central orchestrator in any Mastra application, managing agents, workflows, storage, logging, observability, and more. Typically, you create a single instance of `Mastra` to coordinate your application.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
`Mastra` is the top-level registry where you register agents, workflows, tools, and other components that need to be accessible throughout your application.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ import { Memory } from '@mastra/memory'
|
|
|
18
18
|
export default new Memory()
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
The exported instance becomes the agent's `memory`. If your app configures a storage provider on the main Mastra instance, memory data is stored there. See [storage](https://mastra.ai/docs/storage
|
|
21
|
+
The exported instance becomes the agent's `memory`. If your app configures a storage provider on the main Mastra instance, memory data is stored there. See [storage](https://mastra.ai/docs/storage) for more information.
|
|
22
22
|
|
|
23
23
|
Use the same `resource` and `thread` values when calling the agent to continue a conversation:
|
|
24
24
|
|
|
@@ -51,7 +51,7 @@ export default new Memory({
|
|
|
51
51
|
|
|
52
52
|
Visit the [`Memory` reference](https://mastra.ai/reference/memory/memory-class) for constructor options. Use these pages for related memory features:
|
|
53
53
|
|
|
54
|
-
- [Storage](https://mastra.ai/docs/storage
|
|
54
|
+
- [Storage](https://mastra.ai/docs/storage): configure persistence for memory data.
|
|
55
55
|
- [Semantic recall](https://mastra.ai/docs/memory/semantic-recall): retrieve relevant past messages by semantic meaning.
|
|
56
56
|
- [Memory processors](https://mastra.ai/docs/memory/memory-processors): filter, trim, or transform messages before memory adds them to model context.
|
|
57
57
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
> **Beta:** Breaking changes may occur without a major version bump until the API is stable.
|
|
6
6
|
|
|
7
|
-
Mastra sets the project's default [storage](https://mastra.ai/docs/storage
|
|
7
|
+
Mastra sets the project's default [storage](https://mastra.ai/docs/storage) from a `storage.ts` file directly under `src/mastra/`. The file default-exports a store, which replaces the built-in in-memory store used for memory, workflows, observability, and other storage domains.
|
|
8
8
|
|
|
9
|
-
Use this page for the file-based convention. For backend choice, storage domains, retention, and provider details, see [storage overview](https://mastra.ai/docs/storage
|
|
9
|
+
Use this page for the file-based convention. For backend choice, storage domains, retention, and provider details, see [storage overview](https://mastra.ai/docs/storage).
|
|
10
10
|
|
|
11
11
|
## Quickstart
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ Mastra registers the store before file-based agents and workflows, so storage-de
|
|
|
25
25
|
|
|
26
26
|
## Production backends
|
|
27
27
|
|
|
28
|
-
`storage.ts` can export any Mastra storage adapter, such as LibSQL, PostgreSQL, or MongoDB. For setup patterns, provider support, and schema details, see [storage overview](https://mastra.ai/docs/storage
|
|
28
|
+
`storage.ts` can export any Mastra storage adapter, such as LibSQL, PostgreSQL, or MongoDB. For setup patterns, provider support, and schema details, see [storage overview](https://mastra.ai/docs/storage), [observability signal support](https://mastra.ai/docs/observability/overview), and the [storage reference](https://mastra.ai/reference/storage/overview).
|
|
29
29
|
|
|
30
30
|
## Precedence with code
|
|
31
31
|
|
|
@@ -145,4 +145,5 @@ export const agent = new Agent({
|
|
|
145
145
|
- [listThreads](https://mastra.ai/reference/memory/listThreads)
|
|
146
146
|
- [deleteMessages](https://mastra.ai/reference/memory/deleteMessages)
|
|
147
147
|
- [cloneThread](https://mastra.ai/reference/memory/cloneThread)
|
|
148
|
+
- [settled](https://mastra.ai/reference/memory/settled)
|
|
148
149
|
- [Clone Utility Methods](https://mastra.ai/reference/memory/clone-utilities)
|
|
@@ -234,7 +234,7 @@ const storage = new MongoDBStore({
|
|
|
234
234
|
|
|
235
235
|
`prune()` deletes rows but doesn't shrink the database file. On SQLite/libSQL the freed pages go on a freelist and are reused by future writes, so the file stops growing: for most users this alone solves the unbounded-growth problem.
|
|
236
236
|
|
|
237
|
-
Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself in a maintenance window. A full `VACUUM` locks the file and needs roughly twice the file size in free disk. On PostgreSQL, autovacuum reclaims dead tuples for reuse automatically
|
|
237
|
+
Handing that free space back to the OS is a separate concern that Mastra doesn't manage. If you specifically need to shrink the file, run the underlying database's compaction (for example `VACUUM` on self-hosted libSQL) yourself in a maintenance window. A full `VACUUM` locks the file and needs roughly twice the file size in free disk. On PostgreSQL, autovacuum reclaims dead tuples for reuse automatically. A manual `VACUUM FULL` is only needed if you must return disk to the OS.
|
|
238
238
|
|
|
239
239
|
For MongoDB, deleted documents are reused by future insertions. To reclaim disk space, run [`db.runCommand({ compact: "collection_name" })`](https://www.mongodb.com/docs/manual/reference/command/compact/) during a maintenance window.
|
|
240
240
|
|
package/dist/index.cjs
CHANGED
|
@@ -2021,6 +2021,7 @@ var AgentsLibSQL = class extends _mastra_core_storage.AgentsStorage {
|
|
|
2021
2021
|
"workspace",
|
|
2022
2022
|
"skills",
|
|
2023
2023
|
"skillsFormat",
|
|
2024
|
+
"durable",
|
|
2024
2025
|
"browser",
|
|
2025
2026
|
"toolProviders"
|
|
2026
2027
|
]
|
|
@@ -2456,6 +2457,7 @@ var AgentsLibSQL = class extends _mastra_core_storage.AgentsStorage {
|
|
|
2456
2457
|
workspace: input.workspace ?? null,
|
|
2457
2458
|
skills: input.skills ?? null,
|
|
2458
2459
|
skillsFormat: input.skillsFormat ?? null,
|
|
2460
|
+
durable: input.durable ?? null,
|
|
2459
2461
|
browser: input.browser ?? null,
|
|
2460
2462
|
changedFields: input.changedFields ?? null,
|
|
2461
2463
|
changeMessage: input.changeMessage ?? null,
|
|
@@ -2691,6 +2693,7 @@ var AgentsLibSQL = class extends _mastra_core_storage.AgentsStorage {
|
|
|
2691
2693
|
workspace: this.parseJson(row.workspace, "workspace"),
|
|
2692
2694
|
skills: this.parseJson(row.skills, "skills"),
|
|
2693
2695
|
skillsFormat: row.skillsFormat,
|
|
2696
|
+
durable: this.parseJson(row.durable, "durable"),
|
|
2694
2697
|
browser: this.parseJson(row.browser, "browser"),
|
|
2695
2698
|
changedFields: this.parseJson(row.changedFields, "changedFields"),
|
|
2696
2699
|
changeMessage: row.changeMessage,
|