Error: Unsupported Schema Transformation in Effect Typescript Library

For some reason, after adding this additional tool to an AI toolset:

class CreateContactFact
  extends Schema.TaggedRequest<CreateContactFact>()('CreateContactFact', {
    payload: {
      contactId: Schema.String.annotations({
        description: 'The contact ID to create a fact for',
      }),
      fact: Schema.String.annotations({
        description:
          'The fact about this person you want to store for future reference. This can be anything such as likings, sentences, etc.',
      }),
    },
    success: Schema.String,
    failure: FactAdditionError,
  }, {
    description: 'Create a fact for a contact',
  })
{}

export const MessageTools = AiToolkit
  .empty
  .add(GetMessagesFromChat)
  .add(CreateContactFact); // <-- This is the new one

I'm starting to get this error:
› bun src/scratch.ts
2055 |     case "Transformation":
2056 |       {
2057 |         if (isTypeLiteralTransformation(ast.transformation) && ast.transformation.propertySignatureTransformations.every(isRenamingPropertySignatureTransformation)) {
2058 |           return new Transformation(partial(ast.from, options), partial(ast.to, options), ast.transformation);
2059 |         }
2060 |         throw new Error(errors_.getASTUnsupportedSchemaErrorMessage(ast));
                     ^
error: Unsupported schema
schema (Transformation): (Struct (Encoded side) <-> Struct (Type side))
      at partial (/Users/danielo/GIT/whatsapp-family/node_modules/effect/dist/esm/SchemaAST.js:2060:15)
      at partial (/Users/danielo/GIT/whatsapp-family/node_modules/effect/dist/esm/Schema.js:1488:41)
      at /Users/danielo/GIT/whatsapp-family/src/core/contact/ContactData.ts:79:41
      at loadAndEvaluateModule (2:1)

Bun v1.2.11 (macOS arm64)

Any Idea of what is wrong with? There are no type errors
Was this page helpful?