Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/cloud-agent-profile/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export {
setDefaultProfile,
clearDefaultProfile,
getDefaultProfile,
getProfileByName,
getProfileIdByName,
getEffectiveDefaultProfileId,
} from './profile-service';

Expand Down
40 changes: 0 additions & 40 deletions packages/cloud-agent-profile/src/profile-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,46 +308,6 @@ export async function getDefaultProfile(
return getProfile(db, profile.id, owner);
}

/**
* Get a profile by name for an owner.
* Used for profile resolution in the prepare session API.
*/
export async function getProfileByName(
db: WorkerDb,
name: string,
owner: ProfileOwner
): Promise<ProfileResponse | null> {
const [profile] = await db
.select()
.from(agent_environment_profiles)
.where(and(buildOwnershipCondition(owner), eq(agent_environment_profiles.name, name)))
.limit(1);

if (!profile) {
return null;
}

return getProfile(db, profile.id, owner);
}

/**
* Get profile ID by name for an owner.
* Returns null if not found.
*/
export async function getProfileIdByName(
db: WorkerDb,
name: string,
owner: ProfileOwner
): Promise<string | null> {
const [profile] = await db
.select({ id: agent_environment_profiles.id })
.from(agent_environment_profiles)
.where(and(buildOwnershipCondition(owner), eq(agent_environment_profiles.name, name)))
.limit(1);

return profile?.id ?? null;
}

/**
* Get the effective default profile ID for a user in org context.
* Personal default takes precedence over org default — a user-specific
Expand Down