chatroom-cli 1.143.1 → 1.144.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 CHANGED
@@ -33431,6 +33431,14 @@ var init_agent_role = __esm(() => {
33431
33431
  { teamId: "trio", order: 25 }
33432
33432
  ]
33433
33433
  },
33434
+ "product-manager": {
33435
+ tags: ["ephemeral" /* Ephemeral */],
33436
+ teams: [
33437
+ { teamId: "duo", order: 15 },
33438
+ { teamId: "solo", order: 15 },
33439
+ { teamId: "trio", order: 15 }
33440
+ ]
33441
+ },
33434
33442
  verifier: {
33435
33443
  tags: ["ephemeral" /* Ephemeral */],
33436
33444
  teams: [
@@ -51669,6 +51677,11 @@ var init_stop_agent_confirmed_adapter = __esm(() => {
51669
51677
  init_stop_agent_confirmed();
51670
51678
  });
51671
51679
 
51680
+ // src/infrastructure/services/workspace/normalize-working-dir.ts
51681
+ function normalizeWorkingDirForLookup(workingDir) {
51682
+ return workingDir.trim().replace(/[/\\]+$/, "");
51683
+ }
51684
+
51672
51685
  // src/daemon/domain/usecase/stop-agent-targets.ts
51673
51686
  async function stopAgentTargets(deps, args2) {
51674
51687
  const release2 = await deps.barrier.acquire(args2.chatroomId);
@@ -51747,7 +51760,12 @@ async function runRoleScopedStop(args2) {
51747
51760
  args2.apm.markStopIntent(args2.chatroomId, args2.role, args2.reason, undefined, args2.workingDir);
51748
51761
  const deps = createStopAgentTargetsDeps(args2);
51749
51762
  const discovered = await args2.apm.discoverStopTargets(args2.chatroomId);
51750
- const targets = discovered.filter((target) => normalizeAgentStopRole(target.role) === normalizeAgentStopRole(args2.role) && (!args2.workingDir || target.workingDir === args2.workingDir));
51763
+ const scopeDir = args2.workingDir ? normalizeWorkingDirForLookup(args2.workingDir) : undefined;
51764
+ const targets = discovered.filter((target) => normalizeAgentStopRole(target.role) === normalizeAgentStopRole(args2.role) && (scopeDir === undefined || target.workingDir !== undefined && normalizeWorkingDirForLookup(target.workingDir) === scopeDir));
51765
+ for (const target of targets) {
51766
+ if (target.workingDir !== undefined && target.workingDir !== args2.workingDir)
51767
+ args2.apm.markStopIntent(args2.chatroomId, args2.role, args2.reason, target.pid, target.workingDir);
51768
+ }
51751
51769
  return stopAgentTargets(deps, {
51752
51770
  chatroomId: args2.chatroomId,
51753
51771
  scope: { kind: "agent", role: args2.role },
@@ -72548,7 +72566,7 @@ var init_team_presets = __esm(() => {
72548
72566
  duo: {
72549
72567
  structureId: TEAM_STRUCTURE_IDS.duo,
72550
72568
  name: "Duo",
72551
- description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect, researcher, triage, reviewer, uiux-engineer, game-asset-designer, and verifier roles",
72569
+ description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect, product-manager, researcher, triage, reviewer, uiux-engineer, game-asset-designer, and verifier roles",
72552
72570
  roles: getBuiltinRolesForTeam("duo"),
72553
72571
  entryPoint: "planner",
72554
72572
  handoffGraph: "advisory",
@@ -72557,7 +72575,7 @@ var init_team_presets = __esm(() => {
72557
72575
  solo: {
72558
72576
  structureId: TEAM_STRUCTURE_IDS.solo,
72559
72577
  name: "Solo",
72560
- description: "A single agent working independently, with optional ephemeral architect, triage, uiux-engineer, and verifier roles",
72578
+ description: "A single agent working independently, with optional ephemeral architect, product-manager, triage, uiux-engineer, and verifier roles",
72561
72579
  roles: getBuiltinRolesForTeam("solo"),
72562
72580
  entryPoint: "solo",
72563
72581
  handoffGraph: "advisory",
@@ -72566,7 +72584,7 @@ var init_team_presets = __esm(() => {
72566
72584
  trio: {
72567
72585
  structureId: TEAM_STRUCTURE_IDS.trio,
72568
72586
  name: "Trio",
72569
- description: "A coordinator, specifier, and builder: the coordinator owns the user conversation and routes all work, the specifier turns plans into code-level builder briefs, with optional ephemeral architect, researcher, triage, reviewer, uiux-engineer, game-asset-designer, and verifier roles",
72587
+ description: "A coordinator, specifier, and builder: the coordinator owns the user conversation and routes all work, the specifier turns plans into code-level builder briefs, with optional ephemeral architect, product-manager, researcher, triage, reviewer, uiux-engineer, game-asset-designer, and verifier roles",
72570
72588
  roles: getBuiltinRolesForTeam("trio"),
72571
72589
  entryPoint: "coordinator",
72572
72590
  handoffGraph: "enforced",
@@ -73736,6 +73754,80 @@ var init_planner_game_asset_designer_chat = __esm(() => {
73736
73754
  init_planner_game_asset_designer_code();
73737
73755
  });
73738
73756
 
73757
+ // ../../services/backend/prompts/teams/product-manager-handoff-templates.ts
73758
+ function getEntryPointToProductManagerHandoffTemplate(query) {
73759
+ const entryPoint = query.fromRole;
73760
+ return `The automatically injected \`<user-message>\` is the authoritative request. Pass the feature request in the user's words, the problem it solves and who it is for, any constraints or decisions already made, and the areas of the app it likely touches. List the domain nouns the product manager must check for existing equivalents in the repository. Ask the product manager for a specification only: do not edit files, implement code, or design the technical architecture.
73761
+
73762
+ Use this for a new, ambiguous feature request whose scope is not yet decided. Skip it for small bug fixes and for requests whose scope is already unambiguous, unless a bug fix needs a scope decision.
73763
+
73764
+ After completing the specification, the product manager must return it to \`${entryPoint}\` with the normal handoff command.
73765
+
73766
+ \`\`\`bash
73767
+ ${handoffCommand({
73768
+ chatroomId: "<chatroom-id>",
73769
+ role: entryPoint,
73770
+ nextRole: "product-manager",
73771
+ cliEnvPrefix: ""
73772
+ })}
73773
+ \`\`\``;
73774
+ }
73775
+ function getProductManagerToEntryPointHandoffTemplate(query) {
73776
+ const entryPoint = query.toRole;
73777
+ return `Instructions (not part of the message): Return a complete product specification for the authoritative feature request. The product manager is advisory and read-only: do not edit files, build, or implement. Base every consistency claim on the existing app behavior you inspected, citing concrete repository paths and symbols, docs, or decision records under \`memory/\`. List open questions instead of guessing them. Begin with the \`## Summary\` section, then use the remaining sections below in order. Use \`###\` for sub-items within a section.
73778
+
73779
+ ## Summary
73780
+ <state the feature, the recommended scope in two to four sentences, and whether any open question blocks planning>
73781
+
73782
+ ## Problem statement
73783
+ <the problem the user is trying to solve, who is affected, and the outcome they want, recovered from the request and relevant history>
73784
+
73785
+ ## User stories
73786
+ <one \`###\` per story in the form "As a <user>, I want <capability>, so that <outcome>", each followed by a bullet list of testable acceptance criteria>
73787
+
73788
+ ## In scope
73789
+ <every capability, behavior, and state the feature includes, including the states needed to make it feature complete (loading, empty, error, permissions, and migration of existing data where they apply)>
73790
+
73791
+ ## Out of scope
73792
+ <each excluded or deferred item with a one-line reason; write exactly \`None observed.\` if nothing is excluded>
73793
+
73794
+ ## Consistency with existing functionality
73795
+ <the existing capabilities the feature must stay consistent with, with concrete paths and symbols as evidence; where the feature extends or conflicts with existing behavior, say so and mark each conflict as a decision for the user; the gaps the feature would leave if the proposed scope is not accepted>
73796
+
73797
+ ## UI and UX review
73798
+ <if the feature has any UI surface (a new screen, panel, flow, interaction, or visible state), state that \`${entryPoint}\` must get a \`uiux-engineer\` design before any UI work on this feature, and name each surface; do not design layout yourself. If the feature has no UI surface, write exactly \`No UI surface: no uiux-engineer design needed.\`>
73799
+
73800
+ ## Open questions for the user
73801
+ <each open question with the options, the consequence of each, and a recommended default; write exactly \`None observed.\` if none remain>
73802
+
73803
+ Instructions after the body (not part of the message): run the normal handoff command to \`${entryPoint}\` with the complete body above, then stop.
73804
+
73805
+ \`\`\`bash
73806
+ ${handoffCommand({
73807
+ chatroomId: "<chatroom-id>",
73808
+ role: "product-manager",
73809
+ nextRole: entryPoint,
73810
+ cliEnvPrefix: ""
73811
+ })}
73812
+ \`\`\``;
73813
+ }
73814
+ var init_product_manager_handoff_templates = __esm(() => {
73815
+ init_command2();
73816
+ });
73817
+
73818
+ // ../../services/backend/prompts/teams/duo/handoff-templates/planner-product-manager-code.ts
73819
+ function getPlannerProductManagerCodeTemplate(query) {
73820
+ return getEntryPointToProductManagerHandoffTemplate(query);
73821
+ }
73822
+ var init_planner_product_manager_code = __esm(() => {
73823
+ init_product_manager_handoff_templates();
73824
+ });
73825
+
73826
+ // ../../services/backend/prompts/teams/duo/handoff-templates/planner-product-manager-chat.ts
73827
+ var init_planner_product_manager_chat = __esm(() => {
73828
+ init_planner_product_manager_code();
73829
+ });
73830
+
73739
73831
  // ../../services/backend/prompts/teams/researcher-handoff-templates.ts
73740
73832
  function getEntryPointToResearcherHandoffTemplate(query) {
73741
73833
  const entryPoint = query.fromRole;
@@ -74430,6 +74522,8 @@ var init_planner = __esm(() => {
74430
74522
  init_planner_builder_code();
74431
74523
  init_planner_game_asset_designer_chat();
74432
74524
  init_planner_game_asset_designer_code();
74525
+ init_planner_product_manager_chat();
74526
+ init_planner_product_manager_code();
74433
74527
  init_planner_researcher_chat();
74434
74528
  init_planner_researcher_code();
74435
74529
  init_planner_reviewer_chat();
@@ -74449,6 +74543,7 @@ var init_planner = __esm(() => {
74449
74543
  "user",
74450
74544
  "builder",
74451
74545
  "architect",
74546
+ "product-manager",
74452
74547
  "uiux-engineer",
74453
74548
  "triage",
74454
74549
  "researcher",
@@ -74460,6 +74555,7 @@ var init_planner = __esm(() => {
74460
74555
  "user",
74461
74556
  "builder",
74462
74557
  "architect",
74558
+ "product-manager",
74463
74559
  "uiux-engineer",
74464
74560
  "triage",
74465
74561
  "researcher",
@@ -74476,6 +74572,10 @@ var init_planner = __esm(() => {
74476
74572
  chat: getPlannerArchitectCodeTemplate,
74477
74573
  code: getPlannerArchitectCodeTemplate
74478
74574
  }),
74575
+ "product-manager": handoffTemplateByMode({
74576
+ chat: getPlannerProductManagerCodeTemplate,
74577
+ code: getPlannerProductManagerCodeTemplate
74578
+ }),
74479
74579
  "uiux-engineer": handoffTemplateByMode({
74480
74580
  chat: getPlannerUiuxEngineerCodeTemplate,
74481
74581
  code: getPlannerUiuxEngineerCodeTemplate
@@ -74508,6 +74608,38 @@ var init_planner = __esm(() => {
74508
74608
  };
74509
74609
  });
74510
74610
 
74611
+ // ../../services/backend/prompts/teams/duo/handoff-templates/product-manager-planner-code.ts
74612
+ function getProductManagerPlannerCodeTemplate(query) {
74613
+ return getProductManagerToEntryPointHandoffTemplate(query);
74614
+ }
74615
+ var init_product_manager_planner_code = __esm(() => {
74616
+ init_product_manager_handoff_templates();
74617
+ });
74618
+
74619
+ // ../../services/backend/prompts/teams/duo/handoff-templates/product-manager-planner-chat.ts
74620
+ var init_product_manager_planner_chat = __esm(() => {
74621
+ init_product_manager_planner_code();
74622
+ });
74623
+
74624
+ // ../../services/backend/prompts/teams/duo/handoff-templates/product-manager.ts
74625
+ var duoProductManagerHandoffContract;
74626
+ var init_product_manager = __esm(() => {
74627
+ init_product_manager_planner_chat();
74628
+ init_product_manager_planner_code();
74629
+ init_contracts();
74630
+ duoProductManagerHandoffContract = {
74631
+ role: "product-manager",
74632
+ receivesFrom: ["planner"],
74633
+ returnsTo: ["planner"],
74634
+ outboundTemplates: {
74635
+ planner: handoffTemplateByMode({
74636
+ chat: getProductManagerPlannerCodeTemplate,
74637
+ code: getProductManagerPlannerCodeTemplate
74638
+ })
74639
+ }
74640
+ };
74641
+ });
74642
+
74511
74643
  // ../../services/backend/prompts/teams/duo/handoff-templates/researcher-planner-code.ts
74512
74644
  function getResearcherPlannerCodeTemplate(query) {
74513
74645
  return getResearcherToEntryPointHandoffTemplate(query);
@@ -74678,6 +74810,7 @@ var init_handoff_templates = __esm(() => {
74678
74810
  init_builder();
74679
74811
  init_game_asset_designer();
74680
74812
  init_planner();
74813
+ init_product_manager();
74681
74814
  init_researcher();
74682
74815
  init_reviewer();
74683
74816
  init_triage();
@@ -74688,6 +74821,7 @@ var init_handoff_templates = __esm(() => {
74688
74821
  planner: duoPlannerHandoffContract,
74689
74822
  builder: duoBuilderHandoffContract,
74690
74823
  architect: duoArchitectHandoffContract,
74824
+ "product-manager": duoProductManagerHandoffContract,
74691
74825
  researcher: duoResearcherHandoffContract,
74692
74826
  reviewer: duoReviewerHandoffContract,
74693
74827
  "uiux-engineer": duoUiuxEngineerHandoffContract,
@@ -74734,6 +74868,38 @@ var init_architect2 = __esm(() => {
74734
74868
  };
74735
74869
  });
74736
74870
 
74871
+ // ../../services/backend/prompts/teams/solo/handoff-templates/product-manager-solo-code.ts
74872
+ function getProductManagerSoloCodeTemplate(query) {
74873
+ return getProductManagerToEntryPointHandoffTemplate(query);
74874
+ }
74875
+ var init_product_manager_solo_code = __esm(() => {
74876
+ init_product_manager_handoff_templates();
74877
+ });
74878
+
74879
+ // ../../services/backend/prompts/teams/solo/handoff-templates/product-manager-solo-chat.ts
74880
+ var init_product_manager_solo_chat = __esm(() => {
74881
+ init_product_manager_solo_code();
74882
+ });
74883
+
74884
+ // ../../services/backend/prompts/teams/solo/handoff-templates/product-manager.ts
74885
+ var soloProductManagerHandoffContract;
74886
+ var init_product_manager2 = __esm(() => {
74887
+ init_product_manager_solo_chat();
74888
+ init_product_manager_solo_code();
74889
+ init_contracts();
74890
+ soloProductManagerHandoffContract = {
74891
+ role: "product-manager",
74892
+ receivesFrom: ["solo"],
74893
+ returnsTo: ["solo"],
74894
+ outboundTemplates: {
74895
+ solo: handoffTemplateByMode({
74896
+ chat: getProductManagerSoloCodeTemplate,
74897
+ code: getProductManagerSoloCodeTemplate
74898
+ })
74899
+ }
74900
+ };
74901
+ });
74902
+
74737
74903
  // ../../services/backend/prompts/teams/solo/handoff-templates/solo-architect-code.ts
74738
74904
  function getSoloArchitectCodeTemplate(query) {
74739
74905
  return getEntryPointToArchitectHandoffTemplate(query);
@@ -74747,6 +74913,19 @@ var init_solo_architect_chat = __esm(() => {
74747
74913
  init_solo_architect_code();
74748
74914
  });
74749
74915
 
74916
+ // ../../services/backend/prompts/teams/solo/handoff-templates/solo-product-manager-code.ts
74917
+ function getSoloProductManagerCodeTemplate(query) {
74918
+ return getEntryPointToProductManagerHandoffTemplate(query);
74919
+ }
74920
+ var init_solo_product_manager_code = __esm(() => {
74921
+ init_product_manager_handoff_templates();
74922
+ });
74923
+
74924
+ // ../../services/backend/prompts/teams/solo/handoff-templates/solo-product-manager-chat.ts
74925
+ var init_solo_product_manager_chat = __esm(() => {
74926
+ init_solo_product_manager_code();
74927
+ });
74928
+
74750
74929
  // ../../services/backend/prompts/teams/solo/handoff-templates/solo-triage-code.ts
74751
74930
  function getSoloTriageCodeTemplate(query) {
74752
74931
  return getEntryPointToTriageHandoffTemplate(query);
@@ -74806,6 +74985,8 @@ var soloHandoffContract;
74806
74985
  var init_solo = __esm(() => {
74807
74986
  init_solo_architect_chat();
74808
74987
  init_solo_architect_code();
74988
+ init_solo_product_manager_chat();
74989
+ init_solo_product_manager_code();
74809
74990
  init_solo_triage_chat();
74810
74991
  init_solo_triage_code();
74811
74992
  init_solo_uiux_engineer_chat();
@@ -74817,13 +74998,17 @@ var init_solo = __esm(() => {
74817
74998
  init_contracts();
74818
74999
  soloHandoffContract = {
74819
75000
  role: "solo",
74820
- receivesFrom: ["user", "architect", "uiux-engineer", "triage", "verifier"],
74821
- returnsTo: ["user", "architect", "uiux-engineer", "triage", "verifier"],
75001
+ receivesFrom: ["user", "architect", "product-manager", "uiux-engineer", "triage", "verifier"],
75002
+ returnsTo: ["user", "architect", "product-manager", "uiux-engineer", "triage", "verifier"],
74822
75003
  outboundTemplates: {
74823
75004
  architect: handoffTemplateByMode({
74824
75005
  chat: getSoloArchitectCodeTemplate,
74825
75006
  code: getSoloArchitectCodeTemplate
74826
75007
  }),
75008
+ "product-manager": handoffTemplateByMode({
75009
+ chat: getSoloProductManagerCodeTemplate,
75010
+ code: getSoloProductManagerCodeTemplate
75011
+ }),
74827
75012
  "uiux-engineer": handoffTemplateByMode({
74828
75013
  chat: getSoloUiuxEngineerCodeTemplate,
74829
75014
  code: getSoloUiuxEngineerCodeTemplate
@@ -74947,6 +75132,7 @@ function listSoloRoleHandoffContracts() {
74947
75132
  var SOLO_ROLE_HANDOFF_CATALOG, SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
74948
75133
  var init_handoff_templates2 = __esm(() => {
74949
75134
  init_architect2();
75135
+ init_product_manager2();
74950
75136
  init_solo();
74951
75137
  init_triage2();
74952
75138
  init_uiux_engineer2();
@@ -74955,6 +75141,7 @@ var init_handoff_templates2 = __esm(() => {
74955
75141
  SOLO_ROLE_HANDOFF_CATALOG = {
74956
75142
  solo: soloHandoffContract,
74957
75143
  architect: soloArchitectHandoffContract,
75144
+ "product-manager": soloProductManagerHandoffContract,
74958
75145
  "uiux-engineer": soloUiuxEngineerHandoffContract,
74959
75146
  triage: soloTriageHandoffContract,
74960
75147
  verifier: soloVerifierHandoffContract
@@ -75056,6 +75243,19 @@ var init_coordinator_game_asset_designer_chat = __esm(() => {
75056
75243
  init_coordinator_game_asset_designer_code();
75057
75244
  });
75058
75245
 
75246
+ // ../../services/backend/prompts/teams/trio/handoff-templates/coordinator-product-manager-code.ts
75247
+ function getCoordinatorProductManagerCodeTemplate(query) {
75248
+ return getEntryPointToProductManagerHandoffTemplate(query);
75249
+ }
75250
+ var init_coordinator_product_manager_code = __esm(() => {
75251
+ init_product_manager_handoff_templates();
75252
+ });
75253
+
75254
+ // ../../services/backend/prompts/teams/trio/handoff-templates/coordinator-product-manager-chat.ts
75255
+ var init_coordinator_product_manager_chat = __esm(() => {
75256
+ init_coordinator_product_manager_code();
75257
+ });
75258
+
75059
75259
  // ../../services/backend/prompts/teams/trio/handoff-templates/coordinator-researcher-code.ts
75060
75260
  function getCoordinatorResearcherCodeTemplate(query) {
75061
75261
  return getEntryPointToResearcherHandoffTemplate(query);
@@ -75187,6 +75387,8 @@ var init_coordinator = __esm(() => {
75187
75387
  init_coordinator_architect_code();
75188
75388
  init_coordinator_game_asset_designer_chat();
75189
75389
  init_coordinator_game_asset_designer_code();
75390
+ init_coordinator_product_manager_chat();
75391
+ init_coordinator_product_manager_code();
75190
75392
  init_coordinator_researcher_chat();
75191
75393
  init_coordinator_researcher_code();
75192
75394
  init_coordinator_reviewer_chat();
@@ -75208,6 +75410,7 @@ var init_coordinator = __esm(() => {
75208
75410
  "user",
75209
75411
  "specifier",
75210
75412
  "architect",
75413
+ "product-manager",
75211
75414
  "uiux-engineer",
75212
75415
  "triage",
75213
75416
  "researcher",
@@ -75219,6 +75422,7 @@ var init_coordinator = __esm(() => {
75219
75422
  "user",
75220
75423
  "specifier",
75221
75424
  "architect",
75425
+ "product-manager",
75222
75426
  "uiux-engineer",
75223
75427
  "triage",
75224
75428
  "researcher",
@@ -75239,6 +75443,10 @@ var init_coordinator = __esm(() => {
75239
75443
  chat: getCoordinatorArchitectCodeTemplate,
75240
75444
  code: getCoordinatorArchitectCodeTemplate
75241
75445
  }),
75446
+ "product-manager": handoffTemplateByMode({
75447
+ chat: getCoordinatorProductManagerCodeTemplate,
75448
+ code: getCoordinatorProductManagerCodeTemplate
75449
+ }),
75242
75450
  "uiux-engineer": handoffTemplateByMode({
75243
75451
  chat: getCoordinatorUiuxEngineerCodeTemplate,
75244
75452
  code: getCoordinatorUiuxEngineerCodeTemplate
@@ -75299,6 +75507,38 @@ var init_game_asset_designer2 = __esm(() => {
75299
75507
  };
75300
75508
  });
75301
75509
 
75510
+ // ../../services/backend/prompts/teams/trio/handoff-templates/product-manager-coordinator-code.ts
75511
+ function getProductManagerCoordinatorCodeTemplate(query) {
75512
+ return getProductManagerToEntryPointHandoffTemplate(query);
75513
+ }
75514
+ var init_product_manager_coordinator_code = __esm(() => {
75515
+ init_product_manager_handoff_templates();
75516
+ });
75517
+
75518
+ // ../../services/backend/prompts/teams/trio/handoff-templates/product-manager-coordinator-chat.ts
75519
+ var init_product_manager_coordinator_chat = __esm(() => {
75520
+ init_product_manager_coordinator_code();
75521
+ });
75522
+
75523
+ // ../../services/backend/prompts/teams/trio/handoff-templates/product-manager.ts
75524
+ var trioProductManagerHandoffContract;
75525
+ var init_product_manager3 = __esm(() => {
75526
+ init_product_manager_coordinator_chat();
75527
+ init_product_manager_coordinator_code();
75528
+ init_contracts();
75529
+ trioProductManagerHandoffContract = {
75530
+ role: "product-manager",
75531
+ receivesFrom: ["coordinator"],
75532
+ returnsTo: ["coordinator"],
75533
+ outboundTemplates: {
75534
+ coordinator: handoffTemplateByMode({
75535
+ chat: getProductManagerCoordinatorCodeTemplate,
75536
+ code: getProductManagerCoordinatorCodeTemplate
75537
+ })
75538
+ }
75539
+ };
75540
+ });
75541
+
75302
75542
  // ../../services/backend/prompts/teams/trio/handoff-templates/researcher-coordinator-code.ts
75303
75543
  function getResearcherCoordinatorCodeTemplate(query) {
75304
75544
  return getResearcherToEntryPointHandoffTemplate(query);
@@ -75586,6 +75826,7 @@ var init_handoff_templates3 = __esm(() => {
75586
75826
  init_builder2();
75587
75827
  init_coordinator();
75588
75828
  init_game_asset_designer2();
75829
+ init_product_manager3();
75589
75830
  init_researcher2();
75590
75831
  init_reviewer2();
75591
75832
  init_specifier();
@@ -75598,6 +75839,7 @@ var init_handoff_templates3 = __esm(() => {
75598
75839
  specifier: trioSpecifierHandoffContract,
75599
75840
  builder: trioBuilderHandoffContract,
75600
75841
  architect: trioArchitectHandoffContract,
75842
+ "product-manager": trioProductManagerHandoffContract,
75601
75843
  researcher: trioResearcherHandoffContract,
75602
75844
  reviewer: trioReviewerHandoffContract,
75603
75845
  "uiux-engineer": trioUiuxEngineerHandoffContract,
@@ -76242,6 +76484,33 @@ var init_planner2 = __esm(() => {
76242
76484
  init_sections();
76243
76485
  });
76244
76486
 
76487
+ // ../../services/backend/prompts/cli/roles/product-manager.ts
76488
+ var PRODUCT_MANAGER_GUIDANCE;
76489
+ var init_product_manager4 = __esm(() => {
76490
+ init_sections();
76491
+ PRODUCT_MANAGER_GUIDANCE = `## Product Manager Operating Model
76492
+
76493
+ You are the product manager responsible for turning a new, ambiguous feature request into a product specification: user stories with acceptance criteria and an explicit in-scope and out-of-scope decision. You are advisory and read-only: never edit repository files, never build, and never implement. You may read code and docs.
76494
+
76495
+ ${"{SESSION_CONTINUITY}"}
76496
+
76497
+ ${getInterRoleHandoffRule()}
76498
+
76499
+ 1. Recover the authoritative request from the injected task and chatroom history. State the problem the user is trying to solve and who benefits, in one paragraph. If the request is ambiguous, list what is unclear instead of guessing.
76500
+ 2. Before proposing any scope, inspect the existing app behavior the feature touches: the relevant code paths, UI, CLI commands, docs, and decision records under \`memory/\` (start at \`memory/index.md\`). Cite concrete paths and symbols. Search for existing capabilities that already do part of the job under another name.
76501
+ 3. Name the existing capabilities the feature must stay consistent with. Name the gaps the feature would leave if they are not in scope, so the delivered feature is complete and not a half-feature. Never propose scope that contradicts existing behavior without flagging it as a decision for the user.
76502
+ 4. Write user stories in the form "As a <user>, I want <capability>, so that <outcome>", each with testable acceptance criteria.
76503
+ 5. Decide scope explicitly: list what is in scope and what is out of scope, with a one-line reason for every out-of-scope item. Defer or exclude work; do not leave it unclassified.
76504
+ 6. List every open question for the user with the options, the consequence of each, and a recommended default. Do not answer product decisions that belong to the user.
76505
+ 7. State the UI and UX review the entry point owes. Your spec answers *what* and *whether*; \`uiux-engineer\` answers *how it looks and behaves* (flows, screens, layout, states, keyboard and responsive behavior). Never design layout yourself. In the \`## UI and UX review\` section, if the feature has any UI surface (a new screen, panel, flow, interaction, or visible state), remind \`{ENTRY_POINT_ROLE}\` that it must get a \`uiux-engineer\` design before any UI work on this new feature, and name each surface. If the feature has no UI surface, say so explicitly.
76506
+ 8. Write the spec using the sections in the injected \`<handoff-templates>\`, in the order given, beginning with the \`## Summary\` section.
76507
+ 9. Hand the spec to \`{ENTRY_POINT_ROLE}\` with the normal command, then stop. You cannot contact other roles directly.
76508
+
76509
+ \`\`\`bash
76510
+ chatroom handoff --chatroom-id="<chatroom-id>" --role="product-manager" --next-role="{ENTRY_POINT_ROLE}"
76511
+ \`\`\``;
76512
+ });
76513
+
76245
76514
  // ../../services/backend/prompts/cli/roles/researcher.ts
76246
76515
  var RESEARCHER_GUIDANCE;
76247
76516
  var init_researcher3 = __esm(() => {
@@ -76383,10 +76652,14 @@ var init_planner_guidance_context = __esm(() => {
76383
76652
  init_env();
76384
76653
  });
76385
76654
 
76655
+ // ../../services/backend/prompts/teams/entry-point-coordination-gates.ts
76656
+ var init_entry_point_coordination_gates = () => {};
76657
+
76386
76658
  // ../../services/backend/prompts/teams/solo/prompts/solo.ts
76387
76659
  var init_solo2 = __esm(() => {
76388
76660
  init_planner_guidance_context();
76389
76661
  init_sections();
76662
+ init_entry_point_coordination_gates();
76390
76663
  });
76391
76664
 
76392
76665
  // ../../services/backend/prompts/teams/solo/prompts/fromContext.ts
@@ -76400,6 +76673,7 @@ var init_fromContext2 = __esm(() => {
76400
76673
  init_builder3();
76401
76674
  init_game_asset_designer3();
76402
76675
  init_planner2();
76676
+ init_product_manager4();
76403
76677
  init_researcher3();
76404
76678
  init_reviewer3();
76405
76679
  init_triage4();
@@ -76413,10 +76687,12 @@ var init_fromContext2 = __esm(() => {
76413
76687
  var init_builder4 = __esm(() => {
76414
76688
  init_builder3();
76415
76689
  });
76690
+
76416
76691
  // ../../services/backend/prompts/teams/duo/prompts/planner.ts
76417
76692
  var init_planner3 = __esm(() => {
76418
76693
  init_planner_guidance_context();
76419
76694
  init_sections();
76695
+ init_entry_point_coordination_gates();
76420
76696
  });
76421
76697
 
76422
76698
  // ../../services/backend/prompts/teams/duo/prompts/fromContext.ts
@@ -76435,6 +76711,7 @@ var init_coordinator2 = __esm(() => {
76435
76711
  init_agent_role();
76436
76712
  init_planner_guidance_context();
76437
76713
  init_sections();
76714
+ init_entry_point_coordination_gates();
76438
76715
  });
76439
76716
 
76440
76717
  // ../../services/backend/prompts/teams/trio/prompts/specifier.ts
@@ -76548,6 +76825,20 @@ var init_templates = __esm(() => {
76548
76825
  ],
76549
76826
  defaultHandoffTarget: "planner"
76550
76827
  },
76828
+ "product-manager": {
76829
+ role: "product-manager",
76830
+ title: "Product Manager",
76831
+ description: "You are the product manager responsible for producing one product specification (user stories with acceptance criteria and an explicit in-scope and out-of-scope decision) that is feature complete and consistent with existing app behavior; you are not an implementer.",
76832
+ responsibilities: [
76833
+ "Recover the authoritative feature request and the problem it solves",
76834
+ "Inspect the existing app behavior, docs, and decision records the feature touches",
76835
+ "Write user stories with testable acceptance criteria",
76836
+ "Decide scope explicitly: in scope, out of scope, and the gaps an incomplete scope would leave",
76837
+ "Flag conflicts with existing behavior and list open questions for the user instead of guessing",
76838
+ "Hand one product specification back to the role that activated you"
76839
+ ],
76840
+ defaultHandoffTarget: "planner"
76841
+ },
76551
76842
  reviewer: {
76552
76843
  role: "reviewer",
76553
76844
  title: "Reviewer",
@@ -86037,11 +86328,6 @@ var init_skill = __esm(() => {
86037
86328
  init_terminal_safety();
86038
86329
  });
86039
86330
 
86040
- // src/infrastructure/services/workspace/normalize-working-dir.ts
86041
- function normalizeWorkingDirForLookup(workingDir) {
86042
- return workingDir.trim().replace(/[/\\]+$/, "");
86043
- }
86044
-
86045
86331
  // src/commands/workspace/file-tree.ts
86046
86332
  async function createDefaultDeps15() {
86047
86333
  const client2 = await getConvexClient();
@@ -103262,15 +103548,28 @@ async function executeChatroomStopCommand(args2) {
103262
103548
  args2.apm.markChatroomStopIntent(args2.chatroomId, "user.stop");
103263
103549
  }
103264
103550
  const confirmedDeps = args2.apm.getConfirmedStopAdapterDeps();
103551
+ const scopeDir = args2.workingDir ? normalizeWorkingDirForLookup(args2.workingDir) : undefined;
103552
+ const isInScope = (target) => scopeDir === undefined || target.workingDir !== undefined && normalizeWorkingDirForLookup(target.workingDir) === scopeDir;
103265
103553
  const targets = await args2.apm.discoverStopTargets(args2.chatroomId);
103266
- const roles = new Set(targets.filter((target) => target.chatroomId === args2.chatroomId && (!args2.role || target.role.toLowerCase() === args2.role.toLowerCase()) && (!args2.workingDir || target.workingDir === args2.workingDir)).map((target) => target.role.toLowerCase()));
103267
- if (args2.role)
103268
- roles.add(args2.role.toLowerCase());
103554
+ const roleWorkingDirs = new Map;
103555
+ for (const target of targets) {
103556
+ if (target.chatroomId !== args2.chatroomId)
103557
+ continue;
103558
+ const role = target.role.toLowerCase();
103559
+ if (args2.role && role !== args2.role.toLowerCase())
103560
+ continue;
103561
+ if (!isInScope(target) || roleWorkingDirs.has(role))
103562
+ continue;
103563
+ roleWorkingDirs.set(role, args2.workingDir ? target.workingDir : undefined);
103564
+ }
103565
+ if (args2.role && !roleWorkingDirs.has(args2.role.toLowerCase()))
103566
+ roleWorkingDirs.set(args2.role.toLowerCase(), args2.workingDir);
103269
103567
  if (!args2.role && !args2.workingDir) {
103270
103568
  for (const role of await args2.taskService.listMachineTaskRolesForChatroom(args2.chatroomId))
103271
- roles.add(role.toLowerCase());
103569
+ if (!roleWorkingDirs.has(role.toLowerCase()))
103570
+ roleWorkingDirs.set(role.toLowerCase(), undefined);
103272
103571
  }
103273
- const results2 = await Promise.allSettled([...roles].map((role) => args2.runSerializedForAgent({ chatroomId: args2.chatroomId, role, workingDir: args2.workingDir }, { timeoutMs: AGENT_LIFECYCLE_OPERATION_TIMEOUT_MS }, async (_ops, context3) => {
103572
+ const results2 = await Promise.allSettled([...roleWorkingDirs].map(([role, workingDir]) => args2.runSerializedForAgent({ chatroomId: args2.chatroomId, role, workingDir }, { timeoutMs: AGENT_LIFECYCLE_OPERATION_TIMEOUT_MS }, async (_ops, context3) => {
103274
103573
  if (context3.signal.aborted)
103275
103574
  throw context3.signal.reason;
103276
103575
  await args2.nativeDelivery.prepareRoleRecovery({ chatroomId: args2.chatroomId, role });
@@ -103280,13 +103579,13 @@ async function executeChatroomStopCommand(args2) {
103280
103579
  chatroomId: args2.chatroomId,
103281
103580
  role,
103282
103581
  reason: "user.stop",
103283
- workingDir: args2.workingDir
103582
+ workingDir
103284
103583
  });
103285
103584
  if (result3.failures.length > 0)
103286
103585
  throw new AggregateError(result3.failures.map((failure) => failure.error), `agent stop failed room=${args2.chatroomId} role=${role}`);
103287
103586
  if (args2.workingDir) {
103288
103587
  const remainingTargets = await args2.apm.discoverStopTargets(args2.chatroomId);
103289
- const liveOutsideScope = remainingTargets.some((target) => target.chatroomId === args2.chatroomId && target.role.toLowerCase() === role && target.workingDir !== args2.workingDir);
103588
+ const liveOutsideScope = remainingTargets.some((target) => target.chatroomId === args2.chatroomId && target.role.toLowerCase() === role && !isInScope(target));
103290
103589
  if (liveOutsideScope)
103291
103590
  throw new Error(`cannot recover role with a live process outside working directory room=${args2.chatroomId} role=${role}`);
103292
103591
  }
@@ -123885,4 +124184,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
123885
124184
  });
123886
124185
  program2.parse();
123887
124186
 
123888
- //# debugId=A53D39B9C99789DF64756E2164756E21
124187
+ //# debugId=90CD4346AAE69F5264756E2164756E21