mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 20:04:55 +00:00
Fix NodeJS compat
This commit is contained in:
parent
e2d23a5abb
commit
197259c88a
19 changed files with 110 additions and 99 deletions
|
|
@ -1,6 +1,11 @@
|
|||
import { type Static, Type } from "@sinclair/typebox";
|
||||
import Ajv from "ajv";
|
||||
import addFormats from "ajv-formats";
|
||||
import AjvModule from "ajv";
|
||||
import addFormatsModule from "ajv-formats";
|
||||
|
||||
// Handle both default and named exports
|
||||
const Ajv = (AjvModule as any).default || AjvModule;
|
||||
const addFormats = (addFormatsModule as any).default || addFormatsModule;
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { AgentTool } from "../src/agent/types.js";
|
||||
|
||||
|
|
@ -98,7 +103,7 @@ describe("Tool Validation with TypeBox and AJV", () => {
|
|||
|
||||
if (validate.errors) {
|
||||
const errors = validate.errors
|
||||
.map((err) => {
|
||||
.map((err: any) => {
|
||||
const path = err.instancePath ? err.instancePath.substring(1) : err.params.missingProperty || "root";
|
||||
return ` - ${path}: ${err.message}`;
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue