refactor(loaders): migrate to async-first pattern for commands and skills
- Remove all sync functions from command loader (async now default) - Remove sync load functions from skill loader (async now default) - Add resolveSymlinkAsync to file-utils.ts - Update all callers to use async versions: - config-handler.ts - index.ts - tools/slashcommand/tools.ts - tools/skill/tools.ts - hooks/auto-slash-command/executor.ts - loader.test.ts - All 607 tests pass, build succeeds Generated with assistance of 🤖 [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
16
src/index.ts
16
src/index.ts
@@ -34,10 +34,10 @@ import {
|
||||
} from "./features/context-injector";
|
||||
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity";
|
||||
import {
|
||||
discoverUserClaudeSkillsAsync,
|
||||
discoverProjectClaudeSkillsAsync,
|
||||
discoverOpencodeGlobalSkillsAsync,
|
||||
discoverOpencodeProjectSkillsAsync,
|
||||
discoverUserClaudeSkills,
|
||||
discoverProjectClaudeSkills,
|
||||
discoverOpencodeGlobalSkills,
|
||||
discoverOpencodeProjectSkills,
|
||||
mergeSkills,
|
||||
} from "./features/opencode-skill-loader";
|
||||
import { createBuiltinSkills } from "./features/builtin-skills";
|
||||
@@ -205,10 +205,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
});
|
||||
const includeClaudeSkills = pluginConfig.claude_code?.skills !== false;
|
||||
const [userSkills, globalSkills, projectSkills, opencodeProjectSkills] = await Promise.all([
|
||||
includeClaudeSkills ? discoverUserClaudeSkillsAsync() : Promise.resolve([]),
|
||||
discoverOpencodeGlobalSkillsAsync(),
|
||||
includeClaudeSkills ? discoverProjectClaudeSkillsAsync() : Promise.resolve([]),
|
||||
discoverOpencodeProjectSkillsAsync(),
|
||||
includeClaudeSkills ? discoverUserClaudeSkills() : Promise.resolve([]),
|
||||
discoverOpencodeGlobalSkills(),
|
||||
includeClaudeSkills ? discoverProjectClaudeSkills() : Promise.resolve([]),
|
||||
discoverOpencodeProjectSkills(),
|
||||
]);
|
||||
const mergedSkills = mergeSkills(
|
||||
builtinSkills,
|
||||
|
||||
Reference in New Issue
Block a user