@mastra/libsql 1.24.0-alpha.1 → 1.24.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
CHANGED
|
@@ -120,12 +120,14 @@ 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 {
|
|
123
|
+
import { createTypeSafeAi } 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
|
|
128
|
+
model: createTypeSafeAi({ apiKey: process.env.TYPESAFE_AI_API_KEY }).evaluationModel(
|
|
129
|
+
'jev-latest',
|
|
130
|
+
),
|
|
129
131
|
questions: {
|
|
130
132
|
requiresApproval: {
|
|
131
133
|
type: 'boolean',
|
package/dist/index.cjs
CHANGED
|
@@ -424,9 +424,14 @@ function handleLogicalOperator(key, value, parentPath) {
|
|
|
424
424
|
}
|
|
425
425
|
const values = [];
|
|
426
426
|
const joinOperator = key === "$or" || key === "$nor" ? "OR" : "AND";
|
|
427
|
-
const joined = (Array.isArray(value) ? value.
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
const joined = (Array.isArray(value) ? value.flatMap((f) => {
|
|
428
|
+
const branch = (!!f ? Object.entries(f) : []).map(([k, v]) => buildCondition$1(k, v, key));
|
|
429
|
+
if (branch.length <= 1) return branch;
|
|
430
|
+
return [{
|
|
431
|
+
sql: `(${branch.map((c) => c.sql).join(" AND ")})`,
|
|
432
|
+
values: branch.flatMap((c) => c.values)
|
|
433
|
+
}];
|
|
434
|
+
}) : [buildCondition$1(key, value, parentPath)]).map((c) => {
|
|
430
435
|
values.push(...c.values);
|
|
431
436
|
return c.sql;
|
|
432
437
|
}).join(` ${joinOperator} `);
|