@mastra/libsql 0.0.0-key-fix-20260227010020 → 0.0.0-knowledge-w1-20261006001735

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 (110) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +13 -107
  3. package/dist/_types/@internal_core/dist/knowledge-compat/index.d.ts +533 -0
  4. package/dist/_types/@internal_core/package.json +1 -0
  5. package/dist/docs/SKILL.md +30 -27
  6. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  7. package/dist/docs/references/docs-agents-human-in-the-loop.md +723 -0
  8. package/dist/docs/references/docs-agents-networks.md +93 -206
  9. package/dist/docs/references/docs-deployment-workers.md +404 -0
  10. package/dist/docs/references/docs-memory-memory-processors.md +101 -22
  11. package/dist/docs/references/docs-memory-message-history.md +173 -19
  12. package/dist/docs/references/docs-memory-multi-user-threads.md +210 -0
  13. package/dist/docs/references/docs-memory-overview.md +248 -25
  14. package/dist/docs/references/docs-memory-semantic-recall.md +222 -39
  15. package/dist/docs/references/docs-memory-working-memory.md +67 -33
  16. package/dist/docs/references/docs-storage.md +224 -0
  17. package/dist/docs/references/docs-studio-editor.md +353 -0
  18. package/dist/docs/references/docs-workflows-snapshots.md +21 -15
  19. package/dist/docs/references/integrations-channels-github.md +156 -0
  20. package/dist/docs/references/{reference-storage-dynamodb.md → integrations-databases-dynamodb.md} +28 -24
  21. package/dist/docs/references/{reference-storage-libsql.md → integrations-databases-libsql.md} +31 -5
  22. package/dist/docs/references/{guides-agent-frameworks-ai-sdk.md → reference-ai-sdk-overview.md} +13 -9
  23. package/dist/docs/references/reference-core-getMemory.md +8 -5
  24. package/dist/docs/references/reference-core-listMemory.md +7 -4
  25. package/dist/docs/references/reference-core-mastra-class.md +112 -19
  26. package/dist/docs/references/reference-file-based-agents-memory.md +60 -0
  27. package/dist/docs/references/reference-file-based-agents-storage.md +32 -0
  28. package/dist/docs/references/reference-memory-memory-class.md +27 -18
  29. package/dist/docs/references/{docs-rag-retrieval.md → reference-rag-retrieval.md} +175 -35
  30. package/dist/docs/references/reference-storage-composite.md +183 -19
  31. package/dist/docs/references/reference-storage-retention.md +304 -0
  32. package/dist/docs/references/reference-vectors-libsql.md +52 -48
  33. package/dist/index.cjs +15501 -9968
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +15467 -9944
  36. package/dist/index.js.map +1 -1
  37. package/dist/shared/single-connection-client.d.ts +29 -0
  38. package/dist/shared/single-connection-client.d.ts.map +1 -0
  39. package/dist/storage/db/client.d.ts +31 -0
  40. package/dist/storage/db/client.d.ts.map +1 -0
  41. package/dist/storage/db/index.d.ts +91 -5
  42. package/dist/storage/db/index.d.ts.map +1 -1
  43. package/dist/storage/db/utils.d.ts +17 -1
  44. package/dist/storage/db/utils.d.ts.map +1 -1
  45. package/dist/storage/db/write-lock.d.ts +8 -0
  46. package/dist/storage/db/write-lock.d.ts.map +1 -0
  47. package/dist/storage/domains/agents/index.d.ts +1 -0
  48. package/dist/storage/domains/agents/index.d.ts.map +1 -1
  49. package/dist/storage/domains/background-tasks/index.d.ts +27 -0
  50. package/dist/storage/domains/background-tasks/index.d.ts.map +1 -0
  51. package/dist/storage/domains/blobs/index.d.ts.map +1 -1
  52. package/dist/storage/domains/channels/index.d.ts +20 -0
  53. package/dist/storage/domains/channels/index.d.ts.map +1 -0
  54. package/dist/storage/domains/datasets/index.d.ts +8 -7
  55. package/dist/storage/domains/datasets/index.d.ts.map +1 -1
  56. package/dist/storage/domains/experiments/index.d.ts +27 -1
  57. package/dist/storage/domains/experiments/index.d.ts.map +1 -1
  58. package/dist/storage/domains/favorites/index.d.ts +17 -0
  59. package/dist/storage/domains/favorites/index.d.ts.map +1 -0
  60. package/dist/storage/domains/harness/index.d.ts +17 -0
  61. package/dist/storage/domains/harness/index.d.ts.map +1 -0
  62. package/dist/storage/domains/knowledge/index.d.ts +103 -0
  63. package/dist/storage/domains/knowledge/index.d.ts.map +1 -0
  64. package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -1
  65. package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -1
  66. package/dist/storage/domains/memory/index.d.ts +44 -6
  67. package/dist/storage/domains/memory/index.d.ts.map +1 -1
  68. package/dist/storage/domains/notifications/index.d.ts +28 -0
  69. package/dist/storage/domains/notifications/index.d.ts.map +1 -0
  70. package/dist/storage/domains/observability/index.d.ts +9 -1
  71. package/dist/storage/domains/observability/index.d.ts.map +1 -1
  72. package/dist/storage/domains/prompt-blocks/index.d.ts.map +1 -1
  73. package/dist/storage/domains/schedules/index.d.ts +27 -0
  74. package/dist/storage/domains/schedules/index.d.ts.map +1 -0
  75. package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -1
  76. package/dist/storage/domains/scores/index.d.ts +15 -5
  77. package/dist/storage/domains/scores/index.d.ts.map +1 -1
  78. package/dist/storage/domains/skills/index.d.ts +1 -0
  79. package/dist/storage/domains/skills/index.d.ts.map +1 -1
  80. package/dist/storage/domains/thread-state/index.d.ts +38 -0
  81. package/dist/storage/domains/thread-state/index.d.ts.map +1 -0
  82. package/dist/storage/domains/tool-provider-connections/index.d.ts +14 -0
  83. package/dist/storage/domains/tool-provider-connections/index.d.ts.map +1 -0
  84. package/dist/storage/domains/utils.d.ts +34 -0
  85. package/dist/storage/domains/utils.d.ts.map +1 -0
  86. package/dist/storage/domains/workflow-definitions/index.d.ts +14 -0
  87. package/dist/storage/domains/workflow-definitions/index.d.ts.map +1 -0
  88. package/dist/storage/domains/workflows/index.d.ts +9 -2
  89. package/dist/storage/domains/workflows/index.d.ts.map +1 -1
  90. package/dist/storage/domains/workspaces/index.d.ts.map +1 -1
  91. package/dist/storage/factory-storage.d.ts +28 -0
  92. package/dist/storage/factory-storage.d.ts.map +1 -0
  93. package/dist/storage/index.d.ts +79 -3
  94. package/dist/storage/index.d.ts.map +1 -1
  95. package/dist/storage/retention.d.ts +26 -0
  96. package/dist/storage/retention.d.ts.map +1 -0
  97. package/dist/vector/filter.d.ts.map +1 -1
  98. package/dist/vector/index.d.ts +26 -1
  99. package/dist/vector/index.d.ts.map +1 -1
  100. package/dist/vector/sql-builder.d.ts.map +1 -1
  101. package/dist/vector/write-lock.d.ts +7 -0
  102. package/dist/vector/write-lock.d.ts.map +1 -0
  103. package/package.json +23 -20
  104. package/CHANGELOG.md +0 -4133
  105. package/dist/docs/references/docs-agents-agent-approval.md +0 -558
  106. package/dist/docs/references/docs-agents-agent-memory.md +0 -209
  107. package/dist/docs/references/docs-agents-network-approval.md +0 -275
  108. package/dist/docs/references/docs-memory-storage.md +0 -261
  109. package/dist/docs/references/docs-observability-overview.md +0 -70
  110. package/dist/docs/references/docs-observability-tracing-exporters-default.md +0 -209
