+ {slashCommands.length > 0 && ( +
No custom commands yet.
+ )} +/{command.name}
+ {command.subtask && (
+
+ Subtask
+
+ )}
+ {command.agent && (
+ agent: {command.agent}
+ )}
+ {command.model && (
+ model: {command.model}
+ )}
+ + {command.description} +
+ )} ++ {command.template} +
+[v.profileId, Number(v.count)])); const commandCountMap = new Map(commandCounts.map(c => [c.profileId, Number(c.count)])); const mcpServerCountMap = new Map(mcpServerCounts.map(m => [m.profileId, Number(m.count)])); const skillCountMap = new Map(skillCounts.map(s => [s.profileId, Number(s.count)])); const agentCountMap = new Map(agentCounts.map(a => [a.profileId, Number(a.count)])); + const kiloCommandCountMap = new Map(kiloCommandCounts.map(k => [k.profileId, Number(k.count)])); return profiles.map(p => ({ id: p.id, @@ -170,6 +182,7 @@ export async function listProfiles(db: WorkerDb, owner: ProfileOwner): Promise
{
const profile = await verifyProfileOwnership(db, profileId, owner);
- const [vars, commands, mcpServers, skills, agents] = await Promise.all([
+ const [vars, commands, mcpServers, skills, agents, kiloCommands] = await Promise.all([
db
.select({
key: agent_environment_profile_vars.key,
@@ -213,6 +226,7 @@ export async function getProfile(
listMcpServersForProfile(db, profileId),
listSkillsForProfile(db, profileId),
listAgentsForProfile(db, profileId),
+ listKiloCommandsForProfile(db, profileId),
]);
return {
@@ -227,6 +241,7 @@ export async function getProfile(
mcpServers,
skills,
agents,
+ kiloCommands,
};
}
diff --git a/packages/cloud-agent-profile/src/profile-session-config.ts b/packages/cloud-agent-profile/src/profile-session-config.ts
index fa019f1bb1..64dc28692b 100644
--- a/packages/cloud-agent-profile/src/profile-session-config.ts
+++ b/packages/cloud-agent-profile/src/profile-session-config.ts
@@ -15,6 +15,10 @@ import {
} from './profile-mcp-service';
import { getSkillsForSession, type SkillForSession } from './profile-skills-service';
import { getAgentsForSession, type AgentForSession } from './profile-agents-service';
+import {
+ getKiloCommandsForSession,
+ type KiloCommandForSession,
+} from './profile-kilo-commands-service';
import { resolveProfileLayers } from './profile-resolution';
import { buildOwnershipCondition } from './profile-utils';
import type { ProfileOwner } from './types';
@@ -42,6 +46,8 @@ export type MergedSkillForSession = {
export type MergedAgentForSession = AgentForSession;
+export type MergedKiloCommandForSession = KiloCommandForSession;
+
/**
* Permissive shape for an inline runtime skill supplied by the caller. The
* cloud-agent-next service validates a stricter shape at its API boundary;
@@ -94,6 +100,7 @@ export type MergeProfileConfigurationResult = {
mcpServers?: McpServerForSession[];
skills?: MergedSkillForSession[];
agents?: MergedAgentForSession[];
+ kiloCommands?: KiloCommandForSession[];
};
/** Ensure a profileId belongs to the given owner (or, for org context, to the user personally). */
@@ -140,6 +147,7 @@ type Layer = {
mcpServers: McpServerForSession[];
skills: SkillForSession[];
agents: AgentForSession[];
+ kiloCommands: KiloCommandForSession[];
};
type ProfileLayerData = {
@@ -148,6 +156,7 @@ type ProfileLayerData = {
mcpServers: McpServerForSession[];
skills: SkillForSession[];
agents: AgentForSession[];
+ kiloCommands: KiloCommandForSession[];
};
function profileToLayer(data: ProfileLayerData): Layer {
@@ -167,6 +176,7 @@ function profileToLayer(data: ProfileLayerData): Layer {
mcpServers: [...data.mcpServers],
skills: [...data.skills],
agents: [...data.agents],
+ kiloCommands: [...data.kiloCommands],
};
}
@@ -218,6 +228,11 @@ function inlineToLayer(args: MergeProfileConfigurationArgs): Layer | null {
files: s.files ?? {},
})),
agents: runtimeAgents ? [...runtimeAgents] : [],
+ // Inline kilo commands are not supported — there is no `runtimeKiloCommands`
+ // argument. Commands from resolved profiles flow through the DB query path
+ // above (profileToLayer). Unresolved pass-through handles commands supplied
+ // directly by the caller without merging.
+ kiloCommands: [],
};
}
@@ -236,6 +251,7 @@ function mergeLayers(layers: Layer[]): MergeProfileConfigurationResult {
const mcpByName = new Map