export function createSubagentStartHandler(store) {
    return async (payload) => {
        const body = payload.body;
        const agentId = String(body?.agent_id ?? body?.agentId ?? 'unknown');
        const agentType = String(body?.agent_type ?? body?.agentType ?? 'unknown');
        const sessionId = payload.sessionId;
        store.updateAgent({
            agentId,
            agentType,
            sessionId,
            startedAt: new Date().toISOString(),
        });
        return { status: 200, body: {} };
    };
}
export function createSubagentStopHandler(store) {
    return async (payload) => {
        const body = payload.body;
        const agentId = String(body?.agent_id ?? body?.agentId ?? 'unknown');
        const agentType = String(body?.agent_type ?? body?.agentType ?? 'unknown');
        const sessionId = payload.sessionId;
        store.updateAgent({
            agentId,
            agentType,
            sessionId,
            stoppedAt: new Date().toISOString(),
        });
        return { status: 200, body: {} };
    };
}
//# sourceMappingURL=subagent-lifecycle.js.map