mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:27:38 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent";
|
||||
import { Type } from "@sinclair/typebox";
|
||||
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { resolveUserPath } from "../../utils.js";
|
||||
import { loadWebMedia } from "../../web/media.js";
|
||||
import { ensureAuthProfileStore, listProfilesForProvider } from "../auth-profiles.js";
|
||||
@@ -20,7 +20,7 @@ import { minimaxUnderstandImage } from "../minimax-vlm.js";
|
||||
import { getApiKeyForModel, requireApiKey, resolveEnvApiKey } from "../model-auth.js";
|
||||
import { runWithImageModelFallback } from "../model-fallback.js";
|
||||
import { resolveConfiguredModelRef } from "../model-selection.js";
|
||||
import { ensureMoltbotModelsJson } from "../models-config.js";
|
||||
import { ensureOpenClawModelsJson } from "../models-config.js";
|
||||
import { assertSandboxPath } from "../sandbox-paths.js";
|
||||
import type { AnyAgentTool } from "./common.js";
|
||||
import {
|
||||
@@ -38,7 +38,7 @@ export const __testing = {
|
||||
coerceImageAssistantText,
|
||||
} as const;
|
||||
|
||||
function resolveDefaultModelRef(cfg?: MoltbotConfig): {
|
||||
function resolveDefaultModelRef(cfg?: OpenClawConfig): {
|
||||
provider: string;
|
||||
model: string;
|
||||
} {
|
||||
@@ -70,7 +70,7 @@ function hasAuthForProvider(params: { provider: string; agentDir: string }): boo
|
||||
* - fall back to OpenAI/Anthropic when available
|
||||
*/
|
||||
export function resolveImageModelConfigForTool(params: {
|
||||
cfg?: MoltbotConfig;
|
||||
cfg?: OpenClawConfig;
|
||||
agentDir: string;
|
||||
}): ImageModelConfig | null {
|
||||
// Note: We intentionally do NOT gate based on primarySupportsImages here.
|
||||
@@ -148,7 +148,7 @@ export function resolveImageModelConfigForTool(params: {
|
||||
return null;
|
||||
}
|
||||
|
||||
function pickMaxBytes(cfg?: MoltbotConfig, maxBytesMb?: number): number | undefined {
|
||||
function pickMaxBytes(cfg?: OpenClawConfig, maxBytesMb?: number): number | undefined {
|
||||
if (typeof maxBytesMb === "number" && Number.isFinite(maxBytesMb) && maxBytesMb > 0) {
|
||||
return Math.floor(maxBytesMb * 1024 * 1024);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ async function resolveSandboxedImagePath(params: {
|
||||
}
|
||||
|
||||
async function runImagePrompt(params: {
|
||||
cfg?: MoltbotConfig;
|
||||
cfg?: OpenClawConfig;
|
||||
agentDir: string;
|
||||
imageModelConfig: ImageModelConfig;
|
||||
modelOverride?: string;
|
||||
@@ -219,7 +219,7 @@ async function runImagePrompt(params: {
|
||||
model: string;
|
||||
attempts: Array<{ provider: string; model: string; error: string }>;
|
||||
}> {
|
||||
const effectiveCfg: MoltbotConfig | undefined = params.cfg
|
||||
const effectiveCfg: OpenClawConfig | undefined = params.cfg
|
||||
? {
|
||||
...params.cfg,
|
||||
agents: {
|
||||
@@ -232,7 +232,7 @@ async function runImagePrompt(params: {
|
||||
}
|
||||
: undefined;
|
||||
|
||||
await ensureMoltbotModelsJson(effectiveCfg, params.agentDir);
|
||||
await ensureOpenClawModelsJson(effectiveCfg, params.agentDir);
|
||||
const authStorage = discoverAuthStorage(params.agentDir);
|
||||
const modelRegistry = discoverModels(authStorage, params.agentDir);
|
||||
|
||||
@@ -293,7 +293,7 @@ async function runImagePrompt(params: {
|
||||
}
|
||||
|
||||
export function createImageTool(options?: {
|
||||
config?: MoltbotConfig;
|
||||
config?: OpenClawConfig;
|
||||
agentDir?: string;
|
||||
sandboxRoot?: string;
|
||||
/** If true, the model has native vision capability and images in the prompt are auto-injected */
|
||||
|
||||
Reference in New Issue
Block a user