oh-my-opencode 2.12.4 → 2.13.1
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/README.ja.md +20 -27
- package/README.ko.md +20 -27
- package/README.md +23 -24
- package/README.zh-cn.md +20 -27
- package/dist/cli/config-manager.d.ts +17 -29
- package/dist/cli/index.js +68 -161
- package/dist/config/schema.d.ts +2 -6
- package/dist/config/schema.test.d.ts +1 -0
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/claude-code-command-loader/loader.d.ts +5 -9
- package/dist/features/opencode-skill-loader/loader.d.ts +11 -41
- package/dist/hooks/keyword-detector/constants.d.ts +7 -1
- package/dist/hooks/keyword-detector/detector.d.ts +2 -2
- package/dist/index.js +1182 -493
- package/dist/mcp/index.d.ts +1 -2
- package/dist/mcp/index.test.d.ts +1 -0
- package/dist/mcp/types.d.ts +2 -1
- package/dist/shared/file-utils.d.ts +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/slashcommand/index.d.ts +1 -1
- package/dist/tools/slashcommand/tools.d.ts +10 -1
- package/dist/tools/slashcommand/types.d.ts +7 -0
- package/package.json +1 -1
- package/dist/mcp/websearch-exa.d.ts +0 -5
package/dist/cli/index.js
CHANGED
|
@@ -2657,7 +2657,7 @@ var require_napi = __commonJS((exports, module) => {
|
|
|
2657
2657
|
var require_package = __commonJS((exports, module) => {
|
|
2658
2658
|
module.exports = {
|
|
2659
2659
|
name: "oh-my-opencode",
|
|
2660
|
-
version: "2.
|
|
2660
|
+
version: "2.13.0",
|
|
2661
2661
|
description: "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
|
|
2662
2662
|
main: "dist/index.js",
|
|
2663
2663
|
types: "dist/index.d.ts",
|
|
@@ -6972,13 +6972,9 @@ function getConfigJson() {
|
|
|
6972
6972
|
function getConfigJsonc() {
|
|
6973
6973
|
return getConfigContext().paths.configJsonc;
|
|
6974
6974
|
}
|
|
6975
|
-
function getPackageJson() {
|
|
6976
|
-
return getConfigContext().paths.packageJson;
|
|
6977
|
-
}
|
|
6978
6975
|
function getOmoConfig() {
|
|
6979
6976
|
return getConfigContext().paths.omoConfig;
|
|
6980
6977
|
}
|
|
6981
|
-
var CHATGPT_HOTFIX_REPO = "code-yeongyu/opencode-openai-codex-auth#fix/orphaned-function-call-output-with-tools";
|
|
6982
6978
|
var BUN_INSTALL_TIMEOUT_SECONDS = 60;
|
|
6983
6979
|
var BUN_INSTALL_TIMEOUT_MS = BUN_INSTALL_TIMEOUT_SECONDS * 1000;
|
|
6984
6980
|
function isPermissionError(err) {
|
|
@@ -7134,28 +7130,27 @@ function generateOmoConfig(installConfig) {
|
|
|
7134
7130
|
}
|
|
7135
7131
|
const agents = {};
|
|
7136
7132
|
if (!installConfig.hasClaude) {
|
|
7137
|
-
agents["Sisyphus"] = { model: "opencode/
|
|
7133
|
+
agents["Sisyphus"] = { model: "opencode/glm-4.7-free" };
|
|
7138
7134
|
}
|
|
7135
|
+
agents["librarian"] = { model: "opencode/glm-4.7-free" };
|
|
7139
7136
|
if (installConfig.hasGemini) {
|
|
7140
|
-
agents["
|
|
7141
|
-
agents["explore"] = { model: "google/gemini-3-flash" };
|
|
7137
|
+
agents["explore"] = { model: "google/antigravity-gemini-3-flash" };
|
|
7142
7138
|
} else if (installConfig.hasClaude && installConfig.isMax20) {
|
|
7143
7139
|
agents["explore"] = { model: "anthropic/claude-haiku-4-5" };
|
|
7144
7140
|
} else {
|
|
7145
|
-
agents["
|
|
7146
|
-
agents["explore"] = { model: "opencode/big-pickle" };
|
|
7141
|
+
agents["explore"] = { model: "opencode/glm-4.7-free" };
|
|
7147
7142
|
}
|
|
7148
7143
|
if (!installConfig.hasChatGPT) {
|
|
7149
7144
|
agents["oracle"] = {
|
|
7150
|
-
model: installConfig.hasClaude ? "anthropic/claude-opus-4-5" : "opencode/
|
|
7145
|
+
model: installConfig.hasClaude ? "anthropic/claude-opus-4-5" : "opencode/glm-4.7-free"
|
|
7151
7146
|
};
|
|
7152
7147
|
}
|
|
7153
7148
|
if (installConfig.hasGemini) {
|
|
7154
|
-
agents["frontend-ui-ux-engineer"] = { model: "google/gemini-3-pro-high" };
|
|
7155
|
-
agents["document-writer"] = { model: "google/gemini-3-flash" };
|
|
7156
|
-
agents["multimodal-looker"] = { model: "google/gemini-3-flash" };
|
|
7149
|
+
agents["frontend-ui-ux-engineer"] = { model: "google/antigravity-gemini-3-pro-high" };
|
|
7150
|
+
agents["document-writer"] = { model: "google/antigravity-gemini-3-flash" };
|
|
7151
|
+
agents["multimodal-looker"] = { model: "google/antigravity-gemini-3-flash" };
|
|
7157
7152
|
} else {
|
|
7158
|
-
const fallbackModel = installConfig.hasClaude ? "anthropic/claude-opus-4-5" : "opencode/
|
|
7153
|
+
const fallbackModel = installConfig.hasClaude ? "anthropic/claude-opus-4-5" : "opencode/glm-4.7-free";
|
|
7159
7154
|
agents["frontend-ui-ux-engineer"] = { model: fallbackModel };
|
|
7160
7155
|
agents["document-writer"] = { model: fallbackModel };
|
|
7161
7156
|
agents["multimodal-looker"] = { model: fallbackModel };
|
|
@@ -7276,119 +7271,29 @@ async function addAuthPlugins(config) {
|
|
|
7276
7271
|
return { success: false, configPath: path2, error: formatErrorWithSuggestion(err, "add auth plugins to config") };
|
|
7277
7272
|
}
|
|
7278
7273
|
}
|
|
7279
|
-
function setupChatGPTHotfix() {
|
|
7280
|
-
try {
|
|
7281
|
-
ensureConfigDir();
|
|
7282
|
-
} catch (err) {
|
|
7283
|
-
return { success: false, configPath: getConfigDir(), error: formatErrorWithSuggestion(err, "create config directory") };
|
|
7284
|
-
}
|
|
7285
|
-
const packageJsonPath = getPackageJson();
|
|
7286
|
-
try {
|
|
7287
|
-
let packageJson = {};
|
|
7288
|
-
if (existsSync3(packageJsonPath)) {
|
|
7289
|
-
try {
|
|
7290
|
-
const stat = statSync(packageJsonPath);
|
|
7291
|
-
const content = readFileSync2(packageJsonPath, "utf-8");
|
|
7292
|
-
if (stat.size > 0 && !isEmptyOrWhitespace(content)) {
|
|
7293
|
-
packageJson = JSON.parse(content);
|
|
7294
|
-
if (typeof packageJson !== "object" || packageJson === null || Array.isArray(packageJson)) {
|
|
7295
|
-
packageJson = {};
|
|
7296
|
-
}
|
|
7297
|
-
}
|
|
7298
|
-
} catch (parseErr) {
|
|
7299
|
-
if (parseErr instanceof SyntaxError) {
|
|
7300
|
-
packageJson = {};
|
|
7301
|
-
} else {
|
|
7302
|
-
throw parseErr;
|
|
7303
|
-
}
|
|
7304
|
-
}
|
|
7305
|
-
}
|
|
7306
|
-
const deps = packageJson.dependencies ?? {};
|
|
7307
|
-
deps["opencode-openai-codex-auth"] = CHATGPT_HOTFIX_REPO;
|
|
7308
|
-
packageJson.dependencies = deps;
|
|
7309
|
-
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + `
|
|
7310
|
-
`);
|
|
7311
|
-
return { success: true, configPath: packageJsonPath };
|
|
7312
|
-
} catch (err) {
|
|
7313
|
-
return { success: false, configPath: packageJsonPath, error: formatErrorWithSuggestion(err, "setup ChatGPT hotfix in package.json") };
|
|
7314
|
-
}
|
|
7315
|
-
}
|
|
7316
|
-
async function runBunInstall() {
|
|
7317
|
-
const result = await runBunInstallWithDetails();
|
|
7318
|
-
return result.success;
|
|
7319
|
-
}
|
|
7320
|
-
async function runBunInstallWithDetails() {
|
|
7321
|
-
try {
|
|
7322
|
-
const proc = Bun.spawn(["bun", "install"], {
|
|
7323
|
-
cwd: getConfigDir(),
|
|
7324
|
-
stdout: "pipe",
|
|
7325
|
-
stderr: "pipe"
|
|
7326
|
-
});
|
|
7327
|
-
const timeoutPromise = new Promise((resolve) => setTimeout(() => resolve("timeout"), BUN_INSTALL_TIMEOUT_MS));
|
|
7328
|
-
const exitPromise = proc.exited.then(() => "completed");
|
|
7329
|
-
const result = await Promise.race([exitPromise, timeoutPromise]);
|
|
7330
|
-
if (result === "timeout") {
|
|
7331
|
-
try {
|
|
7332
|
-
proc.kill();
|
|
7333
|
-
} catch {}
|
|
7334
|
-
return {
|
|
7335
|
-
success: false,
|
|
7336
|
-
timedOut: true,
|
|
7337
|
-
error: `bun install timed out after ${BUN_INSTALL_TIMEOUT_SECONDS} seconds. Try running manually: cd ~/.config/opencode && bun i`
|
|
7338
|
-
};
|
|
7339
|
-
}
|
|
7340
|
-
if (proc.exitCode !== 0) {
|
|
7341
|
-
const stderr = await new Response(proc.stderr).text();
|
|
7342
|
-
return {
|
|
7343
|
-
success: false,
|
|
7344
|
-
error: stderr.trim() || `bun install failed with exit code ${proc.exitCode}`
|
|
7345
|
-
};
|
|
7346
|
-
}
|
|
7347
|
-
return { success: true };
|
|
7348
|
-
} catch (err) {
|
|
7349
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
7350
|
-
return {
|
|
7351
|
-
success: false,
|
|
7352
|
-
error: `bun install failed: ${message}. Is bun installed? Try: curl -fsSL https://bun.sh/install | bash`
|
|
7353
|
-
};
|
|
7354
|
-
}
|
|
7355
|
-
}
|
|
7356
7274
|
var ANTIGRAVITY_PROVIDER_CONFIG = {
|
|
7357
7275
|
google: {
|
|
7358
7276
|
name: "Google",
|
|
7359
7277
|
models: {
|
|
7360
|
-
"gemini-3-pro-high": {
|
|
7278
|
+
"antigravity-gemini-3-pro-high": {
|
|
7361
7279
|
name: "Gemini 3 Pro High (Antigravity)",
|
|
7362
7280
|
thinking: true,
|
|
7363
7281
|
attachment: true,
|
|
7364
7282
|
limit: { context: 1048576, output: 65535 },
|
|
7365
7283
|
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
7366
7284
|
},
|
|
7367
|
-
"gemini-3-pro-
|
|
7368
|
-
name: "Gemini 3 Pro Medium (Antigravity)",
|
|
7369
|
-
thinking: true,
|
|
7370
|
-
attachment: true,
|
|
7371
|
-
limit: { context: 1048576, output: 65535 },
|
|
7372
|
-
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
7373
|
-
},
|
|
7374
|
-
"gemini-3-pro-low": {
|
|
7285
|
+
"antigravity-gemini-3-pro-low": {
|
|
7375
7286
|
name: "Gemini 3 Pro Low (Antigravity)",
|
|
7376
7287
|
thinking: true,
|
|
7377
7288
|
attachment: true,
|
|
7378
7289
|
limit: { context: 1048576, output: 65535 },
|
|
7379
7290
|
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
7380
7291
|
},
|
|
7381
|
-
"gemini-3-flash": {
|
|
7292
|
+
"antigravity-gemini-3-flash": {
|
|
7382
7293
|
name: "Gemini 3 Flash (Antigravity)",
|
|
7383
7294
|
attachment: true,
|
|
7384
7295
|
limit: { context: 1048576, output: 65536 },
|
|
7385
7296
|
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
7386
|
-
},
|
|
7387
|
-
"gemini-3-flash-lite": {
|
|
7388
|
-
name: "Gemini 3 Flash Lite (Antigravity)",
|
|
7389
|
-
attachment: true,
|
|
7390
|
-
limit: { context: 1048576, output: 65536 },
|
|
7391
|
-
modalities: { input: ["text", "image", "pdf"], output: ["text"] }
|
|
7392
7297
|
}
|
|
7393
7298
|
}
|
|
7394
7299
|
}
|
|
@@ -7396,12 +7301,48 @@ var ANTIGRAVITY_PROVIDER_CONFIG = {
|
|
|
7396
7301
|
var CODEX_PROVIDER_CONFIG = {
|
|
7397
7302
|
openai: {
|
|
7398
7303
|
name: "OpenAI",
|
|
7399
|
-
|
|
7304
|
+
options: {
|
|
7305
|
+
reasoningEffort: "medium",
|
|
7306
|
+
reasoningSummary: "auto",
|
|
7307
|
+
textVerbosity: "medium",
|
|
7308
|
+
include: ["reasoning.encrypted_content"],
|
|
7309
|
+
store: false
|
|
7310
|
+
},
|
|
7400
7311
|
models: {
|
|
7401
|
-
"gpt-5.2": {
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7312
|
+
"gpt-5.2": {
|
|
7313
|
+
name: "GPT 5.2 (OAuth)",
|
|
7314
|
+
limit: { context: 272000, output: 128000 },
|
|
7315
|
+
modalities: { input: ["text", "image"], output: ["text"] },
|
|
7316
|
+
variants: {
|
|
7317
|
+
none: { reasoningEffort: "none", reasoningSummary: "auto", textVerbosity: "medium" },
|
|
7318
|
+
low: { reasoningEffort: "low", reasoningSummary: "auto", textVerbosity: "medium" },
|
|
7319
|
+
medium: { reasoningEffort: "medium", reasoningSummary: "auto", textVerbosity: "medium" },
|
|
7320
|
+
high: { reasoningEffort: "high", reasoningSummary: "detailed", textVerbosity: "medium" },
|
|
7321
|
+
xhigh: { reasoningEffort: "xhigh", reasoningSummary: "detailed", textVerbosity: "medium" }
|
|
7322
|
+
}
|
|
7323
|
+
},
|
|
7324
|
+
"gpt-5.2-codex": {
|
|
7325
|
+
name: "GPT 5.2 Codex (OAuth)",
|
|
7326
|
+
limit: { context: 272000, output: 128000 },
|
|
7327
|
+
modalities: { input: ["text", "image"], output: ["text"] },
|
|
7328
|
+
variants: {
|
|
7329
|
+
low: { reasoningEffort: "low", reasoningSummary: "auto", textVerbosity: "medium" },
|
|
7330
|
+
medium: { reasoningEffort: "medium", reasoningSummary: "auto", textVerbosity: "medium" },
|
|
7331
|
+
high: { reasoningEffort: "high", reasoningSummary: "detailed", textVerbosity: "medium" },
|
|
7332
|
+
xhigh: { reasoningEffort: "xhigh", reasoningSummary: "detailed", textVerbosity: "medium" }
|
|
7333
|
+
}
|
|
7334
|
+
},
|
|
7335
|
+
"gpt-5.1-codex-max": {
|
|
7336
|
+
name: "GPT 5.1 Codex Max (OAuth)",
|
|
7337
|
+
limit: { context: 272000, output: 128000 },
|
|
7338
|
+
modalities: { input: ["text", "image"], output: ["text"] },
|
|
7339
|
+
variants: {
|
|
7340
|
+
low: { reasoningEffort: "low", reasoningSummary: "detailed", textVerbosity: "medium" },
|
|
7341
|
+
medium: { reasoningEffort: "medium", reasoningSummary: "detailed", textVerbosity: "medium" },
|
|
7342
|
+
high: { reasoningEffort: "high", reasoningSummary: "detailed", textVerbosity: "medium" },
|
|
7343
|
+
xhigh: { reasoningEffort: "xhigh", reasoningSummary: "detailed", textVerbosity: "medium" }
|
|
7344
|
+
}
|
|
7345
|
+
}
|
|
7405
7346
|
}
|
|
7406
7347
|
}
|
|
7407
7348
|
};
|
|
@@ -7482,16 +7423,16 @@ function detectCurrentConfig() {
|
|
|
7482
7423
|
return result;
|
|
7483
7424
|
}
|
|
7484
7425
|
const agents = omoConfig.agents ?? {};
|
|
7485
|
-
if (agents["Sisyphus"]?.model === "opencode/
|
|
7426
|
+
if (agents["Sisyphus"]?.model === "opencode/glm-4.7-free") {
|
|
7486
7427
|
result.hasClaude = false;
|
|
7487
7428
|
result.isMax20 = false;
|
|
7488
|
-
} else if (agents["librarian"]?.model === "opencode/
|
|
7429
|
+
} else if (agents["librarian"]?.model === "opencode/glm-4.7-free") {
|
|
7489
7430
|
result.hasClaude = true;
|
|
7490
7431
|
result.isMax20 = false;
|
|
7491
7432
|
}
|
|
7492
7433
|
if (agents["oracle"]?.model?.startsWith("anthropic/")) {
|
|
7493
7434
|
result.hasChatGPT = false;
|
|
7494
|
-
} else if (agents["oracle"]?.model === "opencode/
|
|
7435
|
+
} else if (agents["oracle"]?.model === "opencode/glm-4.7-free") {
|
|
7495
7436
|
result.hasChatGPT = false;
|
|
7496
7437
|
}
|
|
7497
7438
|
if (omoConfig.google_auth === false) {
|
|
@@ -7530,10 +7471,10 @@ function formatConfigSummary(config) {
|
|
|
7530
7471
|
lines.push("");
|
|
7531
7472
|
lines.push(import_picocolors2.default.bold(import_picocolors2.default.white("Agent Configuration")));
|
|
7532
7473
|
lines.push("");
|
|
7533
|
-
const sisyphusModel = config.hasClaude ? "claude-opus-4-5" : "
|
|
7534
|
-
const oracleModel = config.hasChatGPT ? "gpt-5.2" : config.hasClaude ? "claude-opus-4-5" : "
|
|
7535
|
-
const librarianModel =
|
|
7536
|
-
const frontendModel = config.hasGemini ? "gemini-3-pro-high" : config.hasClaude ? "claude-opus-4-5" : "
|
|
7474
|
+
const sisyphusModel = config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free";
|
|
7475
|
+
const oracleModel = config.hasChatGPT ? "gpt-5.2" : config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free";
|
|
7476
|
+
const librarianModel = "glm-4.7-free";
|
|
7477
|
+
const frontendModel = config.hasGemini ? "antigravity-gemini-3-pro-high" : config.hasClaude ? "claude-opus-4-5" : "glm-4.7-free";
|
|
7537
7478
|
lines.push(` ${SYMBOLS.bullet} Sisyphus ${SYMBOLS.arrow} ${import_picocolors2.default.cyan(sisyphusModel)}`);
|
|
7538
7479
|
lines.push(` ${SYMBOLS.bullet} Oracle ${SYMBOLS.arrow} ${import_picocolors2.default.cyan(oracleModel)}`);
|
|
7539
7480
|
lines.push(` ${SYMBOLS.bullet} Librarian ${SYMBOLS.arrow} ${import_picocolors2.default.cyan(librarianModel)}`);
|
|
@@ -7625,7 +7566,7 @@ async function runTuiMode(detected) {
|
|
|
7625
7566
|
const claude = await ve({
|
|
7626
7567
|
message: "Do you have a Claude Pro/Max subscription?",
|
|
7627
7568
|
options: [
|
|
7628
|
-
{ value: "no", label: "No", hint: "Will use opencode/
|
|
7569
|
+
{ value: "no", label: "No", hint: "Will use opencode/glm-4.7-free as fallback" },
|
|
7629
7570
|
{ value: "yes", label: "Yes (standard)", hint: "Claude Opus 4.5 for orchestration" },
|
|
7630
7571
|
{ value: "max20", label: "Yes (max20 mode)", hint: "Full power with Claude Sonnet 4.5 for Librarian" }
|
|
7631
7572
|
],
|
|
@@ -7723,24 +7664,6 @@ async function runNonTuiInstall(args) {
|
|
|
7723
7664
|
} else {
|
|
7724
7665
|
step += 2;
|
|
7725
7666
|
}
|
|
7726
|
-
if (config.hasChatGPT) {
|
|
7727
|
-
printStep(step++, totalSteps, "Setting up ChatGPT hotfix...");
|
|
7728
|
-
const hotfixResult = setupChatGPTHotfix();
|
|
7729
|
-
if (!hotfixResult.success) {
|
|
7730
|
-
printError(`Failed: ${hotfixResult.error}`);
|
|
7731
|
-
return 1;
|
|
7732
|
-
}
|
|
7733
|
-
printSuccess(`Hotfix configured ${SYMBOLS.arrow} ${import_picocolors2.default.dim(hotfixResult.configPath)}`);
|
|
7734
|
-
printInfo("Installing dependencies with bun...");
|
|
7735
|
-
const bunSuccess = await runBunInstall();
|
|
7736
|
-
if (bunSuccess) {
|
|
7737
|
-
printSuccess("Dependencies installed");
|
|
7738
|
-
} else {
|
|
7739
|
-
printWarning("bun install failed - run manually: cd ~/.config/opencode && bun i");
|
|
7740
|
-
}
|
|
7741
|
-
} else {
|
|
7742
|
-
step++;
|
|
7743
|
-
}
|
|
7744
7667
|
printStep(step++, totalSteps, "Writing oh-my-opencode configuration...");
|
|
7745
7668
|
const omoResult = writeOmoConfig(config);
|
|
7746
7669
|
if (!omoResult.success) {
|
|
@@ -7750,7 +7673,7 @@ async function runNonTuiInstall(args) {
|
|
|
7750
7673
|
printSuccess(`Config written ${SYMBOLS.arrow} ${import_picocolors2.default.dim(omoResult.configPath)}`);
|
|
7751
7674
|
printBox(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete");
|
|
7752
7675
|
if (!config.hasClaude && !config.hasChatGPT && !config.hasGemini) {
|
|
7753
|
-
printWarning("No model providers configured. Using opencode/
|
|
7676
|
+
printWarning("No model providers configured. Using opencode/glm-4.7-free as fallback.");
|
|
7754
7677
|
}
|
|
7755
7678
|
if ((config.hasClaude || config.hasChatGPT || config.hasGemini) && !args.skipAuth) {
|
|
7756
7679
|
console.log(import_picocolors2.default.bold("Next Steps - Authenticate your providers:"));
|
|
@@ -7831,23 +7754,6 @@ async function install(args) {
|
|
|
7831
7754
|
}
|
|
7832
7755
|
s.stop(`Provider config added to ${import_picocolors2.default.cyan(providerResult.configPath)}`);
|
|
7833
7756
|
}
|
|
7834
|
-
if (config.hasChatGPT) {
|
|
7835
|
-
s.start("Setting up ChatGPT hotfix");
|
|
7836
|
-
const hotfixResult = setupChatGPTHotfix();
|
|
7837
|
-
if (!hotfixResult.success) {
|
|
7838
|
-
s.stop(`Failed to setup hotfix: ${hotfixResult.error}`);
|
|
7839
|
-
Se(import_picocolors2.default.red("Installation failed."));
|
|
7840
|
-
return 1;
|
|
7841
|
-
}
|
|
7842
|
-
s.stop(`Hotfix configured in ${import_picocolors2.default.cyan(hotfixResult.configPath)}`);
|
|
7843
|
-
s.start("Installing dependencies with bun");
|
|
7844
|
-
const bunSuccess = await runBunInstall();
|
|
7845
|
-
if (bunSuccess) {
|
|
7846
|
-
s.stop("Dependencies installed");
|
|
7847
|
-
} else {
|
|
7848
|
-
s.stop(import_picocolors2.default.yellow("bun install failed - run manually: cd ~/.config/opencode && bun i"));
|
|
7849
|
-
}
|
|
7850
|
-
}
|
|
7851
7757
|
s.start("Writing oh-my-opencode configuration");
|
|
7852
7758
|
const omoResult = writeOmoConfig(config);
|
|
7853
7759
|
if (!omoResult.success) {
|
|
@@ -7857,7 +7763,7 @@ async function install(args) {
|
|
|
7857
7763
|
}
|
|
7858
7764
|
s.stop(`Config written to ${import_picocolors2.default.cyan(omoResult.configPath)}`);
|
|
7859
7765
|
if (!config.hasClaude && !config.hasChatGPT && !config.hasGemini) {
|
|
7860
|
-
M2.warn("No model providers configured. Using opencode/
|
|
7766
|
+
M2.warn("No model providers configured. Using opencode/glm-4.7-free as fallback.");
|
|
7861
7767
|
}
|
|
7862
7768
|
Me(formatConfigSummary(config), isUpdate ? "Updated Configuration" : "Installation Complete");
|
|
7863
7769
|
if ((config.hasClaude || config.hasChatGPT || config.hasGemini) && !args.skipAuth) {
|
|
@@ -22612,7 +22518,8 @@ function date4(params) {
|
|
|
22612
22518
|
// node_modules/zod/v4/classic/external.js
|
|
22613
22519
|
config(en_default());
|
|
22614
22520
|
// src/mcp/types.ts
|
|
22615
|
-
var McpNameSchema = exports_external.enum(["
|
|
22521
|
+
var McpNameSchema = exports_external.enum(["context7", "grep_app"]);
|
|
22522
|
+
var AnyMcpNameSchema = exports_external.string().min(1);
|
|
22616
22523
|
|
|
22617
22524
|
// src/config/schema.ts
|
|
22618
22525
|
var PermissionValue = exports_external.enum(["ask", "allow", "deny"]);
|
|
@@ -22810,7 +22717,7 @@ var RalphLoopConfigSchema = exports_external.object({
|
|
|
22810
22717
|
});
|
|
22811
22718
|
var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
22812
22719
|
$schema: exports_external.string().optional(),
|
|
22813
|
-
disabled_mcps: exports_external.array(
|
|
22720
|
+
disabled_mcps: exports_external.array(AnyMcpNameSchema).optional(),
|
|
22814
22721
|
disabled_agents: exports_external.array(BuiltinAgentNameSchema).optional(),
|
|
22815
22722
|
disabled_skills: exports_external.array(BuiltinSkillNameSchema).optional(),
|
|
22816
22723
|
disabled_hooks: exports_external.array(HookNameSchema).optional(),
|
|
@@ -23373,7 +23280,7 @@ function getLspCheckDefinition() {
|
|
|
23373
23280
|
import { existsSync as existsSync9, readFileSync as readFileSync7 } from "fs";
|
|
23374
23281
|
import { homedir as homedir6 } from "os";
|
|
23375
23282
|
import { join as join7 } from "path";
|
|
23376
|
-
var BUILTIN_MCP_SERVERS = ["context7", "
|
|
23283
|
+
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
23377
23284
|
var MCP_CONFIG_PATHS = [
|
|
23378
23285
|
join7(homedir6(), ".claude", ".mcp.json"),
|
|
23379
23286
|
join7(process.cwd(), ".mcp.json"),
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -772,11 +772,7 @@ export declare const RalphLoopConfigSchema: z.ZodObject<{
|
|
|
772
772
|
}, z.core.$strip>;
|
|
773
773
|
export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
774
774
|
$schema: z.ZodOptional<z.ZodString>;
|
|
775
|
-
disabled_mcps: z.ZodOptional<z.ZodArray<z.
|
|
776
|
-
websearch_exa: "websearch_exa";
|
|
777
|
-
context7: "context7";
|
|
778
|
-
grep_app: "grep_app";
|
|
779
|
-
}>>>;
|
|
775
|
+
disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
780
776
|
disabled_agents: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
781
777
|
Sisyphus: "Sisyphus";
|
|
782
778
|
oracle: "oracle";
|
|
@@ -1437,4 +1433,4 @@ export type DynamicContextPruningConfig = z.infer<typeof DynamicContextPruningCo
|
|
|
1437
1433
|
export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
|
|
1438
1434
|
export type SkillDefinition = z.infer<typeof SkillDefinitionSchema>;
|
|
1439
1435
|
export type RalphLoopConfig = z.infer<typeof RalphLoopConfigSchema>;
|
|
1440
|
-
export { McpNameSchema, type McpName } from "../mcp/types";
|
|
1436
|
+
export { AnyMcpNameSchema, type AnyMcpName, McpNameSchema, type McpName } from "../mcp/types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `call_omo_agent`:\n\n```\n// Agent 1: Find the refactoring target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ncall_omo_agent(\n subagent_type=\"explore\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Get symbol information at target location\nlsp_hover(filePath, line, character) // Type info, docs, signatures\n\n// Find definition(s)\nlsp_goto_definition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nlsp_find_references(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nlsp_document_symbols(filePath) // Hierarchical outline\n\n// Search symbols by name\nlsp_workspace_symbols(filePath, query=\"[target_symbol]\")\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage the full LSP toolset (`lsp_*`) for precision analysis. Key patterns:\n- **Understand before changing**: `lsp_hover`, `lsp_goto_definition` to grasp context\n- **Impact analysis**: `lsp_find_references` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Consult for complex architectural decisions\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader";
|
|
2
|
-
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph";
|
|
2
|
+
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "refactor";
|
|
3
3
|
export interface BuiltinCommandConfig {
|
|
4
4
|
disabled_commands?: BuiltinCommandName[];
|
|
5
5
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { CommandDefinition } from "./types";
|
|
2
|
-
export declare function loadUserCommands(): Record<string, CommandDefinition
|
|
3
|
-
export declare function loadProjectCommands(): Record<string, CommandDefinition
|
|
4
|
-
export declare function loadOpencodeGlobalCommands(): Record<string, CommandDefinition
|
|
5
|
-
export declare function loadOpencodeProjectCommands(): Record<string, CommandDefinition
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function loadProjectCommandsAsync(): Promise<Record<string, CommandDefinition>>;
|
|
8
|
-
export declare function loadOpencodeGlobalCommandsAsync(): Promise<Record<string, CommandDefinition>>;
|
|
9
|
-
export declare function loadOpencodeProjectCommandsAsync(): Promise<Record<string, CommandDefinition>>;
|
|
10
|
-
export declare function loadAllCommandsAsync(): Promise<Record<string, CommandDefinition>>;
|
|
2
|
+
export declare function loadUserCommands(): Promise<Record<string, CommandDefinition>>;
|
|
3
|
+
export declare function loadProjectCommands(): Promise<Record<string, CommandDefinition>>;
|
|
4
|
+
export declare function loadOpencodeGlobalCommands(): Promise<Record<string, CommandDefinition>>;
|
|
5
|
+
export declare function loadOpencodeProjectCommands(): Promise<Record<string, CommandDefinition>>;
|
|
6
|
+
export declare function loadAllCommands(): Promise<Record<string, CommandDefinition>>;
|
|
@@ -1,46 +1,16 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader/types";
|
|
2
2
|
import type { LoadedSkill } from "./types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare function
|
|
7
|
-
/**
|
|
8
|
-
* Load skills from Claude Code project directory (.claude/skills/)
|
|
9
|
-
*/
|
|
10
|
-
export declare function loadProjectSkills(): Record<string, CommandDefinition>;
|
|
11
|
-
/**
|
|
12
|
-
* Load skills from OpenCode global directory (~/.config/opencode/skill/)
|
|
13
|
-
*/
|
|
14
|
-
export declare function loadOpencodeGlobalSkills(): Record<string, CommandDefinition>;
|
|
15
|
-
/**
|
|
16
|
-
* Load skills from OpenCode project directory (.opencode/skill/)
|
|
17
|
-
*/
|
|
18
|
-
export declare function loadOpencodeProjectSkills(): Record<string, CommandDefinition>;
|
|
19
|
-
/**
|
|
20
|
-
* Discover all skills from all sources with priority ordering.
|
|
21
|
-
* Priority order: opencode-project > project > opencode > user
|
|
22
|
-
*
|
|
23
|
-
* @returns Array of LoadedSkill objects for use in slashcommand discovery
|
|
24
|
-
*/
|
|
25
|
-
export declare function discoverAllSkills(): LoadedSkill[];
|
|
3
|
+
export declare function loadUserSkills(): Promise<Record<string, CommandDefinition>>;
|
|
4
|
+
export declare function loadProjectSkills(): Promise<Record<string, CommandDefinition>>;
|
|
5
|
+
export declare function loadOpencodeGlobalSkills(): Promise<Record<string, CommandDefinition>>;
|
|
6
|
+
export declare function loadOpencodeProjectSkills(): Promise<Record<string, CommandDefinition>>;
|
|
26
7
|
export interface DiscoverSkillsOptions {
|
|
27
8
|
includeClaudeCodePaths?: boolean;
|
|
28
9
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export declare function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
export declare function getSkillByName(name: string, options?: DiscoverSkillsOptions): LoadedSkill | undefined;
|
|
38
|
-
export declare function discoverUserClaudeSkills(): LoadedSkill[];
|
|
39
|
-
export declare function discoverProjectClaudeSkills(): LoadedSkill[];
|
|
40
|
-
export declare function discoverOpencodeGlobalSkills(): LoadedSkill[];
|
|
41
|
-
export declare function discoverOpencodeProjectSkills(): LoadedSkill[];
|
|
42
|
-
export declare function discoverUserClaudeSkillsAsync(): Promise<LoadedSkill[]>;
|
|
43
|
-
export declare function discoverProjectClaudeSkillsAsync(): Promise<LoadedSkill[]>;
|
|
44
|
-
export declare function discoverOpencodeGlobalSkillsAsync(): Promise<LoadedSkill[]>;
|
|
45
|
-
export declare function discoverOpencodeProjectSkillsAsync(): Promise<LoadedSkill[]>;
|
|
46
|
-
export declare function discoverAllSkillsAsync(options?: DiscoverSkillsOptions): Promise<LoadedSkill[]>;
|
|
10
|
+
export declare function discoverAllSkills(): Promise<LoadedSkill[]>;
|
|
11
|
+
export declare function discoverSkills(options?: DiscoverSkillsOptions): Promise<LoadedSkill[]>;
|
|
12
|
+
export declare function getSkillByName(name: string, options?: DiscoverSkillsOptions): Promise<LoadedSkill | undefined>;
|
|
13
|
+
export declare function discoverUserClaudeSkills(): Promise<LoadedSkill[]>;
|
|
14
|
+
export declare function discoverProjectClaudeSkills(): Promise<LoadedSkill[]>;
|
|
15
|
+
export declare function discoverOpencodeGlobalSkills(): Promise<LoadedSkill[]>;
|
|
16
|
+
export declare function discoverOpencodeProjectSkills(): Promise<LoadedSkill[]>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export declare const CODE_BLOCK_PATTERN: RegExp;
|
|
2
2
|
export declare const INLINE_CODE_PATTERN: RegExp;
|
|
3
|
+
/**
|
|
4
|
+
* Generates the ultrawork message based on agent context.
|
|
5
|
+
* Planner agents get context-gathering focused instructions.
|
|
6
|
+
* Other agents get the original strong agent utilization instructions.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getUltraworkMessage(agentName?: string): string;
|
|
3
9
|
export declare const KEYWORD_DETECTORS: Array<{
|
|
4
10
|
pattern: RegExp;
|
|
5
|
-
message: string;
|
|
11
|
+
message: string | ((agentName?: string) => string);
|
|
6
12
|
}>;
|
|
@@ -3,8 +3,8 @@ export interface DetectedKeyword {
|
|
|
3
3
|
message: string;
|
|
4
4
|
}
|
|
5
5
|
export declare function removeCodeBlocks(text: string): string;
|
|
6
|
-
export declare function detectKeywords(text: string): string[];
|
|
7
|
-
export declare function detectKeywordsWithType(text: string): DetectedKeyword[];
|
|
6
|
+
export declare function detectKeywords(text: string, agentName?: string): string[];
|
|
7
|
+
export declare function detectKeywordsWithType(text: string, agentName?: string): DetectedKeyword[];
|
|
8
8
|
export declare function extractPromptText(parts: Array<{
|
|
9
9
|
type: string;
|
|
10
10
|
text?: string;
|