import { Column, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'; // Guild-global slash-command catalog. One row per guild (this node's // FABRIC_BACKEND_GUILD_NODE_ID). The OpenClaw plugin PUTs the OpenClaw // native-command specs here (the same data Discord registers as slash // commands); the frontend GETs it to drive `/` autocomplete. The guild // node stores the catalog opaquely — it does not interpret command bodies. @Entity('guild_commands') export class GuildCommand { @PrimaryGeneratedColumn('uuid') id!: string; @Index({ unique: true }) @Column({ name: 'guild_id', type: 'varchar', length: 80 }) guildId!: string; // NativeCommandSpec[]-shaped (name, nativeName, description, acceptsArgs, // args[{name,description,type,required,choices:[{value,label}], // captureRemaining,preferAutocomplete}], argsParsing). Stored verbatim. @Column({ type: 'json' }) commands!: unknown[]; @UpdateDateColumn() updatedAt!: Date; }