@xopcai/xopc 0.0.91 → 0.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/agents-uwPn7ZW9.js +222 -0
- package/dist/gateway/static/root/assets/{apps-page-CIC8bmvZ.js → apps-page-CWKdhSPU.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-hEhW7Mbk.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CYWL5DLD.js → channels-status-swr-XzddfJW2.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-api-TVqLlGAC.js → cron-api--I8LJ44S.js} +1 -1
- package/dist/gateway/static/root/assets/cron-page-B0kvgZGR.js +1 -0
- package/dist/gateway/static/root/assets/{dist-CUV1uY5f.js → dist-CYgHMQO0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-mTLHRDp1.js → extension-debug-page-6cRP0nA9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-iI8BI7WK.js → extension-page-DpwIkspI.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-ByXcdubM.js → extension-settings-page-DYbnQUxH.js} +1 -1
- package/dist/gateway/static/root/assets/{fetch-BWtQq_Ys.js → fetch-DTN0w7rV.js} +1 -1
- package/dist/gateway/static/root/assets/{field-primitives-BsZ-4VT5.js → field-primitives-CslW6HwD.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-config-api-2UiKevxG.js +1 -0
- package/dist/gateway/static/root/assets/index-BUKUv7QW.css +1 -0
- package/dist/gateway/static/root/assets/{index-CKkR-v9U.js → index-DnevRVa6.js} +82 -82
- package/dist/gateway/static/root/assets/logs-page-sOP4TXJ4.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-page-DJ2Mb4x7.js → note-detail-page-DvW2qg4i.js} +3 -3
- package/dist/gateway/static/root/assets/{note-time-JLBPSLzK.js → note-time-BEiibLJv.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BE-75qz9.js → notes-page-BFQaquHU.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CptjDKAX.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BctKqHcf.js +2 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DSYCknxM.js → settings-form-section-QJh5ruel.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-V3p-hISB.js +2 -0
- package/dist/gateway/static/root/assets/{share-preview-page-awRqs4hV.js → share-preview-page-DBsvvbmD.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-q2zPUJAR.js +2 -0
- package/dist/gateway/static/root/assets/{theme-store-BC-42BoZ.js → theme-store-ht5iswWS.js} +1 -1
- package/dist/gateway/static/root/assets/{url-CY1RQKTU.js → url-CWWpfkq1.js} +2 -2
- package/dist/gateway/static/root/assets/{utils-DX3TQuap.js → utils-DhPv9xoB.js} +1 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DLSKUipa.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-page.utils-ClC37yEp.js → workflow-page.utils-CJqnPWkW.js} +1 -1
- package/dist/gateway/static/root/assets/workflows-page-DRRQ1A0l.js +27 -0
- package/dist/gateway/static/root/index.html +5 -5
- package/dist/package.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.d.ts +2 -9
- package/dist/src/agent/mcp/bundle-mcp-config.js +10 -34
- package/dist/src/agent/mcp/bundle-mcp-config.js.map +1 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-policy.js.map +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +4 -4
- package/dist/src/agent/mcp/bundle-mcp-runtime.js.map +1 -1
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/cli/command-catalog.js +0 -4
- package/dist/src/cli/command-catalog.js.map +1 -1
- package/dist/src/cli/command-loaders.js +1 -2
- package/dist/src/cli/command-loaders.js.map +1 -1
- package/dist/src/cli/command-manifest.js +0 -4
- package/dist/src/cli/command-manifest.js.map +1 -1
- package/dist/src/config/index.d.ts +0 -1
- package/dist/src/config/index.js +1 -2
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/config/schema.d.ts +36 -6
- package/dist/src/config/schema.js +13 -11
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/connectors/builtin-catalog.d.ts +2 -0
- package/dist/src/connectors/builtin-catalog.js +152 -0
- package/dist/src/connectors/builtin-catalog.js.map +1 -0
- package/dist/src/connectors/catalog.d.ts +5 -0
- package/dist/src/connectors/catalog.js +13 -0
- package/dist/src/connectors/catalog.js.map +1 -0
- package/dist/src/connectors/health.d.ts +3 -0
- package/dist/src/connectors/health.js +61 -0
- package/dist/src/connectors/health.js.map +1 -0
- package/dist/src/connectors/install.d.ts +5 -0
- package/dist/src/connectors/install.js +46 -0
- package/dist/src/connectors/install.js.map +1 -0
- package/dist/src/connectors/instances.d.ts +4 -0
- package/dist/src/connectors/instances.js +43 -0
- package/dist/src/connectors/instances.js.map +1 -0
- package/dist/src/connectors/materialize.d.ts +9 -0
- package/dist/src/connectors/materialize.js +76 -0
- package/dist/src/connectors/materialize.js.map +1 -0
- package/dist/src/connectors/oauth.d.ts +22 -0
- package/dist/src/connectors/oauth.js +99 -0
- package/dist/src/connectors/oauth.js.map +1 -0
- package/dist/src/connectors/providers.d.ts +9 -0
- package/dist/src/connectors/providers.js +20 -0
- package/dist/src/connectors/providers.js.map +1 -0
- package/dist/src/connectors/secret-store.d.ts +7 -0
- package/dist/src/connectors/secret-store.js +47 -0
- package/dist/src/connectors/secret-store.js.map +1 -0
- package/dist/src/connectors/types.d.ts +102 -0
- package/dist/src/connectors/types.js +1 -0
- package/dist/src/connectors/usage.d.ts +6 -0
- package/dist/src/connectors/usage.js +63 -0
- package/dist/src/connectors/usage.js.map +1 -0
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.d.ts +3 -0
- package/dist/src/gateway/hono/routes/connectors.js +177 -0
- package/dist/src/gateway/hono/routes/connectors.js.map +1 -0
- package/dist/src/gateway/hono/routes/home.d.ts +12 -0
- package/dist/src/gateway/hono/routes/home.js +50 -0
- package/dist/src/gateway/hono/routes/home.js.map +1 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +12 -4
- package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
- package/dist/src/gateway/hono/routes/notes.js +31 -0
- package/dist/src/gateway/hono/routes/notes.js.map +1 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/mcp/channel-bridge.js.map +1 -1
- package/dist/src/notes/index.d.ts +1 -1
- package/dist/src/notes/service.d.ts +11 -0
- package/dist/src/notes/service.js +42 -0
- package/dist/src/notes/service.js.map +1 -1
- package/dist/src/notes/store.d.ts +1 -0
- package/dist/src/notes/store.js +29 -4
- package/dist/src/notes/store.js.map +1 -1
- package/dist/src/notes/types.d.ts +39 -2
- package/dist/src/session/store.d.ts +2 -0
- package/dist/src/session/store.js +21 -1
- package/dist/src/session/store.js.map +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-bVWUlrlD.js +0 -222
- package/dist/gateway/static/root/assets/channels-settings-C8G8RAAP.js +0 -1
- package/dist/gateway/static/root/assets/cron-dreaming-jobs-Ip703-qM.js +0 -2
- package/dist/gateway/static/root/assets/cron-page-BtcFYlvv.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-config-api-WjTsRLCU.js +0 -1
- package/dist/gateway/static/root/assets/index-VlELBY99.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-ClnIpxfd.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-bJJkWtTl.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-WcMXLq2U.js +0 -3
- package/dist/gateway/static/root/assets/skills-page-Lu-i1JG7.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-B5uKlDqA.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-C7VhIXtR.js +0 -27
- package/dist/src/cli/commands/mcp.d.ts +0 -4
- package/dist/src/cli/commands/mcp.js +0 -85
- package/dist/src/cli/commands/mcp.js.map +0 -1
- package/dist/src/config/mcp-config.d.ts +0 -34
- package/dist/src/config/mcp-config.js +0 -116
- package/dist/src/config/mcp-config.js.map +0 -1
- package/dist/src/gateway/hono/routes/mcp.d.ts +0 -3
- package/dist/src/gateway/hono/routes/mcp.js +0 -99
- package/dist/src/gateway/hono/routes/mcp.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":[],"sources":["../../../src/config/schema.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { checkCacheDir } from '../browser/cache-dir-policy.js';\nimport { LocalizedTextSchema } from './localized-text.js';\nimport { validatePublicUrl } from './public-url.js';\n\n// ============================================\n// Agent Configs\n// ============================================\n\n/**\n * Agent model ref. Always an object with explicit `primary` and optional\n * `fallbacks` chain. No string-form shorthand — every write site builds the\n * object explicitly so reads never branch on shape.\n */\nexport const AgentModelRefSchema = z\n .object({\n primary: z.string().min(1),\n fallbacks: z.array(z.string()).optional(),\n })\n .strict();\n\nexport type AgentModelConfig = z.infer<typeof AgentModelRefSchema>;\n\n/**\n * Image-generation model ref. {@link AgentModelRefSchema} plus runtime knobs\n * (`timeoutMs`, `autoProviderFallback`) used by the image-generation runtime.\n */\nexport const AgentImageGenerationModelSchema = z\n .object({\n primary: z.string().min(1),\n fallbacks: z.array(z.string()).optional(),\n /** Hard cap for the whole generation attempt (ms). */\n timeoutMs: z.number().int().positive().optional(),\n /**\n * When all `primary + fallbacks` candidates fail, sweep every other\n * configured provider before giving up.\n */\n autoProviderFallback: z.boolean().optional(),\n })\n .strict();\n\nexport type AgentImageGenerationModelConfig = z.infer<typeof AgentImageGenerationModelSchema>;\n\n/** Named model role for workflows (e.g. `small`, `large`). Maps to a concrete `provider/model` ref. */\nexport const AgentTypedModelSchema = z\n .object({\n id: z.string().min(1).regex(/^[a-z][a-z0-9_-]{0,63}$/),\n description: z.string().max(500).optional(),\n model: z.string().min(1),\n })\n .strict()\n .superRefine((entry, ctx) => {\n const trimmed = entry.model.trim();\n const idx = trimmed.indexOf('/');\n if (idx <= 0 || idx === trimmed.length - 1) {\n ctx.addIssue({\n code: 'custom',\n message: `model must be provider/model format (got '${entry.model}')`,\n path: ['model'],\n });\n }\n });\n\nexport type AgentTypedModel = z.infer<typeof AgentTypedModelSchema>;\n\nconst AgentTypedModelsArraySchema = z\n .array(AgentTypedModelSchema)\n .optional()\n .superRefine((arr, ctx) => {\n if (!arr) return;\n const seen = new Set<string>();\n for (let i = 0; i < arr.length; i++) {\n const id = arr[i]!.id;\n if (seen.has(id)) {\n ctx.addIssue({\n code: 'custom',\n message: `duplicate typed model id '${id}'`,\n path: [i, 'id'],\n });\n }\n seen.add(id);\n }\n });\n\nexport const AgentDefaultsSchema = z.object({\n /** Parent directory: each agent’s Markdown root is `<expanded>/<agentId>/` (e.g. `.../workspace/main`). */\n workspace: z.string().default('~/.xopc/workspace'),\n /** Default model for new sessions. Optional — runtime resolves a fallback when unset. */\n model: AgentModelRefSchema.optional(),\n /** Named model roles (e.g. `small`, `large`) for workflows and other callers. */\n models: AgentTypedModelsArraySchema,\n /** Vision / image understanding model (provider/model). Falls back to heuristics when unset. */\n imageModel: AgentModelRefSchema.optional(),\n /** Image generation model (provider/model), e.g. openai/gpt-image-1. Supports plugin-based providers (OpenAI / DashScope / MiniMax / Google / Fal). */\n imageGenerationModel: AgentImageGenerationModelSchema.optional(),\n /** Max image size for image tool loads (MB). */\n mediaMaxMb: z.number().positive().optional(),\n maxTokens: z.number().default(8192),\n temperature: z.number().default(0.7),\n maxToolIterations: z.number().default(20),\n // Wall-clock limit for one user turn (LLM + tools). Default 30m if unset; cap 4h.\n maxTaskDurationMs: z.number().min(60000).max(14_400_000).optional(),\n // Reliability settings\n maxRequestsPerTurn: z.number().min(10).max(200).default(50),\n maxToolFailuresPerTurn: z.number().min(1).max(20).default(3),\n // Thinking ability settings\n thinkingDefault: z.enum(['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'adaptive']).optional(),\n reasoningDefault: z.enum(['off', 'on', 'stream']).optional(),\n verboseDefault: z.enum(['off', 'on', 'full']).optional(),\n bootstrapMaxChars: z.number().int().positive().optional(),\n bootstrapTotalMaxChars: z.number().int().positive().optional(),\n bootstrapPromptTruncationWarning: z.enum(['off', 'once', 'always']).optional(),\n startupContext: z\n .object({\n enabled: z.boolean().optional(),\n applyOn: z.array(z.enum(['new', 'reset'])).optional(),\n dailyMemoryDays: z.number().int().min(1).optional(),\n maxFileBytes: z.number().int().positive().optional(),\n maxFileChars: z.number().int().positive().optional(),\n maxTotalChars: z.number().int().positive().optional(),\n })\n .optional(),\n contextLimits: z\n .object({\n postCompactionMaxChars: z.number().int().positive().optional(),\n })\n .optional(),\n compaction: z.object({\n enabled: z.boolean().default(true),\n mode: z.enum(['default', 'safeguard']).default('default'),\n reserveTokens: z.number().default(8000),\n triggerThreshold: z.number().min(0.5).max(0.95).default(0.8),\n minMessagesBeforeCompact: z.number().default(10),\n keepRecentMessages: z.number().default(5),\n // Dual-strategy compaction\n evictionWindow: z.number().min(0.1).max(0.5).default(0.2),\n retentionWindow: z.number().min(3).max(20).default(6),\n postCompactionSections: z.array(z.string()).optional(),\n }).optional(),\n pruning: z.object({\n enabled: z.boolean().default(true),\n maxToolResultChars: z.number().default(10000),\n headKeepRatio: z.number().default(0.3),\n tailKeepRatio: z.number().default(0.3),\n }).optional(),\n /**\n * Curated memory (`agents/<id>/memories/`) + pluggable external provider.\n * Only one external provider at a time.\n */\n memory: z\n .object({\n /** Master switch: `curated_memory` tool, prefetch, and external provider. Default true. */\n enabled: z.boolean().optional(),\n /** When false, disable curated_memory tool and memory subsystem helpers. Default true. */\n useEnhancedSystem: z.boolean().optional(),\n /** Include USER.md in snapshot. Default true. */\n userProfileEnabled: z.boolean().optional(),\n memoryCharLimit: z.number().positive().optional(),\n userCharLimit: z.number().positive().optional(),\n provider: z.enum(['none', 'stub']).optional(),\n /** How often prefetched external memory is injected into the user message. */\n injectionFrequency: z.enum(['every-turn', 'first-turn']).optional(),\n /** Inject prefetch on turns 1, 1+N, 1+2N, … (only when injectionFrequency is every-turn). Min 1. */\n contextCadence: z.number().int().min(1).optional(),\n /** Reserved for future external “dialectic” sync cadence (not wired yet). */\n dialecticCadence: z.number().int().min(1).optional(),\n /**\n * Background memory consolidation (\"dreaming\"): three-phase sleep model that\n * promotes short-term recall signals into long-term memory (`MEMORY.md`).\n *\n * Phases:\n * - **light** — fast, frequent sweep (default every 6 h): dedup + signal collection.\n * - **deep** — daily deep promotion (default 3 AM): score-gated write to MEMORY.md.\n * - **rem** — weekly pattern discovery (default Sun 5 AM): cross-session insight mining.\n */\n dreaming: z\n .object({\n enabled: z.boolean().optional(),\n /** Default deep-phase cron when `phases.deep.cron` is omitted. */\n frequency: z.string().optional(),\n timezone: z.string().optional(),\n phases: z\n .object({\n light: z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().optional(),\n lookbackDays: z.number().int().min(1).optional(),\n limit: z.number().int().min(0).optional(),\n dedupeSimilarity: z.number().min(0).max(1).optional(),\n })\n .optional(),\n deep: z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().optional(),\n minScore: z.number().min(0).max(1).optional(),\n minRecallCount: z.number().int().min(1).optional(),\n minUniqueQueries: z.number().int().min(1).optional(),\n limit: z.number().int().min(0).optional(),\n recencyHalfLifeDays: z.number().min(1).optional(),\n maxAgeDays: z.number().int().min(1).optional(),\n })\n .optional(),\n rem: z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().optional(),\n lookbackDays: z.number().int().min(1).optional(),\n limit: z.number().int().min(0).optional(),\n minPatternStrength: z.number().min(0).max(1).optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional(),\n /** Cross-session transcript search (`session_search` tool). */\n sessionSearch: z\n .object({\n /** Model ref for per-session summaries (e.g. openai/gpt-4o-mini). */\n summaryModel: z.string().optional(),\n })\n .optional(),\n /**\n * Post-turn background review (Hermes-style): optional quiet follow-up that may call\n * `curated_memory` / `skill_manage` so durable facts and reusable workflows persist\n * without bloating the main user-visible turn.\n */\n backgroundReview: z\n .object({\n /** When true, nudges may run after successful turns. Default false (opt-in). */\n enabled: z.boolean().optional(),\n /** User-turn cadence for memory review. 0 disables the memory channel. Default 10. */\n memoryNudgeInterval: z.number().int().min(0).optional(),\n /** LLM rounds without `skill_manage` before a skill review. 0 disables the skill channel. Default 10. */\n skillNudgeInterval: z.number().int().min(0).optional(),\n /** Max tool executions for the review agent. Default 8. */\n maxToolRounds: z.number().int().min(1).max(32).optional(),\n /** Max prior messages passed into the review context (tail). Default 80. */\n maxHistoryMessages: z.number().int().min(10).max(200).optional(),\n /** Wall-clock cap for the review run (ms). Default 120000. */\n maxDurationMs: z.number().int().min(30_000).max(600_000).optional(),\n })\n .optional(),\n /** LLM pass for `web_extract` (markdown-focused extraction). */\n webExtract: z\n .object({\n model: z.string().optional(),\n maxLength: z.number().positive().optional(),\n })\n .optional(),\n /**\n * Browser capability via unified `browser_use` tool. Enabled by default (set `enabled: false` to disable).\n * The local Playwright backend requires Chromium on the gateway host: `npx playwright install chromium`.\n */\n browser: z\n .object({\n enabled: z.boolean().optional(),\n /** Run browser in headless mode (default: false — visible window). */\n headless: z.boolean().optional(),\n /** When true, skip private-IP blocking for browser navigation (cloud metadata endpoints are always blocked). */\n allowPrivateUrls: z.boolean().optional(),\n /** Browser command timeout in seconds (default: 30). */\n commandTimeout: z.number().min(5).optional(),\n /** Browser backend mode (default: 'extension'). Also: 'local' (Playwright), 'cdp', 'cloud', or 'cloakbrowser'. */\n backend: z.enum(['local', 'cdp', 'cloud', 'extension', 'cloakbrowser']).optional(),\n /** Cloud browser backend: 'local' (default Playwright), 'browserbase', or 'browser-use'. */\n cloudProvider: z.enum(['local', 'browserbase', 'browser-use']).optional(),\n /** Cloud browser credentials and optional session hints. */\n cloud: z.object({\n /** API key for the selected cloud provider. Environment variables are still supported as fallback. */\n apiKey: z.string().optional(),\n /** Browserbase project id. Falls back to BROWSERBASE_PROJECT_ID. */\n projectId: z.string().optional(),\n /** Optional cloud provider region. */\n region: z.string().optional(),\n }).optional(),\n /** Direct CDP WebSocket endpoint URL (bypasses cloud provider). */\n cdpUrl: z.string().optional(),\n /** Chrome Extension bridge settings (only used when backend = 'extension'). */\n extension: z.object({\n /** WebSocket server port. Default: 19820. */\n port: z.number().min(1024).max(65535).optional(),\n /** Host to bind. Default: 127.0.0.1. */\n host: z.string().optional(),\n /** Timeout waiting for extension connection (ms). Default: 30000. */\n connectionTimeout: z.number().min(1000).optional(),\n }).optional(),\n /** JS dialog handling policy: 'must_respond' (agent must act), 'auto_dismiss', or 'auto_accept'. */\n dialogPolicy: z.enum(['must_respond', 'auto_dismiss', 'auto_accept']).optional(),\n /** Dialog auto-dismiss/accept timeout in seconds (default: 300). */\n dialogTimeoutSeconds: z.number().min(1).optional(),\n /** Enable humanized input simulation (Bezier mouse, per-char typing, wheel scroll). Default: false. */\n humanize: z.boolean().optional(),\n /** Humanize behavior preset: 'default' (fast) or 'careful' (slower, more realistic). Default: 'careful'. */\n humanPreset: z.enum(['default', 'careful']).optional(),\n /** CloakBrowser settings (only used when backend = 'cloakbrowser'). */\n cloakbrowser: z.object({\n /** Keep browser process alive between tasks. Default: true. */\n keepOpen: z.boolean().optional(),\n /** Create a temporary profile directory, cleaned up on close. Default: false. */\n temporaryProfile: z.boolean().optional(),\n /** Directory for cached CloakBrowser binaries. Must live under the user's home directory. Default: ~/.xopc/bin/cloakbrowser. */\n cacheDir: z\n .string()\n .optional()\n .superRefine((v, ctx) => {\n const r = checkCacheDir(v);\n if (r.ok === false) ctx.addIssue({ code: 'custom', message: r.message });\n }),\n /** Override the CloakBrowser binary path (skip auto-download). */\n binaryPath: z.string().optional(),\n /** Timezone to emulate (e.g. \"America/New_York\"). */\n timezone: z.string().optional(),\n /** Locale to emulate (e.g. \"en-US\"). */\n locale: z.string().optional(),\n /** Public IP for WebRTC leak prevention. */\n webrtcIp: z.string().optional(),\n /** Platform to emulate in fingerprint (e.g. \"windows\", \"macos\"). */\n fingerprintPlatform: z.string().optional(),\n /** Extra Chromium launch args (override defaults with same --key= prefix). */\n extraArgs: z.array(z.string()).optional(),\n }).optional(),\n })\n .optional(),\n /** Sub-agent delegation (`delegate_task`). Opt-in. */\n delegate: z\n .object({\n enabled: z.boolean().optional(),\n })\n .optional(),\n /** Sandboxed `execute_code` (programmatic tool calls). Opt-in. */\n executeCode: z\n .object({\n enabled: z.boolean().optional(),\n })\n .optional(),\n /**\n * Dynamic workflows (`workflow` tool). On by default — disable to remove the\n * tool from the agent surface entirely. Subagents spawned by workflows still\n * obey the global `delegate` allowlist; `maxSubagents` caps a single workflow\n * run, `defaultTimeoutSec` caps wall-clock per run.\n */\n workflow: z\n .object({\n enabled: z.boolean().default(true),\n maxConcurrency: z.number().int().min(1).max(64).default(16),\n maxSubagents: z.number().int().min(1).max(10000).default(1000),\n defaultTimeoutSec: z.number().int().min(60).max(14_400).default(1800),\n /** Subagent live progress in workflow snapshots: tool steps only, or full text stream. */\n subagentStream: z.enum(['off', 'steps', 'full']).default('steps'),\n })\n .optional(),\n /** Optional full system prompt replacement (merged with per-agent entry; entry wins). */\n systemPromptOverride: z.string().optional(),\n /** Optional allowlist of skill names for `<available_skills>`; when set, replaces unfiltered list. */\n skills: z.array(z.string()).optional(),\n /** Disable built-in tools by name (e.g. `shell`, `web_search`). */\n tools: z\n .object({\n disable: z.array(z.string()).optional(),\n })\n .optional(),\n /** Opaque per-process params (reserved for extensions / future use). */\n params: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const AgentConfigSchema = z.object({\n id: z.string(),\n /** When true, this entry is the default routing agent. */\n default: z.boolean().optional(),\n name: LocalizedTextSchema.optional(),\n /** Short human-readable summary for UIs (gateway console, pickers). */\n description: LocalizedTextSchema.optional(),\n enabled: z.boolean().default(true),\n /** Per-agent workspace root (`~` expanded at runtime). */\n workspace: z.string().optional(),\n /**\n * Internal agent state directory (`…/credentials`, `agent.json`, pid, inbox).\n * Default: `<stateDir>/agents/<id>/agent`.\n */\n agentDir: z.string().optional(),\n model: AgentModelRefSchema.optional(),\n thinkingDefault: z.enum(['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'adaptive']).optional(),\n reasoningDefault: z.enum(['off', 'on', 'stream']).optional(),\n verboseDefault: z.enum(['off', 'on', 'full']).optional(),\n systemPromptOverride: z.string().optional(),\n skills: z.array(z.string()).optional(),\n tools: z\n .object({\n disable: z.array(z.string()).optional(),\n })\n .optional(),\n params: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const AgentsConfigSchema = z.object({\n /** Default agent id when not specified (routing / session creation). */\n default: z.string().optional(),\n defaults: AgentDefaultsSchema.optional(),\n list: z.array(AgentConfigSchema).optional(),\n}).default({\n defaults: {\n workspace: '~/.xopc/workspace',\n // `model` is intentionally omitted — resolved dynamically at runtime.\n maxTokens: 8192,\n temperature: 0.7,\n maxToolIterations: 20,\n maxRequestsPerTurn: 50,\n maxToolFailuresPerTurn: 3,\n thinkingDefault: 'medium',\n reasoningDefault: 'stream',\n verboseDefault: 'full',\n compaction: {\n enabled: true,\n mode: 'default',\n reserveTokens: 8000,\n triggerThreshold: 0.8,\n minMessagesBeforeCompact: 10,\n keepRecentMessages: 5,\n evictionWindow: 0.2,\n retentionWindow: 6,\n },\n pruning: {\n enabled: true,\n maxToolResultChars: 10000,\n headKeepRatio: 0.3,\n tailKeepRatio: 0.3,\n },\n browser: {\n enabled: true,\n headless: false,\n backend: 'extension',\n },\n },\n} as any);\n\n// ============================================\n// Channel Configs (per-channel Zod lives in bundled extensions; root schema is open)\n// ============================================\n\nexport {\n TelegramTopicConfigSchema,\n TelegramGroupConfigSchema,\n TelegramAccountConfigSchema,\n TelegramConfigSchema,\n} from '../../extensions/telegram/src/config-schema.js';\nexport type { TelegramConfig } from '../../extensions/telegram/src/config-schema.js';\nexport { WeixinAccountConfigSchema, WeixinConfigSchema } from '../../extensions/weixin/src/config-schema.js';\nexport type { WeixinConfig } from '../../extensions/weixin/src/config-schema.js';\n// ============================================\n// Session Routing Configuration\n// ============================================\n\nexport const BindingMatchSchema = z.object({\n channel: z.string(),\n accountId: z.string().optional(),\n peerKind: z.string().optional(),\n peerId: z.string().optional(),\n guildId: z.string().optional(),\n teamId: z.string().optional(),\n memberRoleIds: z.array(z.string()).optional(),\n});\n\nexport const BindingRuleSchema = z.object({\n id: z.string().optional(),\n agentId: z.string(),\n priority: z.number().default(100),\n match: BindingMatchSchema,\n enabled: z.boolean().default(true),\n});\n\nexport const BindingsConfigSchema = z.array(BindingRuleSchema).default([]);\n\nexport const SessionDmScopeSchema = z.enum([\n 'main',\n 'per-peer',\n 'per-channel-peer',\n 'per-account-channel-peer',\n]);\n\nexport const SessionStorageConfigSchema = z.object({\n pruneAfterMs: z.number().optional(),\n maxEntries: z.number().optional(),\n});\n\nexport const SessionResetModeSchema = z.enum(['daily', 'idle']);\n\nexport const SessionResetConfigSchema = z\n .object({\n mode: SessionResetModeSchema.optional(),\n /** Local hour (0–23) for the daily reset boundary. */\n atHour: z.number().int().min(0).max(23).optional(),\n /** Sliding idle window (minutes). When set with daily mode, whichever expires first wins. */\n idleMinutes: z.number().int().min(0).optional(),\n })\n .strict();\n\nexport const SessionResetByTypeSchema = z\n .object({\n direct: SessionResetConfigSchema.optional(),\n group: SessionResetConfigSchema.optional(),\n thread: SessionResetConfigSchema.optional(),\n })\n .strict();\n\nexport const SessionScopeSchema = z.enum(['per-sender', 'global']);\n\nexport const SessionConfigSchema = z.object({\n scope: SessionScopeSchema.default('per-sender'),\n mainKey: z.string().default('main'),\n dmScope: SessionDmScopeSchema.default('main'),\n identityLinks: z.record(z.string(), z.array(z.string())).optional(),\n resetTriggers: z.array(z.string()).optional(),\n idleMinutes: z.number().int().positive().optional(),\n reset: SessionResetConfigSchema.optional(),\n resetByType: SessionResetByTypeSchema.optional(),\n resetByChannel: z.record(z.string(), SessionResetConfigSchema).optional(),\n storage: SessionStorageConfigSchema.optional(),\n}).default({\n scope: 'per-sender',\n mainKey: 'main',\n dmScope: 'main',\n});\n\n/** Channel buckets — shapes validated post-parse by registered channel plugins. */\nexport const ChannelsConfigSchema = z.record(z.string(), z.unknown()).default({\n telegram: {\n enabled: false,\n allowFrom: [],\n groupAllowFrom: [],\n debug: false,\n accounts: {\n default: {\n accountId: 'default',\n enabled: true,\n botToken: '',\n allowFrom: [],\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n streamMode: 'partial' as const,\n },\n },\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n },\n});\n\nexport const SearchProviderEntrySchema = z.object({\n type: z.enum(['brave', 'tavily', 'bing', 'searxng']),\n apiKey: z.string().optional(),\n /** SearXNG instance base URL (e.g. http://localhost:8080) */\n url: z.string().optional(),\n disabled: z.boolean().optional(),\n});\n\nexport type SearchProviderEntry = z.infer<typeof SearchProviderEntrySchema>;\n\nexport const WebSearchConfigSchema = z.object({\n maxResults: z.number().default(5),\n /** Ordered API providers; empty → HTML fallback only */\n providers: z.array(SearchProviderEntrySchema).default([]),\n});\n\nexport type WebSearchConfig = z.infer<typeof WebSearchConfigSchema>;\n\nexport const WebsiteBlocklistSchema = z.object({\n /** Master switch. Default false (no blocking). */\n enabled: z.boolean().default(false),\n /** Domain patterns to block (e.g. \"example.com\", \"*.evil.org\"). */\n domains: z.array(z.string()).default([]),\n});\n\nexport type WebsiteBlocklistConfig = z.infer<typeof WebsiteBlocklistSchema>;\n\nexport const WebToolsConfigSchema = z.object({\n /** Search result HTML fallback: cn → Bing, otherwise DuckDuckGo */\n region: z.enum(['cn', 'global']).optional(),\n search: WebSearchConfigSchema.optional(),\n /** Domain blocklist for web_fetch / web_extract / browser tools. */\n blocklist: WebsiteBlocklistSchema.optional(),\n});\n\nexport type WebToolsConfig = z.infer<typeof WebToolsConfigSchema>;\n\nexport const ToolsConfigSchema = z.object({\n web: WebToolsConfigSchema.optional(),\n /**\n * Per-capability media providers. Currently only `audio` (STT) is wired;\n * `image` / `video` slots are reserved for future capabilities.\n */\n media: z.lazy(() => ToolsMediaConfigSchema),\n}).default({\n web: {\n search: {\n maxResults: 5,\n providers: [],\n },\n },\n});\n\n// ============================================\n// Gateway Configuration\n// ============================================\n\nexport const GatewayAuthRateLimitSchema = z\n .object({\n enabled: z.boolean().default(true),\n maxAttempts: z.number().int().min(1).default(5),\n windowMs: z.number().default(900_000),\n blockDurationMs: z.number().default(300_000),\n /** OpenClaw alias for blockDurationMs. */\n lockoutMs: z.number().optional(),\n /** Skip rate limiting for loopback client IPs (default true). Remote browser Origin requests never exempt. */\n exemptLoopback: z.boolean().default(true),\n /**\n * Coalesce same-client failures arriving within this window into a single\n * attempt. Absorbs SPA fan-out / SDK auto-retry storms without weakening\n * brute-force protection (deliberate attackers are still rate-limited to\n * one effective attempt per window). Set to 0 to disable.\n */\n burstCoalesceMs: z.number().int().min(0).default(1000),\n })\n .optional();\n\nexport const GatewaySecuritySchema = z\n .object({\n /** When true, non-loopback binds require explicit gateway.auth.rateLimit configuration. */\n strict: z.boolean().optional(),\n })\n .optional();\n\nexport const GatewayTrustedProxySchema = z\n .object({\n /** Header set by the reverse proxy with the authenticated user identity. */\n userHeader: z.string().min(1),\n /** Additional headers that must be present (e.g. proxy auth markers). */\n requiredHeaders: z.array(z.string()).optional(),\n /** When non-empty, only these user identities are allowed. */\n allowUsers: z.array(z.string()).optional(),\n /** Allow trusted-proxy auth when the TCP source is loopback (same-host reverse proxy). */\n allowLoopback: z.boolean().optional(),\n })\n .strict();\n\nexport const GatewayAuthSchema = z\n .object({\n mode: z.enum(['none', 'token', 'password', 'trusted-proxy']).default('token'),\n token: z.string().optional(),\n password: z.string().optional(),\n /** When true (default for Serve), browser UI may auth via Tailscale identity headers. API routes still require token. */\n allowTailscale: z.boolean().optional(),\n rateLimit: GatewayAuthRateLimitSchema,\n trustedProxy: GatewayTrustedProxySchema.optional(),\n })\n .default({\n mode: 'token',\n });\n\nexport const GatewayTailscaleConsentSchema = z.object({\n version: z.string().min(1),\n acceptedAt: z.string().min(1),\n});\n\nexport const GatewayTailscaleSchema = z\n .object({\n mode: z.enum(['off', 'serve', 'funnel']).default('off'),\n resetOnExit: z.boolean().default(true),\n consent: GatewayTailscaleConsentSchema.optional(),\n })\n .default({\n mode: 'off',\n resetOnExit: true,\n });\n\nexport const GatewayRemoteSchema = z.object({\n url: z.string().url(),\n token: z.string().optional(),\n password: z.string().optional(),\n transport: z.enum(['direct', 'ssh']).default('direct'),\n sshTarget: z.string().optional(),\n sshIdentity: z.string().optional(),\n tlsFingerprint: z.string().optional(),\n});\n\nexport const GatewayTlsSchema = z\n .object({\n enabled: z.boolean().default(false),\n autoGenerate: z.boolean().default(false),\n certPath: z.string().optional(),\n keyPath: z.string().optional(),\n })\n .default({\n enabled: false,\n autoGenerate: false,\n });\n\nexport const GatewayModeSchema = z.enum(['local', 'remote']).default('local');\n\nexport const HeartbeatConfigSchema = z\n .object({\n enabled: z.boolean(),\n intervalMs: z.number(),\n /** When false, heartbeat instructions are only sent during heartbeat polling turns (not in every chat system prompt). */\n includeSystemPromptSection: z.boolean().optional().default(false),\n target: z.string().optional(),\n targetChatId: z.string().optional(),\n prompt: z.string().optional(),\n ackMaxChars: z.number().optional(),\n isolatedSession: z.boolean().optional(),\n activeHours: z\n .object({\n start: z.string(),\n end: z.string(),\n timezone: z.string().optional(),\n })\n .optional(),\n })\n .default({\n enabled: true,\n intervalMs: 1_800_000,\n includeSystemPromptSection: false,\n });\n\nexport const GatewayChannelConnectDeferModeSchema = z.enum(['auto', 'off', 'explicit']);\n\nexport const TunnelConsentSchema = z.object({\n version: z.string().min(1),\n acceptedAt: z.string().min(1),\n});\n\nexport const TunnelConfigSchema = z\n .object({\n enabled: z.boolean().default(false),\n brokerUrl: z.string().url().default('https://frp.xopc.ai/api'),\n /** Broker register API secret (env `XOPC_TUNNEL_REGISTRATION_SECRET` overrides when set). */\n registrationSecret: z.string().min(1).optional(),\n autoStart: z.boolean().default(false),\n subdomain: z.string().optional(),\n consent: TunnelConsentSchema.optional(),\n })\n .default({\n enabled: false,\n brokerUrl: 'https://frp.xopc.ai/api',\n autoStart: false,\n });\n\nexport type TunnelConfig = z.infer<typeof TunnelConfigSchema>;\n\n/**\n * Workspace-scoped concerns (file import, etc.). Distinct from\n * `agents.defaults.workspace`, which is the workspace *path*; this block carries\n * feature configuration for workspace-related routes.\n */\nexport const WorkspaceImportConfigSchema = z.object({\n /** Workspace-relative subdir for imported files. Default `imports`. */\n targetDir: z.string().default('imports'),\n /** Per-file byte cap. Default 100 MiB. */\n maxBytes: z.number().int().min(1024).max(10_737_418_240).default(104_857_600),\n /** When false, the route rejects `onConflict: 'overwrite'`. Default true. */\n allowOverwrite: z.boolean().default(true),\n});\nexport type WorkspaceImportConfig = z.infer<typeof WorkspaceImportConfigSchema>;\n\nexport const WorkspaceConfigSchema = z.object({\n import: WorkspaceImportConfigSchema.optional(),\n}).optional();\nexport type WorkspaceConfig = z.infer<typeof WorkspaceConfigSchema>;\n\nexport const GatewayBindModeSchema = z.enum(['auto', 'loopback', 'lan', 'tailnet', 'custom']);\n\nexport const GatewayConfigSchema = z.object({\n /** Semantic bind mode. */\n bind: GatewayBindModeSchema.optional(),\n /** IPv4 listen address when `bind` is `custom`. */\n customBindHost: z.string().optional(),\n port: z.number().optional(),\n /** local: this process runs the gateway; remote: CLI clients target gateway.remote. */\n mode: GatewayModeSchema.optional(),\n /** Persistent remote gateway target for CLI/TUI/MCP when mode=remote. */\n remote: GatewayRemoteSchema.optional(),\n tailscale: GatewayTailscaleSchema.optional(),\n tls: GatewayTlsSchema.optional(),\n auth: GatewayAuthSchema.optional(),\n heartbeat: HeartbeatConfigSchema.optional(),\n maxSseConnections: z.number().optional(),\n corsOrigins: z.array(z.string()).optional(),\n /**\n * Reverse-proxy publicly reachable URL (e.g. `https://gateway.example.com`).\n * Optional. When set, mobile pairing surfaces this URL as the preferred\n * baseUrl and it is auto-added to the browser CORS/CSRF allowlist.\n * - Must be a URL with no path / query / userinfo.\n * - Must use `https:` for public hosts; `http:` is only allowed when the\n * hostname is in an RFC1918 / `.local` private range.\n */\n publicUrl: z\n .string()\n .superRefine((value, ctx) => {\n const result = validatePublicUrl(value);\n if (result.ok === false) {\n ctx.addIssue({ code: 'custom', message: `gateway.publicUrl: ${result.message}` });\n }\n })\n .optional(),\n /** Dangerous: allow browser Origin to match the HTTP Host header when not in corsOrigins. */\n dangerouslyAllowHostHeaderOriginFallback: z.boolean().optional(),\n /** CIDRs or exact IPs of reverse proxies allowed to terminate auth (trusted-proxy mode). */\n trustedProxies: z.array(z.string()).optional(),\n /** When true, fall back to X-Real-IP if X-Forwarded-For chain parsing fails. Default false (fail closed). */\n allowRealIpFallback: z.boolean().optional(),\n security: GatewaySecuritySchema,\n /**\n * How channel `start()` is split around HTTP listen when using `GatewayServer`.\n * - `auto` (default): defer ids come from channel plugin `meta.deferConnectUntilAfterListen` + enabled config.\n * - `off`: always start all channels in phase1 (troubleshooting / strict ordering).\n * - `explicit`: defer only `channelConnectDeferIds` (empty = defer none).\n */\n channelConnectDeferMode: GatewayChannelConnectDeferModeSchema.optional(),\n /** When `channelConnectDeferMode` is `explicit`, these channel plugin ids are deferred until after listen. */\n channelConnectDeferIds: z.array(z.string().min(1)).max(24).optional(),\n /** Removed from the defer set (applied after `auto` or `explicit` resolution). */\n channelConnectDeferSkipIds: z.array(z.string().min(1)).max(24).optional(),\n /** Default skills marketplace provider id. Built-in: 'store', 'skillhub', 'clawhub'. Extensions may register more. */\n skillsMarketplaceProvider: z.string().optional(),\n /** Base URL for the xopc skills marketplace (public REST API). */\n skillsStoreBaseUrl: z.string().url().optional(),\n /** File sharing configuration (temporary public download links for workspace files). */\n share: z.object({\n enabled: z.boolean().default(true),\n /** Default TTL in ms (default 24h). */\n defaultTtlMs: z.number().min(60_000).max(604_800_000).default(86_400_000),\n /** Maximum TTL in ms (default 7 days). */\n maxTtlMs: z.number().min(60_000).max(2_592_000_000).default(604_800_000),\n /** Maximum concurrent active shares (default 100). */\n maxActiveShares: z.number().min(1).max(10_000).default(100),\n /** Maximum shareable file size in bytes (default 100MB). */\n maxFileSize: z.number().min(1_048_576).max(10_737_418_240).default(104_857_600),\n /** MIME types allowed for inline preview (?inline=1). */\n inlinePreviewMimes: z.array(z.string()).default([\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n 'application/pdf',\n 'text/html',\n 'text/markdown',\n 'text/plain',\n 'application/json',\n ]),\n /** Folder-sharing controls (browse + ZIP). */\n directory: z.object({\n enabled: z.boolean().default(true),\n /** Maximum folder size in bytes at scan time (default 1 GB). */\n maxFolderSize: z.number().int().min(1_048_576).max(10_737_418_240).default(1_073_741_824),\n /** Maximum number of entries scanned for a single folder share. */\n maxFileCount: z.number().int().min(1).max(100_000).default(1_000),\n /** Traversal depth cap (defense against recursive symlinks). */\n maxDepth: z.number().int().min(1).max(64).default(20),\n /** In-memory directory listing cache TTL. */\n listingCacheMs: z.number().int().min(0).max(600_000).default(60_000),\n /** Maximum simultaneous ZIP streams per share token. */\n zipConcurrency: z.number().int().min(1).max(8).default(1),\n }).default({\n enabled: true,\n maxFolderSize: 1_073_741_824,\n maxFileCount: 1_000,\n maxDepth: 20,\n listingCacheMs: 60_000,\n zipConcurrency: 1,\n }),\n }).optional(),\n /** Site-share configuration (static directory or reverse-proxy a local dev server). */\n siteShare: z.object({\n enabled: z.boolean().default(true),\n /** Public host suffix that subdomain shares are served under. */\n publicHostSuffix: z.string().min(1).default('share.xopc.ai'),\n /** Default TTL in ms (default 6h, shorter than file shares — live app surface). */\n defaultTtlMs: z.number().int().min(60_000).max(604_800_000).default(21_600_000),\n /** Maximum TTL in ms (default 7 days). */\n maxTtlMs: z.number().int().min(60_000).max(2_592_000_000).default(604_800_000),\n /** Maximum concurrent active site shares. */\n maxActiveSites: z.number().int().min(1).max(1_000).default(5),\n static: z.object({\n enabled: z.boolean().default(true),\n /** Maximum total bytes of files served per static site. */\n maxRootDirSize: z.number().int().min(1_048_576).max(10_737_418_240).default(524_288_000),\n /** Maximum file count under root dir. */\n maxFileCount: z.number().int().min(1).max(100_000).default(10_000),\n /** Whether HTML/CSS rewrite of absolute paths is on by default. */\n rewriteEnabledByDefault: z.boolean().default(false),\n }).default({\n enabled: true,\n maxRootDirSize: 524_288_000,\n maxFileCount: 10_000,\n rewriteEnabledByDefault: false,\n }),\n proxy: z.object({\n /** Reverse-proxy mode default-enabled per the product brief. */\n enabled: z.boolean().default(true),\n /** Upstream host whitelist. Loopback by default. */\n allowedUpstreamHosts: z\n .array(z.string().min(1))\n .default(['127.0.0.1', 'localhost', '::1']),\n /** Upstream port whitelist (common dev-server ports). */\n allowedUpstreamPorts: z\n .array(z.number().int().min(1).max(65535))\n .default([3000, 3001, 4321, 5173, 8000, 8080, 8888, 9000]),\n /** Whether to forward WebSocket upgrades. */\n forwardWebSocket: z.boolean().default(true),\n /** Maximum request body size in bytes (50 MB). */\n bodySizeLimit: z.number().int().min(0).max(1_073_741_824).default(52_428_800),\n /** Per-request HTTP timeout in ms. */\n requestTimeoutMs: z.number().int().min(1_000).max(600_000).default(30_000),\n /** Per-WebSocket idle timeout in ms. */\n wsIdleTimeoutMs: z.number().int().min(10_000).max(3_600_000).default(300_000),\n /** Rewrite Set-Cookie Path attribute (subpath mode only). */\n rewriteSetCookiePath: z.boolean().default(true),\n }).default({\n enabled: true,\n allowedUpstreamHosts: ['127.0.0.1', 'localhost', '::1'],\n allowedUpstreamPorts: [3000, 3001, 4321, 5173, 8000, 8080, 8888, 9000],\n forwardWebSocket: true,\n bodySizeLimit: 52_428_800,\n requestTimeoutMs: 30_000,\n wsIdleTimeoutMs: 300_000,\n rewriteSetCookiePath: true,\n }),\n }).optional(),\n}).default({\n bind: 'loopback',\n port: 18790,\n auth: {\n mode: 'token',\n },\n heartbeat: {\n enabled: true,\n intervalMs: 1_800_000,\n includeSystemPromptSection: false,\n },\n maxSseConnections: 100,\n corsOrigins: [],\n skillsMarketplaceProvider: 'skillhub',\n skillsStoreBaseUrl: 'https://store.xopc.ai',\n});\n\nexport const CronConfigSchema = z.object({\n enabled: z.boolean().optional(),\n maxConcurrentJobs: z.number().optional(),\n defaultTimezone: z.string().optional(),\n historyRetentionDays: z.number().optional(),\n enableMetrics: z.boolean().optional(),\n}).default({\n enabled: true,\n maxConcurrentJobs: 5,\n defaultTimezone: 'UTC',\n historyRetentionDays: 7,\n enableMetrics: true,\n});\n\nexport const ModelsDevConfigSchema = z.object({\n enabled: z.boolean().default(true),\n}).default({\n enabled: true,\n});\n\n// ============================================\n// STT (Speech-to-Text) Config\n// ============================================\n\nconst SttProviderConfigCatchallSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n]);\n\nexport const STTProviderConfigSchema = z\n .object({\n apiKey: z.string().optional(),\n model: z.string().optional(),\n baseUrl: z.string().optional(),\n headers: z.record(z.string(), z.string()).optional(),\n language: z.string().optional(),\n prompt: z.string().optional(),\n })\n .catchall(SttProviderConfigCatchallSchema);\n\nexport const STTFallbackConfigSchema = z.object({\n enabled: z.boolean().default(true),\n order: z.array(z.string().min(1)).default(['alibaba', 'openai']),\n});\n\nexport const MediaUnderstandingCapabilitiesSchema = z\n .array(z.enum(['image', 'audio', 'video']))\n .optional();\n\nexport const MediaUnderstandingModelSchema = z\n .object({\n provider: z.string().optional(),\n model: z.string().optional(),\n capabilities: MediaUnderstandingCapabilitiesSchema,\n type: z.union([z.literal('provider'), z.literal('cli')]).optional(),\n command: z.string().optional(),\n baseUrl: z.string().optional(),\n headers: z.record(z.string(), z.string()).optional(),\n apiKey: z.string().optional(),\n language: z.string().optional(),\n prompt: z.string().optional(),\n })\n .catchall(SttProviderConfigCatchallSchema);\n\nexport const STTConfigSchema = z\n .object({\n enabled: z.boolean().default(false),\n /** Primary provider id — any registered MediaUnderstandingProvider id. */\n provider: z.string().min(1).default('alibaba'),\n fallback: STTFallbackConfigSchema.optional(),\n timeoutMs: z.number().int().min(1000).max(180000).optional(),\n /** Ordered model entries for this capability (OpenClaw `tools.media.audio.models`). */\n models: z.array(MediaUnderstandingModelSchema).optional(),\n /** Provider settings map keyed by provider id. */\n providers: z.record(z.string(), STTProviderConfigSchema).optional(),\n })\n .strict();\n\n// ============================================\n// TTS (Text-to-Speech) Config\n// ============================================\n\nconst TtsProviderConfigCatchallSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n]);\n\nexport const TTSProviderConfigSchema = z\n .object({\n apiKey: z.string().optional(),\n model: z.string().optional(),\n voice: z.string().optional(),\n })\n .catchall(TtsProviderConfigCatchallSchema);\n\nexport const TTSFallbackConfigSchema = z.object({\n enabled: z.boolean().default(true),\n order: z\n .array(z.string().min(1))\n .default(['openai', 'alibaba', 'minimax', 'edge']),\n});\n\nexport const TTSModelOverridesConfigSchema = z.object({\n enabled: z.boolean().default(true),\n allowText: z.boolean().default(true),\n allowProvider: z.boolean().default(false),\n allowVoice: z.boolean().default(true),\n allowModelId: z.boolean().default(true),\n allowVoiceSettings: z.boolean().default(false),\n allowNormalization: z.boolean().default(false),\n allowSeed: z.boolean().default(false),\n});\n\nexport const TTSEdgeConfigSchema = z.object({\n enabled: z.boolean().default(true),\n voice: z.string().optional(),\n lang: z.string().optional(),\n outputFormat: z.string().optional(),\n pitch: z.string().optional(),\n rate: z.string().optional(),\n volume: z.string().optional(),\n proxy: z.string().optional(),\n timeoutMs: z.number().int().min(1000).max(120000).optional(),\n});\n\nexport const TTSSummarizationConfigSchema = z.object({\n enabled: z.boolean().optional(),\n targetLength: z.number().int().min(1).optional(),\n threshold: z.number().int().min(1).optional(),\n model: z.string().optional(),\n});\n\nexport const TTSConfigSchema = z\n .object({\n enabled: z.boolean().default(false),\n /** Primary provider id — any registered SpeechProviderPlugin id. */\n provider: z.string().min(1).default('openai'),\n trigger: z.enum(['off', 'always', 'inbound', 'tagged']).default('always'),\n fallback: TTSFallbackConfigSchema.optional(),\n maxTextLength: z.number().int().min(1).default(512), // Conservative default to accommodate all providers (Alibaba limit is 512)\n timeoutMs: z.number().int().min(1000).max(180000).default(60000),\n summarization: TTSSummarizationConfigSchema.optional(),\n modelOverrides: TTSModelOverridesConfigSchema.optional(),\n /** Provider settings map keyed by provider id. */\n providers: z.record(z.string(), TTSProviderConfigSchema).optional(),\n })\n .strict();\n\n// ============================================\n// messages.* — delivery / presentation concerns\n// ============================================\n\nexport const MessagesConfigSchema = z.object({\n /** Voice (text-to-speech) output configuration. */\n tts: TTSConfigSchema.optional(),\n}).optional();\n\nexport const ToolsMediaAudioConfigSchema = STTConfigSchema;\n\nexport const ToolsMediaConfigSchema = z\n .object({\n /** Shared model entries applied across media capabilities when entry lacks capabilities. */\n models: z.array(MediaUnderstandingModelSchema).optional(),\n /** Audio (speech-to-text) capability provider config. */\n audio: ToolsMediaAudioConfigSchema.optional(),\n })\n .optional();\n\n// ============================================\n// Provider Configs (capability providers: image / audio / video)\n// ============================================\n\n/**\n * Optional Azure OpenAI overrides used when an OpenAI image-generation\n * request should hit an Azure deployment instead of `api.openai.com`.\n *\n * URL template (when present):\n * `https://<resource>.openai.azure.com/openai/deployments/<deployment>/images/generations?api-version=<apiVersion>`\n */\nexport const ProviderAzureConfigSchema = z\n .object({\n /** Azure resource name (subdomain before `.openai.azure.com`). */\n resource: z.string().min(1).optional(),\n /** Azure deployment id (configured per model). */\n deployment: z.string().min(1).optional(),\n /** Azure REST API version, e.g. `2024-08-01-preview`. */\n apiVersion: z.string().min(1).optional(),\n })\n .strict();\n\n/** Per-vendor request overrides applied by the provider HTTP layer. */\nexport const ProviderRequestOverridesSchema = z\n .object({\n /** Hard cap for a single HTTP call (ms). */\n timeoutMs: z.number().int().positive().optional(),\n /** Extra headers merged into every outbound request. */\n headers: z.record(z.string(), z.string()).optional(),\n })\n .strict();\n\n/**\n * Generic per-vendor provider config — used by image / audio / video\n * capability providers via `cfg.providers.<id>`. Kept loose (`.strict()` but\n * everything optional) so adding a new vendor never requires a config\n * migration.\n */\nexport const ProviderAuthConfigSchema = z\n .object({\n /** Static API key (api-key / azure-key modes). */\n apiKey: z.string().optional(),\n /** Override the default REST base URL. */\n baseUrl: z.string().url().optional(),\n /** Vendor region (DashScope: `beijing` / `singapore`; AWS: region id). */\n region: z.string().optional(),\n /** Image-only base URL override (DashScope splits image vs LLM). */\n imageBaseUrl: z.string().url().optional(),\n /** Per-vendor request overrides. */\n request: ProviderRequestOverridesSchema.optional(),\n /** Azure OpenAI deployment overrides; only consumed by OpenAI image provider. */\n azure: ProviderAzureConfigSchema.optional(),\n })\n .strict();\n\nexport type ProviderAuthConfig = z.infer<typeof ProviderAuthConfigSchema>;\n\n/**\n * `cfg.providers.<id>` is keyed by provider id (`openai`, `dashscope`,\n * `minimax`, `google`, `fal`, …). Every entry is optional and validated by\n * {@link ProviderAuthConfigSchema}.\n */\nexport const ProvidersConfigSchema = z.record(z.string(), ProviderAuthConfigSchema);\n\nexport type ProvidersConfig = z.infer<typeof ProvidersConfigSchema>;\n\n// ============================================\n// Extension Configs \n// ============================================\n\n// Security config for extensions \nexport const ExtensionSecurityConfigSchema = z.object({\n checkPermissions: z.boolean().default(true),\n allowUntrusted: z.boolean().default(false),\n allow: z.array(z.string()).default([]),\n trackProvenance: z.boolean().default(true),\n allowPromptInjection: z.boolean().default(false),\n});\n\n// Slot config for extensions \nexport const ExtensionSlotsConfigSchema = z.object({\n memory: z.string().optional(),\n tts: z.string().optional(),\n imageGeneration: z.string().optional(),\n webSearch: z.string().optional(),\n});\n\n// Complete extensions config\n// Extension config allows both known fields AND arbitrary extension-specific config\n// Known fields: enabled (array), allow (array), security (object), slots (object)\n// Arbitrary: any other key is extension-specific config (e.g., extensions.hello.greeting)\nexport const ExtensionsConfigSchema: z.ZodType<Record<string, unknown>> = z.record(z.string(), z.unknown());\n\n// ============================================\n// Update Config\n// ============================================\n\nexport const UpdateAutoConfigSchema = z\n .object({\n /** Enable automatic update installation. Default false. */\n enabled: z.boolean().default(false),\n /** Hours to wait before applying a stable update after first detection. */\n stableDelayHours: z.number().min(0).default(6),\n /** Additional random jitter hours for stable rollout (avoids thundering herd). */\n stableJitterHours: z.number().min(0).default(12),\n /** How often to re-check for beta updates (hours). Min 0.25. */\n betaCheckIntervalHours: z.number().min(0.25).default(1),\n })\n .strict()\n .optional();\n\n/** Persistent `/goal` (Ralph loop) — Hermes-aligned defaults. */\nexport const GoalsConfigSchema = z\n .object({\n /** Max continuation turns before auto-pause (Hermes default 20). */\n maxTurns: z.number().int().min(1).max(500).default(20),\n /** Optional judge model ref; defaults to `agents.defaults.model`. */\n judgeModelRef: z.string().optional(),\n /**\n * When true (default), first post-turn runs a decomposition judge to build a checklist;\n * subsequent turns evaluate progress per item (Hermes-style). When false, use legacy freeform judge only.\n */\n checklistMode: z.boolean().default(true),\n /** Auto-pause after this many consecutive judge JSON/tool parse failures (Hermes default 3). */\n maxConsecutiveParseFailures: z.number().int().min(1).max(20).default(3),\n /** Judge LLM call timeout in ms (Hermes uses 60s). */\n judgeTimeoutMs: z.number().int().min(5_000).max(120_000).default(60_000),\n /** Max characters of recent transcript JSON passed to the checklist judge as extra context. */\n checklistHistoryChars: z.number().int().min(0).max(100_000).default(24_000),\n })\n .strict();\n\nexport type GoalsConfig = z.infer<typeof GoalsConfigSchema>;\n\nexport const UpdateConfigSchema = z\n .object({\n /** Check for updates on gateway startup. Default true. */\n checkOnStart: z.boolean().default(true),\n /** Update channel: stable (default), beta, or dev. */\n channel: z.enum(['stable', 'beta', 'dev']).default('stable'),\n /** Automatic update policy. */\n auto: UpdateAutoConfigSchema,\n })\n .strict()\n .optional();\n\nexport type UpdateConfig = z.infer<typeof UpdateConfigSchema>;\n\nexport const CommandsConfigSchema = z\n .object({\n restart: z.boolean().optional(),\n })\n .strict()\n .optional();\n\nexport type CommandsConfig = z.infer<typeof CommandsConfigSchema>;\n\n// ============================================\n// MCP (Model Context Protocol)\n// ============================================\n\nconst McpHttpUrlSchema = z\n .string()\n .url()\n .refine((value) => {\n try {\n const protocol = new URL(value).protocol;\n return protocol === 'http:' || protocol === 'https:';\n } catch {\n return false;\n }\n }, 'MCP server URL must use http or https');\n\nexport const McpServerSchema = z\n .object({\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),\n cwd: z.string().optional(),\n workingDirectory: z.string().optional(),\n url: McpHttpUrlSchema.optional(),\n transport: z.enum(['sse', 'streamable-http']).optional(),\n headers: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional(),\n connectionTimeoutMs: z.number().finite().positive().optional(),\n })\n .catchall(z.unknown())\n .superRefine((value, ctx) => {\n const hasCommand = typeof value.command === 'string' && value.command.trim().length > 0;\n const hasUrl = typeof value.url === 'string' && value.url.trim().length > 0;\n if (hasCommand && hasUrl) {\n ctx.addIssue({\n code: 'custom',\n message: 'MCP server cannot define both command and url',\n });\n }\n });\n\nexport const McpConfigSchema = z\n .object({\n servers: z.record(z.string(), McpServerSchema).optional(),\n sessionIdleTtlMs: z.number().finite().min(0).optional(),\n })\n .strict()\n .optional();\n\nexport type McpServerConfig = z.infer<typeof McpServerSchema>;\nexport type McpConfig = z.infer<typeof McpConfigSchema>;\n\n// ============================================\n// Root Config\n// ============================================\n\nexport const ConfigSchema = z.object({\n agents: AgentsConfigSchema,\n bindings: BindingsConfigSchema,\n session: SessionConfigSchema,\n channels: ChannelsConfigSchema,\n gateway: GatewayConfigSchema,\n tunnel: TunnelConfigSchema.optional(),\n workspace: WorkspaceConfigSchema,\n tools: ToolsConfigSchema,\n mcp: McpConfigSchema,\n cron: CronConfigSchema,\n goals: GoalsConfigSchema.optional(),\n extensions: ExtensionsConfigSchema.default({}),\n /** Per-vendor capability provider config (image / audio / video). */\n providers: ProvidersConfigSchema.optional(),\n modelsDev: ModelsDevConfigSchema,\n /** Delivery / presentation concerns (currently `tts`). */\n messages: MessagesConfigSchema,\n update: UpdateConfigSchema,\n commands: CommandsConfigSchema,\n}).default({\n agents: {\n defaults: {\n workspace: '~/.xopc/workspace',\n // `model` is intentionally omitted — resolved dynamically at runtime.\n maxTokens: 8192,\n temperature: 0.7,\n maxToolIterations: 20,\n maxRequestsPerTurn: 50,\n maxToolFailuresPerTurn: 3,\n thinkingDefault: 'medium',\n reasoningDefault: 'stream',\n verboseDefault: 'full',\n compaction: {\n enabled: true,\n mode: 'default',\n reserveTokens: 8000,\n triggerThreshold: 0.8,\n minMessagesBeforeCompact: 10,\n keepRecentMessages: 5,\n evictionWindow: 0.2,\n retentionWindow: 6,\n },\n pruning: {\n enabled: true,\n maxToolResultChars: 10000,\n headKeepRatio: 0.3,\n tailKeepRatio: 0.3,\n },\n browser: {\n backend: 'extension',\n },\n },\n },\n bindings: [],\n session: {\n scope: 'per-sender' as const,\n mainKey: 'main',\n dmScope: 'main' as const,\n },\n channels: {\n telegram: {\n enabled: false,\n allowFrom: [],\n groupAllowFrom: [],\n debug: false,\n accounts: {\n default: {\n accountId: 'default',\n enabled: true,\n botToken: '',\n allowFrom: [],\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n streamMode: 'partial' as const,\n },\n },\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n },\n },\n gateway: {\n bind: 'loopback',\n port: 18790,\n auth: {\n mode: 'token',\n },\n heartbeat: {\n enabled: true,\n intervalMs: 1_800_000,\n includeSystemPromptSection: false,\n },\n maxSseConnections: 100,\n corsOrigins: [],\n skillsMarketplaceProvider: 'skillhub',\n skillsStoreBaseUrl: 'https://store.xopc.ai',\n },\n tools: {\n web: {\n search: {\n maxResults: 5,\n providers: [],\n },\n },\n },\n cron: {\n enabled: true,\n maxConcurrentJobs: 5,\n defaultTimezone: 'UTC',\n historyRetentionDays: 7,\n enableMetrics: true,\n },\n goals: {\n maxTurns: 20,\n checklistMode: true,\n maxConsecutiveParseFailures: 3,\n judgeTimeoutMs: 60_000,\n checklistHistoryChars: 24_000,\n },\n extensions: {\n allow: [],\n security: {\n checkPermissions: true,\n allowUntrusted: false,\n allow: [],\n trackProvenance: true,\n allowPromptInjection: false,\n },\n slots: {},\n },\n modelsDev: {\n enabled: true,\n },\n // messages.tts / tools.media.audio start undefined; the factory layer fills\n // in provider-level defaults (model/voice) on demand. Fresh configs don't\n // ship with enabled providers so they never make surprise STT/TTS calls.\n});\n\nexport type Config = z.infer<typeof ConfigSchema>;\nexport type AgentDefaults = z.infer<typeof AgentDefaultsSchema>;\nexport type GatewayAuthConfig = z.infer<typeof GatewayAuthSchema>;\nexport type GatewayTrustedProxyConfig = z.infer<typeof GatewayTrustedProxySchema>;\nexport type GatewayAuthRateLimitConfig = z.infer<typeof GatewayAuthRateLimitSchema>;\nexport type GatewayBindMode = z.infer<typeof GatewayBindModeSchema>;\nexport type STTConfig = z.infer<typeof STTConfigSchema>;\nexport type TTSConfig = z.infer<typeof TTSConfigSchema>;\n\n// ============================================\n// Helper Functions\n// ============================================\n\n/**\n * Parse a model reference string.\n */\nexport interface ParsedModelRef {\n provider: string;\n model: string;\n}\n\n/**\n * Primary model ref from `agents.defaults.model`. Returns undefined when unset.\n */\nexport function getAgentDefaultModelRef(config: Config): string | undefined {\n const ref = config.agents?.defaults?.model?.primary?.trim();\n return ref || undefined;\n}\n\n/** `provider/model` or null when invalid. */\nexport function parseModelRef(ref: string): ParsedModelRef | null {\n const trimmed = ref.trim();\n const idx = trimmed.indexOf('/');\n if (idx <= 0 || idx === trimmed.length - 1) {\n return null;\n }\n return { provider: trimmed.slice(0, idx).trim(), model: trimmed.slice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;GACb,aAAa;GACb,cAAc;GACd,gBAAgB;GACjB,EACF;EACD,SAAS;GACP,MAAM;GACN,MAAM;GACN,MAAM,EACJ,MAAM,SACP;GACD,WAAW;IACT,SAAS;IACT,YAAY;IACZ,4BAA4B;IAC7B;GACD,mBAAmB;GACnB,aAAa,EAAE;GACf,2BAA2B;GAC3B,oBAAoB;GACrB;EACD,OAAO,EACL,KAAK,EACH,QAAQ;GACN,YAAY;GACZ,WAAW,EAAE;GACd,EACF,EACF;EACD,MAAM;GACJ,SAAS;GACT,mBAAmB;GACnB,iBAAiB;GACjB,sBAAsB;GACtB,eAAe;GAChB;EACD,OAAO;GACL,UAAU;GACV,eAAe;GACf,6BAA6B;GAC7B,gBAAgB;GAChB,uBAAuB;GACxB;EACD,YAAY;GACV,OAAO,EAAE;GACT,UAAU;IACR,kBAAkB;IAClB,gBAAgB;IAChB,OAAO,EAAE;IACT,iBAAiB;IACjB,sBAAsB;IACvB;GACD,OAAO,EAAE;GACV;EACD,WAAW,EACT,SAAS,MACV;EAIF,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../../../src/config/schema.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { checkCacheDir } from '../browser/cache-dir-policy.js';\nimport { LocalizedTextSchema } from './localized-text.js';\nimport { validatePublicUrl } from './public-url.js';\n\n// ============================================\n// Agent Configs\n// ============================================\n\n/**\n * Agent model ref. Always an object with explicit `primary` and optional\n * `fallbacks` chain. No string-form shorthand — every write site builds the\n * object explicitly so reads never branch on shape.\n */\nexport const AgentModelRefSchema = z\n .object({\n primary: z.string().min(1),\n fallbacks: z.array(z.string()).optional(),\n })\n .strict();\n\nexport type AgentModelConfig = z.infer<typeof AgentModelRefSchema>;\n\n/**\n * Image-generation model ref. {@link AgentModelRefSchema} plus runtime knobs\n * (`timeoutMs`, `autoProviderFallback`) used by the image-generation runtime.\n */\nexport const AgentImageGenerationModelSchema = z\n .object({\n primary: z.string().min(1),\n fallbacks: z.array(z.string()).optional(),\n /** Hard cap for the whole generation attempt (ms). */\n timeoutMs: z.number().int().positive().optional(),\n /**\n * When all `primary + fallbacks` candidates fail, sweep every other\n * configured provider before giving up.\n */\n autoProviderFallback: z.boolean().optional(),\n })\n .strict();\n\nexport type AgentImageGenerationModelConfig = z.infer<typeof AgentImageGenerationModelSchema>;\n\n/** Named model role for workflows (e.g. `small`, `large`). Maps to a concrete `provider/model` ref. */\nexport const AgentTypedModelSchema = z\n .object({\n id: z.string().min(1).regex(/^[a-z][a-z0-9_-]{0,63}$/),\n description: z.string().max(500).optional(),\n model: z.string().min(1),\n })\n .strict()\n .superRefine((entry, ctx) => {\n const trimmed = entry.model.trim();\n const idx = trimmed.indexOf('/');\n if (idx <= 0 || idx === trimmed.length - 1) {\n ctx.addIssue({\n code: 'custom',\n message: `model must be provider/model format (got '${entry.model}')`,\n path: ['model'],\n });\n }\n });\n\nexport type AgentTypedModel = z.infer<typeof AgentTypedModelSchema>;\n\nconst AgentTypedModelsArraySchema = z\n .array(AgentTypedModelSchema)\n .optional()\n .superRefine((arr, ctx) => {\n if (!arr) return;\n const seen = new Set<string>();\n for (let i = 0; i < arr.length; i++) {\n const id = arr[i]!.id;\n if (seen.has(id)) {\n ctx.addIssue({\n code: 'custom',\n message: `duplicate typed model id '${id}'`,\n path: [i, 'id'],\n });\n }\n seen.add(id);\n }\n });\n\nexport const AgentDefaultsSchema = z.object({\n /** Parent directory: each agent’s Markdown root is `<expanded>/<agentId>/` (e.g. `.../workspace/main`). */\n workspace: z.string().default('~/.xopc/workspace'),\n /** Default model for new sessions. Optional — runtime resolves a fallback when unset. */\n model: AgentModelRefSchema.optional(),\n /** Named model roles (e.g. `small`, `large`) for workflows and other callers. */\n models: AgentTypedModelsArraySchema,\n /** Vision / image understanding model (provider/model). Falls back to heuristics when unset. */\n imageModel: AgentModelRefSchema.optional(),\n /** Image generation model (provider/model), e.g. openai/gpt-image-1. Supports plugin-based providers (OpenAI / DashScope / MiniMax / Google / Fal). */\n imageGenerationModel: AgentImageGenerationModelSchema.optional(),\n /** Max image size for image tool loads (MB). */\n mediaMaxMb: z.number().positive().optional(),\n maxTokens: z.number().default(8192),\n temperature: z.number().default(0.7),\n maxToolIterations: z.number().default(20),\n // Wall-clock limit for one user turn (LLM + tools). Default 30m if unset; cap 4h.\n maxTaskDurationMs: z.number().min(60000).max(14_400_000).optional(),\n // Reliability settings\n maxRequestsPerTurn: z.number().min(10).max(200).default(50),\n maxToolFailuresPerTurn: z.number().min(1).max(20).default(3),\n // Thinking ability settings\n thinkingDefault: z.enum(['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'adaptive']).optional(),\n reasoningDefault: z.enum(['off', 'on', 'stream']).optional(),\n verboseDefault: z.enum(['off', 'on', 'full']).optional(),\n bootstrapMaxChars: z.number().int().positive().optional(),\n bootstrapTotalMaxChars: z.number().int().positive().optional(),\n bootstrapPromptTruncationWarning: z.enum(['off', 'once', 'always']).optional(),\n startupContext: z\n .object({\n enabled: z.boolean().optional(),\n applyOn: z.array(z.enum(['new', 'reset'])).optional(),\n dailyMemoryDays: z.number().int().min(1).optional(),\n maxFileBytes: z.number().int().positive().optional(),\n maxFileChars: z.number().int().positive().optional(),\n maxTotalChars: z.number().int().positive().optional(),\n })\n .optional(),\n contextLimits: z\n .object({\n postCompactionMaxChars: z.number().int().positive().optional(),\n })\n .optional(),\n compaction: z.object({\n enabled: z.boolean().default(true),\n mode: z.enum(['default', 'safeguard']).default('default'),\n reserveTokens: z.number().default(8000),\n triggerThreshold: z.number().min(0.5).max(0.95).default(0.8),\n minMessagesBeforeCompact: z.number().default(10),\n keepRecentMessages: z.number().default(5),\n // Dual-strategy compaction\n evictionWindow: z.number().min(0.1).max(0.5).default(0.2),\n retentionWindow: z.number().min(3).max(20).default(6),\n postCompactionSections: z.array(z.string()).optional(),\n }).optional(),\n pruning: z.object({\n enabled: z.boolean().default(true),\n maxToolResultChars: z.number().default(10000),\n headKeepRatio: z.number().default(0.3),\n tailKeepRatio: z.number().default(0.3),\n }).optional(),\n /**\n * Curated memory (`agents/<id>/memories/`) + pluggable external provider.\n * Only one external provider at a time.\n */\n memory: z\n .object({\n /** Master switch: `curated_memory` tool, prefetch, and external provider. Default true. */\n enabled: z.boolean().optional(),\n /** When false, disable curated_memory tool and memory subsystem helpers. Default true. */\n useEnhancedSystem: z.boolean().optional(),\n /** Include USER.md in snapshot. Default true. */\n userProfileEnabled: z.boolean().optional(),\n memoryCharLimit: z.number().positive().optional(),\n userCharLimit: z.number().positive().optional(),\n provider: z.enum(['none', 'stub']).optional(),\n /** How often prefetched external memory is injected into the user message. */\n injectionFrequency: z.enum(['every-turn', 'first-turn']).optional(),\n /** Inject prefetch on turns 1, 1+N, 1+2N, … (only when injectionFrequency is every-turn). Min 1. */\n contextCadence: z.number().int().min(1).optional(),\n /** Reserved for future external “dialectic” sync cadence (not wired yet). */\n dialecticCadence: z.number().int().min(1).optional(),\n /**\n * Background memory consolidation (\"dreaming\"): three-phase sleep model that\n * promotes short-term recall signals into long-term memory (`MEMORY.md`).\n *\n * Phases:\n * - **light** — fast, frequent sweep (default every 6 h): dedup + signal collection.\n * - **deep** — daily deep promotion (default 3 AM): score-gated write to MEMORY.md.\n * - **rem** — weekly pattern discovery (default Sun 5 AM): cross-session insight mining.\n */\n dreaming: z\n .object({\n enabled: z.boolean().optional(),\n /** Default deep-phase cron when `phases.deep.cron` is omitted. */\n frequency: z.string().optional(),\n timezone: z.string().optional(),\n phases: z\n .object({\n light: z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().optional(),\n lookbackDays: z.number().int().min(1).optional(),\n limit: z.number().int().min(0).optional(),\n dedupeSimilarity: z.number().min(0).max(1).optional(),\n })\n .optional(),\n deep: z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().optional(),\n minScore: z.number().min(0).max(1).optional(),\n minRecallCount: z.number().int().min(1).optional(),\n minUniqueQueries: z.number().int().min(1).optional(),\n limit: z.number().int().min(0).optional(),\n recencyHalfLifeDays: z.number().min(1).optional(),\n maxAgeDays: z.number().int().min(1).optional(),\n })\n .optional(),\n rem: z\n .object({\n enabled: z.boolean().optional(),\n cron: z.string().optional(),\n lookbackDays: z.number().int().min(1).optional(),\n limit: z.number().int().min(0).optional(),\n minPatternStrength: z.number().min(0).max(1).optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional(),\n })\n .optional(),\n /** Cross-session transcript search (`session_search` tool). */\n sessionSearch: z\n .object({\n /** Model ref for per-session summaries (e.g. openai/gpt-4o-mini). */\n summaryModel: z.string().optional(),\n })\n .optional(),\n /**\n * Post-turn background review (Hermes-style): optional quiet follow-up that may call\n * `curated_memory` / `skill_manage` so durable facts and reusable workflows persist\n * without bloating the main user-visible turn.\n */\n backgroundReview: z\n .object({\n /** When true, nudges may run after successful turns. Default false (opt-in). */\n enabled: z.boolean().optional(),\n /** User-turn cadence for memory review. 0 disables the memory channel. Default 10. */\n memoryNudgeInterval: z.number().int().min(0).optional(),\n /** LLM rounds without `skill_manage` before a skill review. 0 disables the skill channel. Default 10. */\n skillNudgeInterval: z.number().int().min(0).optional(),\n /** Max tool executions for the review agent. Default 8. */\n maxToolRounds: z.number().int().min(1).max(32).optional(),\n /** Max prior messages passed into the review context (tail). Default 80. */\n maxHistoryMessages: z.number().int().min(10).max(200).optional(),\n /** Wall-clock cap for the review run (ms). Default 120000. */\n maxDurationMs: z.number().int().min(30_000).max(600_000).optional(),\n })\n .optional(),\n /** LLM pass for `web_extract` (markdown-focused extraction). */\n webExtract: z\n .object({\n model: z.string().optional(),\n maxLength: z.number().positive().optional(),\n })\n .optional(),\n /**\n * Browser capability via unified `browser_use` tool. Enabled by default (set `enabled: false` to disable).\n * The local Playwright backend requires Chromium on the gateway host: `npx playwright install chromium`.\n */\n browser: z\n .object({\n enabled: z.boolean().optional(),\n /** Run browser in headless mode (default: false — visible window). */\n headless: z.boolean().optional(),\n /** When true, skip private-IP blocking for browser navigation (cloud metadata endpoints are always blocked). */\n allowPrivateUrls: z.boolean().optional(),\n /** Browser command timeout in seconds (default: 30). */\n commandTimeout: z.number().min(5).optional(),\n /** Browser backend mode (default: 'extension'). Also: 'local' (Playwright), 'cdp', 'cloud', or 'cloakbrowser'. */\n backend: z.enum(['local', 'cdp', 'cloud', 'extension', 'cloakbrowser']).optional(),\n /** Cloud browser backend: 'local' (default Playwright), 'browserbase', or 'browser-use'. */\n cloudProvider: z.enum(['local', 'browserbase', 'browser-use']).optional(),\n /** Cloud browser credentials and optional session hints. */\n cloud: z.object({\n /** API key for the selected cloud provider. Environment variables are still supported as fallback. */\n apiKey: z.string().optional(),\n /** Browserbase project id. Falls back to BROWSERBASE_PROJECT_ID. */\n projectId: z.string().optional(),\n /** Optional cloud provider region. */\n region: z.string().optional(),\n }).optional(),\n /** Direct CDP WebSocket endpoint URL (bypasses cloud provider). */\n cdpUrl: z.string().optional(),\n /** Chrome Extension bridge settings (only used when backend = 'extension'). */\n extension: z.object({\n /** WebSocket server port. Default: 19820. */\n port: z.number().min(1024).max(65535).optional(),\n /** Host to bind. Default: 127.0.0.1. */\n host: z.string().optional(),\n /** Timeout waiting for extension connection (ms). Default: 30000. */\n connectionTimeout: z.number().min(1000).optional(),\n }).optional(),\n /** JS dialog handling policy: 'must_respond' (agent must act), 'auto_dismiss', or 'auto_accept'. */\n dialogPolicy: z.enum(['must_respond', 'auto_dismiss', 'auto_accept']).optional(),\n /** Dialog auto-dismiss/accept timeout in seconds (default: 300). */\n dialogTimeoutSeconds: z.number().min(1).optional(),\n /** Enable humanized input simulation (Bezier mouse, per-char typing, wheel scroll). Default: false. */\n humanize: z.boolean().optional(),\n /** Humanize behavior preset: 'default' (fast) or 'careful' (slower, more realistic). Default: 'careful'. */\n humanPreset: z.enum(['default', 'careful']).optional(),\n /** CloakBrowser settings (only used when backend = 'cloakbrowser'). */\n cloakbrowser: z.object({\n /** Keep browser process alive between tasks. Default: true. */\n keepOpen: z.boolean().optional(),\n /** Create a temporary profile directory, cleaned up on close. Default: false. */\n temporaryProfile: z.boolean().optional(),\n /** Directory for cached CloakBrowser binaries. Must live under the user's home directory. Default: ~/.xopc/bin/cloakbrowser. */\n cacheDir: z\n .string()\n .optional()\n .superRefine((v, ctx) => {\n const r = checkCacheDir(v);\n if (r.ok === false) ctx.addIssue({ code: 'custom', message: r.message });\n }),\n /** Override the CloakBrowser binary path (skip auto-download). */\n binaryPath: z.string().optional(),\n /** Timezone to emulate (e.g. \"America/New_York\"). */\n timezone: z.string().optional(),\n /** Locale to emulate (e.g. \"en-US\"). */\n locale: z.string().optional(),\n /** Public IP for WebRTC leak prevention. */\n webrtcIp: z.string().optional(),\n /** Platform to emulate in fingerprint (e.g. \"windows\", \"macos\"). */\n fingerprintPlatform: z.string().optional(),\n /** Extra Chromium launch args (override defaults with same --key= prefix). */\n extraArgs: z.array(z.string()).optional(),\n }).optional(),\n })\n .optional(),\n /** Sub-agent delegation (`delegate_task`). Opt-in. */\n delegate: z\n .object({\n enabled: z.boolean().optional(),\n })\n .optional(),\n /** Sandboxed `execute_code` (programmatic tool calls). Opt-in. */\n executeCode: z\n .object({\n enabled: z.boolean().optional(),\n })\n .optional(),\n /**\n * Dynamic workflows (`workflow` tool). On by default — disable to remove the\n * tool from the agent surface entirely. Subagents spawned by workflows still\n * obey the global `delegate` allowlist; `maxSubagents` caps a single workflow\n * run, `defaultTimeoutSec` caps wall-clock per run.\n */\n workflow: z\n .object({\n enabled: z.boolean().default(true),\n maxConcurrency: z.number().int().min(1).max(64).default(16),\n maxSubagents: z.number().int().min(1).max(10000).default(1000),\n defaultTimeoutSec: z.number().int().min(60).max(14_400).default(1800),\n /** Subagent live progress in workflow snapshots: tool steps only, or full text stream. */\n subagentStream: z.enum(['off', 'steps', 'full']).default('steps'),\n })\n .optional(),\n /** Optional full system prompt replacement (merged with per-agent entry; entry wins). */\n systemPromptOverride: z.string().optional(),\n /** Optional allowlist of skill names for `<available_skills>`; when set, replaces unfiltered list. */\n skills: z.array(z.string()).optional(),\n /** Disable built-in tools by name (e.g. `shell`, `web_search`). */\n tools: z\n .object({\n disable: z.array(z.string()).optional(),\n })\n .optional(),\n /** Opaque per-process params (reserved for extensions / future use). */\n params: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const AgentConfigSchema = z.object({\n id: z.string(),\n /** When true, this entry is the default routing agent. */\n default: z.boolean().optional(),\n name: LocalizedTextSchema.optional(),\n /** Short human-readable summary for UIs (gateway console, pickers). */\n description: LocalizedTextSchema.optional(),\n enabled: z.boolean().default(true),\n /** Per-agent workspace root (`~` expanded at runtime). */\n workspace: z.string().optional(),\n /**\n * Internal agent state directory (`…/credentials`, `agent.json`, pid, inbox).\n * Default: `<stateDir>/agents/<id>/agent`.\n */\n agentDir: z.string().optional(),\n model: AgentModelRefSchema.optional(),\n thinkingDefault: z.enum(['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'adaptive']).optional(),\n reasoningDefault: z.enum(['off', 'on', 'stream']).optional(),\n verboseDefault: z.enum(['off', 'on', 'full']).optional(),\n systemPromptOverride: z.string().optional(),\n skills: z.array(z.string()).optional(),\n tools: z\n .object({\n disable: z.array(z.string()).optional(),\n })\n .optional(),\n params: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const AgentsConfigSchema = z.object({\n /** Default agent id when not specified (routing / session creation). */\n default: z.string().optional(),\n defaults: AgentDefaultsSchema.optional(),\n list: z.array(AgentConfigSchema).optional(),\n}).default({\n defaults: {\n workspace: '~/.xopc/workspace',\n // `model` is intentionally omitted — resolved dynamically at runtime.\n maxTokens: 8192,\n temperature: 0.7,\n maxToolIterations: 20,\n maxRequestsPerTurn: 50,\n maxToolFailuresPerTurn: 3,\n thinkingDefault: 'medium',\n reasoningDefault: 'stream',\n verboseDefault: 'full',\n compaction: {\n enabled: true,\n mode: 'default',\n reserveTokens: 8000,\n triggerThreshold: 0.8,\n minMessagesBeforeCompact: 10,\n keepRecentMessages: 5,\n evictionWindow: 0.2,\n retentionWindow: 6,\n },\n pruning: {\n enabled: true,\n maxToolResultChars: 10000,\n headKeepRatio: 0.3,\n tailKeepRatio: 0.3,\n },\n browser: {\n enabled: true,\n headless: false,\n backend: 'extension',\n },\n },\n} as any);\n\n// ============================================\n// Channel Configs (per-channel Zod lives in bundled extensions; root schema is open)\n// ============================================\n\nexport {\n TelegramTopicConfigSchema,\n TelegramGroupConfigSchema,\n TelegramAccountConfigSchema,\n TelegramConfigSchema,\n} from '../../extensions/telegram/src/config-schema.js';\nexport type { TelegramConfig } from '../../extensions/telegram/src/config-schema.js';\nexport { WeixinAccountConfigSchema, WeixinConfigSchema } from '../../extensions/weixin/src/config-schema.js';\nexport type { WeixinConfig } from '../../extensions/weixin/src/config-schema.js';\n// ============================================\n// Session Routing Configuration\n// ============================================\n\nexport const BindingMatchSchema = z.object({\n channel: z.string(),\n accountId: z.string().optional(),\n peerKind: z.string().optional(),\n peerId: z.string().optional(),\n guildId: z.string().optional(),\n teamId: z.string().optional(),\n memberRoleIds: z.array(z.string()).optional(),\n});\n\nexport const BindingRuleSchema = z.object({\n id: z.string().optional(),\n agentId: z.string(),\n priority: z.number().default(100),\n match: BindingMatchSchema,\n enabled: z.boolean().default(true),\n});\n\nexport const BindingsConfigSchema = z.array(BindingRuleSchema).default([]);\n\nexport const SessionDmScopeSchema = z.enum([\n 'main',\n 'per-peer',\n 'per-channel-peer',\n 'per-account-channel-peer',\n]);\n\nexport const SessionStorageConfigSchema = z.object({\n pruneAfterMs: z.number().optional(),\n maxEntries: z.number().optional(),\n});\n\nexport const SessionResetModeSchema = z.enum(['daily', 'idle']);\n\nexport const SessionResetConfigSchema = z\n .object({\n mode: SessionResetModeSchema.optional(),\n /** Local hour (0–23) for the daily reset boundary. */\n atHour: z.number().int().min(0).max(23).optional(),\n /** Sliding idle window (minutes). When set with daily mode, whichever expires first wins. */\n idleMinutes: z.number().int().min(0).optional(),\n })\n .strict();\n\nexport const SessionResetByTypeSchema = z\n .object({\n direct: SessionResetConfigSchema.optional(),\n group: SessionResetConfigSchema.optional(),\n thread: SessionResetConfigSchema.optional(),\n })\n .strict();\n\nexport const SessionScopeSchema = z.enum(['per-sender', 'global']);\n\nexport const SessionConfigSchema = z.object({\n scope: SessionScopeSchema.default('per-sender'),\n mainKey: z.string().default('main'),\n dmScope: SessionDmScopeSchema.default('main'),\n identityLinks: z.record(z.string(), z.array(z.string())).optional(),\n resetTriggers: z.array(z.string()).optional(),\n idleMinutes: z.number().int().positive().optional(),\n reset: SessionResetConfigSchema.optional(),\n resetByType: SessionResetByTypeSchema.optional(),\n resetByChannel: z.record(z.string(), SessionResetConfigSchema).optional(),\n storage: SessionStorageConfigSchema.optional(),\n}).default({\n scope: 'per-sender',\n mainKey: 'main',\n dmScope: 'main',\n});\n\n/** Channel buckets — shapes validated post-parse by registered channel plugins. */\nexport const ChannelsConfigSchema = z.record(z.string(), z.unknown()).default({\n telegram: {\n enabled: false,\n allowFrom: [],\n groupAllowFrom: [],\n debug: false,\n accounts: {\n default: {\n accountId: 'default',\n enabled: true,\n botToken: '',\n allowFrom: [],\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n streamMode: 'partial' as const,\n },\n },\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n },\n});\n\nexport const SearchProviderEntrySchema = z.object({\n type: z.enum(['brave', 'tavily', 'bing', 'searxng']),\n apiKey: z.string().optional(),\n /** SearXNG instance base URL (e.g. http://localhost:8080) */\n url: z.string().optional(),\n disabled: z.boolean().optional(),\n});\n\nexport type SearchProviderEntry = z.infer<typeof SearchProviderEntrySchema>;\n\nexport const WebSearchConfigSchema = z.object({\n maxResults: z.number().default(5),\n /** Ordered API providers; empty → HTML fallback only */\n providers: z.array(SearchProviderEntrySchema).default([]),\n});\n\nexport type WebSearchConfig = z.infer<typeof WebSearchConfigSchema>;\n\nexport const WebsiteBlocklistSchema = z.object({\n /** Master switch. Default false (no blocking). */\n enabled: z.boolean().default(false),\n /** Domain patterns to block (e.g. \"example.com\", \"*.evil.org\"). */\n domains: z.array(z.string()).default([]),\n});\n\nexport type WebsiteBlocklistConfig = z.infer<typeof WebsiteBlocklistSchema>;\n\nexport const WebToolsConfigSchema = z.object({\n /** Search result HTML fallback: cn → Bing, otherwise DuckDuckGo */\n region: z.enum(['cn', 'global']).optional(),\n search: WebSearchConfigSchema.optional(),\n /** Domain blocklist for web_fetch / web_extract / browser tools. */\n blocklist: WebsiteBlocklistSchema.optional(),\n});\n\nexport type WebToolsConfig = z.infer<typeof WebToolsConfigSchema>;\n\nexport const ToolsConfigSchema = z.object({\n web: WebToolsConfigSchema.optional(),\n /**\n * Per-capability media providers. Currently only `audio` (STT) is wired;\n * `image` / `video` slots are reserved for future capabilities.\n */\n media: z.lazy(() => ToolsMediaConfigSchema),\n}).default({\n web: {\n search: {\n maxResults: 5,\n providers: [],\n },\n },\n});\n\n// ============================================\n// Gateway Configuration\n// ============================================\n\nexport const GatewayAuthRateLimitSchema = z\n .object({\n enabled: z.boolean().default(true),\n maxAttempts: z.number().int().min(1).default(5),\n windowMs: z.number().default(900_000),\n blockDurationMs: z.number().default(300_000),\n /** OpenClaw alias for blockDurationMs. */\n lockoutMs: z.number().optional(),\n /** Skip rate limiting for loopback client IPs (default true). Remote browser Origin requests never exempt. */\n exemptLoopback: z.boolean().default(true),\n /**\n * Coalesce same-client failures arriving within this window into a single\n * attempt. Absorbs SPA fan-out / SDK auto-retry storms without weakening\n * brute-force protection (deliberate attackers are still rate-limited to\n * one effective attempt per window). Set to 0 to disable.\n */\n burstCoalesceMs: z.number().int().min(0).default(1000),\n })\n .optional();\n\nexport const GatewaySecuritySchema = z\n .object({\n /** When true, non-loopback binds require explicit gateway.auth.rateLimit configuration. */\n strict: z.boolean().optional(),\n })\n .optional();\n\nexport const GatewayTrustedProxySchema = z\n .object({\n /** Header set by the reverse proxy with the authenticated user identity. */\n userHeader: z.string().min(1),\n /** Additional headers that must be present (e.g. proxy auth markers). */\n requiredHeaders: z.array(z.string()).optional(),\n /** When non-empty, only these user identities are allowed. */\n allowUsers: z.array(z.string()).optional(),\n /** Allow trusted-proxy auth when the TCP source is loopback (same-host reverse proxy). */\n allowLoopback: z.boolean().optional(),\n })\n .strict();\n\nexport const GatewayAuthSchema = z\n .object({\n mode: z.enum(['none', 'token', 'password', 'trusted-proxy']).default('token'),\n token: z.string().optional(),\n password: z.string().optional(),\n /** When true (default for Serve), browser UI may auth via Tailscale identity headers. API routes still require token. */\n allowTailscale: z.boolean().optional(),\n rateLimit: GatewayAuthRateLimitSchema,\n trustedProxy: GatewayTrustedProxySchema.optional(),\n })\n .default({\n mode: 'token',\n });\n\nexport const GatewayTailscaleConsentSchema = z.object({\n version: z.string().min(1),\n acceptedAt: z.string().min(1),\n});\n\nexport const GatewayTailscaleSchema = z\n .object({\n mode: z.enum(['off', 'serve', 'funnel']).default('off'),\n resetOnExit: z.boolean().default(true),\n consent: GatewayTailscaleConsentSchema.optional(),\n })\n .default({\n mode: 'off',\n resetOnExit: true,\n });\n\nexport const GatewayRemoteSchema = z.object({\n url: z.string().url(),\n token: z.string().optional(),\n password: z.string().optional(),\n transport: z.enum(['direct', 'ssh']).default('direct'),\n sshTarget: z.string().optional(),\n sshIdentity: z.string().optional(),\n tlsFingerprint: z.string().optional(),\n});\n\nexport const GatewayTlsSchema = z\n .object({\n enabled: z.boolean().default(false),\n autoGenerate: z.boolean().default(false),\n certPath: z.string().optional(),\n keyPath: z.string().optional(),\n })\n .default({\n enabled: false,\n autoGenerate: false,\n });\n\nexport const GatewayModeSchema = z.enum(['local', 'remote']).default('local');\n\nexport const HeartbeatConfigSchema = z\n .object({\n enabled: z.boolean(),\n intervalMs: z.number(),\n /** When false, heartbeat instructions are only sent during heartbeat polling turns (not in every chat system prompt). */\n includeSystemPromptSection: z.boolean().optional().default(false),\n target: z.string().optional(),\n targetChatId: z.string().optional(),\n prompt: z.string().optional(),\n ackMaxChars: z.number().optional(),\n isolatedSession: z.boolean().optional(),\n activeHours: z\n .object({\n start: z.string(),\n end: z.string(),\n timezone: z.string().optional(),\n })\n .optional(),\n })\n .default({\n enabled: true,\n intervalMs: 1_800_000,\n includeSystemPromptSection: false,\n });\n\nexport const GatewayChannelConnectDeferModeSchema = z.enum(['auto', 'off', 'explicit']);\n\nexport const TunnelConsentSchema = z.object({\n version: z.string().min(1),\n acceptedAt: z.string().min(1),\n});\n\nexport const TunnelConfigSchema = z\n .object({\n enabled: z.boolean().default(false),\n brokerUrl: z.string().url().default('https://frp.xopc.ai/api'),\n /** Broker register API secret (env `XOPC_TUNNEL_REGISTRATION_SECRET` overrides when set). */\n registrationSecret: z.string().min(1).optional(),\n autoStart: z.boolean().default(false),\n subdomain: z.string().optional(),\n consent: TunnelConsentSchema.optional(),\n })\n .default({\n enabled: false,\n brokerUrl: 'https://frp.xopc.ai/api',\n autoStart: false,\n });\n\nexport type TunnelConfig = z.infer<typeof TunnelConfigSchema>;\n\n/**\n * Workspace-scoped concerns (file import, etc.). Distinct from\n * `agents.defaults.workspace`, which is the workspace *path*; this block carries\n * feature configuration for workspace-related routes.\n */\nexport const WorkspaceImportConfigSchema = z.object({\n /** Workspace-relative subdir for imported files. Default `imports`. */\n targetDir: z.string().default('imports'),\n /** Per-file byte cap. Default 100 MiB. */\n maxBytes: z.number().int().min(1024).max(10_737_418_240).default(104_857_600),\n /** When false, the route rejects `onConflict: 'overwrite'`. Default true. */\n allowOverwrite: z.boolean().default(true),\n});\nexport type WorkspaceImportConfig = z.infer<typeof WorkspaceImportConfigSchema>;\n\nexport const WorkspaceConfigSchema = z.object({\n import: WorkspaceImportConfigSchema.optional(),\n}).optional();\nexport type WorkspaceConfig = z.infer<typeof WorkspaceConfigSchema>;\n\nexport const GatewayBindModeSchema = z.enum(['auto', 'loopback', 'lan', 'tailnet', 'custom']);\n\nexport const GatewayConfigSchema = z.object({\n /** Semantic bind mode. */\n bind: GatewayBindModeSchema.optional(),\n /** IPv4 listen address when `bind` is `custom`. */\n customBindHost: z.string().optional(),\n port: z.number().optional(),\n /** local: this process runs the gateway; remote: CLI clients target gateway.remote. */\n mode: GatewayModeSchema.optional(),\n /** Persistent remote gateway target for CLI/TUI/MCP when mode=remote. */\n remote: GatewayRemoteSchema.optional(),\n tailscale: GatewayTailscaleSchema.optional(),\n tls: GatewayTlsSchema.optional(),\n auth: GatewayAuthSchema.optional(),\n heartbeat: HeartbeatConfigSchema.optional(),\n maxSseConnections: z.number().optional(),\n corsOrigins: z.array(z.string()).optional(),\n /**\n * Reverse-proxy publicly reachable URL (e.g. `https://gateway.example.com`).\n * Optional. When set, mobile pairing surfaces this URL as the preferred\n * baseUrl and it is auto-added to the browser CORS/CSRF allowlist.\n * - Must be a URL with no path / query / userinfo.\n * - Must use `https:` for public hosts; `http:` is only allowed when the\n * hostname is in an RFC1918 / `.local` private range.\n */\n publicUrl: z\n .string()\n .superRefine((value, ctx) => {\n const result = validatePublicUrl(value);\n if (result.ok === false) {\n ctx.addIssue({ code: 'custom', message: `gateway.publicUrl: ${result.message}` });\n }\n })\n .optional(),\n /** Dangerous: allow browser Origin to match the HTTP Host header when not in corsOrigins. */\n dangerouslyAllowHostHeaderOriginFallback: z.boolean().optional(),\n /** CIDRs or exact IPs of reverse proxies allowed to terminate auth (trusted-proxy mode). */\n trustedProxies: z.array(z.string()).optional(),\n /** When true, fall back to X-Real-IP if X-Forwarded-For chain parsing fails. Default false (fail closed). */\n allowRealIpFallback: z.boolean().optional(),\n security: GatewaySecuritySchema,\n /**\n * How channel `start()` is split around HTTP listen when using `GatewayServer`.\n * - `auto` (default): defer ids come from channel plugin `meta.deferConnectUntilAfterListen` + enabled config.\n * - `off`: always start all channels in phase1 (troubleshooting / strict ordering).\n * - `explicit`: defer only `channelConnectDeferIds` (empty = defer none).\n */\n channelConnectDeferMode: GatewayChannelConnectDeferModeSchema.optional(),\n /** When `channelConnectDeferMode` is `explicit`, these channel plugin ids are deferred until after listen. */\n channelConnectDeferIds: z.array(z.string().min(1)).max(24).optional(),\n /** Removed from the defer set (applied after `auto` or `explicit` resolution). */\n channelConnectDeferSkipIds: z.array(z.string().min(1)).max(24).optional(),\n /** Default skills marketplace provider id. Built-in: 'store', 'skillhub', 'clawhub'. Extensions may register more. */\n skillsMarketplaceProvider: z.string().optional(),\n /** Base URL for the xopc skills marketplace (public REST API). */\n skillsStoreBaseUrl: z.string().url().optional(),\n /** File sharing configuration (temporary public download links for workspace files). */\n share: z.object({\n enabled: z.boolean().default(true),\n /** Default TTL in ms (default 24h). */\n defaultTtlMs: z.number().min(60_000).max(604_800_000).default(86_400_000),\n /** Maximum TTL in ms (default 7 days). */\n maxTtlMs: z.number().min(60_000).max(2_592_000_000).default(604_800_000),\n /** Maximum concurrent active shares (default 100). */\n maxActiveShares: z.number().min(1).max(10_000).default(100),\n /** Maximum shareable file size in bytes (default 100MB). */\n maxFileSize: z.number().min(1_048_576).max(10_737_418_240).default(104_857_600),\n /** MIME types allowed for inline preview (?inline=1). */\n inlinePreviewMimes: z.array(z.string()).default([\n 'image/png',\n 'image/jpeg',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n 'application/pdf',\n 'text/html',\n 'text/markdown',\n 'text/plain',\n 'application/json',\n ]),\n /** Folder-sharing controls (browse + ZIP). */\n directory: z.object({\n enabled: z.boolean().default(true),\n /** Maximum folder size in bytes at scan time (default 1 GB). */\n maxFolderSize: z.number().int().min(1_048_576).max(10_737_418_240).default(1_073_741_824),\n /** Maximum number of entries scanned for a single folder share. */\n maxFileCount: z.number().int().min(1).max(100_000).default(1_000),\n /** Traversal depth cap (defense against recursive symlinks). */\n maxDepth: z.number().int().min(1).max(64).default(20),\n /** In-memory directory listing cache TTL. */\n listingCacheMs: z.number().int().min(0).max(600_000).default(60_000),\n /** Maximum simultaneous ZIP streams per share token. */\n zipConcurrency: z.number().int().min(1).max(8).default(1),\n }).default({\n enabled: true,\n maxFolderSize: 1_073_741_824,\n maxFileCount: 1_000,\n maxDepth: 20,\n listingCacheMs: 60_000,\n zipConcurrency: 1,\n }),\n }).optional(),\n /** Site-share configuration (static directory or reverse-proxy a local dev server). */\n siteShare: z.object({\n enabled: z.boolean().default(true),\n /** Public host suffix that subdomain shares are served under. */\n publicHostSuffix: z.string().min(1).default('share.xopc.ai'),\n /** Default TTL in ms (default 6h, shorter than file shares — live app surface). */\n defaultTtlMs: z.number().int().min(60_000).max(604_800_000).default(21_600_000),\n /** Maximum TTL in ms (default 7 days). */\n maxTtlMs: z.number().int().min(60_000).max(2_592_000_000).default(604_800_000),\n /** Maximum concurrent active site shares. */\n maxActiveSites: z.number().int().min(1).max(1_000).default(5),\n static: z.object({\n enabled: z.boolean().default(true),\n /** Maximum total bytes of files served per static site. */\n maxRootDirSize: z.number().int().min(1_048_576).max(10_737_418_240).default(524_288_000),\n /** Maximum file count under root dir. */\n maxFileCount: z.number().int().min(1).max(100_000).default(10_000),\n /** Whether HTML/CSS rewrite of absolute paths is on by default. */\n rewriteEnabledByDefault: z.boolean().default(false),\n }).default({\n enabled: true,\n maxRootDirSize: 524_288_000,\n maxFileCount: 10_000,\n rewriteEnabledByDefault: false,\n }),\n proxy: z.object({\n /** Reverse-proxy mode default-enabled per the product brief. */\n enabled: z.boolean().default(true),\n /** Upstream host whitelist. Loopback by default. */\n allowedUpstreamHosts: z\n .array(z.string().min(1))\n .default(['127.0.0.1', 'localhost', '::1']),\n /** Upstream port whitelist (common dev-server ports). */\n allowedUpstreamPorts: z\n .array(z.number().int().min(1).max(65535))\n .default([3000, 3001, 4321, 5173, 8000, 8080, 8888, 9000]),\n /** Whether to forward WebSocket upgrades. */\n forwardWebSocket: z.boolean().default(true),\n /** Maximum request body size in bytes (50 MB). */\n bodySizeLimit: z.number().int().min(0).max(1_073_741_824).default(52_428_800),\n /** Per-request HTTP timeout in ms. */\n requestTimeoutMs: z.number().int().min(1_000).max(600_000).default(30_000),\n /** Per-WebSocket idle timeout in ms. */\n wsIdleTimeoutMs: z.number().int().min(10_000).max(3_600_000).default(300_000),\n /** Rewrite Set-Cookie Path attribute (subpath mode only). */\n rewriteSetCookiePath: z.boolean().default(true),\n }).default({\n enabled: true,\n allowedUpstreamHosts: ['127.0.0.1', 'localhost', '::1'],\n allowedUpstreamPorts: [3000, 3001, 4321, 5173, 8000, 8080, 8888, 9000],\n forwardWebSocket: true,\n bodySizeLimit: 52_428_800,\n requestTimeoutMs: 30_000,\n wsIdleTimeoutMs: 300_000,\n rewriteSetCookiePath: true,\n }),\n }).optional(),\n}).default({\n bind: 'loopback',\n port: 18790,\n auth: {\n mode: 'token',\n },\n heartbeat: {\n enabled: true,\n intervalMs: 1_800_000,\n includeSystemPromptSection: false,\n },\n maxSseConnections: 100,\n corsOrigins: [],\n skillsMarketplaceProvider: 'skillhub',\n skillsStoreBaseUrl: 'https://store.xopc.ai',\n});\n\nexport const CronConfigSchema = z.object({\n enabled: z.boolean().optional(),\n maxConcurrentJobs: z.number().optional(),\n defaultTimezone: z.string().optional(),\n historyRetentionDays: z.number().optional(),\n enableMetrics: z.boolean().optional(),\n}).default({\n enabled: true,\n maxConcurrentJobs: 5,\n defaultTimezone: 'UTC',\n historyRetentionDays: 7,\n enableMetrics: true,\n});\n\nexport const ModelsDevConfigSchema = z.object({\n enabled: z.boolean().default(true),\n}).default({\n enabled: true,\n});\n\n// ============================================\n// STT (Speech-to-Text) Config\n// ============================================\n\nconst SttProviderConfigCatchallSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n]);\n\nexport const STTProviderConfigSchema = z\n .object({\n apiKey: z.string().optional(),\n model: z.string().optional(),\n baseUrl: z.string().optional(),\n headers: z.record(z.string(), z.string()).optional(),\n language: z.string().optional(),\n prompt: z.string().optional(),\n })\n .catchall(SttProviderConfigCatchallSchema);\n\nexport const STTFallbackConfigSchema = z.object({\n enabled: z.boolean().default(true),\n order: z.array(z.string().min(1)).default(['alibaba', 'openai']),\n});\n\nexport const MediaUnderstandingCapabilitiesSchema = z\n .array(z.enum(['image', 'audio', 'video']))\n .optional();\n\nexport const MediaUnderstandingModelSchema = z\n .object({\n provider: z.string().optional(),\n model: z.string().optional(),\n capabilities: MediaUnderstandingCapabilitiesSchema,\n type: z.union([z.literal('provider'), z.literal('cli')]).optional(),\n command: z.string().optional(),\n baseUrl: z.string().optional(),\n headers: z.record(z.string(), z.string()).optional(),\n apiKey: z.string().optional(),\n language: z.string().optional(),\n prompt: z.string().optional(),\n })\n .catchall(SttProviderConfigCatchallSchema);\n\nexport const STTConfigSchema = z\n .object({\n enabled: z.boolean().default(false),\n /** Primary provider id — any registered MediaUnderstandingProvider id. */\n provider: z.string().min(1).default('alibaba'),\n fallback: STTFallbackConfigSchema.optional(),\n timeoutMs: z.number().int().min(1000).max(180000).optional(),\n /** Ordered model entries for this capability (OpenClaw `tools.media.audio.models`). */\n models: z.array(MediaUnderstandingModelSchema).optional(),\n /** Provider settings map keyed by provider id. */\n providers: z.record(z.string(), STTProviderConfigSchema).optional(),\n })\n .strict();\n\n// ============================================\n// TTS (Text-to-Speech) Config\n// ============================================\n\nconst TtsProviderConfigCatchallSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n]);\n\nexport const TTSProviderConfigSchema = z\n .object({\n apiKey: z.string().optional(),\n model: z.string().optional(),\n voice: z.string().optional(),\n })\n .catchall(TtsProviderConfigCatchallSchema);\n\nexport const TTSFallbackConfigSchema = z.object({\n enabled: z.boolean().default(true),\n order: z\n .array(z.string().min(1))\n .default(['openai', 'alibaba', 'minimax', 'edge']),\n});\n\nexport const TTSModelOverridesConfigSchema = z.object({\n enabled: z.boolean().default(true),\n allowText: z.boolean().default(true),\n allowProvider: z.boolean().default(false),\n allowVoice: z.boolean().default(true),\n allowModelId: z.boolean().default(true),\n allowVoiceSettings: z.boolean().default(false),\n allowNormalization: z.boolean().default(false),\n allowSeed: z.boolean().default(false),\n});\n\nexport const TTSEdgeConfigSchema = z.object({\n enabled: z.boolean().default(true),\n voice: z.string().optional(),\n lang: z.string().optional(),\n outputFormat: z.string().optional(),\n pitch: z.string().optional(),\n rate: z.string().optional(),\n volume: z.string().optional(),\n proxy: z.string().optional(),\n timeoutMs: z.number().int().min(1000).max(120000).optional(),\n});\n\nexport const TTSSummarizationConfigSchema = z.object({\n enabled: z.boolean().optional(),\n targetLength: z.number().int().min(1).optional(),\n threshold: z.number().int().min(1).optional(),\n model: z.string().optional(),\n});\n\nexport const TTSConfigSchema = z\n .object({\n enabled: z.boolean().default(false),\n /** Primary provider id — any registered SpeechProviderPlugin id. */\n provider: z.string().min(1).default('openai'),\n trigger: z.enum(['off', 'always', 'inbound', 'tagged']).default('always'),\n fallback: TTSFallbackConfigSchema.optional(),\n maxTextLength: z.number().int().min(1).default(512), // Conservative default to accommodate all providers (Alibaba limit is 512)\n timeoutMs: z.number().int().min(1000).max(180000).default(60000),\n summarization: TTSSummarizationConfigSchema.optional(),\n modelOverrides: TTSModelOverridesConfigSchema.optional(),\n /** Provider settings map keyed by provider id. */\n providers: z.record(z.string(), TTSProviderConfigSchema).optional(),\n })\n .strict();\n\n// ============================================\n// messages.* — delivery / presentation concerns\n// ============================================\n\nexport const MessagesConfigSchema = z.object({\n /** Voice (text-to-speech) output configuration. */\n tts: TTSConfigSchema.optional(),\n}).optional();\n\nexport const ToolsMediaAudioConfigSchema = STTConfigSchema;\n\nexport const ToolsMediaConfigSchema = z\n .object({\n /** Shared model entries applied across media capabilities when entry lacks capabilities. */\n models: z.array(MediaUnderstandingModelSchema).optional(),\n /** Audio (speech-to-text) capability provider config. */\n audio: ToolsMediaAudioConfigSchema.optional(),\n })\n .optional();\n\n// ============================================\n// Provider Configs (capability providers: image / audio / video)\n// ============================================\n\n/**\n * Optional Azure OpenAI overrides used when an OpenAI image-generation\n * request should hit an Azure deployment instead of `api.openai.com`.\n *\n * URL template (when present):\n * `https://<resource>.openai.azure.com/openai/deployments/<deployment>/images/generations?api-version=<apiVersion>`\n */\nexport const ProviderAzureConfigSchema = z\n .object({\n /** Azure resource name (subdomain before `.openai.azure.com`). */\n resource: z.string().min(1).optional(),\n /** Azure deployment id (configured per model). */\n deployment: z.string().min(1).optional(),\n /** Azure REST API version, e.g. `2024-08-01-preview`. */\n apiVersion: z.string().min(1).optional(),\n })\n .strict();\n\n/** Per-vendor request overrides applied by the provider HTTP layer. */\nexport const ProviderRequestOverridesSchema = z\n .object({\n /** Hard cap for a single HTTP call (ms). */\n timeoutMs: z.number().int().positive().optional(),\n /** Extra headers merged into every outbound request. */\n headers: z.record(z.string(), z.string()).optional(),\n })\n .strict();\n\n/**\n * Generic per-vendor provider config — used by image / audio / video\n * capability providers via `cfg.providers.<id>`. Kept loose (`.strict()` but\n * everything optional) so adding a new vendor never requires a config\n * migration.\n */\nexport const ProviderAuthConfigSchema = z\n .object({\n /** Static API key (api-key / azure-key modes). */\n apiKey: z.string().optional(),\n /** Override the default REST base URL. */\n baseUrl: z.string().url().optional(),\n /** Vendor region (DashScope: `beijing` / `singapore`; AWS: region id). */\n region: z.string().optional(),\n /** Image-only base URL override (DashScope splits image vs LLM). */\n imageBaseUrl: z.string().url().optional(),\n /** Per-vendor request overrides. */\n request: ProviderRequestOverridesSchema.optional(),\n /** Azure OpenAI deployment overrides; only consumed by OpenAI image provider. */\n azure: ProviderAzureConfigSchema.optional(),\n })\n .strict();\n\nexport type ProviderAuthConfig = z.infer<typeof ProviderAuthConfigSchema>;\n\n/**\n * `cfg.providers.<id>` is keyed by provider id (`openai`, `dashscope`,\n * `minimax`, `google`, `fal`, …). Every entry is optional and validated by\n * {@link ProviderAuthConfigSchema}.\n */\nexport const ProvidersConfigSchema = z.record(z.string(), ProviderAuthConfigSchema);\n\nexport type ProvidersConfig = z.infer<typeof ProvidersConfigSchema>;\n\n// ============================================\n// Extension Configs \n// ============================================\n\n// Security config for extensions \nexport const ExtensionSecurityConfigSchema = z.object({\n checkPermissions: z.boolean().default(true),\n allowUntrusted: z.boolean().default(false),\n allow: z.array(z.string()).default([]),\n trackProvenance: z.boolean().default(true),\n allowPromptInjection: z.boolean().default(false),\n});\n\n// Slot config for extensions \nexport const ExtensionSlotsConfigSchema = z.object({\n memory: z.string().optional(),\n tts: z.string().optional(),\n imageGeneration: z.string().optional(),\n webSearch: z.string().optional(),\n});\n\n// Complete extensions config\n// Extension config allows both known fields AND arbitrary extension-specific config\n// Known fields: enabled (array), allow (array), security (object), slots (object)\n// Arbitrary: any other key is extension-specific config (e.g., extensions.hello.greeting)\nexport const ExtensionsConfigSchema: z.ZodType<Record<string, unknown>> = z.record(z.string(), z.unknown());\n\n// ============================================\n// Update Config\n// ============================================\n\nexport const UpdateAutoConfigSchema = z\n .object({\n /** Enable automatic update installation. Default false. */\n enabled: z.boolean().default(false),\n /** Hours to wait before applying a stable update after first detection. */\n stableDelayHours: z.number().min(0).default(6),\n /** Additional random jitter hours for stable rollout (avoids thundering herd). */\n stableJitterHours: z.number().min(0).default(12),\n /** How often to re-check for beta updates (hours). Min 0.25. */\n betaCheckIntervalHours: z.number().min(0.25).default(1),\n })\n .strict()\n .optional();\n\n/** Persistent `/goal` (Ralph loop) — Hermes-aligned defaults. */\nexport const GoalsConfigSchema = z\n .object({\n /** Max continuation turns before auto-pause (Hermes default 20). */\n maxTurns: z.number().int().min(1).max(500).default(20),\n /** Optional judge model ref; defaults to `agents.defaults.model`. */\n judgeModelRef: z.string().optional(),\n /**\n * When true (default), first post-turn runs a decomposition judge to build a checklist;\n * subsequent turns evaluate progress per item (Hermes-style). When false, use legacy freeform judge only.\n */\n checklistMode: z.boolean().default(true),\n /** Auto-pause after this many consecutive judge JSON/tool parse failures (Hermes default 3). */\n maxConsecutiveParseFailures: z.number().int().min(1).max(20).default(3),\n /** Judge LLM call timeout in ms (Hermes uses 60s). */\n judgeTimeoutMs: z.number().int().min(5_000).max(120_000).default(60_000),\n /** Max characters of recent transcript JSON passed to the checklist judge as extra context. */\n checklistHistoryChars: z.number().int().min(0).max(100_000).default(24_000),\n })\n .strict();\n\nexport type GoalsConfig = z.infer<typeof GoalsConfigSchema>;\n\nexport const UpdateConfigSchema = z\n .object({\n /** Check for updates on gateway startup. Default true. */\n checkOnStart: z.boolean().default(true),\n /** Update channel: stable (default), beta, or dev. */\n channel: z.enum(['stable', 'beta', 'dev']).default('stable'),\n /** Automatic update policy. */\n auto: UpdateAutoConfigSchema,\n })\n .strict()\n .optional();\n\nexport type UpdateConfig = z.infer<typeof UpdateConfigSchema>;\n\nexport const CommandsConfigSchema = z\n .object({\n restart: z.boolean().optional(),\n })\n .strict()\n .optional();\n\nexport type CommandsConfig = z.infer<typeof CommandsConfigSchema>;\n\n// ============================================\n// MCP (Model Context Protocol)\n// ============================================\n\nconst McpHttpUrlSchema = z\n .string()\n .url()\n .refine((value) => {\n try {\n const protocol = new URL(value).protocol;\n return protocol === 'http:' || protocol === 'https:';\n } catch {\n return false;\n }\n }, 'MCP server URL must use http or https');\n\nconst ConnectorSecretReferenceSchema = z.object({\n xopcSecretRef: z.object({\n provider: z.string().min(1),\n fieldKey: z.string().min(1),\n }),\n});\n\nconst McpConfigScalarSchema = z.union([z.string(), z.number(), z.boolean(), ConnectorSecretReferenceSchema]);\n\nexport const McpServerSchema = z\n .object({\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), McpConfigScalarSchema).optional(),\n cwd: z.string().optional(),\n workingDirectory: z.string().optional(),\n url: McpHttpUrlSchema.optional(),\n transport: z.enum(['sse', 'streamable-http']).optional(),\n headers: z.record(z.string(), McpConfigScalarSchema).optional(),\n connectionTimeoutMs: z.number().finite().positive().optional(),\n })\n .catchall(z.unknown())\n .superRefine((value, ctx) => {\n const hasCommand = typeof value.command === 'string' && value.command.trim().length > 0;\n const hasUrl = typeof value.url === 'string' && value.url.trim().length > 0;\n if (hasCommand && hasUrl) {\n ctx.addIssue({\n code: 'custom',\n message: 'MCP server cannot define both command and url',\n });\n }\n });\n\nexport const McpConfigSchema = z\n .object({\n servers: z.record(z.string(), McpServerSchema).optional(),\n sessionIdleTtlMs: z.number().finite().min(0).optional(),\n })\n .strict()\n .optional();\n\nexport type McpServerConfig = z.infer<typeof McpServerSchema>;\nexport type McpConfig = z.infer<typeof McpConfigSchema>;\n\n// ============================================\n// Root Config\n// ============================================\n\nexport const ConfigSchema = z.object({\n agents: AgentsConfigSchema,\n bindings: BindingsConfigSchema,\n session: SessionConfigSchema,\n channels: ChannelsConfigSchema,\n gateway: GatewayConfigSchema,\n tunnel: TunnelConfigSchema.optional(),\n workspace: WorkspaceConfigSchema,\n tools: ToolsConfigSchema,\n mcp: McpConfigSchema,\n cron: CronConfigSchema,\n goals: GoalsConfigSchema.optional(),\n extensions: ExtensionsConfigSchema.default({}),\n /** Per-vendor capability provider config (image / audio / video). */\n providers: ProvidersConfigSchema.optional(),\n modelsDev: ModelsDevConfigSchema,\n /** Delivery / presentation concerns (currently `tts`). */\n messages: MessagesConfigSchema,\n update: UpdateConfigSchema,\n commands: CommandsConfigSchema,\n}).default({\n agents: {\n defaults: {\n workspace: '~/.xopc/workspace',\n // `model` is intentionally omitted — resolved dynamically at runtime.\n maxTokens: 8192,\n temperature: 0.7,\n maxToolIterations: 20,\n maxRequestsPerTurn: 50,\n maxToolFailuresPerTurn: 3,\n thinkingDefault: 'medium',\n reasoningDefault: 'stream',\n verboseDefault: 'full',\n compaction: {\n enabled: true,\n mode: 'default',\n reserveTokens: 8000,\n triggerThreshold: 0.8,\n minMessagesBeforeCompact: 10,\n keepRecentMessages: 5,\n evictionWindow: 0.2,\n retentionWindow: 6,\n },\n pruning: {\n enabled: true,\n maxToolResultChars: 10000,\n headKeepRatio: 0.3,\n tailKeepRatio: 0.3,\n },\n browser: {\n backend: 'extension',\n },\n },\n },\n bindings: [],\n session: {\n scope: 'per-sender' as const,\n mainKey: 'main',\n dmScope: 'main' as const,\n },\n channels: {\n telegram: {\n enabled: false,\n allowFrom: [],\n groupAllowFrom: [],\n debug: false,\n accounts: {\n default: {\n accountId: 'default',\n enabled: true,\n botToken: '',\n allowFrom: [],\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n streamMode: 'partial' as const,\n },\n },\n dmPolicy: 'pairing' as const,\n groupPolicy: 'open' as const,\n replyToMode: 'off' as const,\n historyLimit: 50,\n textChunkLimit: 4000,\n },\n },\n gateway: {\n bind: 'loopback',\n port: 18790,\n auth: {\n mode: 'token',\n },\n heartbeat: {\n enabled: true,\n intervalMs: 1_800_000,\n includeSystemPromptSection: false,\n },\n maxSseConnections: 100,\n corsOrigins: [],\n skillsMarketplaceProvider: 'skillhub',\n skillsStoreBaseUrl: 'https://store.xopc.ai',\n },\n tools: {\n web: {\n search: {\n maxResults: 5,\n providers: [],\n },\n },\n },\n cron: {\n enabled: true,\n maxConcurrentJobs: 5,\n defaultTimezone: 'UTC',\n historyRetentionDays: 7,\n enableMetrics: true,\n },\n goals: {\n maxTurns: 20,\n checklistMode: true,\n maxConsecutiveParseFailures: 3,\n judgeTimeoutMs: 60_000,\n checklistHistoryChars: 24_000,\n },\n extensions: {\n allow: [],\n security: {\n checkPermissions: true,\n allowUntrusted: false,\n allow: [],\n trackProvenance: true,\n allowPromptInjection: false,\n },\n slots: {},\n },\n modelsDev: {\n enabled: true,\n },\n // messages.tts / tools.media.audio start undefined; the factory layer fills\n // in provider-level defaults (model/voice) on demand. Fresh configs don't\n // ship with enabled providers so they never make surprise STT/TTS calls.\n});\n\nexport type Config = z.infer<typeof ConfigSchema>;\nexport type AgentDefaults = z.infer<typeof AgentDefaultsSchema>;\nexport type GatewayAuthConfig = z.infer<typeof GatewayAuthSchema>;\nexport type GatewayTrustedProxyConfig = z.infer<typeof GatewayTrustedProxySchema>;\nexport type GatewayAuthRateLimitConfig = z.infer<typeof GatewayAuthRateLimitSchema>;\nexport type GatewayBindMode = z.infer<typeof GatewayBindModeSchema>;\nexport type STTConfig = z.infer<typeof STTConfigSchema>;\nexport type TTSConfig = z.infer<typeof TTSConfigSchema>;\n\n// ============================================\n// Helper Functions\n// ============================================\n\n/**\n * Parse a model reference string.\n */\nexport interface ParsedModelRef {\n provider: string;\n model: string;\n}\n\n/**\n * Primary model ref from `agents.defaults.model`. Returns undefined when unset.\n */\nexport function getAgentDefaultModelRef(config: Config): string | undefined {\n const ref = config.agents?.defaults?.model?.primary?.trim();\n return ref || undefined;\n}\n\n/** `provider/model` or null when invalid. */\nexport function parseModelRef(ref: string): ParsedModelRef | null {\n const trimmed = ref.trim();\n const idx = trimmed.indexOf('/');\n if (idx <= 0 || idx === trimmed.length - 1) {\n return null;\n }\n return { provider: trimmed.slice(0, idx).trim(), model: trimmed.slice(idx + 1).trim() };\n}\n"],"mappings":";;;;;;;;;;;AAi/CA,SAAgB,wBAAwB,QAAoC;AAE1E,QADY,OAAO,QAAQ,UAAU,OAAO,SAAS,MAAM,IAC7C,KAAA;;;AAIhB,SAAgB,cAAc,KAAoC;CAChE,MAAM,UAAU,IAAI,MAAM;CAC1B,MAAM,MAAM,QAAQ,QAAQ,IAAI;AAChC,KAAI,OAAO,KAAK,QAAQ,QAAQ,SAAS,EACvC,QAAO;AAET,QAAO;EAAE,UAAU,QAAQ,MAAM,GAAG,IAAI,CAAC,MAAM;EAAE,OAAO,QAAQ,MAAM,MAAM,EAAE,CAAC,MAAM;EAAE;;;;wBA3/C1B;sBACL;kBACN;qBA8bI;uBAEqD;AArbhG,uBAAsB,EAChC,OAAO;EACN,SAAS,EAAE,QAAQ,CAAC,IAAI,EAAE;EAC1B,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EAC1C,CAAC,CACD,QAAQ;AAQE,mCAAkC,EAC5C,OAAO;EACN,SAAS,EAAE,QAAQ,CAAC,IAAI,EAAE;EAC1B,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;;EAEzC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU;;;;;EAKjD,sBAAsB,EAAE,SAAS,CAAC,UAAU;EAC7C,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,eAAe;IACf,kBAAkB;IAClB,0BAA0B;IAC1B,oBAAoB;IACpB,gBAAgB;IAChB,iBAAiB;IAClB;GACD,SAAS;IACP,SAAS;IACT,oBAAoB;IACpB,eAAe;IACf,eAAe;IAChB;GACD,SAAS,EACP,SAAS,aACV;GACF,EACF;EACD,UAAU,EAAE;EACZ,SAAS;GACP,OAAO;GACP,SAAS;GACT,SAAS;GACV;EACD,UAAU,EACR,UAAU;GACR,SAAS;GACT,WAAW,EAAE;GACb,gBAAgB,EAAE;GAClB,OAAO;GACP,UAAU,EACR,SAAS;IACP,WAAW;IACX,SAAS;IACT,UAAU;IACV,WAAW,EAAE;IACb,UAAU;IACV,aAAa;IACb,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,YAAY;IACb,EACF;GACD,UAAU;GACV,aAAa;GACb,aAAa;GACb,cAAc;GACd,gBAAgB;GACjB,EACF;EACD,SAAS;GACP,MAAM;GACN,MAAM;GACN,MAAM,EACJ,MAAM,SACP;GACD,WAAW;IACT,SAAS;IACT,YAAY;IACZ,4BAA4B;IAC7B;GACD,mBAAmB;GACnB,aAAa,EAAE;GACf,2BAA2B;GAC3B,oBAAoB;GACrB;EACD,OAAO,EACL,KAAK,EACH,QAAQ;GACN,YAAY;GACZ,WAAW,EAAE;GACd,EACF,EACF;EACD,MAAM;GACJ,SAAS;GACT,mBAAmB;GACnB,iBAAiB;GACjB,sBAAsB;GACtB,eAAe;GAChB;EACD,OAAO;GACL,UAAU;GACV,eAAe;GACf,6BAA6B;GAC7B,gBAAgB;GAChB,uBAAuB;GACxB;EACD,YAAY;GACV,OAAO,EAAE;GACT,UAAU;IACR,kBAAkB;IAClB,gBAAgB;IAChB,OAAO,EAAE;IACT,iBAAiB;IACjB,sBAAsB;IACvB;GACD,OAAO,EAAE;GACV;EACD,WAAW,EACT,SAAS,MACV;EAIF,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//#region src/connectors/builtin-catalog.ts
|
|
2
|
+
const BUILTIN_CONNECTORS = [
|
|
3
|
+
{
|
|
4
|
+
id: "fetch",
|
|
5
|
+
version: "1.0.0",
|
|
6
|
+
displayName: "Fetch",
|
|
7
|
+
description: "Fetch and read web pages through the official MCP fetch server.",
|
|
8
|
+
category: "docs",
|
|
9
|
+
kind: "mcp",
|
|
10
|
+
source: "builtin",
|
|
11
|
+
capabilities: ["tools", "runtime.mcp.stdio"],
|
|
12
|
+
tags: [
|
|
13
|
+
"web",
|
|
14
|
+
"docs",
|
|
15
|
+
"http"
|
|
16
|
+
],
|
|
17
|
+
auth: { mode: "none" },
|
|
18
|
+
setup: {},
|
|
19
|
+
runtime: {
|
|
20
|
+
type: "mcp",
|
|
21
|
+
serverId: "fetch",
|
|
22
|
+
serverTemplate: {
|
|
23
|
+
command: "uvx",
|
|
24
|
+
args: ["mcp-server-fetch"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "filesystem",
|
|
30
|
+
version: "1.0.0",
|
|
31
|
+
displayName: "Filesystem",
|
|
32
|
+
description: "Read and search files from an explicitly selected local directory.",
|
|
33
|
+
category: "docs",
|
|
34
|
+
kind: "mcp",
|
|
35
|
+
source: "builtin",
|
|
36
|
+
capabilities: [
|
|
37
|
+
"tools",
|
|
38
|
+
"resources",
|
|
39
|
+
"runtime.mcp.stdio"
|
|
40
|
+
],
|
|
41
|
+
tags: [
|
|
42
|
+
"files",
|
|
43
|
+
"local",
|
|
44
|
+
"docs"
|
|
45
|
+
],
|
|
46
|
+
auth: { mode: "none" },
|
|
47
|
+
setup: { config: [{
|
|
48
|
+
key: "rootPath",
|
|
49
|
+
label: "Allowed directory",
|
|
50
|
+
type: "path",
|
|
51
|
+
required: true,
|
|
52
|
+
placeholder: "/Users/you/project",
|
|
53
|
+
description: "The only directory this connector can expose to the MCP runtime."
|
|
54
|
+
}] },
|
|
55
|
+
runtime: {
|
|
56
|
+
type: "mcp",
|
|
57
|
+
serverId: "filesystem",
|
|
58
|
+
serverTemplate: {
|
|
59
|
+
command: "npx",
|
|
60
|
+
args: [
|
|
61
|
+
"-y",
|
|
62
|
+
"@modelcontextprotocol/server-filesystem",
|
|
63
|
+
"{{config.rootPath}}"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "time",
|
|
70
|
+
version: "1.0.0",
|
|
71
|
+
displayName: "Time",
|
|
72
|
+
description: "Convert time zones and answer current-time questions through an MCP time server.",
|
|
73
|
+
category: "automation",
|
|
74
|
+
kind: "mcp",
|
|
75
|
+
source: "builtin",
|
|
76
|
+
capabilities: ["tools", "runtime.mcp.stdio"],
|
|
77
|
+
tags: [
|
|
78
|
+
"time",
|
|
79
|
+
"timezone",
|
|
80
|
+
"utility"
|
|
81
|
+
],
|
|
82
|
+
auth: { mode: "none" },
|
|
83
|
+
setup: {},
|
|
84
|
+
runtime: {
|
|
85
|
+
type: "mcp",
|
|
86
|
+
serverId: "time",
|
|
87
|
+
serverTemplate: {
|
|
88
|
+
command: "uvx",
|
|
89
|
+
args: ["mcp-server-time"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "playwright",
|
|
95
|
+
version: "1.0.0",
|
|
96
|
+
displayName: "Playwright",
|
|
97
|
+
description: "Automate and inspect browser pages through the official Playwright MCP server.",
|
|
98
|
+
category: "browser",
|
|
99
|
+
kind: "mcp",
|
|
100
|
+
source: "builtin",
|
|
101
|
+
capabilities: ["tools", "runtime.mcp.stdio"],
|
|
102
|
+
tags: [
|
|
103
|
+
"browser",
|
|
104
|
+
"automation",
|
|
105
|
+
"testing"
|
|
106
|
+
],
|
|
107
|
+
auth: { mode: "none" },
|
|
108
|
+
setup: {},
|
|
109
|
+
runtime: {
|
|
110
|
+
type: "mcp",
|
|
111
|
+
serverId: "playwright",
|
|
112
|
+
serverTemplate: {
|
|
113
|
+
command: "npx",
|
|
114
|
+
args: ["-y", "@playwright/mcp@latest"]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "github",
|
|
120
|
+
version: "1.0.0",
|
|
121
|
+
displayName: "GitHub",
|
|
122
|
+
description: "Work with GitHub repositories, issues, pull requests, and code search.",
|
|
123
|
+
category: "code",
|
|
124
|
+
kind: "mcp",
|
|
125
|
+
source: "builtin",
|
|
126
|
+
capabilities: [
|
|
127
|
+
"tools",
|
|
128
|
+
"auth.oauth",
|
|
129
|
+
"runtime.mcp.stdio"
|
|
130
|
+
],
|
|
131
|
+
tags: [
|
|
132
|
+
"code",
|
|
133
|
+
"repository",
|
|
134
|
+
"issues"
|
|
135
|
+
],
|
|
136
|
+
auth: { mode: "oauth" },
|
|
137
|
+
setup: {},
|
|
138
|
+
runtime: {
|
|
139
|
+
type: "mcp",
|
|
140
|
+
serverId: "github",
|
|
141
|
+
serverTemplate: {
|
|
142
|
+
command: "npx",
|
|
143
|
+
args: ["-y", "@modelcontextprotocol/server-github"],
|
|
144
|
+
env: { GITHUB_PERSONAL_ACCESS_TOKEN: "{{secrets.GITHUB_PERSONAL_ACCESS_TOKEN}}" }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
];
|
|
149
|
+
//#endregion
|
|
150
|
+
export { BUILTIN_CONNECTORS };
|
|
151
|
+
|
|
152
|
+
//# sourceMappingURL=builtin-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-catalog.js","names":[],"sources":["../../../src/connectors/builtin-catalog.ts"],"sourcesContent":["import type { ConnectorDefinition } from './types.js';\n\nexport const BUILTIN_CONNECTORS: readonly ConnectorDefinition[] = [\n {\n id: 'fetch',\n version: '1.0.0',\n displayName: 'Fetch',\n description: 'Fetch and read web pages through the official MCP fetch server.',\n category: 'docs',\n kind: 'mcp',\n source: 'builtin',\n capabilities: ['tools', 'runtime.mcp.stdio'],\n tags: ['web', 'docs', 'http'],\n auth: { mode: 'none' },\n setup: {},\n runtime: {\n type: 'mcp',\n serverId: 'fetch',\n serverTemplate: {\n command: 'uvx',\n args: ['mcp-server-fetch'],\n },\n },\n },\n {\n id: 'filesystem',\n version: '1.0.0',\n displayName: 'Filesystem',\n description: 'Read and search files from an explicitly selected local directory.',\n category: 'docs',\n kind: 'mcp',\n source: 'builtin',\n capabilities: ['tools', 'resources', 'runtime.mcp.stdio'],\n tags: ['files', 'local', 'docs'],\n auth: { mode: 'none' },\n setup: {\n config: [\n {\n key: 'rootPath',\n label: 'Allowed directory',\n type: 'path',\n required: true,\n placeholder: '/Users/you/project',\n description: 'The only directory this connector can expose to the MCP runtime.',\n },\n ],\n },\n runtime: {\n type: 'mcp',\n serverId: 'filesystem',\n serverTemplate: {\n command: 'npx',\n args: ['-y', '@modelcontextprotocol/server-filesystem', '{{config.rootPath}}'],\n },\n },\n },\n {\n id: 'time',\n version: '1.0.0',\n displayName: 'Time',\n description: 'Convert time zones and answer current-time questions through an MCP time server.',\n category: 'automation',\n kind: 'mcp',\n source: 'builtin',\n capabilities: ['tools', 'runtime.mcp.stdio'],\n tags: ['time', 'timezone', 'utility'],\n auth: { mode: 'none' },\n setup: {},\n runtime: {\n type: 'mcp',\n serverId: 'time',\n serverTemplate: {\n command: 'uvx',\n args: ['mcp-server-time'],\n },\n },\n },\n {\n id: 'playwright',\n version: '1.0.0',\n displayName: 'Playwright',\n description: 'Automate and inspect browser pages through the official Playwright MCP server.',\n category: 'browser',\n kind: 'mcp',\n source: 'builtin',\n capabilities: ['tools', 'runtime.mcp.stdio'],\n tags: ['browser', 'automation', 'testing'],\n auth: { mode: 'none' },\n setup: {},\n runtime: {\n type: 'mcp',\n serverId: 'playwright',\n serverTemplate: {\n command: 'npx',\n args: ['-y', '@playwright/mcp@latest'],\n },\n },\n },\n {\n id: 'github',\n version: '1.0.0',\n displayName: 'GitHub',\n description: 'Work with GitHub repositories, issues, pull requests, and code search.',\n category: 'code',\n kind: 'mcp',\n source: 'builtin',\n capabilities: ['tools', 'auth.oauth', 'runtime.mcp.stdio'],\n tags: ['code', 'repository', 'issues'],\n auth: { mode: 'oauth' },\n setup: {},\n runtime: {\n type: 'mcp',\n serverId: 'github',\n serverTemplate: {\n command: 'npx',\n args: ['-y', '@modelcontextprotocol/server-github'],\n env: {\n GITHUB_PERSONAL_ACCESS_TOKEN: '{{secrets.GITHUB_PERSONAL_ACCESS_TOKEN}}',\n },\n },\n },\n },\n];\n"],"mappings":";AAEA,MAAa,qBAAqD;CAChE;EACE,IAAI;EACJ,SAAS;EACT,aAAa;EACb,aAAa;EACb,UAAU;EACV,MAAM;EACN,QAAQ;EACR,cAAc,CAAC,SAAS,oBAAoB;EAC5C,MAAM;GAAC;GAAO;GAAQ;GAAO;EAC7B,MAAM,EAAE,MAAM,QAAQ;EACtB,OAAO,EAAE;EACT,SAAS;GACP,MAAM;GACN,UAAU;GACV,gBAAgB;IACd,SAAS;IACT,MAAM,CAAC,mBAAmB;IAC3B;GACF;EACF;CACD;EACE,IAAI;EACJ,SAAS;EACT,aAAa;EACb,aAAa;EACb,UAAU;EACV,MAAM;EACN,QAAQ;EACR,cAAc;GAAC;GAAS;GAAa;GAAoB;EACzD,MAAM;GAAC;GAAS;GAAS;GAAO;EAChC,MAAM,EAAE,MAAM,QAAQ;EACtB,OAAO,EACL,QAAQ,CACN;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,UAAU;GACV,aAAa;GACb,aAAa;GACd,CACF,EACF;EACD,SAAS;GACP,MAAM;GACN,UAAU;GACV,gBAAgB;IACd,SAAS;IACT,MAAM;KAAC;KAAM;KAA2C;KAAsB;IAC/E;GACF;EACF;CACD;EACE,IAAI;EACJ,SAAS;EACT,aAAa;EACb,aAAa;EACb,UAAU;EACV,MAAM;EACN,QAAQ;EACR,cAAc,CAAC,SAAS,oBAAoB;EAC5C,MAAM;GAAC;GAAQ;GAAY;GAAU;EACrC,MAAM,EAAE,MAAM,QAAQ;EACtB,OAAO,EAAE;EACT,SAAS;GACP,MAAM;GACN,UAAU;GACV,gBAAgB;IACd,SAAS;IACT,MAAM,CAAC,kBAAkB;IAC1B;GACF;EACF;CACD;EACE,IAAI;EACJ,SAAS;EACT,aAAa;EACb,aAAa;EACb,UAAU;EACV,MAAM;EACN,QAAQ;EACR,cAAc,CAAC,SAAS,oBAAoB;EAC5C,MAAM;GAAC;GAAW;GAAc;GAAU;EAC1C,MAAM,EAAE,MAAM,QAAQ;EACtB,OAAO,EAAE;EACT,SAAS;GACP,MAAM;GACN,UAAU;GACV,gBAAgB;IACd,SAAS;IACT,MAAM,CAAC,MAAM,yBAAyB;IACvC;GACF;EACF;CACD;EACE,IAAI;EACJ,SAAS;EACT,aAAa;EACb,aAAa;EACb,UAAU;EACV,MAAM;EACN,QAAQ;EACR,cAAc;GAAC;GAAS;GAAc;GAAoB;EAC1D,MAAM;GAAC;GAAQ;GAAc;GAAS;EACtC,MAAM,EAAE,MAAM,SAAS;EACvB,OAAO,EAAE;EACT,SAAS;GACP,MAAM;GACN,UAAU;GACV,gBAAgB;IACd,SAAS;IACT,MAAM,CAAC,MAAM,sCAAsC;IACnD,KAAK,EACH,8BAA8B,4CAC/B;IACF;GACF;EACF;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { listConnectorProviders } from './providers.js';
|
|
2
|
+
import type { ConnectorDefinition } from './types.js';
|
|
3
|
+
export declare function listConnectorCatalog(): ConnectorDefinition[];
|
|
4
|
+
export declare function getConnectorDefinition(connectorId: string): ConnectorDefinition | undefined;
|
|
5
|
+
export { listConnectorProviders };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { listConnectorProviderDefinitions, listConnectorProviders } from "./providers.js";
|
|
2
|
+
//#region src/connectors/catalog.ts
|
|
3
|
+
const CONNECTOR_BY_ID = new Map(listConnectorProviderDefinitions().map((connector) => [connector.id, connector]));
|
|
4
|
+
function listConnectorCatalog() {
|
|
5
|
+
return listConnectorProviderDefinitions().sort((left, right) => left.displayName.localeCompare(right.displayName));
|
|
6
|
+
}
|
|
7
|
+
function getConnectorDefinition(connectorId) {
|
|
8
|
+
return CONNECTOR_BY_ID.get(connectorId);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getConnectorDefinition, listConnectorCatalog, listConnectorProviders };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","names":[],"sources":["../../../src/connectors/catalog.ts"],"sourcesContent":["import { listConnectorProviderDefinitions, listConnectorProviders } from './providers.js';\nimport type { ConnectorDefinition } from './types.js';\n\nconst CONNECTOR_BY_ID = new Map(listConnectorProviderDefinitions().map((connector) => [connector.id, connector]));\n\nexport function listConnectorCatalog(): ConnectorDefinition[] {\n return listConnectorProviderDefinitions().sort((left, right) => left.displayName.localeCompare(right.displayName));\n}\n\nexport function getConnectorDefinition(connectorId: string): ConnectorDefinition | undefined {\n return CONNECTOR_BY_ID.get(connectorId);\n}\n\nexport { listConnectorProviders };\n"],"mappings":";;AAGA,MAAM,kBAAkB,IAAI,IAAI,kCAAkC,CAAC,KAAK,cAAc,CAAC,UAAU,IAAI,UAAU,CAAC,CAAC;AAEjH,SAAgB,uBAA8C;AAC5D,QAAO,kCAAkC,CAAC,MAAM,MAAM,UAAU,KAAK,YAAY,cAAc,MAAM,YAAY,CAAC;;AAGpH,SAAgB,uBAAuB,aAAsD;AAC3F,QAAO,gBAAgB,IAAI,YAAY"}
|