/** * Settings declared by this domain (see `config/registry.ts`). Declaration order is the * settings-panel order; `config/all-settings.ts` registers every domain. */ import { combine, register, type SettingValueOf } from "../config/registry"; import { DEFAULT_SKILLS_URL } from "@oh-my-pi/pi-wire/skillshare"; const EMPTY_STRING_ARRAY: string[] = []; export const cfgExtensions = register({ id: "extensions", type: "array", default: EMPTY_STRING_ARRAY }); export const cfgDisabledExtensions = register({ id: "disabledExtensions", type: "array", default: EMPTY_STRING_ARRAY }); // Skill registry (omp skill) export const cfgSkillsRegistryUrl = register({ id: "skills.registryUrl", type: "string", default: DEFAULT_SKILLS_URL, ui: { tab: "interaction", group: "Skills", label: "Skill Registry", description: "Skillshare registry used by `omp skill` to install, search, and publish skills (https://host[:port])", }, }); // Skills export const cfgSkillsEnabled = register({ id: "skills.enabled", type: "boolean", default: true }); export const cfgSkillsEnableSkillCommands = register({ id: "skills.enableSkillCommands", type: "boolean", default: true, ui: { tab: "tasks", group: "Commands & Skills", label: "Skill Commands", description: "Register skills as /skill:name commands", }, }); export const cfgSkillsEnableCodexUser = register({ id: "skills.enableCodexUser", type: "boolean", default: false }); export const cfgSkillsEnableClaudeUser = register({ id: "skills.enableClaudeUser", type: "boolean", default: false }); export const cfgSkillsEnableClaudeProject = register({ id: "skills.enableClaudeProject", type: "boolean", default: true, }); export const cfgSkillsEnablePiUser = register({ id: "skills.enablePiUser", type: "boolean", default: true }); export const cfgSkillsEnablePiProject = register({ id: "skills.enablePiProject", type: "boolean", default: true }); export const cfgSkillsEnableAgentsUser = register({ id: "skills.enableAgentsUser", type: "boolean", default: true }); export const cfgSkillsEnableAgentsProject = register({ id: "skills.enableAgentsProject", type: "boolean", default: true, }); export const cfgSkillsCustomDirectories = register({ id: "skills.customDirectories", type: "array", default: EMPTY_STRING_ARRAY, }); export const cfgSkillsIgnoredSkills = register({ id: "skills.ignoredSkills", type: "array", default: EMPTY_STRING_ARRAY, }); export const cfgSkillsManualSkills = register({ id: "skills.manualSkills", type: "array", default: EMPTY_STRING_ARRAY, }); export const cfgSkillsIncludeSkills = register({ id: "skills.includeSkills", type: "array", default: EMPTY_STRING_ARRAY, }); /** Skill discovery options (`skills.*` except the `omp skill` registry URL). */ export const cfgSkills = combine({ enabled: cfgSkillsEnabled, enableSkillCommands: cfgSkillsEnableSkillCommands, enableCodexUser: cfgSkillsEnableCodexUser, enableClaudeUser: cfgSkillsEnableClaudeUser, enableClaudeProject: cfgSkillsEnableClaudeProject, enablePiUser: cfgSkillsEnablePiUser, enablePiProject: cfgSkillsEnablePiProject, enableAgentsUser: cfgSkillsEnableAgentsUser, enableAgentsProject: cfgSkillsEnableAgentsProject, customDirectories: cfgSkillsCustomDirectories, ignoredSkills: cfgSkillsIgnoredSkills, manualSkills: cfgSkillsManualSkills, includeSkills: cfgSkillsIncludeSkills, }); /** Skill discovery options ({@link cfgSkills}); omitted fields fall back to the setting defaults. */ export type SkillsSettings = Partial>; // Commands export const cfgCommandsEnableClaudeUser = register({ id: "commands.enableClaudeUser", type: "boolean", default: false, ui: { tab: "tasks", group: "Commands & Skills", label: "Claude User Commands", description: "Load commands from ~/.claude/commands/", }, }); export const cfgCommandsEnableClaudeProject = register({ id: "commands.enableClaudeProject", type: "boolean", default: true, ui: { tab: "tasks", group: "Commands & Skills", label: "Claude Project Commands", description: "Load commands from .claude/commands/", }, }); export const cfgCommandsEnableOpencodeUser = register({ id: "commands.enableOpencodeUser", type: "boolean", default: false, ui: { tab: "tasks", group: "Commands & Skills", label: "OpenCode User Commands", description: "Load commands from ~/.config/opencode/commands/", }, }); export const cfgCommandsEnableOpencodeProject = register({ id: "commands.enableOpencodeProject", type: "boolean", default: true, ui: { tab: "tasks", group: "Commands & Skills", label: "OpenCode Project Commands", description: "Load commands from .opencode/commands/", }, }); export const cfgExtensionHandlersToolCallTimeoutMs = register({ id: "extensionHandlers.toolCallTimeoutMs", type: "number", default: 30_000, ui: { tab: "tools", group: "Extensions", label: "Tool Call Handler Timeout (ms)", description: "Positive finite active-work timeout for extension tool_call handlers; invalid values use 30000ms, and time awaiting OMP-owned dialogs does not count", }, }); export const cfgExtensionHandlersModeControl = register({ id: "extensionHandlers.modeControl", type: "boolean", default: true, ui: { tab: "tools", group: "Extensions", label: "Extension Mode Control", description: "Let extensions enter and exit plan, vibe, goal, and loop modes via ctx.sessionModes.set(); reading mode state stays available", }, }); export const cfgExtensionAssistantTextRenderers = register({ id: "extensionRenderers.assistantText", type: "boolean", default: false, ui: { tab: "tools", group: "Extensions", label: "Extension Reply Renderers", description: "Let extensions change how assistant replies are drawn, redraw a reply in place, and receive clicks on their own links; the session, exports and model context keep the reply as written", }, }); export const cfgExtensionTranscriptPresenters = register({ id: "extensionRenderers.transcriptPresenters", type: "boolean", default: false, ui: { tab: "tools", group: "Extensions", label: "Extension Transcript Presenters", description: "Let extensions draw transcript blocks such as tool calls in full, as one compact row, or hidden; the session, exports and model context are unchanged", }, });