/** * Builds the Crewly teams of a solution bundle. * * Mirrors `TemplateService.createTeamFromTemplate` (members per role, * hierarchy wiring) with what bundles need on top: placeholder filling, * deterministic team ids (so every re-run and the CLI find the same team), * ASCII session names like the onboarding starters, and one runtime for * every member. * * @module services/bundle/bundle-team.builder */ import type { Team, TeamMember } from '../../types/index.js'; import type { BundleTemplate } from '../../types/solution-bundle.types.js'; import type { NormalizedBundleTeam } from './bundle-manifest.js'; import { type BundleAnswers } from './bundle-placeholders.js'; /** * Lower-case ASCII slug. * * @param value - Any text * @returns Slug (may be empty for non-ASCII text) */ export declare function toSlug(value: string): string; /** * The deterministic id of a bundle team: the template id for the main * team, `--` for extra teams. * * @param templateId - Template id * @param teamKey - Team key * @returns Team id */ export declare function bundleTeamId(templateId: string, teamKey: string): string; /** * The member name of the n-th member of a role. * * @param defaultName - Role default name * @param count - Members in the role * @param index - 0-based index * @returns Name (`Writer`, or `Writer1`, `Writer2` …) */ export declare function memberNameFor(defaultName: string, count: number, index: number): string; /** * Values for a team's placeholders: the answers plus the built-ins. * * @param answers - Owner answers * @param teamName - Filled team name * @param leadName - The lead member's name * @returns Placeholder values */ export declare function teamPlaceholderValues(answers: BundleAnswers, teamName: string, leadName: string): BundleAnswers; /** Input of {@link buildBundleTeam}. */ export interface BuildBundleTeamInput { template: BundleTemplate; team: NormalizedBundleTeam; answers: BundleAnswers; runtime: string; now: Date; } /** * Build one bundle team (not saved). * * @param input - Template, normalized team, answers, runtime, clock * @returns The team, ready for `StorageService.saveTeam` * @throws BundlePlaceholderError when a text keeps an unfilled placeholder */ export declare function buildBundleTeam(input: BuildBundleTeamInput): Team; /** * Find the member a ref names in a built team. * * @param team - Saved team * @param role - Role id (the first member of the role is returned) * @returns The member, or undefined */ export declare function memberForRole(team: Team, role: string): TeamMember | undefined; /** * The session name a member runs under (its permanent agent id). * * @param member - Member * @returns Session name */ export declare function memberSession(member: TeamMember): string; //# sourceMappingURL=bundle-team.builder.d.ts.map