The verbatim-module-syntax lint rule was correctly flagging that GraphConfig is only used in a type position (typeof GraphConfig). Since typeof resolves purely at the type level, import type works fine here and is the correct form. No lint exclusion needed. Also: deno fmt across all files (markdown line wrapping).
31 lines
1023 B
TypeScript
31 lines
1023 B
TypeScript
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
import { createInsertSchema, createSelectSchema } from "@alkdev/drizzlebox";
|
|
import { type Static, Type } from "@alkdev/typebox";
|
|
import { ACTOR_TYPE, commonCols } from "./common.ts";
|
|
|
|
export const actors = sqliteTable("actors", {
|
|
...commonCols,
|
|
name: text("name").notNull(),
|
|
type: text("type", { enum: ["human", "llm", "agent"] }).notNull(),
|
|
});
|
|
|
|
export const SelectActor = createSelectSchema(actors, {
|
|
metadata: Type.Object({}, { additionalProperties: true }),
|
|
createdAt: Type.Date(),
|
|
updatedAt: Type.Date(),
|
|
});
|
|
|
|
export type SelectActor = Static<typeof SelectActor>;
|
|
|
|
export const InsertActor = createInsertSchema(actors, {
|
|
name: Type.String({ minLength: 1, maxLength: 255 }),
|
|
type: Type.Union([
|
|
Type.Literal(ACTOR_TYPE.Human),
|
|
Type.Literal(ACTOR_TYPE.Llm),
|
|
Type.Literal(ACTOR_TYPE.Agent),
|
|
]),
|
|
metadata: Type.Optional(Type.Object({}, { additionalProperties: true })),
|
|
});
|
|
|
|
export type InsertActor = Static<typeof InsertActor>;
|