@mastra/libsql 1.30.0-alpha.0 → 1.30.0-alpha.2
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 -10
- package/dist/docs/assets/SOURCE_MAP.json +29 -29
- package/dist/docs/references/reference-core-mastra-class.md +1 -1
- package/dist/docs/references/reference-memory-memory-class.md +1 -1
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +1 -0
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/docs/references/docs-deployment-workers.md +0 -404
- package/dist/docs/references/docs-memory-memory-processors.md +0 -442
- package/dist/docs/references/docs-memory-semantic-recall.md +0 -485
- package/dist/docs/references/docs-memory-working-memory.md +0 -450
- package/dist/docs/references/docs-storage.md +0 -224
- package/dist/docs/references/integrations-channels-github.md +0 -156
- package/dist/docs/references/reference-rag-retrieval.md +0 -672
- package/dist/docs/references/reference-storage-composite.md +0 -433
- package/dist/docs/references/reference-storage-retention.md +0 -310
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-libsql
|
|
|
3
3
|
description: Documentation for @mastra/libsql. Use when working with @mastra/libsql APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/libsql"
|
|
6
|
-
version: "1.30.0-alpha.
|
|
6
|
+
version: "1.30.0-alpha.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -18,24 +18,18 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
18
18
|
|
|
19
19
|
- [Human-in-the-loop](references/docs-agents-human-in-the-loop.md) - Add human-in-the-loop controls to Mastra agents with tool approval and suspended execution, so people can provide input before a run resumes or stops.
|
|
20
20
|
- [Agent networks](references/docs-agents-networks.md) - Understand deprecated Mastra agent networks, including multi-agent routing, structured output, tool approvals, and migration to supervisor agents.
|
|
21
|
-
- [Workers](references/docs-deployment-workers.md) - Run Mastra workflow orchestration, schedules, and long-running background tasks in dedicated workers to keep API processes responsive under load.
|
|
22
21
|
- [Load your content](references/docs-knowledge-load-your-content.md) - Load your own content, such as product docs or policies, into Knowledge so agents can search and read it.
|
|
23
22
|
- [Knowledge](references/docs-knowledge-overview.md) - Give agents shared pages and notes they search, read and write, with access decided by your configuration rather than by the model.
|
|
24
23
|
- [Search](references/docs-knowledge-search.md) - How Knowledge search ranks results, and how to add search by meaning.
|
|
25
|
-
- [Memory processors](references/docs-memory-memory-processors.md) - Configure Mastra memory processors to filter, trim, transform, and deduplicate messages before they reach the model while managing context limits.
|
|
26
24
|
- [Message history](references/docs-memory-message-history.md) - Store and retrieve recent Mastra conversation messages, configure history limits and thread titles, and query threads for chat interfaces.
|
|
27
25
|
- [Multi-user threads](references/docs-memory-multi-user-threads.md) - Share one Mastra memory thread across multiple users by preserving speaker identity in messages and combining history with observational or working memory.
|
|
28
26
|
- [Memory](references/docs-memory-overview.md) - Add memory to Mastra agents with message history, observational memory, and working memory across threads and multi-agent delegation.
|
|
29
|
-
- [Semantic recall](references/docs-memory-semantic-recall.md) - Retrieve relevant messages from past Mastra conversations with semantic recall, vector search, embeddings, metadata filters, and configurable storage.
|
|
30
|
-
- [Working memory](references/docs-memory-working-memory.md) - Persist user profiles, preferences, and application data with Mastra working memory using resource- or thread-scoped templates and storage adapters.
|
|
31
27
|
- [Signals](references/docs-signals-overview.md) - Send asynchronous input into a Mastra agent thread while Mastra manages whether the agent is active or idle.
|
|
32
|
-
- [Storage](references/docs-storage.md) - Configure Mastra storage to persist memory, workflow state, observability data, evals, schedules, and long-running agent state across restarts.
|
|
33
28
|
- [Editor](references/docs-studio-editor.md) - Use Mastra Studio Editor so collaborators can change agent instructions and tools without modifying source code, from draft testing through publication.
|
|
34
29
|
- [Snapshots](references/docs-workflows-snapshots.md) - Store and retrieve Mastra workflow snapshots so suspended executions preserve step results and state and can resume reliably across processes.
|
|
35
30
|
|
|
36
31
|
### Integrations
|
|
37
32
|
|
|
38
|
-
- [GitHub](references/integrations-channels-github.md) - Subscribe Mastra agents to GitHub pull requests with @mastra/github-signals, polling modes, notification signals, and subscription management tools.
|
|
39
33
|
- [Ring](references/integrations-channels-ring.md) - Send Ring doorbell and camera events to Mastra agents as notification signals with @mastra/ring-signals, and fetch snapshots and video clips with agent tools.
|
|
40
34
|
- [DynamoDB](references/integrations-databases-dynamodb.md) - Persist Mastra data in Amazon DynamoDB with a single-table ElectroDB design, configurable indexes, TTL support, credentials, and table initialization.
|
|
41
35
|
- [libSQL](references/integrations-databases-libsql.md) - Persist Mastra messages, workflow snapshots, traces, and eval scores in local or remote libSQL with managed tables and initialization options.
|
|
@@ -50,9 +44,6 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
50
44
|
- [Memory](references/reference-file-based-agents-memory.md) - A file-based agent gets memory from a memory.ts file that default-exports a Memory instance.
|
|
51
45
|
- [Storage](references/reference-file-based-agents-storage.md) - Mastra sets the project's default storage from a storage.ts file directly under src/mastra/.
|
|
52
46
|
- [Reference: Memory class](references/reference-memory-memory-class.md) - The Memory class provides a reliable system for managing conversation history and thread-based message storage in Mastra.
|
|
53
|
-
- [Retrieval, semantic search, reranking](references/reference-rag-retrieval.md) - After storing embeddings, you need to retrieve relevant chunks to answer user queries.
|
|
54
|
-
- [Reference: Composite storage](references/reference-storage-composite.md) - MastraCompositeStore can compose storage domains from different providers. Use it when you need different databases for different purposes.
|
|
55
|
-
- [Reference: Storage retention (prune)](references/reference-storage-retention.md) - prune() deletes rows. It caps growth and is safe to run against large tables (batched, bounded, resumable, cancellable).
|
|
56
47
|
|
|
57
48
|
|
|
58
49
|
Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.30.0-alpha.
|
|
2
|
+
"version": "1.30.0-alpha.2",
|
|
3
3
|
"package": "@mastra/libsql",
|
|
4
4
|
"exports": {
|
|
5
5
|
"AgentsLibSQL": {
|
|
6
6
|
"types": "dist/storage/domains/agents/index.d.ts",
|
|
7
7
|
"implementation": "dist/index.js",
|
|
8
|
-
"line":
|
|
8
|
+
"line": 2602
|
|
9
9
|
},
|
|
10
10
|
"BackgroundTasksLibSQL": {
|
|
11
11
|
"types": "dist/storage/domains/background-tasks/index.d.ts",
|
|
12
12
|
"implementation": "dist/index.js",
|
|
13
|
-
"line":
|
|
13
|
+
"line": 3436
|
|
14
14
|
},
|
|
15
15
|
"BlobsLibSQL": {
|
|
16
16
|
"types": "dist/storage/domains/blobs/index.d.ts",
|
|
17
17
|
"implementation": "dist/index.js",
|
|
18
|
-
"line":
|
|
18
|
+
"line": 3738
|
|
19
19
|
},
|
|
20
20
|
"ChannelsLibSQL": {
|
|
21
21
|
"types": "dist/storage/domains/channels/index.d.ts",
|
|
22
22
|
"implementation": "dist/index.js",
|
|
23
|
-
"line":
|
|
23
|
+
"line": 3836
|
|
24
24
|
},
|
|
25
25
|
"DatasetsLibSQL": {
|
|
26
26
|
"types": "dist/storage/domains/datasets/index.d.ts",
|
|
27
27
|
"implementation": "dist/index.js",
|
|
28
|
-
"line":
|
|
28
|
+
"line": 4033
|
|
29
29
|
},
|
|
30
30
|
"DefaultStorage": {
|
|
31
31
|
"types": "dist/storage/index.d.ts",
|
|
32
32
|
"implementation": "dist/index.js",
|
|
33
|
-
"line":
|
|
33
|
+
"line": 17344
|
|
34
34
|
},
|
|
35
35
|
"LibSQLStore": {
|
|
36
36
|
"types": "dist/storage/index.d.ts",
|
|
37
37
|
"implementation": "dist/index.js",
|
|
38
|
-
"line":
|
|
38
|
+
"line": 17344
|
|
39
39
|
},
|
|
40
40
|
"ExperimentsLibSQL": {
|
|
41
41
|
"types": "dist/storage/domains/experiments/index.d.ts",
|
|
42
42
|
"implementation": "dist/index.js",
|
|
43
|
-
"line":
|
|
43
|
+
"line": 5295
|
|
44
44
|
},
|
|
45
45
|
"FavoritesLibSQL": {
|
|
46
46
|
"types": "dist/storage/domains/favorites/index.d.ts",
|
|
47
47
|
"implementation": "dist/index.js",
|
|
48
|
-
"line":
|
|
48
|
+
"line": 6154
|
|
49
49
|
},
|
|
50
50
|
"HarnessLibSQL": {
|
|
51
51
|
"types": "dist/storage/domains/harness/index.d.ts",
|
|
52
52
|
"implementation": "dist/index.js",
|
|
53
|
-
"line":
|
|
53
|
+
"line": 6482
|
|
54
54
|
},
|
|
55
55
|
"KnowledgeLibSQL": {
|
|
56
56
|
"types": "dist/storage/domains/knowledge/index.d.ts",
|
|
57
57
|
"implementation": "dist/index.js",
|
|
58
|
-
"line":
|
|
58
|
+
"line": 8143
|
|
59
59
|
},
|
|
60
60
|
"LIBSQL_PROMPT": {
|
|
61
61
|
"types": "dist/vector/prompt.d.ts",
|
|
62
62
|
"implementation": "dist/index.js",
|
|
63
|
-
"line":
|
|
63
|
+
"line": 17543
|
|
64
64
|
},
|
|
65
65
|
"LibSQLFactoryStorage": {
|
|
66
66
|
"types": "dist/storage/factory-storage.d.ts",
|
|
67
67
|
"implementation": "dist/index.js",
|
|
68
|
-
"line":
|
|
68
|
+
"line": 17196
|
|
69
69
|
},
|
|
70
70
|
"LibSQLVector": {
|
|
71
71
|
"types": "dist/vector/index.d.ts",
|
|
@@ -75,77 +75,77 @@
|
|
|
75
75
|
"MCPClientsLibSQL": {
|
|
76
76
|
"types": "dist/storage/domains/mcp-clients/index.d.ts",
|
|
77
77
|
"implementation": "dist/index.js",
|
|
78
|
-
"line":
|
|
78
|
+
"line": 8338
|
|
79
79
|
},
|
|
80
80
|
"MCPServersLibSQL": {
|
|
81
81
|
"types": "dist/storage/domains/mcp-servers/index.d.ts",
|
|
82
82
|
"implementation": "dist/index.js",
|
|
83
|
-
"line":
|
|
83
|
+
"line": 8761
|
|
84
84
|
},
|
|
85
85
|
"MemoryLibSQL": {
|
|
86
86
|
"types": "dist/storage/domains/memory/index.d.ts",
|
|
87
87
|
"implementation": "dist/index.js",
|
|
88
|
-
"line":
|
|
88
|
+
"line": 9317
|
|
89
89
|
},
|
|
90
90
|
"NotificationsLibSQL": {
|
|
91
91
|
"types": "dist/storage/domains/notifications/index.d.ts",
|
|
92
92
|
"implementation": "dist/index.js",
|
|
93
|
-
"line":
|
|
93
|
+
"line": 11702
|
|
94
94
|
},
|
|
95
95
|
"ObservabilityLibSQL": {
|
|
96
96
|
"types": "dist/storage/domains/observability/index.d.ts",
|
|
97
97
|
"implementation": "dist/index.js",
|
|
98
|
-
"line":
|
|
98
|
+
"line": 12009
|
|
99
99
|
},
|
|
100
100
|
"PromptBlocksLibSQL": {
|
|
101
101
|
"types": "dist/storage/domains/prompt-blocks/index.d.ts",
|
|
102
102
|
"implementation": "dist/index.js",
|
|
103
|
-
"line":
|
|
103
|
+
"line": 12535
|
|
104
104
|
},
|
|
105
105
|
"SchedulesLibSQL": {
|
|
106
106
|
"types": "dist/storage/domains/schedules/index.d.ts",
|
|
107
107
|
"implementation": "dist/index.js",
|
|
108
|
-
"line":
|
|
108
|
+
"line": 13011
|
|
109
109
|
},
|
|
110
110
|
"ScorerDefinitionsLibSQL": {
|
|
111
111
|
"types": "dist/storage/domains/scorer-definitions/index.d.ts",
|
|
112
112
|
"implementation": "dist/index.js",
|
|
113
|
-
"line":
|
|
113
|
+
"line": 13309
|
|
114
114
|
},
|
|
115
115
|
"ScoresLibSQL": {
|
|
116
116
|
"types": "dist/storage/domains/scores/index.d.ts",
|
|
117
117
|
"implementation": "dist/index.js",
|
|
118
|
-
"line":
|
|
118
|
+
"line": 13747
|
|
119
119
|
},
|
|
120
120
|
"SkillsLibSQL": {
|
|
121
121
|
"types": "dist/storage/domains/skills/index.d.ts",
|
|
122
122
|
"implementation": "dist/index.js",
|
|
123
|
-
"line":
|
|
123
|
+
"line": 14089
|
|
124
124
|
},
|
|
125
125
|
"ThreadStateLibSQL": {
|
|
126
126
|
"types": "dist/storage/domains/thread-state/index.d.ts",
|
|
127
127
|
"implementation": "dist/index.js",
|
|
128
|
-
"line":
|
|
128
|
+
"line": 14645
|
|
129
129
|
},
|
|
130
130
|
"ToolProviderConnectionsLibSQL": {
|
|
131
131
|
"types": "dist/storage/domains/tool-provider-connections/index.d.ts",
|
|
132
132
|
"implementation": "dist/index.js",
|
|
133
|
-
"line":
|
|
133
|
+
"line": 14788
|
|
134
134
|
},
|
|
135
135
|
"WorkflowDefinitionsLibSQL": {
|
|
136
136
|
"types": "dist/storage/domains/workflow-definitions/index.d.ts",
|
|
137
137
|
"implementation": "dist/index.js",
|
|
138
|
-
"line":
|
|
138
|
+
"line": 15023
|
|
139
139
|
},
|
|
140
140
|
"WorkflowsLibSQL": {
|
|
141
141
|
"types": "dist/storage/domains/workflows/index.d.ts",
|
|
142
142
|
"implementation": "dist/index.js",
|
|
143
|
-
"line":
|
|
143
|
+
"line": 15381
|
|
144
144
|
},
|
|
145
145
|
"WorkspacesLibSQL": {
|
|
146
146
|
"types": "dist/storage/domains/workspaces/index.d.ts",
|
|
147
147
|
"implementation": "dist/index.js",
|
|
148
|
-
"line":
|
|
148
|
+
"line": 16433
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
151
|
"modules": {}
|
|
@@ -137,7 +137,7 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
137
137
|
|
|
138
138
|
**recovery** (`MastraRecoveryConfig`): Boot-time recovery behavior for orphaned agent and workflow runs. See Crash recovery. (Default: `{ durableAgents: 'off', workflows: 'auto', workflowConcurrency: 5 }`)
|
|
139
139
|
|
|
140
|
-
**recovery.durableAgents** (`'auto' | 'off'`): Set to 'auto' to automatically re-drive orphaned RUNNING durable agent runs on server boot. This also controls the default snapshot-persistence policy for durable agents: running checkpoints are only written when set to 'auto' (or when an agent sets a custom shouldPersistSnapshot that includes running). Recovery
|
|
140
|
+
**recovery.durableAgents** (`'auto' | 'off'`): Set to 'auto' to automatically re-drive orphaned RUNNING durable agent runs on server boot. This also controls the default snapshot-persistence policy for durable agents: running checkpoints are only written when set to 'auto' (or when an agent sets a custom shouldPersistSnapshot that includes running). Recovery can run an interrupted tool call again and request a new model response in place of one that wasn't saved, so tools must be idempotent. See make tools safe to repeat.
|
|
141
141
|
|
|
142
142
|
**recovery.workflows** (`'auto' | 'off'`): Set to 'off' to skip restarting active workflow runs on server boot. Individual workflows can also opt out with autoRestartActiveRuns: false.
|
|
143
143
|
|
|
@@ -49,7 +49,7 @@ export const agent = new Agent({
|
|
|
49
49
|
|
|
50
50
|
**options.retainFullInput** (`boolean`): When true, the request input is processed exactly as supplied instead of being filtered against stored history. Use this when you assemble the input yourself and need the message sequence preserved. Stored history is still loaded underneath, and every input message that isn't already stored is saved to the thread, including few-shot examples. Can be set per call on memory.options or agent-wide in the memory constructor options.
|
|
51
51
|
|
|
52
|
-
**options.semanticRecall** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires a vector store, and an embedder unless the vector store embeds text itself (isSelfEmbedding). Default topK is 4, default messageRange is {before: 1, after: 1}.
|
|
52
|
+
**options.semanticRecall** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource'; maxChunkChars?: number }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires a vector store, and an embedder unless the vector store embeds text itself (isSelfEmbedding). Default topK is 4, default messageRange is {before: 1, after: 1}. maxChunkChars caps the characters of message text per embedded chunk; see Long messages.
|
|
53
53
|
|
|
54
54
|
**options.workingMemory** (`WorkingMemory`): Configuration for working memory feature. Can be { enabled: boolean; template?: string; schema?: ZodObject\<any> | JSONSchema7; scope?: 'thread' | 'resource' } or { enabled: boolean } to disable.
|
|
55
55
|
|
package/dist/index.cjs
CHANGED
|
@@ -1448,8 +1448,9 @@ var LibSQLVector = class extends _mastra_core_vector.MastraVector {
|
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
1450
|
async _doTruncateIndex({ indexName }) {
|
|
1451
|
+
const parsedIndexName = (0, _mastra_core_utils.parseSqlIdentifier)(indexName, "index name");
|
|
1451
1452
|
await this.turso.execute({
|
|
1452
|
-
sql: `DELETE FROM ${
|
|
1453
|
+
sql: `DELETE FROM ${parsedIndexName} WHERE rowid IS NOT NULL`,
|
|
1453
1454
|
args: []
|
|
1454
1455
|
});
|
|
1455
1456
|
}
|
|
@@ -12017,9 +12018,19 @@ var ObservabilityLibSQL = class ObservabilityLibSQL extends _mastra_core_storage
|
|
|
12017
12018
|
indexed: true
|
|
12018
12019
|
} };
|
|
12019
12020
|
#db;
|
|
12021
|
+
#persistenceLocation;
|
|
12022
|
+
get persistenceLocation() {
|
|
12023
|
+
return this.#persistenceLocation;
|
|
12024
|
+
}
|
|
12020
12025
|
constructor(config) {
|
|
12021
12026
|
super();
|
|
12022
12027
|
const client = resolveClient(config);
|
|
12028
|
+
this.#persistenceLocation = config.embeddedReplica || client.protocol === "file" ? "local" : [
|
|
12029
|
+
"http",
|
|
12030
|
+
"https",
|
|
12031
|
+
"ws",
|
|
12032
|
+
"wss"
|
|
12033
|
+
].includes(client.protocol) ? "remote" : void 0;
|
|
12023
12034
|
this.#db = new LibSQLDB({
|
|
12024
12035
|
client,
|
|
12025
12036
|
maxRetries: config.maxRetries,
|