schema

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package schema defines the Ent schemas for the team (multi-user) system of record. PostgreSQL-only: citext columns and row-level security policies (applied by team/store migrations) assume Postgres.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ent.Schema
}

Agent is a first-class, named configuration: a persona/model bound to a subset of the deployment's available skills and its own agent-scoped secrets (INIT-OMNIAGENT-004). Owners and maintainers (AgentRole) configure it; conversing with it (via Chat) never grants configuration rights.

func (Agent) Edges

func (Agent) Edges() []ent.Edge

Edges of the Agent.

func (Agent) Fields

func (Agent) Fields() []ent.Field

Fields of the Agent.

type AgentRole

type AgentRole struct {
	ent.Schema
}

AgentRole is a user's per-agent role: owner (creator or assignee, full control incl. maintainers) or maintainer (added by an owner; everything except managing other maintainers). Per-agent roles are independent of chat membership — being in a group chat with an agent never implies a row here (PRD: "conversing with an agent never confers the right to configure it").

func (AgentRole) Edges

func (AgentRole) Edges() []ent.Edge

Edges of the AgentRole.

func (AgentRole) Fields

func (AgentRole) Fields() []ent.Field

Fields of the AgentRole.

func (AgentRole) Indexes

func (AgentRole) Indexes() []ent.Index

Indexes of the AgentRole.

type AgentSkill

type AgentSkill struct {
	ent.Schema
}

AgentSkill is one skill enabled on an agent. The enabled set must be a subset of the deployment's available-skills catalog (TRD section 5); this table only records the membership.

func (AgentSkill) Edges

func (AgentSkill) Edges() []ent.Edge

Edges of the AgentSkill.

func (AgentSkill) Fields

func (AgentSkill) Fields() []ent.Field

Fields of the AgentSkill.

func (AgentSkill) Indexes

func (AgentSkill) Indexes() []ent.Index

Indexes of the AgentSkill.

type AllowlistEntry

type AllowlistEntry struct {
	ent.Schema
}

AllowlistEntry is an email the superadmin has approved for login. Signup is closed: no allowlist entry (and not the configured superadmin email) means no magic link is ever issued.

func (AllowlistEntry) Annotations

func (AllowlistEntry) Annotations() []schema.Annotation

Annotations of the AllowlistEntry.

func (AllowlistEntry) Edges

func (AllowlistEntry) Edges() []ent.Edge

Edges of the AllowlistEntry.

func (AllowlistEntry) Fields

func (AllowlistEntry) Fields() []ent.Field

Fields of the AllowlistEntry.

type AuthSession

type AuthSession struct {
	ent.Schema
}

AuthSession is a server-side login session backing the browser cookie. Only the SHA-256 hash of the cookie token is stored.

func (AuthSession) Edges

func (AuthSession) Edges() []ent.Edge

Edges of the AuthSession.

func (AuthSession) Fields

func (AuthSession) Fields() []ent.Field

Fields of the AuthSession.

type Chat

type Chat struct {
	ent.Schema
}

Chat is a conversation: each member's private chat with the agent, or a group chat with multiple members where the agent replies on @-mention.

func (Chat) Edges

func (Chat) Edges() []ent.Edge

Edges of the Chat.

func (Chat) Fields

func (Chat) Fields() []ent.Field

Fields of the Chat.

func (Chat) Indexes

func (Chat) Indexes() []ent.Index

Indexes of the Chat.

type ChatMember

type ChatMember struct {
	ent.Schema
}

ChatMember is a user's membership in a chat. Uniqueness of (chat_id, user_id) enforces one membership row per user per chat.

func (ChatMember) Edges

func (ChatMember) Edges() []ent.Edge

Edges of the ChatMember.

func (ChatMember) Fields

func (ChatMember) Fields() []ent.Field

Fields of the ChatMember.

func (ChatMember) Indexes

func (ChatMember) Indexes() []ent.Index

Indexes of the ChatMember.

type Identity

type Identity struct {
	ent.Schema
}

Identity links a login provider identity to a user. A user may hold several (magic link plus SSO providers).

func (Identity) Edges

func (Identity) Edges() []ent.Edge

Edges of the Identity.

func (Identity) Fields

func (Identity) Fields() []ent.Field

Fields of the Identity.

func (Identity) Indexes

func (Identity) Indexes() []ent.Index

Indexes of the Identity.

type MagicLinkToken

type MagicLinkToken struct {
	ent.Schema
}

MagicLinkToken is a single-use, expiring login token. Only the SHA-256 hash is stored; the raw token exists solely in the emailed link. Row-level security restricts this table to the system (auth-layer) context.

func (MagicLinkToken) Fields

func (MagicLinkToken) Fields() []ent.Field

Fields of the MagicLinkToken.

type Message

type Message struct {
	ent.Schema
}

Message is one message in a chat, authored by a member or by the agent. Messages are immutable at v1: no update or delete policies exist.

func (Message) Edges

func (Message) Edges() []ent.Edge

Edges of the Message.

func (Message) Fields

func (Message) Fields() []ent.Field

Fields of the Message.

func (Message) Indexes

func (Message) Indexes() []ent.Index

Indexes of the Message.

type User

type User struct {
	ent.Schema
}

User holds team members and the superadmin.

func (User) Edges

func (User) Edges() []ent.Edge

Edges of the User.

func (User) Fields

func (User) Fields() []ent.Field

Fields of the User.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL