@mastra/libsql 1.24.0 → 1.24.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.
@@ -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.24.0"
6
+ version: "1.24.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.24.0",
2
+ "version": "1.24.1-alpha.0",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -120,14 +120,12 @@ The function can be asynchronous. For decisions that depend on the tool name and
120
120
 
121
121
  ```typescript
122
122
  import { Classifier } from '@mastra/core/classifier'
123
- import { createTypeSafeAi } from '@ai-sdk/typesafe-ai'
123
+ import { typeSafeAi } from '@ai-sdk/typesafe-ai'
124
124
  import { agent } from './agent'
125
125
 
126
126
  const approvalClassifier = new Classifier({
127
127
  id: 'tool-approval-classifier',
128
- model: createTypeSafeAi({ apiKey: process.env.TYPESAFE_AI_API_KEY }).evaluationModel(
129
- 'jev-latest',
130
- ),
128
+ model: typeSafeAi.evaluationModel('jev-latest'),
131
129
  questions: {
132
130
  requiresApproval: {
133
131
  type: 'boolean',
@@ -60,7 +60,7 @@ The background task worker manages concurrency limits, task lifecycle, and resul
60
60
 
61
61
  ### In-process mode (default)
62
62
 
63
- With no configuration, Mastra creates and starts workers inside the API process. Events flow through an in-memory PubSub, and everything shares a single Node.js runtime.
63
+ With no configuration, Mastra runs workers inside the API process. Events flow through an in-memory PubSub, and everything shares a single Node.js runtime.
64
64
 
65
65
  ```typescript
66
66
  import { Mastra } from '@mastra/core/mastra'
@@ -71,6 +71,8 @@ export const mastra = new Mastra({
71
71
  })
72
72
  ```
73
73
 
74
+ The server generated by `mastra build` starts these workers automatically. If you use a [server adapter](https://mastra.ai/docs/server/server-adapters) instead, add a call to `mastra.startWorkers()` after your server starts listening. See [Start background workers](https://mastra.ai/docs/server/server-adapters).
75
+
74
76
  This setup needs no external infrastructure beyond your storage adapter. It doesn't survive process crashes, and you can't scale individual components.
75
77
 
76
78
  ### Split processes
package/dist/index.cjs CHANGED
@@ -8,7 +8,6 @@ let _mastra_core_vector_filter = require("@mastra/core/vector/filter");
8
8
  let fs_promises = require("fs/promises");
9
9
  let path = require("path");
10
10
  let _mastra_core_base = require("@mastra/core/base");
11
- let crypto$1 = require("crypto");
12
11
  let _mastra_core_agent = require("@mastra/core/agent");
13
12
  let _mastra_core_evals = require("@mastra/core/evals");
14
13
  let _mastra_core_storage_domains_skills = require("@mastra/core/storage/domains/skills");
@@ -9580,7 +9579,7 @@ var MemoryLibSQL = class MemoryLibSQL extends _mastra_core_storage.MemoryStorage
9580
9579
  return;
9581
9580
  }
9582
9581
  const newChunk = {
9583
- id: `ombuf-${(0, crypto$1.randomUUID)()}`,
9582
+ id: `ombuf-${globalThis.crypto.randomUUID()}`,
9584
9583
  cycleId: input.chunk.cycleId,
9585
9584
  observations: input.chunk.observations,
9586
9585
  tokenCount: input.chunk.tokenCount,
@@ -10046,7 +10045,7 @@ var NotificationsLibSQL = class NotificationsLibSQL extends _mastra_core_storage
10046
10045
  }
10047
10046
  const now = input.createdAt ?? /* @__PURE__ */ new Date();
10048
10047
  const record = {
10049
- id: input.id ?? (0, crypto$1.randomUUID)(),
10048
+ id: input.id ?? globalThis.crypto.randomUUID(),
10050
10049
  threadId: input.threadId,
10051
10050
  source: input.source,
10052
10051
  kind: input.kind,
@@ -14351,7 +14350,7 @@ var LibSQLFactoryStorageOps = class {
14351
14350
  const schema = this.#schema(collection);
14352
14351
  const pk = primaryKeyOf(schema);
14353
14352
  const values = { ...row };
14354
- if (schema.columns[pk].type === "uuid-pk" && values[pk] === void 0) values[pk] = (0, crypto$1.randomUUID)();
14353
+ if (schema.columns[pk].type === "uuid-pk" && values[pk] === void 0) values[pk] = globalThis.crypto.randomUUID();
14355
14354
  const columns = Object.keys(values).filter((column) => values[column] !== void 0);
14356
14355
  for (const column of columns) this.#column(schema, column);
14357
14356
  const sql = `INSERT INTO "${schema.name}" (${columns.map((c) => `"${c}"`).join(", ")}) VALUES (${columns.map(() => "?").join(", ")})`;