antigravity2api2 / src /utils /idGenerator.js
lin7zhi's picture
Upload folder using huggingface_hub
97ec0e5 verified
raw
history blame contribute delete
806 Bytes
import { randomUUID } from 'crypto';
function generateRequestId() {
return `agent-${randomUUID()}`;
}
function generateSessionId() {
return String(-Math.floor(Math.random() * 9e18));
}
function generateProjectId() {
const adjectives = ['useful', 'bright', 'swift', 'calm', 'bold'];
const nouns = ['fuze', 'wave', 'spark', 'flow', 'core'];
const randomAdj = adjectives[Math.floor(Math.random() * adjectives.length)];
const randomNoun = nouns[Math.floor(Math.random() * nouns.length)];
const randomNum = Math.random().toString(36).substring(2, 7);
return `${randomAdj}-${randomNoun}-${randomNum}`;
}
function generateToolCallId() {
return `call_${randomUUID().replace(/-/g, '')}`;
}
export {
generateProjectId,
generateSessionId,
generateRequestId,
generateToolCallId
}