mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:28:28 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { canonicalizeMainSessionAlias, resolveAgentMainSessionKey } from "../../config/sessions.js";
|
||||
import { resolveSessionAgentId } from "../agent-scope.js";
|
||||
import { expandToolGroups } from "../tool-policy.js";
|
||||
@@ -13,7 +13,10 @@ function shouldSandboxSession(cfg: SandboxConfig, sessionKey: string, mainSessio
|
||||
return sessionKey.trim() !== mainSessionKey.trim();
|
||||
}
|
||||
|
||||
function resolveMainSessionKeyForSandbox(params: { cfg?: MoltbotConfig; agentId: string }): string {
|
||||
function resolveMainSessionKeyForSandbox(params: {
|
||||
cfg?: OpenClawConfig;
|
||||
agentId: string;
|
||||
}): string {
|
||||
if (params.cfg?.session?.scope === "global") return "global";
|
||||
return resolveAgentMainSessionKey({
|
||||
cfg: params.cfg,
|
||||
@@ -22,7 +25,7 @@ function resolveMainSessionKeyForSandbox(params: { cfg?: MoltbotConfig; agentId:
|
||||
}
|
||||
|
||||
function resolveComparableSessionKeyForSandbox(params: {
|
||||
cfg?: MoltbotConfig;
|
||||
cfg?: OpenClawConfig;
|
||||
agentId: string;
|
||||
sessionKey: string;
|
||||
}): string {
|
||||
@@ -33,7 +36,10 @@ function resolveComparableSessionKeyForSandbox(params: {
|
||||
});
|
||||
}
|
||||
|
||||
export function resolveSandboxRuntimeStatus(params: { cfg?: MoltbotConfig; sessionKey?: string }): {
|
||||
export function resolveSandboxRuntimeStatus(params: {
|
||||
cfg?: OpenClawConfig;
|
||||
sessionKey?: string;
|
||||
}): {
|
||||
agentId: string;
|
||||
sessionKey: string;
|
||||
mainSessionKey: string;
|
||||
@@ -67,7 +73,7 @@ export function resolveSandboxRuntimeStatus(params: { cfg?: MoltbotConfig; sessi
|
||||
}
|
||||
|
||||
export function formatSandboxToolPolicyBlockedMessage(params: {
|
||||
cfg?: MoltbotConfig;
|
||||
cfg?: OpenClawConfig;
|
||||
sessionKey?: string;
|
||||
toolName: string;
|
||||
}): string | undefined {
|
||||
@@ -111,7 +117,7 @@ export function formatSandboxToolPolicyBlockedMessage(params: {
|
||||
lines.push(`- Use main session key (direct): ${runtime.mainSessionKey}`);
|
||||
}
|
||||
lines.push(
|
||||
`- See: ${formatCliCommand(`moltbot sandbox explain --session ${runtime.sessionKey}`)}`,
|
||||
`- See: ${formatCliCommand(`openclaw sandbox explain --session ${runtime.sessionKey}`)}`,
|
||||
);
|
||||
|
||||
return lines.join("\n");
|
||||
|
||||
Reference in New Issue
Block a user