chatroom-cli 1.123.3 → 1.124.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
@@ -20376,6 +20376,10 @@ var init_agent_role = __esm(() => {
20376
20376
  { teamId: "duo", order: 40 },
20377
20377
  { teamId: "solo", order: 40 }
20378
20378
  ]
20379
+ },
20380
+ researcher: {
20381
+ tags: ["ephemeral" /* Ephemeral */],
20382
+ teams: [{ teamId: "duo", order: 25 }]
20379
20383
  }
20380
20384
  };
20381
20385
  AGENT_ROLE_DEFINITIONS = Object.fromEntries(Object.entries(roleMetadata).map(([role, metadata]) => [role, { role, ...metadata }]));
@@ -99325,7 +99329,7 @@ var init_team_presets = __esm(() => {
99325
99329
  duo: {
99326
99330
  structureId: TEAM_STRUCTURE_IDS.duo,
99327
99331
  name: "Duo",
99328
- description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect, triage, and uiux-engineer roles",
99332
+ description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect, researcher, triage, and uiux-engineer roles",
99329
99333
  roles: getBuiltinRolesForTeam("duo"),
99330
99334
  entryPoint: "planner"
99331
99335
  },
@@ -100007,6 +100011,8 @@ function getPlannerToBuilderHandoffTemplate() {
100007
100011
 
100008
100012
  ${getDelegationBriefIntro()}
100009
100013
 
100014
+ **Before you delegate:** if this slice introduces anything not yet grounded in the repository (a new library, API, external platform behavior, or an unresolved design choice), hand off to \`researcher\` first and delegate only after its brief returns. Skip this for small, well-understood edits. The \`researcher\` handoff template defines the criteria.
100015
+
100010
100016
  **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.
100011
100017
 
100012
100018
  **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.
@@ -100260,12 +100266,96 @@ function getChatToUserHandoffTemplate() {
100260
100266
  }
100261
100267
  var init_chat_handoff_template = () => {};
100262
100268
 
100263
- // ../../services/backend/prompts/teams/triage-handoff-templates.ts
100269
+ // ../../services/backend/prompts/teams/researcher-handoff-templates.ts
100264
100270
  function normalizeEntryPointRole3(entryPointRole) {
100265
100271
  return entryPointRole.trim().toLowerCase() || "planner";
100266
100272
  }
100267
- function getEntryPointToTriageHandoffTemplate(entryPointRole) {
100273
+ function getEntryPointToResearcherHandoffTemplate(entryPointRole) {
100268
100274
  const entryPoint = normalizeEntryPointRole3(entryPointRole);
100275
+ return `${getHandoffRecipientVisibilityCallout("researcher")}
100276
+
100277
+ ## Handoff Template (${entryPoint} → researcher)
100278
+
100279
+ The automatically injected \`<user-message>\` is the authoritative request. Pass the decisions the research must ground, the specific research questions, known constraints, and the files or areas already suspected. Ask the researcher for a report only: do not edit files, implement code, or design alternative architectures.
100280
+
100281
+ ### When to research
100282
+
100283
+ Research before delegating when the slice introduces something not already grounded in this repository:
100284
+ - a new library, API, external service, platform behavior, or version-sensitive dependency;
100285
+ - an unfamiliar subsystem;
100286
+ - a change with several plausible designs;
100287
+ - any ambiguity the user has not resolved.
100288
+
100289
+ Skip research when the change is a small, well-understood edit in code you have already inspected.
100290
+
100291
+ After completing the research, the researcher must return the evidence-backed brief to \`${entryPoint}\` with the normal handoff command.
100292
+
100293
+ \`\`\`bash
100294
+ ${handoffCommand({
100295
+ chatroomId: "<chatroom-id>",
100296
+ role: entryPoint,
100297
+ nextRole: "researcher",
100298
+ cliEnvPrefix: ""
100299
+ })}
100300
+ \`\`\``;
100301
+ }
100302
+ function getResearcherToEntryPointHandoffTemplate(entryPointRole) {
100303
+ const entryPoint = normalizeEntryPointRole3(entryPointRole);
100304
+ return `${getHandoffRecipientVisibilityCallout(entryPoint)}
100305
+
100306
+ ## Handoff Template (Researcher → ${entryPoint})
100307
+
100308
+ Return a complete, evidence-backed research brief for the authoritative request. The researcher is advisory: do not edit files, implement code, or present alternative architectures beyond what grounds the decision. Answer only the questions asked. Separate every finding into confirmed (with evidence), inferred (with reasoning), or unknown. Never present a guess as fact. External claims must cite the source URL together with the version or date checked. Use the exact sections below, in this order.
100309
+
100310
+ ## Summary
100311
+ <state the answer to the core question in two to four sentences and whether any decision remains open>
100312
+
100313
+ ## Research questions
100314
+ <list each question exactly as asked or as derived from the request, numbered>
100315
+
100316
+ ## Answers
100317
+ <one entry per question, each tagged \`confirmed\` (with evidence), \`inferred\` (with reasoning), or \`unknown\`>
100318
+
100319
+ ## Repository evidence
100320
+ <concrete repository paths and symbols with what each shows; quote the relevant lines briefly>
100321
+
100322
+ ## External sources
100323
+ <URL, version or date checked, and the specific claim each source supports; write exactly \`None consulted.\` if no external source was needed, and say why>
100324
+
100325
+ ## Grounded facts for the plan
100326
+ <the facts the planner can rely on when decomposing and delegating, each tagged confirmed or inferred>
100327
+
100328
+ ## Remaining ambiguity
100329
+ <each open decision, who must decide it, and a recommended default; write exactly \`None observed.\` if none remain>
100330
+
100331
+ ## Risks and constraints
100332
+ <constraints from the repository or external platform, and risks the plan must account for>
100333
+
100334
+ ## Work completed
100335
+ <paths inspected, searches run, and sources opened, with the result of each>
100336
+
100337
+ ## Handoff
100338
+ Run the normal handoff command to \`${entryPoint}\` with this complete brief, then stop.
100339
+
100340
+ \`\`\`bash
100341
+ ${handoffCommand({
100342
+ chatroomId: "<chatroom-id>",
100343
+ role: "researcher",
100344
+ nextRole: entryPoint,
100345
+ cliEnvPrefix: ""
100346
+ })}
100347
+ \`\`\``;
100348
+ }
100349
+ var init_researcher_handoff_templates = __esm(() => {
100350
+ init_command2();
100351
+ });
100352
+
100353
+ // ../../services/backend/prompts/teams/triage-handoff-templates.ts
100354
+ function normalizeEntryPointRole4(entryPointRole) {
100355
+ return entryPointRole.trim().toLowerCase() || "planner";
100356
+ }
100357
+ function getEntryPointToTriageHandoffTemplate(entryPointRole) {
100358
+ const entryPoint = normalizeEntryPointRole4(entryPointRole);
100269
100359
  return `${getHandoffRecipientVisibilityCallout("triage")}
100270
100360
 
100271
100361
  ## Handoff Template (${entryPoint} → triage)
@@ -100284,7 +100374,7 @@ ${handoffCommand({
100284
100374
  \`\`\``;
100285
100375
  }
100286
100376
  function getTriageToEntryPointHandoffTemplate(entryPointRole) {
100287
- const entryPoint = normalizeEntryPointRole3(entryPointRole);
100377
+ const entryPoint = normalizeEntryPointRole4(entryPointRole);
100288
100378
  return `${getHandoffRecipientVisibilityCallout(entryPoint)}
100289
100379
 
100290
100380
  ## Handoff Template (Triage → ${entryPoint})
@@ -100335,17 +100425,19 @@ var init_planner = __esm(() => {
100335
100425
  init_planner_to_user();
100336
100426
  init_chat_handoff_template();
100337
100427
  init_architect_handoff_templates();
100428
+ init_researcher_handoff_templates();
100338
100429
  init_triage_handoff_templates();
100339
100430
  init_uiux_engineer_handoff_templates();
100340
100431
  duoPlannerHandoffContract = {
100341
100432
  role: "planner",
100342
- receivesFrom: ["user", "builder", "architect", "uiux-engineer", "triage"],
100343
- returnsTo: ["builder", "architect", "uiux-engineer", "triage", "user"],
100433
+ receivesFrom: ["user", "builder", "architect", "uiux-engineer", "triage", "researcher"],
100434
+ returnsTo: ["builder", "architect", "uiux-engineer", "triage", "researcher", "user"],
100344
100435
  outboundTemplates: {
100345
100436
  builder: () => getPlannerToBuilderHandoffTemplate(),
100346
100437
  architect: () => getEntryPointToArchitectHandoffTemplate("planner"),
100347
100438
  "uiux-engineer": () => getEntryPointToUiuxEngineerHandoffTemplate("planner"),
100348
100439
  triage: () => getEntryPointToTriageHandoffTemplate("planner"),
100440
+ researcher: () => getEntryPointToResearcherHandoffTemplate("planner"),
100349
100441
  user: (query) => query.conversationMode === "chat" ? getChatToUserHandoffTemplate() : getPlannerToUserReportTemplate({
100350
100442
  chatroomId: query.chatroomId,
100351
100443
  role: query.role,
@@ -100355,6 +100447,20 @@ var init_planner = __esm(() => {
100355
100447
  };
100356
100448
  });
100357
100449
 
100450
+ // ../../services/backend/prompts/teams/duo/handoff-templates/researcher.ts
100451
+ var duoResearcherHandoffContract;
100452
+ var init_researcher = __esm(() => {
100453
+ init_researcher_handoff_templates();
100454
+ duoResearcherHandoffContract = {
100455
+ role: "researcher",
100456
+ receivesFrom: ["planner"],
100457
+ returnsTo: ["planner"],
100458
+ outboundTemplates: {
100459
+ planner: () => getResearcherToEntryPointHandoffTemplate("planner")
100460
+ }
100461
+ };
100462
+ });
100463
+
100358
100464
  // ../../services/backend/prompts/teams/duo/handoff-templates/triage.ts
100359
100465
  var duoTriageHandoffContract;
100360
100466
  var init_triage = __esm(() => {
@@ -100524,6 +100630,7 @@ var init_handoff_templates = __esm(() => {
100524
100630
  init_architect();
100525
100631
  init_builder();
100526
100632
  init_planner();
100633
+ init_researcher();
100527
100634
  init_triage();
100528
100635
  init_uiux_engineer();
100529
100636
  init_contracts();
@@ -100531,6 +100638,7 @@ var init_handoff_templates = __esm(() => {
100531
100638
  planner: duoPlannerHandoffContract,
100532
100639
  builder: duoBuilderHandoffContract,
100533
100640
  architect: duoArchitectHandoffContract,
100641
+ researcher: duoResearcherHandoffContract,
100534
100642
  "uiux-engineer": duoUiuxEngineerHandoffContract,
100535
100643
  triage: duoTriageHandoffContract
100536
100644
  };
@@ -101143,6 +101251,31 @@ var init_planner2 = __esm(() => {
101143
101251
  init_sections();
101144
101252
  });
101145
101253
 
101254
+ // ../../services/backend/prompts/cli/roles/researcher.ts
101255
+ var RESEARCHER_GUIDANCE;
101256
+ var init_researcher2 = __esm(() => {
101257
+ init_sections();
101258
+ RESEARCHER_GUIDANCE = `## Researcher Operating Model
101259
+
101260
+ You are the researcher responsible for grounding a request with evidence so the planner can decide and delegate without ambiguity. You are advisory only: do not edit files, implement code, or act as the builder or planner.
101261
+
101262
+ ${"{SESSION_CONTINUITY}"}
101263
+
101264
+ ${getInterRoleHandoffRule()}
101265
+
101266
+ 1. Recover the authoritative request and the research questions from the injected task and chatroom history. If the questions are not explicit, derive the decisions the planner must make and answer those.
101267
+ 2. Investigate the repository first: existing modules, APIs, types, patterns, tests, and conventions that bear on the request. Cite concrete paths and symbols.
101268
+ 3. Investigate external sources when the request depends on libraries, APIs, platform behavior, versions, or recent changes. Prefer official documentation and primary sources. Record the URL, the version, and the date checked.
101269
+ 4. Label every finding \`confirmed\`, \`inferred\`, or \`unknown\`. Never present a guess as fact.
101270
+ 5. Resolve ambiguity where evidence allows. For the rest, state the open question, who must decide it, and a recommended default.
101271
+ 6. Follow the injected \`<handoff-templates>\` research brief exactly, in its order. Answer only the questions asked. Do not present alternative architectures beyond what grounds the decision.
101272
+ 7. Hand the brief to the configured entry point with the normal command, then stop:
101273
+
101274
+ \`\`\`bash
101275
+ chatroom handoff --chatroom-id="<chatroom-id>" --role="researcher" --next-role="{ENTRY_POINT_ROLE}"
101276
+ \`\`\``;
101277
+ });
101278
+
101146
101279
  // ../../services/backend/prompts/cli/roles/uiux-engineer.ts
101147
101280
  var UIUX_ENGINEER_GUIDANCE;
101148
101281
  var init_uiux_engineer3 = __esm(() => {
@@ -101191,6 +101324,7 @@ var init_fromContext2 = __esm(() => {
101191
101324
  init_architect3();
101192
101325
  init_builder2();
101193
101326
  init_planner2();
101327
+ init_researcher2();
101194
101328
  init_uiux_engineer3();
101195
101329
  init_fromContext();
101196
101330
  });
@@ -101268,6 +101402,19 @@ var init_templates = __esm(() => {
101268
101402
  ],
101269
101403
  defaultHandoffTarget: "planner"
101270
101404
  },
101405
+ researcher: {
101406
+ role: "researcher",
101407
+ title: "Researcher",
101408
+ description: "You are the researcher responsible for producing one evidence-backed research brief that grounds the request for planning; you are not an implementer.",
101409
+ responsibilities: [
101410
+ "Recover the authoritative user request and the decisions the planner must make",
101411
+ "Inspect the repository for existing code, patterns, and constraints that bear on the request",
101412
+ "Consult official documentation and primary sources for external facts, APIs, versions, and behavior",
101413
+ "Label every finding as confirmed, inferred, or unknown, with citations",
101414
+ "Hand one grounded research brief to the planner, including the remaining ambiguity and a recommended default"
101415
+ ],
101416
+ defaultHandoffTarget: "planner"
101417
+ },
101271
101418
  triage: {
101272
101419
  role: "triage",
101273
101420
  title: "Triage Agent",
@@ -128856,4 +129003,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
128856
129003
  });
128857
129004
  program2.parse();
128858
129005
 
128859
- //# debugId=A4F00C6913ED47A764756E2164756E21
129006
+ //# debugId=63EAC0BA8745C9A064756E2164756E21