Revert "Upgrade linter and formatter to Ultracite" (#1226)

This commit is contained in:
josh 2025-09-21 12:03:29 +01:00 committed by GitHub
parent 0e320b391d
commit 1aff7d9868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
177 changed files with 8334 additions and 6943 deletions

View file

@ -1,22 +1,22 @@
import { tool, type UIMessageStreamWriter } from "ai";
import type { Session } from "next-auth";
import { z } from "zod";
import { generateUUID } from '@/lib/utils';
import { tool, type UIMessageStreamWriter } from 'ai';
import { z } from 'zod';
import type { Session } from 'next-auth';
import {
artifactKinds,
documentHandlersByArtifactKind,
} from "@/lib/artifacts/server";
import type { ChatMessage } from "@/lib/types";
import { generateUUID } from "@/lib/utils";
} from '@/lib/artifacts/server';
import type { ChatMessage } from '@/lib/types';
type CreateDocumentProps = {
interface CreateDocumentProps {
session: Session;
dataStream: UIMessageStreamWriter<ChatMessage>;
};
}
export const createDocument = ({ session, dataStream }: CreateDocumentProps) =>
tool({
description:
"Create a document for a writing or content creation activities. This tool will call other functions that will generate the contents of the document based on the title and kind.",
'Create a document for a writing or content creation activities. This tool will call other functions that will generate the contents of the document based on the title and kind.',
inputSchema: z.object({
title: z.string(),
kind: z.enum(artifactKinds),
@ -25,32 +25,32 @@ export const createDocument = ({ session, dataStream }: CreateDocumentProps) =>
const id = generateUUID();
dataStream.write({
type: "data-kind",
type: 'data-kind',
data: kind,
transient: true,
});
dataStream.write({
type: "data-id",
type: 'data-id',
data: id,
transient: true,
});
dataStream.write({
type: "data-title",
type: 'data-title',
data: title,
transient: true,
});
dataStream.write({
type: "data-clear",
type: 'data-clear',
data: null,
transient: true,
});
const documentHandler = documentHandlersByArtifactKind.find(
(documentHandlerByArtifactKind) =>
documentHandlerByArtifactKind.kind === kind
documentHandlerByArtifactKind.kind === kind,
);
if (!documentHandler) {
@ -64,13 +64,13 @@ export const createDocument = ({ session, dataStream }: CreateDocumentProps) =>
session,
});
dataStream.write({ type: "data-finish", data: null, transient: true });
dataStream.write({ type: 'data-finish', data: null, transient: true });
return {
id,
title,
kind,
content: "A document was created and is now visible to the user.",
content: 'A document was created and is now visible to the user.',
};
},
});