chatroom-cli 1.76.0 → 1.77.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
@@ -76767,7 +76767,8 @@ var init_participant = __esm(() => {
76767
76767
  "task.inProgress",
76768
76768
  "task.completed",
76769
76769
  "agent.requestStop",
76770
- "agent.awaitingHandoff"
76770
+ "agent.awaitingHandoff",
76771
+ "agent.enhancing"
76771
76772
  ]);
76772
76773
  });
76773
76774
 
@@ -77365,6 +77366,38 @@ var init_builder_to_planner = __esm(() => {
77365
77366
  init_role_guidance_disclosure();
77366
77367
  });
77367
77368
 
77369
+ // ../../services/backend/prompts/teams/duo/handoff-templates/enhancer-to-planner.ts
77370
+ function getEnhancerToPlannerHandoffTemplate() {
77371
+ return `${getHandoffRecipientVisibilityCallout("planner")}
77372
+
77373
+ ${getHandoffReportTemplateIntro("Planning Feedback (Enhancer → Planner)")}
77374
+
77375
+ The planner sent you three XML sections: \`<user-message>\`, \`<grounding>\`, and a draft \`<builder-handoff>\`. Your job is **critical review** of all three — tighten their thinking toward a high-quality eventual handoff to the user. Do not explore the codebase or invent new scope.
77376
+
77377
+ \`\`\`markdown
77378
+ ## Summary
77379
+ <one paragraph: overall assessment of the planner's check-in — strengths and the main gaps to address>
77380
+
77381
+ ## User intent assessment
77382
+ <mistakes or misreadings in what the user may want; clarify the correct interpretation>
77383
+
77384
+ ## Knowledge gaps
77385
+ <facts, context, or research the planner is missing or has not surfaced>
77386
+
77387
+ ## Reasoning & logic
77388
+ <logical errors, weak inference chains, contradictions, or unsupported conclusions>
77389
+
77390
+ ## Alignment with user handoff
77391
+ <how to tighten the research and conclusions so the eventual planner→user report will be accurate, complete, and well-justified>
77392
+
77393
+ ## Recommended next steps
77394
+ <concrete actions for the planner: what to research, revise, validate, or decide before proceeding>
77395
+ \`\`\`
77396
+
77397
+ Return only the feedback markdown — no preamble. Follow this structure; omit sections that truly do not apply.`;
77398
+ }
77399
+ var init_enhancer_to_planner = () => {};
77400
+
77368
77401
  // ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-builder.ts
77369
77402
  function getPlannerToBuilderHandoffTemplate(nativeIntegration = false) {
77370
77403
  const sessionManagement = nativeIntegration ? `\`compact\` runs in-session context compaction via the SDK runtime. \`new_session\` starts a completely new session within the same process (not compaction). \`none\` continues the prior session. Tasks continue via injection.` : `\`compact\` is NOT supported — use \`none\` or \`new_session\`. \`new_session\` requires a hard restart (daemon stops agent, cold-starts, agent rejoins via \`get-next-task\`). \`none\` resumes prior session (\`wantResume=true\`).`;
@@ -77449,6 +77482,41 @@ Keep one slice ≈ one focused review surface. Delegate slices incrementally —
77449
77482
  }
77450
77483
  var init_planner_to_builder = () => {};
77451
77484
 
77485
+ // ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-enhancer.ts
77486
+ function getPlannerToEnhancerHandoffTemplate() {
77487
+ return `${getHandoffRecipientVisibilityCallout("enhancer")}
77488
+
77489
+ **Mandatory Planning Check-in (Planner → Enhancer)** — paste into the handoff message. **Do not skip this check-in** when the enhancer is enabled.
77490
+
77491
+ The enhancer has **no session context** — only this message. Use the three XML sections below **exactly** — they delimit what the enhancer will review.
77492
+
77493
+ \`\`\`markdown
77494
+ <user-message>
77495
+ <verbatim or faithful quote of the user's request — include constraints, priorities, and classification context if relevant>
77496
+ </user-message>
77497
+
77498
+ <grounding>
77499
+ <fully detailed research the enhancer cannot see from your session — be exhaustive>
77500
+
77501
+ Include:
77502
+ - **Existing code examples** — relevant snippets, patterns, and conventions already in the codebase
77503
+ - **File references** — paths to every file you investigated or plan to change
77504
+ - **Technology choices** — libraries, frameworks, APIs, and why they apply here
77505
+ - **Observations** — what you learned, edge cases, risks, and open questions from investigation
77506
+ ${getFileReferenceGuidanceComment()}
77507
+ </grounding>
77508
+
77509
+ <builder-handoff>
77510
+ <your complete, filled-in Delegation Brief for builder review — every section with real content, not placeholders>
77511
+
77512
+ Follow the **Handoff to \`builder\`** template structure (Summary, Goal, Files to implement, Requirements, etc.). The enhancer critiques this draft before you delegate.
77513
+ </builder-handoff>
77514
+ \`\`\`
77515
+
77516
+ After the enhancer returns feedback, you will receive it as a new planner task. Revise grounding and the builder handoff as needed, then proceed to \`builder\` or \`user\` as appropriate.`;
77517
+ }
77518
+ var init_planner_to_enhancer = () => {};
77519
+
77452
77520
  // ../../services/backend/prompts/cli/context/read.ts
