mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-26 02:07:28 +08:00
57a505f837
* chore: Rename service & container names for consistency in Docker configs (#6710) * chore: Rename container names for consistency in Docker configs * chore: Rename service names for consistency in Docker configs chore: Update OpenSandbox versions and image repositories (#6709) * chore: Update OpenSandbox versions and image repositories * yml version * images * init yml * port --------- Co-authored-by: archer <545436317@qq.com> refactor(chat): optimize sandbox status logic and decouple UI/Status hooks (#6713) * refactor(chat): optimize sandbox status logic and decouple UI/Status hooks * fix: useRef, rename onClose to afterClose Update .env.template (#6720) aiproxy默认的请求地址改成http协议 feat: comprehensive agent skill management and sandbox infrastructure optimization - Skill System: Implemented a full skill management module including CRUD operations, folder organization, AI-driven skill generation, and versioning (switch/update). - Sandbox Infrastructure: Introduced 'volume-manager' for PVC and Docker volume lifecycle management, replacing the MinIO sync-agent for better data persistence. - Workflow Integration: Enhanced the Agent node to support skill selection and configuration, including new UI components and data normalization. - Permission Management: Added granular permission controls for skills, supporting collaborators, owner transfers, and permission inheritance. - UI/UX: Added a dedicated Skill dashboard, sandbox debug interface (terminal, logs, and iframe proxy), and comprehensive i18n support. - Maintenance: Migrated Docker services to named volumes, optimized sandbox instance limits, and improved error handling for sandbox providers. Co-authored-by: chanzhi82020 <chenzhi@sangfor.com.cn> Co-authored-by: lavine77 Signed-off-by: Jon <ljp@sangfor.com.cn> feat: hide skill prettier * perf: hide skill code * fix: ts * lock * perf: tool code * fix: ts * lock * fix: test * fix: openapi * lock * fix: test * null model --------- Co-authored-by: archer <545436317@qq.com>
71 lines
3.0 KiB
TypeScript
71 lines
3.0 KiB
TypeScript
import { createEnv } from '@t3-oss/env-core';
|
|
import { z } from 'zod';
|
|
|
|
const BoolSchema = z
|
|
.string()
|
|
.transform((val) => val === 'true')
|
|
.pipe(z.boolean());
|
|
const NumSchema = z.coerce.number();
|
|
|
|
const LogLevelSchema = z.enum(['trace', 'debug', 'info', 'warning', 'error', 'fatal']);
|
|
|
|
export const env = createEnv({
|
|
server: {
|
|
// ===== Agent sandbox =====
|
|
AGENT_SANDBOX_PROVIDER: z.enum(['sealosdevbox', 'opensandbox', 'e2b']).optional(),
|
|
AGENT_SANDBOX_E2B_API_KEY: z.string().optional(),
|
|
AGENT_SANDBOX_SEALOS_BASEURL: z.string().url().optional(),
|
|
AGENT_SANDBOX_SEALOS_TOKEN: z.string().optional(),
|
|
|
|
AGENT_SANDBOX_OPENSANDBOX_BASEURL: z.string().url().optional(),
|
|
AGENT_SANDBOX_OPENSANDBOX_API_KEY: z.string().optional(),
|
|
AGENT_SANDBOX_OPENSANDBOX_RUNTIME: z.enum(['docker', 'kubernetes']).default('docker'),
|
|
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPO: z.string().optional(),
|
|
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAG: z.string().default('latest'),
|
|
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXY: BoolSchema.default(true),
|
|
AGENT_SANDBOX_ENABLE_VOLUME: BoolSchema.default(false),
|
|
AGENT_SANDBOX_VOLUME_MANAGER_URL: z.string().url().optional(),
|
|
AGENT_SANDBOX_VOLUME_MANAGER_TOKEN: z.string().optional(),
|
|
AGENT_SANDBOX_VOLUME_MANAGER_MOUNT_PATH: z.string().default('/workspace'),
|
|
|
|
AGENT_SKILL_MAX_UPLOAD_SIZE: NumSchema.optional(),
|
|
AGENT_SKILL_MAX_UNCOMPRESSED_SIZE: NumSchema.optional(),
|
|
AGENT_SKILL_MAX_DOWNLOAD_SIZE: NumSchema.optional(),
|
|
AGENT_SKILL_MAX_SANDBOX_SIZE: NumSchema.optional(),
|
|
|
|
AGENT_SANDBOX_MAX_EDIT_DEBUG: NumSchema.optional(),
|
|
AGENT_SANDBOX_MAX_SESSION_RUNTIME: NumSchema.optional(),
|
|
|
|
// ===== Logging =====
|
|
LOG_ENABLE_CONSOLE: BoolSchema.default(true),
|
|
LOG_CONSOLE_LEVEL: LogLevelSchema.default('debug'),
|
|
LOG_ENABLE_OTEL: BoolSchema.default(false),
|
|
LOG_OTEL_LEVEL: LogLevelSchema.default('info'),
|
|
LOG_OTEL_SERVICE_NAME: z.string().default('fastgpt-client'),
|
|
LOG_OTEL_URL: z.url().optional(),
|
|
|
|
METRICS_ENABLE_OTEL: BoolSchema.default(false),
|
|
METRICS_EXPORT_INTERVAL: z.coerce.number().int().positive().default(30000),
|
|
METRICS_OTEL_SERVICE_NAME: z.string().default('fastgpt-client'),
|
|
METRICS_OTEL_URL: z.url().optional(),
|
|
|
|
TRACING_ENABLE_OTEL: BoolSchema.default(false),
|
|
TRACING_OTEL_SERVICE_NAME: z.string().default('fastgpt-client'),
|
|
TRACING_OTEL_URL: z.url().optional(),
|
|
TRACING_OTEL_SAMPLE_RATIO: z.coerce.number().min(0).max(1).optional(),
|
|
|
|
APP_FOLDER_MAX_AMOUNT: z.coerce.number().int().positive().default(1000),
|
|
DATASET_FOLDER_MAX_AMOUNT: z.coerce.number().int().positive().default(1000),
|
|
|
|
// Beta features
|
|
// Whether the Skill feature is enabled (frontend entries + backend runtime)
|
|
SHOW_SKILL: BoolSchema.default(false)
|
|
},
|
|
emptyStringAsUndefined: true,
|
|
runtimeEnv: process.env,
|
|
onValidationError(issues) {
|
|
const paths = issues.map((issue) => issue.path).join(', ');
|
|
throw new Error(`Invalid environment variables. Please check: ${paths}\n`);
|
|
}
|
|
});
|