chatroom-cli 1.118.0 → 1.119.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
@@ -27792,6 +27792,100 @@ var init_base_cli_agent_service = __esm(() => {
27792
27792
  retrySchedule = exports_Schedule.exponential(exports_Duration.millis(DETECTION_RETRY_POLICY.initialDelayMs), DETECTION_RETRY_POLICY.backoffFactor).pipe(exports_Schedule.either(exports_Schedule.spaced(exports_Duration.millis(DETECTION_RETRY_POLICY.maxDelayMs))), exports_Schedule.compose(exports_Schedule.recurs(DETECTION_RETRY_POLICY.maxAttempts - 1)));
27793
27793
  });
27794
27794
 
27795
+ // ../../services/backend/src/domain/entities/_shared/v-literals-of.ts
27796
+ var toLiteralValidators = (values3) => values3.map((v_) => v.literal(v_));
27797
+ var init_v_literals_of = __esm(() => {
27798
+ init_values();
27799
+ });
27800
+
27801
+ // ../../services/backend/src/domain/entities/agent.ts
27802
+ var AGENT_HARNESSES, AgentHarnessEnum, agentHarnessValidator, AGENT_TYPES, AgentTypeEnum, agentTypeValidator, MACHINE_COMMAND_TYPES, MachineCommandTypeEnum, machineCommandTypeValidator, MACHINE_COMMAND_STATUSES, MachineCommandStatusEnum, machineCommandStatusValidator, AgentStartReasonCode, AGENT_START_REASONS, DaemonStartReasonCode, agentStartReasonValidator, USER_EXPLICIT_START_REASONS, EXPLICIT_DAEMON_START_REASONS, isExplicitDaemonStart = (reason) => EXPLICIT_DAEMON_START_REASONS.includes(reason), AGENT_STOP_REASONS, agentPostStopDesiredStateValidator, AgentStopReasonEnum, MODEL_SOURCES, ModelSourceEnum, modelSourceValidator;
27803
+ var init_agent = __esm(() => {
27804
+ init_values();
27805
+ init_v_literals_of();
27806
+ AGENT_HARNESSES = [
27807
+ "opencode",
27808
+ "opencode-sdk",
27809
+ "pi",
27810
+ "pi-sdk",
27811
+ "cursor",
27812
+ "cursor-sdk",
27813
+ "claude",
27814
+ "claude-sdk",
27815
+ "codex-sdk",
27816
+ "copilot",
27817
+ "commandcode"
27818
+ ];
27819
+ AgentHarnessEnum = Object.fromEntries(AGENT_HARNESSES.map((h) => [h, h]));
27820
+ agentHarnessValidator = v.union(...toLiteralValidators(AGENT_HARNESSES));
27821
+ AGENT_TYPES = ["remote", "custom"];
27822
+ AgentTypeEnum = Object.fromEntries(AGENT_TYPES.map((t) => [t, t]));
27823
+ agentTypeValidator = v.union(...toLiteralValidators(AGENT_TYPES));
27824
+ MACHINE_COMMAND_TYPES = ["start-agent", "restart-agent", "ping", "status"];
27825
+ MachineCommandTypeEnum = Object.fromEntries(MACHINE_COMMAND_TYPES.map((c) => [c, c]));
27826
+ machineCommandTypeValidator = v.union(...toLiteralValidators(MACHINE_COMMAND_TYPES));
27827
+ MACHINE_COMMAND_STATUSES = ["pending", "completed", "failed"];
27828
+ MachineCommandStatusEnum = Object.fromEntries(MACHINE_COMMAND_STATUSES.map((s) => [s, s]));
27829
+ machineCommandStatusValidator = v.union(...toLiteralValidators(MACHINE_COMMAND_STATUSES));
27830
+ AgentStartReasonCode = {
27831
+ USER_START: "user.start",
27832
+ USER_RESTART: "user.restart",
27833
+ USER_MANUAL_SPAWN: "user.manual_spawn",
27834
+ PLATFORM_TASK_MONITOR_NUDGE: "platform.task_monitor_nudge",
27835
+ PLATFORM_TASK_START_IN_NEW_SESSION: "platform.task_start_in_new_session",
27836
+ PLATFORM_PENDING_TASK_WAKE: "platform.pending_task_wake",
27837
+ PLATFORM_AUTO_RESTART_ON_NEW_CONTEXT: "platform.auto_restart_on_new_context",
27838
+ PLATFORM_TEAM_SWITCH: "platform.team_switch",
27839
+ TEST: "test"
27840
+ };
27841
+ AGENT_START_REASONS = [
27842
+ AgentStartReasonCode.USER_START,
27843
+ AgentStartReasonCode.USER_RESTART,
27844
+ AgentStartReasonCode.USER_MANUAL_SPAWN,
27845
+ AgentStartReasonCode.PLATFORM_TASK_MONITOR_NUDGE,
27846
+ AgentStartReasonCode.PLATFORM_TASK_START_IN_NEW_SESSION,
27847
+ AgentStartReasonCode.PLATFORM_PENDING_TASK_WAKE,
27848
+ AgentStartReasonCode.PLATFORM_AUTO_RESTART_ON_NEW_CONTEXT,
27849
+ AgentStartReasonCode.PLATFORM_TEAM_SWITCH,
27850
+ AgentStartReasonCode.TEST
27851
+ ];
27852
+ DaemonStartReasonCode = {
27853
+ RESPAWN: "daemon.respawn"
27854
+ };
27855
+ agentStartReasonValidator = v.union(...toLiteralValidators(AGENT_START_REASONS));
27856
+ USER_EXPLICIT_START_REASONS = [
27857
+ AgentStartReasonCode.USER_START,
27858
+ AgentStartReasonCode.USER_RESTART
27859
+ ];
27860
+ EXPLICIT_DAEMON_START_REASONS = [
27861
+ ...USER_EXPLICIT_START_REASONS,
27862
+ AgentStartReasonCode.USER_MANUAL_SPAWN,
27863
+ AgentStartReasonCode.PLATFORM_TASK_MONITOR_NUDGE,
27864
+ AgentStartReasonCode.PLATFORM_PENDING_TASK_WAKE,
27865
+ AgentStartReasonCode.PLATFORM_TASK_START_IN_NEW_SESSION,
27866
+ DaemonStartReasonCode.RESPAWN
27867
+ ];
27868
+ AGENT_STOP_REASONS = [
27869
+ "user.stop",
27870
+ "user.restart",
27871
+ "platform.dedup",
27872
+ "platform.team_switch",
27873
+ "platform.task_monitor_nudge",
27874
+ "platform.task_start_in_new_session",
27875
+ "daemon.respawn",
27876
+ "daemon.shutdown",
27877
+ "daemon.stop_timeout",
27878
+ "platform.ephemeral_task_complete",
27879
+ "platform.task_cancelled",
27880
+ "test"
27881
+ ];
27882
+ agentPostStopDesiredStateValidator = v.union(v.literal("running"), v.literal("stopped"));
27883
+ AgentStopReasonEnum = Object.fromEntries(AGENT_STOP_REASONS.map((r) => [r, r]));
27884
+ MODEL_SOURCES = ["team_config", "none"];
27885
+ ModelSourceEnum = Object.fromEntries(MODEL_SOURCES.map((s) => [s, s]));
27886
+ modelSourceValidator = v.union(...toLiteralValidators(MODEL_SOURCES));
27887
+ });
27888
+
27795
27889
  // ../../services/backend/src/domain/entities/harness/claude-sdk.config.ts
27796
27890
  var claudeSdkCapabilities;