package/LICENSE.md CHANGED
@@ -1,3 +1,20 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named `ee/` within this
4
+ repository, including but not limited to:
5
+ - `@mastra/core/auth/ee`
6
+ - `@mastra/core/agent-builder/ee`
7
+ - `@mastra/editor/ee`
8
+
9
+ is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
10
+
11
+ - All third-party components incorporated into the Mastra Software are
12
+ licensed under the original license provided by the owner of the
13
+ applicable component.
14
+
15
+ - Content outside of the above-mentioned directories or restrictions is
16
+ available under the "Apache License 2.0" as defined below.
17
+
1
18
  # Apache License 2.0
2
19
 
3
20
  Copyright (c) 2025 Kepler Software, Inc.
package/README.md CHANGED
@@ -16,27 +16,30 @@ npm install @mastra/libsql
16
16
  import { LibSQLVector } from '@mastra/libsql';
17
17
 
18
18
  const vectorStore = new LibSQLVector({
19
- url: 'file:./my-db.db'
19
+ url: 'file:./my-db.db',
20
20
  });
21
21
 
22
22
  // Create a new table with vector support
23
23
  await vectorStore.createIndex({
24
24
  indexName: 'my_vectors',
25
- dimension: 1536,
25
+ dimension: 3,
26
26
  metric: 'cosine',
27
27
  });
