oh-my-opencode-unguarded 3.10.5 → 3.10.7
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.md +14 -1
- package/dist/cli/config-manager/add-plugin-to-opencode-config.d.ts +1 -0
- package/dist/cli/config-manager/add-provider-config.d.ts +1 -0
- package/dist/cli/index.js +104 -40
- package/dist/features/context-injector/language-policy.d.ts +8 -0
- package/dist/index.js +84 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,11 @@ oh-my-opencode-unguarded install
|
|
|
17
17
|
|
|
18
18
|
## What's Different
|
|
19
19
|
|
|
20
|
-
This fork
|
|
20
|
+
This fork stays aligned with upstream while keeping a small set of fork patches:
|
|
21
|
+
- prompt customization in `src/agents/`
|
|
22
|
+
- agent config post-processing in `src/plugin-handlers/`
|
|
23
|
+
- message-level language fallback in `src/features/context-injector/`
|
|
24
|
+
- fork workflows/scripts for upstream sync and publishing
|
|
21
25
|
|
|
22
26
|
### Auto-Sync
|
|
23
27
|
|
|
@@ -29,6 +33,15 @@ A GitHub Actions workflow runs every hour:
|
|
|
29
33
|
|
|
30
34
|
No manual intervention required. Version numbers track upstream.
|
|
31
35
|
|
|
36
|
+
### Fork Patch Notes
|
|
37
|
+
|
|
38
|
+
- Default Chinese policy is enforced for all agents, including planning/progress/final responses and visible thinking/reasoning text.
|
|
39
|
+
- Code, commands, paths, env vars, API names, and identifiers are kept in original form.
|
|
40
|
+
- If the user explicitly requests another language, agent output follows the user request.
|
|
41
|
+
- A message-transform fallback injects an idempotent synthetic language policy marker to avoid duplicate injection.
|
|
42
|
+
- Installer now normalizes legacy plugin entries to `oh-my-opencode-unguarded@<tag>` and removes stale `oh-my-opencode` entries.
|
|
43
|
+
- Installer/provider merge normalizes legacy Antigravity Claude 4.5 IDs/names to the 4.6 equivalents in local OpenCode config.
|
|
44
|
+
|
|
32
45
|
## Upstream Documentation
|
|
33
46
|
|
|
34
47
|
All features, configuration, and guides apply as-is:
|
package/dist/cli/index.js
CHANGED
|
@@ -7601,6 +7601,23 @@ var init_parse_opencode_config_file = __esm(() => {
|
|
|
7601
7601
|
|
|
7602
7602
|
// src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
7603
7603
|
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
7604
|
+
function matchesPackageEntry(entry, packageName) {
|
|
7605
|
+
return entry === packageName || entry.startsWith(`${packageName}@`);
|
|
7606
|
+
}
|
|
7607
|
+
function isManagedPluginEntry(entry) {
|
|
7608
|
+
if (matchesPackageEntry(entry, PACKAGE_NAME2))
|
|
7609
|
+
return true;
|
|
7610
|
+
return LEGACY_PACKAGE_NAMES.some((legacyName) => matchesPackageEntry(entry, legacyName));
|
|
7611
|
+
}
|
|
7612
|
+
function normalizeManagedPluginEntries(plugins, pluginEntry) {
|
|
7613
|
+
const preservedPlugins = plugins.filter((entry) => !isManagedPluginEntry(entry));
|
|
7614
|
+
return [...preservedPlugins, pluginEntry];
|
|
7615
|
+
}
|
|
7616
|
+
function areStringArraysEqual(a, b) {
|
|
7617
|
+
if (a.length !== b.length)
|
|
7618
|
+
return false;
|
|
7619
|
+
return a.every((value, index) => value === b[index]);
|
|
7620
|
+
}
|
|
7604
7621
|
async function addPluginToOpenCodeConfig(currentVersion) {
|
|
7605
7622
|
try {
|
|
7606
7623
|
ensureConfigDirectoryExists();
|
|
@@ -7629,15 +7646,10 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7629
7646
|
};
|
|
7630
7647
|
}
|
|
7631
7648
|
const config = parseResult.config;
|
|
7632
|
-
const
|
|
7633
|
-
const
|
|
7634
|
-
if (
|
|
7635
|
-
|
|
7636
|
-
return { success: true, configPath: path3 };
|
|
7637
|
-
}
|
|
7638
|
-
plugins[existingIndex] = pluginEntry;
|
|
7639
|
-
} else {
|
|
7640
|
-
plugins.push(pluginEntry);
|
|
7649
|
+
const existingPlugins = config.plugin ?? [];
|
|
7650
|
+
const plugins = normalizeManagedPluginEntries(existingPlugins, pluginEntry);
|
|
7651
|
+
if (areStringArraysEqual(existingPlugins, plugins)) {
|
|
7652
|
+
return { success: true, configPath: path3 };
|
|
7641
7653
|
}
|
|
7642
7654
|
config.plugin = plugins;
|
|
7643
7655
|
if (format2 === "jsonc") {
|
|
@@ -7669,13 +7681,14 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
7669
7681
|
};
|
|
7670
7682
|
}
|
|
7671
7683
|
}
|
|
7672
|
-
var PACKAGE_NAME2 = "oh-my-opencode-unguarded";
|
|
7684
|
+
var PACKAGE_NAME2 = "oh-my-opencode-unguarded", LEGACY_PACKAGE_NAMES;
|
|
7673
7685
|
var init_add_plugin_to_opencode_config = __esm(() => {
|
|
7674
7686
|
init_config_context();
|
|
7675
7687
|
init_ensure_config_directory_exists();
|
|
7676
7688
|
init_opencode_config_format();
|
|
7677
7689
|
init_parse_opencode_config_file();
|
|
7678
7690
|
init_plugin_name_with_version();
|
|
7691
|
+
LEGACY_PACKAGE_NAMES = ["oh-my-opencode"];
|
|
7679
7692
|
});
|
|
7680
7693
|
|
|
7681
7694
|
// src/cli/model-fallback-requirements.ts
|
|
@@ -8341,6 +8354,38 @@ var init_jsonc_provider_editor = __esm(() => {
|
|
|
8341
8354
|
|
|
8342
8355
|
// src/cli/config-manager/add-provider-config.ts
|
|
8343
8356
|
import { readFileSync as readFileSync8, writeFileSync as writeFileSync6, copyFileSync as copyFileSync3 } from "fs";
|
|
8357
|
+
function isRecord2(value) {
|
|
8358
|
+
return typeof value === "object" && value !== null;
|
|
8359
|
+
}
|
|
8360
|
+
function normalizeAntigravityGoogleProvider(googleProvider) {
|
|
8361
|
+
if (!isRecord2(googleProvider))
|
|
8362
|
+
return googleProvider;
|
|
8363
|
+
const models = googleProvider.models;
|
|
8364
|
+
if (!isRecord2(models))
|
|
8365
|
+
return googleProvider;
|
|
8366
|
+
const normalizedModels = {};
|
|
8367
|
+
for (const [modelId, modelValue] of Object.entries(models)) {
|
|
8368
|
+
const normalizedModelId = LEGACY_MODEL_ID_MAP[modelId] ?? modelId;
|
|
8369
|
+
if (normalizedModelId !== modelId && normalizedModels[normalizedModelId] !== undefined) {
|
|
8370
|
+
continue;
|
|
8371
|
+
}
|
|
8372
|
+
if (isRecord2(modelValue) && typeof modelValue.name === "string") {
|
|
8373
|
+
const normalizedName = LEGACY_MODEL_NAME_MAP[modelValue.name] ?? modelValue.name;
|
|
8374
|
+
if (normalizedName !== modelValue.name) {
|
|
8375
|
+
normalizedModels[normalizedModelId] = {
|
|
8376
|
+
...modelValue,
|
|
8377
|
+
name: normalizedName
|
|
8378
|
+
};
|
|
8379
|
+
continue;
|
|
8380
|
+
}
|
|
8381
|
+
}
|
|
8382
|
+
normalizedModels[normalizedModelId] = modelValue;
|
|
8383
|
+
}
|
|
8384
|
+
return {
|
|
8385
|
+
...googleProvider,
|
|
8386
|
+
models: normalizedModels
|
|
8387
|
+
};
|
|
8388
|
+
}
|
|
8344
8389
|
function addProviderConfig(config) {
|
|
8345
8390
|
try {
|
|
8346
8391
|
ensureConfigDirectoryExists();
|
|
@@ -8367,8 +8412,11 @@ function addProviderConfig(config) {
|
|
|
8367
8412
|
}
|
|
8368
8413
|
const newConfig = { ...existingConfig ?? {} };
|
|
8369
8414
|
const providers = newConfig.provider ?? {};
|
|
8415
|
+
const existingGoogleProvider = providers.google;
|
|
8370
8416
|
if (config.hasGemini) {
|
|
8371
8417
|
providers.google = ANTIGRAVITY_PROVIDER_CONFIG.google;
|
|
8418
|
+
} else if (existingGoogleProvider !== undefined) {
|
|
8419
|
+
providers.google = normalizeAntigravityGoogleProvider(existingGoogleProvider);
|
|
8372
8420
|
}
|
|
8373
8421
|
if (Object.keys(providers).length > 0) {
|
|
8374
8422
|
newConfig.provider = providers;
|
|
@@ -8401,6 +8449,7 @@ function addProviderConfig(config) {
|
|
|
8401
8449
|
};
|
|
8402
8450
|
}
|
|
8403
8451
|
}
|
|
8452
|
+
var LEGACY_MODEL_ID_MAP, LEGACY_MODEL_NAME_MAP;
|
|
8404
8453
|
var init_add_provider_config = __esm(() => {
|
|
8405
8454
|
init_config_context();
|
|
8406
8455
|
init_ensure_config_directory_exists();
|
|
@@ -8409,10 +8458,23 @@ var init_add_provider_config = __esm(() => {
|
|
|
8409
8458
|
init_antigravity_provider_configuration();
|
|
8410
8459
|
init_jsonc_provider_editor();
|
|
8411
8460
|
init_jsonc_parser();
|
|
8461
|
+
LEGACY_MODEL_ID_MAP = {
|
|
8462
|
+
"antigravity-claude-opus-4-5-thinking": "antigravity-claude-opus-4-6-thinking",
|
|
8463
|
+
"antigravity-claude-sonnet-4-5": "antigravity-claude-sonnet-4-6",
|
|
8464
|
+
"antigravity-claude-sonnet-4-5-thinking": "antigravity-claude-sonnet-4-6-thinking"
|
|
8465
|
+
};
|
|
8466
|
+
LEGACY_MODEL_NAME_MAP = {
|
|
8467
|
+
"Claude Opus 4.5 Thinking (Antigravity)": "Claude Opus 4.6 Thinking (Antigravity)",
|
|
8468
|
+
"Claude Sonnet 4.5 (Antigravity)": "Claude Sonnet 4.6 (Antigravity)",
|
|
8469
|
+
"Claude Sonnet 4.5 Thinking (Antigravity)": "Claude Sonnet 4.6 Thinking (Antigravity)"
|
|
8470
|
+
};
|
|
8412
8471
|
});
|
|
8413
8472
|
|
|
8414
8473
|
// src/cli/config-manager/detect-current-config.ts
|
|
8415
8474
|
import { existsSync as existsSync9, readFileSync as readFileSync9 } from "fs";
|
|
8475
|
+
function isManagedPluginEntry2(entry) {
|
|
8476
|
+
return MANAGED_PLUGIN_NAMES.some((name) => entry === name || entry.startsWith(`${name}@`));
|
|
8477
|
+
}
|
|
8416
8478
|
function detectProvidersFromOmoConfig() {
|
|
8417
8479
|
const omoConfigPath = getOmoConfigPath();
|
|
8418
8480
|
if (!existsSync9(omoConfigPath)) {
|
|
@@ -8456,7 +8518,7 @@ function detectCurrentConfig() {
|
|
|
8456
8518
|
}
|
|
8457
8519
|
const openCodeConfig = parseResult.config;
|
|
8458
8520
|
const plugins = openCodeConfig.plugin ?? [];
|
|
8459
|
-
result.isInstalled = plugins.some((p) => p
|
|
8521
|
+
result.isInstalled = plugins.some((p) => isManagedPluginEntry2(p));
|
|
8460
8522
|
if (!result.isInstalled) {
|
|
8461
8523
|
return result;
|
|
8462
8524
|
}
|
|
@@ -8468,11 +8530,13 @@ function detectCurrentConfig() {
|
|
|
8468
8530
|
result.hasKimiForCoding = hasKimiForCoding;
|
|
8469
8531
|
return result;
|
|
8470
8532
|
}
|
|
8533
|
+
var MANAGED_PLUGIN_NAMES;
|
|
8471
8534
|
var init_detect_current_config = __esm(() => {
|
|
8472
8535
|
init_shared();
|
|
8473
8536
|
init_config_context();
|
|
8474
8537
|
init_opencode_config_format();
|
|
8475
8538
|
init_parse_opencode_config_file();
|
|
8539
|
+
MANAGED_PLUGIN_NAMES = ["oh-my-opencode-unguarded", "oh-my-opencode"];
|
|
8476
8540
|
});
|
|
8477
8541
|
|
|
8478
8542
|
// src/cli/config-manager/bun-install.ts
|
|
@@ -9442,7 +9506,7 @@ var {
|
|
|
9442
9506
|
// package.json
|
|
9443
9507
|
var package_default = {
|
|
9444
9508
|
name: "oh-my-opencode-unguarded",
|
|
9445
|
-
version: "3.10.
|
|
9509
|
+
version: "3.10.7",
|
|
9446
9510
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
9447
9511
|
main: "dist/index.js",
|
|
9448
9512
|
types: "dist/index.d.ts",
|
|
@@ -9716,7 +9780,7 @@ async function runCliInstaller(args, version) {
|
|
|
9716
9780
|
printInfo(`Current config: Claude=${initial.claude}, Gemini=${initial.gemini}`);
|
|
9717
9781
|
}
|
|
9718
9782
|
const config = argsToConfig(args);
|
|
9719
|
-
printStep(step++, totalSteps, "Adding oh-my-opencode plugin...");
|
|
9783
|
+
printStep(step++, totalSteps, "Adding oh-my-opencode-unguarded plugin...");
|
|
9720
9784
|
const pluginResult = await addPluginToOpenCodeConfig(version);
|
|
9721
9785
|
if (!pluginResult.success) {
|
|
9722
9786
|
printError(`Failed: ${pluginResult.error}`);
|
|
@@ -9754,7 +9818,7 @@ async function runCliInstaller(args, version) {
|
|
|
9754
9818
|
console.log();
|
|
9755
9819
|
console.log(import_picocolors2.default.bgRed(import_picocolors2.default.white(import_picocolors2.default.bold(" CRITICAL WARNING "))));
|
|
9756
9820
|
console.log();
|
|
9757
|
-
console.log(import_picocolors2.default.red(import_picocolors2.default.bold(" Sisyphus agent is STRONGLY optimized for Claude Opus 4.
|
|
9821
|
+
console.log(import_picocolors2.default.red(import_picocolors2.default.bold(" Sisyphus agent is STRONGLY optimized for Claude Opus 4.6.")));
|
|
9758
9822
|
console.log(import_picocolors2.default.red(" Without Claude, you may experience significantly degraded performance:"));
|
|
9759
9823
|
console.log(import_picocolors2.default.dim(" \u2022 Reduced orchestration quality"));
|
|
9760
9824
|
console.log(import_picocolors2.default.dim(" \u2022 Weaker tool selection and delegation"));
|
|
@@ -10391,7 +10455,7 @@ async function promptInstallConfig(detected) {
|
|
|
10391
10455
|
message: "Do you have a Claude Pro/Max subscription?",
|
|
10392
10456
|
options: [
|
|
10393
10457
|
{ value: "no", label: "No", hint: "Will use opencode/big-pickle as fallback" },
|
|
10394
|
-
{ value: "yes", label: "Yes (standard)", hint: "Claude Opus 4.
|
|
10458
|
+
{ value: "yes", label: "Yes (standard)", hint: "Claude Opus 4.6 for orchestration" },
|
|
10395
10459
|
{ value: "max20", label: "Yes (max20 mode)", hint: "Full power with Claude Sonnet 4.6 for Librarian" }
|
|
10396
10460
|
],
|
|
10397
10461
|
initialValue: initial.claude
|
|
@@ -10497,7 +10561,7 @@ async function runTuiInstaller(args, version) {
|
|
|
10497
10561
|
const config = await promptInstallConfig(detected);
|
|
10498
10562
|
if (!config)
|
|
10499
10563
|
return 1;
|
|
10500
|
-
spinner.start("Adding oh-my-opencode to OpenCode config");
|
|
10564
|
+
spinner.start("Adding oh-my-opencode-unguarded to OpenCode config");
|
|
10501
10565
|
const pluginResult = await addPluginToOpenCodeConfig(version);
|
|
10502
10566
|
if (!pluginResult.success) {
|
|
10503
10567
|
spinner.stop(`Failed to add plugin: ${pluginResult.error}`);
|
|
@@ -10535,7 +10599,7 @@ async function runTuiInstaller(args, version) {
|
|
|
10535
10599
|
console.log();
|
|
10536
10600
|
console.log(import_picocolors4.default.bgRed(import_picocolors4.default.white(import_picocolors4.default.bold(" CRITICAL WARNING "))));
|
|
10537
10601
|
console.log();
|
|
10538
|
-
console.log(import_picocolors4.default.red(import_picocolors4.default.bold(" Sisyphus agent is STRONGLY optimized for Claude Opus 4.
|
|
10602
|
+
console.log(import_picocolors4.default.red(import_picocolors4.default.bold(" Sisyphus agent is STRONGLY optimized for Claude Opus 4.6.")));
|
|
10539
10603
|
console.log(import_picocolors4.default.red(" Without Claude, you may experience significantly degraded performance:"));
|
|
10540
10604
|
console.log(import_picocolors4.default.dim(" \u2022 Reduced orchestration quality"));
|
|
10541
10605
|
console.log(import_picocolors4.default.dim(" \u2022 Weaker tool selection and delegation"));
|
|
@@ -28358,7 +28422,7 @@ async function getOrRegisterClient(options) {
|
|
|
28358
28422
|
}
|
|
28359
28423
|
}
|
|
28360
28424
|
function parseRegistrationResponse(data) {
|
|
28361
|
-
if (!
|
|
28425
|
+
if (!isRecord3(data))
|
|
28362
28426
|
return null;
|
|
28363
28427
|
const clientId = data.client_id;
|
|
28364
28428
|
if (typeof clientId !== "string" || clientId.length === 0)
|
|
@@ -28369,7 +28433,7 @@ function parseRegistrationResponse(data) {
|
|
|
28369
28433
|
}
|
|
28370
28434
|
return { clientId };
|
|
28371
28435
|
}
|
|
28372
|
-
function
|
|
28436
|
+
function isRecord3(value) {
|
|
28373
28437
|
return typeof value === "object" && value !== null;
|
|
28374
28438
|
}
|
|
28375
28439
|
|
|
@@ -28736,11 +28800,11 @@ function createMcpOAuthCommand() {
|
|
|
28736
28800
|
var VERSION2 = package_default.version;
|
|
28737
28801
|
var program2 = new Command;
|
|
28738
28802
|
program2.name("oh-my-opencode-unguarded").description("The ultimate OpenCode plugin - multi-model orchestration, LSP tools, and more").version(VERSION2, "-v, --version", "Show version number").enablePositionalOptions();
|
|
28739
|
-
program2.command("install").description("Install and configure oh-my-opencode with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
|
|
28803
|
+
program2.command("install").description("Install and configure oh-my-opencode-unguarded with interactive setup").option("--no-tui", "Run in non-interactive mode (requires all options)").option("--claude <value>", "Claude subscription: no, yes, max20").option("--openai <value>", "OpenAI/ChatGPT subscription: no, yes (default: no)").option("--gemini <value>", "Gemini integration: no, yes").option("--copilot <value>", "GitHub Copilot subscription: no, yes").option("--opencode-zen <value>", "OpenCode Zen access: no, yes (default: no)").option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)").option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)").option("--skip-auth", "Skip authentication setup hints").addHelpText("after", `
|
|
28740
28804
|
Examples:
|
|
28741
|
-
$ bunx oh-my-opencode install
|
|
28742
|
-
$ bunx oh-my-opencode install --no-tui --claude=max20 --openai=yes --gemini=yes --copilot=no
|
|
28743
|
-
$ bunx oh-my-opencode install --no-tui --claude=no --gemini=no --copilot=yes --opencode-zen=yes
|
|
28805
|
+
$ bunx oh-my-opencode-unguarded install
|
|
28806
|
+
$ bunx oh-my-opencode-unguarded install --no-tui --claude=max20 --openai=yes --gemini=yes --copilot=no
|
|
28807
|
+
$ bunx oh-my-opencode-unguarded install --no-tui --claude=no --gemini=no --copilot=yes --opencode-zen=yes
|
|
28744
28808
|
|
|
28745
28809
|
Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
|
|
28746
28810
|
Claude Native anthropic/ models (Opus, Sonnet, Haiku)
|
|
@@ -28767,18 +28831,18 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
|
|
|
28767
28831
|
});
|
|
28768
28832
|
program2.command("run <message>").allowUnknownOption().passThroughOptions().description("Run opencode with todo/background task completion enforcement").option("-a, --agent <name>", "Agent to use (default: from CLI/env/config, fallback: Sisyphus)").option("-d, --directory <path>", "Working directory").option("-p, --port <port>", "Server port (attaches if port already in use)", parseInt).option("--attach <url>", "Attach to existing opencode server URL").option("--on-complete <command>", "Shell command to run after completion").option("--json", "Output structured JSON result to stdout").option("--no-timestamp", "Disable timestamp prefix in run output").option("--verbose", "Show full event stream (default: messages/tools only)").option("--session-id <id>", "Resume existing session instead of creating new one").addHelpText("after", `
|
|
28769
28833
|
Examples:
|
|
28770
|
-
$ bunx oh-my-opencode run "Fix the bug in index.ts"
|
|
28771
|
-
$ bunx oh-my-opencode run --agent Sisyphus "Implement feature X"
|
|
28772
|
-
$ bunx oh-my-opencode run --port 4321 "Fix the bug"
|
|
28773
|
-
$ bunx oh-my-opencode run --attach http://127.0.0.1:4321 "Fix the bug"
|
|
28774
|
-
$ bunx oh-my-opencode run --json "Fix the bug" | jq .sessionId
|
|
28775
|
-
$ bunx oh-my-opencode run --on-complete "notify-send Done" "Fix the bug"
|
|
28776
|
-
$ bunx oh-my-opencode run --session-id ses_abc123 "Continue the work"
|
|
28834
|
+
$ bunx oh-my-opencode-unguarded run "Fix the bug in index.ts"
|
|
28835
|
+
$ bunx oh-my-opencode-unguarded run --agent Sisyphus "Implement feature X"
|
|
28836
|
+
$ bunx oh-my-opencode-unguarded run --port 4321 "Fix the bug"
|
|
28837
|
+
$ bunx oh-my-opencode-unguarded run --attach http://127.0.0.1:4321 "Fix the bug"
|
|
28838
|
+
$ bunx oh-my-opencode-unguarded run --json "Fix the bug" | jq .sessionId
|
|
28839
|
+
$ bunx oh-my-opencode-unguarded run --on-complete "notify-send Done" "Fix the bug"
|
|
28840
|
+
$ bunx oh-my-opencode-unguarded run --session-id ses_abc123 "Continue the work"
|
|
28777
28841
|
|
|
28778
28842
|
Agent resolution order:
|
|
28779
28843
|
1) --agent flag
|
|
28780
28844
|
2) OPENCODE_DEFAULT_AGENT
|
|
28781
|
-
3) oh-my-opencode.
|
|
28845
|
+
3) oh-my-opencode.jsonc "default_run_agent"
|
|
28782
28846
|
4) Sisyphus (fallback)
|
|
28783
28847
|
|
|
28784
28848
|
Available core agents:
|
|
@@ -28809,9 +28873,9 @@ Unlike 'opencode run', this command waits until:
|
|
|
28809
28873
|
});
|
|
28810
28874
|
program2.command("get-local-version").description("Show current installed version and check for updates").option("-d, --directory <path>", "Working directory to check config from").option("--json", "Output in JSON format for scripting").addHelpText("after", `
|
|
28811
28875
|
Examples:
|
|
28812
|
-
$ bunx oh-my-opencode get-local-version
|
|
28813
|
-
$ bunx oh-my-opencode get-local-version --json
|
|
28814
|
-
$ bunx oh-my-opencode get-local-version --directory /path/to/project
|
|
28876
|
+
$ bunx oh-my-opencode-unguarded get-local-version
|
|
28877
|
+
$ bunx oh-my-opencode-unguarded get-local-version --json
|
|
28878
|
+
$ bunx oh-my-opencode-unguarded get-local-version --directory /path/to/project
|
|
28815
28879
|
|
|
28816
28880
|
This command shows:
|
|
28817
28881
|
- Current installed version
|
|
@@ -28826,12 +28890,12 @@ This command shows:
|
|
|
28826
28890
|
const exitCode = await getLocalVersion(versionOptions);
|
|
28827
28891
|
process.exit(exitCode);
|
|
28828
28892
|
});
|
|
28829
|
-
program2.command("doctor").description("Check oh-my-opencode installation health and diagnose issues").option("--status", "Show compact system dashboard").option("--verbose", "Show detailed diagnostic information").option("--json", "Output results in JSON format").addHelpText("after", `
|
|
28893
|
+
program2.command("doctor").description("Check oh-my-opencode-unguarded installation health and diagnose issues").option("--status", "Show compact system dashboard").option("--verbose", "Show detailed diagnostic information").option("--json", "Output results in JSON format").addHelpText("after", `
|
|
28830
28894
|
Examples:
|
|
28831
|
-
$ bunx oh-my-opencode doctor # Show problems only
|
|
28832
|
-
$ bunx oh-my-opencode doctor --status # Compact dashboard
|
|
28833
|
-
$ bunx oh-my-opencode doctor --verbose # Deep diagnostics
|
|
28834
|
-
$ bunx oh-my-opencode doctor --json # JSON output
|
|
28895
|
+
$ bunx oh-my-opencode-unguarded doctor # Show problems only
|
|
28896
|
+
$ bunx oh-my-opencode-unguarded doctor --status # Compact dashboard
|
|
28897
|
+
$ bunx oh-my-opencode-unguarded doctor --verbose # Deep diagnostics
|
|
28898
|
+
$ bunx oh-my-opencode-unguarded doctor --json # JSON output
|
|
28835
28899
|
`).action(async (options) => {
|
|
28836
28900
|
const mode = options.status ? "status" : options.verbose ? "verbose" : "default";
|
|
28837
28901
|
const doctorOptions = {
|
|
@@ -28842,7 +28906,7 @@ Examples:
|
|
|
28842
28906
|
process.exit(exitCode);
|
|
28843
28907
|
});
|
|
28844
28908
|
program2.command("version").description("Show version information").action(() => {
|
|
28845
|
-
console.log(`oh-my-opencode v${VERSION2}`);
|
|
28909
|
+
console.log(`oh-my-opencode-unguarded v${VERSION2}`);
|
|
28846
28910
|
});
|
|
28847
28911
|
program2.addCommand(createMcpOAuthCommand());
|
|
28848
28912
|
function runCli() {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Message, Part } from "@opencode-ai/sdk";
|
|
2
|
+
type MessageWithParts = {
|
|
3
|
+
info: Message;
|
|
4
|
+
parts: Part[];
|
|
5
|
+
};
|
|
6
|
+
export declare const DEFAULT_LANGUAGE_POLICY_TEXT: string;
|
|
7
|
+
export declare function injectDefaultLanguagePolicy(lastUserMessage: MessageWithParts, messages: MessageWithParts[]): boolean;
|
|
8
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -41055,7 +41055,7 @@ function createThinkingBlockValidatorHook() {
|
|
|
41055
41055
|
continue;
|
|
41056
41056
|
if (hasContentParts(msg.parts) && !startsWithThinkingBlock(msg.parts)) {
|
|
41057
41057
|
const previousThinking = findPreviousThinkingContent(messages, i2);
|
|
41058
|
-
const thinkingContent = previousThinking || "[
|
|
41058
|
+
const thinkingContent = previousThinking || "[\u5EF6\u7EED\u4E0A\u4E00\u8F6E\u63A8\u7406\u5185\u5BB9]";
|
|
41059
41059
|
prependThinkingBlock(msg, thinkingContent);
|
|
41060
41060
|
}
|
|
41061
41061
|
}
|
|
@@ -60574,6 +60574,46 @@ class ContextCollector {
|
|
|
60574
60574
|
}
|
|
60575
60575
|
}
|
|
60576
60576
|
var contextCollector = new ContextCollector;
|
|
60577
|
+
// src/features/context-injector/language-policy.ts
|
|
60578
|
+
var LANGUAGE_POLICY_SENTINEL = "[FORK-LANGUAGE-POLICY]";
|
|
60579
|
+
var DEFAULT_LANGUAGE_POLICY_TEXT = [
|
|
60580
|
+
LANGUAGE_POLICY_SENTINEL,
|
|
60581
|
+
"IMPORTANT: \u9ED8\u8BA4\u4F7F\u7528\u7B80\u4F53\u4E2D\u6587\u4E0E\u7528\u6237\u4EA4\u4E92\uFF0C\u5305\u62EC\u601D\u8003/\u63A8\u7406\u5185\u5BB9\u3001\u8BA1\u5212\u3001\u8FDB\u5EA6\u66F4\u65B0\u548C\u6700\u7EC8\u56DE\u7B54\u3002",
|
|
60582
|
+
"IMPORTANT: \u4EE3\u7801\u3001\u547D\u4EE4\u3001\u8DEF\u5F84\u3001\u73AF\u5883\u53D8\u91CF\u3001API \u540D\u79F0\u548C\u6807\u8BC6\u7B26\u4FDD\u6301\u539F\u59CB\u5F62\u5F0F\u3002",
|
|
60583
|
+
"IMPORTANT: \u82E5\u7528\u6237\u660E\u786E\u8981\u6C42\u5176\u4ED6\u8BED\u8A00\uFF0C\u9075\u5FAA\u7528\u6237\u8981\u6C42\u3002"
|
|
60584
|
+
].join(`
|
|
60585
|
+
`);
|
|
60586
|
+
function hasLanguagePolicyPart(parts) {
|
|
60587
|
+
return parts.some((part) => {
|
|
60588
|
+
if (part.type !== "text")
|
|
60589
|
+
return false;
|
|
60590
|
+
const text = part.text;
|
|
60591
|
+
return typeof text === "string" && text.includes(LANGUAGE_POLICY_SENTINEL);
|
|
60592
|
+
});
|
|
60593
|
+
}
|
|
60594
|
+
function hasLanguagePolicyInMessages(messages) {
|
|
60595
|
+
return messages.some((message) => hasLanguagePolicyPart(message.parts));
|
|
60596
|
+
}
|
|
60597
|
+
function injectDefaultLanguagePolicy(lastUserMessage, messages) {
|
|
60598
|
+
if (hasLanguagePolicyInMessages(messages)) {
|
|
60599
|
+
return false;
|
|
60600
|
+
}
|
|
60601
|
+
if (hasLanguagePolicyPart(lastUserMessage.parts)) {
|
|
60602
|
+
return false;
|
|
60603
|
+
}
|
|
60604
|
+
const info = lastUserMessage.info;
|
|
60605
|
+
const syntheticPart = {
|
|
60606
|
+
id: `synthetic_language_policy_${lastUserMessage.info.id}`,
|
|
60607
|
+
messageID: lastUserMessage.info.id,
|
|
60608
|
+
sessionID: info.sessionID ?? info.sessionId ?? "",
|
|
60609
|
+
type: "text",
|
|
60610
|
+
text: DEFAULT_LANGUAGE_POLICY_TEXT,
|
|
60611
|
+
synthetic: true
|
|
60612
|
+
};
|
|
60613
|
+
lastUserMessage.parts.unshift(syntheticPart);
|
|
60614
|
+
return true;
|
|
60615
|
+
}
|
|
60616
|
+
|
|
60577
60617
|
// src/features/context-injector/injector.ts
|
|
60578
60618
|
function createContextInjectorMessagesTransformHook(collector) {
|
|
60579
60619
|
return {
|
|
@@ -60605,43 +60645,47 @@ function createContextInjectorMessagesTransformHook(collector) {
|
|
|
60605
60645
|
sessionID,
|
|
60606
60646
|
infoKeys: Object.keys(lastUserMessage.info)
|
|
60607
60647
|
});
|
|
60608
|
-
if (
|
|
60648
|
+
if (sessionID) {
|
|
60649
|
+
const hasPending = collector.hasPending(sessionID);
|
|
60650
|
+
log("[DEBUG] Checking hasPending", {
|
|
60651
|
+
sessionID,
|
|
60652
|
+
hasPending
|
|
60653
|
+
});
|
|
60654
|
+
if (hasPending) {
|
|
60655
|
+
const textPartIndex = lastUserMessage.parts.findIndex((p) => p.type === "text" && p.text);
|
|
60656
|
+
if (textPartIndex === -1) {
|
|
60657
|
+
log("[context-injector] No text part found in last user message, skipping injection", {
|
|
60658
|
+
sessionID,
|
|
60659
|
+
partsCount: lastUserMessage.parts.length
|
|
60660
|
+
});
|
|
60661
|
+
} else {
|
|
60662
|
+
const pending = collector.consume(sessionID);
|
|
60663
|
+
if (pending.hasContent) {
|
|
60664
|
+
const syntheticPart = {
|
|
60665
|
+
id: `synthetic_hook_${sessionID}`,
|
|
60666
|
+
messageID: lastUserMessage.info.id,
|
|
60667
|
+
sessionID: lastUserMessage.info.sessionID ?? lastUserMessage.info.sessionId ?? "",
|
|
60668
|
+
type: "text",
|
|
60669
|
+
text: pending.merged,
|
|
60670
|
+
synthetic: true
|
|
60671
|
+
};
|
|
60672
|
+
lastUserMessage.parts.splice(textPartIndex, 0, syntheticPart);
|
|
60673
|
+
log("[context-injector] Inserted synthetic part with hook content", {
|
|
60674
|
+
sessionID,
|
|
60675
|
+
contentLength: pending.merged.length
|
|
60676
|
+
});
|
|
60677
|
+
}
|
|
60678
|
+
}
|
|
60679
|
+
}
|
|
60680
|
+
} else {
|
|
60609
60681
|
log("[DEBUG] sessionID is undefined (both message.info and mainSessionID are empty)");
|
|
60610
|
-
return;
|
|
60611
|
-
}
|
|
60612
|
-
const hasPending = collector.hasPending(sessionID);
|
|
60613
|
-
log("[DEBUG] Checking hasPending", {
|
|
60614
|
-
sessionID,
|
|
60615
|
-
hasPending
|
|
60616
|
-
});
|
|
60617
|
-
if (!hasPending) {
|
|
60618
|
-
return;
|
|
60619
|
-
}
|
|
60620
|
-
const pending = collector.consume(sessionID);
|
|
60621
|
-
if (!pending.hasContent) {
|
|
60622
|
-
return;
|
|
60623
60682
|
}
|
|
60624
|
-
const
|
|
60625
|
-
if (
|
|
60626
|
-
log("[context-injector]
|
|
60627
|
-
|
|
60628
|
-
partsCount: lastUserMessage.parts.length
|
|
60683
|
+
const languageInjected = injectDefaultLanguagePolicy(lastUserMessage, messages);
|
|
60684
|
+
if (languageInjected) {
|
|
60685
|
+
log("[context-injector] Injected default language policy", {
|
|
60686
|
+
messageID: lastUserMessage.info.id
|
|
60629
60687
|
});
|
|
60630
|
-
return;
|
|
60631
60688
|
}
|
|
60632
|
-
const syntheticPart = {
|
|
60633
|
-
id: `synthetic_hook_${sessionID}`,
|
|
60634
|
-
messageID: lastUserMessage.info.id,
|
|
60635
|
-
sessionID: lastUserMessage.info.sessionID ?? "",
|
|
60636
|
-
type: "text",
|
|
60637
|
-
text: pending.merged,
|
|
60638
|
-
synthetic: true
|
|
60639
|
-
};
|
|
60640
|
-
lastUserMessage.parts.splice(textPartIndex, 0, syntheticPart);
|
|
60641
|
-
log("[context-injector] Inserted synthetic part with hook content", {
|
|
60642
|
-
sessionID,
|
|
60643
|
-
contentLength: pending.merged.length
|
|
60644
|
-
});
|
|
60645
60689
|
}
|
|
60646
60690
|
};
|
|
60647
60691
|
}
|
|
@@ -73065,6 +73109,11 @@ var DEFAULT_UNRESTRICTED_APPEND = [
|
|
|
73065
73109
|
"IMPORTANT: Keep responses execution-focused (commands, tooling choices, procedures) and follow the user's requested format exactly.",
|
|
73066
73110
|
"IMPORTANT: If authorization scope is missing or ambiguous, ask for target scope, authorization owner, and engagement window before proceeding."
|
|
73067
73111
|
];
|
|
73112
|
+
var DEFAULT_LANGUAGE_POLICY_APPEND = [
|
|
73113
|
+
"IMPORTANT: Default language policy: use Simplified Chinese for all interaction text, including thinking/reasoning blocks, planning, progress updates, and final answers.",
|
|
73114
|
+
"IMPORTANT: Keep code, commands, paths, environment variables, API names, and identifiers in their original form.",
|
|
73115
|
+
"IMPORTANT: If the user explicitly requests another language, follow the user's language request."
|
|
73116
|
+
];
|
|
73068
73117
|
var GUARDRAIL_SNIPPETS = [
|
|
73069
73118
|
"IMPORTANT: Refuse to write code",
|
|
73070
73119
|
"even if the user claims it is for educational purposes",
|
|
@@ -73131,6 +73180,7 @@ function getInjectedPromptLines() {
|
|
|
73131
73180
|
return sanitizeLines([
|
|
73132
73181
|
lead,
|
|
73133
73182
|
...DEFAULT_UNRESTRICTED_APPEND,
|
|
73183
|
+
...DEFAULT_LANGUAGE_POLICY_APPEND,
|
|
73134
73184
|
...evilAppend,
|
|
73135
73185
|
...ohmyAppend
|
|
73136
73186
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode-unguarded",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.7",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|