feat(guild-discovery): add purpose column to guild_nodes + cli set-purpose

Adds a free-form 'purpose' text field on GuildNode so admins can describe
what each guild is for (debate broadcasts / agent triage / dev sandbox /
etc.). Surfaced through:

  - GET /api/auth/me/guilds   (existing user-facing list)
  - GET /api/nodes             (existing admin-facing list)
  - new cli: node set-purpose --node-id X --purpose 'text'

Admin-only writes via CLI (HangmanLab pattern) — never HTTP. Empty string
clears. TypeORM synchronize auto-adds the column on first startup.

Motivates: agents discover the right guild by intent (purpose substring
match) before picking a channel, so dialectic/announce workflows don't
need hardcoded guild ids.
This commit is contained in:
h z
2026-05-23 19:21:49 +01:00
parent ca7c6b408e
commit 604f6556fe
5 changed files with 45 additions and 1 deletions

View File

@@ -20,6 +20,15 @@ export class GuildNode {
@Column()
endpoint!: string;
// Free-form description of this guild's purpose — what it's used for,
// who its agents/users serve. Surfaced to agents via /auth/me/guilds so
// the cross-guild/cross-channel announce-target picker can find the
// right guild by intent ("which guild is about debate broadcasts?")
// without anything hard-coded into agent workflows. admin-only write
// (cli: `node set-purpose --node-id X --purpose Y`).
@Column({ type: 'text', nullable: true })
purpose!: string | null;
@Column({ type: 'varchar', length: 255, nullable: true })
apiKeyHash!: string | null;