28
28
 
29
29
  // Add vectors
30
30
  const ids = await vectorStore.upsert({
31
31
  indexName: 'my_vectors',
32
- vectors: [[0.1, 0.2, ...], [0.3, 0.4, ...]],
32
+ vectors: [
33
+ [0.1, 0.2, 0.3],
34
+ [0.3, 0.4, 0.5],
35
+ ],
33
36
  metadata: [{ text: 'doc1' }, { text: 'doc2' }],
34
37
  });
35
38
 
36
39
  // Query vectors
37
40
  const results = await vectorStore.query({
38
41
  indexName: 'my_vectors',
39
- queryVector: [0.1, 0.2, ...],
42
+ queryVector: [0.1, 0.2, 0.3],
40
43
  topK: 10, // topK
41
44
  filter: { text: 'doc1' }, // filter
42
45
  includeVector: false, // includeVector
@@ -44,111 +47,14 @@ const results = await vectorStore.query({
44
47
  });
45
48
  ```
46
49
 
47
- ### Storage
48
-
49
- ```typescript
50
- import { LibSQLStore } from '@mastra/libsql';
51
-
52
- const store = new LibSQLStore({
53
- id: 'libsql-storage',
54
- url: 'file:./my-db.db',
55
- });
56
-
57
- // Create a thread
58
- await store.saveThread({
59
- thread: {
60
- id: 'thread-123',
61
- resourceId: 'resource-456',
62
- title: 'My Thread',
63
- metadata: { key: 'value' },
64
- createdAt: new Date(),
65
- },
66
- });
67
-
68
- // Add messages to thread
69
- await store.saveMessages({
70
- messages: [
71
- {
72
- id: 'msg-789',
73
- threadId: 'thread-123',
74
- role: 'user',
75
- content: { content: 'Hello' },
76
- resourceId: 'resource-456',
77
- createdAt: new Date(),
78
- },
79
- ],
80
- });
81
-
82
- // Query threads and messages
83
- const savedThread = await store.getThreadById({ threadId: 'thread-123' });
84
- const messages = await store.listMessages({ threadId: 'thread-123' });
85
- ```
86
-
87
- ## Configuration
88
-
89
- The LibSQLStore store can be initialized with:
90
-
91
- - Configuration object with url and auth. Auth is only necessary when using a provider like [Turso](https://turso.tech/)
92
-
93
- ## Features
94
-
95
- ### Vector Store Features
96
-
97
- - Vector similarity search with cosine, euclidean, and dot product metrics
98
- - Advanced metadata filtering with MongoDB-like query syntax
99
- - Minimum score threshold for queries
100
- - Automatic UUID generation for vectors
101
- - Table management (create, list, describe, delete, truncate)
102
-
103
- ### Storage Features
104
-
105
- - Thread and message storage with JSON support
106
- - Atomic transactions for data consistency
107
- - Efficient batch operations
108
- - Rich metadata support
109
- - Timestamp tracking
110
- - Cascading deletes
111
-
112
- ## Supported Filter Operators
113
-
114
- The following filter operators are supported for metadata queries:
115
-
116
- - Comparison: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`
117
- - Logical: `$and`, `$or`
118
- - Array: `$in`, `$nin`
119
- - Text: `$regex`, `$like`
120
-
121
- Example filter:
122
-
123
- ```typescript
124
- {
125
- $and: [{ age: { $gt: 25 } }, { tags: { $in: ['tag1', 'tag2'] } }];
126
- }
127
- ```
128
-
129
- ## Vector Store Methods
50
+ ## Documentation
130
51
 
131
- - `createIndex({indexName, dimension, metric?, indexConfig?, defineIndex?})`: Create a new table with vector support
132
- - `upsert({indexName, vectors, metadata?, ids?})`: Add or update vectors
133
- - `query({indexName, queryVector, topK?, filter?, includeVector?, minScore?})`: Search for similar vectors
134
- - `updateVector({ indexName, id?, filter?, update })`: Update a single vector by ID or metadata filter
135
- - `deleteVector({ indexName, id })`: Delete a single vector by ID
136
- - `deleteVectors({ indexName, ids?, filter? })`: Delete multiple vectors by IDs or metadata filter
137
- - `defineIndex({indexName, metric?, indexConfig?})`: Define an index
138
- - `listIndexes()`: List all vector-enabled tables
139
- - `describeIndex(indexName)`: Get table statistics
140
- - `deleteIndex(indexName)`: Delete a table
141
- - `truncateIndex(indexName)`: Remove all data from a table
52
+ - [@mastra/libsql documentation](https://mastra.ai/reference/vectors/libsql)
142
53
 
143
- ## Storage Methods
54
+ ## Changelog
144
55
 
145
- - `saveThread({ thread })`: Create or update a thread
146
- - `getThreadById({ threadId })`: Get a thread by ID
147
- - `deleteThread({ threadId })`: Delete a thread and its messages
148
- - `saveMessages({ messages })`: Save multiple messages in a transaction
149
- - `listMessages({ threadId, perPage?, page? })`: Get messages for a thread with pagination
150
- - `deleteMessages(messageIds)`: Delete specific messages
56
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/stores/libsql/CHANGELOG.md) for version history and release notes.
151
57
 
152
- ## Related Links
58
+ ## Support
153
59
 
154
- - [LibSQL Documentation](https://docs.turso.tech/sdk/introductionh)
60
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
@@ -0,0 +1,533 @@
1
+ //#region src/knowledge-compat/index.d.ts
2
+ declare const KNOWLEDGE_V2_CORE_FEATURE = "knowledge-v2";
3
+ declare const KNOWLEDGE_V2_MINIMUM_CORE_VERSION = "1.65.0-0";
4
+ declare const KNOWLEDGE_STORAGE_CONTRACT_VERSION: 2;
5
+ declare const KNOWLEDGE_STORAGE_SCHEMA_VERSION: 2;
6
+ /** Hard cap on scope nodes returned by one `listScopeNodes` read. */
7
+ declare const MAX_KNOWLEDGE_SCOPE_NODES = 1000;
8
+ /** A reconciled structural scope node with its containing scope nodes. */
9
+ interface KnowledgeScopeNodeSummary {
10
+ /** UUID of the `isScope` node. */
11
+ id: string;
12
+ /** Canonical address the scope node was reconciled from (e.g. `features:memory`). */
13
+ address: string;
14
+ name: string;
15
+ kind?: string;
16
+ description?: string;
17
+ /** UUIDs of the scope nodes that contain this scope (membership edges). */
18
+ parentIds: string[];
19
+ }
20
+ declare const TABLE_KNOWLEDGE_NODE_SCOPES = "mastra_knowledge_node_scopes";
21
+ declare const TABLE_KNOWLEDGE_RECORD_SCOPES = "mastra_knowledge_record_scopes";
22
+ declare const TABLE_KNOWLEDGE_SCOPE_GRANTS = "mastra_knowledge_scope_grants";
23
+ declare const TABLE_KNOWLEDGE_ACCESS_STATE = "mastra_knowledge_access_state";
24
+ declare const TABLE_KNOWLEDGE_SCOPE_ADDRESSES = "mastra_knowledge_scope_addresses";
25
+ declare const TABLE_KNOWLEDGE_NODE_ADDRESSES = "mastra_knowledge_node_addresses";
26
+ declare const TABLE_KNOWLEDGE_IMPORT_STATE = "mastra_knowledge_import_state";
27
+ declare const TABLE_KNOWLEDGE_IMPORT_RUNS = "mastra_knowledge_import_runs";
28
+ declare const TABLE_KNOWLEDGE_PROPOSALS = "mastra_knowledge_proposals";
29
+ declare const KNOWLEDGE_TABLE_NAMES: readonly ["mastra_knowledge_nodes", "mastra_knowledge_records", "mastra_knowledge_mentions", "mastra_knowledge_cursors", "mastra_knowledge_activity", "mastra_knowledge_semantic_outbox", "mastra_knowledge_node_scopes", "mastra_knowledge_record_scopes", "mastra_knowledge_scope_grants", "mastra_knowledge_access_state", "mastra_knowledge_scope_addresses", "mastra_knowledge_node_addresses", "mastra_knowledge_import_state", "mastra_knowledge_import_runs", "mastra_knowledge_proposals"];
30
+ declare const KNOWLEDGE_V2_NODES_SCHEMA: {
31
+ readonly id: {
32
+ readonly type: 'text';
33
+ readonly nullable: false;
34
+ readonly primaryKey: true;
35
+ };
36
+ readonly name: {
37
+ readonly type: 'text';
38
+ readonly nullable: false;
39
+ };
40
+ readonly kind: {
41
+ readonly type: 'text';
42
+ readonly nullable: true;
43
+ };
44
+ readonly isScope: {
45
+ readonly type: 'boolean';
46
+ readonly nullable: false;
47
+ };
48
+ readonly metadata: {
49
+ readonly type: 'jsonb';
50
+ readonly nullable: true;
51
+ };
52
+ readonly version: {
53
+ readonly type: 'integer';
54
+ readonly nullable: false;
55
+ };
56
+ readonly createdAt: {
57
+ readonly type: 'timestamp';
58
+ readonly nullable: false;
59
+ };
60
+ readonly updatedAt: {
61
+ readonly type: 'timestamp';
62
+ readonly nullable: false;
63
+ };
64
+ readonly deletedAt: {
65
+ readonly type: 'timestamp';
66
+ readonly nullable: true;
67
+ };
68
+ readonly deletedBy: {
69
+ readonly type: 'text';
70
+ readonly nullable: true;
71
+ };
72
+ readonly type: {
73
+ readonly type: 'text';
74
+ readonly nullable: true;
75
+ };
76
+ readonly canonicalName: {
77
+ readonly type: 'text';
78
+ readonly nullable: true;
79
+ };
80
+ readonly content: {
81
+ readonly type: 'text';
82
+ readonly nullable: true;
83
+ };
84
+ readonly description: {
85
+ readonly type: 'text';
86
+ readonly nullable: true;
87
+ };
88
+ readonly scope: {
89
+ readonly type: 'jsonb';
90
+ readonly nullable: true;
91
+ };
92
+ readonly scopeKey: {
93
+ readonly type: 'text';
94
+ readonly nullable: true;
95
+ };
96
+ readonly mergedInto: {
97
+ readonly type: 'text';
98
+ readonly nullable: true;
99
+ };
100
+ };
101
+ declare const KNOWLEDGE_V2_RECORDS_SCHEMA: {
102
+ readonly id: {
103
+ readonly type: 'text';
104
+ readonly nullable: false;
105
+ readonly primaryKey: true;
106
+ };
107
+ readonly nodeId: {
108
+ readonly type: 'text';
109
+ readonly nullable: false;
110
+ readonly references: {
111
+ readonly table: "mastra_knowledge_nodes";
112
+ readonly column: 'id';
113
+ };
114
+ };
115
+ readonly text: {
116
+ readonly type: 'text';
117
+ readonly nullable: false;
118
+ };
119
+ readonly metadata: {
120
+ readonly type: 'jsonb';
121
+ readonly nullable: true;
122
+ };
123
+ readonly source: {
124
+ readonly type: 'text';
125
+ readonly nullable: true;
126
+ };
127
+ readonly version: {
128
+ readonly type: 'integer';
129
+ readonly nullable: false;
130
+ };
131
+ readonly createdAt: {
132
+ readonly type: 'timestamp';
133
+ readonly nullable: false;
134
+ };
135
+ readonly updatedAt: {
136
+ readonly type: 'timestamp';
137
+ readonly nullable: false;
138
+ };
139
+ readonly deletedAt: {
140
+ readonly type: 'timestamp';
141
+ readonly nullable: true;
142
+ };
143
+ readonly deletedBy: {
144
+ readonly type: 'text';
145
+ readonly nullable: true;
146
+ };
147
+ readonly node: {
148
+ readonly type: 'text';
149
+ readonly nullable: true;
150
+ };
151
+ readonly scope: {
152
+ readonly type: 'jsonb';
153
+ readonly nullable: true;
154
+ };
155
+ readonly scopeKey: {
156
+ readonly type: 'text';
157
+ readonly nullable: true;
158
+ };
159
+ readonly sourceThreadId: {
160
+ readonly type: 'text';
161
+ readonly nullable: true;
162
+ };
163
+ readonly capturedAt: {
164
+ readonly type: 'timestamp';
165
+ readonly nullable: true;
166
+ };
167
+ readonly when: {
168
+ readonly type: 'timestamp';
169
+ readonly nullable: true;
170
+ };
171
+ readonly maxScope: {
172
+ readonly type: 'text';
173
+ readonly nullable: true;
174
+ };
175
+ };
176
+ declare const KNOWLEDGE_V2_MENTIONS_SCHEMA: {
177
+ readonly recordId: {
178
+ readonly type: 'text';
179
+ readonly nullable: false;
180
+ readonly references: {
181
+ readonly table: "mastra_knowledge_records";
182
+ readonly column: 'id';
183
+ };
184
+ };
185
+ readonly targetNodeId: {
186
+ readonly type: 'text';
187
+ readonly nullable: true;
188
+ readonly references: {
189
+ readonly table: "mastra_knowledge_nodes";
190
+ readonly column: 'id';
191
+ };
192
+ };
193
+ readonly sourceType: {
194
+ readonly type: 'text';
195
+ readonly nullable: true;
196
+ };
197
+ readonly sourceId: {
198
+ readonly type: 'text';
199
+ readonly nullable: true;
200
+ };
201
+ };
202
+ declare const KNOWLEDGE_NODE_SCOPES_SCHEMA: {
203
+ readonly nodeId: {
204
+ readonly type: 'text';
205
+ readonly nullable: false;
206
+ readonly references: {
207
+ readonly table: "mastra_knowledge_nodes";
208
+ readonly column: 'id';
209
+ };
210
+ };
211
+ readonly scopeNodeId: {
212
+ readonly type: 'text';
213
+ readonly nullable: false;
214
+ readonly references: {
215
+ readonly table: "mastra_knowledge_nodes";
216
+ readonly column: 'id';
217
+ };
218
+ };
219
+ readonly addedAt: {
220
+ readonly type: 'timestamp';
221
+ readonly nullable: false;
222
+ };
223
+ };
224
+ declare const KNOWLEDGE_RECORD_SCOPES_SCHEMA: {
225
+ readonly recordId: {
226
+ readonly type: 'text';
227
+ readonly nullable: false;
228
+ readonly references: {
229
+ readonly table: "mastra_knowledge_records";
230
+ readonly column: 'id';
231
+ };
232
+ };
233
+ readonly scopeNodeId: {
234
+ readonly type: 'text';
235
+ readonly nullable: false;
236
+ readonly references: {
237
+ readonly table: "mastra_knowledge_nodes";
238
+ readonly column: 'id';
239
+ };
240
+ };
241
+ readonly addedAt: {
242
+ readonly type: 'timestamp';
243
+ readonly nullable: false;
244
+ };
245
+ };
246
+ declare const KNOWLEDGE_SCOPE_GRANTS_SCHEMA: {
247
+ readonly scopeNodeId: {
248
+ readonly type: 'text';
249
+ readonly nullable: false;
250
+ readonly references: {
251
+ readonly table: "mastra_knowledge_nodes";
252
+ readonly column: 'id';
253
+ };
254
+ };
255
+ readonly scopeRefId: {
256
+ readonly type: 'text';
257
+ readonly nullable: false;
258
+ readonly references: {
259
+ readonly table: "mastra_knowledge_nodes";
260
+ readonly column: 'id';
261
+ };
262
+ };
263
+ readonly role: {
264
+ readonly type: 'text';
265
+ readonly nullable: false;
266
+ };
267
+ readonly canSuggest: {
268
+ readonly type: 'boolean';
269
+ readonly nullable: true;
270
+ };
271
+ };
272
+ declare const KNOWLEDGE_ACCESS_STATE_SCHEMA: {
273
+ readonly id: {
274
+ readonly type: 'text';
275
+ readonly nullable: false;
276
+ readonly primaryKey: true;
277
+ };
278
+ readonly epoch: {
279
+ readonly type: 'integer';
280
+ readonly nullable: false;
281
+ };
282
+ readonly schemaVersion: {
283
+ readonly type: 'integer';
284
+ readonly nullable: false;
285
+ };
286
+ };
287
+ declare const KNOWLEDGE_SCOPE_ADDRESSES_SCHEMA: {
288
+ readonly address: {
289
+ readonly type: 'text';
290
+ readonly nullable: false;
291
+ readonly primaryKey: true;
292
+ };
293
+ readonly scopeNodeId: {
294
+ readonly type: 'text';
295
+ readonly nullable: false;
296
+ readonly references: {
297
+ readonly table: "mastra_knowledge_nodes";
298
+ readonly column: 'id';
299
+ };
300
+ };
301
+ };
302
+ declare const KNOWLEDGE_NODE_ADDRESSES_SCHEMA: {
303
+ readonly source: {
304
+ readonly type: 'text';
305
+ readonly nullable: false;
306
+ };
307
+ readonly address: {
308
+ readonly type: 'text';
309
+ readonly nullable: false;
310
+ };
311
+ readonly nodeId: {
312
+ readonly type: 'text';
313
+ readonly nullable: false;
314
+ readonly references: {
315
+ readonly table: "mastra_knowledge_nodes";
316
+ readonly column: 'id';
317
+ };
318
+ };
319
+ };
320
+ declare const KNOWLEDGE_IMPORT_STATE_SCHEMA: {
321
+ readonly importerId: {
322
+ readonly type: 'text';
323
+ readonly nullable: false;
324
+ };
325
+ readonly binding: {
326
+ readonly type: 'text';
327
+ readonly nullable: false;
328
+ };
329
+ readonly key: {
330
+ readonly type: 'text';
331
+ readonly nullable: false;
332
+ };
333
+ readonly value: {
334
+ readonly type: 'text';
335
+ readonly nullable: false;
336
+ };
337
+ };
338
+ declare const KNOWLEDGE_IMPORT_RUNS_SCHEMA: {
339
+ readonly id: {
340
+ readonly type: 'text';
341
+ readonly nullable: false;
342
+ readonly primaryKey: true;
343
+ };
344
+ readonly importerId: {
345
+ readonly type: 'text';
346
+ readonly nullable: false;
347
+ };
348
+ readonly binding: {
349
+ readonly type: 'text';
350
+ readonly nullable: false;
351
+ };
352
+ readonly importKind: {
353
+ readonly type: 'text';
354
+ readonly nullable: false;
355
+ };
356
+ readonly triggerKind: {
357
+ readonly type: 'text';
358
+ readonly nullable: false;
359
+ };
360
+ readonly status: {
361
+ readonly type: 'text';
362
+ readonly nullable: false;
363
+ };
364
+ readonly error: {
365
+ readonly type: 'text';
366
+ readonly nullable: true;
367
+ };
368
+ readonly transcriptThreadId: {
369
+ readonly type: 'text';
370
+ readonly nullable: true;
371
+ };
372
+ readonly traceId: {
373
+ readonly type: 'text';
374
+ readonly nullable: true;
375
+ };
376
+ readonly queuedAt: {
377
+ readonly type: 'timestamp';
378
+ readonly nullable: false;
379
+ };
380
+ readonly startedAt: {
381
+ readonly type: 'timestamp';
382
+ readonly nullable: true;
383
+ };
384
+ readonly completedAt: {
385
+ readonly type: 'timestamp';
386
+ readonly nullable: true;
387
+ };
388
+ };
389
+ declare const KNOWLEDGE_V2_ACTIVITY_SCHEMA: {
390
+ readonly id: {
391
+ readonly type: 'text';
392
+ readonly nullable: false;
393
+ readonly primaryKey: true;
394
+ };
395
+ readonly action: {
396
+ readonly type: 'text';
397
+ readonly nullable: false;
398
+ };
399
+ readonly targetType: {
400
+ readonly type: 'text';
401
+ readonly nullable: true;
402
+ };
403
+ readonly targetId: {
404
+ readonly type: 'text';
405
+ readonly nullable: true;
406
+ };
407
+ readonly contextScopeId: {
408
+ readonly type: 'text';
409
+ readonly nullable: true;
410
+ readonly references: {
411
+ readonly table: "mastra_knowledge_nodes";
412
+ readonly column: 'id';
413
+ };
414
+ };
415
+ readonly importRunId: {
416
+ readonly type: 'text';
417
+ readonly nullable: true;
418
+ readonly references: {
419
+ readonly table: "mastra_knowledge_import_runs";
420
+ readonly column: 'id';
421
+ };
422
+ };
423
+ readonly details: {
424
+ readonly type: 'jsonb';
425
+ readonly nullable: true;
426
+ };
427
+ readonly createdAt: {
428
+ readonly type: 'timestamp';
429
+ readonly nullable: false;
430
+ };
431
+ readonly recordType: {
432
+ readonly type: 'text';
433
+ readonly nullable: true;
434
+ };
435
+ readonly recordId: {
436
+ readonly type: 'text';
437
+ readonly nullable: true;
438
+ };
439
+ readonly scope: {
440
+ readonly type: 'jsonb';
441
+ readonly nullable: true;
442
+ };
443
+ readonly scopeKey: {
444
+ readonly type: 'text';
445
+ readonly nullable: true;
446
+ };
447
+ readonly sourceThreadId: {
448
+ readonly type: 'text';
449
+ readonly nullable: true;
450
+ };
451
+ };
452
+ declare const KNOWLEDGE_PROPOSALS_SCHEMA: {
453
+ readonly id: {
454
+ readonly type: 'text';
455
+ readonly nullable: false;
456
+ readonly primaryKey: true;
457
+ };
458
+ readonly targetType: {
459
+ readonly type: 'text';
460
+ readonly nullable: false;
461
+ };
462
+ readonly targetId: {
463
+ readonly type: 'text';
464
+ readonly nullable: false;
465
+ };
466
+ readonly action: {
467
+ readonly type: 'text';
468
+ readonly nullable: false;
469
+ };
470
+ readonly changes: {
471
+ readonly type: 'jsonb';
472
+ readonly nullable: false;
473
+ };
474
+ readonly reason: {
475
+ readonly type: 'text';
476
+ readonly nullable: true;
477
+ };
478
+ readonly proposerContextScopeId: {
479
+ readonly type: 'text';
480
+ readonly nullable: false;
481
+ };
482
+ readonly expectedVersion: {
483
+ readonly type: 'integer';
484
+ readonly nullable: false;
485
+ };
486
+ readonly status: {
487
+ readonly type: 'text';
488
+ readonly nullable: false;
489
+ };
490
+ readonly reviewerContextScopeId: {
491
+ readonly type: 'text';
492
+ readonly nullable: true;
493
+ };
494
+ readonly reviewedAt: {
495
+ readonly type: 'timestamp';
496
+ readonly nullable: true;
497
+ };
498
+ readonly createdAt: {
499
+ readonly type: 'timestamp';
500
+ readonly nullable: false;
501
+ };
502
+ };
503
+ type KnowledgeSchemaInspection = {
504
+ status: 'compatible';
505
+ schemaVersion: typeof KNOWLEDGE_STORAGE_SCHEMA_VERSION;
506
+ } | {
507
+ status: 'uninitialized';
508
+ schemaVersion: null;
509
+ } | {
510
+ status: 'incompatible-reset-required';
511
+ schemaVersion: number | null;
512
+ reason: string;
513
+ } | {
514
+ status: 'unavailable';
515
+ schemaVersion: null;
516
+ reason: string;
517
+ };
518
+ interface KnowledgeSchemaSnapshot {
519
+ available: boolean;
520
+ tableNames: readonly string[];
521
+ schemaVersion?: number;
522
+ reason?: string;
523
+ }
524
+ interface KnowledgeV2Core {
525
+ assertKnowledgeDescriptionWithinBound(description: string | undefined): void;
526
+ assertKnowledgeSchemaCompatible(inspection: KnowledgeSchemaInspection): void;
527
+ inspectKnowledgeSchema(snapshot: KnowledgeSchemaSnapshot): KnowledgeSchemaInspection;
528
+ }
529
+ declare function assertKnowledgeV2CoreSupport(features: ReadonlySet<string>): void;
530
+ declare function createKnowledgeV2CoreLoader(features: ReadonlySet<string>, loadStorageModule: () => Promise<unknown>): () => Promise<KnowledgeV2Core>;
531
+ //#endregion
532
+ export { KNOWLEDGE_ACCESS_STATE_SCHEMA, KNOWLEDGE_IMPORT_RUNS_SCHEMA, KNOWLEDGE_IMPORT_STATE_SCHEMA, KNOWLEDGE_NODE_ADDRESSES_SCHEMA, KNOWLEDGE_NODE_SCOPES_SCHEMA, KNOWLEDGE_PROPOSALS_SCHEMA, KNOWLEDGE_RECORD_SCOPES_SCHEMA, KNOWLEDGE_SCOPE_ADDRESSES_SCHEMA, KNOWLEDGE_SCOPE_GRANTS_SCHEMA, KNOWLEDGE_STORAGE_CONTRACT_VERSION, KNOWLEDGE_STORAGE_SCHEMA_VERSION, KNOWLEDGE_TABLE_NAMES, KNOWLEDGE_V2_ACTIVITY_SCHEMA, KNOWLEDGE_V2_CORE_FEATURE, KNOWLEDGE_V2_MENTIONS_SCHEMA, KNOWLEDGE_V2_MINIMUM_CORE_VERSION, KNOWLEDGE_V2_NODES_SCHEMA, KNOWLEDGE_V2_RECORDS_SCHEMA, KnowledgeSchemaInspection, KnowledgeSchemaSnapshot, KnowledgeScopeNodeSummary, MAX_KNOWLEDGE_SCOPE_NODES, TABLE_KNOWLEDGE_ACCESS_STATE, TABLE_KNOWLEDGE_IMPORT_RUNS, TABLE_KNOWLEDGE_IMPORT_STATE, TABLE_KNOWLEDGE_NODE_ADDRESSES, TABLE_KNOWLEDGE_NODE_SCOPES, TABLE_KNOWLEDGE_PROPOSALS, TABLE_KNOWLEDGE_RECORD_SCOPES, TABLE_KNOWLEDGE_SCOPE_ADDRESSES, TABLE_KNOWLEDGE_SCOPE_GRANTS, assertKnowledgeV2CoreSupport, createKnowledgeV2CoreLoader };
533
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"type":"module"}