diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index 6888caf5d19..9a25e3e1b38 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -1623,17 +1623,21 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper const { visible, defaultAgent } = filterVisibleAgents(agents) + const mapAgent = (a: (typeof agents)[number]) => ({ + name: a.name, + displayName: a.displayName, + description: a.description, + mode: a.mode, + native: a.native, + color: a.color, + deprecated: a.deprecated, + permission: a.permission, + }) + const message = { type: "agentsLoaded", - agents: visible.map((a) => ({ - name: a.name, - displayName: a.displayName, - description: a.description, - mode: a.mode, - native: a.native, - color: a.color, - deprecated: a.deprecated, - })), + agents: visible.map(mapAgent), + allAgents: agents.map(mapAgent), defaultAgent, } this.cachedAgentsMessage = message diff --git a/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx b/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx index 5349789bae3..722021f8007 100644 --- a/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx @@ -82,7 +82,7 @@ const AgentBehaviourTab: Component = () => { }) const agentNames = createMemo(() => { - const names = session.agents().map((a) => a.name) + const names = session.allAgents().map((a) => a.name) // Also include any agents from config that might not be in the agent list const agents = Object.keys(config().agent ?? {}) for (const name of agents) { @@ -185,7 +185,7 @@ const AgentBehaviourTab: Component = () => { )) } - const removableModes = createMemo(() => session.agents().filter((a) => !a.native)) + const removableModes = createMemo(() => session.allAgents().filter((a) => !a.native)) const confirmRemoveMode = (agent: AgentInfo) => { dialog.show(() => ( @@ -354,7 +354,7 @@ const AgentBehaviourTab: Component = () => { {(name, index) => { - const agent = () => session.agents().find((a) => a.name === name) + const agent = () => session.allAgents().find((a) => a.name === name) const isCustom = () => !agent()?.native const agentCfg = () => config().agent?.[name] ?? {} const disabled = () => agentCfg().disable ?? false @@ -396,6 +396,19 @@ const AgentBehaviourTab: Component = () => { custom + + + {language.t("settings.agentBehaviour.badge.subagent")} + + = (props) => { // agent() may be undefined for modes that only exist in the config draft (just // created, not yet saved). This is fine — native defaults to false (correct for // custom modes) and all fields read from cfg() which comes from config context. - const agent = () => session.agents().find((a) => a.name === props.name) + const agent = () => session.allAgents().find((a) => a.name === props.name) const native = () => agent()?.native ?? false + const [expanded, setExpanded] = createSignal(false) const cfg = createMemo(() => config().agent?.[props.name] ?? {}) @@ -230,6 +231,11 @@ const ModeEditView: Component = (props) => { + {/* Calculated permissions (read-only, collapsible) */} + + setExpanded((v) => !v)} /> + +