refactor: update remaining modules to use plugin-identity constants
Update various modules to use centralized constants from plugin-identity:
- get-local-version/formatter: Use PUBLISHED_PACKAGE_NAME
- run/session-resolver: Use PUBLISHED_PACKAGE_NAME
- background-agent/task-poller: Use PUBLISHED_PACKAGE_NAME
- mcp-oauth/provider: Use PUBLISHED_PACKAGE_NAME
- auto-update-checker/constants: Use ACCEPTED_PACKAGE_NAMES
- comment-checker/downloader: Use PUBLISHED_PACKAGE_NAME
- legacy-plugin-toast/hook: Use PLUGIN_NAME
- shared/data-path: Use CACHE_DIR_NAME
- shared/external-plugin-detector: Use ACCEPTED_PACKAGE_NAMES
- shared/logger: Use LOG_FILENAME
- tools/ast-grep/downloader: Use PUBLISHED_PACKAGE_NAME
- tools/call-omo-agent/tools: Use PUBLISHED_PACKAGE_NAME
- tools/delegate-task/category-resolver: Use PUBLISHED_PACKAGE_NAME
- tools/grep/constants: Use PUBLISHED_PACKAGE_NAME
- tools/grep/downloader: Use PUBLISHED_PACKAGE_NAME
- tools/lsp/lsp-client-wrapper: Use PUBLISHED_PACKAGE_NAME
🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
@@ -2,6 +2,8 @@ import * as path from "node:path"
|
||||
import * as os from "node:os"
|
||||
import { accessSync, constants, mkdirSync } from "node:fs"
|
||||
|
||||
import { CACHE_DIR_NAME } from "./plugin-identity"
|
||||
|
||||
function resolveWritableDirectory(preferredDir: string, fallbackSuffix: string): string {
|
||||
try {
|
||||
mkdirSync(preferredDir, { recursive: true })
|
||||
@@ -50,7 +52,7 @@ export function getCacheDir(): string {
|
||||
* All platforms: ~/.cache/oh-my-opencode
|
||||
*/
|
||||
export function getOmoOpenCodeCacheDir(): string {
|
||||
return path.join(getCacheDir(), "oh-my-opencode")
|
||||
return path.join(getCacheDir(), CACHE_DIR_NAME)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import { loadOpencodePlugins } from "./load-opencode-plugins"
|
||||
import { log } from "./logger"
|
||||
import { CONFIG_BASENAME, PLUGIN_NAME } from "./plugin-identity"
|
||||
|
||||
/**
|
||||
* Known notification plugins that conflict with oh-my-opencode's session-notification.
|
||||
@@ -110,29 +111,29 @@ export function detectExternalSkillPlugin(directory: string): ExternalSkillPlugi
|
||||
* Generate a warning message for users with conflicting notification plugins.
|
||||
*/
|
||||
export function getNotificationConflictWarning(pluginName: string): string {
|
||||
return `[oh-my-opencode] External notification plugin detected: ${pluginName}
|
||||
return `[${PLUGIN_NAME}] External notification plugin detected: ${pluginName}
|
||||
|
||||
Both oh-my-opencode and ${pluginName} listen to session.idle events.
|
||||
Both ${PLUGIN_NAME} and ${pluginName} listen to session.idle events.
|
||||
Running both simultaneously can cause crashes on Windows.
|
||||
|
||||
oh-my-opencode's session-notification has been auto-disabled.
|
||||
${PLUGIN_NAME}'s session-notification has been auto-disabled.
|
||||
|
||||
To use oh-my-opencode's notifications instead, either:
|
||||
To use ${PLUGIN_NAME}'s notifications instead, either:
|
||||
1. Remove ${pluginName} from your opencode.json plugins
|
||||
2. Or set "notification": { "force_enable": true } in oh-my-opencode.json`
|
||||
2. Or set "notification": { "force_enable": true } in ${CONFIG_BASENAME}.json`
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a warning message for users with conflicting skill plugins.
|
||||
*/
|
||||
export function getSkillPluginConflictWarning(pluginName: string): string {
|
||||
return `[oh-my-opencode] External skill plugin detected: ${pluginName}
|
||||
return `[${PLUGIN_NAME}] External skill plugin detected: ${pluginName}
|
||||
|
||||
Both oh-my-opencode and ${pluginName} scan ~/.config/opencode/skills/ and register tools independently.
|
||||
Both ${PLUGIN_NAME} and ${pluginName} scan ~/.config/opencode/skills/ and register tools independently.
|
||||
Running both simultaneously causes "Duplicate tool names detected" warnings and HTTP 400 errors.
|
||||
|
||||
Consider either:
|
||||
1. Remove ${pluginName} from your opencode.json plugins to use oh-my-opencode's skill loading
|
||||
2. Or disable oh-my-opencode's skill loading by setting "claude_code.skills": false in oh-my-opencode.json
|
||||
3. Or uninstall oh-my-opencode if you prefer ${pluginName}'s skill management`
|
||||
1. Remove ${pluginName} from your opencode.json plugins to use ${PLUGIN_NAME}'s skill loading
|
||||
2. Or disable ${PLUGIN_NAME}'s skill loading by setting "claude_code.skills": false in ${CONFIG_BASENAME}.json
|
||||
3. Or uninstall ${PLUGIN_NAME} if you prefer ${pluginName}'s skill management`
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ import * as fs from "fs"
|
||||
import * as os from "os"
|
||||
import * as path from "path"
|
||||
|
||||
const logFile = path.join(os.tmpdir(), "oh-my-opencode.log")
|
||||
import { LOG_FILENAME } from "./plugin-identity"
|
||||
|
||||
const logFile = path.join(os.tmpdir(), LOG_FILENAME)
|
||||
|
||||
let buffer: string[] = []
|
||||
let flushTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
Reference in New Issue
Block a user