chatroom-cli 1.122.1 → 1.122.2
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 +373 -26
- package/dist/index.js.map +21 -18
- 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
|
};
|
|
@@ -108476,6 +108618,12 @@ var init_uiux_engineer = __esm(() => {
|
|
|
108476
108618
|
};
|
|
108477
108619
|
});
|
|
108478
108620
|
|
|
108621
|
+
// ../shared/src/domain/chatroom-role.ts
|
|
108622
|
+
var CHATROOM_ROLE_USER = "user";
|
|
108623
|
+
var init_chatroom_role = __esm(() => {
|
|
108624
|
+
init_agent_role();
|
|
108625
|
+
});
|
|
108626
|
+
|
|
108479
108627
|
// ../../services/backend/prompts/cli/handoff-templates/contracts.ts
|
|
108480
108628
|
function validateRoleHandoffContracts(contracts) {
|
|
108481
108629
|
const byRole = new Map;
|
|
@@ -108503,6 +108651,97 @@ function validateRoleHandoffContracts(contracts) {
|
|
|
108503
108651
|
}
|
|
108504
108652
|
}
|
|
108505
108653
|
}
|
|
108654
|
+
function validateBuiltinOwners(teamName, expectedRoles, contracts) {
|
|
108655
|
+
const actualRoles = new Set;
|
|
108656
|
+
const byRole = new Map;
|
|
108657
|
+
for (const contract of contracts) {
|
|
108658
|
+
const normalizedOwner = contract.role.trim().toLowerCase();
|
|
108659
|
+
if (!normalizedOwner || contract.role !== normalizedOwner) {
|
|
108660
|
+
throw new Error(`${teamName} handoff owner "${contract.role}" is not canonical`);
|
|
108661
|
+
}
|
|
108662
|
+
if (actualRoles.has(normalizedOwner)) {
|
|
108663
|
+
throw new Error(`${teamName} has duplicate handoff contract owner "${contract.role}"`);
|
|
108664
|
+
}
|
|
108665
|
+
if (!expectedRoles.has(normalizedOwner)) {
|
|
108666
|
+
throw new Error(`${teamName} has unexpected handoff contract role "${contract.role}"`);
|
|
108667
|
+
}
|
|
108668
|
+
actualRoles.add(normalizedOwner);
|
|
108669
|
+
byRole.set(normalizedOwner, contract);
|
|
108670
|
+
}
|
|
108671
|
+
for (const role of expectedRoles) {
|
|
108672
|
+
if (!actualRoles.has(role)) {
|
|
108673
|
+
throw new Error(`${teamName} is missing handoff contract for role "${role}"`);
|
|
108674
|
+
}
|
|
108675
|
+
}
|
|
108676
|
+
return byRole;
|
|
108677
|
+
}
|
|
108678
|
+
function validateReferenceTargets(teamName, owner, label, targets, allowedTargets) {
|
|
108679
|
+
const seen = new Set;
|
|
108680
|
+
for (const target of targets) {
|
|
108681
|
+
const normalizedTarget = target.trim().toLowerCase();
|
|
108682
|
+
if (target !== normalizedTarget || !allowedTargets.has(normalizedTarget)) {
|
|
108683
|
+
throw new Error(`${teamName} role "${owner}" has invalid ${label} target "${target}"`);
|
|
108684
|
+
}
|
|
108685
|
+
if (seen.has(normalizedTarget)) {
|
|
108686
|
+
throw new Error(`${teamName} role "${owner}" has duplicate ${label} target "${target}"`);
|
|
108687
|
+
}
|
|
108688
|
+
seen.add(normalizedTarget);
|
|
108689
|
+
}
|
|
108690
|
+
}
|
|
108691
|
+
function validateBuiltinReferences(teamName, allowedTargets, contracts) {
|
|
108692
|
+
for (const contract of contracts) {
|
|
108693
|
+
const owner = contract.role;
|
|
108694
|
+
validateReferenceTargets(teamName, owner, "receivesFrom", contract.receivesFrom, allowedTargets);
|
|
108695
|
+
validateReferenceTargets(teamName, owner, "returnsTo", contract.returnsTo, allowedTargets);
|
|
108696
|
+
const outboundTargets = Object.keys(contract.outboundTemplates);
|
|
108697
|
+
if (outboundTargets.length === 0) {
|
|
108698
|
+
throw new Error(`${teamName} role "${owner}" must have an outbound handoff capability`);
|
|
108699
|
+
}
|
|
108700
|
+
const returnsTo = new Set(contract.returnsTo);
|
|
108701
|
+
const outbound = new Set(outboundTargets);
|
|
108702
|
+
validateReferenceTargets(teamName, owner, "outbound", outboundTargets, allowedTargets);
|
|
108703
|
+
for (const target of outboundTargets) {
|
|
108704
|
+
if (typeof contract.outboundTemplates[target] !== "function") {
|
|
108705
|
+
throw new Error(`${teamName} role "${owner}" has no outbound getter for target "${target}"`);
|
|
108706
|
+
}
|
|
108707
|
+
}
|
|
108708
|
+
if (returnsTo.size !== outbound.size || [...returnsTo].some((target) => !outbound.has(target))) {
|
|
108709
|
+
throw new Error(`${teamName} role "${owner}" returnsTo targets must exactly match outbound targets`);
|
|
108710
|
+
}
|
|
108711
|
+
}
|
|
108712
|
+
}
|
|
108713
|
+
function validateBuiltinReciprocity(teamName, byRole, contracts) {
|
|
108714
|
+
for (const contract of contracts) {
|
|
108715
|
+
const owner = contract.role;
|
|
108716
|
+
for (const receivedFrom of contract.receivesFrom) {
|
|
108717
|
+
if (receivedFrom === CHATROOM_ROLE_USER)
|
|
108718
|
+
continue;
|
|
108719
|
+
const source = byRole.get(receivedFrom);
|
|
108720
|
+
if (!source?.outboundTemplates[owner]) {
|
|
108721
|
+
throw new Error(`${teamName} role "${owner}" receives from "${receivedFrom}" without a reverse outbound edge`);
|
|
108722
|
+
}
|
|
108723
|
+
}
|
|
108724
|
+
}
|
|
108725
|
+
try {
|
|
108726
|
+
validateRoleHandoffContracts(contracts);
|
|
108727
|
+
} catch (error51) {
|
|
108728
|
+
const contextualError = new Error(`${teamName}: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
108729
|
+
Object.defineProperty(contextualError, "cause", { value: error51, configurable: true });
|
|
108730
|
+
throw contextualError;
|
|
108731
|
+
}
|
|
108732
|
+
}
|
|
108733
|
+
function validateBuiltinTeamRoleHandoffContracts(teamId, contracts) {
|
|
108734
|
+
const teamName = TEAM_PRESETS[teamId].name;
|
|
108735
|
+
const expectedRoles = new Set(TEAM_PRESETS[teamId].roles);
|
|
108736
|
+
const byRole = validateBuiltinOwners(teamName, expectedRoles, contracts);
|
|
108737
|
+
const allowedTargets = new Set([...expectedRoles, CHATROOM_ROLE_USER]);
|
|
108738
|
+
validateBuiltinReferences(teamName, allowedTargets, contracts);
|
|
108739
|
+
validateBuiltinReciprocity(teamName, byRole, contracts);
|
|
108740
|
+
}
|
|
108741
|
+
var init_contracts = __esm(() => {
|
|
108742
|
+
init_chatroom_role();
|
|
108743
|
+
init_team_presets();
|
|
108744
|
+
});
|
|
108506
108745
|
|
|
108507
108746
|
// ../../services/backend/prompts/teams/duo/handoff-templates/index.ts
|
|
108508
108747
|
function listDuoRoleHandoffContracts() {
|
|
@@ -108515,22 +108754,24 @@ function getDuoHandoffTemplate(query) {
|
|
|
108515
108754
|
const getter = contract?.outboundTemplates[toRole];
|
|
108516
108755
|
return getter?.(query) ?? null;
|
|
108517
108756
|
}
|
|
108518
|
-
var DUO_ROLE_HANDOFF_CONTRACTS, validatedDuoRoleHandoffContracts;
|
|
108757
|
+
var DUO_ROLE_HANDOFF_CATALOG, DUO_ROLE_HANDOFF_CONTRACTS, validatedDuoRoleHandoffContracts;
|
|
108519
108758
|
var init_handoff_templates = __esm(() => {
|
|
108520
108759
|
init_architect();
|
|
108521
108760
|
init_builder();
|
|
108522
108761
|
init_planner();
|
|
108523
108762
|
init_triage();
|
|
108524
108763
|
init_uiux_engineer();
|
|
108525
|
-
|
|
108526
|
-
|
|
108527
|
-
|
|
108528
|
-
|
|
108529
|
-
|
|
108530
|
-
|
|
108531
|
-
|
|
108764
|
+
init_contracts();
|
|
108765
|
+
DUO_ROLE_HANDOFF_CATALOG = {
|
|
108766
|
+
planner: duoPlannerHandoffContract,
|
|
108767
|
+
builder: duoBuilderHandoffContract,
|
|
108768
|
+
architect: duoArchitectHandoffContract,
|
|
108769
|
+
"uiux-engineer": duoUiuxEngineerHandoffContract,
|
|
108770
|
+
triage: duoTriageHandoffContract
|
|
108771
|
+
};
|
|
108772
|
+
DUO_ROLE_HANDOFF_CONTRACTS = Object.values(DUO_ROLE_HANDOFF_CATALOG);
|
|
108532
108773
|
validatedDuoRoleHandoffContracts = (() => {
|
|
108533
|
-
|
|
108774
|
+
validateBuiltinTeamRoleHandoffContracts("duo", DUO_ROLE_HANDOFF_CONTRACTS);
|
|
108534
108775
|
return DUO_ROLE_HANDOFF_CONTRACTS;
|
|
108535
108776
|
})();
|
|
108536
108777
|
});
|
|
@@ -108627,20 +108868,22 @@ function getSoloHandoffTemplate(query) {
|
|
|
108627
108868
|
const getter = contract?.outboundTemplates[toRole];
|
|
108628
108869
|
return getter?.(query) ?? null;
|
|
108629
108870
|
}
|
|
108630
|
-
var SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
|
|
108871
|
+
var SOLO_ROLE_HANDOFF_CATALOG, SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
|
|
108631
108872
|
var init_handoff_templates2 = __esm(() => {
|
|
108632
108873
|
init_architect2();
|
|
108633
108874
|
init_solo();
|
|
108634
108875
|
init_triage2();
|
|
108635
108876
|
init_uiux_engineer2();
|
|
108636
|
-
|
|
108637
|
-
|
|
108638
|
-
|
|
108639
|
-
|
|
108640
|
-
|
|
108641
|
-
|
|
108877
|
+
init_contracts();
|
|
108878
|
+
SOLO_ROLE_HANDOFF_CATALOG = {
|
|
108879
|
+
solo: soloHandoffContract,
|
|
108880
|
+
architect: soloArchitectHandoffContract,
|
|
108881
|
+
"uiux-engineer": soloUiuxEngineerHandoffContract,
|
|
108882
|
+
triage: soloTriageHandoffContract
|
|
108883
|
+
};
|
|
108884
|
+
SOLO_ROLE_HANDOFF_CONTRACTS = Object.values(SOLO_ROLE_HANDOFF_CATALOG);
|
|
108642
108885
|
validatedSoloRoleHandoffContracts = (() => {
|
|
108643
|
-
|
|
108886
|
+
validateBuiltinTeamRoleHandoffContracts("solo", SOLO_ROLE_HANDOFF_CONTRACTS);
|
|
108644
108887
|
return SOLO_ROLE_HANDOFF_CONTRACTS;
|
|
108645
108888
|
})();
|
|
108646
108889
|
});
|
|
@@ -108665,7 +108908,7 @@ function listHandoffTemplates(query) {
|
|
|
108665
108908
|
const templates = [];
|
|
108666
108909
|
for (const toRole of Object.keys(contract.outboundTemplates).sort()) {
|
|
108667
108910
|
const getter = contract.outboundTemplates[toRole];
|
|
108668
|
-
const template = getter({
|
|
108911
|
+
const template = getter?.({
|
|
108669
108912
|
fromRole: contract.role,
|
|
108670
108913
|
toRole,
|
|
108671
108914
|
teamId,
|
|
@@ -109216,8 +109459,112 @@ var init_role_guidance = __esm(() => {
|
|
|
109216
109459
|
});
|
|
109217
109460
|
|
|
109218
109461
|
// ../../services/backend/prompts/templates.ts
|
|
109462
|
+
var BUILTIN_ROLE_TEMPLATES, CUSTOM_ROLE_TEMPLATES, ROLE_TEMPLATES;
|
|
109219
109463
|
var init_templates = __esm(() => {
|
|
109220
109464
|
init_agent_role();
|
|
109465
|
+
BUILTIN_ROLE_TEMPLATES = {
|
|
109466
|
+
builder: {
|
|
109467
|
+
role: "builder",
|
|
109468
|
+
title: "Builder",
|
|
109469
|
+
description: "You are the implementer responsible for writing code and building solutions.",
|
|
109470
|
+
responsibilities: [
|
|
109471
|
+
"Implement solutions based on requirements",
|
|
109472
|
+
"Write clean, maintainable, well-documented code",
|
|
109473
|
+
"Follow established patterns and best practices",
|
|
109474
|
+
"Handle edge cases and error scenarios",
|
|
109475
|
+
"Provide clear summaries of what was built"
|
|
109476
|
+
],
|
|
109477
|
+
defaultHandoffTarget: "planner"
|
|
109478
|
+
},
|
|
109479
|
+
planner: {
|
|
109480
|
+
role: "planner",
|
|
109481
|
+
title: "Planner",
|
|
109482
|
+
description: "You are the team coordinator responsible for user communication, task decomposition, and team management.",
|
|
109483
|
+
responsibilities: [
|
|
109484
|
+
"Communicate with the user as the single point of contact",
|
|
109485
|
+
"Decompose complex tasks into actionable work items",
|
|
109486
|
+
"Delegate work to available team members",
|
|
109487
|
+
"Review completed work against user requirements",
|
|
109488
|
+
"Manage the backlog and prioritize tasks",
|
|
109489
|
+
"Hand back work for rework if requirements are not met"
|
|
109490
|
+
],
|
|
109491
|
+
defaultHandoffTarget: "builder"
|
|
109492
|
+
},
|
|
109493
|
+
architect: {
|
|
109494
|
+
role: "architect",
|
|
109495
|
+
title: "Architect",
|
|
109496
|
+
description: "You are the architect responsible for producing one complete implementation design for the request; you are not an implementer.",
|
|
109497
|
+
responsibilities: [
|
|
109498
|
+
"Recover the authoritative user request and relevant history",
|
|
109499
|
+
"Inspect repository patterns and identify the coding change surface",
|
|
109500
|
+
"Design module boundaries, APIs, schemas, queries, invariants, and failure handling",
|
|
109501
|
+
"Specify the implementation and verification sequence at code granularity",
|
|
109502
|
+
"Hand one evidence-backed design to the planner for implementation"
|
|
109503
|
+
],
|
|
109504
|
+
defaultHandoffTarget: "planner"
|
|
109505
|
+
},
|
|
109506
|
+
triage: {
|
|
109507
|
+
role: "triage",
|
|
109508
|
+
title: "Triage Agent",
|
|
109509
|
+
description: "You are the triage agent responsible for thoroughly investigating reported bugs and returning an evidence-backed diagnosis; you do not implement fixes.",
|
|
109510
|
+
responsibilities: [
|
|
109511
|
+
"Recover the reported symptoms and expected behavior from the authoritative request and relevant history",
|
|
109512
|
+
"Trace the relevant code and state flow to identify a root cause, citing concrete repository evidence",
|
|
109513
|
+
"Attempt to reproduce the issue with the smallest focused automated test and report the result honestly",
|
|
109514
|
+
"Recommend the smallest immediate fix without implementing it",
|
|
109515
|
+
"Report systemic design risks separately from the immediate fix",
|
|
109516
|
+
"Hand the complete investigation report to the configured entry point"
|
|
109517
|
+
],
|
|
109518
|
+
defaultHandoffTarget: "planner"
|
|
109519
|
+
},
|
|
109520
|
+
"uiux-engineer": {
|
|
109521
|
+
role: "uiux-engineer",
|
|
109522
|
+
title: "UI/UX Engineer",
|
|
109523
|
+
description: "You are the UI/UX engineer responsible for producing one complete interface and experience design for the request; you are not an implementer.",
|
|
109524
|
+
responsibilities: [
|
|
109525
|
+
"Recover the authoritative user request and relevant history",
|
|
109526
|
+
"Inspect existing UI patterns, components, tokens, and interaction conventions",
|
|
109527
|
+
"Design complete user flows including loading, empty, error, and success states",
|
|
109528
|
+
"Specify responsive layout, state ownership, and UI tests; include web accessibility implementation only when explicitly requested by the user",
|
|
109529
|
+
"Hand one evidence-backed design to the planner for implementation"
|
|
109530
|
+
],
|
|
109531
|
+
defaultHandoffTarget: "planner"
|
|
109532
|
+
},
|
|
109533
|
+
solo: {
|
|
109534
|
+
role: "solo",
|
|
109535
|
+
title: "Solo",
|
|
109536
|
+
description: "You are the autonomous agent responsible for both planning and executing tasks independently.",
|
|
109537
|
+
responsibilities: [
|
|
109538
|
+
"Communicate directly with the user as the single point of contact",
|
|
109539
|
+
"Decompose complex tasks into actionable work items",
|
|
109540
|
+
"Implement solutions: write clean, maintainable code",
|
|
109541
|
+
"Follow established patterns and best practices",
|
|
109542
|
+
"Handle edge cases and error scenarios",
|
|
109543
|
+
"Review and validate your own work for quality",
|
|
109544
|
+
"Deliver completed results to the user"
|
|
109545
|
+
],
|
|
109546
|
+
defaultHandoffTarget: "user"
|
|
109547
|
+
}
|
|
109548
|
+
};
|
|
109549
|
+
CUSTOM_ROLE_TEMPLATES = {
|
|
109550
|
+
tester: {
|
|
109551
|
+
role: "tester",
|
|
109552
|
+
title: "Tester",
|
|
109553
|
+
description: "You are the QA role responsible for testing and validation.",
|
|
109554
|
+
responsibilities: [
|
|
109555
|
+
"Write and execute test cases",
|
|
109556
|
+
"Verify functionality works as expected",
|
|
109557
|
+
"Test edge cases and error handling",
|
|
109558
|
+
"Report bugs and issues clearly",
|
|
109559
|
+
"Confirm quality standards are met"
|
|
109560
|
+
],
|
|
109561
|
+
defaultHandoffTarget: "user"
|
|
109562
|
+
}
|
|
109563
|
+
};
|
|
109564
|
+
ROLE_TEMPLATES = {
|
|
109565
|
+
...BUILTIN_ROLE_TEMPLATES,
|
|
109566
|
+
...CUSTOM_ROLE_TEMPLATES
|
|
109567
|
+
};
|
|
109221
109568
|
});
|
|
109222
109569
|
|
|
109223
109570
|
// ../../services/backend/prompts/sections/role-identity.ts
|
|
@@ -136733,4 +137080,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
136733
137080
|
});
|
|
136734
137081
|
program2.parse();
|
|
136735
137082
|
|
|
136736
|
-
//# debugId=
|
|
137083
|
+
//# debugId=1F68354F72E2582064756E2164756E21
|