feat: prepare Zhinian desktop pilot
This commit is contained in:
@@ -28,6 +28,8 @@ export interface YinianInitializationStatus {
|
||||
const INTERNAL_PROVIDER_KEY = 'minimax';
|
||||
const INTERNAL_MODEL_ID = 'MiniMax-M2.7';
|
||||
const INTERNAL_MODEL_REF = `${INTERNAL_PROVIDER_KEY}/${INTERNAL_MODEL_ID}`;
|
||||
const INTERNAL_MODEL_TIMEOUT_SECONDS = 300;
|
||||
const DESKTOP_TOOLS_PROFILE = 'coding';
|
||||
let initializationInFlight: Promise<YinianInitializationStatus> | null = null;
|
||||
|
||||
const DEFAULT_STEPS: YinianInitializationStep[] = [
|
||||
@@ -143,10 +145,12 @@ async function seedInternalModelConfig(): Promise<void> {
|
||||
const config = await readJsonFile(configPath);
|
||||
const models = asObject(config.models);
|
||||
const providers = asObject(models.providers);
|
||||
const pricing = asObject(models.pricing);
|
||||
providers[INTERNAL_PROVIDER_KEY] = {
|
||||
baseUrl: 'https://api.minimaxi.com/anthropic',
|
||||
api: 'anthropic-messages',
|
||||
authHeader: true,
|
||||
timeoutSeconds: INTERNAL_MODEL_TIMEOUT_SECONDS,
|
||||
models: [
|
||||
{
|
||||
id: INTERNAL_MODEL_ID,
|
||||
@@ -158,10 +162,19 @@ async function seedInternalModelConfig(): Promise<void> {
|
||||
},
|
||||
],
|
||||
};
|
||||
pricing.enabled = false;
|
||||
models.mode = 'merge';
|
||||
models.providers = providers;
|
||||
models.pricing = pricing;
|
||||
config.models = models;
|
||||
|
||||
const tools = asObject(config.tools);
|
||||
tools.profile = DESKTOP_TOOLS_PROFILE;
|
||||
const sessions = asObject(tools.sessions);
|
||||
sessions.visibility = 'all';
|
||||
tools.sessions = sessions;
|
||||
config.tools = tools;
|
||||
|
||||
const agents = asObject(config.agents);
|
||||
const defaults = asObject(agents.defaults);
|
||||
defaults.model = {
|
||||
@@ -169,6 +182,11 @@ async function seedInternalModelConfig(): Promise<void> {
|
||||
fallbacks: ['minimax/MiniMax-M2.5'],
|
||||
};
|
||||
defaults.workspace = join(homedir(), '.openclaw', 'workspace');
|
||||
defaults.skills = [];
|
||||
defaults.heartbeat = {
|
||||
...asObject(defaults.heartbeat),
|
||||
every: '0m',
|
||||
};
|
||||
agents.defaults = defaults;
|
||||
if (!Array.isArray(agents.list)) {
|
||||
agents.list = [
|
||||
@@ -178,8 +196,23 @@ async function seedInternalModelConfig(): Promise<void> {
|
||||
default: true,
|
||||
workspace: join(homedir(), '.openclaw', 'workspace'),
|
||||
agentDir: '~/.openclaw/agents/main/agent',
|
||||
skills: [],
|
||||
tools: { profile: DESKTOP_TOOLS_PROFILE },
|
||||
},
|
||||
];
|
||||
} else {
|
||||
agents.list = agents.list.map((entry) => {
|
||||
const agent = asObject(entry);
|
||||
if (agent.id !== 'main') return entry;
|
||||
return {
|
||||
...agent,
|
||||
skills: Array.isArray(agent.skills) ? agent.skills : [],
|
||||
tools: {
|
||||
...asObject(agent.tools),
|
||||
profile: DESKTOP_TOOLS_PROFILE,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
config.agents = agents;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user