Files
opencode-manager/shared/src/config/defaults.ts
T
Chris Scott be93975d90 feat(markdown): render inline images in messages and markdown files
Route markdown image nodes through a shared MarkdownImage component that
loads local paths through the raw file API, and allow data:image/* sources
through the sanitizer and URL transform so inline images survive rendering.

Render image attachments as thumbnails in the message thread, and accept
image/webp uploads.
2026-10-13 00:29:00 +00:00

114 lines
2.3 KiB
TypeScript

export const DEFAULTS = {
SERVER: {
PORT: 5003,
HOST: '0.0.0.0',
CORS_ORIGIN: 'http://localhost:5173',
},
FRONTEND: {
PORT: 5173,
HOST: '0.0.0.0',
},
OPENCODE: {
PORT: 5551,
HOST: '127.0.0.1',
HEALTH_WATCH_ENABLED: true,
HEALTH_POLL_MS: 30000,
HEALTH_FAILURE_THRESHOLD: 2,
},
PREVIEW: {
PORT: 5004,
},
DATABASE: {
PATH: './data/opencode.db',
},
WORKSPACE: {
BASE_PATH: './workspace',
REPOS_DIR: 'repos',
SCHEDULE_WORKTREES_DIR: 'schedule-worktrees',
CONFIG_DIR: '.config/opencode',
},
SANDBOX: {
MSB_PATH: 'msb',
IMAGE: 'docker.io/cstechdev/ocm-sandbox@sha256:9df035cfb1a7c367bac6edbfd660d084b08e02faa051a93e0a6e381272b85342',
MEMORY: '4G',
CPUS: 2,
EXEC_USER: 'node',
NET: 'public',
START_TIMEOUT_MS: 300000,
EXEC_TIMEOUT_MS: 600000,
},
TIMEOUTS: {
PROCESS_START_WAIT_MS: 2000,
PROCESS_VERIFY_WAIT_MS: 1000,
HEALTH_CHECK_TIMEOUT_MS: 30000,
},
FILE_LIMITS: {
MAX_SIZE_MB: 50,
MAX_UPLOAD_SIZE_MB: 50,
},
LOGGING: {
DEBUG: false,
LOG_LEVEL: 'info',
},
LOGS: {
BUFFER_CAPACITY: 2000,
MAX_ENTRY_LENGTH: 4000,
DEFAULT_PAGE_SIZE: 500,
MAX_PAGE_SIZE: 1000,
POLL_INTERVAL_MS: 3000,
},
SSE: {
RECONNECT_DELAY_MS: 1000,
MAX_RECONNECT_DELAY_MS: 30000,
CONNECT_TIMEOUT_MS: 10000,
IDLE_GRACE_PERIOD_MS: 5000,
HEARTBEAT_INTERVAL_MS: 30000,
STALL_THRESHOLD_MS: 90000,
WATCHDOG_TICK_MS: 15000,
},
} as const
export const ALLOWED_MIME_TYPES = [
'text/plain',
'text/html',
'text/css',
'text/javascript',
'text/typescript',
'application/json',
'application/xml',
'image/png',
'image/jpeg',
'image/gif',
'image/webp',
'image/svg+xml',
'application/pdf',
'application/zip',
'text/markdown',
] as const
export const GIT_PROVIDERS = {
GITHUB: 'github.com',
GITLAB: 'gitlab.com',
BITBUCKET: 'bitbucket.org',
} as const
export const OPENCODE_CONFIG_SOURCE_NAMES = ['opencode.json', 'opencode.jsonc'] as const
export type OpenCodeConfigSourceName = (typeof OPENCODE_CONFIG_SOURCE_NAMES)[number]
export const LEGACY_OPENCODE_CONFIG_SOURCE_NAME = 'config.json'
export type Config = typeof DEFAULTS
export type AllowedMimeType = (typeof ALLOWED_MIME_TYPES)[number]
export type GitProvider = (typeof GIT_PROVIDERS)[keyof typeof GIT_PROVIDERS]