feat: add group activation command

This commit is contained in:
Peter Steinberger
2025-12-22 20:36:29 +01:00
parent 5d2d701e1e
commit f10c8f2b4c
13 changed files with 356 additions and 47 deletions

View File

@@ -14,6 +14,7 @@ import { DEFAULT_CONTEXT_TOKENS, DEFAULT_MODEL } from "../agents/defaults.js";
import { installSkill } from "../agents/skills-install.js";
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
import { DEFAULT_AGENT_WORKSPACE_DIR } from "../agents/workspace.js";
import { normalizeGroupActivation } from "../auto-reply/group-activation.js";
import {
normalizeThinkLevel,
normalizeVerboseLevel,
@@ -1996,6 +1997,25 @@ export async function startGatewayServer(
}
}
if ("groupActivation" in p) {
const raw = p.groupActivation;
if (raw === null) {
delete next.groupActivation;
} else if (raw !== undefined) {
const normalized = normalizeGroupActivation(String(raw));
if (!normalized) {
return {
ok: false,
error: {
code: ErrorCodes.INVALID_REQUEST,
message: `invalid groupActivation: ${String(raw)}`,
},
};
}
next.groupActivation = normalized;
}
}
if ("syncing" in p) {
const raw = p.syncing;
if (raw === null) {
@@ -4280,6 +4300,27 @@ export async function startGatewayServer(
}
}
if ("groupActivation" in p) {
const raw = p.groupActivation;
if (raw === null) {
delete next.groupActivation;
} else if (raw !== undefined) {
const normalized = normalizeGroupActivation(String(raw));
if (!normalized) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
'invalid groupActivation (use "mention"|"always")',
),
);
break;
}
next.groupActivation = normalized;
}
}
if ("syncing" in p) {
const raw = p.syncing;
if (raw === null) {