chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -112,9 +112,7 @@ export async function sandboxExplainCommand(
|
||||
): Promise<void> {
|
||||
const cfg = loadConfig();
|
||||
|
||||
const defaultAgentId = resolveAgentIdFromSessionKey(
|
||||
resolveMainSessionKey(cfg),
|
||||
);
|
||||
const defaultAgentId = resolveAgentIdFromSessionKey(resolveMainSessionKey(cfg));
|
||||
const resolvedAgentId = normalizeAgentId(
|
||||
opts.agent?.trim()
|
||||
? opts.agent
|
||||
@@ -155,9 +153,7 @@ export async function sandboxExplainCommand(
|
||||
const elevatedAgentEnabled = elevatedAgent?.enabled !== false;
|
||||
const elevatedEnabled = elevatedGlobalEnabled && elevatedAgentEnabled;
|
||||
|
||||
const globalAllow = channel
|
||||
? elevatedGlobal?.allowFrom?.[channel]
|
||||
: undefined;
|
||||
const globalAllow = channel ? elevatedGlobal?.allowFrom?.[channel] : undefined;
|
||||
const agentAllow = channel ? elevatedAgent?.allowFrom?.[channel] : undefined;
|
||||
|
||||
const allowTokens = (values?: Array<string | number>) =>
|
||||
@@ -236,8 +232,7 @@ export async function sandboxExplainCommand(
|
||||
alwaysAllowedByConfig: elevatedAlwaysAllowedByConfig,
|
||||
allowFrom: {
|
||||
global: channel ? globalAllowTokens : undefined,
|
||||
agent:
|
||||
elevatedAgent?.allowFrom && channel ? agentAllowTokens : undefined,
|
||||
agent: elevatedAgent?.allowFrom && channel ? agentAllowTokens : undefined,
|
||||
},
|
||||
failures: elevatedFailures,
|
||||
},
|
||||
@@ -264,9 +259,7 @@ export async function sandboxExplainCommand(
|
||||
lines.push(` ${key("sessionKey:")} ${value(payload.sessionKey)}`);
|
||||
lines.push(` ${key("mainSessionKey:")} ${value(payload.mainSessionKey)}`);
|
||||
lines.push(
|
||||
` ${key("runtime:")} ${
|
||||
payload.sandbox.sessionIsSandboxed ? warn("sandboxed") : ok("direct")
|
||||
}`,
|
||||
` ${key("runtime:")} ${payload.sandbox.sessionIsSandboxed ? warn("sandboxed") : ok("direct")}`,
|
||||
);
|
||||
lines.push(
|
||||
` ${key("mode:")} ${value(payload.sandbox.mode)} ${key("scope:")} ${value(
|
||||
@@ -293,12 +286,8 @@ export async function sandboxExplainCommand(
|
||||
lines.push("");
|
||||
lines.push(heading("Elevated:"));
|
||||
lines.push(` ${key("enabled:")} ${bool(payload.elevated.enabled)}`);
|
||||
lines.push(
|
||||
` ${key("channel:")} ${value(payload.elevated.channel ?? "(unknown)")}`,
|
||||
);
|
||||
lines.push(
|
||||
` ${key("allowedByConfig:")} ${bool(payload.elevated.allowedByConfig)}`,
|
||||
);
|
||||
lines.push(` ${key("channel:")} ${value(payload.elevated.channel ?? "(unknown)")}`);
|
||||
lines.push(` ${key("allowedByConfig:")} ${bool(payload.elevated.allowedByConfig)}`);
|
||||
if (payload.elevated.failures.length > 0) {
|
||||
lines.push(
|
||||
` ${key("failing gates:")} ${warn(
|
||||
@@ -306,10 +295,7 @@ export async function sandboxExplainCommand(
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
if (
|
||||
payload.sandbox.mode === "non-main" &&
|
||||
payload.sandbox.sessionIsSandboxed
|
||||
) {
|
||||
if (payload.sandbox.mode === "non-main" && payload.sandbox.sessionIsSandboxed) {
|
||||
lines.push("");
|
||||
lines.push(
|
||||
`${warn("Hint:")} sandbox mode is non-main; use main session key to run direct: ${value(
|
||||
@@ -321,9 +307,7 @@ export async function sandboxExplainCommand(
|
||||
lines.push(heading("Fix-it:"));
|
||||
for (const key of payload.fixIt) lines.push(` - ${key}`);
|
||||
lines.push("");
|
||||
lines.push(
|
||||
`${key("Docs:")} ${formatDocsLink("/sandbox", "docs.clawd.bot/sandbox")}`,
|
||||
);
|
||||
lines.push(`${key("Docs:")} ${formatDocsLink("/sandbox", "docs.clawd.bot/sandbox")}`);
|
||||
|
||||
runtime.log(`${lines.join("\n")}\n`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user