@openai/agents-core
Version:
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
31 lines • 908 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeUser = normalizeUser;
exports.normalizeGroup = normalizeGroup;
exports.normalizeEntryGroup = normalizeEntryGroup;
function normalizeUser(user) {
const name = (typeof user === 'string' ? user : user.name).trim();
if (!name) {
throw new Error('Sandbox user name must be non-empty.');
}
return { name };
}
function normalizeGroup(group) {
const name = group.name.trim();
if (!name) {
throw new Error('Sandbox group name must be non-empty.');
}
return {
name,
...(group.users
? { users: group.users.map((user) => normalizeUser(user)) }
: {}),
};
}
function normalizeEntryGroup(group) {
if ('users' in group) {
return normalizeGroup(group);
}
return normalizeUser(group);
}
//# sourceMappingURL=users.js.map