feat: add elevated bash mode

This commit is contained in:
Peter Steinberger
2026-01-04 05:15:42 +00:00
parent b978cc4e91
commit fe0b3500cc
29 changed files with 509 additions and 7 deletions

View File

@@ -309,6 +309,7 @@ export const SessionsPatchParamsSchema = Type.Object(
key: NonEmptyString,
thinkingLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
verboseLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
elevatedLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
model: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
sendPolicy: Type.Optional(
Type.Union([Type.Literal("allow"), Type.Literal("deny"), Type.Null()]),

View File

@@ -18,6 +18,7 @@ import {
} from "../agents/pi-embedded.js";
import { normalizeGroupActivation } from "../auto-reply/group-activation.js";
import {
normalizeElevatedLevel,
normalizeThinkLevel,
normalizeVerboseLevel,
} from "../auto-reply/thinking.js";
@@ -384,6 +385,25 @@ export function createBridgeHandlers(ctx: BridgeHandlersContext) {
}
}
if ("elevatedLevel" in p) {
const raw = p.elevatedLevel;
if (raw === null) {
delete next.elevatedLevel;
} else if (raw !== undefined) {
const normalized = normalizeElevatedLevel(String(raw));
if (!normalized) {
return {
ok: false,
error: {
code: ErrorCodes.INVALID_REQUEST,
message: `invalid elevatedLevel: ${String(raw)}`,
},
};
}
next.elevatedLevel = normalized;
}
}
if ("model" in p) {
const raw = p.model;
if (raw === null) {

View File

@@ -36,6 +36,7 @@ export type GatewaySessionRow = {
abortedLastRun?: boolean;
thinkingLevel?: string;
verboseLevel?: string;
elevatedLevel?: string;
sendPolicy?: "allow" | "deny";
inputTokens?: number;
outputTokens?: number;
@@ -276,6 +277,7 @@ export function listSessionsFromStore(params: {
abortedLastRun: entry?.abortedLastRun,
thinkingLevel: entry?.thinkingLevel,
verboseLevel: entry?.verboseLevel,
elevatedLevel: entry?.elevatedLevel,
sendPolicy: entry?.sendPolicy,
inputTokens: entry?.inputTokens,
outputTokens: entry?.outputTokens,