feat(plugin-handlers): wire team-mode into agent, command and tool config handlers
This commit is contained in:
@@ -172,6 +172,7 @@ export async function applyAgentConfig(params: {
|
|||||||
disabledSkills,
|
disabledSkills,
|
||||||
useTaskSystem,
|
useTaskSystem,
|
||||||
disableOmoEnv,
|
disableOmoEnv,
|
||||||
|
params.pluginConfig.team_mode?.enabled ?? false,
|
||||||
);
|
);
|
||||||
|
|
||||||
const disabledAgentNames = new Set(
|
const disabledAgentNames = new Set(
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export async function applyCommandConfig(params: {
|
|||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
const builtinCommands = loadBuiltinCommands(params.pluginConfig.disabled_commands, {
|
const builtinCommands = loadBuiltinCommands(params.pluginConfig.disabled_commands, {
|
||||||
useRegisteredAgents: true,
|
useRegisteredAgents: true,
|
||||||
|
teamModeEnabled: params.pluginConfig.team_mode?.enabled ?? false,
|
||||||
});
|
});
|
||||||
const systemCommands = (params.config.command as Record<string, unknown>) ?? {};
|
const systemCommands = (params.config.command as Record<string, unknown>) ?? {};
|
||||||
|
|
||||||
|
|||||||
@@ -265,6 +265,20 @@ describe("applyToolConfig", () => {
|
|||||||
expect(agent.permission["task_*"]).toBe("allow")
|
expect(agent.permission["task_*"]).toBe("allow")
|
||||||
expect(agent.permission.teammate).toBe("allow")
|
expect(agent.permission.teammate).toBe("allow")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("#then should allow teammate for hephaestus", () => {
|
||||||
|
// given
|
||||||
|
const params = createParams({ agents: ["hephaestus"] })
|
||||||
|
|
||||||
|
// when
|
||||||
|
applyToolConfig(params)
|
||||||
|
|
||||||
|
// then
|
||||||
|
const agent = params.agentResult.hephaestus as {
|
||||||
|
permission: Record<string, unknown>
|
||||||
|
}
|
||||||
|
expect(agent.permission.teammate).toBe("allow")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("#given disabled_tools includes 'question'", () => {
|
describe("#given disabled_tools includes 'question'", () => {
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ export function applyToolConfig(params: {
|
|||||||
call_omo_agent: "deny",
|
call_omo_agent: "deny",
|
||||||
task: "allow",
|
task: "allow",
|
||||||
question: questionPermission,
|
question: questionPermission,
|
||||||
|
teammate: "allow",
|
||||||
...denyTodoTools,
|
...denyTodoTools,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user