77453
77521
  function contextReadCommand(params = {}) {
77454
77522
  const prefix = params.cliEnvPrefix ?? "";
@@ -77561,10 +77629,14 @@ function getDuoHandoffTemplate(query) {
77561
77629
  var DUO_HANDOFF_TEMPLATES;
77562
77630
  var init_handoff_templates = __esm(() => {
77563
77631
  init_builder_to_planner();
77632
+ init_enhancer_to_planner();
77564
77633
  init_planner_to_builder();
77634
+ init_planner_to_enhancer();
77565
77635
  init_planner_to_user();
77566
77636
  DUO_HANDOFF_TEMPLATES = {
77567
77637
  "planner:builder": (query) => getPlannerToBuilderHandoffTemplate(query.nativeIntegration),
77638
+ "planner:enhancer": () => getPlannerToEnhancerHandoffTemplate(),
77639
+ "enhancer:planner": () => getEnhancerToPlannerHandoffTemplate(),
77568
77640
  "planner:user": (query) => getPlannerToUserReportTemplate({
77569
77641
  chatroomId: query.chatroomId,
77570
77642
  role: query.role,
@@ -80386,11 +80458,33 @@ function composeSystemPrompt2(input) {
80386
80458
  });
80387
80459
  return composeSections(buildInitPromptSections(input, selectorCtx));
80388
80460
  }
80461
+ function isEnhancerCheckInQueuedHandoff(params) {
80462
+ return params.enhancerCheckInQueued === true && params.role.toLowerCase() === "planner" && params.nextRole.toLowerCase() === "enhancer";
80463
+ }
80464
+ function getEnhancerCheckInQueuedConfirmationLines() {
80465
+ return [
80466
+ "✅ Planning check-in queued for handoff enhancer",
80467
+ "",
80468
+ "Your check-in was sent to the handoff enhancer (async). You will receive planning feedback back as a planner task when review completes.",
80469
+ "**Run get-next-task now and end your turn** — do not wait for feedback, poll, or re-submit the handoff."
80470
+ ];
80471
+ }
80389
80472
  function generateHandoffOutput(params) {
80390
- const { role, nextRole, chatroomId, convexUrl, supportsNativeIntegration } = params;
80473
+ const {
80474
+ role,
80475
+ nextRole,
80476
+ chatroomId,
80477
+ convexUrl,
80478
+ supportsNativeIntegration,
80479
+ enhancerCheckInQueued
80480
+ } = params;
80391
80481
  const cliEnvPrefix = getCliEnvPrefix(convexUrl);
80392
80482
  const lines = [];
80393
- lines.push(`✅ Chatroom task completed and handed off to ${nextRole}`);
80483
+ if (isEnhancerCheckInQueuedHandoff({ role, nextRole, enhancerCheckInQueued })) {
80484
+ lines.push(...getEnhancerCheckInQueuedConfirmationLines());
80485
+ } else {
80486
+ lines.push(`✅ Chatroom task completed and handed off to ${nextRole}`);
80487
+ }
80394
80488
  if (supportsNativeIntegration) {
80395
80489
  lines.push(getNativeHandoffTurnEndGuidance(nextRole));
80396
80490
  } else {
@@ -115667,7 +115761,7 @@ handoffCommandGroup.requiredOption("--chatroom-id <id>", "Chatroom identifier").
115667
115761
  console.error("❌ Message is empty");
115668
115762
  process.exit(1);
115669
115763
  }
115670
- const shouldEnhance = options.role.toLowerCase() === "planner" && options.nextRole.toLowerCase() === "builder";
115764
+ const shouldEnhance = options.role.toLowerCase() === "planner" && options.nextRole.toLowerCase() === "enhancer";
115671
115765
  if (shouldEnhance) {
115672
115766
  const { api: api3 } = await Promise.resolve().then(() => (init_api3(), exports_api));
115673
115767
  const { getConvexClient: getConvexClient2 } = await Promise.resolve().then(() => (init_client2(), exports_client));
@@ -115695,7 +115789,8 @@ handoffCommandGroup.requiredOption("--chatroom-id <id>", "Chatroom identifier").
115695
115789
  role: options.role,
115696
115790
  nextRole: options.nextRole,
115697
115791
  chatroomId: options.chatroomId,
115698
- convexUrl
115792
+ convexUrl,
115793
+ enhancerCheckInQueued: true
115699
115794
  }));
115700
115795
  return;
115701
115796
  }
@@ -115703,7 +115798,7 @@ handoffCommandGroup.requiredOption("--chatroom-id <id>", "Chatroom identifier").
115703
115798
  const error51 = err;
115704
115799
  if (error51?.data?.code !== "ENHANCER_NOT_ENABLED") {
115705
115800
  console.error(`
115706
- ❌ ERROR: Enhancer interception failed`);
115801
+ ❌ ERROR: Enhancer check-in failed`);
115707
115802
  console.error(`
115708
115803
  ${error51?.data?.message ?? err.message}`);
115709
115804
  process.exit(1);
@@ -116052,4 +116147,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
116052
116147
  });
116053
116148
  program2.parse();
116054
116149
 
116055
- //# debugId=7F5BB9A13B1C8A7564756E2164756E21
116150
+ //# debugId=94A8E14D18276BBD64756E2164756E21