evil-omo 3.14.1 → 3.15.2
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/bin/platform.test.ts +15 -0
- package/dist/agents/atlas/agent.d.ts +1 -1
- package/dist/agents/atlas/default-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/default.d.ts +0 -9
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/gemini.d.ts +0 -9
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/gpt.d.ts +0 -9
- package/dist/agents/atlas/shared-prompt.d.ts +9 -0
- package/dist/agents/dynamic-agent-category-skills-guide.d.ts +2 -0
- package/dist/agents/dynamic-agent-core-sections.d.ts +10 -0
- package/dist/agents/dynamic-agent-policy-sections.d.ts +6 -0
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +5 -35
- package/dist/agents/dynamic-agent-prompt-types.d.ts +20 -0
- package/dist/agents/dynamic-agent-tool-categorization.d.ts +3 -0
- package/dist/agents/hephaestus/agent.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +1 -1
- package/dist/agents/hephaestus/gpt.d.ts +1 -1
- package/dist/agents/momus.d.ts +2 -2
- package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
- package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/sisyphus/gpt-5-4.d.ts +14 -14
- package/dist/agents/sisyphus/index.d.ts +1 -1
- package/dist/agents/sisyphus.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -0
- package/dist/cli/index.js +711 -475
- package/dist/cli/mcp-oauth/login.d.ts +6 -1
- package/dist/cli/run/event-state.d.ts +0 -2
- package/dist/cli/run/types.d.ts +0 -1
- package/dist/config/schema/agent-names.d.ts +2 -0
- package/dist/config/schema/agent-overrides.d.ts +330 -15
- package/dist/config/schema/background-task.d.ts +2 -0
- package/dist/config/schema/categories.d.ts +44 -2
- package/dist/config/schema/commands.d.ts +1 -0
- package/dist/config/schema/evil-omo-config.d.ts +341 -15
- package/dist/config/schema/experimental.d.ts +1 -0
- package/dist/config/schema/fallback-models.d.ts +67 -1
- package/dist/config/schema/hooks.d.ts +3 -0
- package/dist/config/schema/sisyphus-agent.d.ts +1 -0
- package/dist/config/schema/tmux.d.ts +11 -0
- package/dist/create-hooks.d.ts +6 -0
- package/dist/create-runtime-tmux-config.d.ts +9 -0
- package/dist/evil-omo.schema.json +1042 -3
- package/dist/features/background-agent/abort-with-timeout.d.ts +2 -0
- package/dist/features/background-agent/background-task-notification-template.d.ts +10 -4
- package/dist/features/background-agent/constants.d.ts +1 -0
- package/dist/features/background-agent/fallback-retry-handler.d.ts +1 -1
- package/dist/features/background-agent/manager.d.ts +10 -0
- package/dist/features/background-agent/process-cleanup.d.ts +1 -1
- package/dist/features/background-agent/session-existence.d.ts +3 -0
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +2 -0
- package/dist/features/builtin-commands/commands.d.ts +4 -1
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/builtin-skills/skills/ai-slop-remover.d.ts +2 -0
- package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -0
- package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -0
- package/dist/features/builtin-skills/skills/index.d.ts +2 -0
- package/dist/features/builtin-skills/skills/playwright-cli.d.ts +1 -1
- package/dist/features/builtin-skills/skills/review-work.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/configure-allowed-env-vars.d.ts +5 -0
- package/dist/features/claude-code-mcp-loader/index.d.ts +1 -0
- package/dist/features/claude-code-mcp-loader/scope-filter.d.ts +2 -0
- package/dist/features/claude-code-mcp-loader/types.d.ts +8 -4
- package/dist/features/claude-code-session-state/state.d.ts +2 -0
- package/dist/features/context-injector/collector.d.ts +1 -0
- package/dist/features/opencode-skill-loader/async-loader.d.ts +2 -2
- package/dist/features/skill-mcp-manager/manager.d.ts +4 -1
- package/dist/features/skill-mcp-manager/oauth-handler.d.ts +5 -4
- package/dist/features/skill-mcp-manager/types.d.ts +7 -0
- package/dist/features/tmux-subagent/manager.d.ts +15 -13
- package/dist/features/tmux-subagent/polling-manager.d.ts +5 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/message-builder.d.ts +4 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/recovery-hook.d.ts +10 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/recovery-hook.test-support.d.ts +29 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/session-timeout-map.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/state.d.ts +2 -0
- package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +1 -0
- package/dist/hooks/atlas/subagent-session-id.d.ts +1 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +2 -2
- package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
- package/dist/hooks/auto-slash-command/hook.d.ts +1 -0
- package/dist/hooks/auto-update-checker/checker/sync-package-json.d.ts +1 -1
- package/dist/hooks/auto-update-checker/constants.d.ts +1 -0
- package/dist/hooks/auto-update-checker/hook/background-update-check.d.ts +29 -1
- package/dist/hooks/bash-file-read-guard.d.ts +2 -0
- package/dist/hooks/claude-code-hooks/claude-code-hooks-hook.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/config-loader.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/config.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/handlers/session-event-handler.d.ts +3 -1
- package/dist/hooks/claude-code-hooks/session-hook-state.d.ts +1 -0
- package/dist/hooks/claude-code-hooks/tool-input-cache.d.ts +2 -0
- package/dist/hooks/claude-code-hooks/transcript.d.ts +1 -3
- package/dist/hooks/comment-checker/hook.d.ts +1 -0
- package/dist/hooks/comment-checker/pending-calls.d.ts +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/legacy-plugin-toast/auto-migrate-runner.d.ts +2 -0
- package/dist/hooks/legacy-plugin-toast/auto-migrate.d.ts +7 -0
- package/dist/hooks/legacy-plugin-toast/hook.d.ts +18 -0
- package/dist/hooks/legacy-plugin-toast/index.d.ts +1 -0
- package/dist/hooks/legacy-plugin-toast/plugin-entry-migrator.d.ts +1 -0
- package/dist/hooks/model-fallback/chat-message-fallback-handler.d.ts +23 -0
- package/dist/hooks/model-fallback/next-fallback.d.ts +6 -0
- package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +11 -0
- package/dist/hooks/rules-injector/constants.d.ts +1 -0
- package/dist/hooks/rules-injector/finder.d.ts +1 -1
- package/dist/hooks/rules-injector/hook.d.ts +2 -0
- package/dist/hooks/rules-injector/injector.d.ts +2 -0
- package/dist/hooks/rules-injector/rule-file-finder.d.ts +9 -1
- package/dist/hooks/runtime-fallback/fallback-models.d.ts +1 -1
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +5 -1
- package/dist/hooks/start-work/context-info-builder.d.ts +12 -0
- package/dist/hooks/start-work/start-work-hook.d.ts +6 -0
- package/dist/hooks/start-work/worktree-block.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/resolve-message-info.d.ts +2 -2
- package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +4 -3
- package/dist/hooks/todo-continuation-enforcer/types.d.ts +7 -0
- package/dist/hooks/todo-description-override/description.d.ts +1 -1
- package/dist/hooks/tool-pair-validator/hook.d.ts +28 -0
- package/dist/hooks/tool-pair-validator/index.d.ts +1 -0
- package/dist/hooks/write-existing-file-guard/hook.d.ts +12 -0
- package/dist/hooks/write-existing-file-guard/session-read-permissions.d.ts +3 -0
- package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +15 -0
- package/dist/index.js +9391 -4974
- package/dist/mcp/websearch.d.ts +2 -2
- package/dist/openclaw/dispatcher.d.ts +6 -0
- package/dist/plugin/command-execute-before.d.ts +17 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -1
- package/dist/plugin/tool-registry.d.ts +1 -0
- package/dist/plugin/types.d.ts +1 -0
- package/dist/plugin-dispose.d.ts +3 -0
- package/dist/shared/agent-display-names.d.ts +8 -0
- package/dist/shared/archive-entry-validator.d.ts +6 -0
- package/dist/shared/background-output-consumption.d.ts +5 -0
- package/dist/shared/connected-providers-cache.d.ts +2 -1
- package/dist/shared/contains-path.d.ts +2 -0
- package/dist/shared/external-plugin-detector.d.ts +14 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/is-abort-error.d.ts +1 -0
- package/dist/shared/json-file-cache-store.d.ts +16 -0
- package/dist/shared/jsonc-parser.d.ts +1 -0
- package/dist/shared/legacy-plugin-warning.d.ts +1 -0
- package/dist/shared/load-opencode-plugins.d.ts +1 -0
- package/dist/shared/log-legacy-plugin-startup-warning.d.ts +10 -1
- package/dist/shared/migrate-legacy-config-file.d.ts +1 -0
- package/dist/shared/migrate-legacy-plugin-entry.d.ts +1 -0
- package/dist/shared/model-capabilities/bundled-snapshot.d.ts +2 -0
- package/dist/shared/model-capabilities/get-model-capabilities.d.ts +2 -0
- package/dist/shared/model-capabilities/index.d.ts +3 -0
- package/dist/shared/model-capabilities/runtime-model-readers.d.ts +11 -0
- package/dist/shared/{model-capabilities.d.ts → model-capabilities/types.d.ts} +35 -32
- package/dist/shared/model-suggestion-retry.d.ts +0 -9
- package/dist/shared/plugin-entry-migrator.d.ts +3 -0
- package/dist/shared/plugin-identity.d.ts +2 -1
- package/dist/shared/session-category-registry.d.ts +0 -24
- package/dist/shared/session-cursor.d.ts +6 -0
- package/dist/shared/skill-path-resolver.d.ts +0 -8
- package/dist/shared/task-system-enabled.d.ts +6 -0
- package/dist/shared/tmux/tmux-utils/server-health.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +3 -0
- package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +3 -0
- package/dist/shared/tmux/tmux-utils.d.ts +3 -1
- package/dist/shared/write-file-atomically.d.ts +1 -0
- package/dist/shared/zip-entry-listing/powershell-zip-entry-listing.d.ts +4 -0
- package/dist/shared/zip-entry-listing/python-zip-entry-listing.d.ts +3 -0
- package/dist/shared/zip-entry-listing/read-zip-symlink-target.d.ts +1 -0
- package/dist/shared/zip-entry-listing/tar-zip-entry-listing.d.ts +3 -0
- package/dist/shared/zip-entry-listing/zipinfo-zip-entry-listing.d.ts +4 -0
- package/dist/shared/zip-entry-listing.d.ts +4 -0
- package/dist/tools/call-omo-agent/background-executor.d.ts +2 -1
- package/dist/tools/call-omo-agent/sync-executor.d.ts +2 -1
- package/dist/tools/delegate-task/anthropic-categories.d.ts +2 -0
- package/dist/tools/delegate-task/builtin-categories.d.ts +4 -0
- package/dist/tools/delegate-task/builtin-category-definition.d.ts +7 -0
- package/dist/tools/delegate-task/constants.d.ts +1 -12
- package/dist/tools/delegate-task/executor-types.d.ts +2 -1
- package/dist/tools/delegate-task/google-categories.d.ts +2 -0
- package/dist/tools/delegate-task/kimi-categories.d.ts +2 -0
- package/dist/tools/delegate-task/openai-categories.d.ts +2 -0
- package/dist/tools/delegate-task/prompt-builder.d.ts +1 -1
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +2 -0
- package/dist/tools/delegate-task/types.d.ts +2 -1
- package/dist/tools/grep/cli.d.ts +3 -2
- package/dist/tools/grep/constants.d.ts +1 -2
- package/dist/tools/hashline-edit/tool-description.d.ts +1 -1
- package/dist/tools/look-at/constants.d.ts +1 -1
- package/dist/tools/lsp/infer-extension.d.ts +1 -0
- package/dist/tools/session-manager/file-storage.d.ts +8 -0
- package/dist/tools/session-manager/sdk-storage.d.ts +8 -0
- package/dist/tools/session-manager/sdk-unavailable.d.ts +1 -0
- package/dist/tools/session-manager/storage.d.ts +1 -1
- package/dist/tools/skill/description-formatter.d.ts +3 -0
- package/dist/tools/skill/mcp-capability-formatter.d.ts +3 -0
- package/dist/tools/skill/native-skills.d.ts +12 -0
- package/dist/tools/skill/scope-priority.d.ts +4 -0
- package/dist/tools/skill/skill-body.d.ts +2 -0
- package/dist/tools/skill/skill-matcher.d.ts +5 -0
- package/dist/tools/skill/types.d.ts +30 -2
- package/dist/tools/skill-mcp/tools.d.ts +1 -1
- package/package.json +14 -14
- package/dist/hooks/openclaw.d.ts +0 -11
package/dist/cli/index.js
CHANGED
|
@@ -4914,8 +4914,9 @@ var init_command_executor = __esm(() => {
|
|
|
4914
4914
|
init_resolve_commands_in_text();
|
|
4915
4915
|
});
|
|
4916
4916
|
|
|
4917
|
-
// src/shared/
|
|
4918
|
-
var
|
|
4917
|
+
// src/shared/contains-path.ts
|
|
4918
|
+
var init_contains_path = () => {};
|
|
4919
|
+
|
|
4919
4920
|
// node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
4920
4921
|
function createScanner(text, ignoreTrivia = false) {
|
|
4921
4922
|
const len = text.length;
|
|
@@ -5807,6 +5808,7 @@ function detectConfigFile(basePath) {
|
|
|
5807
5808
|
}
|
|
5808
5809
|
var init_jsonc_parser = __esm(() => {
|
|
5809
5810
|
init_main();
|
|
5811
|
+
init_plugin_identity();
|
|
5810
5812
|
});
|
|
5811
5813
|
|
|
5812
5814
|
// src/shared/plugin-identity.ts
|
|
@@ -5837,11 +5839,11 @@ function detectManagedConfigFile(directory) {
|
|
|
5837
5839
|
baseName: CONFIG_BASENAME
|
|
5838
5840
|
};
|
|
5839
5841
|
}
|
|
5840
|
-
var PLUGIN_NAME = "evil-omo", LEGACY_PLUGIN_NAME = "oh-my-opencode", ALL_PLUGIN_NAMES, CONFIG_BASENAME = "evil-omo", ALL_CONFIG_BASENAMES, LOG_FILENAME = "evil-omo.log", CACHE_DIR_NAME = "evil-omo", SCHEMA_FILENAME = "evil-omo.schema.json";
|
|
5842
|
+
var PLUGIN_NAME = "evil-omo", LEGACY_PLUGIN_NAME = "oh-my-opencode", ALL_PLUGIN_NAMES, CONFIG_BASENAME = "evil-omo", LEGACY_CONFIG_BASENAME = "oh-my-opencode", ALL_CONFIG_BASENAMES, LOG_FILENAME = "evil-omo.log", CACHE_DIR_NAME = "evil-omo", SCHEMA_FILENAME = "evil-omo.schema.json";
|
|
5841
5843
|
var init_plugin_identity = __esm(() => {
|
|
5842
5844
|
init_jsonc_parser();
|
|
5843
5845
|
ALL_PLUGIN_NAMES = [PLUGIN_NAME, LEGACY_PLUGIN_NAME];
|
|
5844
|
-
ALL_CONFIG_BASENAMES = [CONFIG_BASENAME];
|
|
5846
|
+
ALL_CONFIG_BASENAMES = [CONFIG_BASENAME, LEGACY_CONFIG_BASENAME];
|
|
5845
5847
|
});
|
|
5846
5848
|
|
|
5847
5849
|
// src/shared/logger.ts
|
|
@@ -5862,6 +5864,11 @@ var init_logger = __esm(() => {
|
|
|
5862
5864
|
logFile = path.join(os.tmpdir(), LOG_FILENAME);
|
|
5863
5865
|
});
|
|
5864
5866
|
|
|
5867
|
+
// src/shared/file-reference-resolver.ts
|
|
5868
|
+
var init_file_reference_resolver = __esm(() => {
|
|
5869
|
+
init_contains_path();
|
|
5870
|
+
init_logger();
|
|
5871
|
+
});
|
|
5865
5872
|
// src/shared/deep-merge.ts
|
|
5866
5873
|
function isPlainObject(value) {
|
|
5867
5874
|
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]";
|
|
@@ -5924,15 +5931,7 @@ function resolveSymlink(filePath) {
|
|
|
5924
5931
|
var init_file_utils = () => {};
|
|
5925
5932
|
|
|
5926
5933
|
// src/shared/context-limit-resolver.ts
|
|
5927
|
-
var
|
|
5928
|
-
var init_context_limit_resolver = __esm(() => {
|
|
5929
|
-
ANTHROPIC_NO_HEADER_GA_MODEL_IDS = new Set([
|
|
5930
|
-
"claude-opus-4-6",
|
|
5931
|
-
"claude-opus-4.6",
|
|
5932
|
-
"claude-sonnet-4-6",
|
|
5933
|
-
"claude-sonnet-4.6"
|
|
5934
|
-
]);
|
|
5935
|
-
});
|
|
5934
|
+
var init_context_limit_resolver = () => {};
|
|
5936
5935
|
|
|
5937
5936
|
// src/shared/normalize-sdk-response.ts
|
|
5938
5937
|
function normalizeSDKResponse(response, fallback, options) {
|
|
@@ -6124,13 +6123,29 @@ var MODEL_VERSION_MAP;
|
|
|
6124
6123
|
var init_model_versions = __esm(() => {
|
|
6125
6124
|
MODEL_VERSION_MAP = {
|
|
6126
6125
|
"anthropic/claude-opus-4-5": "anthropic/claude-opus-4-6",
|
|
6127
|
-
"anthropic/claude-sonnet-4-5": "anthropic/claude-sonnet-4-6"
|
|
6126
|
+
"anthropic/claude-sonnet-4-5": "anthropic/claude-sonnet-4-6",
|
|
6127
|
+
"openai/gpt-5.3-codex": "openai/gpt-5.4"
|
|
6128
6128
|
};
|
|
6129
6129
|
});
|
|
6130
6130
|
|
|
6131
6131
|
// src/shared/migration/agent-category.ts
|
|
6132
6132
|
var init_agent_category = () => {};
|
|
6133
6133
|
|
|
6134
|
+
// src/shared/write-file-atomically.ts
|
|
6135
|
+
import { closeSync, fsyncSync, openSync, renameSync, writeFileSync } from "fs";
|
|
6136
|
+
function writeFileAtomically(filePath, content) {
|
|
6137
|
+
const tempPath = `${filePath}.tmp`;
|
|
6138
|
+
writeFileSync(tempPath, content, "utf-8");
|
|
6139
|
+
const tempFileDescriptor = openSync(tempPath, "r");
|
|
6140
|
+
try {
|
|
6141
|
+
fsyncSync(tempFileDescriptor);
|
|
6142
|
+
} finally {
|
|
6143
|
+
closeSync(tempFileDescriptor);
|
|
6144
|
+
}
|
|
6145
|
+
renameSync(tempPath, filePath);
|
|
6146
|
+
}
|
|
6147
|
+
var init_write_file_atomically = () => {};
|
|
6148
|
+
|
|
6134
6149
|
// src/shared/migration/config-migration.ts
|
|
6135
6150
|
import * as fs2 from "fs";
|
|
6136
6151
|
function migrateConfigFile(configPath, rawConfig) {
|
|
@@ -6219,11 +6234,13 @@ function migrateConfigFile(configPath, rawConfig) {
|
|
|
6219
6234
|
try {
|
|
6220
6235
|
fs2.copyFileSync(configPath, backupPath);
|
|
6221
6236
|
backupSucceeded = true;
|
|
6222
|
-
} catch {
|
|
6237
|
+
} catch {
|
|
6238
|
+
backupSucceeded = false;
|
|
6239
|
+
}
|
|
6223
6240
|
let writeSucceeded = false;
|
|
6224
6241
|
try {
|
|
6225
|
-
|
|
6226
|
-
|
|
6242
|
+
writeFileAtomically(configPath, JSON.stringify(copy, null, 2) + `
|
|
6243
|
+
`);
|
|
6227
6244
|
writeSucceeded = true;
|
|
6228
6245
|
} catch (err) {
|
|
6229
6246
|
log(`Failed to write migrated config to ${configPath}:`, err);
|
|
@@ -6244,6 +6261,7 @@ function migrateConfigFile(configPath, rawConfig) {
|
|
|
6244
6261
|
}
|
|
6245
6262
|
var init_config_migration = __esm(() => {
|
|
6246
6263
|
init_logger();
|
|
6264
|
+
init_write_file_atomically();
|
|
6247
6265
|
init_agent_names();
|
|
6248
6266
|
init_hook_names();
|
|
6249
6267
|
init_model_versions();
|
|
@@ -6344,11 +6362,45 @@ var init_external_plugin_detector = __esm(() => {
|
|
|
6344
6362
|
init_plugin_identity();
|
|
6345
6363
|
});
|
|
6346
6364
|
|
|
6365
|
+
// src/shared/archive-entry-validator.ts
|
|
6366
|
+
var init_archive_entry_validator = () => {};
|
|
6367
|
+
|
|
6368
|
+
// src/shared/zip-entry-listing/python-zip-entry-listing.ts
|
|
6369
|
+
var init_python_zip_entry_listing = () => {};
|
|
6370
|
+
|
|
6371
|
+
// src/shared/zip-entry-listing/powershell-zip-entry-listing.ts
|
|
6372
|
+
var init_powershell_zip_entry_listing = () => {};
|
|
6373
|
+
|
|
6374
|
+
// src/shared/zip-entry-listing/tar-zip-entry-listing.ts
|
|
6375
|
+
var init_tar_zip_entry_listing = __esm(() => {
|
|
6376
|
+
init_logger();
|
|
6377
|
+
});
|
|
6378
|
+
|
|
6379
|
+
// src/shared/zip-entry-listing/read-zip-symlink-target.ts
|
|
6380
|
+
var init_read_zip_symlink_target = () => {};
|
|
6381
|
+
|
|
6382
|
+
// src/shared/zip-entry-listing/zipinfo-zip-entry-listing.ts
|
|
6383
|
+
var init_zipinfo_zip_entry_listing = __esm(() => {
|
|
6384
|
+
init_read_zip_symlink_target();
|
|
6385
|
+
});
|
|
6386
|
+
|
|
6387
|
+
// src/shared/zip-entry-listing.ts
|
|
6388
|
+
var init_zip_entry_listing = __esm(() => {
|
|
6389
|
+
init_python_zip_entry_listing();
|
|
6390
|
+
init_powershell_zip_entry_listing();
|
|
6391
|
+
init_tar_zip_entry_listing();
|
|
6392
|
+
init_zipinfo_zip_entry_listing();
|
|
6393
|
+
});
|
|
6394
|
+
|
|
6347
6395
|
// src/shared/zip-extractor.ts
|
|
6348
|
-
var init_zip_extractor = () => {
|
|
6396
|
+
var init_zip_extractor = __esm(() => {
|
|
6397
|
+
init_archive_entry_validator();
|
|
6398
|
+
init_zip_entry_listing();
|
|
6399
|
+
});
|
|
6349
6400
|
|
|
6350
6401
|
// src/shared/binary-downloader.ts
|
|
6351
6402
|
var init_binary_downloader = __esm(() => {
|
|
6403
|
+
init_archive_entry_validator();
|
|
6352
6404
|
init_zip_extractor();
|
|
6353
6405
|
});
|
|
6354
6406
|
|
|
@@ -6415,7 +6467,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6415
6467
|
librarian: {
|
|
6416
6468
|
fallbackChain: [
|
|
6417
6469
|
{ providers: ["opencode-go"], model: "minimax-m2.7" },
|
|
6418
|
-
{ providers: ["opencode"], model: "minimax-m2.
|
|
6470
|
+
{ providers: ["opencode"], model: "minimax-m2.7-highspeed" },
|
|
6419
6471
|
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
6420
6472
|
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
6421
6473
|
]
|
|
@@ -6423,8 +6475,8 @@ var init_model_requirements = __esm(() => {
|
|
|
6423
6475
|
explore: {
|
|
6424
6476
|
fallbackChain: [
|
|
6425
6477
|
{ providers: ["github-copilot", "xai"], model: "grok-code-fast-1" },
|
|
6426
|
-
{ providers: ["opencode-go"], model: "minimax-m2.7" },
|
|
6427
|
-
{ providers: ["opencode"], model: "minimax-m2.
|
|
6478
|
+
{ providers: ["opencode-go"], model: "minimax-m2.7-highspeed" },
|
|
6479
|
+
{ providers: ["opencode"], model: "minimax-m2.7" },
|
|
6428
6480
|
{ providers: ["anthropic", "opencode"], model: "claude-haiku-4-5" },
|
|
6429
6481
|
{ providers: ["opencode"], model: "gpt-5-nano" }
|
|
6430
6482
|
]
|
|
@@ -6559,8 +6611,8 @@ var init_model_requirements = __esm(() => {
|
|
|
6559
6611
|
deep: {
|
|
6560
6612
|
fallbackChain: [
|
|
6561
6613
|
{
|
|
6562
|
-
providers: ["openai", "opencode"],
|
|
6563
|
-
model: "gpt-5.
|
|
6614
|
+
providers: ["openai", "github-copilot", "venice", "opencode"],
|
|
6615
|
+
model: "gpt-5.4",
|
|
6564
6616
|
variant: "medium"
|
|
6565
6617
|
},
|
|
6566
6618
|
{
|
|
@@ -6573,8 +6625,7 @@ var init_model_requirements = __esm(() => {
|
|
|
6573
6625
|
model: "gemini-3.1-pro",
|
|
6574
6626
|
variant: "high"
|
|
6575
6627
|
}
|
|
6576
|
-
]
|
|
6577
|
-
requiresModel: "gpt-5.3-codex"
|
|
6628
|
+
]
|
|
6578
6629
|
},
|
|
6579
6630
|
artistry: {
|
|
6580
6631
|
fallbackChain: [
|
|
@@ -6685,6 +6736,22 @@ var sessionCursors;
|
|
|
6685
6736
|
var init_session_cursor = __esm(() => {
|
|
6686
6737
|
sessionCursors = new Map;
|
|
6687
6738
|
});
|
|
6739
|
+
|
|
6740
|
+
// src/shared/shell-env.ts
|
|
6741
|
+
function detectShellType() {
|
|
6742
|
+
if (process.env.PSModulePath) {
|
|
6743
|
+
return "powershell";
|
|
6744
|
+
}
|
|
6745
|
+
if (process.env.SHELL) {
|
|
6746
|
+
const shell = process.env.SHELL;
|
|
6747
|
+
if (shell.includes("csh") || shell.includes("tcsh")) {
|
|
6748
|
+
return "csh";
|
|
6749
|
+
}
|
|
6750
|
+
return "unix";
|
|
6751
|
+
}
|
|
6752
|
+
return process.platform === "win32" ? "cmd" : "unix";
|
|
6753
|
+
}
|
|
6754
|
+
|
|
6688
6755
|
// src/shared/system-directive.ts
|
|
6689
6756
|
var init_system_directive = () => {};
|
|
6690
6757
|
|
|
@@ -6696,108 +6763,122 @@ function normalizeModelID(modelID) {
|
|
|
6696
6763
|
return modelID.replace(/\.(\d+)/g, "-$1");
|
|
6697
6764
|
}
|
|
6698
6765
|
|
|
6699
|
-
// src/shared/
|
|
6700
|
-
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2
|
|
6766
|
+
// src/shared/json-file-cache-store.ts
|
|
6767
|
+
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
6701
6768
|
import { join as join5 } from "path";
|
|
6702
|
-
function
|
|
6703
|
-
return
|
|
6769
|
+
function toLogLabel(cacheLabel) {
|
|
6770
|
+
return cacheLabel.toLowerCase();
|
|
6704
6771
|
}
|
|
6705
|
-
function
|
|
6706
|
-
|
|
6707
|
-
|
|
6772
|
+
function createJsonFileCacheStore(options) {
|
|
6773
|
+
let memoryValue;
|
|
6774
|
+
function getCacheFilePath() {
|
|
6775
|
+
return join5(options.getCacheDir(), options.filename);
|
|
6708
6776
|
}
|
|
6709
|
-
let memConnected;
|
|
6710
|
-
let memProviderModels;
|
|
6711
6777
|
function ensureCacheDir() {
|
|
6712
|
-
const cacheDir =
|
|
6778
|
+
const cacheDir = options.getCacheDir();
|
|
6713
6779
|
if (!existsSync3(cacheDir)) {
|
|
6714
6780
|
mkdirSync(cacheDir, { recursive: true });
|
|
6715
6781
|
}
|
|
6716
6782
|
}
|
|
6717
|
-
function
|
|
6718
|
-
if (
|
|
6719
|
-
return
|
|
6720
|
-
|
|
6783
|
+
function read() {
|
|
6784
|
+
if (memoryValue !== undefined) {
|
|
6785
|
+
return memoryValue;
|
|
6786
|
+
}
|
|
6787
|
+
const cacheFile = getCacheFilePath();
|
|
6721
6788
|
if (!existsSync3(cacheFile)) {
|
|
6722
|
-
|
|
6723
|
-
|
|
6789
|
+
memoryValue = null;
|
|
6790
|
+
log(`[${options.logPrefix}] ${options.cacheLabel} file not found`, { cacheFile });
|
|
6724
6791
|
return null;
|
|
6725
6792
|
}
|
|
6726
6793
|
try {
|
|
6727
6794
|
const content = readFileSync2(cacheFile, "utf-8");
|
|
6728
|
-
const
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
return
|
|
6732
|
-
} catch (
|
|
6733
|
-
|
|
6734
|
-
|
|
6795
|
+
const value = JSON.parse(content);
|
|
6796
|
+
memoryValue = value;
|
|
6797
|
+
log(`[${options.logPrefix}] Read ${toLogLabel(options.cacheLabel)}`, options.describe(value));
|
|
6798
|
+
return value;
|
|
6799
|
+
} catch (error) {
|
|
6800
|
+
memoryValue = null;
|
|
6801
|
+
log(`[${options.logPrefix}] Error reading ${toLogLabel(options.cacheLabel)}`, {
|
|
6802
|
+
error: String(error)
|
|
6803
|
+
});
|
|
6735
6804
|
return null;
|
|
6736
6805
|
}
|
|
6737
6806
|
}
|
|
6807
|
+
function has() {
|
|
6808
|
+
return existsSync3(getCacheFilePath());
|
|
6809
|
+
}
|
|
6810
|
+
function write(value) {
|
|
6811
|
+
ensureCacheDir();
|
|
6812
|
+
const cacheFile = getCacheFilePath();
|
|
6813
|
+
try {
|
|
6814
|
+
writeFileSync2(cacheFile, options.serialize?.(value) ?? JSON.stringify(value, null, 2));
|
|
6815
|
+
memoryValue = value;
|
|
6816
|
+
log(`[${options.logPrefix}] ${options.cacheLabel} written`, options.describe(value));
|
|
6817
|
+
} catch (error) {
|
|
6818
|
+
log(`[${options.logPrefix}] Error writing ${toLogLabel(options.cacheLabel)}`, {
|
|
6819
|
+
error: String(error)
|
|
6820
|
+
});
|
|
6821
|
+
}
|
|
6822
|
+
}
|
|
6823
|
+
function resetMemory() {
|
|
6824
|
+
memoryValue = undefined;
|
|
6825
|
+
}
|
|
6826
|
+
return {
|
|
6827
|
+
read,
|
|
6828
|
+
has,
|
|
6829
|
+
write,
|
|
6830
|
+
resetMemory
|
|
6831
|
+
};
|
|
6832
|
+
}
|
|
6833
|
+
var init_json_file_cache_store = __esm(() => {
|
|
6834
|
+
init_logger();
|
|
6835
|
+
});
|
|
6836
|
+
|
|
6837
|
+
// src/shared/connected-providers-cache.ts
|
|
6838
|
+
function isRecord(value) {
|
|
6839
|
+
return typeof value === "object" && value !== null;
|
|
6840
|
+
}
|
|
6841
|
+
function createConnectedProvidersCacheStore(getCacheDir2 = getOmoOpenCodeCacheDir) {
|
|
6842
|
+
const connectedProvidersCacheStore = createJsonFileCacheStore({
|
|
6843
|
+
getCacheDir: getCacheDir2,
|
|
6844
|
+
filename: CONNECTED_PROVIDERS_CACHE_FILE,
|
|
6845
|
+
logPrefix: "connected-providers-cache",
|
|
6846
|
+
cacheLabel: "Cache",
|
|
6847
|
+
describe: (value) => ({ count: value.connected.length, updatedAt: value.updatedAt })
|
|
6848
|
+
});
|
|
6849
|
+
const providerModelsCacheStore = createJsonFileCacheStore({
|
|
6850
|
+
getCacheDir: getCacheDir2,
|
|
6851
|
+
filename: PROVIDER_MODELS_CACHE_FILE,
|
|
6852
|
+
logPrefix: "connected-providers-cache",
|
|
6853
|
+
cacheLabel: "Provider-models cache",
|
|
6854
|
+
describe: (value) => ({
|
|
6855
|
+
providerCount: Object.keys(value.models).length,
|
|
6856
|
+
updatedAt: value.updatedAt
|
|
6857
|
+
})
|
|
6858
|
+
});
|
|
6859
|
+
function readConnectedProvidersCache() {
|
|
6860
|
+
return connectedProvidersCacheStore.read()?.connected ?? null;
|
|
6861
|
+
}
|
|
6738
6862
|
function hasConnectedProvidersCache() {
|
|
6739
|
-
|
|
6740
|
-
return existsSync3(cacheFile);
|
|
6863
|
+
return connectedProvidersCacheStore.has();
|
|
6741
6864
|
}
|
|
6742
6865
|
function writeConnectedProvidersCache(connected) {
|
|
6743
|
-
|
|
6744
|
-
const cacheFile = getCacheFilePath(CONNECTED_PROVIDERS_CACHE_FILE);
|
|
6745
|
-
const data = {
|
|
6866
|
+
connectedProvidersCacheStore.write({
|
|
6746
6867
|
connected,
|
|
6747
6868
|
updatedAt: new Date().toISOString()
|
|
6748
|
-
};
|
|
6749
|
-
try {
|
|
6750
|
-
writeFileSync2(cacheFile, JSON.stringify(data, null, 2));
|
|
6751
|
-
memConnected = connected;
|
|
6752
|
-
log("[connected-providers-cache] Cache written", { count: connected.length });
|
|
6753
|
-
} catch (err) {
|
|
6754
|
-
log("[connected-providers-cache] Error writing cache", { error: String(err) });
|
|
6755
|
-
}
|
|
6869
|
+
});
|
|
6756
6870
|
}
|
|
6757
6871
|
function readProviderModelsCache() {
|
|
6758
|
-
|
|
6759
|
-
return memProviderModels;
|
|
6760
|
-
const cacheFile = getCacheFilePath(PROVIDER_MODELS_CACHE_FILE);
|
|
6761
|
-
if (!existsSync3(cacheFile)) {
|
|
6762
|
-
log("[connected-providers-cache] Provider-models cache file not found", { cacheFile });
|
|
6763
|
-
memProviderModels = null;
|
|
6764
|
-
return null;
|
|
6765
|
-
}
|
|
6766
|
-
try {
|
|
6767
|
-
const content = readFileSync2(cacheFile, "utf-8");
|
|
6768
|
-
const data = JSON.parse(content);
|
|
6769
|
-
log("[connected-providers-cache] Read provider-models cache", {
|
|
6770
|
-
providerCount: Object.keys(data.models).length,
|
|
6771
|
-
updatedAt: data.updatedAt
|
|
6772
|
-
});
|
|
6773
|
-
memProviderModels = data;
|
|
6774
|
-
return data;
|
|
6775
|
-
} catch (err) {
|
|
6776
|
-
log("[connected-providers-cache] Error reading provider-models cache", { error: String(err) });
|
|
6777
|
-
memProviderModels = null;
|
|
6778
|
-
return null;
|
|
6779
|
-
}
|
|
6872
|
+
return providerModelsCacheStore.read();
|
|
6780
6873
|
}
|
|
6781
6874
|
function hasProviderModelsCache() {
|
|
6782
|
-
|
|
6783
|
-
return existsSync3(cacheFile);
|
|
6875
|
+
return providerModelsCacheStore.has();
|
|
6784
6876
|
}
|
|
6785
6877
|
function writeProviderModelsCache(data) {
|
|
6786
|
-
|
|
6787
|
-
const cacheFile = getCacheFilePath(PROVIDER_MODELS_CACHE_FILE);
|
|
6788
|
-
const cacheData = {
|
|
6878
|
+
providerModelsCacheStore.write({
|
|
6789
6879
|
...data,
|
|
6790
6880
|
updatedAt: new Date().toISOString()
|
|
6791
|
-
};
|
|
6792
|
-
try {
|
|
6793
|
-
writeFileSync2(cacheFile, JSON.stringify(cacheData, null, 2));
|
|
6794
|
-
memProviderModels = cacheData;
|
|
6795
|
-
log("[connected-providers-cache] Provider-models cache written", {
|
|
6796
|
-
providerCount: Object.keys(data.models).length
|
|
6797
|
-
});
|
|
6798
|
-
} catch (err) {
|
|
6799
|
-
log("[connected-providers-cache] Error writing provider-models cache", { error: String(err) });
|
|
6800
|
-
}
|
|
6881
|
+
});
|
|
6801
6882
|
}
|
|
6802
6883
|
async function updateConnectedProvidersCache(client) {
|
|
6803
6884
|
if (!client?.provider?.list) {
|
|
@@ -6843,13 +6924,18 @@ function createConnectedProvidersCacheStore(getCacheDir2 = getOmoOpenCodeCacheDi
|
|
|
6843
6924
|
log("[connected-providers-cache] Error updating cache", { error: String(err) });
|
|
6844
6925
|
}
|
|
6845
6926
|
}
|
|
6927
|
+
function _resetMemCacheForTesting() {
|
|
6928
|
+
connectedProvidersCacheStore.resetMemory();
|
|
6929
|
+
providerModelsCacheStore.resetMemory();
|
|
6930
|
+
}
|
|
6846
6931
|
return {
|
|
6847
6932
|
readConnectedProvidersCache,
|
|
6848
6933
|
hasConnectedProvidersCache,
|
|
6849
6934
|
readProviderModelsCache,
|
|
6850
6935
|
hasProviderModelsCache,
|
|
6851
6936
|
writeProviderModelsCache,
|
|
6852
|
-
updateConnectedProvidersCache
|
|
6937
|
+
updateConnectedProvidersCache,
|
|
6938
|
+
_resetMemCacheForTesting
|
|
6853
6939
|
};
|
|
6854
6940
|
}
|
|
6855
6941
|
function findProviderModelMetadata(providerID, modelID, cache = defaultConnectedProvidersCacheStore.readProviderModelsCache()) {
|
|
@@ -6864,16 +6950,17 @@ function findProviderModelMetadata(providerID, modelID, cache = defaultConnected
|
|
|
6864
6950
|
}
|
|
6865
6951
|
continue;
|
|
6866
6952
|
}
|
|
6867
|
-
if (entry
|
|
6953
|
+
if (entry.id === modelID) {
|
|
6868
6954
|
return entry;
|
|
6869
6955
|
}
|
|
6870
6956
|
}
|
|
6871
6957
|
return;
|
|
6872
6958
|
}
|
|
6873
|
-
var CONNECTED_PROVIDERS_CACHE_FILE = "connected-providers.json", PROVIDER_MODELS_CACHE_FILE = "provider-models.json", defaultConnectedProvidersCacheStore, readConnectedProvidersCache, hasConnectedProvidersCache, readProviderModelsCache, hasProviderModelsCache, writeProviderModelsCache, updateConnectedProvidersCache;
|
|
6959
|
+
var CONNECTED_PROVIDERS_CACHE_FILE = "connected-providers.json", PROVIDER_MODELS_CACHE_FILE = "provider-models.json", defaultConnectedProvidersCacheStore, readConnectedProvidersCache, hasConnectedProvidersCache, readProviderModelsCache, hasProviderModelsCache, writeProviderModelsCache, updateConnectedProvidersCache, _resetMemCacheForTesting;
|
|
6874
6960
|
var init_connected_providers_cache = __esm(() => {
|
|
6875
6961
|
init_logger();
|
|
6876
6962
|
init_data_path();
|
|
6963
|
+
init_json_file_cache_store();
|
|
6877
6964
|
defaultConnectedProvidersCacheStore = createConnectedProvidersCacheStore(() => getOmoOpenCodeCacheDir());
|
|
6878
6965
|
({
|
|
6879
6966
|
readConnectedProvidersCache,
|
|
@@ -6881,7 +6968,8 @@ var init_connected_providers_cache = __esm(() => {
|
|
|
6881
6968
|
readProviderModelsCache,
|
|
6882
6969
|
hasProviderModelsCache,
|
|
6883
6970
|
writeProviderModelsCache,
|
|
6884
|
-
updateConnectedProvidersCache
|
|
6971
|
+
updateConnectedProvidersCache,
|
|
6972
|
+
_resetMemCacheForTesting
|
|
6885
6973
|
} = defaultConnectedProvidersCacheStore);
|
|
6886
6974
|
});
|
|
6887
6975
|
|
|
@@ -19059,7 +19147,7 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
19059
19147
|
family: "gpt-nano",
|
|
19060
19148
|
reasoning: false,
|
|
19061
19149
|
temperature: true,
|
|
19062
|
-
toolCall:
|
|
19150
|
+
toolCall: true,
|
|
19063
19151
|
modalities: {
|
|
19064
19152
|
input: [
|
|
19065
19153
|
"text",
|
|
@@ -19220,7 +19308,7 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
19220
19308
|
family: "gpt-mini",
|
|
19221
19309
|
reasoning: false,
|
|
19222
19310
|
temperature: true,
|
|
19223
|
-
toolCall:
|
|
19311
|
+
toolCall: true,
|
|
19224
19312
|
modalities: {
|
|
19225
19313
|
input: [
|
|
19226
19314
|
"text",
|
|
@@ -47636,53 +47724,62 @@ var init_model_capabilities_generated = __esm(() => {
|
|
|
47636
47724
|
};
|
|
47637
47725
|
});
|
|
47638
47726
|
|
|
47727
|
+
// src/shared/model-capabilities/bundled-snapshot.ts
|
|
47728
|
+
function normalizeSnapshot(snapshot) {
|
|
47729
|
+
return snapshot;
|
|
47730
|
+
}
|
|
47731
|
+
function getBundledModelCapabilitiesSnapshot() {
|
|
47732
|
+
return bundledModelCapabilitiesSnapshot;
|
|
47733
|
+
}
|
|
47734
|
+
var bundledModelCapabilitiesSnapshot;
|
|
47735
|
+
var init_bundled_snapshot = __esm(() => {
|
|
47736
|
+
init_model_capabilities_generated();
|
|
47737
|
+
bundledModelCapabilitiesSnapshot = normalizeSnapshot(model_capabilities_generated_default);
|
|
47738
|
+
});
|
|
47739
|
+
|
|
47639
47740
|
// src/shared/model-capability-aliases.ts
|
|
47640
47741
|
function normalizeLookupModelID(modelID) {
|
|
47641
47742
|
return modelID.trim().toLowerCase();
|
|
47642
47743
|
}
|
|
47744
|
+
function stripProviderPrefixForAliasLookup(normalizedModelID) {
|
|
47745
|
+
const slashIndex = normalizedModelID.indexOf("/");
|
|
47746
|
+
if (slashIndex <= 0 || slashIndex === normalizedModelID.length - 1) {
|
|
47747
|
+
return normalizedModelID;
|
|
47748
|
+
}
|
|
47749
|
+
return normalizedModelID.slice(slashIndex + 1);
|
|
47750
|
+
}
|
|
47643
47751
|
function resolveModelIDAlias(modelID) {
|
|
47644
|
-
const
|
|
47645
|
-
const
|
|
47752
|
+
const requestedModelID = normalizeLookupModelID(modelID);
|
|
47753
|
+
const aliasLookupModelID = stripProviderPrefixForAliasLookup(requestedModelID);
|
|
47754
|
+
const exactRule = EXACT_ALIAS_RULES_BY_MODEL.get(aliasLookupModelID);
|
|
47646
47755
|
if (exactRule) {
|
|
47647
47756
|
return {
|
|
47648
|
-
requestedModelID
|
|
47757
|
+
requestedModelID,
|
|
47649
47758
|
canonicalModelID: exactRule.canonicalModelID,
|
|
47650
47759
|
source: "exact-alias",
|
|
47651
47760
|
ruleID: exactRule.ruleID
|
|
47652
47761
|
};
|
|
47653
47762
|
}
|
|
47654
47763
|
for (const rule of PATTERN_ALIAS_RULES) {
|
|
47655
|
-
if (!rule.match(
|
|
47764
|
+
if (!rule.match(aliasLookupModelID)) {
|
|
47656
47765
|
continue;
|
|
47657
47766
|
}
|
|
47658
47767
|
return {
|
|
47659
|
-
requestedModelID
|
|
47660
|
-
canonicalModelID: rule.canonicalize(
|
|
47768
|
+
requestedModelID,
|
|
47769
|
+
canonicalModelID: rule.canonicalize(aliasLookupModelID),
|
|
47661
47770
|
source: "pattern-alias",
|
|
47662
47771
|
ruleID: rule.ruleID
|
|
47663
47772
|
};
|
|
47664
47773
|
}
|
|
47665
47774
|
return {
|
|
47666
|
-
requestedModelID
|
|
47667
|
-
canonicalModelID:
|
|
47775
|
+
requestedModelID,
|
|
47776
|
+
canonicalModelID: aliasLookupModelID,
|
|
47668
47777
|
source: "canonical"
|
|
47669
47778
|
};
|
|
47670
47779
|
}
|
|
47671
47780
|
var EXACT_ALIAS_RULES, EXACT_ALIAS_RULES_BY_MODEL, PATTERN_ALIAS_RULES;
|
|
47672
47781
|
var init_model_capability_aliases = __esm(() => {
|
|
47673
47782
|
EXACT_ALIAS_RULES = [
|
|
47674
|
-
{
|
|
47675
|
-
aliasModelID: "gemini-3.1-pro-high",
|
|
47676
|
-
ruleID: "gemini-3.1-pro-tier-alias",
|
|
47677
|
-
canonicalModelID: "gemini-3.1-pro",
|
|
47678
|
-
rationale: "OmO historically encoded Gemini tier selection in the model name instead of variant metadata."
|
|
47679
|
-
},
|
|
47680
|
-
{
|
|
47681
|
-
aliasModelID: "gemini-3.1-pro-low",
|
|
47682
|
-
ruleID: "gemini-3.1-pro-tier-alias",
|
|
47683
|
-
canonicalModelID: "gemini-3.1-pro",
|
|
47684
|
-
rationale: "OmO historically encoded Gemini tier selection in the model name instead of variant metadata."
|
|
47685
|
-
},
|
|
47686
47783
|
{
|
|
47687
47784
|
aliasModelID: "gemini-3-pro-high",
|
|
47688
47785
|
ruleID: "gemini-3-pro-tier-alias",
|
|
@@ -47694,16 +47791,23 @@ var init_model_capability_aliases = __esm(() => {
|
|
|
47694
47791
|
ruleID: "gemini-3-pro-tier-alias",
|
|
47695
47792
|
canonicalModelID: "gemini-3-pro-preview",
|
|
47696
47793
|
rationale: "Legacy Gemini 3 tier suffixes still need to land on the canonical preview model."
|
|
47794
|
+
}
|
|
47795
|
+
];
|
|
47796
|
+
EXACT_ALIAS_RULES_BY_MODEL = new Map(EXACT_ALIAS_RULES.map((rule) => [rule.aliasModelID, rule]));
|
|
47797
|
+
PATTERN_ALIAS_RULES = [
|
|
47798
|
+
{
|
|
47799
|
+
ruleID: "claude-thinking-legacy-alias",
|
|
47800
|
+
description: "Normalizes the legacy Claude Opus 4.6 thinking suffix to the canonical snapshot ID.",
|
|
47801
|
+
match: (normalizedModelID) => /^claude-opus-4-6-thinking$/.test(normalizedModelID),
|
|
47802
|
+
canonicalize: () => "claude-opus-4-6"
|
|
47697
47803
|
},
|
|
47698
47804
|
{
|
|
47699
|
-
|
|
47700
|
-
|
|
47701
|
-
|
|
47702
|
-
|
|
47805
|
+
ruleID: "gemini-3.1-pro-tier-alias",
|
|
47806
|
+
description: "Normalizes Gemini 3.1 Pro tier suffixes to the canonical snapshot ID.",
|
|
47807
|
+
match: (normalizedModelID) => /^gemini-3\.1-pro-(?:high|low)$/.test(normalizedModelID),
|
|
47808
|
+
canonicalize: () => "gemini-3.1-pro"
|
|
47703
47809
|
}
|
|
47704
47810
|
];
|
|
47705
|
-
EXACT_ALIAS_RULES_BY_MODEL = new Map(EXACT_ALIAS_RULES.map((rule) => [rule.aliasModelID, rule]));
|
|
47706
|
-
PATTERN_ALIAS_RULES = [];
|
|
47707
47811
|
});
|
|
47708
47812
|
|
|
47709
47813
|
// src/shared/model-capability-heuristics.ts
|
|
@@ -47789,13 +47893,10 @@ var init_model_capability_heuristics = __esm(() => {
|
|
|
47789
47893
|
];
|
|
47790
47894
|
});
|
|
47791
47895
|
|
|
47792
|
-
// src/shared/model-capabilities.ts
|
|
47896
|
+
// src/shared/model-capabilities/runtime-model-readers.ts
|
|
47793
47897
|
function isRecord2(value) {
|
|
47794
47898
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47795
47899
|
}
|
|
47796
|
-
function normalizeLookupModelID2(modelID) {
|
|
47797
|
-
return modelID.trim().toLowerCase();
|
|
47798
|
-
}
|
|
47799
47900
|
function readNumber(value) {
|
|
47800
47901
|
return typeof value === "number" ? value : undefined;
|
|
47801
47902
|
}
|
|
@@ -47842,32 +47943,13 @@ function normalizeModalities(value) {
|
|
|
47842
47943
|
...output ? { output } : {}
|
|
47843
47944
|
};
|
|
47844
47945
|
}
|
|
47845
|
-
function normalizeSnapshot(snapshot) {
|
|
47846
|
-
return snapshot;
|
|
47847
|
-
}
|
|
47848
|
-
function getOverride(modelID) {
|
|
47849
|
-
return MODEL_ID_OVERRIDES[normalizeLookupModelID2(modelID)];
|
|
47850
|
-
}
|
|
47851
47946
|
function readRuntimeModelCapabilities(runtimeModel) {
|
|
47852
47947
|
return isRecord2(runtimeModel?.capabilities) ? runtimeModel.capabilities : undefined;
|
|
47853
47948
|
}
|
|
47854
|
-
function readRuntimeModelLimitOutput(runtimeModel) {
|
|
47855
|
-
if (!runtimeModel) {
|
|
47856
|
-
return;
|
|
47857
|
-
}
|
|
47858
|
-
const limit = isRecord2(runtimeModel.limit) ? runtimeModel.limit : readRuntimeModelCapabilities(runtimeModel)?.limit;
|
|
47859
|
-
if (!isRecord2(limit)) {
|
|
47860
|
-
return;
|
|
47861
|
-
}
|
|
47862
|
-
return readNumber(limit.output);
|
|
47863
|
-
}
|
|
47864
47949
|
function readRuntimeModelBoolean(runtimeModel, keys) {
|
|
47865
|
-
if (!runtimeModel) {
|
|
47866
|
-
return;
|
|
47867
|
-
}
|
|
47868
47950
|
const runtimeCapabilities = readRuntimeModelCapabilities(runtimeModel);
|
|
47869
47951
|
for (const key of keys) {
|
|
47870
|
-
const value = runtimeModel[key];
|
|
47952
|
+
const value = runtimeModel?.[key];
|
|
47871
47953
|
if (typeof value === "boolean") {
|
|
47872
47954
|
return value;
|
|
47873
47955
|
}
|
|
@@ -47878,114 +47960,110 @@ function readRuntimeModelBoolean(runtimeModel, keys) {
|
|
|
47878
47960
|
}
|
|
47879
47961
|
return;
|
|
47880
47962
|
}
|
|
47881
|
-
function
|
|
47882
|
-
|
|
47883
|
-
return;
|
|
47884
|
-
}
|
|
47885
|
-
const rootModalities = normalizeModalities(runtimeModel.modalities);
|
|
47886
|
-
if (rootModalities) {
|
|
47887
|
-
return rootModalities;
|
|
47888
|
-
}
|
|
47889
|
-
const runtimeCapabilities = readRuntimeModelCapabilities(runtimeModel);
|
|
47890
|
-
if (!runtimeCapabilities) {
|
|
47891
|
-
return;
|
|
47892
|
-
}
|
|
47893
|
-
const nestedModalities = normalizeModalities(runtimeCapabilities.modalities);
|
|
47894
|
-
if (nestedModalities) {
|
|
47895
|
-
return nestedModalities;
|
|
47896
|
-
}
|
|
47897
|
-
const capabilityModalities = normalizeModalities(runtimeCapabilities);
|
|
47898
|
-
if (capabilityModalities) {
|
|
47899
|
-
return capabilityModalities;
|
|
47900
|
-
}
|
|
47901
|
-
return;
|
|
47963
|
+
function readRuntimeModel(runtimeModel) {
|
|
47964
|
+
return isRecord2(runtimeModel) ? runtimeModel : undefined;
|
|
47902
47965
|
}
|
|
47903
47966
|
function readRuntimeModelVariants(runtimeModel) {
|
|
47904
|
-
|
|
47905
|
-
return;
|
|
47906
|
-
}
|
|
47907
|
-
const rootVariants = normalizeVariantKeys(runtimeModel.variants);
|
|
47967
|
+
const rootVariants = normalizeVariantKeys(runtimeModel?.variants);
|
|
47908
47968
|
if (rootVariants) {
|
|
47909
47969
|
return rootVariants;
|
|
47910
47970
|
}
|
|
47911
|
-
|
|
47912
|
-
if (!runtimeCapabilities) {
|
|
47913
|
-
return;
|
|
47914
|
-
}
|
|
47915
|
-
return normalizeVariantKeys(runtimeCapabilities.variants);
|
|
47916
|
-
}
|
|
47917
|
-
function readRuntimeModelTopPSupport(runtimeModel) {
|
|
47918
|
-
return readRuntimeModelBoolean(runtimeModel, ["topP", "top_p"]);
|
|
47971
|
+
return normalizeVariantKeys(readRuntimeModelCapabilities(runtimeModel)?.variants);
|
|
47919
47972
|
}
|
|
47920
|
-
function
|
|
47921
|
-
|
|
47973
|
+
function readRuntimeModelModalities(runtimeModel) {
|
|
47974
|
+
const rootModalities = normalizeModalities(runtimeModel?.modalities);
|
|
47975
|
+
if (rootModalities) {
|
|
47976
|
+
return rootModalities;
|
|
47977
|
+
}
|
|
47978
|
+
const runtimeCapabilities = readRuntimeModelCapabilities(runtimeModel);
|
|
47979
|
+
return normalizeModalities(runtimeCapabilities?.modalities) ?? normalizeModalities(runtimeCapabilities);
|
|
47922
47980
|
}
|
|
47923
47981
|
function readRuntimeModelReasoningSupport(runtimeModel) {
|
|
47924
47982
|
return readRuntimeModelBoolean(runtimeModel, ["reasoning"]);
|
|
47925
47983
|
}
|
|
47926
|
-
function readRuntimeModelTemperatureSupport(runtimeModel) {
|
|
47927
|
-
return readRuntimeModelBoolean(runtimeModel, ["temperature"]);
|
|
47928
|
-
}
|
|
47929
47984
|
function readRuntimeModelThinkingSupport(runtimeModel) {
|
|
47930
47985
|
const capabilityValue = readRuntimeModelReasoningSupport(runtimeModel);
|
|
47931
47986
|
if (capabilityValue !== undefined) {
|
|
47932
47987
|
return capabilityValue;
|
|
47933
47988
|
}
|
|
47934
|
-
const
|
|
47935
|
-
if (
|
|
47936
|
-
return
|
|
47989
|
+
const thinkingSupport = readRuntimeModelBoolean(runtimeModel, ["thinking", "supportsThinking"]);
|
|
47990
|
+
if (thinkingSupport !== undefined) {
|
|
47991
|
+
return thinkingSupport;
|
|
47937
47992
|
}
|
|
47938
47993
|
const runtimeCapabilities = readRuntimeModelCapabilities(runtimeModel);
|
|
47939
|
-
if (!runtimeCapabilities) {
|
|
47940
|
-
return;
|
|
47941
|
-
}
|
|
47942
47994
|
for (const key of ["thinking", "supportsThinking"]) {
|
|
47943
|
-
const value = runtimeCapabilities[key];
|
|
47995
|
+
const value = runtimeCapabilities?.[key];
|
|
47944
47996
|
if (typeof value === "boolean") {
|
|
47945
47997
|
return value;
|
|
47946
47998
|
}
|
|
47947
47999
|
}
|
|
47948
48000
|
return;
|
|
47949
48001
|
}
|
|
47950
|
-
function
|
|
47951
|
-
return
|
|
48002
|
+
function readRuntimeModelTemperatureSupport(runtimeModel) {
|
|
48003
|
+
return readRuntimeModelBoolean(runtimeModel, ["temperature"]);
|
|
48004
|
+
}
|
|
48005
|
+
function readRuntimeModelTopPSupport(runtimeModel) {
|
|
48006
|
+
return readRuntimeModelBoolean(runtimeModel, ["topP", "top_p"]);
|
|
48007
|
+
}
|
|
48008
|
+
function readRuntimeModelToolCallSupport(runtimeModel) {
|
|
48009
|
+
return readRuntimeModelBoolean(runtimeModel, ["toolCall", "tool_call", "toolcall"]);
|
|
48010
|
+
}
|
|
48011
|
+
function readRuntimeModelLimitOutput(runtimeModel) {
|
|
48012
|
+
const limit = isRecord2(runtimeModel?.limit) ? runtimeModel.limit : readRuntimeModelCapabilities(runtimeModel)?.limit;
|
|
48013
|
+
if (!isRecord2(limit)) {
|
|
48014
|
+
return;
|
|
48015
|
+
}
|
|
48016
|
+
return readNumber(limit.output);
|
|
48017
|
+
}
|
|
48018
|
+
|
|
48019
|
+
// src/shared/model-capabilities/get-model-capabilities.ts
|
|
48020
|
+
function normalizeLookupModelID2(modelID) {
|
|
48021
|
+
return modelID.trim().toLowerCase();
|
|
48022
|
+
}
|
|
48023
|
+
function getOverride(modelID) {
|
|
48024
|
+
return MODEL_ID_OVERRIDES[normalizeLookupModelID2(modelID)];
|
|
47952
48025
|
}
|
|
47953
48026
|
function getModelCapabilities(input) {
|
|
47954
48027
|
const canonicalization = resolveModelIDAlias(input.modelID);
|
|
47955
|
-
const requestedModelID = canonicalization.requestedModelID;
|
|
47956
|
-
const canonicalModelID = canonicalization.canonicalModelID;
|
|
47957
48028
|
const override = getOverride(input.modelID);
|
|
47958
48029
|
const runtimeModel = readRuntimeModel(input.runtimeModel ?? findProviderModelMetadata(input.providerID, input.modelID));
|
|
47959
48030
|
const runtimeSnapshot = input.runtimeSnapshot;
|
|
47960
|
-
const bundledSnapshot = input.bundledSnapshot ??
|
|
47961
|
-
const snapshotEntry = runtimeSnapshot?.models?.[canonicalModelID] ?? bundledSnapshot.models[canonicalModelID];
|
|
47962
|
-
const heuristicFamily = detectHeuristicModelFamily(canonicalModelID);
|
|
48031
|
+
const bundledSnapshot = input.bundledSnapshot ?? getBundledModelCapabilitiesSnapshot();
|
|
48032
|
+
const snapshotEntry = runtimeSnapshot?.models?.[canonicalization.canonicalModelID] ?? bundledSnapshot.models[canonicalization.canonicalModelID];
|
|
48033
|
+
const heuristicFamily = detectHeuristicModelFamily(canonicalization.canonicalModelID);
|
|
47963
48034
|
const runtimeVariants = readRuntimeModelVariants(runtimeModel);
|
|
47964
|
-
const
|
|
48035
|
+
const runtimeReasoning = readRuntimeModelReasoningSupport(runtimeModel);
|
|
48036
|
+
const runtimeThinking = readRuntimeModelThinkingSupport(runtimeModel);
|
|
48037
|
+
const runtimeTemperature = readRuntimeModelTemperatureSupport(runtimeModel);
|
|
48038
|
+
const runtimeTopP = readRuntimeModelTopPSupport(runtimeModel);
|
|
48039
|
+
const runtimeMaxOutputTokens = readRuntimeModelLimitOutput(runtimeModel);
|
|
48040
|
+
const runtimeToolCall = readRuntimeModelToolCallSupport(runtimeModel);
|
|
48041
|
+
const runtimeModalities = readRuntimeModelModalities(runtimeModel);
|
|
48042
|
+
const snapshotSource = runtimeSnapshot?.models?.[canonicalization.canonicalModelID] ? "runtime-snapshot" : bundledSnapshot.models[canonicalization.canonicalModelID] ? "bundled-snapshot" : "none";
|
|
47965
48043
|
const familySource = snapshotEntry?.family ? "snapshot" : heuristicFamily?.family ? "heuristic" : "none";
|
|
47966
48044
|
const variantsSource = runtimeVariants ? "runtime" : override?.variants ? "override" : heuristicFamily?.variants ? "heuristic" : "none";
|
|
47967
48045
|
const reasoningEffortsSource = override?.reasoningEfforts ? "override" : heuristicFamily?.reasoningEfforts ? "heuristic" : "none";
|
|
47968
|
-
const reasoningSource =
|
|
47969
|
-
const supportsThinkingSource = override?.supportsThinking !== undefined ? "override" : heuristicFamily?.supportsThinking !== undefined ? "heuristic" :
|
|
47970
|
-
const supportsTemperatureSource =
|
|
47971
|
-
const supportsTopPSource =
|
|
47972
|
-
const maxOutputTokensSource =
|
|
47973
|
-
const toolCallSource =
|
|
47974
|
-
const modalitiesSource =
|
|
48046
|
+
const reasoningSource = runtimeReasoning === undefined ? snapshotEntry?.reasoning === undefined ? "none" : snapshotSource : "runtime";
|
|
48047
|
+
const supportsThinkingSource = override?.supportsThinking !== undefined ? "override" : heuristicFamily?.supportsThinking !== undefined ? "heuristic" : runtimeThinking !== undefined ? "runtime" : snapshotEntry?.reasoning !== undefined ? snapshotSource : "none";
|
|
48048
|
+
const supportsTemperatureSource = runtimeTemperature !== undefined ? "runtime" : override?.supportsTemperature !== undefined ? "override" : snapshotEntry?.temperature !== undefined ? snapshotSource : "none";
|
|
48049
|
+
const supportsTopPSource = runtimeTopP !== undefined ? "runtime" : override?.supportsTopP !== undefined ? "override" : "none";
|
|
48050
|
+
const maxOutputTokensSource = runtimeMaxOutputTokens !== undefined ? "runtime" : snapshotEntry?.limit?.output !== undefined ? snapshotSource : "none";
|
|
48051
|
+
const toolCallSource = runtimeToolCall !== undefined ? "runtime" : snapshotEntry?.toolCall !== undefined ? snapshotSource : "none";
|
|
48052
|
+
const modalitiesSource = runtimeModalities !== undefined ? "runtime" : snapshotEntry?.modalities !== undefined ? snapshotSource : "none";
|
|
47975
48053
|
const resolutionMode = snapshotSource !== "none" && canonicalization.source === "canonical" ? "snapshot-backed" : snapshotSource !== "none" ? "alias-backed" : familySource === "heuristic" || variantsSource === "heuristic" || reasoningEffortsSource === "heuristic" ? "heuristic-backed" : "unknown";
|
|
47976
48054
|
return {
|
|
47977
|
-
requestedModelID,
|
|
47978
|
-
canonicalModelID,
|
|
48055
|
+
requestedModelID: canonicalization.requestedModelID,
|
|
48056
|
+
canonicalModelID: canonicalization.canonicalModelID,
|
|
47979
48057
|
family: snapshotEntry?.family ?? heuristicFamily?.family,
|
|
47980
48058
|
variants: runtimeVariants ?? override?.variants ?? heuristicFamily?.variants,
|
|
47981
48059
|
reasoningEfforts: override?.reasoningEfforts ?? heuristicFamily?.reasoningEfforts,
|
|
47982
|
-
reasoning:
|
|
47983
|
-
supportsThinking: override?.supportsThinking ?? heuristicFamily?.supportsThinking ??
|
|
47984
|
-
supportsTemperature:
|
|
47985
|
-
supportsTopP:
|
|
47986
|
-
maxOutputTokens:
|
|
47987
|
-
toolCall:
|
|
47988
|
-
modalities:
|
|
48060
|
+
reasoning: runtimeReasoning ?? snapshotEntry?.reasoning,
|
|
48061
|
+
supportsThinking: override?.supportsThinking ?? heuristicFamily?.supportsThinking ?? runtimeThinking ?? snapshotEntry?.reasoning,
|
|
48062
|
+
supportsTemperature: runtimeTemperature ?? override?.supportsTemperature ?? snapshotEntry?.temperature,
|
|
48063
|
+
supportsTopP: runtimeTopP ?? override?.supportsTopP,
|
|
48064
|
+
maxOutputTokens: runtimeMaxOutputTokens ?? snapshotEntry?.limit?.output,
|
|
48065
|
+
toolCall: runtimeToolCall ?? snapshotEntry?.toolCall,
|
|
48066
|
+
modalities: runtimeModalities ?? snapshotEntry?.modalities,
|
|
47989
48067
|
diagnostics: {
|
|
47990
48068
|
resolutionMode,
|
|
47991
48069
|
canonicalization: {
|
|
@@ -48006,19 +48084,22 @@ function getModelCapabilities(input) {
|
|
|
48006
48084
|
}
|
|
48007
48085
|
};
|
|
48008
48086
|
}
|
|
48009
|
-
var MODEL_ID_OVERRIDES
|
|
48010
|
-
var
|
|
48011
|
-
init_model_capabilities_generated();
|
|
48087
|
+
var MODEL_ID_OVERRIDES;
|
|
48088
|
+
var init_get_model_capabilities = __esm(() => {
|
|
48012
48089
|
init_connected_providers_cache();
|
|
48013
48090
|
init_model_capability_aliases();
|
|
48014
48091
|
init_model_capability_heuristics();
|
|
48092
|
+
init_bundled_snapshot();
|
|
48015
48093
|
MODEL_ID_OVERRIDES = {};
|
|
48016
|
-
|
|
48094
|
+
});
|
|
48095
|
+
|
|
48096
|
+
// src/shared/model-capabilities/index.ts
|
|
48097
|
+
var init_model_capabilities = __esm(() => {
|
|
48098
|
+
init_bundled_snapshot();
|
|
48099
|
+
init_get_model_capabilities();
|
|
48017
48100
|
});
|
|
48018
48101
|
|
|
48019
48102
|
// src/shared/model-capabilities-cache.ts
|
|
48020
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
48021
|
-
import { join as join7 } from "path";
|
|
48022
48103
|
function isRecord3(value) {
|
|
48023
48104
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
48024
48105
|
}
|
|
@@ -48132,54 +48213,26 @@ async function fetchModelCapabilitiesSnapshot(args = {}) {
|
|
|
48132
48213
|
};
|
|
48133
48214
|
}
|
|
48134
48215
|
function createModelCapabilitiesCacheStore(getCacheDir2 = getOmoOpenCodeCacheDir) {
|
|
48135
|
-
|
|
48136
|
-
|
|
48137
|
-
|
|
48138
|
-
|
|
48139
|
-
|
|
48140
|
-
|
|
48141
|
-
|
|
48142
|
-
|
|
48143
|
-
}
|
|
48144
|
-
|
|
48216
|
+
const snapshotCacheStore = createJsonFileCacheStore({
|
|
48217
|
+
getCacheDir: getCacheDir2,
|
|
48218
|
+
filename: MODEL_CAPABILITIES_CACHE_FILE,
|
|
48219
|
+
logPrefix: "model-capabilities-cache",
|
|
48220
|
+
cacheLabel: "Cache",
|
|
48221
|
+
describe: (snapshot) => ({
|
|
48222
|
+
modelCount: Object.keys(snapshot.models).length,
|
|
48223
|
+
generatedAt: snapshot.generatedAt
|
|
48224
|
+
}),
|
|
48225
|
+
serialize: (snapshot) => `${JSON.stringify(snapshot, null, 2)}
|
|
48226
|
+
`
|
|
48227
|
+
});
|
|
48145
48228
|
function readModelCapabilitiesCache() {
|
|
48146
|
-
|
|
48147
|
-
return memSnapshot;
|
|
48148
|
-
}
|
|
48149
|
-
const cacheFile = getCacheFilePath();
|
|
48150
|
-
if (!existsSync5(cacheFile)) {
|
|
48151
|
-
memSnapshot = null;
|
|
48152
|
-
log("[model-capabilities-cache] Cache file not found", { cacheFile });
|
|
48153
|
-
return null;
|
|
48154
|
-
}
|
|
48155
|
-
try {
|
|
48156
|
-
const content = readFileSync4(cacheFile, "utf-8");
|
|
48157
|
-
const snapshot = JSON.parse(content);
|
|
48158
|
-
memSnapshot = snapshot;
|
|
48159
|
-
log("[model-capabilities-cache] Read cache", {
|
|
48160
|
-
modelCount: Object.keys(snapshot.models).length,
|
|
48161
|
-
generatedAt: snapshot.generatedAt
|
|
48162
|
-
});
|
|
48163
|
-
return snapshot;
|
|
48164
|
-
} catch (error) {
|
|
48165
|
-
memSnapshot = null;
|
|
48166
|
-
log("[model-capabilities-cache] Error reading cache", { error: String(error) });
|
|
48167
|
-
return null;
|
|
48168
|
-
}
|
|
48229
|
+
return snapshotCacheStore.read();
|
|
48169
48230
|
}
|
|
48170
48231
|
function hasModelCapabilitiesCache() {
|
|
48171
|
-
return
|
|
48232
|
+
return snapshotCacheStore.has();
|
|
48172
48233
|
}
|
|
48173
48234
|
function writeModelCapabilitiesCache(snapshot) {
|
|
48174
|
-
|
|
48175
|
-
const cacheFile = getCacheFilePath();
|
|
48176
|
-
writeFileSync3(cacheFile, JSON.stringify(snapshot, null, 2) + `
|
|
48177
|
-
`);
|
|
48178
|
-
memSnapshot = snapshot;
|
|
48179
|
-
log("[model-capabilities-cache] Cache written", {
|
|
48180
|
-
modelCount: Object.keys(snapshot.models).length,
|
|
48181
|
-
generatedAt: snapshot.generatedAt
|
|
48182
|
-
});
|
|
48235
|
+
snapshotCacheStore.write(snapshot);
|
|
48183
48236
|
}
|
|
48184
48237
|
async function refreshModelCapabilitiesCache(args = {}) {
|
|
48185
48238
|
const snapshot = await fetchModelCapabilitiesSnapshot(args);
|
|
@@ -48196,7 +48249,7 @@ function createModelCapabilitiesCacheStore(getCacheDir2 = getOmoOpenCodeCacheDir
|
|
|
48196
48249
|
var MODELS_DEV_SOURCE_URL = "https://models.dev/api.json", MODEL_CAPABILITIES_CACHE_FILE = "model-capabilities.json", defaultModelCapabilitiesCacheStore, readModelCapabilitiesCache, hasModelCapabilitiesCache, writeModelCapabilitiesCache, refreshModelCapabilitiesCache;
|
|
48197
48250
|
var init_model_capabilities_cache = __esm(() => {
|
|
48198
48251
|
init_data_path();
|
|
48199
|
-
|
|
48252
|
+
init_json_file_cache_store();
|
|
48200
48253
|
defaultModelCapabilitiesCacheStore = createModelCapabilitiesCacheStore(() => getOmoOpenCodeCacheDir());
|
|
48201
48254
|
({
|
|
48202
48255
|
readModelCapabilitiesCache,
|
|
@@ -48241,24 +48294,26 @@ var init_hook_message_injector = __esm(() => {
|
|
|
48241
48294
|
});
|
|
48242
48295
|
|
|
48243
48296
|
// src/shared/opencode-storage-paths.ts
|
|
48244
|
-
import { join as
|
|
48297
|
+
import { join as join7 } from "path";
|
|
48245
48298
|
var OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE, SESSION_STORAGE;
|
|
48246
48299
|
var init_opencode_storage_paths = __esm(() => {
|
|
48247
48300
|
init_data_path();
|
|
48248
48301
|
OPENCODE_STORAGE = getOpenCodeStorageDir();
|
|
48249
|
-
MESSAGE_STORAGE =
|
|
48250
|
-
PART_STORAGE =
|
|
48251
|
-
SESSION_STORAGE =
|
|
48302
|
+
MESSAGE_STORAGE = join7(OPENCODE_STORAGE, "message");
|
|
48303
|
+
PART_STORAGE = join7(OPENCODE_STORAGE, "part");
|
|
48304
|
+
SESSION_STORAGE = join7(OPENCODE_STORAGE, "session");
|
|
48252
48305
|
});
|
|
48253
48306
|
|
|
48254
48307
|
// src/shared/opencode-message-dir.ts
|
|
48255
48308
|
var init_opencode_message_dir = __esm(() => {
|
|
48256
48309
|
init_opencode_storage_paths();
|
|
48257
|
-
init_opencode_storage_detection();
|
|
48258
48310
|
init_logger();
|
|
48259
48311
|
});
|
|
48260
48312
|
|
|
48261
48313
|
// src/shared/agent-display-names.ts
|
|
48314
|
+
function stripAgentListSortPrefix(agentName) {
|
|
48315
|
+
return agentName.replace(/^\u200B+/, "");
|
|
48316
|
+
}
|
|
48262
48317
|
function getAgentDisplayName(configKey) {
|
|
48263
48318
|
const exactMatch = AGENT_DISPLAY_NAMES[configKey];
|
|
48264
48319
|
if (exactMatch !== undefined)
|
|
@@ -48271,7 +48326,7 @@ function getAgentDisplayName(configKey) {
|
|
|
48271
48326
|
return configKey;
|
|
48272
48327
|
}
|
|
48273
48328
|
function getAgentConfigKey(agentName) {
|
|
48274
|
-
const lower = agentName.toLowerCase();
|
|
48329
|
+
const lower = stripAgentListSortPrefix(agentName).toLowerCase();
|
|
48275
48330
|
const reversed = REVERSE_DISPLAY_NAMES[lower];
|
|
48276
48331
|
if (reversed !== undefined)
|
|
48277
48332
|
return reversed;
|
|
@@ -48289,10 +48344,13 @@ var init_agent_display_names = __esm(() => {
|
|
|
48289
48344
|
"sisyphus-junior": "Sisyphus-Junior",
|
|
48290
48345
|
metis: "Metis (Plan Consultant)",
|
|
48291
48346
|
momus: "Momus (Plan Critic)",
|
|
48347
|
+
athena: "Athena (Council)",
|
|
48348
|
+
"athena-junior": "Athena-Junior (Council)",
|
|
48292
48349
|
oracle: "oracle",
|
|
48293
48350
|
librarian: "librarian",
|
|
48294
48351
|
explore: "explore",
|
|
48295
|
-
"multimodal-looker": "multimodal-looker"
|
|
48352
|
+
"multimodal-looker": "multimodal-looker",
|
|
48353
|
+
"council-member": "council-member"
|
|
48296
48354
|
};
|
|
48297
48355
|
REVERSE_DISPLAY_NAMES = Object.fromEntries(Object.entries(AGENT_DISPLAY_NAMES).map(([key, displayName]) => [displayName.toLowerCase(), key]));
|
|
48298
48356
|
});
|
|
@@ -48310,6 +48368,12 @@ var SESSION_TIMEOUT_MS;
|
|
|
48310
48368
|
var init_constants2 = __esm(() => {
|
|
48311
48369
|
SESSION_TIMEOUT_MS = 10 * 60 * 1000;
|
|
48312
48370
|
});
|
|
48371
|
+
// src/shared/tmux/tmux-utils/server-health.ts
|
|
48372
|
+
var SERVER_RUNNING_KEY;
|
|
48373
|
+
var init_server_health = __esm(() => {
|
|
48374
|
+
SERVER_RUNNING_KEY = Symbol.for("evil-omo:server-running-in-process");
|
|
48375
|
+
});
|
|
48376
|
+
|
|
48313
48377
|
// src/tools/interactive-bash/tmux-path-resolver.ts
|
|
48314
48378
|
var init_tmux_path_resolver = () => {};
|
|
48315
48379
|
|
|
@@ -48321,6 +48385,7 @@ var init_pane_dimensions = __esm(() => {
|
|
|
48321
48385
|
// src/shared/tmux/tmux-utils/pane-spawn.ts
|
|
48322
48386
|
var init_pane_spawn = __esm(() => {
|
|
48323
48387
|
init_tmux_path_resolver();
|
|
48388
|
+
init_server_health();
|
|
48324
48389
|
});
|
|
48325
48390
|
|
|
48326
48391
|
// src/shared/tmux/tmux-utils/pane-close.ts
|
|
@@ -48333,6 +48398,18 @@ var init_pane_replace = __esm(() => {
|
|
|
48333
48398
|
init_tmux_path_resolver();
|
|
48334
48399
|
});
|
|
48335
48400
|
|
|
48401
|
+
// src/shared/tmux/tmux-utils/window-spawn.ts
|
|
48402
|
+
var init_window_spawn = __esm(() => {
|
|
48403
|
+
init_tmux_path_resolver();
|
|
48404
|
+
init_server_health();
|
|
48405
|
+
});
|
|
48406
|
+
|
|
48407
|
+
// src/shared/tmux/tmux-utils/session-spawn.ts
|
|
48408
|
+
var init_session_spawn = __esm(() => {
|
|
48409
|
+
init_tmux_path_resolver();
|
|
48410
|
+
init_server_health();
|
|
48411
|
+
});
|
|
48412
|
+
|
|
48336
48413
|
// src/shared/tmux/tmux-utils/layout.ts
|
|
48337
48414
|
var init_layout = __esm(() => {
|
|
48338
48415
|
init_tmux_path_resolver();
|
|
@@ -48340,10 +48417,13 @@ var init_layout = __esm(() => {
|
|
|
48340
48417
|
|
|
48341
48418
|
// src/shared/tmux/tmux-utils.ts
|
|
48342
48419
|
var init_tmux_utils = __esm(() => {
|
|
48420
|
+
init_server_health();
|
|
48343
48421
|
init_pane_dimensions();
|
|
48344
48422
|
init_pane_spawn();
|
|
48345
48423
|
init_pane_close();
|
|
48346
48424
|
init_pane_replace();
|
|
48425
|
+
init_window_spawn();
|
|
48426
|
+
init_session_spawn();
|
|
48347
48427
|
init_layout();
|
|
48348
48428
|
});
|
|
48349
48429
|
|
|
@@ -48475,10 +48555,32 @@ var init_agent_loader = __esm(() => {
|
|
|
48475
48555
|
init_logger();
|
|
48476
48556
|
init_claude_model_mapper();
|
|
48477
48557
|
});
|
|
48558
|
+
|
|
48559
|
+
// src/features/claude-code-mcp-loader/configure-allowed-env-vars.ts
|
|
48560
|
+
var additionalAllowedMcpEnvVars;
|
|
48561
|
+
var init_configure_allowed_env_vars = __esm(() => {
|
|
48562
|
+
additionalAllowedMcpEnvVars = new Set;
|
|
48563
|
+
});
|
|
48564
|
+
|
|
48565
|
+
// src/features/claude-code-mcp-loader/env-expander.ts
|
|
48566
|
+
var init_env_expander = __esm(() => {
|
|
48567
|
+
init_logger();
|
|
48568
|
+
init_configure_allowed_env_vars();
|
|
48569
|
+
});
|
|
48570
|
+
|
|
48571
|
+
// src/features/claude-code-mcp-loader/scope-filter.ts
|
|
48572
|
+
var init_scope_filter = __esm(() => {
|
|
48573
|
+
init_contains_path();
|
|
48574
|
+
});
|
|
48575
|
+
|
|
48478
48576
|
// src/features/claude-code-mcp-loader/transformer.ts
|
|
48479
|
-
var init_transformer = () => {
|
|
48577
|
+
var init_transformer = __esm(() => {
|
|
48578
|
+
init_env_expander();
|
|
48579
|
+
});
|
|
48480
48580
|
// src/features/claude-code-plugin-loader/mcp-server-loader.ts
|
|
48481
48581
|
var init_mcp_server_loader = __esm(() => {
|
|
48582
|
+
init_env_expander();
|
|
48583
|
+
init_scope_filter();
|
|
48482
48584
|
init_transformer();
|
|
48483
48585
|
init_logger();
|
|
48484
48586
|
});
|
|
@@ -48534,13 +48636,28 @@ var init_legacy_plugin_warning = __esm(() => {
|
|
|
48534
48636
|
init_plugin_identity();
|
|
48535
48637
|
});
|
|
48536
48638
|
|
|
48639
|
+
// src/shared/plugin-entry-migrator.ts
|
|
48640
|
+
var init_plugin_entry_migrator = __esm(() => {
|
|
48641
|
+
init_plugin_identity();
|
|
48642
|
+
});
|
|
48643
|
+
|
|
48644
|
+
// src/shared/migrate-legacy-plugin-entry.ts
|
|
48645
|
+
var init_migrate_legacy_plugin_entry = __esm(() => {
|
|
48646
|
+
init_main();
|
|
48647
|
+
init_jsonc_parser();
|
|
48648
|
+
init_logger();
|
|
48649
|
+
init_plugin_identity();
|
|
48650
|
+
init_plugin_entry_migrator();
|
|
48651
|
+
});
|
|
48652
|
+
|
|
48537
48653
|
// src/shared/log-legacy-plugin-startup-warning.ts
|
|
48538
48654
|
var init_log_legacy_plugin_startup_warning = __esm(() => {
|
|
48539
48655
|
init_legacy_plugin_warning();
|
|
48540
48656
|
init_logger();
|
|
48657
|
+
init_migrate_legacy_plugin_entry();
|
|
48658
|
+
init_plugin_entry_migrator();
|
|
48541
48659
|
init_plugin_identity();
|
|
48542
48660
|
});
|
|
48543
|
-
|
|
48544
48661
|
// src/shared/index.ts
|
|
48545
48662
|
var init_shared = __esm(() => {
|
|
48546
48663
|
init_model_resolver();
|
|
@@ -48548,6 +48665,7 @@ var init_shared = __esm(() => {
|
|
|
48548
48665
|
init_session_category_registry();
|
|
48549
48666
|
init_frontmatter();
|
|
48550
48667
|
init_command_executor();
|
|
48668
|
+
init_contains_path();
|
|
48551
48669
|
init_file_reference_resolver();
|
|
48552
48670
|
init_logger();
|
|
48553
48671
|
init_snake_case();
|
|
@@ -48567,6 +48685,7 @@ var init_shared = __esm(() => {
|
|
|
48567
48685
|
init_external_plugin_detector();
|
|
48568
48686
|
init_zip_extractor();
|
|
48569
48687
|
init_binary_downloader();
|
|
48688
|
+
init_write_file_atomically();
|
|
48570
48689
|
init_agent_variant();
|
|
48571
48690
|
init_session_cursor();
|
|
48572
48691
|
init_system_directive();
|
|
@@ -48678,11 +48797,11 @@ var init_plugin_name_with_version = __esm(() => {
|
|
|
48678
48797
|
});
|
|
48679
48798
|
|
|
48680
48799
|
// src/cli/config-manager/ensure-config-directory-exists.ts
|
|
48681
|
-
import { existsSync as
|
|
48800
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
|
|
48682
48801
|
function ensureConfigDirectoryExists() {
|
|
48683
48802
|
const configDir = getConfigDir();
|
|
48684
|
-
if (!
|
|
48685
|
-
|
|
48803
|
+
if (!existsSync5(configDir)) {
|
|
48804
|
+
mkdirSync2(configDir, { recursive: true });
|
|
48686
48805
|
}
|
|
48687
48806
|
}
|
|
48688
48807
|
var init_ensure_config_directory_exists = __esm(() => {
|
|
@@ -48719,14 +48838,14 @@ function formatErrorWithSuggestion(err, context) {
|
|
|
48719
48838
|
}
|
|
48720
48839
|
|
|
48721
48840
|
// src/cli/config-manager/opencode-config-format.ts
|
|
48722
|
-
import { existsSync as
|
|
48841
|
+
import { existsSync as existsSync6 } from "fs";
|
|
48723
48842
|
function detectConfigFormat() {
|
|
48724
48843
|
const configJsonc = getConfigJsonc();
|
|
48725
48844
|
const configJson = getConfigJson();
|
|
48726
|
-
if (
|
|
48845
|
+
if (existsSync6(configJsonc)) {
|
|
48727
48846
|
return { format: "jsonc", path: configJsonc };
|
|
48728
48847
|
}
|
|
48729
|
-
if (
|
|
48848
|
+
if (existsSync6(configJson)) {
|
|
48730
48849
|
return { format: "json", path: configJson };
|
|
48731
48850
|
}
|
|
48732
48851
|
return { format: "none", path: configJson };
|
|
@@ -48736,7 +48855,7 @@ var init_opencode_config_format = __esm(() => {
|
|
|
48736
48855
|
});
|
|
48737
48856
|
|
|
48738
48857
|
// src/cli/config-manager/parse-opencode-config-file.ts
|
|
48739
|
-
import { readFileSync as
|
|
48858
|
+
import { readFileSync as readFileSync4, statSync } from "fs";
|
|
48740
48859
|
function isEmptyOrWhitespace(content) {
|
|
48741
48860
|
return content.trim().length === 0;
|
|
48742
48861
|
}
|
|
@@ -48746,7 +48865,7 @@ function parseOpenCodeConfigFileWithError(path3) {
|
|
|
48746
48865
|
if (stat.size === 0) {
|
|
48747
48866
|
return { config: null, error: `Config file is empty: ${path3}. Delete it or add valid JSON content.` };
|
|
48748
48867
|
}
|
|
48749
|
-
const content =
|
|
48868
|
+
const content = readFileSync4(path3, "utf-8");
|
|
48750
48869
|
if (isEmptyOrWhitespace(content)) {
|
|
48751
48870
|
return { config: null, error: `Config file contains only whitespace: ${path3}. Delete it or add valid JSON content.` };
|
|
48752
48871
|
}
|
|
@@ -48770,7 +48889,7 @@ var init_parse_opencode_config_file = __esm(() => {
|
|
|
48770
48889
|
});
|
|
48771
48890
|
|
|
48772
48891
|
// src/cli/config-manager/add-plugin-to-opencode-config.ts
|
|
48773
|
-
import { readFileSync as
|
|
48892
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
48774
48893
|
async function addPluginToOpenCodeConfig(currentVersion) {
|
|
48775
48894
|
try {
|
|
48776
48895
|
ensureConfigDirectoryExists();
|
|
@@ -48786,7 +48905,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
48786
48905
|
try {
|
|
48787
48906
|
if (format2 === "none") {
|
|
48788
48907
|
const config2 = { plugin: [pluginEntry] };
|
|
48789
|
-
|
|
48908
|
+
writeFileSync3(path3, JSON.stringify(config2, null, 2) + `
|
|
48790
48909
|
`);
|
|
48791
48910
|
return { success: true, configPath: path3 };
|
|
48792
48911
|
}
|
|
@@ -48811,7 +48930,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
48811
48930
|
}
|
|
48812
48931
|
config.plugin = plugins;
|
|
48813
48932
|
if (format2 === "jsonc") {
|
|
48814
|
-
const content =
|
|
48933
|
+
const content = readFileSync5(path3, "utf-8");
|
|
48815
48934
|
const pluginArrayRegex = /"plugin"\s*:\s*\[([\s\S]*?)\]/;
|
|
48816
48935
|
const match = content.match(pluginArrayRegex);
|
|
48817
48936
|
if (match) {
|
|
@@ -48820,14 +48939,14 @@ async function addPluginToOpenCodeConfig(currentVersion) {
|
|
|
48820
48939
|
const newContent = content.replace(pluginArrayRegex, `"plugin": [
|
|
48821
48940
|
${formattedPlugins}
|
|
48822
48941
|
]`);
|
|
48823
|
-
|
|
48942
|
+
writeFileSync3(path3, newContent);
|
|
48824
48943
|
} else {
|
|
48825
48944
|
const newContent = content.replace(/(\{)/, `$1
|
|
48826
48945
|
"plugin": ["${pluginEntry}"],`);
|
|
48827
|
-
|
|
48946
|
+
writeFileSync3(path3, newContent);
|
|
48828
48947
|
}
|
|
48829
48948
|
} else {
|
|
48830
|
-
|
|
48949
|
+
writeFileSync3(path3, JSON.stringify(config, null, 2) + `
|
|
48831
48950
|
`);
|
|
48832
48951
|
}
|
|
48833
48952
|
return { success: true, configPath: path3 };
|
|
@@ -49077,7 +49196,7 @@ function deepMergeRecord(target, source) {
|
|
|
49077
49196
|
}
|
|
49078
49197
|
|
|
49079
49198
|
// src/cli/config-manager/write-omo-config.ts
|
|
49080
|
-
import { existsSync as
|
|
49199
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6, statSync as statSync2, writeFileSync as writeFileSync4 } from "fs";
|
|
49081
49200
|
function isEmptyOrWhitespace2(content) {
|
|
49082
49201
|
return content.trim().length === 0;
|
|
49083
49202
|
}
|
|
@@ -49095,35 +49214,35 @@ function writeOmoConfig(installConfig) {
|
|
|
49095
49214
|
const existingConfigPath = getExistingOmoConfigPath() ?? omoConfigPath;
|
|
49096
49215
|
try {
|
|
49097
49216
|
const newConfig = generateOmoConfig(installConfig);
|
|
49098
|
-
if (
|
|
49217
|
+
if (existsSync7(existingConfigPath)) {
|
|
49099
49218
|
try {
|
|
49100
49219
|
const stat = statSync2(existingConfigPath);
|
|
49101
|
-
const content =
|
|
49220
|
+
const content = readFileSync6(existingConfigPath, "utf-8");
|
|
49102
49221
|
if (stat.size === 0 || isEmptyOrWhitespace2(content)) {
|
|
49103
|
-
|
|
49222
|
+
writeFileSync4(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
49104
49223
|
`);
|
|
49105
49224
|
return { success: true, configPath: omoConfigPath };
|
|
49106
49225
|
}
|
|
49107
49226
|
const existing = parseJsonc(content);
|
|
49108
49227
|
if (!existing || typeof existing !== "object" || Array.isArray(existing)) {
|
|
49109
|
-
|
|
49228
|
+
writeFileSync4(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
49110
49229
|
`);
|
|
49111
49230
|
return { success: true, configPath: omoConfigPath };
|
|
49112
49231
|
}
|
|
49113
49232
|
const merged = deepMergeRecord(newConfig, existing);
|
|
49114
49233
|
merged.$schema = newConfig.$schema;
|
|
49115
|
-
|
|
49234
|
+
writeFileSync4(omoConfigPath, JSON.stringify(merged, null, 2) + `
|
|
49116
49235
|
`);
|
|
49117
49236
|
} catch (parseErr) {
|
|
49118
49237
|
if (parseErr instanceof SyntaxError) {
|
|
49119
|
-
|
|
49238
|
+
writeFileSync4(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
49120
49239
|
`);
|
|
49121
49240
|
return { success: true, configPath: omoConfigPath };
|
|
49122
49241
|
}
|
|
49123
49242
|
throw parseErr;
|
|
49124
49243
|
}
|
|
49125
49244
|
} else {
|
|
49126
|
-
|
|
49245
|
+
writeFileSync4(omoConfigPath, JSON.stringify(newConfig, null, 2) + `
|
|
49127
49246
|
`);
|
|
49128
49247
|
}
|
|
49129
49248
|
return { success: true, configPath: omoConfigPath };
|
|
@@ -49239,10 +49358,10 @@ var init_opencode_binary = __esm(() => {
|
|
|
49239
49358
|
});
|
|
49240
49359
|
|
|
49241
49360
|
// src/cli/config-manager/detect-current-config.ts
|
|
49242
|
-
import { existsSync as
|
|
49361
|
+
import { existsSync as existsSync8, readFileSync as readFileSync7 } from "fs";
|
|
49243
49362
|
function detectProvidersFromOmoConfig() {
|
|
49244
49363
|
const omoConfigPath = getExistingOmoConfigPath();
|
|
49245
|
-
if (!omoConfigPath || !
|
|
49364
|
+
if (!omoConfigPath || !existsSync8(omoConfigPath)) {
|
|
49246
49365
|
return {
|
|
49247
49366
|
hasOpenAI: true,
|
|
49248
49367
|
hasOpencodeZen: true,
|
|
@@ -49252,7 +49371,7 @@ function detectProvidersFromOmoConfig() {
|
|
|
49252
49371
|
};
|
|
49253
49372
|
}
|
|
49254
49373
|
try {
|
|
49255
|
-
const content =
|
|
49374
|
+
const content = readFileSync7(omoConfigPath, "utf-8");
|
|
49256
49375
|
const omoConfig = parseJsonc(content);
|
|
49257
49376
|
if (!omoConfig || typeof omoConfig !== "object") {
|
|
49258
49377
|
return {
|
|
@@ -49326,7 +49445,11 @@ var init_detect_current_config = __esm(() => {
|
|
|
49326
49445
|
});
|
|
49327
49446
|
|
|
49328
49447
|
// src/cli/config-manager/bun-install.ts
|
|
49329
|
-
import { existsSync as
|
|
49448
|
+
import { existsSync as existsSync9 } from "fs";
|
|
49449
|
+
import { join as join8 } from "path";
|
|
49450
|
+
function getDefaultWorkspaceDir() {
|
|
49451
|
+
return join8(getOpenCodeCacheDir(), "packages");
|
|
49452
|
+
}
|
|
49330
49453
|
function readProcessOutput(stream) {
|
|
49331
49454
|
if (!stream) {
|
|
49332
49455
|
return Promise.resolve("");
|
|
@@ -49349,9 +49472,9 @@ function logCapturedOutputOnFailure(outputMode, output) {
|
|
|
49349
49472
|
}
|
|
49350
49473
|
async function runBunInstallWithDetails(options) {
|
|
49351
49474
|
const outputMode = options?.outputMode ?? "pipe";
|
|
49352
|
-
const cacheDir = options?.workspaceDir ??
|
|
49475
|
+
const cacheDir = options?.workspaceDir ?? getDefaultWorkspaceDir();
|
|
49353
49476
|
const packageJsonPath = `${cacheDir}/package.json`;
|
|
49354
|
-
if (!
|
|
49477
|
+
if (!existsSync9(packageJsonPath)) {
|
|
49355
49478
|
return {
|
|
49356
49479
|
success: false,
|
|
49357
49480
|
error: `Workspace not initialized: ${packageJsonPath} not found. OpenCode should create this on first run.`
|
|
@@ -49495,15 +49618,16 @@ function getWindowsAppdataDir() {
|
|
|
49495
49618
|
return null;
|
|
49496
49619
|
return process.env.APPDATA ?? path4.join(os3.homedir(), "AppData", "Roaming");
|
|
49497
49620
|
}
|
|
49498
|
-
var PACKAGE_NAME2, NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT = 5000, CACHE_DIR, VERSION_FILE, USER_CONFIG_DIR, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC, INSTALLED_PACKAGE_JSON;
|
|
49621
|
+
var PACKAGE_NAME2, NPM_REGISTRY_URL, NPM_FETCH_TIMEOUT = 5000, CACHE_ROOT_DIR, CACHE_DIR, VERSION_FILE, USER_CONFIG_DIR, USER_OPENCODE_CONFIG, USER_OPENCODE_CONFIG_JSONC, INSTALLED_PACKAGE_JSON;
|
|
49499
49622
|
var init_constants3 = __esm(() => {
|
|
49500
49623
|
init_data_path();
|
|
49501
49624
|
init_opencode_config_dir();
|
|
49502
49625
|
init_plugin_identity();
|
|
49503
49626
|
PACKAGE_NAME2 = PLUGIN_NAME;
|
|
49504
49627
|
NPM_REGISTRY_URL = `https://registry.npmjs.org/-/package/${PACKAGE_NAME2}/dist-tags`;
|
|
49505
|
-
|
|
49506
|
-
|
|
49628
|
+
CACHE_ROOT_DIR = getOpenCodeCacheDir();
|
|
49629
|
+
CACHE_DIR = path4.join(CACHE_ROOT_DIR, "packages");
|
|
49630
|
+
VERSION_FILE = path4.join(CACHE_ROOT_DIR, "version");
|
|
49507
49631
|
USER_CONFIG_DIR = getOpenCodeConfigDir({ binary: "opencode" });
|
|
49508
49632
|
USER_OPENCODE_CONFIG = path4.join(USER_CONFIG_DIR, "opencode.json");
|
|
49509
49633
|
USER_OPENCODE_CONFIG_JSONC = path4.join(USER_CONFIG_DIR, "opencode.jsonc");
|
|
@@ -49850,11 +49974,28 @@ function getIntentVersion(pluginInfo) {
|
|
|
49850
49974
|
}
|
|
49851
49975
|
return pluginInfo.pinnedVersion;
|
|
49852
49976
|
}
|
|
49977
|
+
function writeCachePackageJson(cachePackageJsonPath, pkgJson) {
|
|
49978
|
+
const tmpPath = `${cachePackageJsonPath}.${crypto.randomUUID()}`;
|
|
49979
|
+
try {
|
|
49980
|
+
fs9.mkdirSync(path8.dirname(cachePackageJsonPath), { recursive: true });
|
|
49981
|
+
fs9.writeFileSync(tmpPath, JSON.stringify(pkgJson, null, 2));
|
|
49982
|
+
fs9.renameSync(tmpPath, cachePackageJsonPath);
|
|
49983
|
+
return { synced: true, error: null };
|
|
49984
|
+
} catch (err) {
|
|
49985
|
+
log("[auto-update-checker] Failed to write cache package.json:", err);
|
|
49986
|
+
safeUnlink(tmpPath);
|
|
49987
|
+
return { synced: false, error: "write_error", message: "Failed to write cache package.json" };
|
|
49988
|
+
}
|
|
49989
|
+
}
|
|
49853
49990
|
function syncCachePackageJsonToIntent(pluginInfo) {
|
|
49854
49991
|
const cachePackageJsonPath = path8.join(CACHE_DIR, "package.json");
|
|
49992
|
+
const intentVersion = getIntentVersion(pluginInfo);
|
|
49855
49993
|
if (!fs9.existsSync(cachePackageJsonPath)) {
|
|
49856
|
-
log("[auto-update-checker] Cache package.json
|
|
49857
|
-
return {
|
|
49994
|
+
log("[auto-update-checker] Cache package.json missing, creating workspace package.json", { intentVersion });
|
|
49995
|
+
return {
|
|
49996
|
+
...writeCachePackageJson(cachePackageJsonPath, { dependencies: { [PACKAGE_NAME2]: intentVersion } }),
|
|
49997
|
+
message: `Created cache package.json with: ${intentVersion}`
|
|
49998
|
+
};
|
|
49858
49999
|
}
|
|
49859
50000
|
let content;
|
|
49860
50001
|
let pkgJson;
|
|
@@ -49871,11 +50012,20 @@ function syncCachePackageJsonToIntent(pluginInfo) {
|
|
|
49871
50012
|
return { synced: false, error: "parse_error", message: "Failed to parse cache package.json (malformed JSON)" };
|
|
49872
50013
|
}
|
|
49873
50014
|
if (!pkgJson || !pkgJson.dependencies?.[PACKAGE_NAME2]) {
|
|
49874
|
-
log("[auto-update-checker] Plugin
|
|
49875
|
-
|
|
50015
|
+
log("[auto-update-checker] Plugin missing from cache package.json dependencies, adding dependency", { intentVersion });
|
|
50016
|
+
const nextPkgJson = {
|
|
50017
|
+
...pkgJson ?? {},
|
|
50018
|
+
dependencies: {
|
|
50019
|
+
...pkgJson?.dependencies ?? {},
|
|
50020
|
+
[PACKAGE_NAME2]: intentVersion
|
|
50021
|
+
}
|
|
50022
|
+
};
|
|
50023
|
+
return {
|
|
50024
|
+
...writeCachePackageJson(cachePackageJsonPath, nextPkgJson),
|
|
50025
|
+
message: `Added ${PACKAGE_NAME2}: ${intentVersion}`
|
|
50026
|
+
};
|
|
49876
50027
|
}
|
|
49877
50028
|
const currentVersion = pkgJson.dependencies[PACKAGE_NAME2];
|
|
49878
|
-
const intentVersion = getIntentVersion(pluginInfo);
|
|
49879
50029
|
if (currentVersion === intentVersion) {
|
|
49880
50030
|
log("[auto-update-checker] Cache package.json already matches intent:", intentVersion);
|
|
49881
50031
|
return { synced: false, error: null, message: `Already matches intent: ${intentVersion}` };
|
|
@@ -49888,16 +50038,10 @@ function syncCachePackageJsonToIntent(pluginInfo) {
|
|
|
49888
50038
|
log(`[auto-update-checker] Updating cache package.json: "${currentVersion}" \u2192 "${intentVersion}"`);
|
|
49889
50039
|
}
|
|
49890
50040
|
pkgJson.dependencies[PACKAGE_NAME2] = intentVersion;
|
|
49891
|
-
|
|
49892
|
-
|
|
49893
|
-
|
|
49894
|
-
|
|
49895
|
-
return { synced: true, error: null, message: `Updated: "${currentVersion}" \u2192 "${intentVersion}"` };
|
|
49896
|
-
} catch (err) {
|
|
49897
|
-
log("[auto-update-checker] Failed to write cache package.json:", err);
|
|
49898
|
-
safeUnlink(tmpPath);
|
|
49899
|
-
return { synced: false, error: "write_error", message: "Failed to write cache package.json" };
|
|
49900
|
-
}
|
|
50041
|
+
return {
|
|
50042
|
+
...writeCachePackageJson(cachePackageJsonPath, pkgJson),
|
|
50043
|
+
message: `Updated: "${currentVersion}" \u2192 "${intentVersion}"`
|
|
50044
|
+
};
|
|
49901
50045
|
}
|
|
49902
50046
|
var EXACT_SEMVER_REGEX2;
|
|
49903
50047
|
var init_sync_package_json = __esm(() => {
|
|
@@ -50023,90 +50167,116 @@ var init_update_toasts = __esm(() => {
|
|
|
50023
50167
|
});
|
|
50024
50168
|
|
|
50025
50169
|
// src/hooks/auto-update-checker/hook/background-update-check.ts
|
|
50026
|
-
import { existsSync as
|
|
50170
|
+
import { existsSync as existsSync20 } from "fs";
|
|
50027
50171
|
import { join as join19 } from "path";
|
|
50172
|
+
function getCacheWorkspaceDir(deps) {
|
|
50173
|
+
return deps.join(deps.getOpenCodeCacheDir(), "packages");
|
|
50174
|
+
}
|
|
50028
50175
|
function getPinnedVersionToastMessage(latestVersion) {
|
|
50029
50176
|
return `Update available: ${latestVersion} (version pinned, update manually)`;
|
|
50030
50177
|
}
|
|
50031
|
-
function resolveActiveInstallWorkspace() {
|
|
50032
|
-
const configPaths = getOpenCodeConfigPaths({ binary: "opencode" });
|
|
50033
|
-
const cacheDir =
|
|
50034
|
-
const configInstallPath =
|
|
50035
|
-
const cacheInstallPath =
|
|
50036
|
-
if (
|
|
50037
|
-
log(`[auto-update-checker] Active workspace: config-dir (${configPaths.configDir})`);
|
|
50178
|
+
function resolveActiveInstallWorkspace(deps) {
|
|
50179
|
+
const configPaths = deps.getOpenCodeConfigPaths({ binary: "opencode" });
|
|
50180
|
+
const cacheDir = getCacheWorkspaceDir(deps);
|
|
50181
|
+
const configInstallPath = deps.join(configPaths.configDir, "node_modules", PACKAGE_NAME2, "package.json");
|
|
50182
|
+
const cacheInstallPath = deps.join(cacheDir, "node_modules", PACKAGE_NAME2, "package.json");
|
|
50183
|
+
if (deps.existsSync(configInstallPath)) {
|
|
50184
|
+
deps.log(`[auto-update-checker] Active workspace: config-dir (${configPaths.configDir})`);
|
|
50038
50185
|
return configPaths.configDir;
|
|
50039
50186
|
}
|
|
50040
|
-
if (
|
|
50041
|
-
log(`[auto-update-checker] Active workspace: cache-dir (${cacheDir})`);
|
|
50187
|
+
if (deps.existsSync(cacheInstallPath)) {
|
|
50188
|
+
deps.log(`[auto-update-checker] Active workspace: cache-dir (${cacheDir})`);
|
|
50042
50189
|
return cacheDir;
|
|
50043
50190
|
}
|
|
50044
|
-
|
|
50191
|
+
const cachePackageJsonPath = deps.join(cacheDir, "package.json");
|
|
50192
|
+
if (deps.existsSync(cachePackageJsonPath)) {
|
|
50193
|
+
deps.log(`[auto-update-checker] Active workspace: cache-dir (${cacheDir}, package.json present)`);
|
|
50194
|
+
return cacheDir;
|
|
50195
|
+
}
|
|
50196
|
+
deps.log(`[auto-update-checker] Active workspace: config-dir (default, no install detected)`);
|
|
50045
50197
|
return configPaths.configDir;
|
|
50046
50198
|
}
|
|
50047
|
-
async function runBunInstallSafe(workspaceDir) {
|
|
50199
|
+
async function runBunInstallSafe(workspaceDir, deps) {
|
|
50048
50200
|
try {
|
|
50049
|
-
const result = await runBunInstallWithDetails({ outputMode: "pipe", workspaceDir });
|
|
50201
|
+
const result = await deps.runBunInstallWithDetails({ outputMode: "pipe", workspaceDir });
|
|
50050
50202
|
if (!result.success && result.error) {
|
|
50051
|
-
log("[auto-update-checker] bun install error:", result.error);
|
|
50203
|
+
deps.log("[auto-update-checker] bun install error:", result.error);
|
|
50052
50204
|
}
|
|
50053
50205
|
return result.success;
|
|
50054
50206
|
} catch (err) {
|
|
50055
50207
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
50056
|
-
log("[auto-update-checker] bun install error:", errorMessage);
|
|
50208
|
+
deps.log("[auto-update-checker] bun install error:", errorMessage);
|
|
50057
50209
|
return false;
|
|
50058
50210
|
}
|
|
50059
50211
|
}
|
|
50060
|
-
async function
|
|
50061
|
-
const
|
|
50062
|
-
if (
|
|
50063
|
-
|
|
50064
|
-
return;
|
|
50065
|
-
}
|
|
50066
|
-
const cachedVersion = getCachedVersion();
|
|
50067
|
-
const currentVersion = cachedVersion ?? pluginInfo.pinnedVersion;
|
|
50068
|
-
if (!currentVersion) {
|
|
50069
|
-
log("[auto-update-checker] No version found (cached or pinned)");
|
|
50070
|
-
return;
|
|
50071
|
-
}
|
|
50072
|
-
const channel = extractChannel(pluginInfo.pinnedVersion ?? currentVersion);
|
|
50073
|
-
const latestVersion = await getLatestVersion(channel);
|
|
50074
|
-
if (!latestVersion) {
|
|
50075
|
-
log("[auto-update-checker] Failed to fetch latest version for channel:", channel);
|
|
50076
|
-
return;
|
|
50077
|
-
}
|
|
50078
|
-
if (currentVersion === latestVersion) {
|
|
50079
|
-
log("[auto-update-checker] Already on latest version for channel:", channel);
|
|
50080
|
-
return;
|
|
50081
|
-
}
|
|
50082
|
-
log(`[auto-update-checker] Update available (${channel}): ${currentVersion} \u2192 ${latestVersion}`);
|
|
50083
|
-
if (!autoUpdate) {
|
|
50084
|
-
await showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
50085
|
-
log("[auto-update-checker] Auto-update disabled, notification only");
|
|
50086
|
-
return;
|
|
50087
|
-
}
|
|
50088
|
-
if (pluginInfo.isPinned) {
|
|
50089
|
-
await showUpdateAvailableToast(ctx, latestVersion, () => getPinnedVersionToastMessage(latestVersion));
|
|
50090
|
-
log(`[auto-update-checker] User-pinned version detected (${pluginInfo.entry}), skipping auto-update. Notification only.`);
|
|
50091
|
-
return;
|
|
50092
|
-
}
|
|
50093
|
-
const syncResult = syncCachePackageJsonToIntent(pluginInfo);
|
|
50094
|
-
if (syncResult.error) {
|
|
50095
|
-
log(`[auto-update-checker] Sync failed with error: ${syncResult.error}`, syncResult.message);
|
|
50096
|
-
await showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
50097
|
-
return;
|
|
50098
|
-
}
|
|
50099
|
-
invalidatePackage(PACKAGE_NAME2);
|
|
50100
|
-
const activeWorkspace = resolveActiveInstallWorkspace();
|
|
50101
|
-
const installSuccess = await runBunInstallSafe(activeWorkspace);
|
|
50102
|
-
if (installSuccess) {
|
|
50103
|
-
await showAutoUpdatedToast(ctx, currentVersion, latestVersion);
|
|
50104
|
-
log(`[auto-update-checker] Update installed: ${currentVersion} \u2192 ${latestVersion}`);
|
|
50105
|
-
return;
|
|
50212
|
+
async function primeCacheWorkspace(activeWorkspace, deps) {
|
|
50213
|
+
const cacheWorkspace = getCacheWorkspaceDir(deps);
|
|
50214
|
+
if (activeWorkspace === cacheWorkspace) {
|
|
50215
|
+
return true;
|
|
50106
50216
|
}
|
|
50107
|
-
|
|
50108
|
-
|
|
50217
|
+
deps.log(`[auto-update-checker] Priming cache workspace after install: ${cacheWorkspace}`);
|
|
50218
|
+
return runBunInstallSafe(cacheWorkspace, deps);
|
|
50219
|
+
}
|
|
50220
|
+
function createBackgroundUpdateCheckRunner(overrides = {}) {
|
|
50221
|
+
const deps = { ...defaultDeps, ...overrides };
|
|
50222
|
+
return async function runBackgroundUpdateCheck(ctx, autoUpdate, getToastMessage) {
|
|
50223
|
+
const pluginInfo = deps.findPluginEntry(ctx.directory);
|
|
50224
|
+
if (!pluginInfo) {
|
|
50225
|
+
deps.log("[auto-update-checker] Plugin not found in config");
|
|
50226
|
+
return;
|
|
50227
|
+
}
|
|
50228
|
+
const cachedVersion = deps.getCachedVersion();
|
|
50229
|
+
const currentVersion = cachedVersion ?? pluginInfo.pinnedVersion;
|
|
50230
|
+
if (!currentVersion) {
|
|
50231
|
+
deps.log("[auto-update-checker] No version found (cached or pinned)");
|
|
50232
|
+
return;
|
|
50233
|
+
}
|
|
50234
|
+
const channel = deps.extractChannel(pluginInfo.pinnedVersion ?? currentVersion);
|
|
50235
|
+
const latestVersion = await deps.getLatestVersion(channel);
|
|
50236
|
+
if (!latestVersion) {
|
|
50237
|
+
deps.log("[auto-update-checker] Failed to fetch latest version for channel:", channel);
|
|
50238
|
+
return;
|
|
50239
|
+
}
|
|
50240
|
+
if (currentVersion === latestVersion) {
|
|
50241
|
+
deps.log("[auto-update-checker] Already on latest version for channel:", channel);
|
|
50242
|
+
return;
|
|
50243
|
+
}
|
|
50244
|
+
deps.log(`[auto-update-checker] Update available (${channel}): ${currentVersion} \u2192 ${latestVersion}`);
|
|
50245
|
+
if (!autoUpdate) {
|
|
50246
|
+
await deps.showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
50247
|
+
deps.log("[auto-update-checker] Auto-update disabled, notification only");
|
|
50248
|
+
return;
|
|
50249
|
+
}
|
|
50250
|
+
if (pluginInfo.isPinned) {
|
|
50251
|
+
await deps.showUpdateAvailableToast(ctx, latestVersion, () => getPinnedVersionToastMessage(latestVersion));
|
|
50252
|
+
deps.log(`[auto-update-checker] User-pinned version detected (${pluginInfo.entry}), skipping auto-update. Notification only.`);
|
|
50253
|
+
return;
|
|
50254
|
+
}
|
|
50255
|
+
const syncResult = deps.syncCachePackageJsonToIntent(pluginInfo);
|
|
50256
|
+
if (syncResult.error) {
|
|
50257
|
+
deps.log(`[auto-update-checker] Sync failed with error: ${syncResult.error}`, syncResult.message);
|
|
50258
|
+
await deps.showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
50259
|
+
return;
|
|
50260
|
+
}
|
|
50261
|
+
deps.invalidatePackage(PACKAGE_NAME2);
|
|
50262
|
+
const activeWorkspace = resolveActiveInstallWorkspace(deps);
|
|
50263
|
+
const installSuccess = await runBunInstallSafe(activeWorkspace, deps);
|
|
50264
|
+
if (installSuccess) {
|
|
50265
|
+
const cachePrimed = await primeCacheWorkspace(activeWorkspace, deps);
|
|
50266
|
+
if (!cachePrimed) {
|
|
50267
|
+
await deps.showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
50268
|
+
deps.log("[auto-update-checker] cache workspace priming failed after install");
|
|
50269
|
+
return;
|
|
50270
|
+
}
|
|
50271
|
+
await deps.showAutoUpdatedToast(ctx, currentVersion, latestVersion);
|
|
50272
|
+
deps.log(`[auto-update-checker] Update installed: ${currentVersion} \u2192 ${latestVersion}`);
|
|
50273
|
+
return;
|
|
50274
|
+
}
|
|
50275
|
+
await deps.showUpdateAvailableToast(ctx, latestVersion, getToastMessage);
|
|
50276
|
+
deps.log("[auto-update-checker] bun install failed; update not installed (falling back to notification-only)");
|
|
50277
|
+
};
|
|
50109
50278
|
}
|
|
50279
|
+
var defaultDeps, runBackgroundUpdateCheck;
|
|
50110
50280
|
var init_background_update_check = __esm(() => {
|
|
50111
50281
|
init_config_manager();
|
|
50112
50282
|
init_logger();
|
|
@@ -50115,6 +50285,23 @@ var init_background_update_check = __esm(() => {
|
|
|
50115
50285
|
init_constants3();
|
|
50116
50286
|
init_checker();
|
|
50117
50287
|
init_update_toasts();
|
|
50288
|
+
defaultDeps = {
|
|
50289
|
+
existsSync: existsSync20,
|
|
50290
|
+
join: join19,
|
|
50291
|
+
runBunInstallWithDetails,
|
|
50292
|
+
log,
|
|
50293
|
+
getOpenCodeCacheDir,
|
|
50294
|
+
getOpenCodeConfigPaths,
|
|
50295
|
+
invalidatePackage,
|
|
50296
|
+
extractChannel,
|
|
50297
|
+
findPluginEntry,
|
|
50298
|
+
getCachedVersion,
|
|
50299
|
+
getLatestVersion,
|
|
50300
|
+
syncCachePackageJsonToIntent,
|
|
50301
|
+
showUpdateAvailableToast,
|
|
50302
|
+
showAutoUpdatedToast
|
|
50303
|
+
};
|
|
50304
|
+
runBackgroundUpdateCheck = createBackgroundUpdateCheckRunner();
|
|
50118
50305
|
});
|
|
50119
50306
|
|
|
50120
50307
|
// src/hooks/auto-update-checker/hook/config-errors-toast.ts
|
|
@@ -50380,9 +50567,9 @@ var {
|
|
|
50380
50567
|
// package.json
|
|
50381
50568
|
var package_default = {
|
|
50382
50569
|
name: "evil-omo",
|
|
50383
|
-
version: "3.
|
|
50570
|
+
version: "3.15.2",
|
|
50384
50571
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
50385
|
-
main: "dist/index.js",
|
|
50572
|
+
main: "./dist/index.js",
|
|
50386
50573
|
types: "dist/index.d.ts",
|
|
50387
50574
|
type: "module",
|
|
50388
50575
|
bin: {
|
|
@@ -50454,21 +50641,21 @@ var package_default = {
|
|
|
50454
50641
|
devDependencies: {
|
|
50455
50642
|
"@types/js-yaml": "^4.0.9",
|
|
50456
50643
|
"@types/picomatch": "^3.0.2",
|
|
50457
|
-
"bun-types": "1.3.
|
|
50644
|
+
"bun-types": "1.3.11",
|
|
50458
50645
|
typescript: "^5.7.3"
|
|
50459
50646
|
},
|
|
50460
50647
|
optionalDependencies: {
|
|
50461
|
-
"evil-omo-darwin-arm64": "3.
|
|
50462
|
-
"evil-omo-darwin-x64": "3.
|
|
50463
|
-
"evil-omo-darwin-x64-baseline": "3.
|
|
50464
|
-
"evil-omo-linux-x64": "3.
|
|
50465
|
-
"evil-omo-linux-x64-baseline": "3.
|
|
50466
|
-
"evil-omo-linux-arm64": "3.
|
|
50467
|
-
"evil-omo-linux-x64-musl": "3.
|
|
50468
|
-
"evil-omo-linux-x64-musl-baseline": "3.
|
|
50469
|
-
"evil-omo-linux-arm64-musl": "3.
|
|
50470
|
-
"evil-omo-windows-x64": "3.
|
|
50471
|
-
"evil-omo-windows-x64-baseline": "3.
|
|
50648
|
+
"evil-omo-darwin-arm64": "3.15.2",
|
|
50649
|
+
"evil-omo-darwin-x64": "3.15.2",
|
|
50650
|
+
"evil-omo-darwin-x64-baseline": "3.15.2",
|
|
50651
|
+
"evil-omo-linux-x64": "3.15.2",
|
|
50652
|
+
"evil-omo-linux-x64-baseline": "3.15.2",
|
|
50653
|
+
"evil-omo-linux-arm64": "3.15.2",
|
|
50654
|
+
"evil-omo-linux-x64-musl": "3.15.2",
|
|
50655
|
+
"evil-omo-linux-x64-musl-baseline": "3.15.2",
|
|
50656
|
+
"evil-omo-linux-arm64-musl": "3.15.2",
|
|
50657
|
+
"evil-omo-windows-x64": "3.15.2",
|
|
50658
|
+
"evil-omo-windows-x64-baseline": "3.15.2"
|
|
50472
50659
|
},
|
|
50473
50660
|
overrides: {
|
|
50474
50661
|
"@opencode-ai/sdk": "^1.2.24"
|
|
@@ -65753,7 +65940,9 @@ var BuiltinSkillNameSchema = exports_external.enum([
|
|
|
65753
65940
|
"agent-browser",
|
|
65754
65941
|
"dev-browser",
|
|
65755
65942
|
"frontend-ui-ux",
|
|
65756
|
-
"git-master"
|
|
65943
|
+
"git-master",
|
|
65944
|
+
"review-work",
|
|
65945
|
+
"ai-slop-remover"
|
|
65757
65946
|
]);
|
|
65758
65947
|
var OverridableAgentNameSchema = exports_external.enum([
|
|
65759
65948
|
"build",
|
|
@@ -65784,9 +65973,14 @@ var FallbackModelObjectSchema = exports_external.object({
|
|
|
65784
65973
|
budgetTokens: exports_external.number().optional()
|
|
65785
65974
|
}).optional()
|
|
65786
65975
|
});
|
|
65976
|
+
var FallbackModelStringArraySchema = exports_external.array(exports_external.string());
|
|
65977
|
+
var FallbackModelObjectArraySchema = exports_external.array(FallbackModelObjectSchema);
|
|
65978
|
+
var FallbackModelMixedArraySchema = exports_external.array(exports_external.union([exports_external.string(), FallbackModelObjectSchema]));
|
|
65787
65979
|
var FallbackModelsSchema = exports_external.union([
|
|
65788
65980
|
exports_external.string(),
|
|
65789
|
-
|
|
65981
|
+
FallbackModelStringArraySchema,
|
|
65982
|
+
FallbackModelObjectArraySchema,
|
|
65983
|
+
FallbackModelMixedArraySchema
|
|
65790
65984
|
]);
|
|
65791
65985
|
|
|
65792
65986
|
// src/config/schema/internal/permission.ts
|
|
@@ -65874,6 +66068,8 @@ var BackgroundTaskConfigSchema = exports_external.object({
|
|
|
65874
66068
|
maxDescendants: exports_external.number().int().min(1).optional(),
|
|
65875
66069
|
staleTimeoutMs: exports_external.number().min(60000).optional(),
|
|
65876
66070
|
messageStalenessTimeoutMs: exports_external.number().min(60000).optional(),
|
|
66071
|
+
taskTtlMs: exports_external.number().min(300000).optional(),
|
|
66072
|
+
sessionGoneTimeoutMs: exports_external.number().min(1e4).optional(),
|
|
65877
66073
|
syncPollTimeoutMs: exports_external.number().min(60000).optional(),
|
|
65878
66074
|
maxToolCalls: exports_external.number().int().min(10).optional(),
|
|
65879
66075
|
circuitBreaker: CircuitBreakerConfigSchema.optional()
|
|
@@ -65942,7 +66138,8 @@ var BuiltinCommandNameSchema = exports_external.enum([
|
|
|
65942
66138
|
"cancel-ralph",
|
|
65943
66139
|
"refactor",
|
|
65944
66140
|
"start-work",
|
|
65945
|
-
"stop-continuation"
|
|
66141
|
+
"stop-continuation",
|
|
66142
|
+
"remove-ai-slops"
|
|
65946
66143
|
]);
|
|
65947
66144
|
// src/config/schema/dynamic-context-pruning.ts
|
|
65948
66145
|
var DynamicContextPruningConfigSchema = exports_external.object({
|
|
@@ -65987,7 +66184,8 @@ var ExperimentalConfigSchema = exports_external.object({
|
|
|
65987
66184
|
safe_hook_creation: exports_external.boolean().optional(),
|
|
65988
66185
|
disable_omo_env: exports_external.boolean().optional(),
|
|
65989
66186
|
hashline_edit: exports_external.boolean().optional(),
|
|
65990
|
-
model_fallback_title: exports_external.boolean().optional()
|
|
66187
|
+
model_fallback_title: exports_external.boolean().optional(),
|
|
66188
|
+
max_tools: exports_external.number().int().min(1).optional()
|
|
65991
66189
|
});
|
|
65992
66190
|
// src/config/schema/git-env-prefix.ts
|
|
65993
66191
|
var GIT_ENV_ASSIGNMENT_PATTERN = /^(?:[A-Za-z_][A-Za-z0-9_]*=[A-Za-z0-9_-]*)(?: [A-Za-z_][A-Za-z0-9_]*=[A-Za-z0-9_-]*)*$/;
|
|
@@ -66030,6 +66228,7 @@ var HookNameSchema = exports_external.enum([
|
|
|
66030
66228
|
"non-interactive-env",
|
|
66031
66229
|
"interactive-bash-session",
|
|
66032
66230
|
"thinking-block-validator",
|
|
66231
|
+
"tool-pair-validator",
|
|
66033
66232
|
"ralph-loop",
|
|
66034
66233
|
"category-skill-reminder",
|
|
66035
66234
|
"compaction-context-injector",
|
|
@@ -66051,11 +66250,13 @@ var HookNameSchema = exports_external.enum([
|
|
|
66051
66250
|
"tasks-todowrite-disabler",
|
|
66052
66251
|
"runtime-fallback",
|
|
66053
66252
|
"write-existing-file-guard",
|
|
66253
|
+
"bash-file-read-guard",
|
|
66054
66254
|
"anthropic-effort",
|
|
66055
66255
|
"hashline-read-enhancer",
|
|
66056
66256
|
"read-image-resizer",
|
|
66057
66257
|
"todo-description-override",
|
|
66058
|
-
"webfetch-redirect-guard"
|
|
66258
|
+
"webfetch-redirect-guard",
|
|
66259
|
+
"legacy-plugin-toast"
|
|
66059
66260
|
]);
|
|
66060
66261
|
// src/config/schema/model-capabilities.ts
|
|
66061
66262
|
var ModelCapabilitiesConfigSchema = exports_external.object({
|
|
@@ -66166,7 +66367,8 @@ var SisyphusAgentConfigSchema = exports_external.object({
|
|
|
66166
66367
|
disabled: exports_external.boolean().optional(),
|
|
66167
66368
|
default_builder_enabled: exports_external.boolean().optional(),
|
|
66168
66369
|
planner_enabled: exports_external.boolean().optional(),
|
|
66169
|
-
replace_plan: exports_external.boolean().optional()
|
|
66370
|
+
replace_plan: exports_external.boolean().optional(),
|
|
66371
|
+
tdd: exports_external.boolean().default(true).optional()
|
|
66170
66372
|
});
|
|
66171
66373
|
|
|
66172
66374
|
// src/config/schema/start-work.ts
|
|
@@ -66182,12 +66384,18 @@ var TmuxLayoutSchema = exports_external.enum([
|
|
|
66182
66384
|
"even-horizontal",
|
|
66183
66385
|
"even-vertical"
|
|
66184
66386
|
]);
|
|
66387
|
+
var TmuxIsolationSchema = exports_external.enum([
|
|
66388
|
+
"inline",
|
|
66389
|
+
"window",
|
|
66390
|
+
"session"
|
|
66391
|
+
]);
|
|
66185
66392
|
var TmuxConfigSchema = exports_external.object({
|
|
66186
66393
|
enabled: exports_external.boolean().default(false),
|
|
66187
66394
|
layout: TmuxLayoutSchema.default("main-vertical"),
|
|
66188
66395
|
main_pane_size: exports_external.number().min(20).max(80).default(60),
|
|
66189
66396
|
main_pane_min_width: exports_external.number().min(40).default(120),
|
|
66190
|
-
agent_pane_min_width: exports_external.number().min(20).default(40)
|
|
66397
|
+
agent_pane_min_width: exports_external.number().min(20).default(40),
|
|
66398
|
+
isolation: TmuxIsolationSchema.default("inline")
|
|
66191
66399
|
});
|
|
66192
66400
|
|
|
66193
66401
|
// src/config/schema/websearch.ts
|
|
@@ -66212,6 +66420,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
66212
66420
|
disabled_hooks: StringListSchema.optional(),
|
|
66213
66421
|
disabled_commands: exports_external.array(BuiltinCommandNameSchema).optional(),
|
|
66214
66422
|
disabled_tools: StringListSchema.optional(),
|
|
66423
|
+
mcp_env_allowlist: exports_external.array(exports_external.string()).optional(),
|
|
66215
66424
|
hashline_edit: exports_external.boolean().optional(),
|
|
66216
66425
|
model_fallback: exports_external.boolean().optional(),
|
|
66217
66426
|
agents: AgentOverridesSchema.optional(),
|
|
@@ -66245,7 +66454,8 @@ var PARTIAL_STRING_ARRAY_KEYS = new Set([
|
|
|
66245
66454
|
"disabled_skills",
|
|
66246
66455
|
"disabled_hooks",
|
|
66247
66456
|
"disabled_commands",
|
|
66248
|
-
"disabled_tools"
|
|
66457
|
+
"disabled_tools",
|
|
66458
|
+
"mcp_env_allowlist"
|
|
66249
66459
|
]);
|
|
66250
66460
|
function parseConfigPartially(rawConfig) {
|
|
66251
66461
|
const fullResult = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
@@ -66353,6 +66563,12 @@ function mergeConfigs(base, override) {
|
|
|
66353
66563
|
...override.disabled_tools ?? []
|
|
66354
66564
|
])
|
|
66355
66565
|
],
|
|
66566
|
+
mcp_env_allowlist: [
|
|
66567
|
+
...new Set([
|
|
66568
|
+
...base.mcp_env_allowlist ?? [],
|
|
66569
|
+
...override.mcp_env_allowlist ?? []
|
|
66570
|
+
])
|
|
66571
|
+
],
|
|
66356
66572
|
claude_code: deepMerge(base.claude_code, override.claude_code)
|
|
66357
66573
|
};
|
|
66358
66574
|
}
|
|
@@ -68080,6 +68296,22 @@ async function readOutput(stream, streamName) {
|
|
|
68080
68296
|
return "";
|
|
68081
68297
|
}
|
|
68082
68298
|
}
|
|
68299
|
+
function resolveHookShellCommand(command) {
|
|
68300
|
+
const shellType = detectShellType();
|
|
68301
|
+
switch (shellType) {
|
|
68302
|
+
case "powershell": {
|
|
68303
|
+
const powershellExecutable = process.platform === "win32" ? "powershell.exe" : "pwsh";
|
|
68304
|
+
return [powershellExecutable, "-NoProfile", "-Command", command];
|
|
68305
|
+
}
|
|
68306
|
+
case "cmd":
|
|
68307
|
+
return [process.env.ComSpec || "cmd.exe", "/d", "/s", "/c", command];
|
|
68308
|
+
case "csh":
|
|
68309
|
+
return ["csh", "-c", command];
|
|
68310
|
+
case "unix":
|
|
68311
|
+
default:
|
|
68312
|
+
return ["sh", "-c", command];
|
|
68313
|
+
}
|
|
68314
|
+
}
|
|
68083
68315
|
async function executeOnCompleteHook(options) {
|
|
68084
68316
|
const { command, sessionId, exitCode, durationMs, messageCount } = options;
|
|
68085
68317
|
const trimmedCommand = command.trim();
|
|
@@ -68088,7 +68320,8 @@ async function executeOnCompleteHook(options) {
|
|
|
68088
68320
|
}
|
|
68089
68321
|
log("Running on-complete hook", { command: trimmedCommand });
|
|
68090
68322
|
try {
|
|
68091
|
-
const
|
|
68323
|
+
const shellCommand = resolveHookShellCommand(trimmedCommand);
|
|
68324
|
+
const proc = spawnWithWindowsHide(shellCommand, {
|
|
68092
68325
|
env: {
|
|
68093
68326
|
...process.env,
|
|
68094
68327
|
SESSION_ID: sessionId,
|
|
@@ -68217,7 +68450,7 @@ var BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
|
|
|
68217
68450
|
var NOTEPAD_DIR = "notepads";
|
|
68218
68451
|
var NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
|
|
68219
68452
|
// src/features/boulder-state/storage.ts
|
|
68220
|
-
import { existsSync as
|
|
68453
|
+
import { existsSync as existsSync11, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync3, readdirSync } from "fs";
|
|
68221
68454
|
import { dirname as dirname2, join as join11, basename } from "path";
|
|
68222
68455
|
var RESERVED_KEYS = new Set(["__proto__", "prototype", "constructor"]);
|
|
68223
68456
|
function getBoulderFilePath(directory) {
|
|
@@ -68225,11 +68458,11 @@ function getBoulderFilePath(directory) {
|
|
|
68225
68458
|
}
|
|
68226
68459
|
function readBoulderState(directory) {
|
|
68227
68460
|
const filePath = getBoulderFilePath(directory);
|
|
68228
|
-
if (!
|
|
68461
|
+
if (!existsSync11(filePath)) {
|
|
68229
68462
|
return null;
|
|
68230
68463
|
}
|
|
68231
68464
|
try {
|
|
68232
|
-
const content =
|
|
68465
|
+
const content = readFileSync9(filePath, "utf-8");
|
|
68233
68466
|
const parsed = JSON.parse(content);
|
|
68234
68467
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
68235
68468
|
return null;
|
|
@@ -68246,11 +68479,11 @@ function readBoulderState(directory) {
|
|
|
68246
68479
|
}
|
|
68247
68480
|
}
|
|
68248
68481
|
function getPlanProgress(planPath) {
|
|
68249
|
-
if (!
|
|
68482
|
+
if (!existsSync11(planPath)) {
|
|
68250
68483
|
return { total: 0, completed: 0, isComplete: true };
|
|
68251
68484
|
}
|
|
68252
68485
|
try {
|
|
68253
|
-
const content =
|
|
68486
|
+
const content = readFileSync9(planPath, "utf-8");
|
|
68254
68487
|
const uncheckedMatches = content.match(/^\s*[-*]\s*\[\s*\]/gm) || [];
|
|
68255
68488
|
const checkedMatches = content.match(/^\s*[-*]\s*\[[xX]\]/gm) || [];
|
|
68256
68489
|
const total = uncheckedMatches.length + checkedMatches.length;
|
|
@@ -68267,17 +68500,17 @@ function getPlanProgress(planPath) {
|
|
|
68267
68500
|
// src/features/run-continuation-state/constants.ts
|
|
68268
68501
|
var CONTINUATION_MARKER_DIR = ".sisyphus/run-continuation";
|
|
68269
68502
|
// src/features/run-continuation-state/storage.ts
|
|
68270
|
-
import { existsSync as
|
|
68503
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync4, readFileSync as readFileSync10, rmSync, writeFileSync as writeFileSync6 } from "fs";
|
|
68271
68504
|
import { join as join12 } from "path";
|
|
68272
68505
|
function getMarkerPath(directory, sessionID) {
|
|
68273
68506
|
return join12(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
|
|
68274
68507
|
}
|
|
68275
68508
|
function readContinuationMarker(directory, sessionID) {
|
|
68276
68509
|
const markerPath = getMarkerPath(directory, sessionID);
|
|
68277
|
-
if (!
|
|
68510
|
+
if (!existsSync12(markerPath))
|
|
68278
68511
|
return null;
|
|
68279
68512
|
try {
|
|
68280
|
-
const raw =
|
|
68513
|
+
const raw = readFileSync10(markerPath, "utf-8");
|
|
68281
68514
|
const parsed = JSON.parse(raw);
|
|
68282
68515
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
68283
68516
|
return null;
|
|
@@ -68302,7 +68535,7 @@ function getActiveContinuationMarkerReason(marker) {
|
|
|
68302
68535
|
}
|
|
68303
68536
|
// src/hooks/ralph-loop/storage.ts
|
|
68304
68537
|
init_frontmatter();
|
|
68305
|
-
import { existsSync as
|
|
68538
|
+
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync7, unlinkSync, mkdirSync as mkdirSync5 } from "fs";
|
|
68306
68539
|
import { dirname as dirname3, join as join13 } from "path";
|
|
68307
68540
|
|
|
68308
68541
|
// src/hooks/ralph-loop/constants.ts
|
|
@@ -68316,11 +68549,11 @@ function getStateFilePath(directory, customPath) {
|
|
|
68316
68549
|
}
|
|
68317
68550
|
function readState(directory, customPath) {
|
|
68318
68551
|
const filePath = getStateFilePath(directory, customPath);
|
|
68319
|
-
if (!
|
|
68552
|
+
if (!existsSync13(filePath)) {
|
|
68320
68553
|
return null;
|
|
68321
68554
|
}
|
|
68322
68555
|
try {
|
|
68323
|
-
const content =
|
|
68556
|
+
const content = readFileSync11(filePath, "utf-8");
|
|
68324
68557
|
const { data, body } = parseFrontmatter(content);
|
|
68325
68558
|
const active = data.active;
|
|
68326
68559
|
const iteration = data.iteration;
|
|
@@ -69026,11 +69259,11 @@ var PACKAGE_NAME3 = PLUGIN_NAME;
|
|
|
69026
69259
|
var OPENCODE_BINARIES2 = ["opencode", "opencode-desktop"];
|
|
69027
69260
|
|
|
69028
69261
|
// src/cli/doctor/checks/system.ts
|
|
69029
|
-
import { existsSync as
|
|
69262
|
+
import { existsSync as existsSync24, readFileSync as readFileSync21 } from "fs";
|
|
69030
69263
|
|
|
69031
69264
|
// src/cli/doctor/checks/system-binary.ts
|
|
69032
69265
|
init_spawn_with_windows_hide();
|
|
69033
|
-
import { existsSync as
|
|
69266
|
+
import { existsSync as existsSync21 } from "fs";
|
|
69034
69267
|
import { homedir as homedir5 } from "os";
|
|
69035
69268
|
import { join as join20 } from "path";
|
|
69036
69269
|
function getDesktopAppPaths(platform) {
|
|
@@ -69070,7 +69303,7 @@ function buildVersionCommand(binaryPath, platform) {
|
|
|
69070
69303
|
}
|
|
69071
69304
|
return [binaryPath, "--version"];
|
|
69072
69305
|
}
|
|
69073
|
-
function findDesktopBinary(platform = process.platform, checkExists =
|
|
69306
|
+
function findDesktopBinary(platform = process.platform, checkExists = existsSync21) {
|
|
69074
69307
|
for (const desktopPath of getDesktopAppPaths(platform)) {
|
|
69075
69308
|
if (checkExists(desktopPath)) {
|
|
69076
69309
|
return { binary: "opencode", path: desktopPath };
|
|
@@ -69118,12 +69351,12 @@ function compareVersions(current, minimum) {
|
|
|
69118
69351
|
|
|
69119
69352
|
// src/cli/doctor/checks/system-plugin.ts
|
|
69120
69353
|
init_shared();
|
|
69121
|
-
import { existsSync as
|
|
69354
|
+
import { existsSync as existsSync22, readFileSync as readFileSync19 } from "fs";
|
|
69122
69355
|
function detectConfigPath() {
|
|
69123
69356
|
const paths = getOpenCodeConfigPaths({ binary: "opencode", version: null });
|
|
69124
|
-
if (
|
|
69357
|
+
if (existsSync22(paths.configJsonc))
|
|
69125
69358
|
return paths.configJsonc;
|
|
69126
|
-
if (
|
|
69359
|
+
if (existsSync22(paths.configJson))
|
|
69127
69360
|
return paths.configJson;
|
|
69128
69361
|
return null;
|
|
69129
69362
|
}
|
|
@@ -69169,7 +69402,7 @@ function getPluginInfo() {
|
|
|
69169
69402
|
};
|
|
69170
69403
|
}
|
|
69171
69404
|
try {
|
|
69172
|
-
const content =
|
|
69405
|
+
const content = readFileSync19(configPath, "utf-8");
|
|
69173
69406
|
const parsedConfig = parseJsonc(content);
|
|
69174
69407
|
const pluginEntry = findPluginEntry2(parsedConfig.plugin ?? []);
|
|
69175
69408
|
if (!pluginEntry) {
|
|
@@ -69207,7 +69440,7 @@ function getPluginInfo() {
|
|
|
69207
69440
|
init_file_utils();
|
|
69208
69441
|
init_checker();
|
|
69209
69442
|
init_auto_update_checker();
|
|
69210
|
-
import { existsSync as
|
|
69443
|
+
import { existsSync as existsSync23, readFileSync as readFileSync20 } from "fs";
|
|
69211
69444
|
import { homedir as homedir6 } from "os";
|
|
69212
69445
|
import { join as join21 } from "path";
|
|
69213
69446
|
init_shared();
|
|
@@ -69224,20 +69457,20 @@ function resolveOpenCodeCacheDir() {
|
|
|
69224
69457
|
return join21(xdgCacheHome, "opencode");
|
|
69225
69458
|
const fromShared = getOpenCodeCacheDir();
|
|
69226
69459
|
const platformDefault = join21(getPlatformDefaultCacheDir(), "opencode");
|
|
69227
|
-
if (
|
|
69460
|
+
if (existsSync23(fromShared) || !existsSync23(platformDefault))
|
|
69228
69461
|
return fromShared;
|
|
69229
69462
|
return platformDefault;
|
|
69230
69463
|
}
|
|
69231
69464
|
function resolveExistingDir(dirPath) {
|
|
69232
|
-
if (!
|
|
69465
|
+
if (!existsSync23(dirPath))
|
|
69233
69466
|
return dirPath;
|
|
69234
69467
|
return resolveSymlink(dirPath);
|
|
69235
69468
|
}
|
|
69236
69469
|
function readPackageJson(filePath) {
|
|
69237
|
-
if (!
|
|
69470
|
+
if (!existsSync23(filePath))
|
|
69238
69471
|
return null;
|
|
69239
69472
|
try {
|
|
69240
|
-
const content =
|
|
69473
|
+
const content = readFileSync20(filePath, "utf-8");
|
|
69241
69474
|
return parseJsonc(content);
|
|
69242
69475
|
} catch {
|
|
69243
69476
|
return null;
|
|
@@ -69265,7 +69498,7 @@ function getLoadedPluginVersion() {
|
|
|
69265
69498
|
installedPackagePath: join21(cacheDir, "node_modules", PACKAGE_NAME3, "package.json")
|
|
69266
69499
|
}
|
|
69267
69500
|
];
|
|
69268
|
-
const selectedCandidate = candidates.find((candidate) =>
|
|
69501
|
+
const selectedCandidate = candidates.find((candidate) => existsSync23(candidate.installedPackagePath)) ?? candidates[0];
|
|
69269
69502
|
const { cacheDir: selectedDir, cachePackagePath, installedPackagePath } = selectedCandidate;
|
|
69270
69503
|
const cachePackage = readPackageJson(cachePackagePath);
|
|
69271
69504
|
const installedPackage = readPackageJson(installedPackagePath);
|
|
@@ -69292,10 +69525,10 @@ init_shared();
|
|
|
69292
69525
|
function isConfigValid(configPath) {
|
|
69293
69526
|
if (!configPath)
|
|
69294
69527
|
return true;
|
|
69295
|
-
if (!
|
|
69528
|
+
if (!existsSync24(configPath))
|
|
69296
69529
|
return false;
|
|
69297
69530
|
try {
|
|
69298
|
-
parseJsonc(
|
|
69531
|
+
parseJsonc(readFileSync21(configPath, "utf-8"));
|
|
69299
69532
|
return true;
|
|
69300
69533
|
} catch {
|
|
69301
69534
|
return false;
|
|
@@ -69398,14 +69631,14 @@ async function checkSystem() {
|
|
|
69398
69631
|
}
|
|
69399
69632
|
|
|
69400
69633
|
// src/cli/doctor/checks/config.ts
|
|
69401
|
-
import { readFileSync as
|
|
69634
|
+
import { readFileSync as readFileSync24 } from "fs";
|
|
69402
69635
|
import { join as join25 } from "path";
|
|
69403
69636
|
init_shared();
|
|
69404
69637
|
init_plugin_identity();
|
|
69405
69638
|
|
|
69406
69639
|
// src/cli/doctor/checks/model-resolution-cache.ts
|
|
69407
69640
|
init_shared();
|
|
69408
|
-
import { existsSync as
|
|
69641
|
+
import { existsSync as existsSync25, readFileSync as readFileSync22 } from "fs";
|
|
69409
69642
|
import { homedir as homedir7 } from "os";
|
|
69410
69643
|
import { join as join22 } from "path";
|
|
69411
69644
|
function getOpenCodeCacheDir2() {
|
|
@@ -69416,11 +69649,11 @@ function getOpenCodeCacheDir2() {
|
|
|
69416
69649
|
}
|
|
69417
69650
|
function loadAvailableModelsFromCache() {
|
|
69418
69651
|
const cacheFile = join22(getOpenCodeCacheDir2(), "models.json");
|
|
69419
|
-
if (!
|
|
69652
|
+
if (!existsSync25(cacheFile)) {
|
|
69420
69653
|
return { providers: [], modelCount: 0, cacheExists: false };
|
|
69421
69654
|
}
|
|
69422
69655
|
try {
|
|
69423
|
-
const content =
|
|
69656
|
+
const content = readFileSync22(cacheFile, "utf-8");
|
|
69424
69657
|
const data = parseJsonc(content);
|
|
69425
69658
|
const providers = Object.keys(data);
|
|
69426
69659
|
let modelCount = 0;
|
|
@@ -69443,7 +69676,7 @@ init_model_capabilities();
|
|
|
69443
69676
|
// src/cli/doctor/checks/model-resolution-config.ts
|
|
69444
69677
|
init_shared();
|
|
69445
69678
|
init_plugin_identity();
|
|
69446
|
-
import { readFileSync as
|
|
69679
|
+
import { readFileSync as readFileSync23 } from "fs";
|
|
69447
69680
|
import { join as join23 } from "path";
|
|
69448
69681
|
var USER_CONFIG_DIR2 = getOpenCodeConfigPaths({ binary: "opencode", version: null }).configDir;
|
|
69449
69682
|
var PROJECT_CONFIG_DIR = join23(process.cwd(), ".opencode");
|
|
@@ -69451,7 +69684,7 @@ function loadOmoConfig() {
|
|
|
69451
69684
|
const projectDetected = detectManagedConfigFile(PROJECT_CONFIG_DIR);
|
|
69452
69685
|
if (projectDetected.format !== "none") {
|
|
69453
69686
|
try {
|
|
69454
|
-
const content =
|
|
69687
|
+
const content = readFileSync23(projectDetected.path, "utf-8");
|
|
69455
69688
|
return parseJsonc(content);
|
|
69456
69689
|
} catch {
|
|
69457
69690
|
return null;
|
|
@@ -69460,7 +69693,7 @@ function loadOmoConfig() {
|
|
|
69460
69693
|
const userDetected = detectManagedConfigFile(USER_CONFIG_DIR2);
|
|
69461
69694
|
if (userDetected.format !== "none") {
|
|
69462
69695
|
try {
|
|
69463
|
-
const content =
|
|
69696
|
+
const content = readFileSync23(userDetected.path, "utf-8");
|
|
69464
69697
|
return parseJsonc(content);
|
|
69465
69698
|
} catch {
|
|
69466
69699
|
return null;
|
|
@@ -69574,7 +69807,7 @@ function buildEffectiveResolution(requirement, userOverride) {
|
|
|
69574
69807
|
|
|
69575
69808
|
// src/cli/doctor/checks/model-resolution.ts
|
|
69576
69809
|
function parseProviderModel(value) {
|
|
69577
|
-
const slashIndex = value.
|
|
69810
|
+
const slashIndex = value.lastIndexOf("/");
|
|
69578
69811
|
if (slashIndex <= 0 || slashIndex === value.length - 1) {
|
|
69579
69812
|
return null;
|
|
69580
69813
|
}
|
|
@@ -69683,7 +69916,7 @@ function validateConfig() {
|
|
|
69683
69916
|
return { exists: false, path: null, valid: true, config: null, errors: [] };
|
|
69684
69917
|
}
|
|
69685
69918
|
try {
|
|
69686
|
-
const content =
|
|
69919
|
+
const content = readFileSync24(configPath, "utf-8");
|
|
69687
69920
|
const rawConfig = parseJsonc(content);
|
|
69688
69921
|
const schemaResult = OhMyOpenCodeConfigSchema.safeParse(rawConfig);
|
|
69689
69922
|
if (!schemaResult.success) {
|
|
@@ -69787,9 +70020,9 @@ async function checkConfig() {
|
|
|
69787
70020
|
|
|
69788
70021
|
// src/cli/doctor/checks/dependencies.ts
|
|
69789
70022
|
init_spawn_with_windows_hide();
|
|
69790
|
-
import { existsSync as
|
|
70023
|
+
import { existsSync as existsSync26 } from "fs";
|
|
69791
70024
|
import { createRequire } from "module";
|
|
69792
|
-
import { dirname as
|
|
70025
|
+
import { dirname as dirname7, join as join26 } from "path";
|
|
69793
70026
|
async function checkBinaryExists(binary2) {
|
|
69794
70027
|
try {
|
|
69795
70028
|
const path10 = Bun.which(binary2);
|
|
@@ -69845,7 +70078,7 @@ async function checkAstGrepNapi() {
|
|
|
69845
70078
|
path: null
|
|
69846
70079
|
};
|
|
69847
70080
|
} catch {
|
|
69848
|
-
const { existsSync:
|
|
70081
|
+
const { existsSync: existsSync27 } = await import("fs");
|
|
69849
70082
|
const { join: join27 } = await import("path");
|
|
69850
70083
|
const { homedir: homedir8 } = await import("os");
|
|
69851
70084
|
const pathsToCheck = [
|
|
@@ -69853,7 +70086,7 @@ async function checkAstGrepNapi() {
|
|
|
69853
70086
|
join27(process.cwd(), "node_modules", "@ast-grep", "napi")
|
|
69854
70087
|
];
|
|
69855
70088
|
for (const napiPath of pathsToCheck) {
|
|
69856
|
-
if (
|
|
70089
|
+
if (existsSync27(napiPath)) {
|
|
69857
70090
|
return {
|
|
69858
70091
|
name: "AST-Grep NAPI",
|
|
69859
70092
|
required: false,
|
|
@@ -69878,8 +70111,8 @@ function findCommentCheckerPackageBinary() {
|
|
|
69878
70111
|
try {
|
|
69879
70112
|
const require2 = createRequire(import.meta.url);
|
|
69880
70113
|
const pkgPath = require2.resolve("@code-yeongyu/comment-checker/package.json");
|
|
69881
|
-
const binaryPath = join26(
|
|
69882
|
-
if (
|
|
70114
|
+
const binaryPath = join26(dirname7(pkgPath), "bin", binaryName);
|
|
70115
|
+
if (existsSync26(binaryPath))
|
|
69883
70116
|
return binaryPath;
|
|
69884
70117
|
} catch {}
|
|
69885
70118
|
return null;
|
|
@@ -70036,16 +70269,16 @@ var BUILTIN_SERVERS = {
|
|
|
70036
70269
|
"kotlin-ls": { command: ["kotlin-lsp"], extensions: [".kt", ".kts"] }
|
|
70037
70270
|
};
|
|
70038
70271
|
// src/tools/lsp/server-config-loader.ts
|
|
70039
|
-
import { existsSync as
|
|
70272
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25 } from "fs";
|
|
70040
70273
|
import { join as join27 } from "path";
|
|
70041
70274
|
init_shared();
|
|
70042
70275
|
init_jsonc_parser();
|
|
70043
70276
|
init_plugin_identity();
|
|
70044
70277
|
function loadJsonFile(path10) {
|
|
70045
|
-
if (!
|
|
70278
|
+
if (!existsSync27(path10))
|
|
70046
70279
|
return null;
|
|
70047
70280
|
try {
|
|
70048
|
-
return parseJsonc(
|
|
70281
|
+
return parseJsonc(readFileSync25(path10, "utf-8"));
|
|
70049
70282
|
} catch {
|
|
70050
70283
|
return null;
|
|
70051
70284
|
}
|
|
@@ -70125,7 +70358,7 @@ function getMergedServers() {
|
|
|
70125
70358
|
}
|
|
70126
70359
|
|
|
70127
70360
|
// src/tools/lsp/server-installation.ts
|
|
70128
|
-
import { existsSync as
|
|
70361
|
+
import { existsSync as existsSync28 } from "fs";
|
|
70129
70362
|
import { delimiter as delimiter2, join as join29 } from "path";
|
|
70130
70363
|
|
|
70131
70364
|
// src/tools/lsp/server-path-bases.ts
|
|
@@ -70149,7 +70382,7 @@ function isServerInstalled(command) {
|
|
|
70149
70382
|
return false;
|
|
70150
70383
|
const cmd = command[0];
|
|
70151
70384
|
if (cmd.includes("/") || cmd.includes("\\")) {
|
|
70152
|
-
if (
|
|
70385
|
+
if (existsSync28(cmd))
|
|
70153
70386
|
return true;
|
|
70154
70387
|
}
|
|
70155
70388
|
const isWindows = process.platform === "win32";
|
|
@@ -70170,14 +70403,14 @@ function isServerInstalled(command) {
|
|
|
70170
70403
|
const paths = pathEnv.split(delimiter2);
|
|
70171
70404
|
for (const p2 of paths) {
|
|
70172
70405
|
for (const suffix of exts) {
|
|
70173
|
-
if (
|
|
70406
|
+
if (existsSync28(join29(p2, cmd + suffix))) {
|
|
70174
70407
|
return true;
|
|
70175
70408
|
}
|
|
70176
70409
|
}
|
|
70177
70410
|
}
|
|
70178
70411
|
for (const base of getLspServerAdditionalPathBases(process.cwd())) {
|
|
70179
70412
|
for (const suffix of exts) {
|
|
70180
|
-
if (
|
|
70413
|
+
if (existsSync28(join29(base, cmd + suffix))) {
|
|
70181
70414
|
return true;
|
|
70182
70415
|
}
|
|
70183
70416
|
}
|
|
@@ -70239,7 +70472,7 @@ function getInstalledLspServers() {
|
|
|
70239
70472
|
|
|
70240
70473
|
// src/cli/doctor/checks/tools-mcp.ts
|
|
70241
70474
|
init_shared();
|
|
70242
|
-
import { existsSync as
|
|
70475
|
+
import { existsSync as existsSync29, readFileSync as readFileSync26 } from "fs";
|
|
70243
70476
|
import { homedir as homedir8 } from "os";
|
|
70244
70477
|
import { join as join30 } from "path";
|
|
70245
70478
|
var BUILTIN_MCP_SERVERS = ["context7", "grep_app"];
|
|
@@ -70253,10 +70486,10 @@ function getMcpConfigPaths() {
|
|
|
70253
70486
|
function loadUserMcpConfig() {
|
|
70254
70487
|
const servers = {};
|
|
70255
70488
|
for (const configPath of getMcpConfigPaths()) {
|
|
70256
|
-
if (!
|
|
70489
|
+
if (!existsSync29(configPath))
|
|
70257
70490
|
continue;
|
|
70258
70491
|
try {
|
|
70259
|
-
const content =
|
|
70492
|
+
const content = readFileSync26(configPath, "utf-8");
|
|
70260
70493
|
const config2 = parseJsonc(content);
|
|
70261
70494
|
if (config2.mcpServers) {
|
|
70262
70495
|
Object.assign(servers, config2.mcpServers);
|
|
@@ -70679,8 +70912,8 @@ async function doctor(options = { mode: "default" }) {
|
|
|
70679
70912
|
|
|
70680
70913
|
// src/features/mcp-oauth/storage.ts
|
|
70681
70914
|
init_shared();
|
|
70682
|
-
import { chmodSync, existsSync as
|
|
70683
|
-
import { dirname as
|
|
70915
|
+
import { chmodSync, existsSync as existsSync30, mkdirSync as mkdirSync7, readFileSync as readFileSync27, unlinkSync as unlinkSync4, writeFileSync as writeFileSync10 } from "fs";
|
|
70916
|
+
import { dirname as dirname8, join as join31 } from "path";
|
|
70684
70917
|
var STORAGE_FILE_NAME = "mcp-oauth.json";
|
|
70685
70918
|
function getMcpOauthStoragePath() {
|
|
70686
70919
|
return join31(getOpenCodeConfigDir({ binary: "opencode" }), STORAGE_FILE_NAME);
|
|
@@ -70720,11 +70953,11 @@ function buildKey(serverHost, resource) {
|
|
|
70720
70953
|
}
|
|
70721
70954
|
function readStore() {
|
|
70722
70955
|
const filePath = getMcpOauthStoragePath();
|
|
70723
|
-
if (!
|
|
70956
|
+
if (!existsSync30(filePath)) {
|
|
70724
70957
|
return null;
|
|
70725
70958
|
}
|
|
70726
70959
|
try {
|
|
70727
|
-
const content =
|
|
70960
|
+
const content = readFileSync27(filePath, "utf-8");
|
|
70728
70961
|
return JSON.parse(content);
|
|
70729
70962
|
} catch {
|
|
70730
70963
|
return null;
|
|
@@ -70733,11 +70966,11 @@ function readStore() {
|
|
|
70733
70966
|
function writeStore(store2) {
|
|
70734
70967
|
const filePath = getMcpOauthStoragePath();
|
|
70735
70968
|
try {
|
|
70736
|
-
const dir =
|
|
70737
|
-
if (!
|
|
70969
|
+
const dir = dirname8(filePath);
|
|
70970
|
+
if (!existsSync30(dir)) {
|
|
70738
70971
|
mkdirSync7(dir, { recursive: true });
|
|
70739
70972
|
}
|
|
70740
|
-
|
|
70973
|
+
writeFileSync10(filePath, JSON.stringify(store2, null, 2), { encoding: "utf-8", mode: 384 });
|
|
70741
70974
|
chmodSync(filePath, 384);
|
|
70742
70975
|
return true;
|
|
70743
70976
|
} catch {
|
|
@@ -70769,7 +71002,7 @@ function deleteToken(serverHost, resource) {
|
|
|
70769
71002
|
if (Object.keys(store2).length === 0) {
|
|
70770
71003
|
try {
|
|
70771
71004
|
const filePath = getMcpOauthStoragePath();
|
|
70772
|
-
if (
|
|
71005
|
+
if (existsSync30(filePath)) {
|
|
70773
71006
|
unlinkSync4(filePath);
|
|
70774
71007
|
}
|
|
70775
71008
|
return true;
|
|
@@ -71196,14 +71429,17 @@ class McpOAuthProvider {
|
|
|
71196
71429
|
}
|
|
71197
71430
|
|
|
71198
71431
|
// src/cli/mcp-oauth/login.ts
|
|
71199
|
-
|
|
71432
|
+
var defaultLoginDependencies = {
|
|
71433
|
+
createProvider: (options) => new McpOAuthProvider(options)
|
|
71434
|
+
};
|
|
71435
|
+
async function login(serverName, options, deps = defaultLoginDependencies) {
|
|
71200
71436
|
try {
|
|
71201
71437
|
const serverUrl = options.serverUrl;
|
|
71202
71438
|
if (!serverUrl) {
|
|
71203
71439
|
console.error(`Error: --server-url is required for server "${serverName}"`);
|
|
71204
71440
|
return 1;
|
|
71205
71441
|
}
|
|
71206
|
-
const provider =
|
|
71442
|
+
const provider = deps.createProvider({
|
|
71207
71443
|
serverUrl,
|
|
71208
71444
|
clientId: options.clientId,
|
|
71209
71445
|
scopes: options.scopes
|