@mastra/libsql 1.7.3 → 1.7.4-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 +9 -0
- package/dist/docs/SKILL.md +1 -3
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-message-history.md +6 -4
- package/dist/docs/references/docs-memory-overview.md +4 -4
- package/dist/docs/references/docs-memory-semantic-recall.md +28 -19
- package/dist/docs/references/docs-memory-storage.md +4 -4
- package/dist/docs/references/reference-storage-dynamodb.md +1 -1
- package/dist/index.cjs +20 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/datasets/index.d.ts.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/docs/references/docs-observability-overview.md +0 -70
- package/dist/docs/references/docs-observability-tracing-exporters-default.md +0 -209
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.7.4-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added expectedTrajectory support to dataset items across all storage backends and API layer. Dataset items can now store trajectory expectations that define expected agent execution steps, ordering, and constraints for trajectory-based evaluation scoring. ([#14902](https://github.com/mastra-ai/mastra/pull/14902))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`cb15509`](https://github.com/mastra-ai/mastra/commit/cb15509b58f6a83e11b765c945082afc027db972), [`80c5668`](https://github.com/mastra-ai/mastra/commit/80c5668e365470d3a96d3e953868fd7a643ff67c), [`3d478c1`](https://github.com/mastra-ai/mastra/commit/3d478c1e13f17b80f330ac49d7aa42ef929b93ff), [`6039f17`](https://github.com/mastra-ai/mastra/commit/6039f176f9c457304825ff1df8c83b8e457376c0), [`06b928d`](https://github.com/mastra-ai/mastra/commit/06b928dfc2f5630d023467476cc5919dfa858d0a), [`6a8d984`](https://github.com/mastra-ai/mastra/commit/6a8d9841f2933456ee1598099f488d742b600054)]:
|
|
10
|
+
- @mastra/core@1.22.0-alpha.2
|
|
11
|
+
|
|
3
12
|
## 1.7.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
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.7.
|
|
6
|
+
version: "1.7.4-alpha.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -24,8 +24,6 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
24
24
|
- [Semantic recall](references/docs-memory-semantic-recall.md) - Learn how to use semantic recall in Mastra to retrieve relevant messages from past conversations using vector search and embeddings.
|
|
25
25
|
- [Storage](references/docs-memory-storage.md) - Configure storage for Mastra to persist conversations and other runtime state.
|
|
26
26
|
- [Working memory](references/docs-memory-working-memory.md) - Learn how to configure working memory in Mastra to store persistent user data, preferences.
|
|
27
|
-
- [Observability overview](references/docs-observability-overview.md) - Monitor and debug applications with Mastra's Observability features.
|
|
28
|
-
- [Default exporter](references/docs-observability-tracing-exporters-default.md) - Store traces locally for development and debugging
|
|
29
27
|
- [Retrieval, semantic search, reranking](references/docs-rag-retrieval.md) - Guide on retrieval processes in Mastra's RAG systems, including semantic search, filtering, and re-ranking.
|
|
30
28
|
- [Snapshots](references/docs-workflows-snapshots.md) - Learn how to save and resume workflow execution state with snapshots in Mastra
|
|
31
29
|
|
|
@@ -48,7 +48,7 @@ export const mastra = new Mastra({
|
|
|
48
48
|
})
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Instantiate a [`Memory`](https://mastra.ai/reference/memory/memory-class) instance in your agent:
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
54
|
import { Memory } from '@mastra/memory'
|
|
@@ -66,7 +66,7 @@ export const agent = new Agent({
|
|
|
66
66
|
|
|
67
67
|
When you call the agent, messages are automatically saved to the database. You can specify a `threadId`, `resourceId`, and optional `metadata`:
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
**.generate()**:
|
|
70
70
|
|
|
71
71
|
```typescript
|
|
72
72
|
await agent.generate('Hello', {
|
|
@@ -81,7 +81,7 @@ await agent.generate('Hello', {
|
|
|
81
81
|
})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
**.stream()**:
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
87
|
await agent.stream('Hello', {
|
|
@@ -103,12 +103,14 @@ You can use this history in two ways:
|
|
|
103
103
|
- **Automatic inclusion** - Mastra automatically fetches and includes recent messages in the context window. By default, it includes the last 10 messages, keeping agents grounded in the conversation. You can adjust this number with `lastMessages`, but in most cases you don't need to think about it.
|
|
104
104
|
- [**Manual querying**](#querying) - For more control, use the `recall()` function to query threads and messages directly. This lets you choose exactly which memories are included in the context window, or fetch messages to render conversation history in your UI.
|
|
105
105
|
|
|
106
|
+
> **Tip:** When memory is enabled, [Studio](https://mastra.ai/docs/studio/overview) uses message history to display past conversations in the chat sidebar.
|
|
107
|
+
|
|
106
108
|
## Accessing memory
|
|
107
109
|
|
|
108
110
|
To access memory functions for querying, cloning, or deleting threads and messages, call `getMemory()` on an agent:
|
|
109
111
|
|
|
110
112
|
```typescript
|
|
111
|
-
const agent = mastra.
|
|
113
|
+
const agent = mastra.getAgentById('test-agent')
|
|
112
114
|
const memory = await agent.getMemory()
|
|
113
115
|
```
|
|
114
116
|
|
|
@@ -107,7 +107,7 @@ Use memory when your agent needs to maintain multi-turn conversations that refer
|
|
|
107
107
|
|
|
108
108
|
> **Note:** Visit [Memory Class](https://mastra.ai/reference/memory/memory-class) for a full list of configuration options.
|
|
109
109
|
|
|
110
|
-
5. Call your agent, for example in [
|
|
110
|
+
5. Call your agent, for example in [Studio](https://mastra.ai/docs/studio/overview). Inside Studio, start a new chat with your agent and take a look at the right sidebar. It'll now display various memory-related information.
|
|
111
111
|
|
|
112
112
|
## Message history
|
|
113
113
|
|
|
@@ -165,7 +165,7 @@ export const memoryAgent = new Agent({
|
|
|
165
165
|
|
|
166
166
|
## Memory in multi-agent systems
|
|
167
167
|
|
|
168
|
-
When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to a subagent, Mastra isolates subagent memory automatically.
|
|
168
|
+
When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to a subagent, Mastra isolates subagent memory automatically. No flag enables this as it happens on every delegation. Understanding how this scoping works lets you decide what stays private and what to share intentionally.
|
|
169
169
|
|
|
170
170
|
### How delegation scopes memory
|
|
171
171
|
|
|
@@ -175,7 +175,7 @@ Each delegation creates a fresh `threadId` and a deterministic `resourceId` for
|
|
|
175
175
|
- **Resource ID**: Derived as `{parentResourceId}-{agentName}`. Because the resource ID is stable across delegations, resource-scoped memory persists between calls. A subagent remembers facts from previous delegations by the same user.
|
|
176
176
|
- **Memory instance**: If a subagent has no memory configured, it inherits the supervisor's `Memory` instance. If the subagent defines its own, that takes precedence.
|
|
177
177
|
|
|
178
|
-
The supervisor forwards its conversation context to the subagent so it has enough background to complete the task. Only the delegation prompt and the subagent's response are saved — the full parent conversation
|
|
178
|
+
The supervisor forwards its conversation context to the subagent so it has enough background to complete the task. Only the delegation prompt and the subagent's response are saved — the full parent conversation isn't stored. You can control which messages reach the subagent with the [`messageFilter`](https://mastra.ai/docs/agents/supervisor-agents) callback.
|
|
179
179
|
|
|
180
180
|
> **Note:** Subagent resource IDs are always suffixed with the agent name (`{parentResourceId}-{agentName}`). Two different subagents under the same supervisor never share a resource ID through delegation.
|
|
181
181
|
|
|
@@ -206,7 +206,7 @@ Because both calls use `resource: 'project-42'`, the writer can access the resea
|
|
|
206
206
|
|
|
207
207
|
Enable [Tracing](https://mastra.ai/docs/observability/tracing/overview) to monitor and debug memory in action. Traces show you exactly which messages and observations the agent included in its context for each request, helping you understand agent behavior and verify that memory retrieval is working as expected.
|
|
208
208
|
|
|
209
|
-
Open [
|
|
209
|
+
Open [Studio](https://mastra.ai/docs/studio/overview) and select the **Observability** tab in the sidebar. Open the trace of a recent agent request, then look for spans of LLMs calls.
|
|
210
210
|
|
|
211
211
|
## Switch memory per request
|
|
212
212
|
|
|
@@ -18,18 +18,33 @@ After getting a response from the LLM, all new messages (user, assistant, and to
|
|
|
18
18
|
|
|
19
19
|
## Quickstart
|
|
20
20
|
|
|
21
|
-
Semantic recall is
|
|
21
|
+
Semantic recall is disabled by default. To enable it, set `semanticRecall: true` in `options` and provide a `vector` store and `embedder`:
|
|
22
22
|
|
|
23
23
|
```typescript
|
|
24
24
|
import { Agent } from '@mastra/core/agent'
|
|
25
25
|
import { Memory } from '@mastra/memory'
|
|
26
|
+
import { LibSQLStore, LibSQLVector } from '@mastra/libsql'
|
|
27
|
+
import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
26
28
|
|
|
27
29
|
const agent = new Agent({
|
|
28
30
|
id: 'support-agent',
|
|
29
31
|
name: 'SupportAgent',
|
|
30
32
|
instructions: 'You are a helpful support agent.',
|
|
31
33
|
model: 'openai/gpt-5.4',
|
|
32
|
-
memory: new Memory(
|
|
34
|
+
memory: new Memory({
|
|
35
|
+
storage: new LibSQLStore({
|
|
36
|
+
id: 'agent-storage',
|
|
37
|
+
url: 'file:./local.db',
|
|
38
|
+
}),
|
|
39
|
+
vector: new LibSQLVector({
|
|
40
|
+
id: 'agent-vector',
|
|
41
|
+
url: 'file:./local.db',
|
|
42
|
+
}),
|
|
43
|
+
embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
44
|
+
options: {
|
|
45
|
+
semanticRecall: true,
|
|
46
|
+
},
|
|
47
|
+
}),
|
|
33
48
|
})
|
|
34
49
|
```
|
|
35
50
|
|
|
@@ -77,6 +92,9 @@ const agent = new Agent({
|
|
|
77
92
|
id: 'agent-vector',
|
|
78
93
|
url: 'file:./local.db',
|
|
79
94
|
}),
|
|
95
|
+
options: {
|
|
96
|
+
semanticRecall: true,
|
|
97
|
+
},
|
|
80
98
|
}),
|
|
81
99
|
})
|
|
82
100
|
```
|
|
@@ -139,6 +157,9 @@ import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
|
139
157
|
const agent = new Agent({
|
|
140
158
|
memory: new Memory({
|
|
141
159
|
embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
160
|
+
options: {
|
|
161
|
+
semanticRecall: true,
|
|
162
|
+
},
|
|
142
163
|
}),
|
|
143
164
|
})
|
|
144
165
|
```
|
|
@@ -262,26 +283,14 @@ const agent = new Agent({
|
|
|
262
283
|
|
|
263
284
|
For detailed information about index configuration options and performance tuning, see the [PgVector configuration guide](https://mastra.ai/reference/vectors/pg).
|
|
264
285
|
|
|
265
|
-
##
|
|
286
|
+
## Disable semantic recall
|
|
266
287
|
|
|
267
|
-
Semantic recall
|
|
268
|
-
|
|
269
|
-
Semantic recall is enabled by default but can be disabled when not needed:
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
const agent = new Agent({
|
|
273
|
-
memory: new Memory({
|
|
274
|
-
options: {
|
|
275
|
-
semanticRecall: false,
|
|
276
|
-
},
|
|
277
|
-
}),
|
|
278
|
-
})
|
|
279
|
-
```
|
|
288
|
+
Semantic recall is disabled by default (`semanticRecall: false`). Each call adds latency because new messages are converted into embeddings and used to query a vector database before the LLM receives them.
|
|
280
289
|
|
|
281
|
-
|
|
290
|
+
Keep semantic recall disabled when:
|
|
282
291
|
|
|
283
|
-
-
|
|
284
|
-
-
|
|
292
|
+
- Message history provides sufficient context for the current conversation.
|
|
293
|
+
- You're building performance-sensitive applications, like realtime two-way audio, where embedding and vector query latency is noticeable.
|
|
285
294
|
|
|
286
295
|
## Viewing recalled messages
|
|
287
296
|
|
|
@@ -14,7 +14,7 @@ export const mastra = new Mastra({
|
|
|
14
14
|
})
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
> **Sharing the database with
|
|
17
|
+
> **Sharing the database with Studio:** When running `mastra dev` alongside your application (e.g., Next.js), use an absolute path to ensure both processes access the same database:
|
|
18
18
|
>
|
|
19
19
|
> ```typescript
|
|
20
20
|
> url: 'file:/absolute/path/to/your/project/mastra.db'
|
|
@@ -129,7 +129,7 @@ Mastra organizes conversations using two identifiers:
|
|
|
129
129
|
|
|
130
130
|
Both identifiers are required for agents to store information:
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
**.generate()**:
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
135
|
const response = await agent.generate('hello', {
|
|
@@ -140,7 +140,7 @@ const response = await agent.generate('hello', {
|
|
|
140
140
|
})
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
**.stream()**:
|
|
144
144
|
|
|
145
145
|
```typescript
|
|
146
146
|
const stream = await agent.stream('hello', {
|
|
@@ -151,7 +151,7 @@ const stream = await agent.stream('hello', {
|
|
|
151
151
|
})
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
-
> **Note:** [Studio](https://mastra.ai/docs/
|
|
154
|
+
> **Note:** [Studio](https://mastra.ai/docs/studio/overview) automatically generates a thread and resource ID for you. When calling `stream()` or `generate()` yourself, remember to provide these identifiers explicitly.
|
|
155
155
|
|
|
156
156
|
### Thread title generation
|
|
157
157
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The DynamoDB storage implementation provides a scalable and performant NoSQL database solution for Mastra, leveraging a single-table design pattern with [ElectroDB](https://electrodb.dev/).
|
|
4
4
|
|
|
5
|
-
> **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and
|
|
5
|
+
> **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
6
6
|
|
|
7
7
|
> **Item Size Limit:** DynamoDB enforces a **400 KB maximum item size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage.
|
|
8
8
|
|
package/dist/index.cjs
CHANGED
|
@@ -2993,6 +2993,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
2993
2993
|
await this.#addColumnIfNotExists(storage.TABLE_DATASETS, "scorerIds", "TEXT");
|
|
2994
2994
|
await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "requestContext", "TEXT");
|
|
2995
2995
|
await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "source", "TEXT");
|
|
2996
|
+
await this.#addColumnIfNotExists(storage.TABLE_DATASET_ITEMS, "expectedTrajectory", "TEXT");
|
|
2996
2997
|
await this.#client.execute({
|
|
2997
2998
|
sql: `CREATE INDEX IF NOT EXISTS idx_dataset_items_dataset_validto ON "${storage.TABLE_DATASET_ITEMS}" ("datasetId", "validTo")`,
|
|
2998
2999
|
args: []
|
|
@@ -3051,6 +3052,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3051
3052
|
datasetVersion: row.datasetVersion,
|
|
3052
3053
|
input: storage.safelyParseJSON(row.input),
|
|
3053
3054
|
groundTruth: row.groundTruth ? storage.safelyParseJSON(row.groundTruth) : void 0,
|
|
3055
|
+
expectedTrajectory: row.expectedTrajectory ? storage.safelyParseJSON(row.expectedTrajectory) : void 0,
|
|
3054
3056
|
requestContext: row.requestContext ? storage.safelyParseJSON(row.requestContext) : void 0,
|
|
3055
3057
|
metadata: row.metadata ? storage.safelyParseJSON(row.metadata) : void 0,
|
|
3056
3058
|
source: row.source ? storage.safelyParseJSON(row.source) : void 0,
|
|
@@ -3067,6 +3069,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3067
3069
|
isDeleted: Boolean(row.isDeleted),
|
|
3068
3070
|
input: storage.safelyParseJSON(row.input),
|
|
3069
3071
|
groundTruth: row.groundTruth ? storage.safelyParseJSON(row.groundTruth) : void 0,
|
|
3072
|
+
expectedTrajectory: row.expectedTrajectory ? storage.safelyParseJSON(row.expectedTrajectory) : void 0,
|
|
3070
3073
|
requestContext: row.requestContext ? storage.safelyParseJSON(row.requestContext) : void 0,
|
|
3071
3074
|
metadata: row.metadata ? storage.safelyParseJSON(row.metadata) : void 0,
|
|
3072
3075
|
source: row.source ? storage.safelyParseJSON(row.source) : void 0,
|
|
@@ -3326,13 +3329,14 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3326
3329
|
args: [args.datasetId]
|
|
3327
3330
|
},
|
|
3328
3331
|
{
|
|
3329
|
-
sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
|
|
3332
|
+
sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, expectedTrajectory, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
|
|
3330
3333
|
args: [
|
|
3331
3334
|
id,
|
|
3332
3335
|
args.datasetId,
|
|
3333
3336
|
args.datasetId,
|
|
3334
3337
|
jsonbArg(args.input),
|
|
3335
3338
|
jsonbArg(args.groundTruth),
|
|
3339
|
+
jsonbArg(args.expectedTrajectory),
|
|
3336
3340
|
jsonbArg(args.requestContext),
|
|
3337
3341
|
jsonbArg(args.metadata),
|
|
3338
3342
|
jsonbArg(args.source),
|
|
@@ -3354,6 +3358,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3354
3358
|
datasetVersion: newVersion,
|
|
3355
3359
|
input: args.input,
|
|
3356
3360
|
groundTruth: args.groundTruth,
|
|
3361
|
+
expectedTrajectory: args.expectedTrajectory,
|
|
3357
3362
|
requestContext: args.requestContext,
|
|
3358
3363
|
metadata: args.metadata,
|
|
3359
3364
|
source: args.source,
|
|
@@ -3394,11 +3399,12 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3394
3399
|
const versionId = crypto.randomUUID();
|
|
3395
3400
|
const now = /* @__PURE__ */ new Date();
|
|
3396
3401
|
const nowIso = now.toISOString();
|
|
3397
|
-
const mergedInput = args.input
|
|
3398
|
-
const mergedGroundTruth = args.groundTruth
|
|
3399
|
-
const
|
|
3400
|
-
const
|
|
3401
|
-
const
|
|
3402
|
+
const mergedInput = args.input !== void 0 ? args.input : existing.input;
|
|
3403
|
+
const mergedGroundTruth = args.groundTruth !== void 0 ? args.groundTruth : existing.groundTruth;
|
|
3404
|
+
const mergedExpectedTrajectory = args.expectedTrajectory !== void 0 ? args.expectedTrajectory : existing.expectedTrajectory;
|
|
3405
|
+
const mergedRequestContext = args.requestContext !== void 0 ? args.requestContext : existing.requestContext;
|
|
3406
|
+
const mergedMetadata = args.metadata !== void 0 ? args.metadata : existing.metadata;
|
|
3407
|
+
const mergedSource = args.source !== void 0 ? args.source : existing.source;
|
|
3402
3408
|
const results = await this.#client.batch(
|
|
3403
3409
|
[
|
|
3404
3410
|
{
|
|
@@ -3410,13 +3416,14 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3410
3416
|
args: [args.datasetId, args.id]
|
|
3411
3417
|
},
|
|
3412
3418
|
{
|
|
3413
|
-
sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
|
|
3419
|
+
sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, expectedTrajectory, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
|
|
3414
3420
|
args: [
|
|
3415
3421
|
args.id,
|
|
3416
3422
|
args.datasetId,
|
|
3417
3423
|
args.datasetId,
|
|
3418
3424
|
jsonbArg(mergedInput),
|
|
3419
3425
|
jsonbArg(mergedGroundTruth),
|
|
3426
|
+
jsonbArg(mergedExpectedTrajectory),
|
|
3420
3427
|
jsonbArg(mergedRequestContext),
|
|
3421
3428
|
jsonbArg(mergedMetadata),
|
|
3422
3429
|
jsonbArg(mergedSource),
|
|
@@ -3437,6 +3444,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3437
3444
|
datasetVersion: newVersion,
|
|
3438
3445
|
input: mergedInput,
|
|
3439
3446
|
groundTruth: mergedGroundTruth,
|
|
3447
|
+
expectedTrajectory: mergedExpectedTrajectory,
|
|
3440
3448
|
requestContext: mergedRequestContext,
|
|
3441
3449
|
metadata: mergedMetadata,
|
|
3442
3450
|
source: mergedSource,
|
|
@@ -3768,13 +3776,14 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3768
3776
|
const id = crypto.randomUUID();
|
|
3769
3777
|
items.push({ id, input: itemInput });
|
|
3770
3778
|
statements.push({
|
|
3771
|
-
sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
|
|
3779
|
+
sql: `INSERT INTO ${storage.TABLE_DATASET_ITEMS} (id, datasetId, datasetVersion, validTo, isDeleted, input, groundTruth, expectedTrajectory, requestContext, metadata, source, createdAt, updatedAt) VALUES (?, ?, (SELECT version FROM ${storage.TABLE_DATASETS} WHERE id = ?), NULL, 0, jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), jsonb(?), ?, ?)`,
|
|
3772
3780
|
args: [
|
|
3773
3781
|
id,
|
|
3774
3782
|
input.datasetId,
|
|
3775
3783
|
input.datasetId,
|
|
3776
3784
|
jsonbArg(itemInput.input),
|
|
3777
3785
|
jsonbArg(itemInput.groundTruth),
|
|
3786
|
+
jsonbArg(itemInput.expectedTrajectory),
|
|
3778
3787
|
jsonbArg(itemInput.requestContext),
|
|
3779
3788
|
jsonbArg(itemInput.metadata),
|
|
3780
3789
|
jsonbArg(itemInput.source),
|
|
@@ -3795,6 +3804,7 @@ var DatasetsLibSQL = class extends storage.DatasetsStorage {
|
|
|
3795
3804
|
datasetVersion: newVersion,
|
|
3796
3805
|
input: itemInput.input,
|
|
3797
3806
|
groundTruth: itemInput.groundTruth,
|
|
3807
|
+
expectedTrajectory: itemInput.expectedTrajectory,
|
|
3798
3808
|
requestContext: itemInput.requestContext,
|
|
3799
3809
|
metadata: itemInput.metadata,
|
|
3800
3810
|
source: itemInput.source,
|
|
@@ -7063,7 +7073,8 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
7063
7073
|
lastObservedAt: input.chunk.lastObservedAt,
|
|
7064
7074
|
createdAt: /* @__PURE__ */ new Date(),
|
|
7065
7075
|
suggestedContinuation: input.chunk.suggestedContinuation,
|
|
7066
|
-
currentTask: input.chunk.currentTask
|
|
7076
|
+
currentTask: input.chunk.currentTask,
|
|
7077
|
+
threadTitle: input.chunk.threadTitle
|
|
7067
7078
|
};
|
|
7068
7079
|
const newChunks = [...existingChunks, newChunk];
|
|
7069
7080
|
const lastBufferedAtTime = input.lastBufferedAtTime ? input.lastBufferedAtTime.toISOString() : null;
|