import { generateId } from "@inkeep/agents-core";

//#region src/domains/run/utils/agent-operations.ts
/**
* Creates an agent initializing operation
*/
function agentInitializingOp(sessionId, agentId) {
	return {
		type: "agent_initializing",
		details: {
			sessionId,
			agentId
		}
	};
}
/**
* Creates a completion operation
*/
function completionOp(subAgentId, iterations) {
	return {
		type: "completion",
		details: {
			agent: subAgentId,
			iteration: iterations
		}
	};
}
/**
* Creates a unified error event
* @param message - Error message
* @param subAgentId - Optional agent ID for context
* @param severity - Error severity level
* @param code - Optional error code
*/
function errorOp(message, subAgentId, severity = "error", code) {
	return {
		type: "error",
		message,
		agent: subAgentId,
		severity,
		code,
		timestamp: Date.now()
	};
}
/**
* Generate a unique tool execution ID for lifecycle tracking
*/
function generateToolId() {
	return `tool_${generateId(8)}`;
}

//#endregion
export { agentInitializingOp, completionOp, errorOp, generateToolId };