27797
27891
  var init_claude_sdk_config = __esm(() => {
@@ -28258,7 +28352,7 @@ function createAgentProcessManagerService(deps) {
28258
28352
  await awaitWithinDeadline(deps.execution.stop({
28259
28353
  chatroomId: input.chatroomId,
28260
28354
  role: input.role,
28261
- reason: "daemon.respawn",
28355
+ reason: DaemonStartReasonCode.RESPAWN,
28262
28356
  pid: slot.pid,
28263
28357
  workingDir: input.workingDir
28264
28358
  }), remaining, input.signal);
@@ -28368,6 +28462,7 @@ function createAgentProcessManagerService(deps) {
28368
28462
  }
28369
28463
  var NATIVE_DELIVERY_SLOT_WAIT_MS = 120000, SLOT_CHANGE_POLL_MS = 100;
28370
28464
  var init_agent_process_manager_service = __esm(() => {
28465
+ init_agent();
28371
28466
  init_types();
28372
28467
  init_check_agent_slot();
28373
28468
  });
@@ -28772,86 +28867,6 @@ var init_native_turn_phase = __esm(() => {
28772
28867
  init_agent_slot();
28773
28868
  });
28774
28869
 
28775
- // ../../services/backend/src/domain/entities/_shared/v-literals-of.ts
28776
- var toLiteralValidators = (values3) => values3.map((v_) => v.literal(v_));
28777
- var init_v_literals_of = __esm(() => {
28778
- init_values();
28779
- });
28780
-
28781
- // ../../services/backend/src/domain/entities/agent.ts
28782
- var AGENT_HARNESSES, AgentHarnessEnum, agentHarnessValidator, AGENT_TYPES, AgentTypeEnum, agentTypeValidator, MACHINE_COMMAND_TYPES, MachineCommandTypeEnum, machineCommandTypeValidator, MACHINE_COMMAND_STATUSES, MachineCommandStatusEnum, machineCommandStatusValidator, AGENT_START_REASONS, AgentStartReasonEnum, agentStartReasonValidator, USER_EXPLICIT_START_REASONS, EXPLICIT_DAEMON_START_REASONS, isExplicitDaemonStart = (reason) => EXPLICIT_DAEMON_START_REASONS.includes(reason), AGENT_STOP_REASONS, agentPostStopDesiredStateValidator, AgentStopReasonEnum, MODEL_SOURCES, ModelSourceEnum, modelSourceValidator;
28783
- var init_agent = __esm(() => {
28784
- init_values();
28785
- init_v_literals_of();
28786
- AGENT_HARNESSES = [
28787
- "opencode",
28788
- "opencode-sdk",
28789
- "pi",
28790
- "pi-sdk",
28791
- "cursor",
28792
- "cursor-sdk",
28793
- "claude",
28794
- "claude-sdk",
28795
- "codex-sdk",
28796
- "copilot",
28797
- "commandcode"
28798
- ];
28799
- AgentHarnessEnum = Object.fromEntries(AGENT_HARNESSES.map((h) => [h, h]));
28800
- agentHarnessValidator = v.union(...toLiteralValidators(AGENT_HARNESSES));
28801
- AGENT_TYPES = ["remote", "custom"];
28802
- AgentTypeEnum = Object.fromEntries(AGENT_TYPES.map((t) => [t, t]));
28803
- agentTypeValidator = v.union(...toLiteralValidators(AGENT_TYPES));
28804
- MACHINE_COMMAND_TYPES = ["start-agent", "restart-agent", "ping", "status"];
28805
- MachineCommandTypeEnum = Object.fromEntries(MACHINE_COMMAND_TYPES.map((c) => [c, c]));
28806
- machineCommandTypeValidator = v.union(...toLiteralValidators(MACHINE_COMMAND_TYPES));
28807
- MACHINE_COMMAND_STATUSES = ["pending", "completed", "failed"];
28808
- MachineCommandStatusEnum = Object.fromEntries(MACHINE_COMMAND_STATUSES.map((s) => [s, s]));
28809
- machineCommandStatusValidator = v.union(...toLiteralValidators(MACHINE_COMMAND_STATUSES));
28810
- AGENT_START_REASONS = [
28811
- "user.start",
28812
- "user.restart",
28813
- "user.manual_spawn",
28814
- "platform.task_monitor_nudge",
28815
- "platform.task_start_in_new_session",
28816
- "platform.pending_task_wake",
28817
- "platform.auto_restart_on_new_context",
28818
- "platform.team_switch",
28819
- "test"
28820
- ];
28821
- AgentStartReasonEnum = Object.fromEntries(AGENT_START_REASONS.map((r) => [r, r]));
28822
- agentStartReasonValidator = v.union(...toLiteralValidators(AGENT_START_REASONS));
28823
- USER_EXPLICIT_START_REASONS = [
28824
- AgentStartReasonEnum["user.start"],
28825
- AgentStartReasonEnum["user.restart"]
28826
- ];
28827
- EXPLICIT_DAEMON_START_REASONS = [
28828
- ...USER_EXPLICIT_START_REASONS,
28829
- AgentStartReasonEnum["user.manual_spawn"],
28830
- AgentStartReasonEnum["platform.task_monitor_nudge"],
28831
- AgentStartReasonEnum["platform.task_start_in_new_session"],
28832
- "daemon.respawn"
28833
- ];
28834
- AGENT_STOP_REASONS = [
28835
- "user.stop",
28836
- "user.restart",
28837
- "platform.dedup",
28838
- "platform.team_switch",
28839
- "platform.task_monitor_nudge",
28840
- "platform.task_start_in_new_session",
28841
- "daemon.respawn",
28842
- "daemon.shutdown",
28843
- "daemon.stop_timeout",
28844
- "platform.ephemeral_task_complete",
28845
- "platform.task_cancelled",
28846
- "test"
28847
- ];
28848
- agentPostStopDesiredStateValidator = v.union(v.literal("running"), v.literal("stopped"));
28849
- AgentStopReasonEnum = Object.fromEntries(AGENT_STOP_REASONS.map((r) => [r, r]));
28850
- MODEL_SOURCES = ["team_config", "none"];
28851
- ModelSourceEnum = Object.fromEntries(MODEL_SOURCES.map((s) => [s, s]));
28852
- modelSourceValidator = v.union(...toLiteralValidators(MODEL_SOURCES));
28853
- });
28854
-
28855
28870
  // src/daemon/services/agent-process-service/infrastructure/adapters/orphan-process-tracker.ts
28856
28871
  import { createHash } from "node:crypto";
28857
28872
  import {
@@ -43674,7 +43689,7 @@ var init_agent_lifecycle_fact_schema = __esm(() => {
43674
43689
  ...agent,
43675
43690
  kind: exports_external.literal("status"),
43676
43691
  status: exports_external.enum(["offline", "starting", "waiting", "working", "stopping", "error"]),
43677
- errorSource: exports_external.enum(["configuration", "runtime", "task", "enhancer", "stop"]).optional(),
43692
+ errorSource: exports_external.enum(["configuration", "runtime", "task", "stop"]).optional(),
43678
43693
  errorCode: exports_external.string().optional(),
43679
43694
  errorMessage: exports_external.string().optional()
43680
43695
  }),
@@ -45410,7 +45425,7 @@ class AgentProcessManager {
45410
45425
  slot.state = AGENT_SLOT_STATE.STOPPING;
45411
45426
  const stopGeneration = this.bumpStopGeneration(slot);
45412
45427
  slot.stoppingSince = this.deps.clock.now();
45413
- await this.doStop(key, slot, pid, { chatroomId, role, reason: "daemon.respawn", workingDir }, stopGeneration);
45428
+ await this.doStop(key, slot, pid, { chatroomId, role, reason: DaemonStartReasonCode.RESPAWN, workingDir }, stopGeneration);
45414
45429
  }
45415
45430
  }
45416
45431
  async killPersistedProcessIfAlive(chatroomId, role, workingDir) {
@@ -45799,6 +45814,9 @@ class AgentProcessManager {
45799
45814
  }
45800
45815
  async doEnsureRunning(key, slot, opts) {
45801
45816
  slot.state = AGENT_SLOT_STATE.SPAWNING;
45817
+ const rateLimit = this.checkRateLimitGate(opts, slot);
45818
+ if (rateLimit)
45819
+ return rateLimit;
45802
45820
  const authorization = await this.deps.backend.mutation(api.machines.authorizeAgentStart, {
45803
45821
  sessionId: this.deps.sessionId,
45804
45822
  machineId: this.deps.machineId,
@@ -45813,9 +45831,6 @@ class AgentProcessManager {
45813
45831
  const wantResume = opts.wantResume;
45814
45832
  console.log(`[AgentProcessManager] harness start: role=${opts.role} harness=${opts.agentHarness} wantResume=${wantResume} reason=${opts.reason}`);
45815
45833
  try {
45816
- const rateLimit = this.checkRateLimitGate(opts, slot);
45817
- if (rateLimit)
45818
- return rateLimit;
45819
45834
  const workingDir = await this.validateWorkingDirGate(opts, slot);
45820
45835
  if (workingDir)
45821
45836
  return workingDir;
@@ -46229,7 +46244,7 @@ async function ensureColdSessionBeforeNativeInject(task, deps) {
46229
46244
  agentHarness,
46230
46245
  model,
46231
46246
  workingDir,
46232
- reason: AgentStartReasonEnum["platform.task_start_in_new_session"],
46247
+ reason: AgentStartReasonCode.PLATFORM_TASK_START_IN_NEW_SESSION,
46233
46248
  wantResume: false
46234
46249
  }, context5.signal);
46235
46250
  return waitForHarnessSessionId(deps.agentMgr, chatroomId, role, context5.signal);
@@ -47754,7 +47769,7 @@ async function processTasksUpdate(taskService, configurationService, pass, isTas
47754
47769
  agentHarness: agentConfig.agentHarness,
47755
47770
  model: agentConfig.model ?? "",
47756
47771
  workingDir: agentConfig.workingDir,
47757
- reason: AgentStartReasonEnum["platform.pending_task_wake"],
47772
+ reason: AgentStartReasonCode.PLATFORM_PENDING_TASK_WAKE,
47758
47773
  wantResume: false,
47759
47774
  taskId: task.taskId
47760
47775
  };
@@ -106971,15 +106986,15 @@ var init_team_presets = __esm(() => {
106971
106986
  duo: {
106972
106987
  structureId: TEAM_STRUCTURE_IDS.duo,
106973
106988
  name: "Duo",
106974
- description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral enhancer",
106975
- roles: ["planner", "enhancer", "builder"],
106989
+ description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect and optional ephemeral uiux-engineer roles",
106990
+ roles: ["planner", "architect", "uiux-engineer", "builder"],
106976
106991
  entryPoint: "planner"
106977
106992
  },
106978
106993
  solo: {
106979
106994
  structureId: TEAM_STRUCTURE_IDS.solo,
106980
106995
  name: "Solo",
106981
- description: "A single agent working independently, with optional ephemeral enhancer",
106982
- roles: ["solo", "enhancer"],
106996
+ description: "A single agent working independently, with optional ephemeral architect and optional ephemeral uiux-engineer roles",
106997
+ roles: ["solo", "architect", "uiux-engineer"],
106983
106998
  entryPoint: "solo"
106984
106999
  }
106985
107000
  };
@@ -107175,6 +107190,22 @@ var init_agent2 = __esm(() => {
107175
107190
  init_storage2();
107176
107191
  });
107177
107192
 
107193
+ // ../../services/backend/prompts/cli/handoff/command.ts
107194
+ function handoffCommand(params) {
107195
+ const prefix = params.cliEnvPrefix || "";
107196
+ const chatroomId = params.chatroomId || "<chatroom-id>";
107197
+ const role = params.role || "<role>";
107198
+ const nextRole = params.nextRole || "<target>";
107199
+ const placeholder = params.messagePlaceholder ?? "[Your message here]";
107200
+ const commandPrefix = `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="${nextRole}"`;
107201
+ return formatStdinHeredocCommand(commandPrefix, HANDOFF_STDIN_DELIMITER, placeholder, {
107202
+ messageMarker: HANDOFF_MESSAGE_MARKER
107203
+ });
107204
+ }
107205
+ var init_command2 = __esm(() => {
107206
+ init_stdin_heredoc();
107207
+ });
107208
+
107178
107209
  // ../../services/backend/prompts/native/handoff-visibility.ts
107179
107210
  function recipientLabel(toRole) {
107180
107211
  return toRole.toLowerCase() === "user" ? "The user" : `The \`${toRole}\` agent`;
@@ -107198,6 +107229,285 @@ Put your **complete** deliverable in the handoff message — not in session text
107198
107229
  ---`;
107199
107230
  }
107200
107231
 
107232
+ // ../../services/backend/prompts/utils/file-reference-guidance.ts
107233
+ function getFileReferenceGuidanceComment() {
107234
+ return `<!-- File references (clickable in workspace UI): use repo-relative paths with a file extension — e.g. \`apps/webapp/src/modules/chatroom/foo.ts\` or [apps/webapp/src/foo.ts](apps/webapp/src/foo.ts). Avoid absolute paths, file:// prefixes, and paths without / or extension. -->`;
107235
+ }
107236
+ function getFileReferenceProofOfCompletionExample() {
107237
+ return `${getFileReferenceGuidanceComment()}
107238
+ - \`apps/webapp/src/path/to/file.ts\` — <what changed and why>`;
107239
+ }
107240
+
107241
+ // ../../services/backend/prompts/teams/architect-handoff-templates.ts
107242
+ function normalizeEntryPointRole(entryPointRole) {
107243
+ return entryPointRole.trim().toLowerCase() || "planner";
107244
+ }
107245
+ function getArchitectFocus() {
107246
+ return "module boundaries, APIs, schemas, indexes and queries, invariants, failure and recovery handling, tests, and implementation sequence";
107247
+ }
107248
+ function getArchitectRequirements() {
107249
+ return `
107250
+ - Cite repository evidence for domain model/entity ownership, lifecycle, invariants, identifiers, and relationships.
107251
+ - Define service and module boundaries, public and internal APIs, function signatures, and ownership of side effects.
107252
+ - Analyze concurrency and races: concurrent writers, idempotency, ordering and monotonicity, retries, transactions, and failure/recovery behavior.
107253
+ - Design read patterns first: primary read paths, indexes, projections/read models, query shapes, scan and transaction limits, and invalidation/subscription scope.
107254
+ - Account for Convex reactivity and bandwidth: query invalidation patterns, avoiding unnecessary reactive fanout, and separating high-frequency heartbeat/liveness/status fields from low-frequency identity/configuration fields.
107255
+ - Specify concrete schema, query, and mutation changes; migration/backfill sequence; tests; and verification order.`;
107256
+ }
107257
+ function getEntryPointToArchitectHandoffTemplate(entryPointRole) {
107258
+ const entryPoint = normalizeEntryPointRole(entryPointRole);
107259
+ return `${getHandoffRecipientVisibilityCallout("architect")}
107260
+
107261
+ ## Handoff Template (${entryPoint} → architect)
107262
+
107263
+ The automatically injected \`<user-message>\` is the authoritative request. Add only concise context that the Architect needs to design within the existing repository and team scope.
107264
+
107265
+ Provide the request, relevant constraints, and the files or product surfaces that need inspection. Ask for one evidence-backed design focused on ${getArchitectFocus()}.
107266
+
107267
+ After completing the design, hand it back to \`${entryPoint}\` with the normal handoff command. Stop after the successful handoff; do not implement the design or delegate further work.
107268
+
107269
+ \`\`\`bash
107270
+ ${handoffCommand({
107271
+ chatroomId: "<chatroom-id>",
107272
+ role: "architect",
107273
+ nextRole: entryPoint,
107274
+ cliEnvPrefix: ""
107275
+ })}
107276
+ \`\`\``;
107277
+ }
107278
+ function getArchitectToEntryPointHandoffTemplate(entryPointRole) {
107279
+ return renderArchitectToEntryPointHandoffTemplate(normalizeEntryPointRole(entryPointRole));
107280
+ }
107281
+ function getGenericArchitectToEntryPointHandoffTemplate() {
107282
+ return renderArchitectToEntryPointHandoffTemplate("<entry-point-role>", true);
107283
+ }
107284
+ function renderArchitectToEntryPointHandoffTemplate(entryPoint, generic = false) {
107285
+ const sharedContractsHeading = !generic && entryPoint === "planner" ? "## Shared contracts (planner-owned)" : "## Shared contracts (configured entry-point-owned)";
107286
+ const placeholderInstruction = generic ? " Replace `<entry-point-role>` with the configured entry-point role before running it." : "";
107287
+ return `${getHandoffRecipientVisibilityCallout(entryPoint)}
107288
+
107289
+ ## Handoff Template (Architect → Entry Point)
107290
+
107291
+ Return exactly one recommended, evidence-backed design brief for the authoritative user request to the configured entry point. This is an advisory handback: do not implement code, edit files, spawn subagents, present alternatives, or expand scope. The injected \`<handoff-templates>\` block is the authoritative structure for this handoff; complete every section in order. Use \`Not Applicable.\` only when a section is genuinely inapplicable, with no explanation or filler.
107292
+
107293
+ ## Summary
107294
+ <describe the design problem being solved, the repository/product surface where it fits, and the evidence-backed context; do not refer to hidden session text>
107295
+
107296
+ ## Goal
107297
+ <state the one-sentence outcome this design delivers>
107298
+
107299
+ ## Key Knowledge for High Quality Bar
107300
+ <cite the inspected repository patterns and complete the architect checklist below; do not provide a high-level essay>
107301
+ - Produce exactly one recommended design for ${getArchitectFocus()}.
107302
+ - Name concrete repository paths, existing abstractions, APIs/types, state/data flow, acceptance criteria, risks, and verification steps.
107303
+ ${getArchitectRequirements()}
107304
+
107305
+ ## Force Multipliers
107306
+ <name the existing abstractions, patterns, utilities, and platform conventions to reuse, and state why each reduces implementation risk or duplication>
107307
+ - Keep the design within the repository's established source-of-truth boundaries and avoid introducing a new registry or abstraction without evidence.
107308
+
107309
+ ## Files to implement (exhaustive, file-level)
107310
+ List every file or product surface the implementer must create or modify. Mark each \`(Required)\` or \`(Optional)\`. For every file, give the exact responsibility, exported types/signatures/query shape, state/data/event boundaries, and target code detailed enough to implement without guessing.
107311
+ ${getFileReferenceGuidanceComment()}
107312
+
107313
+ ### \`<repo-relative/path.ext>\` (Required)
107314
+ **Change:** <precise add/modify/remove responsibility and why>
107315
+
107316
+ \`\`\`text
107317
+ // Target code, API/type signature, query shape, or migration/backfill step.
107318
+ // Enough detail that implementation requires no invention.
107319
+ \`\`\`
107320
+
107321
+ <add one block per file; do not collapse multiple files into a directory or vague layer>
107322
+
107323
+ ${sharedContractsHeading}
107324
+ <list cross-file interfaces, schemas, API contracts, state/data boundaries, or write exactly \`Not Applicable.\` when genuinely inapplicable>
107325
+
107326
+ ### Interfaces & types
107327
+ \`\`\`typescript
107328
+ // Shared signatures, schemas, query/mutation shapes, or state contracts.
107329
+ \`\`\`
107330
+
107331
+ ### Reference snippets
107332
+ \`\`\`typescript
107333
+ // Canonical imports, call patterns, or data-flow examples.
107334
+ \`\`\`
107335
+
107336
+ ## Requirements (acceptance criteria)
107337
+ - <one concrete, verifiable requirement per bullet; include exact data shape, API contract, migration result, and failure behavior>
107338
+ - Include repository test coverage for domain, concurrency, read-pattern, migration, and recovery risk areas.
107339
+ - Verify the implemented user-facing entry point or task-delivery path end-to-end; unit tests alone are insufficient.
107340
+
107341
+ ## What to avoid
107342
+ - Do not implement code or edit files as the architect; this handoff is advisory only.
107343
+ - Do not present alternative designs, generic advice, or requirements without concrete evidence and file-level consequences.
107344
+ - Do not invent APIs, schema fields, query shapes, indexes, or source-of-truth locations when existing repository patterns apply.
107345
+ - <explicit task-specific anti-patterns, scope boundaries, and migration/source-of-truth pitfalls>
107346
+
107347
+ ## Skills to activate
107348
+ - <relevant repository skills and why they apply, or write exactly \`Not Applicable.\` when none apply>
107349
+
107350
+ ## Out of scope
107351
+ - <explicit files, flows, behavior, or migration work the implementer must not touch>
107352
+
107353
+ ## Handoff
107354
+ Run the normal handoff command to the configured entry point with this complete design, then stop.${placeholderInstruction}
107355
+
107356
+ \`\`\`bash
107357
+ ${handoffCommand({
107358
+ chatroomId: "<chatroom-id>",
107359
+ role: "architect",
107360
+ nextRole: entryPoint,
107361
+ cliEnvPrefix: ""
107362
+ })}
107363
+ \`\`\``;
107364
+ }
107365
+ var init_architect_handoff_templates = __esm(() => {
107366
+ init_command2();
107367
+ });
107368
+
107369
+ // ../../services/backend/prompts/teams/uiux-engineer-handoff-templates.ts
107370
+ function normalizeEntryPointRole2(entryPointRole) {
107371
+ return entryPointRole.trim().toLowerCase() || "planner";
107372
+ }
107373
+ function getUiuxEngineerFocus() {
107374
+ return "complete user flows, loading/empty/error/success states, component ownership, theme tokens and layout, keyboard and accessibility behavior, responsive details, and UI tests";
107375
+ }
107376
+ function getUiuxEngineerRequirements() {
107377
+ return `
107378
+ - Specify complete user flows with explicit loading, empty, error, success, disabled, and retry states where applicable.
107379
+ - Define exact keyboard shortcuts, focus order, keyboard navigation, focus restoration, and accessible semantics and labels.
107380
+ - Define component hierarchy and ownership, props/state/events, data boundaries, and interaction behavior.
107381
+ - Choose concrete existing ShadCN components with the Base UI backend and lucide-react/react-icons conventions; do not write "use an appropriate component."
107382
+ - Specify Tailwind utility classes or semantic theme-token classes for layout, spacing, sizing, typography, states, responsive behavior, and dark mode.
107383
+ - Specify responsive breakpoints/layout behavior, visual feedback, destructive-action safeguards, exact files/components, and the UI/integration/accessibility test plan.`;
107384
+ }
107385
+ function getEntryPointToUiuxEngineerHandoffTemplate(entryPointRole) {
107386
+ const entryPoint = normalizeEntryPointRole2(entryPointRole);
107387
+ return `${getHandoffRecipientVisibilityCallout("uiux-engineer")}
107388
+
107389
+ ## Handoff Template (${entryPoint} → uiux-engineer)
107390
+
107391
+ The automatically injected \`<user-message>\` is the authoritative request. Add only concise context that the UI/UX Engineer needs to design within the existing repository and team scope.
107392
+
107393
+ Provide the request, relevant constraints, and the files or product surfaces that need inspection. Ask for one evidence-backed design focused on ${getUiuxEngineerFocus()}.
107394
+
107395
+ After completing the design, hand it back to \`${entryPoint}\` with the normal handoff command. Stop after the successful handoff; do not implement the design or delegate further work.
107396
+
107397
+ \`\`\`bash
107398
+ ${handoffCommand({
107399
+ chatroomId: "<chatroom-id>",
107400
+ role: "uiux-engineer",
107401
+ nextRole: entryPoint,
107402
+ cliEnvPrefix: ""
107403
+ })}
107404
+ \`\`\``;
107405
+ }
107406
+ function getUiuxEngineerToEntryPointHandoffTemplate(entryPointRole) {
107407
+ return renderUiuxEngineerToEntryPointHandoffTemplate(normalizeEntryPointRole2(entryPointRole));
107408
+ }
107409
+ function getGenericUiuxEngineerToEntryPointHandoffTemplate() {
107410
+ return renderUiuxEngineerToEntryPointHandoffTemplate("<entry-point-role>", true);
107411
+ }
107412
+ function renderUiuxEngineerToEntryPointHandoffTemplate(entryPoint, generic = false) {
107413
+ const sharedContractsHeading = !generic && entryPoint === "planner" ? "## Shared contracts (planner-owned)" : "## Shared contracts (configured entry-point-owned)";
107414
+ const placeholderInstruction = generic ? " Replace `<entry-point-role>` with the configured entry-point role before running it." : "";
107415
+ return `${getHandoffRecipientVisibilityCallout(entryPoint)}
107416
+
107417
+ ## Handoff Template (UI/UX Engineer → Entry Point)
107418
+
107419
+ Return exactly one recommended, evidence-backed design brief for the authoritative user request to the configured entry point. This is an advisory handback: do not implement code, edit files, spawn subagents, present alternatives, or expand scope. The injected \`<handoff-templates>\` block is the authoritative structure for this handoff; complete every section in order. Use \`Not Applicable.\` only when a section is genuinely inapplicable, with no explanation or filler.
107420
+
107421
+ ## Summary
107422
+ <describe the design problem being solved, the repository/product surface where it fits, and the evidence-backed context; do not refer to hidden session text>
107423
+
107424
+ ## Goal
107425
+ <state the one-sentence outcome this design delivers>
107426
+
107427
+ ## Key Knowledge for High Quality Bar
107428
+ <cite the inspected repository patterns and complete the UI/UX engineer checklist below; do not provide a high-level essay>
107429
+ - Produce exactly one recommended design for ${getUiuxEngineerFocus()}.
107430
+ - Name concrete repository paths, existing components/tokens, props/state/events, data boundaries, acceptance criteria, risks, and verification steps.
107431
+ ${getUiuxEngineerRequirements()}
107432
+
107433
+ ## Force Multipliers
107434
+ <name the existing components, patterns, tokens, utilities, and platform conventions to reuse, and state why each reduces implementation risk or duplication>
107435
+ - Keep the design within the repository's established source-of-truth boundaries and avoid introducing a new registry or abstraction without evidence.
107436
+
107437
+ ## Files to implement (exhaustive, file-level)
107438
+ List every file or product surface the implementer must create or modify. Mark each \`(Required)\` or \`(Optional)\`. For every file, give the exact responsibility, exported types/signatures/props, state/data/event boundaries, component hierarchy, and target Tailwind/theme-token snippet detailed enough to implement without guessing.
107439
+ ${getFileReferenceGuidanceComment()}
107440
+
107441
+ ### \`<repo-relative/path.ext>\` (Required)
107442
+ **Change:** <precise add/modify/remove responsibility and why>
107443
+
107444
+ \`\`\`text
107445
+ // Component hierarchy, props/state/events, test structure, or exact
107446
+ // Tailwind/theme-token classes. Enough detail that implementation requires no invention.
107447
+ \`\`\`
107448
+
107449
+ <add one block per file; do not collapse multiple files into a directory or vague layer>
107450
+
107451
+ ${sharedContractsHeading}
107452
+ <list cross-file interfaces, component/data contracts, state boundaries, or write exactly \`Not Applicable.\` when genuinely inapplicable>
107453
+
107454
+ ### Interfaces & types
107455
+ \`\`\`typescript
107456
+ // Shared props, state, events, query shapes, or accessibility contracts.
107457
+ \`\`\`
107458
+
107459
+ ### Reference snippets
107460
+ \`\`\`tsx
107461
+ // Canonical component imports, hook usage, keyboard wiring, or layout examples.
107462
+ \`\`\`
107463
+
107464
+ ## Requirements (acceptance criteria)
107465
+ - <one concrete, verifiable requirement per bullet; include exact states, interactions, semantics, classes/tokens, and responsive behavior>
107466
+ - Include UI, integration, and accessibility test coverage for the design's risk areas.
107467
+ - Verify the implemented user-facing entry point end-to-end; unit tests alone are insufficient.
107468
+
107469
+ ## What to avoid
107470
+ - Do not implement code or edit files as the UI/UX engineer; this handoff is advisory only.
107471
+ - Do not present alternative designs, generic advice, or requirements without concrete evidence and file-level consequences.
107472
+ - Do not invent components, props, tokens, keyboard behavior, or source-of-truth locations when existing repository patterns apply.
107473
+ - <explicit task-specific anti-patterns, scope boundaries, and destructive-action/source-of-truth pitfalls>
107474
+
107475
+ ## Skills to activate
107476
+ - <relevant repository skills and why they apply, or write exactly \`Not Applicable.\` when none apply>
107477
+
107478
+ ## Out of scope
107479
+ - <explicit files, flows, behavior, or migration work the implementer must not touch>
107480
+
107481
+ ## Handoff
107482
+ Run the normal handoff command to the configured entry point with this complete design, then stop.${placeholderInstruction}
107483
+
107484
+ \`\`\`bash
107485
+ ${handoffCommand({
107486
+ chatroomId: "<chatroom-id>",
107487
+ role: "uiux-engineer",
107488
+ nextRole: entryPoint,
107489
+ cliEnvPrefix: ""
107490
+ })}
107491
+ \`\`\``;
107492
+ }
107493
+ var init_uiux_engineer_handoff_templates = __esm(() => {
107494
+ init_command2();
107495
+ });
107496
+
107497
+ // ../../services/backend/prompts/teams/duo/handoff-templates/architect.ts
107498
+ var duoArchitectHandoffContract;
107499
+ var init_architect = __esm(() => {
107500
+ init_architect_handoff_templates();
107501
+ duoArchitectHandoffContract = {
107502
+ role: "architect",
107503
+ receivesFrom: ["planner"],
107504
+ returnsTo: ["planner"],
107505
+ outboundTemplates: {
107506
+ planner: () => getArchitectToEntryPointHandoffTemplate("planner")
107507
+ }
107508
+ };
107509
+ });
107510
+
107201
107511
  // ../../services/backend/prompts/utils/code-change-verification.ts
107202
107512
  var CODE_CHANGE_VERIFICATION_CONFIRMATION = "- [ ] I confirm that I have run typecheck and tests for the project (only required if code changes were made)";
107203
107513
 
@@ -107211,15 +107521,6 @@ ${getDelegationBriefDisclosureComment()}`;
107211
107521
  }
107212
107522
  var DELEGATION_BRIEF_DISCLOSURE_CHECKBOX = "- [ ] I confirm the delegation brief is fully met: all (Required) files done, verified end-to-end, acceptance criteria pass";
107213
107523
 
107214
- // ../../services/backend/prompts/utils/file-reference-guidance.ts
107215
- function getFileReferenceGuidanceComment() {
107216
- return `<!-- File references (clickable in workspace UI): use repo-relative paths with a file extension — e.g. \`apps/webapp/src/modules/chatroom/foo.ts\` or [apps/webapp/src/foo.ts](apps/webapp/src/foo.ts). Avoid absolute paths, file:// prefixes, and paths without / or extension. -->`;
107217
- }
107218
- function getFileReferenceProofOfCompletionExample() {
107219
- return `${getFileReferenceGuidanceComment()}
107220
- - \`apps/webapp/src/path/to/file.ts\` — <what changed and why>`;
107221
- }
107222
-
107223
107524
  // ../../services/backend/prompts/utils/handoff-section-guidance.ts
107224
107525
  function getHandoffNotApplicableSectionComment(context5) {
107225
107526
  return `<!-- REQUIRED. ${context5}, or write exactly "${HANDOFF_NOT_APPLICABLE_EXACT_TEXT}" with no explanation. Do not omit this section. -->`;
@@ -107360,217 +107661,6 @@ var init_builder = __esm(() => {
107360
107661
  };
107361
107662
  });
107362
107663
 
107363
- // ../../services/backend/src/domain/usecase/enhancer/enhancer-handoff-content.ts
107364
- var ENHANCER_USER_MESSAGE_PLACEHOLDER = "{{USER_MESSAGE}}";
107365
-
107366
- // ../../services/backend/prompts/utils/data-query-design.ts
107367
- function getDataQueryDesignTemplateBlock() {
107368
- return `## Persistent state and query pattern design
107369
-
107370
- **Goal:** Small updates must not cause large cache invalidations. High-frequency writes use projections to smaller tables.
107371
-
107372
- ### 1. Sources of concern
107373
- | Source | Write frequency | Read pattern | Risk |
107374
- |--------|---------------|--------------|------|
107375
- | \`<table/mutation>\` | \`<frequency>\` | \`<pattern>\` | \`<scan / hot partition>\` |
107376
-
107377
- ### 2. Schema design
107378
- **Hot path:** \`<table>\` — fields, projection from \`<source>\`
107379
- **Cold path:** \`<table>\` — …
107380
-
107381
- \`\`\`typescript
107382
- // target schema shape
107383
- \`\`\`
107384
-
107385
- ### 3. Index design (within limits)
107386
- | Table | Index | Serves query | Budget |
107387
- |-------|-------|--------------|--------|
107388
-
107389
- ### 4. Query design (within limits)
107390
- | Query | Index | Rows scanned | Timeout | Invalidation scope |
107391
- |-------|-------|--------------|---------|-------------------|
107392
-
107393
- \`\`\`typescript
107394
- // target query signature
107395
- \`\`\`
107396
-
107397
- <!-- Write exactly "Not Applicable." for the entire section if no persistence changes -->`;
107398
- }
107399
-
107400
- // ../../services/backend/prompts/utils/frontend-design-ux-checklist.ts
107401
- function getFrontendDesignUxPlanningPrinciplesBlock() {
107402
- return `<!-- Ground every flow in user history and repository patterns. Recommend one existing pattern when multiple exist; do not prescribe style choices the project has not adopted. -->`;
107403
- }
107404
- function getFrontendDesignUxFlowChecklistBlock() {
107405
- return `**UX quality (complete for every interactive step in this flow):**
107406
- - **States:** loading | empty | error | success — no blank panels, silent failures, or missing retry affordances
107407
- - **Layout:** stable across async transitions — no layout shift when content arrives or state changes
107408
- - **Patterns:** consistent with existing project components — cite the chosen pattern and repo-relative file
107409
- - **Shortcuts:** aligned with project keyboard/shortcut conventions; document tab order and gaps
107410
- - **Feedback:** timely response for async user actions
107411
- - **Interaction affordance:** pointer cursor (or project equivalent) on clickable elements
107412
- - **Safeguards:** confirmation before destructive actions; bulk operations confirmed with scope summary`;
107413
- }
107414
- function getFrontendDesignUxTriggerDescription() {
107415
- return "when the user request involves user interface changes";
107416
- }
107417
-
107418
- // ../../services/backend/prompts/utils/enhancer-feedback-template-body.ts
107419
- function getEnhancerFeedbackTemplateBody() {
107420
- return `<handoff-overview>
107421
- ## Summary
107422
- <one paragraph: what we're building and the single design direction>
107423
-
107424
- ## User intent and constraints
107425
- <explicit requirements from user messages; hard constraints that must not be violated>
107426
- </handoff-overview>
107427
-
107428
- <!-- UI collapses proofs, direction, frontend design, data design, and notes by default; overview and action required are expanded -->
107429
-
107430
- <handoff-proofs>
107431
- ## Repository evidence
107432
- <files read, current behavior verified, patterns reused — cite repo-relative paths and short snippets only>
107433
-
107434
- ${getHandoffQualityPrinciplesSectionBlock("design")}
107435
- </handoff-proofs>
107436
-
107437
- <handoff-direction>
107438
- ## Recommended design
107439
- <!-- ONE design only. No Option A/B/C. -->
107440
-
107441
- <2–4 sentences: the chosen architecture and why it fits the request and existing system>
107442
- </handoff-direction>
107443
-
107444
- <handoff-frontend-design>
107445
- ## Frontend / user-centric design
107446
-
107447
- ${getFrontendDesignUxPlanningPrinciplesBlock()}
107448
-
107449
- ### Flow 1: <name>
107450
- **Entry:** User visits \`<route/page>\` from \`<source>\`.
107451
-
107452
- | Step | User action | System response | UI state |
107453
- |------|-------------|-----------------|----------|
107454
- | 1 | User clicks \`<element label>\` | \`<navigation / modal / fetch>\` | \`<loading → success/error>\` |
107455
-
107456
- ${getFrontendDesignUxFlowChecklistBlock()}
107457
-
107458
- **Expected interactions per element:**
107459
- - \`<ElementName>\` (\`apps/webapp/src/...\`): click → \`<handler>\`; keyboard: \`<tab order>\`; disabled when \`<condition>\`
107460
-
107461
- ### Element, style, and layout specification
107462
-
107463
- #### \`<ComponentName>\` — \`apps/webapp/src/path/to/Component.tsx\`
107464
- **Change:** <create | modify>
107465
-
107466
- **Layout:** \`<div className="...">\` — flex/grid, gaps, breakpoints
107467
-
107468
- **States:** loading | empty | error | success
107469
-
107470
- \`\`\`tsx
107471
- export function ComponentName({ ... }: Props) {
107472
- // target structure — props, classNames, branches
107473
- }
107474
- \`\`\`
107475
-
107476
- <!-- Repeat per component; write exactly "Not Applicable." for the entire section if no UI -->
107477
- </handoff-frontend-design>
107478
-
107479
- <handoff-data-design>
107480
- ${getDataQueryDesignTemplateBlock()}
107481
- </handoff-data-design>
107482
-
107483
- <handoff-notes>
107484
- ## Open questions for user
107485
- <decisions only the user can make, or write "Not Applicable.">
107486
- </handoff-notes>
107487
-
107488
- <handoff-action>
107489
- ## Recommended implementation sequence
107490
- <!-- Ordered slices for the planner — references files from design sections. For large or multi-surface revisions, activate the defragmentation skill before delegating. -->
107491
-
107492
- 1. …
107493
- 2. …
107494
-
107495
- ## Files touched (index)
107496
- - \`apps/webapp/src/...\` — …
107497
- - \`services/backend/convex/...\` — …
107498
- </handoff-action>`;
107499
- }
107500
- var init_enhancer_feedback_template_body = __esm(() => {
107501
- init_handoff_quality_principles();
107502
- });
107503
-
107504
- // ../../services/backend/prompts/enhancer/handoff-templates.ts
107505
- function roleLabel(role) {
107506
- return role.charAt(0).toUpperCase() + role.slice(1).toLowerCase();
107507
- }
107508
- function getEntryPointToEnhancerHandoffTemplate(entryPointRole) {
107509
- const label = roleLabel(entryPointRole);
107510
- return `**Planning Request (${label} → Enhancer)** — after reading the user message and any pinned chatroom context, fill only <additional-context> below. The system injects the user message automatically — do not copy it.
107511
-
107512
- \`\`\`markdown
107513
- <user-message>
107514
- <!-- Injected automatically from the originating user message — do not edit or copy the user message here -->
107515
- ${ENHANCER_USER_MESSAGE_PLACEHOLDER}
107516
- </user-message>
107517
-
107518
- <additional-context>
107519
- ## Goal
107520
- <what the user wants in plain language — one short paragraph>
107521
- </additional-context>
107522
- \`\`\`
107523
-
107524
- After handoff succeeds, **end your turn immediately**. The enhancer independently downloads the originating message history and returns design input as your next ${entryPointRole.toLowerCase()} task.`;
107525
- }
107526
- function getEnhancerToEntryPointHandoffTemplate(entryPointRole) {
107527
- const normalizedRole = entryPointRole.toLowerCase();
107528
- const label = roleLabel(entryPointRole);
107529
- return `**Design Input (Enhancer → ${label})**
107530
-
107531
- You are the design authority for this request. Recover conversation history, inspect the repository, and return **one** complete design — not options. The ${normalizedRole} agent verifies your design and delegates implementation.
107532
-
107533
- **Rules:**
107534
- - Design first — complete frontend and data/query sections before implementation sequencing.
107535
- - **No alternative approaches** — one \`Recommended design\` only.
107536
- - Frontend and data sections: code granularity (component names, props, classes, file paths, schema, indexes, queries).
107537
- - Complete per-flow **UX quality** checklist in frontend design — states, layout stability, patterns, safeguards.
107538
- - For large or multi-surface revisions, note in implementation sequence that the entry point should activate the \`defragmentation\` skill.
107539
- - In \`<handoff-proofs>\`, complete **Proof of Principles** for how this design satisfies each quality principle (or "Not Applicable.").
107540
- - Write "Not Applicable." only when a major design section truly does not apply.
107541
-
107542
- \`\`\`markdown
107543
- ${getEnhancerFeedbackTemplateBody()}
107544
- \`\`\`
107545
-
107546
- Return only the design input markdown — no preamble. Follow this structure; use "Not Applicable." where a major section does not apply.`;
107547
- }
107548
- var init_handoff_templates = __esm(() => {
107549
- init_enhancer_feedback_template_body();
107550
- });
107551
-
107552
- // ../../services/backend/prompts/teams/duo/handoff-templates/enhancer-to-planner.ts
107553
- function getEnhancerToPlannerHandoffTemplate() {
107554
- return getEnhancerToEntryPointHandoffTemplate("planner");
107555
- }
107556
- var init_enhancer_to_planner = __esm(() => {
107557
- init_handoff_templates();
107558
- });
107559
-
107560
- // ../../services/backend/prompts/teams/duo/handoff-templates/enhancer.ts
107561
- var duoEnhancerHandoffContract;
107562
- var init_enhancer = __esm(() => {
107563
- init_enhancer_to_planner();
107564
- duoEnhancerHandoffContract = {
107565
- role: "enhancer",
107566
- receivesFrom: ["planner"],
107567
- returnsTo: ["planner"],
107568
- outboundTemplates: {
107569
- planner: () => getEnhancerToPlannerHandoffTemplate()
107570
- }
107571
- };
107572
- });
107573
-
107574
107664
  // ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-builder.ts
107575
107665
  function getPlannerToBuilderHandoffTemplate() {
107576
107666
  return `${getHandoffRecipientVisibilityCallout("builder")}
@@ -107647,14 +107737,6 @@ Keep one slice ≈ one focused review surface. Delegate slices incrementally —
107647
107737
  }
107648
107738
  var init_planner_to_builder = () => {};
107649
107739
 
107650
- // ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-enhancer.ts
107651
- function getPlannerToEnhancerHandoffTemplate() {
107652
- return getEntryPointToEnhancerHandoffTemplate("planner");
107653
- }
107654
- var init_planner_to_enhancer = __esm(() => {
107655
- init_handoff_templates();
107656
- });
107657
-
107658
107740
  // ../../services/backend/prompts/utils/context-disclosure.ts
107659
107741
  function getContextReadDisclosureComment(params = {}) {
107660
107742
  const command = contextReadCommand(params);
@@ -107842,16 +107924,18 @@ var init_chat_handoff_template = () => {};
107842
107924
  var duoPlannerHandoffContract;
107843
107925
  var init_planner = __esm(() => {
107844
107926
  init_planner_to_builder();
107845
- init_planner_to_enhancer();
107846
107927
  init_planner_to_user();
107847
107928
  init_chat_handoff_template();
107929
+ init_architect_handoff_templates();
107930
+ init_uiux_engineer_handoff_templates();
107848
107931
  duoPlannerHandoffContract = {
107849
107932
  role: "planner",
107850
- receivesFrom: ["user", "builder", "enhancer"],
107851
- returnsTo: ["builder", "enhancer", "user"],
107933
+ receivesFrom: ["user", "builder", "architect", "uiux-engineer"],
107934
+ returnsTo: ["builder", "architect", "uiux-engineer", "user"],
107852
107935
  outboundTemplates: {
107853
107936
  builder: () => getPlannerToBuilderHandoffTemplate(),
107854
- enhancer: () => getPlannerToEnhancerHandoffTemplate(),
107937
+ architect: () => getEntryPointToArchitectHandoffTemplate("planner"),
107938
+ "uiux-engineer": () => getEntryPointToUiuxEngineerHandoffTemplate("planner"),
107855
107939
  user: (query) => query.conversationMode === "chat" ? getChatToUserHandoffTemplate() : getPlannerToUserReportTemplate({
107856
107940
  chatroomId: query.chatroomId,
107857
107941
  role: query.role,
@@ -107861,6 +107945,20 @@ var init_planner = __esm(() => {
107861
107945
  };
107862
107946
  });
107863
107947
 
107948
+ // ../../services/backend/prompts/teams/duo/handoff-templates/uiux-engineer.ts
107949
+ var duoUiuxEngineerHandoffContract;
107950
+ var init_uiux_engineer = __esm(() => {
107951
+ init_uiux_engineer_handoff_templates();
107952
+ duoUiuxEngineerHandoffContract = {
107953
+ role: "uiux-engineer",
107954
+ receivesFrom: ["planner"],
107955
+ returnsTo: ["planner"],
107956
+ outboundTemplates: {
107957
+ planner: () => getUiuxEngineerToEntryPointHandoffTemplate("planner")
107958
+ }
107959
+ };
107960
+ });
107961
+
107864
107962
  // ../../services/backend/prompts/cli/handoff-templates/contracts.ts
107865
107963
  function validateRoleHandoffContracts(contracts) {
107866
107964
  const byRole = new Map;
@@ -107901,14 +107999,16 @@ function getDuoHandoffTemplate(query) {
107901
107999
  return getter?.(query) ?? null;
107902
108000
  }
107903
108001
  var DUO_ROLE_HANDOFF_CONTRACTS, validatedDuoRoleHandoffContracts;
107904
- var init_handoff_templates2 = __esm(() => {
108002
+ var init_handoff_templates = __esm(() => {
108003
+ init_architect();
107905
108004
  init_builder();
107906
- init_enhancer();
107907
108005
  init_planner();
108006
+ init_uiux_engineer();
107908
108007
  DUO_ROLE_HANDOFF_CONTRACTS = [
107909
108008
  duoPlannerHandoffContract,
107910
108009
  duoBuilderHandoffContract,
107911
- duoEnhancerHandoffContract
108010
+ duoArchitectHandoffContract,
108011
+ duoUiuxEngineerHandoffContract
107912
108012
  ];
107913
108013
  validatedDuoRoleHandoffContracts = (() => {
107914
108014
  validateRoleHandoffContracts(DUO_ROLE_HANDOFF_CONTRACTS);
@@ -107916,16 +108016,16 @@ var init_handoff_templates2 = __esm(() => {
107916
108016
  })();
107917
108017
  });
107918
108018
 
107919
- // ../../services/backend/prompts/teams/solo/handoff-templates/enhancer.ts
107920
- var soloEnhancerHandoffContract;
107921
- var init_enhancer2 = __esm(() => {
107922
- init_handoff_templates();
107923
- soloEnhancerHandoffContract = {
107924
- role: "enhancer",
108019
+ // ../../services/backend/prompts/teams/solo/handoff-templates/architect.ts
108020
+ var soloArchitectHandoffContract;
108021
+ var init_architect2 = __esm(() => {
108022
+ init_architect_handoff_templates();
108023
+ soloArchitectHandoffContract = {
108024
+ role: "architect",
107925
108025
  receivesFrom: ["solo"],
107926
108026
  returnsTo: ["solo"],
107927
108027
  outboundTemplates: {
107928
- solo: () => getEnhancerToEntryPointHandoffTemplate("solo")
108028
+ solo: () => getArchitectToEntryPointHandoffTemplate("solo")
107929
108029
  }
107930
108030
  };
107931
108031
  });
@@ -107948,14 +108048,16 @@ var init_solo_to_user = __esm(() => {
107948
108048
  var soloHandoffContract;
107949
108049
  var init_solo = __esm(() => {
107950
108050
  init_solo_to_user();
107951
- init_handoff_templates();
107952
108051
  init_chat_handoff_template();
108052
+ init_architect_handoff_templates();
108053
+ init_uiux_engineer_handoff_templates();
107953
108054
  soloHandoffContract = {
107954
108055
  role: "solo",
107955
- receivesFrom: ["user", "enhancer"],
107956
- returnsTo: ["user", "enhancer"],
108056
+ receivesFrom: ["user", "architect", "uiux-engineer"],
108057
+ returnsTo: ["architect", "uiux-engineer", "user"],
107957
108058
  outboundTemplates: {
107958
- enhancer: () => getEntryPointToEnhancerHandoffTemplate("solo"),
108059
+ architect: () => getEntryPointToArchitectHandoffTemplate("solo"),
108060
+ "uiux-engineer": () => getEntryPointToUiuxEngineerHandoffTemplate("solo"),
107959
108061
  user: (query) => query.conversationMode === "chat" ? getChatToUserHandoffTemplate() : getSoloToUserReportTemplate({
107960
108062
  chatroomId: query.chatroomId,
107961
108063
  role: query.role,
@@ -107965,6 +108067,20 @@ var init_solo = __esm(() => {
107965
108067
  };
107966
108068
  });
107967
108069
 
108070
+ // ../../services/backend/prompts/teams/solo/handoff-templates/uiux-engineer.ts
108071
+ var soloUiuxEngineerHandoffContract;
108072
+ var init_uiux_engineer2 = __esm(() => {
108073
+ init_uiux_engineer_handoff_templates();
108074
+ soloUiuxEngineerHandoffContract = {
108075
+ role: "uiux-engineer",
108076
+ receivesFrom: ["solo"],
108077
+ returnsTo: ["solo"],
108078
+ outboundTemplates: {
108079
+ solo: () => getUiuxEngineerToEntryPointHandoffTemplate("solo")
108080
+ }
108081
+ };
108082
+ });
108083
+
107968
108084
  // ../../services/backend/prompts/teams/solo/handoff-templates/index.ts
107969
108085
  function listSoloRoleHandoffContracts() {
107970
108086
  return validatedSoloRoleHandoffContracts;
@@ -107977,12 +108093,14 @@ function getSoloHandoffTemplate(query) {
107977
108093
  return getter?.(query) ?? null;
107978
108094
  }
107979
108095
  var SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
107980
- var init_handoff_templates3 = __esm(() => {
107981
- init_enhancer2();
108096
+ var init_handoff_templates2 = __esm(() => {
108097
+ init_architect2();
107982
108098
  init_solo();
108099
+ init_uiux_engineer2();
107983
108100
  SOLO_ROLE_HANDOFF_CONTRACTS = [
107984
108101
  soloHandoffContract,
107985
- soloEnhancerHandoffContract
108102
+ soloArchitectHandoffContract,
108103
+ soloUiuxEngineerHandoffContract
107986
108104
  ];
107987
108105
  validatedSoloRoleHandoffContracts = (() => {
107988
108106
  validateRoleHandoffContracts(SOLO_ROLE_HANDOFF_CONTRACTS);
@@ -108040,13 +108158,21 @@ function getHandoffTemplate(query) {
108040
108158
  return getSoloHandoffTemplate(query);
108041
108159
  return null;
108042
108160
  }
108043
- var init_handoff_templates4 = __esm(() => {
108161
+ var init_handoff_templates3 = __esm(() => {
108162
+ init_handoff_templates();
108044
108163
  init_handoff_templates2();
108045
- init_handoff_templates3();
108046
108164
  });
108047
108165
 
108048
108166
  // ../../services/backend/prompts/cli/handoff/view-template.ts
108049
108167
  function viewHandoffTemplate(params) {
108168
+ if (params.nextRole === undefined) {
108169
+ const role = params.role.trim().toLowerCase();
108170
+ if (role === "architect")
108171
+ return getGenericArchitectToEntryPointHandoffTemplate();
108172
+ if (role === "uiux-engineer")
108173
+ return getGenericUiuxEngineerToEntryPointHandoffTemplate();
108174
+ throw new Error(`Role-only handoff template viewing is supported only for architect or uiux-engineer, not ${params.role}`);
108175
+ }
108050
108176
  const template = getHandoffTemplate({
108051
108177
  fromRole: params.role,
108052
108178
  toRole: params.nextRole,
@@ -108059,7 +108185,9 @@ function viewHandoffTemplate(params) {
108059
108185
  return template;
108060
108186
  }
108061
108187
  var init_view_template2 = __esm(() => {
108062
- init_handoff_templates4();
108188
+ init_architect_handoff_templates();
108189
+ init_uiux_engineer_handoff_templates();
108190
+ init_handoff_templates3();
108063
108191
  });
108064
108192
 
108065
108193
  // src/commands/handoff/view-template.ts
@@ -108104,12 +108232,12 @@ function listHandoffTemplatesCommand(params) {
108104
108232
  });
108105
108233
  if (!listing) {
108106
108234
  const teamId = params.teamId ?? "duo";
108107
- throw new Error(`No handoff contract for role "${params.role}" in team "${teamId}". Known roles: planner, builder, enhancer (duo) or solo, enhancer (solo).`);
108235
+ throw new Error(`No handoff contract for role "${params.role}" in team "${teamId}". Known roles: planner, builder (duo) or solo.`);
108108
108236
  }
108109
108237
  return formatHandoffTemplateListing(listing);
108110
108238
  }
108111
108239
  var init_list_templates = __esm(() => {
108112
- init_handoff_templates4();
108240
+ init_handoff_templates3();
108113
108241
  });
108114
108242
 
108115
108243
  // src/commands/handoff/list-templates.ts
@@ -108276,30 +108404,43 @@ function formatDecodeError(error51) {
108276
108404
  return message;
108277
108405
  }
108278
108406
 
108279
- // ../../services/backend/prompts/config/agent-general-knowledge.ts
108280
- var init_agent_general_knowledge = () => {};
108407
+ // ../../services/backend/prompts/native/session-continuity.ts
108408
+ function getNativeHandoffTurnEndGuidance(nextRole) {
108409
+ return getHandoffTurnEndGuidance(nextRole);
108410
+ }
108411
+ function getHandoffTurnEndGuidance(nextRole) {
108412
+ const lines = [
108413
+ "",
108414
+ "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.**"
108415
+ ];
108416
+ if (nextRole.toLowerCase() === "user") {
108417
+ lines.push("The system delivers the next chatroom task when the user sends one.");
108418
+ } else {
108419
+ lines.push(`The system delivers \`${nextRole}\`'s handback when they finish — do not poll \`messages download\` while waiting. For history reconstruction tasks, \`messages download\` is the correct tool.`);
108420
+ }
108421
+ return lines.join(`
108422
+ `);
108423
+ }
108281
108424
  // ../../services/backend/prompts/sections/activated-skills.ts
108282
108425
  var init_activated_skills = () => {};
108283
108426
 
108284
108427
  // ../../services/backend/prompts/cli/backlog/command.ts
108285
- var init_command2 = __esm(() => {
108428
+ var init_command3 = __esm(() => {
108286
108429
  init_stdin_heredoc();
108287
108430
  });
108288
108431
 
108289
108432
  // ../../services/backend/src/domain/usecase/skills/modules/backlog/index.ts
108290
108433
  var init_backlog = __esm(() => {
108291
- init_command2();
108434
+ init_command3();
108292
108435
  });
108293
108436
 
108294
108437
  // ../../services/backend/src/domain/usecase/skills/modules/code-review/index.ts
108295
108438
  var init_code_review = () => {};
108296
-
108297
108439
  // ../../services/backend/src/domain/usecase/skills/modules/data-design/index.ts
108298
108440
  var init_data_design = () => {};
108299
108441
 
108300
108442
  // ../../services/backend/src/domain/usecase/skills/modules/defragmentation/index.ts
108301
108443
  var init_defragmentation = () => {};
108302
-
108303
108444
  // ../../services/backend/src/domain/usecase/skills/modules/user-centricity/index.ts
108304
108445
  var init_user_centricity = () => {};
108305
108446
 
@@ -108388,87 +108529,17 @@ var init_general_knowledge = __esm(() => {
108388
108529
  init_utils3();
108389
108530
  });
108390
108531
 
108391
- // ../../services/backend/prompts/enhancer/system-prompt.ts
108392
- var ENHANCER_ROLE_CONTRACT_LINES;
108393
- var init_system_prompt = __esm(() => {
108394
- init_stdin_heredoc();
108395
- init_agent_general_knowledge();
108396
- init_general_knowledge();
108397
- ENHANCER_ROLE_CONTRACT_LINES = [
108398
- "You are a single-turn, memoryless **design advisor**. Produce a high-intelligence first design for the user request; you are not an implementer.",
108399
- "",
108400
- "## Your role",
108401
- "- Recover the authoritative user request and relevant history before analysis.",
108402
- "- Inspect the repository and closely related files to understand existing patterns, constraints, and likely change surfaces.",
108403
- "- Return **one** complete recommended design — not multiple options. The entry point verifies and delegates.",
108404
- "- Complete frontend and data/query design sections at code granularity before implementation sequencing.",
108405
- "- Use <additional-context> from the forwarded request as the entry point's goal; verify against downloaded history and repository evidence.",
108406
- "- <user-message> is authoritative for what the user said; do not treat <additional-context> as a substitute.",
108407
- "- Give concrete, evidence-backed design input with repo-relative file references and targeted code snippets when useful.",
108408
- "- In <handoff-proofs>, complete **Proof of Principles** for how this design satisfies each quality principle.",
108409
- "- Keep the user request as the north star. Tighten within its scope; do not invent requirements.",
108410
- "- Your output becomes the first planning input to the stateful team entry point, which owns persistent memory, the ongoing plan, and execution.",
108411
- "",
108412
- `## Frontend design (${getFrontendDesignUxTriggerDescription()})`,
108413
- "- Complete <handoff-frontend-design> with flows, per-flow UX quality checklist, component specs, and layout at code granularity.",
108414
- "- Ground patterns in repository evidence — cite existing components; recommend one when multiple exist.",
108415
- '- Write "Not Applicable." for the entire section when no UI changes are involved.',
108416
- "",
108417
- "## Large or multi-surface revisions",
108418
- "- When the request involves refactoring, consolidation, or consistency across many surfaces, note in implementation sequence that the entry point should run `chatroom skill activate defragmentation` before delegating slices.",
108419
- "",
108420
- "## Data and query design (when persistence or query patterns change)",
108421
- "- Complete <handoff-data-design> with schema, indexes, and query patterns within project limits.",
108422
- '- Write "Not Applicable." for the entire section when no persistence changes are involved.',
108423
- "",
108424
- "## What you must NOT do",
108425
- "- Do NOT implement changes, spawn subagents, or expand scope.",
108426
- "- Do NOT propose multiple alternative approaches — one recommended design only.",
108427
- "- Do NOT produce generic advice. Tie findings to user messages, repository evidence, and named files.",
108428
- "- Do NOT treat <forwarded-request> as the only source of context; download message history first.",
108429
- "- Output must match <output-template>. **Recommended implementation sequence** and **Files touched** are the last sections."
108430
- ];
108431
- });
108432
-
108433
- // ../../services/backend/prompts/native/session-continuity.ts
108434
- function getNativeHandoffTurnEndGuidance(nextRole) {
108435
- return getHandoffTurnEndGuidance(nextRole);
108436
- }
108437
- function getHandoffTurnEndGuidance(nextRole) {
108438
- const lines = [
108439
- "",
108440
- "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.**"
108441
- ];
108442
- if (nextRole.toLowerCase() === "user") {
108443
- lines.push("The system delivers the next chatroom task when the user sends one.");
108444
- } else {
108445
- lines.push(`The system delivers \`${nextRole}\`'s handback when they finish — do not poll \`messages download\` while waiting. For history reconstruction tasks, \`messages download\` is the correct tool.`);
108446
- }
108447
- return lines.join(`
108448
- `);
108449
- }
108450
- function getNativeEnhancerRequestTurnEndGuidance() {
108451
- return [
108452
- "",
108453
- "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.**",
108454
- "Do **not** wait for enhancer input, poll, or monitor the enhancer job in this turn. The system delivers independent planning input as your next task when analysis completes."
108455
- ].join(`
108456
- `);
108457
- }
108458
-
108459
- // ../../services/backend/prompts/cli/handoff/command.ts
108460
- var init_command3 = __esm(() => {
108461
- init_stdin_heredoc();
108462
- });
108463
-
108464
108532
  // ../../services/backend/prompts/sections/commands-reference.ts
108465
108533
  var init_commands_reference = __esm(() => {
108466
108534
  init_general_knowledge();
108467
108535
  init_command();
108468
108536
  init_reminder();
108469
- init_command3();
108537
+ init_command2();
108470
108538
  init_utils3();
108471
108539
  });
108540
+
108541
+ // ../../services/backend/prompts/cli/roles/architect.ts
108542
+ var init_architect3 = () => {};
108472
108543
  // ../../services/backend/prompts/cli/sections/core-responsibilities.ts
108473
108544
  var init_core_responsibilities = () => {};
108474
108545
  // ../../services/backend/prompts/cli/sections/handoff-rules.ts
@@ -108498,6 +108569,9 @@ var init_planner2 = __esm(() => {
108498
108569
  init_sections();
108499
108570
  });
108500
108571
 
108572
+ // ../../services/backend/prompts/cli/roles/uiux-engineer.ts
108573
+ var init_uiux_engineer3 = () => {};
108574
+
108501
108575
  // ../../services/backend/prompts/cli/roles/planner-guidance-context.ts
108502
108576
  var init_planner_guidance_context = __esm(() => {
108503
108577
  init_env();
@@ -108516,11 +108590,11 @@ var init_fromContext = __esm(() => {
108516
108590
 
108517
108591
  // ../../services/backend/prompts/cli/roles/fromContext.ts
108518
108592
  var init_fromContext2 = __esm(() => {
108593
+ init_architect3();
108519
108594
  init_builder2();
108520
108595
  init_planner2();
108521
- init_system_prompt();
108596
+ init_uiux_engineer3();
108522
108597
  init_fromContext();
108523
- init_utils3();
108524
108598
  });
108525
108599
 
108526
108600
  // ../../services/backend/prompts/teams/duo/prompts/builder.ts
@@ -108552,7 +108626,9 @@ var init_role_guidance = __esm(() => {
108552
108626
  });
108553
108627
 
108554
108628
  // ../../services/backend/prompts/templates.ts
108555
- var init_templates = () => {};
108629
+ var init_templates = __esm(() => {
108630
+ init_agent_role();
108631
+ });
108556
108632
 
108557
108633
  // ../../services/backend/prompts/sections/role-identity.ts
108558
108634
  var init_role_identity = __esm(() => {
@@ -108560,14 +108636,12 @@ var init_role_identity = __esm(() => {
108560
108636
  });
108561
108637
 
108562
108638
  // ../../services/backend/prompts/native/system-prompt.ts
108563
- var init_system_prompt2 = __esm(() => {
108564
- init_system_prompt();
108639
+ var init_system_prompt = __esm(() => {
108565
108640
  init_commands_reference();
108566
108641
  init_general_knowledge();
108567
108642
  init_role_guidance();
108568
108643
  init_role_identity();
108569
108644
  init_selector_context();
108570
- init_utils3();
108571
108645
  });
108572
108646
 
108573
108647
  // ../../services/backend/prompts/native/task-started-content.ts
@@ -108601,40 +108675,12 @@ var init_session_vs_chatroom_task = () => {};
108601
108675
  // ../../services/backend/prompts/review-guidelines/index.ts
108602
108676
  var init_review_guidelines = () => {};
108603
108677
  // ../../services/backend/prompts/generator.ts
108604
- function isEnhancerRequestQueuedHandoff(params) {
108605
- return params.enhancerRequestQueued === true && params.nextRole.toLowerCase() === "enhancer";
108606
- }
108607
- function getEnhancerRequestQueuedConfirmationLines(nativeIntegration) {
108608
- const turnEndRule = nativeIntegration ? "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.** Do **not** wait for enhancer input, poll, monitor the enhancer, or re-submit the handoff. The system delivers independent planning input as your next task when analysis completes." : "**Run get-next-task now and end your turn — stop tool calls. The system will send you a message when further action is required.** Do **not** wait for enhancer input, poll, monitor the enhancer, or re-submit the handoff.";
108609
- return [
108610
- "✅ User request queued for handoff enhancer",
108611
- "",
108612
- "The user request was sent to the handoff enhancer (async). You will receive independent planning input as your next task when analysis completes.",
108613
- turnEndRule
108614
- ];
108615
- }
108616
108678
  function generateHandoffOutput(params) {
108617
- const {
108618
- role,
108619
- nextRole,
108620
- chatroomId,
108621
- convexUrl,
108622
- supportsNativeIntegration,
108623
- enhancerRequestQueued
108624
- } = params;
108679
+ const { role, nextRole, chatroomId, convexUrl, supportsNativeIntegration } = params;
108625
108680
  const cliEnvPrefix = getCliEnvPrefix(convexUrl);
108626
- const enhancerRequest = isEnhancerRequestQueuedHandoff({
108627
- nextRole,
108628
- enhancerRequestQueued
108629
- });
108630
- const lines = [];
108631
- if (enhancerRequest) {
108632
- lines.push(...getEnhancerRequestQueuedConfirmationLines(supportsNativeIntegration));
108633
- } else {
108634
- lines.push(`✅ Chatroom task completed and handed off to ${nextRole}`);
108635
- }
108681
+ const lines = [`✅ Chatroom task completed and handed off to ${nextRole}`];
108636
108682
  if (supportsNativeIntegration) {
108637
- lines.push(enhancerRequest ? getNativeEnhancerRequestTurnEndGuidance() : getNativeHandoffTurnEndGuidance(nextRole));
108683
+ lines.push(getNativeHandoffTurnEndGuidance(nextRole));
108638
108684
  } else {
108639
108685
  lines.push("");
108640
108686
  lines.push("✅ Level B complete (chatroom task handed off).");
@@ -108650,7 +108696,6 @@ var init_generator = __esm(() => {
108650
108696
  init_command();
108651
108697
  init_reminder();
108652
108698
  init_system_prompt();
108653
- init_system_prompt2();
108654
108699
  init_classification_guide();
108655
108700
  init_commands_reference();
108656
108701
  init_general_knowledge();
@@ -108812,8 +108857,7 @@ var handoffEffect = (chatroomId, options) => exports_Effect.gen(function* () {
108812
108857
  nextRole,
108813
108858
  chatroomId,
108814
108859
  convexUrl,
108815
- supportsNativeIntegration: result.supportsNativeIntegration,
108816
- enhancerRequestQueued: result.enhancerRequestQueued === true
108860
+ supportsNativeIntegration: result.supportsNativeIntegration
108817
108861
  }));
108818
108862
  });
108819
108863
  });
@@ -118412,7 +118456,7 @@ async function runRestartOrchestrator(deps, event) {
118412
118456
  agentHarness: event.agentHarness,
118413
118457
  model: event.model,
118414
118458
  workingDir: event.workingDir,
118415
- reason: "user.restart",
118459
+ reason: AgentStartReasonCode.USER_RESTART,
118416
118460
  wantResume: event.wantResume
118417
118461
  }, context5.signal);
118418
118462
  });
@@ -118426,7 +118470,7 @@ async function runRestartOrchestrator(deps, event) {
118426
118470
  await deps.runSerializedForAgent({ chatroomId, role, workingDir: event.workingDir }, { timeoutMs: HARNESS_SESSION_READY_TIMEOUT_MS }, (ops, context5) => ops.stopAgent({
118427
118471
  chatroomId,
118428
118472
  role,
118429
- reason: "user.restart",
118473
+ reason: AgentStartReasonCode.USER_RESTART,
118430
118474
  pid: spawnResult.pid,
118431
118475
  workingDir: event.workingDir
118432
118476
  }, context5.signal));
@@ -118457,6 +118501,7 @@ async function runRestartOrchestrator(deps, event) {
118457
118501
  }
118458
118502
  var init_restart_orchestrator = __esm(() => {
118459
118503
  init_reliability();
118504
+ init_agent();
118460
118505
  init_build_agent_restart_event();
118461
118506
  init_restart_orchestrator_in_flight();
118462
118507
  init_api3();
@@ -135583,10 +135628,10 @@ teamCommand.command("set").description("Set the team preset for a chatroom").req
135583
135628
  const { setTeam: setTeam2 } = await Promise.resolve().then(() => (init_team(), exports_team));
135584
135629
  await setTeam2(options.chatroomId, options.team);
135585
135630
  });
135586
- handoffCommandGroup.command("view-template").description("Print the handoff message template for a role pair").option("--team-id <teamId>", "Team id (solo, duo); defaults to duo").action(async function(options) {
135631
+ handoffCommandGroup.command("view-template").description("Print a handoff message template; omit --next-role to inspect a generic architect or UI/UX engineer template").option("--team-id <teamId>", "Team id (solo, duo); defaults to duo").action(async function(options) {
135587
135632
  const parentOpts = this.parent?.opts() ?? {};
135588
- if (!parentOpts.role || !parentOpts.nextRole) {
135589
- console.error(parentOpts.role ? `error: required option '--next-role <nextRole>' not specified` : `error: required option '--role <role>' not specified`);
135633
+ if (!parentOpts.role) {
135634
+ console.error(`error: required option '--role <role>' not specified`);
135590
135635
  process.exit(1);
135591
135636
  }
135592
135637
  const { printHandoffViewTemplate: printHandoffViewTemplate2 } = await Promise.resolve().then(() => (init_view_template3(), exports_view_template));
@@ -136030,4 +136075,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
136030
136075
  });
136031
136076
  program2.parse();
136032
136077
 
136033
- //# debugId=CB5CA35B81D3EFBC64756E2164756E21
136078
+ //# debugId=318DFD58C705B11264756E2164756E21