105 lines
4.8 KiB
PL/PgSQL
105 lines
4.8 KiB
PL/PgSQL
\set ON_ERROR_STOP on
|
|
\if :{?page_size_json}
|
|
\else
|
|
\set page_size_json 10
|
|
\endif
|
|
\if :{?chat_pull_page_size_json}
|
|
\else
|
|
\set chat_pull_page_size_json 60
|
|
\endif
|
|
\if :{?auth_token_ttl_hours_json}
|
|
\else
|
|
\set auth_token_ttl_hours_json 24
|
|
\endif
|
|
\if :{?auth_token_max_active_json}
|
|
\else
|
|
\set auth_token_max_active_json 2
|
|
\endif
|
|
\if :{?upload_max_mb_json}
|
|
\else
|
|
\set upload_max_mb_json 100
|
|
\endif
|
|
\if :{?allowed_attachment_extensions_json}
|
|
\else
|
|
\set allowed_attachment_extensions_json []
|
|
\endif
|
|
\if :{?workspace_download_extensions_json}
|
|
\else
|
|
\set workspace_download_extensions_json '[".pdf", ".doc", ".docx", ".xls", ".xlsx", ".xlsm", ".ppt", ".pptx", ".odt", ".ods", ".odp", ".wps"]'
|
|
\endif
|
|
\if :{?workspace_preview_token_ttl_seconds_json}
|
|
\else
|
|
\set workspace_preview_token_ttl_seconds_json 3600
|
|
\endif
|
|
\if :{?speech_enabled_json}
|
|
\else
|
|
\set speech_enabled_json true
|
|
\endif
|
|
\if :{?activity_event_retention_days_json}
|
|
\else
|
|
\set activity_event_retention_days_json 7
|
|
\endif
|
|
|
|
BEGIN;
|
|
|
|
INSERT INTO sys_setting (
|
|
key,
|
|
name,
|
|
category,
|
|
description,
|
|
value_type,
|
|
value_json,
|
|
is_public,
|
|
sort_order,
|
|
created_at,
|
|
updated_at
|
|
)
|
|
VALUES
|
|
('page_size', '分页大小', 'ui', '平台各类列表默认每页条数。', 'integer', :'page_size_json', TRUE, 5, NOW(), NOW()),
|
|
('chat_pull_page_size', '对话懒加载条数', 'chat', 'Bot 对话区向上懒加载时每次读取的消息条数。', 'integer', :'chat_pull_page_size_json', TRUE, 8, NOW(), NOW()),
|
|
('auth_token_ttl_hours', '认证 Token 过期小时数', 'auth', 'Panel 与 Bot 登录 Token 的统一有效时长,单位小时。', 'integer', :'auth_token_ttl_hours_json', FALSE, 10, NOW(), NOW()),
|
|
('auth_token_max_active', '认证 Token 最大并发数', 'auth', '同一主体允许同时活跃的 Token 数量,超过时自动撤销最旧 Token。', 'integer', :'auth_token_max_active_json', FALSE, 11, NOW(), NOW()),
|
|
('upload_max_mb', '上传大小限制', 'upload', '单文件上传大小限制,单位 MB。', 'integer', :'upload_max_mb_json', FALSE, 20, NOW(), NOW()),
|
|
('allowed_attachment_extensions', '允许附件后缀', 'upload', '允许上传的附件后缀列表,留空表示不限制。', 'json', :'allowed_attachment_extensions_json', FALSE, 20, NOW(), NOW()),
|
|
('workspace_download_extensions', '工作区下载后缀', 'workspace', '命中后缀的工作区文件默认走下载模式。', 'json', :'workspace_download_extensions_json', FALSE, 30, NOW(), NOW()),
|
|
('workspace_preview_token_ttl_seconds', '工作区预览 Token 过期秒数', 'workspace', 'HTML 预览地址中临时访问 Token 的默认有效时长,单位秒。', 'integer', :'workspace_preview_token_ttl_seconds_json', FALSE, 31, NOW(), NOW()),
|
|
('speech_enabled', '语音识别开关', 'speech', '控制 Bot 语音转写功能是否启用。', 'boolean', :'speech_enabled_json', TRUE, 32, NOW(), NOW()),
|
|
('activity_event_retention_days', '活动事件保留天数', 'maintenance', 'bot_activity_event 运维事件的保留天数,超期记录会自动清理。', 'integer', :'activity_event_retention_days_json', FALSE, 34, NOW(), NOW())
|
|
ON CONFLICT (key) DO UPDATE
|
|
SET
|
|
name = EXCLUDED.name,
|
|
category = EXCLUDED.category,
|
|
description = EXCLUDED.description,
|
|
value_type = EXCLUDED.value_type,
|
|
is_public = EXCLUDED.is_public,
|
|
sort_order = EXCLUDED.sort_order,
|
|
updated_at = NOW();
|
|
|
|
INSERT INTO skill_market_item (
|
|
skill_key,
|
|
display_name,
|
|
description,
|
|
zip_filename,
|
|
zip_size_bytes,
|
|
entry_names_json,
|
|
created_at,
|
|
updated_at
|
|
)
|
|
VALUES
|
|
('nano-banana-pro', 'Nano Banana Pro', 'Generate and edit images with Nano Banana Pro.', 'nano-banana-pro.zip', 5317, '["nano-banana-pro"]', NOW(), NOW()),
|
|
('powerpoint-pptx', 'Powerpoint PPTX', 'Create and edit PowerPoint PPTX files.', 'powerpoint-pptx.zip', 3596, '["powerpoint-pptx"]', NOW(), NOW()),
|
|
('self-improving-agent', 'Self Improving Agent', 'Capture learnings, errors, and corrections for continuous improvement.', 'self-improving-agent.zip', 26866, '["self-improving-agent"]', NOW(), NOW()),
|
|
('stock-analysis', 'Stock Analysis', 'Analyze stocks and crypto with research and portfolio workflows.', 'stock-analysis.zip', 79536, '["stock-analysis"]', NOW(), NOW()),
|
|
('tavily-search', 'Tavily Search', 'AI-optimized web search skill powered by Tavily.', 'tavily-search.zip', 3459, '["tavily-search"]', NOW(), NOW()),
|
|
('writing', 'Writing', 'Adapt writing voice and improve clarity, structure, and style.', 'writing.zip', 8618, '["writing"]', NOW(), NOW())
|
|
ON CONFLICT (skill_key) DO UPDATE
|
|
SET
|
|
display_name = EXCLUDED.display_name,
|
|
description = EXCLUDED.description,
|
|
zip_filename = EXCLUDED.zip_filename,
|
|
zip_size_bytes = EXCLUDED.zip_size_bytes,
|
|
entry_names_json = EXCLUDED.entry_names_json,
|
|
updated_at = NOW();
|
|
|
|
COMMIT;
|