chatroom-cli 1.122.1 → 1.123.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +378 -30
- package/dist/index.js.map +26 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28478,8 +28478,149 @@ var init_agent_process_manager_service = __esm(() => {
|
|
|
28478
28478
|
init_check_agent_slot();
|
|
28479
28479
|
});
|
|
28480
28480
|
|
|
28481
|
+
// ../shared/src/domain/team-kind.ts
|
|
28482
|
+
var TEAM_PRESET_IDS;
|
|
28483
|
+
var init_team_kind = __esm(() => {
|
|
28484
|
+
TEAM_PRESET_IDS = ["duo", "solo"];
|
|
28485
|
+
});
|
|
28486
|
+
|
|
28481
28487
|
// ../shared/src/domain/agent-role.ts
|
|
28482
|
-
|
|
28488
|
+
function getBuiltinRolesForTeam(teamId) {
|
|
28489
|
+
const memberships = Object.values(AGENT_ROLE_DEFINITIONS).flatMap((definition) => {
|
|
28490
|
+
const membership = definition.teams.find((entry) => entry.teamId === teamId);
|
|
28491
|
+
return membership ? [{ role: definition.role, order: membership.order }] : [];
|
|
28492
|
+
});
|
|
28493
|
+
const roles = memberships.sort((left3, right3) => left3.order - right3.order).map(({ role }) => role);
|
|
28494
|
+
return roles;
|
|
28495
|
+
}
|
|
28496
|
+
function normalizeAgentRole(role) {
|
|
28497
|
+
return role.trim().toLowerCase();
|
|
28498
|
+
}
|
|
28499
|
+
function validateNormalizedRoleName(role) {
|
|
28500
|
+
const normalizedRole = normalizeAgentRole(role);
|
|
28501
|
+
if (normalizedRole.length === 0 || role !== normalizedRole) {
|
|
28502
|
+
throw new Error(`Agent role "${role}" must have a normalized nonempty name`);
|
|
28503
|
+
}
|
|
28504
|
+
return normalizedRole;
|
|
28505
|
+
}
|
|
28506
|
+
function validateRoleNotReserved(role, normalizedRole) {
|
|
28507
|
+
if (normalizedRole === "user" || normalizedRole === "enhancer") {
|
|
28508
|
+
throw new Error(`Agent role "${role}" is reserved or retired`);
|
|
28509
|
+
}
|
|
28510
|
+
}
|
|
28511
|
+
function registerUniqueRoleName(role, normalizedRole, roleNames) {
|
|
28512
|
+
if (roleNames.has(normalizedRole)) {
|
|
28513
|
+
throw new Error(`Agent role "${role}" duplicates normalized role "${normalizedRole}"`);
|
|
28514
|
+
}
|
|
28515
|
+
roleNames.add(normalizedRole);
|
|
28516
|
+
}
|
|
28517
|
+
function validateRoleName(role, roleNames) {
|
|
28518
|
+
const normalizedRole = validateNormalizedRoleName(role);
|
|
28519
|
+
validateRoleNotReserved(role, normalizedRole);
|
|
28520
|
+
registerUniqueRoleName(role, normalizedRole, roleNames);
|
|
28521
|
+
}
|
|
28522
|
+
function validateRoleLifecycle(definition) {
|
|
28523
|
+
const { role } = definition;
|
|
28524
|
+
if (!Array.isArray(definition.tags) || definition.tags.length !== 1 || !AGENT_ROLE_LIFECYCLE_TAGS.includes(definition.tags[0])) {
|
|
28525
|
+
throw new Error(`Agent role "${role}" must declare exactly one recognized lifecycle tag`);
|
|
28526
|
+
}
|
|
28527
|
+
}
|
|
28528
|
+
function validateKnownTeam(role, teamId) {
|
|
28529
|
+
if (!TEAM_PRESET_IDS.some((knownTeamId) => knownTeamId === teamId)) {
|
|
28530
|
+
throw new Error(`Agent role "${role}" has unknown team "${String(teamId)}"`);
|
|
28531
|
+
}
|
|
28532
|
+
}
|
|
28533
|
+
function validateUniqueRoleMembership(role, teamId, membershipsForRole) {
|
|
28534
|
+
if (membershipsForRole.has(teamId)) {
|
|
28535
|
+
throw new Error(`Agent role "${role}" has duplicate membership in team "${teamId}"`);
|
|
28536
|
+
}
|
|
28537
|
+
membershipsForRole.add(teamId);
|
|
28538
|
+
}
|
|
28539
|
+
function validateMembershipOrder(role, teamId, order) {
|
|
28540
|
+
if (!Number.isSafeInteger(order) || order < 0) {
|
|
28541
|
+
throw new Error(`Agent role "${role}" has invalid order "${String(order)}" for team "${teamId}"`);
|
|
28542
|
+
}
|
|
28543
|
+
}
|
|
28544
|
+
function registerUniqueTeamOrder(role, teamId, order, teamOrders) {
|
|
28545
|
+
const orders = teamOrders.get(teamId) ?? new Map;
|
|
28546
|
+
const conflictingRole = orders.get(order);
|
|
28547
|
+
if (conflictingRole !== undefined) {
|
|
28548
|
+
throw new Error(`Agent role "${role}" order ${order} for team "${teamId}" conflicts with role "${conflictingRole}"`);
|
|
28549
|
+
}
|
|
28550
|
+
orders.set(order, role);
|
|
28551
|
+
teamOrders.set(teamId, orders);
|
|
28552
|
+
}
|
|
28553
|
+
function validateMembership(role, membership, membershipsForRole, teamOrders) {
|
|
28554
|
+
const { teamId, order } = membership;
|
|
28555
|
+
validateKnownTeam(role, teamId);
|
|
28556
|
+
validateUniqueRoleMembership(role, teamId, membershipsForRole);
|
|
28557
|
+
validateMembershipOrder(role, teamId, order);
|
|
28558
|
+
registerUniqueTeamOrder(role, teamId, order, teamOrders);
|
|
28559
|
+
}
|
|
28560
|
+
function validateRoleMemberships(definition, teamOrders) {
|
|
28561
|
+
const { role, teams } = definition;
|
|
28562
|
+
if (!Array.isArray(teams) || teams.length === 0) {
|
|
28563
|
+
throw new Error(`Agent role "${role}" must declare at least one team membership`);
|
|
28564
|
+
}
|
|
28565
|
+
const membershipsForRole = new Set;
|
|
28566
|
+
for (const membership of teams) {
|
|
28567
|
+
validateMembership(role, membership, membershipsForRole, teamOrders);
|
|
28568
|
+
}
|
|
28569
|
+
}
|
|
28570
|
+
function validateAgentRoleDefinitions(definitions) {
|
|
28571
|
+
const roleNames = new Set;
|
|
28572
|
+
const teamOrders = new Map;
|
|
28573
|
+
for (const definition of definitions) {
|
|
28574
|
+
validateRoleName(definition.role, roleNames);
|
|
28575
|
+
validateRoleLifecycle(definition);
|
|
28576
|
+
validateRoleMemberships(definition, teamOrders);
|
|
28577
|
+
}
|
|
28578
|
+
}
|
|
28579
|
+
var AGENT_ROLE_LIFECYCLE_TAGS, roleMetadata, AGENT_ROLE_DEFINITIONS;
|
|
28580
|
+
var init_agent_role = __esm(() => {
|
|
28581
|
+
init_team_kind();
|
|
28582
|
+
AGENT_ROLE_LIFECYCLE_TAGS = [
|
|
28583
|
+
"permanent" /* Permanent */,
|
|
28584
|
+
"ephemeral" /* Ephemeral */
|
|
28585
|
+
];
|
|
28586
|
+
roleMetadata = {
|
|
28587
|
+
planner: {
|
|
28588
|
+
tags: ["permanent" /* Permanent */],
|
|
28589
|
+
teams: [{ teamId: "duo", order: 10 }]
|
|
28590
|
+
},
|
|
28591
|
+
builder: {
|
|
28592
|
+
tags: ["permanent" /* Permanent */],
|
|
28593
|
+
teams: [{ teamId: "duo", order: 50 }]
|
|
28594
|
+
},
|
|
28595
|
+
solo: {
|
|
28596
|
+
tags: ["permanent" /* Permanent */],
|
|
28597
|
+
teams: [{ teamId: "solo", order: 10 }]
|
|
28598
|
+
},
|
|
28599
|
+
architect: {
|
|
28600
|
+
tags: ["ephemeral" /* Ephemeral */],
|
|
28601
|
+
teams: [
|
|
28602
|
+
{ teamId: "duo", order: 20 },
|
|
28603
|
+
{ teamId: "solo", order: 20 }
|
|
28604
|
+
]
|
|
28605
|
+
},
|
|
28606
|
+
triage: {
|
|
28607
|
+
tags: ["ephemeral" /* Ephemeral */],
|
|
28608
|
+
teams: [
|
|
28609
|
+
{ teamId: "duo", order: 30 },
|
|
28610
|
+
{ teamId: "solo", order: 30 }
|
|
28611
|
+
]
|
|
28612
|
+
},
|
|
28613
|
+
"uiux-engineer": {
|
|
28614
|
+
tags: ["ephemeral" /* Ephemeral */],
|
|
28615
|
+
teams: [
|
|
28616
|
+
{ teamId: "duo", order: 40 },
|
|
28617
|
+
{ teamId: "solo", order: 40 }
|
|
28618
|
+
]
|
|
28619
|
+
}
|
|
28620
|
+
};
|
|
28621
|
+
AGENT_ROLE_DEFINITIONS = Object.fromEntries(Object.entries(roleMetadata).map(([role, metadata]) => [role, { role, ...metadata }]));
|
|
28622
|
+
validateAgentRoleDefinitions(Object.values(AGENT_ROLE_DEFINITIONS));
|
|
28623
|
+
});
|
|
28483
28624
|
|
|
28484
28625
|
// ../../services/backend/src/domain/entities/chatroom-workspace-task-inbox.ts
|
|
28485
28626
|
var ephemeralAssigneeValidator, permanentAssigneeValidator, workspaceTaskAssigneeValidator, workspaceTaskInboxEventStatusValidator, workspaceTaskInboxTaskValidator, workspaceTaskInboxEventFields, workspaceTaskInboxEventValidator;
|
|
@@ -107407,10 +107548,11 @@ function getTeamPreset(teamId) {
|
|
|
107407
107548
|
function listTeamPresetIds() {
|
|
107408
107549
|
return [...TEAM_PRESET_IDS];
|
|
107409
107550
|
}
|
|
107410
|
-
var
|
|
107551
|
+
var DEFAULT_TEAM_PRESET_ID = "duo", TEAM_STRUCTURE_IDS, TEAM_PRESETS;
|
|
107411
107552
|
var init_team_presets = __esm(() => {
|
|
107412
107553
|
init_agent_role();
|
|
107413
|
-
|
|
107554
|
+
init_team_kind();
|
|
107555
|
+
init_team_kind();
|
|
107414
107556
|
TEAM_STRUCTURE_IDS = {
|
|
107415
107557
|
duo: "duo@1",
|
|
107416
107558
|
solo: "solo@1"
|
|
@@ -107419,15 +107561,15 @@ var init_team_presets = __esm(() => {
|
|
|
107419
107561
|
duo: {
|
|
107420
107562
|
structureId: TEAM_STRUCTURE_IDS.duo,
|
|
107421
107563
|
name: "Duo",
|
|
107422
|
-
description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect and
|
|
107423
|
-
roles:
|
|
107564
|
+
description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect, triage, and uiux-engineer roles",
|
|
107565
|
+
roles: getBuiltinRolesForTeam("duo"),
|
|
107424
107566
|
entryPoint: "planner"
|
|
107425
107567
|
},
|
|
107426
107568
|
solo: {
|
|
107427
107569
|
structureId: TEAM_STRUCTURE_IDS.solo,
|
|
107428
107570
|
name: "Solo",
|
|
107429
|
-
description: "A single agent working independently, with optional ephemeral architect and
|
|
107430
|
-
roles:
|
|
107571
|
+
description: "A single agent working independently, with optional ephemeral architect, triage, and uiux-engineer roles",
|
|
107572
|
+
roles: getBuiltinRolesForTeam("solo"),
|
|
107431
107573
|
entryPoint: "solo"
|
|
107432
107574
|
}
|
|
107433
107575
|
};
|
|
@@ -107812,6 +107954,7 @@ function getUiuxEngineerRequirements() {
|
|
|
107812
107954
|
- Define component hierarchy and ownership, props/state/events, data boundaries, and interaction behavior.
|
|
107813
107955
|
- Choose concrete existing ShadCN components with the Base UI backend and lucide-react/react-icons conventions; do not write "use an appropriate component."
|
|
107814
107956
|
- Specify Tailwind utility classes or semantic theme-token classes for layout, spacing, sizing, typography, states, responsive behavior, and dark mode.
|
|
107957
|
+
- Provide the target HTML markup with exact class attributes and any required CSS/styles in the handoff.
|
|
107815
107958
|
- Specify responsive breakpoints/layout behavior, visual feedback, destructive-action safeguards, exact files/components, and the UI/integration test plan.
|
|
107816
107959
|
- Do not propose or require web accessibility implementation work unless the user explicitly requests it.`;
|
|
107817
107960
|
}
|
|
@@ -107875,8 +108018,8 @@ ${getFileReferenceGuidanceComment()}
|
|
|
107875
108018
|
**Change:** <precise add/modify/remove responsibility and why>
|
|
107876
108019
|
|
|
107877
108020
|
\`\`\`text
|
|
107878
|
-
//
|
|
107879
|
-
//
|
|
108021
|
+
// Target HTML markup, exact class attributes, and required CSS/styles.
|
|
108022
|
+
// Include component hierarchy and props/state/events needed for implementation.
|
|
107880
108023
|
\`\`\`
|
|
107881
108024
|
|
|
107882
108025
|
<add one block per file; do not collapse multiple files into a directory or vague layer>
|
|
@@ -108100,7 +108243,7 @@ function getPlannerToBuilderHandoffTemplate() {
|
|
|
108100
108243
|
|
|
108101
108244
|
${getDelegationBriefIntro()}
|
|
108102
108245
|
|
|
108103
|
-
**Division of labor:** You (planner) own architecture and API shape. The
|
|
108246
|
+
**Division of labor:** You (planner) own architecture and API shape. The UI/UX engineer owns UI/UX design. Include its target markup, classes, and styles in UI implementation briefs; the builder implements the components.
|
|
108104
108247
|
|
|
108105
108248
|
**Detail bar:** Specify down to **every file** the builder will create or modify (full repo paths). Include code snippets — types, signatures, stubs, or target implementations — until a competent builder **cannot misinterpret** what to write. Vague layers ("update the backend", "fix the component") are not acceptable.
|
|
108106
108249
|
|
|
@@ -108476,6 +108619,12 @@ var init_uiux_engineer = __esm(() => {
|
|
|
108476
108619
|
};
|
|
108477
108620
|
});
|
|
108478
108621
|
|
|
108622
|
+
// ../shared/src/domain/chatroom-role.ts
|
|
108623
|
+
var CHATROOM_ROLE_USER = "user";
|
|
108624
|
+
var init_chatroom_role = __esm(() => {
|
|
108625
|
+
init_agent_role();
|
|
108626
|
+
});
|
|
108627
|
+
|
|
108479
108628
|
// ../../services/backend/prompts/cli/handoff-templates/contracts.ts
|
|
108480
108629
|
function validateRoleHandoffContracts(contracts) {
|
|
108481
108630
|
const byRole = new Map;
|
|
@@ -108503,6 +108652,97 @@ function validateRoleHandoffContracts(contracts) {
|
|
|
108503
108652
|
}
|
|
108504
108653
|
}
|
|
108505
108654
|
}
|
|
108655
|
+
function validateBuiltinOwners(teamName, expectedRoles, contracts) {
|
|
108656
|
+
const actualRoles = new Set;
|
|
108657
|
+
const byRole = new Map;
|
|
108658
|
+
for (const contract of contracts) {
|
|
108659
|
+
const normalizedOwner = contract.role.trim().toLowerCase();
|
|
108660
|
+
if (!normalizedOwner || contract.role !== normalizedOwner) {
|
|
108661
|
+
throw new Error(`${teamName} handoff owner "${contract.role}" is not canonical`);
|
|
108662
|
+
}
|
|
108663
|
+
if (actualRoles.has(normalizedOwner)) {
|
|
108664
|
+
throw new Error(`${teamName} has duplicate handoff contract owner "${contract.role}"`);
|
|
108665
|
+
}
|
|
108666
|
+
if (!expectedRoles.has(normalizedOwner)) {
|
|
108667
|
+
throw new Error(`${teamName} has unexpected handoff contract role "${contract.role}"`);
|
|
108668
|
+
}
|
|
108669
|
+
actualRoles.add(normalizedOwner);
|
|
108670
|
+
byRole.set(normalizedOwner, contract);
|
|
108671
|
+
}
|
|
108672
|
+
for (const role of expectedRoles) {
|
|
108673
|
+
if (!actualRoles.has(role)) {
|
|
108674
|
+
throw new Error(`${teamName} is missing handoff contract for role "${role}"`);
|
|
108675
|
+
}
|
|
108676
|
+
}
|
|
108677
|
+
return byRole;
|
|
108678
|
+
}
|
|
108679
|
+
function validateReferenceTargets(teamName, owner, label, targets, allowedTargets) {
|
|
108680
|
+
const seen = new Set;
|
|
108681
|
+
for (const target of targets) {
|
|
108682
|
+
const normalizedTarget = target.trim().toLowerCase();
|
|
108683
|
+
if (target !== normalizedTarget || !allowedTargets.has(normalizedTarget)) {
|
|
108684
|
+
throw new Error(`${teamName} role "${owner}" has invalid ${label} target "${target}"`);
|
|
108685
|
+
}
|
|
108686
|
+
if (seen.has(normalizedTarget)) {
|
|
108687
|
+
throw new Error(`${teamName} role "${owner}" has duplicate ${label} target "${target}"`);
|
|
108688
|
+
}
|
|
108689
|
+
seen.add(normalizedTarget);
|
|
108690
|
+
}
|
|
108691
|
+
}
|
|
108692
|
+
function validateBuiltinReferences(teamName, allowedTargets, contracts) {
|
|
108693
|
+
for (const contract of contracts) {
|
|
108694
|
+
const owner = contract.role;
|
|
108695
|
+
validateReferenceTargets(teamName, owner, "receivesFrom", contract.receivesFrom, allowedTargets);
|
|
108696
|
+
validateReferenceTargets(teamName, owner, "returnsTo", contract.returnsTo, allowedTargets);
|
|
108697
|
+
const outboundTargets = Object.keys(contract.outboundTemplates);
|
|
108698
|
+
if (outboundTargets.length === 0) {
|
|
108699
|
+
throw new Error(`${teamName} role "${owner}" must have an outbound handoff capability`);
|
|
108700
|
+
}
|
|
108701
|
+
const returnsTo = new Set(contract.returnsTo);
|
|
108702
|
+
const outbound = new Set(outboundTargets);
|
|
108703
|
+
validateReferenceTargets(teamName, owner, "outbound", outboundTargets, allowedTargets);
|
|
108704
|
+
for (const target of outboundTargets) {
|
|
108705
|
+
if (typeof contract.outboundTemplates[target] !== "function") {
|
|
108706
|
+
throw new Error(`${teamName} role "${owner}" has no outbound getter for target "${target}"`);
|
|
108707
|
+
}
|
|
108708
|
+
}
|
|
108709
|
+
if (returnsTo.size !== outbound.size || [...returnsTo].some((target) => !outbound.has(target))) {
|
|
108710
|
+
throw new Error(`${teamName} role "${owner}" returnsTo targets must exactly match outbound targets`);
|
|
108711
|
+
}
|
|
108712
|
+
}
|
|
108713
|
+
}
|
|
108714
|
+
function validateBuiltinReciprocity(teamName, byRole, contracts) {
|
|
108715
|
+
for (const contract of contracts) {
|
|
108716
|
+
const owner = contract.role;
|
|
108717
|
+
for (const receivedFrom of contract.receivesFrom) {
|
|
108718
|
+
if (receivedFrom === CHATROOM_ROLE_USER)
|
|
108719
|
+
continue;
|
|
108720
|
+
const source = byRole.get(receivedFrom);
|
|
108721
|
+
if (!source?.outboundTemplates[owner]) {
|
|
108722
|
+
throw new Error(`${teamName} role "${owner}" receives from "${receivedFrom}" without a reverse outbound edge`);
|
|
108723
|
+
}
|
|
108724
|
+
}
|
|
108725
|
+
}
|
|
108726
|
+
try {
|
|
108727
|
+
validateRoleHandoffContracts(contracts);
|
|
108728
|
+
} catch (error51) {
|
|
108729
|
+
const contextualError = new Error(`${teamName}: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
108730
|
+
Object.defineProperty(contextualError, "cause", { value: error51, configurable: true });
|
|
108731
|
+
throw contextualError;
|
|
108732
|
+
}
|
|
108733
|
+
}
|
|
108734
|
+
function validateBuiltinTeamRoleHandoffContracts(teamId, contracts) {
|
|
108735
|
+
const teamName = TEAM_PRESETS[teamId].name;
|
|
108736
|
+
const expectedRoles = new Set(TEAM_PRESETS[teamId].roles);
|
|
108737
|
+
const byRole = validateBuiltinOwners(teamName, expectedRoles, contracts);
|
|
108738
|
+
const allowedTargets = new Set([...expectedRoles, CHATROOM_ROLE_USER]);
|
|
108739
|
+
validateBuiltinReferences(teamName, allowedTargets, contracts);
|
|
108740
|
+
validateBuiltinReciprocity(teamName, byRole, contracts);
|
|
108741
|
+
}
|
|
108742
|
+
var init_contracts = __esm(() => {
|
|
108743
|
+
init_chatroom_role();
|
|
108744
|
+
init_team_presets();
|
|
108745
|
+
});
|
|
108506
108746
|
|
|
108507
108747
|
// ../../services/backend/prompts/teams/duo/handoff-templates/index.ts
|
|
108508
108748
|
function listDuoRoleHandoffContracts() {
|
|
@@ -108515,22 +108755,24 @@ function getDuoHandoffTemplate(query) {
|
|
|
108515
108755
|
const getter = contract?.outboundTemplates[toRole];
|
|
108516
108756
|
return getter?.(query) ?? null;
|
|
108517
108757
|
}
|
|
108518
|
-
var DUO_ROLE_HANDOFF_CONTRACTS, validatedDuoRoleHandoffContracts;
|
|
108758
|
+
var DUO_ROLE_HANDOFF_CATALOG, DUO_ROLE_HANDOFF_CONTRACTS, validatedDuoRoleHandoffContracts;
|
|
108519
108759
|
var init_handoff_templates = __esm(() => {
|
|
108520
108760
|
init_architect();
|
|
108521
108761
|
init_builder();
|
|
108522
108762
|
init_planner();
|
|
108523
108763
|
init_triage();
|
|
108524
108764
|
init_uiux_engineer();
|
|
108525
|
-
|
|
108526
|
-
|
|
108527
|
-
|
|
108528
|
-
|
|
108529
|
-
|
|
108530
|
-
|
|
108531
|
-
|
|
108765
|
+
init_contracts();
|
|
108766
|
+
DUO_ROLE_HANDOFF_CATALOG = {
|
|
108767
|
+
planner: duoPlannerHandoffContract,
|
|
108768
|
+
builder: duoBuilderHandoffContract,
|
|
108769
|
+
architect: duoArchitectHandoffContract,
|
|
108770
|
+
"uiux-engineer": duoUiuxEngineerHandoffContract,
|
|
108771
|
+
triage: duoTriageHandoffContract
|
|
108772
|
+
};
|
|
108773
|
+
DUO_ROLE_HANDOFF_CONTRACTS = Object.values(DUO_ROLE_HANDOFF_CATALOG);
|
|
108532
108774
|
validatedDuoRoleHandoffContracts = (() => {
|
|
108533
|
-
|
|
108775
|
+
validateBuiltinTeamRoleHandoffContracts("duo", DUO_ROLE_HANDOFF_CONTRACTS);
|
|
108534
108776
|
return DUO_ROLE_HANDOFF_CONTRACTS;
|
|
108535
108777
|
})();
|
|
108536
108778
|
});
|
|
@@ -108627,20 +108869,22 @@ function getSoloHandoffTemplate(query) {
|
|
|
108627
108869
|
const getter = contract?.outboundTemplates[toRole];
|
|
108628
108870
|
return getter?.(query) ?? null;
|
|
108629
108871
|
}
|
|
108630
|
-
var SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
|
|
108872
|
+
var SOLO_ROLE_HANDOFF_CATALOG, SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
|
|
108631
108873
|
var init_handoff_templates2 = __esm(() => {
|
|
108632
108874
|
init_architect2();
|
|
108633
108875
|
init_solo();
|
|
108634
108876
|
init_triage2();
|
|
108635
108877
|
init_uiux_engineer2();
|
|
108636
|
-
|
|
108637
|
-
|
|
108638
|
-
|
|
108639
|
-
|
|
108640
|
-
|
|
108641
|
-
|
|
108878
|
+
init_contracts();
|
|
108879
|
+
SOLO_ROLE_HANDOFF_CATALOG = {
|
|
108880
|
+
solo: soloHandoffContract,
|
|
108881
|
+
architect: soloArchitectHandoffContract,
|
|
108882
|
+
"uiux-engineer": soloUiuxEngineerHandoffContract,
|
|
108883
|
+
triage: soloTriageHandoffContract
|
|
108884
|
+
};
|
|
108885
|
+
SOLO_ROLE_HANDOFF_CONTRACTS = Object.values(SOLO_ROLE_HANDOFF_CATALOG);
|
|
108642
108886
|
validatedSoloRoleHandoffContracts = (() => {
|
|
108643
|
-
|
|
108887
|
+
validateBuiltinTeamRoleHandoffContracts("solo", SOLO_ROLE_HANDOFF_CONTRACTS);
|
|
108644
108888
|
return SOLO_ROLE_HANDOFF_CONTRACTS;
|
|
108645
108889
|
})();
|
|
108646
108890
|
});
|
|
@@ -108665,7 +108909,7 @@ function listHandoffTemplates(query) {
|
|
|
108665
108909
|
const templates = [];
|
|
108666
108910
|
for (const toRole of Object.keys(contract.outboundTemplates).sort()) {
|
|
108667
108911
|
const getter = contract.outboundTemplates[toRole];
|
|
108668
|
-
const template = getter({
|
|
108912
|
+
const template = getter?.({
|
|
108669
108913
|
fromRole: contract.role,
|
|
108670
108914
|
toRole,
|
|
108671
108915
|
teamId,
|
|
@@ -109141,7 +109385,7 @@ var init_uiux_engineer3 = __esm(() => {
|
|
|
109141
109385
|
init_sections();
|
|
109142
109386
|
UIUX_ENGINEER_GUIDANCE = `## UI/UX Engineer Operating Model
|
|
109143
109387
|
|
|
109144
|
-
You are the UI/UX engineer responsible for producing one complete interface and experience design for the request.
|
|
109388
|
+
You are the UI/UX engineer responsible for UI/UX decisions and for producing one complete interface and experience design for the request. Provide the target markup, classes, and styles in your handoff. Do not implement code, edit files, or act as the builder.
|
|
109145
109389
|
|
|
109146
109390
|
${"{SESSION_CONTINUITY}"}
|
|
109147
109391
|
|
|
@@ -109216,8 +109460,112 @@ var init_role_guidance = __esm(() => {
|
|
|
109216
109460
|
});
|
|
109217
109461
|
|
|
109218
109462
|
// ../../services/backend/prompts/templates.ts
|
|
109463
|
+
var BUILTIN_ROLE_TEMPLATES, CUSTOM_ROLE_TEMPLATES, ROLE_TEMPLATES;
|
|
109219
109464
|
var init_templates = __esm(() => {
|
|
109220
109465
|
init_agent_role();
|
|
109466
|
+
BUILTIN_ROLE_TEMPLATES = {
|
|
109467
|
+
builder: {
|
|
109468
|
+
role: "builder",
|
|
109469
|
+
title: "Builder",
|
|
109470
|
+
description: "You are the implementer responsible for writing code and building solutions.",
|
|
109471
|
+
responsibilities: [
|
|
109472
|
+
"Implement solutions based on requirements",
|
|
109473
|
+
"Write clean, maintainable, well-documented code",
|
|
109474
|
+
"Follow established patterns and best practices",
|
|
109475
|
+
"Handle edge cases and error scenarios",
|
|
109476
|
+
"Provide clear summaries of what was built"
|
|
109477
|
+
],
|
|
109478
|
+
defaultHandoffTarget: "planner"
|
|
109479
|
+
},
|
|
109480
|
+
planner: {
|
|
109481
|
+
role: "planner",
|
|
109482
|
+
title: "Planner",
|
|
109483
|
+
description: "You are the team coordinator responsible for user communication, task decomposition, and team management.",
|
|
109484
|
+
responsibilities: [
|
|
109485
|
+
"Communicate with the user as the single point of contact",
|
|
109486
|
+
"Decompose complex tasks into actionable work items",
|
|
109487
|
+
"Delegate work to available team members",
|
|
109488
|
+
"Review completed work against user requirements",
|
|
109489
|
+
"Manage the backlog and prioritize tasks",
|
|
109490
|
+
"Hand back work for rework if requirements are not met"
|
|
109491
|
+
],
|
|
109492
|
+
defaultHandoffTarget: "builder"
|
|
109493
|
+
},
|
|
109494
|
+
architect: {
|
|
109495
|
+
role: "architect",
|
|
109496
|
+
title: "Architect",
|
|
109497
|
+
description: "You are the architect responsible for producing one complete implementation design for the request; you are not an implementer.",
|
|
109498
|
+
responsibilities: [
|
|
109499
|
+
"Recover the authoritative user request and relevant history",
|
|
109500
|
+
"Inspect repository patterns and identify the coding change surface",
|
|
109501
|
+
"Design module boundaries, APIs, schemas, queries, invariants, and failure handling",
|
|
109502
|
+
"Specify the implementation and verification sequence at code granularity",
|
|
109503
|
+
"Hand one evidence-backed design to the planner for implementation"
|
|
109504
|
+
],
|
|
109505
|
+
defaultHandoffTarget: "planner"
|
|
109506
|
+
},
|
|
109507
|
+
triage: {
|
|
109508
|
+
role: "triage",
|
|
109509
|
+
title: "Triage Agent",
|
|
109510
|
+
description: "You are the triage agent responsible for thoroughly investigating reported bugs and returning an evidence-backed diagnosis; you do not implement fixes.",
|
|
109511
|
+
responsibilities: [
|
|
109512
|
+
"Recover the reported symptoms and expected behavior from the authoritative request and relevant history",
|
|
109513
|
+
"Trace the relevant code and state flow to identify a root cause, citing concrete repository evidence",
|
|
109514
|
+
"Attempt to reproduce the issue with the smallest focused automated test and report the result honestly",
|
|
109515
|
+
"Recommend the smallest immediate fix without implementing it",
|
|
109516
|
+
"Report systemic design risks separately from the immediate fix",
|
|
109517
|
+
"Hand the complete investigation report to the configured entry point"
|
|
109518
|
+
],
|
|
109519
|
+
defaultHandoffTarget: "planner"
|
|
109520
|
+
},
|
|
109521
|
+
"uiux-engineer": {
|
|
109522
|
+
role: "uiux-engineer",
|
|
109523
|
+
title: "UI/UX Engineer",
|
|
109524
|
+
description: "You are the UI/UX engineer responsible for producing one complete interface and experience design for the request; you are not an implementer.",
|
|
109525
|
+
responsibilities: [
|
|
109526
|
+
"Recover the authoritative user request and relevant history",
|
|
109527
|
+
"Inspect existing UI patterns, components, tokens, and interaction conventions",
|
|
109528
|
+
"Design complete user flows including loading, empty, error, and success states",
|
|
109529
|
+
"Specify responsive layout, state ownership, and UI tests; include web accessibility implementation only when explicitly requested by the user",
|
|
109530
|
+
"Hand one evidence-backed design to the planner for implementation"
|
|
109531
|
+
],
|
|
109532
|
+
defaultHandoffTarget: "planner"
|
|
109533
|
+
},
|
|
109534
|
+
solo: {
|
|
109535
|
+
role: "solo",
|
|
109536
|
+
title: "Solo",
|
|
109537
|
+
description: "You are the autonomous agent responsible for both planning and executing tasks independently.",
|
|
109538
|
+
responsibilities: [
|
|
109539
|
+
"Communicate directly with the user as the single point of contact",
|
|
109540
|
+
"Decompose complex tasks into actionable work items",
|
|
109541
|
+
"Implement solutions: write clean, maintainable code",
|
|
109542
|
+
"Follow established patterns and best practices",
|
|
109543
|
+
"Handle edge cases and error scenarios",
|
|
109544
|
+
"Review and validate your own work for quality",
|
|
109545
|
+
"Deliver completed results to the user"
|
|
109546
|
+
],
|
|
109547
|
+
defaultHandoffTarget: "user"
|
|
109548
|
+
}
|
|
109549
|
+
};
|
|
109550
|
+
CUSTOM_ROLE_TEMPLATES = {
|
|
109551
|
+
tester: {
|
|
109552
|
+
role: "tester",
|
|
109553
|
+
title: "Tester",
|
|
109554
|
+
description: "You are the QA role responsible for testing and validation.",
|
|
109555
|
+
responsibilities: [
|
|
109556
|
+
"Write and execute test cases",
|
|
109557
|
+
"Verify functionality works as expected",
|
|
109558
|
+
"Test edge cases and error handling",
|
|
109559
|
+
"Report bugs and issues clearly",
|
|
109560
|
+
"Confirm quality standards are met"
|
|
109561
|
+
],
|
|
109562
|
+
defaultHandoffTarget: "user"
|
|
109563
|
+
}
|
|
109564
|
+
};
|
|
109565
|
+
ROLE_TEMPLATES = {
|
|
109566
|
+
...BUILTIN_ROLE_TEMPLATES,
|
|
109567
|
+
...CUSTOM_ROLE_TEMPLATES
|
|
109568
|
+
};
|
|
109221
109569
|
});
|
|
109222
109570
|
|
|
109223
109571
|
// ../../services/backend/prompts/sections/role-identity.ts
|
|
@@ -136733,4 +137081,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
136733
137081
|
});
|
|
136734
137082
|
program2.parse();
|
|
136735
137083
|
|
|
136736
|
-
//# debugId=
|
|
137084
|
+
//# debugId=23917805A998950464756E2164756E21
|