feat: basic admin interface

This commit is contained in:
Zoe
2026-10-08 13:41:02 -05:00
parent 7b0800882a
commit f6e1bc1f47
27 changed files with 4095 additions and 49 deletions
@@ -0,0 +1,5 @@
CREATE TABLE "instance_settings" (
"id" text PRIMARY KEY,
"registration" text DEFAULT 'open' NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
File diff suppressed because it is too large Load Diff
+13
View File
@@ -25,6 +25,19 @@ export enum ToolCallType {
Json = 'json',
}
export const REGISTRATION_MODES = ['open', 'invite', 'closed'] as const;
export type RegistrationMode = typeof REGISTRATION_MODES[number];
export const INSTANCE_SETTINGS_ID = 'instance';
// Settings of the whole instance, changed by admins. There is only ever the
// one row with the id above.
export const instanceSettings = pgTable('instance_settings', {
id: text('id').primaryKey(),
registration: text('registration').$type<RegistrationMode>().notNull().default('open'),
updatedAt: timestamptz('updated_at').notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()),
});
export const settings = pgTable('settings', {
id: text('id').primaryKey().$defaultFn(nanoid),
userId: text('user_id').notNull(),