mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
1680316c7f
* refactor(agent): replace TypeScript agent gateway with in-process Go agent using twilight-ai SDK
- Remove apps/agent (Bun/Elysia gateway), packages/agent (@memoh/agent),
internal/bun runtime manager, and all embedded agent/bun assets
- Add internal/agent package powered by twilight-ai SDK for LLM calls,
tool execution, streaming, sential logic, tag extraction, and prompts
- Integrate ToolGatewayService in-process for both built-in and user MCP
tools, eliminating HTTP round-trips to the old gateway
- Update resolver to convert between sdk.Message and ModelMessage at the
boundary (resolver_messages.go), keeping agent package free of
persistence concerns
- Prepend user message before storeRound since SDK only returns output
messages (assistant + tool)
- Clean up all Docker configs, TOML configs, nginx proxy, Dockerfile.agent,
and Go config structs related to the removed agent gateway
- Update cmd/agent and cmd/memoh entry points with setter-based
ToolGateway injection to avoid FX dependency cycles
* fix(web): move form declaration before computed properties that reference it
The `form` reactive object was declared after computed properties like
`selectedMemoryProvider` and `isSelectedMemoryProviderPersisted` that
reference it, causing a TDZ ReferenceError during setup.
* fix: prevent UTF-8 character corruption in streaming text output
StreamTagExtractor.Push() used byte-level string slicing to hold back
buffer tails for tag detection, which could split multi-byte UTF-8
characters. After json.Marshal replaced invalid bytes with U+FFFD,
the corruption became permanent — causing garbled CJK characters (�)
in agent responses.
Add safeUTF8SplitIndex() to back up split points to valid character
boundaries. Also fix byte-level truncation in command/formatter.go
and command/fs.go to use rune-aware slicing.
* fix: add agent error logging and fix Gemini tool schema validation
- Log agent stream errors in both SSE and WebSocket paths with bot/model context
- Fix send tool `attachments` parameter: empty `items` schema rejected by
Google Gemini API (INVALID_ARGUMENT), now specifies `{"type": "string"}`
- Upgrade twilight-ai to d898f0b (includes raw body in API error messages)
* chore(ci): remove agent gateway from Docker build and release pipelines
Agent gateway has been replaced by in-process Go agent; remove the
obsolete Docker image matrix entry, Bun/UPX CI steps, and agent-binary
build logic from the release script.
* fix: preserve attachment filename, metadata, and container path through persistence
- Add `name` column to `bot_history_message_assets` (migration 0034) to
persist original filenames across page refreshes.
- Add `metadata` JSONB column (migration 0035) to store source_path,
source_url, and other context alongside each asset.
- Update SQL queries, sqlc-generated code, and all Go types (MessageAsset,
AssetRef, OutboundAssetRef, FileAttachment) to carry name and metadata
through the full lifecycle.
- Extract filenames from path/URL in AttachmentsResolver before clearing
raw paths; enrich streaming event metadata with name, source_path, and
source_url in both the WebSocket and channel inbound ingestion paths.
- Implement `LinkAssets` on message service and `LinkOutboundAssets` on
flow resolver so WebSocket-streamed bot attachments are persisted to the
correct assistant message after streaming completes.
- Frontend: update MessageAsset type with metadata field, pass metadata
through to attachment items, and reorder attachment-block.vue template
so container files (identified by metadata.source_path) open in the
sidebar file manager instead of triggering a download.
* refactor(agent): decouple built-in tools from MCP, load via ToolProvider interface
Migrate all 13 built-in tool providers from internal/mcp/providers/ to
internal/agent/tools/ using the twilight-ai sdk.Tool structure. The agent
now loads tools through a ToolProvider interface instead of the MCP
ToolGatewayService, which is simplified to only manage external federation
sources. This enables selective tool loading and removes the coupling
between business tools and the MCP protocol layer.
* refactor(flow): split monolithic resolver.go into focused modules
Break the 1959-line resolver.go into 12 files organized by concern:
- resolver.go: core orchestration (Resolver struct, resolve, Chat, prepareRunConfig)
- resolver_stream.go: streaming (StreamChat, StreamChatWS, tryStoreStream)
- resolver_trigger.go: schedule/heartbeat triggers
- resolver_attachments.go: attachment routing, inlining, encoding
- resolver_history.go: message loading, deduplication, token trimming
- resolver_store.go: persistence (storeRound, storeMessages, asset linking)
- resolver_memory.go: memory provider integration
- resolver_model_selection.go: model selection and candidate matching
- resolver_identity.go: display name and channel identity resolution
- resolver_settings.go: bot settings, loop detection, inbox
- user_header.go: YAML front-matter formatting
- resolver_util.go: shared utilities (sanitize, normalize, dedup, UUID)
* fix(agent): enable Anthropic extended thinking by passing ReasoningConfig to provider
Anthropic's thinking requires WithThinking() at provider creation time,
unlike OpenAI which uses per-request ReasoningEffort. The config was
never wired through, so Claude models could not trigger thinking.
* refactor(agent): extract prompts into embedded markdown templates
Move inline prompt strings from prompt.go into separate .md files under
internal/agent/prompts/, using {{key}} placeholders and a simple render
engine. Remove obsolete SystemPromptParams fields (Language,
MaxContextLoadTime, Channels, CurrentChannel) and their call-site usage.
* fix: lint
462 lines
20 KiB
Go
462 lines
20 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type Bot struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
OwnerUserID pgtype.UUID `json:"owner_user_id"`
|
|
DisplayName pgtype.Text `json:"display_name"`
|
|
AvatarUrl pgtype.Text `json:"avatar_url"`
|
|
IsActive bool `json:"is_active"`
|
|
Status string `json:"status"`
|
|
MaxContextLoadTime int32 `json:"max_context_load_time"`
|
|
MaxContextTokens int32 `json:"max_context_tokens"`
|
|
Language string `json:"language"`
|
|
ReasoningEnabled bool `json:"reasoning_enabled"`
|
|
ReasoningEffort string `json:"reasoning_effort"`
|
|
MaxInboxItems int32 `json:"max_inbox_items"`
|
|
ChatModelID pgtype.UUID `json:"chat_model_id"`
|
|
SearchProviderID pgtype.UUID `json:"search_provider_id"`
|
|
MemoryProviderID pgtype.UUID `json:"memory_provider_id"`
|
|
HeartbeatEnabled bool `json:"heartbeat_enabled"`
|
|
HeartbeatInterval int32 `json:"heartbeat_interval"`
|
|
HeartbeatPrompt string `json:"heartbeat_prompt"`
|
|
HeartbeatModelID pgtype.UUID `json:"heartbeat_model_id"`
|
|
TtsModelID pgtype.UUID `json:"tts_model_id"`
|
|
BrowserContextID pgtype.UUID `json:"browser_context_id"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type BotAclRule struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
Action string `json:"action"`
|
|
Effect string `json:"effect"`
|
|
SubjectKind string `json:"subject_kind"`
|
|
UserID pgtype.UUID `json:"user_id"`
|
|
ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
|
|
SourceChannel pgtype.Text `json:"source_channel"`
|
|
SourceConversationType pgtype.Text `json:"source_conversation_type"`
|
|
SourceConversationID pgtype.Text `json:"source_conversation_id"`
|
|
SourceThreadID pgtype.Text `json:"source_thread_id"`
|
|
CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type BotChannelConfig struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
ChannelType string `json:"channel_type"`
|
|
Credentials []byte `json:"credentials"`
|
|
ExternalIdentity pgtype.Text `json:"external_identity"`
|
|
SelfIdentity []byte `json:"self_identity"`
|
|
Routing []byte `json:"routing"`
|
|
Capabilities []byte `json:"capabilities"`
|
|
Disabled bool `json:"disabled"`
|
|
VerifiedAt pgtype.Timestamptz `json:"verified_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type BotChannelRoute struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
ChannelType string `json:"channel_type"`
|
|
ChannelConfigID pgtype.UUID `json:"channel_config_id"`
|
|
ExternalConversationID string `json:"external_conversation_id"`
|
|
ExternalThreadID pgtype.Text `json:"external_thread_id"`
|
|
ConversationType pgtype.Text `json:"conversation_type"`
|
|
DefaultReplyTarget pgtype.Text `json:"default_reply_target"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type BotEmailBinding struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
EmailProviderID pgtype.UUID `json:"email_provider_id"`
|
|
EmailAddress string `json:"email_address"`
|
|
CanRead bool `json:"can_read"`
|
|
CanWrite bool `json:"can_write"`
|
|
CanDelete bool `json:"can_delete"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type BotHeartbeatLog struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
Status string `json:"status"`
|
|
ResultText string `json:"result_text"`
|
|
ErrorMessage string `json:"error_message"`
|
|
Usage []byte `json:"usage"`
|
|
ModelID pgtype.UUID `json:"model_id"`
|
|
StartedAt pgtype.Timestamptz `json:"started_at"`
|
|
CompletedAt pgtype.Timestamptz `json:"completed_at"`
|
|
}
|
|
|
|
type BotHistoryMessage struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
RouteID pgtype.UUID `json:"route_id"`
|
|
SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
|
|
SenderAccountUserID pgtype.UUID `json:"sender_account_user_id"`
|
|
ChannelType pgtype.Text `json:"channel_type"`
|
|
SourceMessageID pgtype.Text `json:"source_message_id"`
|
|
SourceReplyToMessageID pgtype.Text `json:"source_reply_to_message_id"`
|
|
Role string `json:"role"`
|
|
Content []byte `json:"content"`
|
|
Metadata []byte `json:"metadata"`
|
|
Usage []byte `json:"usage"`
|
|
ModelID pgtype.UUID `json:"model_id"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type BotHistoryMessageAsset struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
MessageID pgtype.UUID `json:"message_id"`
|
|
Role string `json:"role"`
|
|
Ordinal int32 `json:"ordinal"`
|
|
ContentHash string `json:"content_hash"`
|
|
Name string `json:"name"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type BotInbox struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
Source string `json:"source"`
|
|
Header []byte `json:"header"`
|
|
Content string `json:"content"`
|
|
Action string `json:"action"`
|
|
IsRead bool `json:"is_read"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
ReadAt pgtype.Timestamptz `json:"read_at"`
|
|
}
|
|
|
|
type BotStorageBinding struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
StorageProviderID pgtype.UUID `json:"storage_provider_id"`
|
|
BasePath string `json:"base_path"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type BrowserContext struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type ChannelIdentity struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
UserID pgtype.UUID `json:"user_id"`
|
|
ChannelType string `json:"channel_type"`
|
|
ChannelSubjectID string `json:"channel_subject_id"`
|
|
DisplayName pgtype.Text `json:"display_name"`
|
|
AvatarUrl pgtype.Text `json:"avatar_url"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type ChannelIdentityBindCode struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Token string `json:"token"`
|
|
IssuedByUserID pgtype.UUID `json:"issued_by_user_id"`
|
|
ChannelType pgtype.Text `json:"channel_type"`
|
|
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
|
|
UsedAt pgtype.Timestamptz `json:"used_at"`
|
|
UsedByChannelIdentityID pgtype.UUID `json:"used_by_channel_identity_id"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type Container struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
ContainerID string `json:"container_id"`
|
|
ContainerName string `json:"container_name"`
|
|
Image string `json:"image"`
|
|
Status string `json:"status"`
|
|
Namespace string `json:"namespace"`
|
|
AutoStart bool `json:"auto_start"`
|
|
ContainerPath string `json:"container_path"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
LastStartedAt pgtype.Timestamptz `json:"last_started_at"`
|
|
LastStoppedAt pgtype.Timestamptz `json:"last_stopped_at"`
|
|
}
|
|
|
|
type ContainerVersion struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ContainerID string `json:"container_id"`
|
|
SnapshotID pgtype.UUID `json:"snapshot_id"`
|
|
Version int32 `json:"version"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type EmailOauthToken struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
EmailProviderID pgtype.UUID `json:"email_provider_id"`
|
|
EmailAddress string `json:"email_address"`
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
|
|
Scope string `json:"scope"`
|
|
State string `json:"state"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type EmailOutbox struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ProviderID pgtype.UUID `json:"provider_id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
MessageID string `json:"message_id"`
|
|
FromAddress string `json:"from_address"`
|
|
ToAddresses []byte `json:"to_addresses"`
|
|
Subject string `json:"subject"`
|
|
BodyText string `json:"body_text"`
|
|
BodyHtml string `json:"body_html"`
|
|
Attachments []byte `json:"attachments"`
|
|
Status string `json:"status"`
|
|
Error string `json:"error"`
|
|
SentAt pgtype.Timestamptz `json:"sent_at"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type EmailProvider struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Provider string `json:"provider"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type LifecycleEvent struct {
|
|
ID string `json:"id"`
|
|
ContainerID string `json:"container_id"`
|
|
EventType string `json:"event_type"`
|
|
Payload []byte `json:"payload"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type LlmProvider struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
BaseUrl string `json:"base_url"`
|
|
ApiKey string `json:"api_key"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type McpConnection struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Config []byte `json:"config"`
|
|
IsActive bool `json:"is_active"`
|
|
Status string `json:"status"`
|
|
ToolsCache []byte `json:"tools_cache"`
|
|
LastProbedAt pgtype.Timestamptz `json:"last_probed_at"`
|
|
StatusMessage string `json:"status_message"`
|
|
AuthType string `json:"auth_type"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type McpOauthToken struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ConnectionID pgtype.UUID `json:"connection_id"`
|
|
ResourceMetadataUrl string `json:"resource_metadata_url"`
|
|
AuthorizationServerUrl string `json:"authorization_server_url"`
|
|
AuthorizationEndpoint string `json:"authorization_endpoint"`
|
|
TokenEndpoint string `json:"token_endpoint"`
|
|
RegistrationEndpoint string `json:"registration_endpoint"`
|
|
ScopesSupported []string `json:"scopes_supported"`
|
|
ClientID string `json:"client_id"`
|
|
ClientSecret string `json:"client_secret"`
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
TokenType string `json:"token_type"`
|
|
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
|
|
Scope string `json:"scope"`
|
|
PkceCodeVerifier string `json:"pkce_code_verifier"`
|
|
StateParam string `json:"state_param"`
|
|
ResourceUri string `json:"resource_uri"`
|
|
RedirectUri string `json:"redirect_uri"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type MediaAsset struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
StorageProviderID pgtype.UUID `json:"storage_provider_id"`
|
|
ContentHash string `json:"content_hash"`
|
|
MediaType string `json:"media_type"`
|
|
Mime string `json:"mime"`
|
|
SizeBytes int64 `json:"size_bytes"`
|
|
StorageKey string `json:"storage_key"`
|
|
OriginalName pgtype.Text `json:"original_name"`
|
|
Width pgtype.Int4 `json:"width"`
|
|
Height pgtype.Int4 `json:"height"`
|
|
DurationMs pgtype.Int8 `json:"duration_ms"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type MemoryProvider struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Provider string `json:"provider"`
|
|
Config []byte `json:"config"`
|
|
IsDefault bool `json:"is_default"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Model struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ModelID string `json:"model_id"`
|
|
Name pgtype.Text `json:"name"`
|
|
LlmProviderID pgtype.UUID `json:"llm_provider_id"`
|
|
ClientType pgtype.Text `json:"client_type"`
|
|
Dimensions pgtype.Int4 `json:"dimensions"`
|
|
InputModalities []string `json:"input_modalities"`
|
|
SupportsReasoning bool `json:"supports_reasoning"`
|
|
Type string `json:"type"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type ModelVariant struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ModelUuid pgtype.UUID `json:"model_uuid"`
|
|
VariantID string `json:"variant_id"`
|
|
Weight int32 `json:"weight"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Schedule struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Pattern string `json:"pattern"`
|
|
MaxCalls pgtype.Int4 `json:"max_calls"`
|
|
CurrentCalls int32 `json:"current_calls"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
Enabled bool `json:"enabled"`
|
|
Command string `json:"command"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
}
|
|
|
|
type SearchProvider struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Provider string `json:"provider"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Snapshot struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ContainerID string `json:"container_id"`
|
|
RuntimeSnapshotName string `json:"runtime_snapshot_name"`
|
|
DisplayName pgtype.Text `json:"display_name"`
|
|
ParentRuntimeSnapshotName pgtype.Text `json:"parent_runtime_snapshot_name"`
|
|
Snapshotter string `json:"snapshotter"`
|
|
Source string `json:"source"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
}
|
|
|
|
type StorageProvider struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Provider string `json:"provider"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Subagent struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
Deleted bool `json:"deleted"`
|
|
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
|
|
BotID pgtype.UUID `json:"bot_id"`
|
|
Messages []byte `json:"messages"`
|
|
Metadata []byte `json:"metadata"`
|
|
Skills []byte `json:"skills"`
|
|
Usage []byte `json:"usage"`
|
|
}
|
|
|
|
type TtsModel struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ModelID string `json:"model_id"`
|
|
Name pgtype.Text `json:"name"`
|
|
TtsProviderID pgtype.UUID `json:"tts_provider_id"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type TtsProvider struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Provider string `json:"provider"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type User struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Username pgtype.Text `json:"username"`
|
|
Email pgtype.Text `json:"email"`
|
|
PasswordHash pgtype.Text `json:"password_hash"`
|
|
Role string `json:"role"`
|
|
DisplayName pgtype.Text `json:"display_name"`
|
|
AvatarUrl pgtype.Text `json:"avatar_url"`
|
|
DataRoot pgtype.Text `json:"data_root"`
|
|
LastLoginAt pgtype.Timestamptz `json:"last_login_at"`
|
|
IsActive bool `json:"is_active"`
|
|
Metadata []byte `json:"metadata"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type UserChannelBinding struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
UserID pgtype.UUID `json:"user_id"`
|
|
ChannelType string `json:"channel_type"`
|
|
Config []byte `json:"config"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|