chatroom-cli 1.118.0 → 1.119.1
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:
|
|
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", "
|
|
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:
|
|
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:
|
|
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:
|
|
47772
|
+
reason: AgentStartReasonCode.PLATFORM_PENDING_TASK_WAKE,
|
|
47758
47773
|
wantResume: false,
|
|
47759
47774
|
taskId: task.taskId
|
|
47760
47775
|
};
|
|
@@ -51791,10 +51806,17 @@ var init_claude_model_variants = __esm(() => {
|
|
|
51791
51806
|
"haiku",
|
|
51792
51807
|
"claude-opus-5",
|
|
51793
51808
|
"claude-sonnet-5",
|
|
51809
|
+
"claude-fable-5-1",
|
|
51810
|
+
"claude-fable-5",
|
|
51811
|
+
"claude-opus-5-5",
|
|
51794
51812
|
"claude-opus-4-8",
|
|
51813
|
+
"claude-opus-4-7",
|
|
51795
51814
|
"claude-opus-4-6",
|
|
51815
|
+
"claude-opus-4-5-20251101",
|
|
51796
51816
|
"claude-sonnet-4-6",
|
|
51797
|
-
"claude-
|
|
51817
|
+
"claude-sonnet-4-5-20250929",
|
|
51818
|
+
"claude-haiku-4-5",
|
|
51819
|
+
"claude-haiku-4-5-20251001"
|
|
51798
51820
|
];
|
|
51799
51821
|
CLAUDE_BASE_MODEL_IDS = [
|
|
51800
51822
|
...CLAUDE_SPAWN_ALIASES,
|
|
@@ -54038,14 +54060,26 @@ var init_command_code_agent_service = __esm(() => {
|
|
|
54038
54060
|
init_base_cli_agent_service();
|
|
54039
54061
|
init_command_code_stream_reader();
|
|
54040
54062
|
COMMANDCODE_MODELS = [
|
|
54063
|
+
"claude-fable-5-1",
|
|
54064
|
+
"claude-fable-5",
|
|
54041
54065
|
"claude-sonnet-4-6",
|
|
54066
|
+
"claude-sonnet-5",
|
|
54042
54067
|
"claude-opus-4-7",
|
|
54068
|
+
"claude-opus-4-8",
|
|
54043
54069
|
"claude-opus-4-6",
|
|
54070
|
+
"claude-opus-5",
|
|
54071
|
+
"claude-opus-5-5",
|
|
54044
54072
|
"claude-haiku-4-5",
|
|
54045
54073
|
"gpt-5.5",
|
|
54046
54074
|
"gpt-5.4",
|
|
54047
54075
|
"gpt-5.3-codex",
|
|
54048
54076
|
"gpt-5.4-mini",
|
|
54077
|
+
"gpt-5.6-luna",
|
|
54078
|
+
"gpt-5.6-sol",
|
|
54079
|
+
"gpt-5.6-terra",
|
|
54080
|
+
"gpt-6-astra",
|
|
54081
|
+
"gpt-6-luna",
|
|
54082
|
+
"gpt-6-sol",
|
|
54049
54083
|
"google/gemini-3.5-flash",
|
|
54050
54084
|
"google/gemini-3.1-flash-lite",
|
|
54051
54085
|
"moonshotai/Kimi-K2.6",
|
|
@@ -106971,15 +107005,15 @@ var init_team_presets = __esm(() => {
|
|
|
106971
107005
|
duo: {
|
|
106972
107006
|
structureId: TEAM_STRUCTURE_IDS.duo,
|
|
106973
107007
|
name: "Duo",
|
|
106974
|
-
description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral
|
|
106975
|
-
roles: ["planner", "
|
|
107008
|
+
description: "A planner and builder working as a pair, planner as coordinator, with optional ephemeral architect and optional ephemeral uiux-engineer roles",
|
|
107009
|
+
roles: ["planner", "architect", "uiux-engineer", "builder"],
|
|
106976
107010
|
entryPoint: "planner"
|
|
106977
107011
|
},
|
|
106978
107012
|
solo: {
|
|
106979
107013
|
structureId: TEAM_STRUCTURE_IDS.solo,
|
|
106980
107014
|
name: "Solo",
|
|
106981
|
-
description: "A single agent working independently, with optional ephemeral
|
|
106982
|
-
roles: ["solo", "
|
|
107015
|
+
description: "A single agent working independently, with optional ephemeral architect and optional ephemeral uiux-engineer roles",
|
|
107016
|
+
roles: ["solo", "architect", "uiux-engineer"],
|
|
106983
107017
|
entryPoint: "solo"
|
|
106984
107018
|
}
|
|
106985
107019
|
};
|
|
@@ -107175,6 +107209,22 @@ var init_agent2 = __esm(() => {
|
|
|
107175
107209
|
init_storage2();
|
|
107176
107210
|
});
|
|
107177
107211
|
|
|
107212
|
+
// ../../services/backend/prompts/cli/handoff/command.ts
|
|
107213
|
+
function handoffCommand(params) {
|
|
107214
|
+
const prefix = params.cliEnvPrefix || "";
|
|
107215
|
+
const chatroomId = params.chatroomId || "<chatroom-id>";
|
|
107216
|
+
const role = params.role || "<role>";
|
|
107217
|
+
const nextRole = params.nextRole || "<target>";
|
|
107218
|
+
const placeholder = params.messagePlaceholder ?? "[Your message here]";
|
|
107219
|
+
const commandPrefix = `${prefix}chatroom handoff --chatroom-id="${chatroomId}" --role="${role}" --next-role="${nextRole}"`;
|
|
107220
|
+
return formatStdinHeredocCommand(commandPrefix, HANDOFF_STDIN_DELIMITER, placeholder, {
|
|
107221
|
+
messageMarker: HANDOFF_MESSAGE_MARKER
|
|
107222
|
+
});
|
|
107223
|
+
}
|
|
107224
|
+
var init_command2 = __esm(() => {
|
|
107225
|
+
init_stdin_heredoc();
|
|
107226
|
+
});
|
|
107227
|
+
|
|
107178
107228
|
// ../../services/backend/prompts/native/handoff-visibility.ts
|
|
107179
107229
|
function recipientLabel(toRole) {
|
|
107180
107230
|
return toRole.toLowerCase() === "user" ? "The user" : `The \`${toRole}\` agent`;
|
|
@@ -107198,6 +107248,285 @@ Put your **complete** deliverable in the handoff message — not in session text
|
|
|
107198
107248
|
---`;
|
|
107199
107249
|
}
|
|
107200
107250
|
|
|
107251
|
+
// ../../services/backend/prompts/utils/file-reference-guidance.ts
|
|
107252
|
+
function getFileReferenceGuidanceComment() {
|
|
107253
|
+
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. -->`;
|
|
107254
|
+
}
|
|
107255
|
+
function getFileReferenceProofOfCompletionExample() {
|
|
107256
|
+
return `${getFileReferenceGuidanceComment()}
|
|
107257
|
+
- \`apps/webapp/src/path/to/file.ts\` — <what changed and why>`;
|
|
107258
|
+
}
|
|
107259
|
+
|
|
107260
|
+
// ../../services/backend/prompts/teams/architect-handoff-templates.ts
|
|
107261
|
+
function normalizeEntryPointRole(entryPointRole) {
|
|
107262
|
+
return entryPointRole.trim().toLowerCase() || "planner";
|
|
107263
|
+
}
|
|
107264
|
+
function getArchitectFocus() {
|
|
107265
|
+
return "module boundaries, APIs, schemas, indexes and queries, invariants, failure and recovery handling, tests, and implementation sequence";
|
|
107266
|
+
}
|
|
107267
|
+
function getArchitectRequirements() {
|
|
107268
|
+
return `
|
|
107269
|
+
- Cite repository evidence for domain model/entity ownership, lifecycle, invariants, identifiers, and relationships.
|
|
107270
|
+
- Define service and module boundaries, public and internal APIs, function signatures, and ownership of side effects.
|
|
107271
|
+
- Analyze concurrency and races: concurrent writers, idempotency, ordering and monotonicity, retries, transactions, and failure/recovery behavior.
|
|
107272
|
+
- Design read patterns first: primary read paths, indexes, projections/read models, query shapes, scan and transaction limits, and invalidation/subscription scope.
|
|
107273
|
+
- 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.
|
|
107274
|
+
- Specify concrete schema, query, and mutation changes; migration/backfill sequence; tests; and verification order.`;
|
|
107275
|
+
}
|
|
107276
|
+
function getEntryPointToArchitectHandoffTemplate(entryPointRole) {
|
|
107277
|
+
const entryPoint = normalizeEntryPointRole(entryPointRole);
|
|
107278
|
+
return `${getHandoffRecipientVisibilityCallout("architect")}
|
|
107279
|
+
|
|
107280
|
+
## Handoff Template (${entryPoint} → architect)
|
|
107281
|
+
|
|
107282
|
+
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.
|
|
107283
|
+
|
|
107284
|
+
Provide the request, relevant constraints, and the files or product surfaces that need inspection. Ask for one evidence-backed design focused on ${getArchitectFocus()}.
|
|
107285
|
+
|
|
107286
|
+
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.
|
|
107287
|
+
|
|
107288
|
+
\`\`\`bash
|
|
107289
|
+
${handoffCommand({
|
|
107290
|
+
chatroomId: "<chatroom-id>",
|
|
107291
|
+
role: "architect",
|
|
107292
|
+
nextRole: entryPoint,
|
|
107293
|
+
cliEnvPrefix: ""
|
|
107294
|
+
})}
|
|
107295
|
+
\`\`\``;
|
|
107296
|
+
}
|
|
107297
|
+
function getArchitectToEntryPointHandoffTemplate(entryPointRole) {
|
|
107298
|
+
return renderArchitectToEntryPointHandoffTemplate(normalizeEntryPointRole(entryPointRole));
|
|
107299
|
+
}
|
|
107300
|
+
function getGenericArchitectToEntryPointHandoffTemplate() {
|
|
107301
|
+
return renderArchitectToEntryPointHandoffTemplate("<entry-point-role>", true);
|
|
107302
|
+
}
|
|
107303
|
+
function renderArchitectToEntryPointHandoffTemplate(entryPoint, generic = false) {
|
|
107304
|
+
const sharedContractsHeading = !generic && entryPoint === "planner" ? "## Shared contracts (planner-owned)" : "## Shared contracts (configured entry-point-owned)";
|
|
107305
|
+
const placeholderInstruction = generic ? " Replace `<entry-point-role>` with the configured entry-point role before running it." : "";
|
|
107306
|
+
return `${getHandoffRecipientVisibilityCallout(entryPoint)}
|
|
107307
|
+
|
|
107308
|
+
## Handoff Template (Architect → Entry Point)
|
|
107309
|
+
|
|
107310
|
+
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.
|
|
107311
|
+
|
|
107312
|
+
## Summary
|
|
107313
|
+
<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>
|
|
107314
|
+
|
|
107315
|
+
## Goal
|
|
107316
|
+
<state the one-sentence outcome this design delivers>
|
|
107317
|
+
|
|
107318
|
+
## Key Knowledge for High Quality Bar
|
|
107319
|
+
<cite the inspected repository patterns and complete the architect checklist below; do not provide a high-level essay>
|
|
107320
|
+
- Produce exactly one recommended design for ${getArchitectFocus()}.
|
|
107321
|
+
- Name concrete repository paths, existing abstractions, APIs/types, state/data flow, acceptance criteria, risks, and verification steps.
|
|
107322
|
+
${getArchitectRequirements()}
|
|
107323
|
+
|
|
107324
|
+
## Force Multipliers
|
|
107325
|
+
<name the existing abstractions, patterns, utilities, and platform conventions to reuse, and state why each reduces implementation risk or duplication>
|
|
107326
|
+
- Keep the design within the repository's established source-of-truth boundaries and avoid introducing a new registry or abstraction without evidence.
|
|
107327
|
+
|
|
107328
|
+
## Files to implement (exhaustive, file-level)
|
|
107329
|
+
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.
|
|
107330
|
+
${getFileReferenceGuidanceComment()}
|
|
107331
|
+
|
|
107332
|
+
### \`<repo-relative/path.ext>\` (Required)
|
|
107333
|
+
**Change:** <precise add/modify/remove responsibility and why>
|
|
107334
|
+
|
|
107335
|
+
\`\`\`text
|
|
107336
|
+
// Target code, API/type signature, query shape, or migration/backfill step.
|
|
107337
|
+
// Enough detail that implementation requires no invention.
|
|
107338
|
+
\`\`\`
|
|
107339
|
+
|
|
107340
|
+
<add one block per file; do not collapse multiple files into a directory or vague layer>
|
|
107341
|
+
|
|
107342
|
+
${sharedContractsHeading}
|
|
107343
|
+
<list cross-file interfaces, schemas, API contracts, state/data boundaries, or write exactly \`Not Applicable.\` when genuinely inapplicable>
|
|
107344
|
+
|
|
107345
|
+
### Interfaces & types
|
|
107346
|
+
\`\`\`typescript
|
|
107347
|
+
// Shared signatures, schemas, query/mutation shapes, or state contracts.
|
|
107348
|
+
\`\`\`
|
|
107349
|
+
|
|
107350
|
+
### Reference snippets
|
|
107351
|
+
\`\`\`typescript
|
|
107352
|
+
// Canonical imports, call patterns, or data-flow examples.
|
|
107353
|
+
\`\`\`
|
|
107354
|
+
|
|
107355
|
+
## Requirements (acceptance criteria)
|
|
107356
|
+
- <one concrete, verifiable requirement per bullet; include exact data shape, API contract, migration result, and failure behavior>
|
|
107357
|
+
- Include repository test coverage for domain, concurrency, read-pattern, migration, and recovery risk areas.
|
|
107358
|
+
- Verify the implemented user-facing entry point or task-delivery path end-to-end; unit tests alone are insufficient.
|
|
107359
|
+
|
|
107360
|
+
## What to avoid
|
|
107361
|
+
- Do not implement code or edit files as the architect; this handoff is advisory only.
|
|
107362
|
+
- Do not present alternative designs, generic advice, or requirements without concrete evidence and file-level consequences.
|
|
107363
|
+
- Do not invent APIs, schema fields, query shapes, indexes, or source-of-truth locations when existing repository patterns apply.
|
|
107364
|
+
- <explicit task-specific anti-patterns, scope boundaries, and migration/source-of-truth pitfalls>
|
|
107365
|
+
|
|
107366
|
+
## Skills to activate
|
|
107367
|
+
- <relevant repository skills and why they apply, or write exactly \`Not Applicable.\` when none apply>
|
|
107368
|
+
|
|
107369
|
+
## Out of scope
|
|
107370
|
+
- <explicit files, flows, behavior, or migration work the implementer must not touch>
|
|
107371
|
+
|
|
107372
|
+
## Handoff
|
|
107373
|
+
Run the normal handoff command to the configured entry point with this complete design, then stop.${placeholderInstruction}
|
|
107374
|
+
|
|
107375
|
+
\`\`\`bash
|
|
107376
|
+
${handoffCommand({
|
|
107377
|
+
chatroomId: "<chatroom-id>",
|
|
107378
|
+
role: "architect",
|
|
107379
|
+
nextRole: entryPoint,
|
|
107380
|
+
cliEnvPrefix: ""
|
|
107381
|
+
})}
|
|
107382
|
+
\`\`\``;
|
|
107383
|
+
}
|
|
107384
|
+
var init_architect_handoff_templates = __esm(() => {
|
|
107385
|
+
init_command2();
|
|
107386
|
+
});
|
|
107387
|
+
|
|
107388
|
+
// ../../services/backend/prompts/teams/uiux-engineer-handoff-templates.ts
|
|
107389
|
+
function normalizeEntryPointRole2(entryPointRole) {
|
|
107390
|
+
return entryPointRole.trim().toLowerCase() || "planner";
|
|
107391
|
+
}
|
|
107392
|
+
function getUiuxEngineerFocus() {
|
|
107393
|
+
return "complete user flows, loading/empty/error/success states, component ownership, theme tokens and layout, keyboard and accessibility behavior, responsive details, and UI tests";
|
|
107394
|
+
}
|
|
107395
|
+
function getUiuxEngineerRequirements() {
|
|
107396
|
+
return `
|
|
107397
|
+
- Specify complete user flows with explicit loading, empty, error, success, disabled, and retry states where applicable.
|
|
107398
|
+
- Define exact keyboard shortcuts, focus order, keyboard navigation, focus restoration, and accessible semantics and labels.
|
|
107399
|
+
- Define component hierarchy and ownership, props/state/events, data boundaries, and interaction behavior.
|
|
107400
|
+
- Choose concrete existing ShadCN components with the Base UI backend and lucide-react/react-icons conventions; do not write "use an appropriate component."
|
|
107401
|
+
- Specify Tailwind utility classes or semantic theme-token classes for layout, spacing, sizing, typography, states, responsive behavior, and dark mode.
|
|
107402
|
+
- Specify responsive breakpoints/layout behavior, visual feedback, destructive-action safeguards, exact files/components, and the UI/integration/accessibility test plan.`;
|
|
107403
|
+
}
|
|
107404
|
+
function getEntryPointToUiuxEngineerHandoffTemplate(entryPointRole) {
|
|
107405
|
+
const entryPoint = normalizeEntryPointRole2(entryPointRole);
|
|
107406
|
+
return `${getHandoffRecipientVisibilityCallout("uiux-engineer")}
|
|
107407
|
+
|
|
107408
|
+
## Handoff Template (${entryPoint} → uiux-engineer)
|
|
107409
|
+
|
|
107410
|
+
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.
|
|
107411
|
+
|
|
107412
|
+
Provide the request, relevant constraints, and the files or product surfaces that need inspection. Ask for one evidence-backed design focused on ${getUiuxEngineerFocus()}.
|
|
107413
|
+
|
|
107414
|
+
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.
|
|
107415
|
+
|
|
107416
|
+
\`\`\`bash
|
|
107417
|
+
${handoffCommand({
|
|
107418
|
+
chatroomId: "<chatroom-id>",
|
|
107419
|
+
role: "uiux-engineer",
|
|
107420
|
+
nextRole: entryPoint,
|
|
107421
|
+
cliEnvPrefix: ""
|
|
107422
|
+
})}
|
|
107423
|
+
\`\`\``;
|
|
107424
|
+
}
|
|
107425
|
+
function getUiuxEngineerToEntryPointHandoffTemplate(entryPointRole) {
|
|
107426
|
+
return renderUiuxEngineerToEntryPointHandoffTemplate(normalizeEntryPointRole2(entryPointRole));
|
|
107427
|
+
}
|
|
107428
|
+
function getGenericUiuxEngineerToEntryPointHandoffTemplate() {
|
|
107429
|
+
return renderUiuxEngineerToEntryPointHandoffTemplate("<entry-point-role>", true);
|
|
107430
|
+
}
|
|
107431
|
+
function renderUiuxEngineerToEntryPointHandoffTemplate(entryPoint, generic = false) {
|
|
107432
|
+
const sharedContractsHeading = !generic && entryPoint === "planner" ? "## Shared contracts (planner-owned)" : "## Shared contracts (configured entry-point-owned)";
|
|
107433
|
+
const placeholderInstruction = generic ? " Replace `<entry-point-role>` with the configured entry-point role before running it." : "";
|
|
107434
|
+
return `${getHandoffRecipientVisibilityCallout(entryPoint)}
|
|
107435
|
+
|
|
107436
|
+
## Handoff Template (UI/UX Engineer → Entry Point)
|
|
107437
|
+
|
|
107438
|
+
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.
|
|
107439
|
+
|
|
107440
|
+
## Summary
|
|
107441
|
+
<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>
|
|
107442
|
+
|
|
107443
|
+
## Goal
|
|
107444
|
+
<state the one-sentence outcome this design delivers>
|
|
107445
|
+
|
|
107446
|
+
## Key Knowledge for High Quality Bar
|
|
107447
|
+
<cite the inspected repository patterns and complete the UI/UX engineer checklist below; do not provide a high-level essay>
|
|
107448
|
+
- Produce exactly one recommended design for ${getUiuxEngineerFocus()}.
|
|
107449
|
+
- Name concrete repository paths, existing components/tokens, props/state/events, data boundaries, acceptance criteria, risks, and verification steps.
|
|
107450
|
+
${getUiuxEngineerRequirements()}
|
|
107451
|
+
|
|
107452
|
+
## Force Multipliers
|
|
107453
|
+
<name the existing components, patterns, tokens, utilities, and platform conventions to reuse, and state why each reduces implementation risk or duplication>
|
|
107454
|
+
- Keep the design within the repository's established source-of-truth boundaries and avoid introducing a new registry or abstraction without evidence.
|
|
107455
|
+
|
|
107456
|
+
## Files to implement (exhaustive, file-level)
|
|
107457
|
+
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.
|
|
107458
|
+
${getFileReferenceGuidanceComment()}
|
|
107459
|
+
|
|
107460
|
+
### \`<repo-relative/path.ext>\` (Required)
|
|
107461
|
+
**Change:** <precise add/modify/remove responsibility and why>
|
|
107462
|
+
|
|
107463
|
+
\`\`\`text
|
|
107464
|
+
// Component hierarchy, props/state/events, test structure, or exact
|
|
107465
|
+
// Tailwind/theme-token classes. Enough detail that implementation requires no invention.
|
|
107466
|
+
\`\`\`
|
|
107467
|
+
|
|
107468
|
+
<add one block per file; do not collapse multiple files into a directory or vague layer>
|
|
107469
|
+
|
|
107470
|
+
${sharedContractsHeading}
|
|
107471
|
+
<list cross-file interfaces, component/data contracts, state boundaries, or write exactly \`Not Applicable.\` when genuinely inapplicable>
|
|
107472
|
+
|
|
107473
|
+
### Interfaces & types
|
|
107474
|
+
\`\`\`typescript
|
|
107475
|
+
// Shared props, state, events, query shapes, or accessibility contracts.
|
|
107476
|
+
\`\`\`
|
|
107477
|
+
|
|
107478
|
+
### Reference snippets
|
|
107479
|
+
\`\`\`tsx
|
|
107480
|
+
// Canonical component imports, hook usage, keyboard wiring, or layout examples.
|
|
107481
|
+
\`\`\`
|
|
107482
|
+
|
|
107483
|
+
## Requirements (acceptance criteria)
|
|
107484
|
+
- <one concrete, verifiable requirement per bullet; include exact states, interactions, semantics, classes/tokens, and responsive behavior>
|
|
107485
|
+
- Include UI, integration, and accessibility test coverage for the design's risk areas.
|
|
107486
|
+
- Verify the implemented user-facing entry point end-to-end; unit tests alone are insufficient.
|
|
107487
|
+
|
|
107488
|
+
## What to avoid
|
|
107489
|
+
- Do not implement code or edit files as the UI/UX engineer; this handoff is advisory only.
|
|
107490
|
+
- Do not present alternative designs, generic advice, or requirements without concrete evidence and file-level consequences.
|
|
107491
|
+
- Do not invent components, props, tokens, keyboard behavior, or source-of-truth locations when existing repository patterns apply.
|
|
107492
|
+
- <explicit task-specific anti-patterns, scope boundaries, and destructive-action/source-of-truth pitfalls>
|
|
107493
|
+
|
|
107494
|
+
## Skills to activate
|
|
107495
|
+
- <relevant repository skills and why they apply, or write exactly \`Not Applicable.\` when none apply>
|
|
107496
|
+
|
|
107497
|
+
## Out of scope
|
|
107498
|
+
- <explicit files, flows, behavior, or migration work the implementer must not touch>
|
|
107499
|
+
|
|
107500
|
+
## Handoff
|
|
107501
|
+
Run the normal handoff command to the configured entry point with this complete design, then stop.${placeholderInstruction}
|
|
107502
|
+
|
|
107503
|
+
\`\`\`bash
|
|
107504
|
+
${handoffCommand({
|
|
107505
|
+
chatroomId: "<chatroom-id>",
|
|
107506
|
+
role: "uiux-engineer",
|
|
107507
|
+
nextRole: entryPoint,
|
|
107508
|
+
cliEnvPrefix: ""
|
|
107509
|
+
})}
|
|
107510
|
+
\`\`\``;
|
|
107511
|
+
}
|
|
107512
|
+
var init_uiux_engineer_handoff_templates = __esm(() => {
|
|
107513
|
+
init_command2();
|
|
107514
|
+
});
|
|
107515
|
+
|
|
107516
|
+
// ../../services/backend/prompts/teams/duo/handoff-templates/architect.ts
|
|
107517
|
+
var duoArchitectHandoffContract;
|
|
107518
|
+
var init_architect = __esm(() => {
|
|
107519
|
+
init_architect_handoff_templates();
|
|
107520
|
+
duoArchitectHandoffContract = {
|
|
107521
|
+
role: "architect",
|
|
107522
|
+
receivesFrom: ["planner"],
|
|
107523
|
+
returnsTo: ["planner"],
|
|
107524
|
+
outboundTemplates: {
|
|
107525
|
+
planner: () => getArchitectToEntryPointHandoffTemplate("planner")
|
|
107526
|
+
}
|
|
107527
|
+
};
|
|
107528
|
+
});
|
|
107529
|
+
|
|
107201
107530
|
// ../../services/backend/prompts/utils/code-change-verification.ts
|
|
107202
107531
|
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
107532
|
|
|
@@ -107211,15 +107540,6 @@ ${getDelegationBriefDisclosureComment()}`;
|
|
|
107211
107540
|
}
|
|
107212
107541
|
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
107542
|
|
|
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
107543
|
// ../../services/backend/prompts/utils/handoff-section-guidance.ts
|
|
107224
107544
|
function getHandoffNotApplicableSectionComment(context5) {
|
|
107225
107545
|
return `<!-- REQUIRED. ${context5}, or write exactly "${HANDOFF_NOT_APPLICABLE_EXACT_TEXT}" with no explanation. Do not omit this section. -->`;
|
|
@@ -107360,217 +107680,6 @@ var init_builder = __esm(() => {
|
|
|
107360
107680
|
};
|
|
107361
107681
|
});
|
|
107362
107682
|
|
|
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
107683
|
// ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-builder.ts
|
|
107575
107684
|
function getPlannerToBuilderHandoffTemplate() {
|
|
107576
107685
|
return `${getHandoffRecipientVisibilityCallout("builder")}
|
|
@@ -107647,14 +107756,6 @@ Keep one slice ≈ one focused review surface. Delegate slices incrementally —
|
|
|
107647
107756
|
}
|
|
107648
107757
|
var init_planner_to_builder = () => {};
|
|
107649
107758
|
|
|
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
107759
|
// ../../services/backend/prompts/utils/context-disclosure.ts
|
|
107659
107760
|
function getContextReadDisclosureComment(params = {}) {
|
|
107660
107761
|
const command = contextReadCommand(params);
|
|
@@ -107842,16 +107943,18 @@ var init_chat_handoff_template = () => {};
|
|
|
107842
107943
|
var duoPlannerHandoffContract;
|
|
107843
107944
|
var init_planner = __esm(() => {
|
|
107844
107945
|
init_planner_to_builder();
|
|
107845
|
-
init_planner_to_enhancer();
|
|
107846
107946
|
init_planner_to_user();
|
|
107847
107947
|
init_chat_handoff_template();
|
|
107948
|
+
init_architect_handoff_templates();
|
|
107949
|
+
init_uiux_engineer_handoff_templates();
|
|
107848
107950
|
duoPlannerHandoffContract = {
|
|
107849
107951
|
role: "planner",
|
|
107850
|
-
receivesFrom: ["user", "builder", "
|
|
107851
|
-
returnsTo: ["builder", "
|
|
107952
|
+
receivesFrom: ["user", "builder", "architect", "uiux-engineer"],
|
|
107953
|
+
returnsTo: ["builder", "architect", "uiux-engineer", "user"],
|
|
107852
107954
|
outboundTemplates: {
|
|
107853
107955
|
builder: () => getPlannerToBuilderHandoffTemplate(),
|
|
107854
|
-
|
|
107956
|
+
architect: () => getEntryPointToArchitectHandoffTemplate("planner"),
|
|
107957
|
+
"uiux-engineer": () => getEntryPointToUiuxEngineerHandoffTemplate("planner"),
|
|
107855
107958
|
user: (query) => query.conversationMode === "chat" ? getChatToUserHandoffTemplate() : getPlannerToUserReportTemplate({
|
|
107856
107959
|
chatroomId: query.chatroomId,
|
|
107857
107960
|
role: query.role,
|
|
@@ -107861,6 +107964,20 @@ var init_planner = __esm(() => {
|
|
|
107861
107964
|
};
|
|
107862
107965
|
});
|
|
107863
107966
|
|
|
107967
|
+
// ../../services/backend/prompts/teams/duo/handoff-templates/uiux-engineer.ts
|
|
107968
|
+
var duoUiuxEngineerHandoffContract;
|
|
107969
|
+
var init_uiux_engineer = __esm(() => {
|
|
107970
|
+
init_uiux_engineer_handoff_templates();
|
|
107971
|
+
duoUiuxEngineerHandoffContract = {
|
|
107972
|
+
role: "uiux-engineer",
|
|
107973
|
+
receivesFrom: ["planner"],
|
|
107974
|
+
returnsTo: ["planner"],
|
|
107975
|
+
outboundTemplates: {
|
|
107976
|
+
planner: () => getUiuxEngineerToEntryPointHandoffTemplate("planner")
|
|
107977
|
+
}
|
|
107978
|
+
};
|
|
107979
|
+
});
|
|
107980
|
+
|
|
107864
107981
|
// ../../services/backend/prompts/cli/handoff-templates/contracts.ts
|
|
107865
107982
|
function validateRoleHandoffContracts(contracts) {
|
|
107866
107983
|
const byRole = new Map;
|
|
@@ -107901,14 +108018,16 @@ function getDuoHandoffTemplate(query) {
|
|
|
107901
108018
|
return getter?.(query) ?? null;
|
|
107902
108019
|
}
|
|
107903
108020
|
var DUO_ROLE_HANDOFF_CONTRACTS, validatedDuoRoleHandoffContracts;
|
|
107904
|
-
var
|
|
108021
|
+
var init_handoff_templates = __esm(() => {
|
|
108022
|
+
init_architect();
|
|
107905
108023
|
init_builder();
|
|
107906
|
-
init_enhancer();
|
|
107907
108024
|
init_planner();
|
|
108025
|
+
init_uiux_engineer();
|
|
107908
108026
|
DUO_ROLE_HANDOFF_CONTRACTS = [
|
|
107909
108027
|
duoPlannerHandoffContract,
|
|
107910
108028
|
duoBuilderHandoffContract,
|
|
107911
|
-
|
|
108029
|
+
duoArchitectHandoffContract,
|
|
108030
|
+
duoUiuxEngineerHandoffContract
|
|
107912
108031
|
];
|
|
107913
108032
|
validatedDuoRoleHandoffContracts = (() => {
|
|
107914
108033
|
validateRoleHandoffContracts(DUO_ROLE_HANDOFF_CONTRACTS);
|
|
@@ -107916,16 +108035,16 @@ var init_handoff_templates2 = __esm(() => {
|
|
|
107916
108035
|
})();
|
|
107917
108036
|
});
|
|
107918
108037
|
|
|
107919
|
-
// ../../services/backend/prompts/teams/solo/handoff-templates/
|
|
107920
|
-
var
|
|
107921
|
-
var
|
|
107922
|
-
|
|
107923
|
-
|
|
107924
|
-
role: "
|
|
108038
|
+
// ../../services/backend/prompts/teams/solo/handoff-templates/architect.ts
|
|
108039
|
+
var soloArchitectHandoffContract;
|
|
108040
|
+
var init_architect2 = __esm(() => {
|
|
108041
|
+
init_architect_handoff_templates();
|
|
108042
|
+
soloArchitectHandoffContract = {
|
|
108043
|
+
role: "architect",
|
|
107925
108044
|
receivesFrom: ["solo"],
|
|
107926
108045
|
returnsTo: ["solo"],
|
|
107927
108046
|
outboundTemplates: {
|
|
107928
|
-
solo: () =>
|
|
108047
|
+
solo: () => getArchitectToEntryPointHandoffTemplate("solo")
|
|
107929
108048
|
}
|
|
107930
108049
|
};
|
|
107931
108050
|
});
|
|
@@ -107948,14 +108067,16 @@ var init_solo_to_user = __esm(() => {
|
|
|
107948
108067
|
var soloHandoffContract;
|
|
107949
108068
|
var init_solo = __esm(() => {
|
|
107950
108069
|
init_solo_to_user();
|
|
107951
|
-
init_handoff_templates();
|
|
107952
108070
|
init_chat_handoff_template();
|
|
108071
|
+
init_architect_handoff_templates();
|
|
108072
|
+
init_uiux_engineer_handoff_templates();
|
|
107953
108073
|
soloHandoffContract = {
|
|
107954
108074
|
role: "solo",
|
|
107955
|
-
receivesFrom: ["user", "
|
|
107956
|
-
returnsTo: ["
|
|
108075
|
+
receivesFrom: ["user", "architect", "uiux-engineer"],
|
|
108076
|
+
returnsTo: ["architect", "uiux-engineer", "user"],
|
|
107957
108077
|
outboundTemplates: {
|
|
107958
|
-
|
|
108078
|
+
architect: () => getEntryPointToArchitectHandoffTemplate("solo"),
|
|
108079
|
+
"uiux-engineer": () => getEntryPointToUiuxEngineerHandoffTemplate("solo"),
|
|
107959
108080
|
user: (query) => query.conversationMode === "chat" ? getChatToUserHandoffTemplate() : getSoloToUserReportTemplate({
|
|
107960
108081
|
chatroomId: query.chatroomId,
|
|
107961
108082
|
role: query.role,
|
|
@@ -107965,6 +108086,20 @@ var init_solo = __esm(() => {
|
|
|
107965
108086
|
};
|
|
107966
108087
|
});
|
|
107967
108088
|
|
|
108089
|
+
// ../../services/backend/prompts/teams/solo/handoff-templates/uiux-engineer.ts
|
|
108090
|
+
var soloUiuxEngineerHandoffContract;
|
|
108091
|
+
var init_uiux_engineer2 = __esm(() => {
|
|
108092
|
+
init_uiux_engineer_handoff_templates();
|
|
108093
|
+
soloUiuxEngineerHandoffContract = {
|
|
108094
|
+
role: "uiux-engineer",
|
|
108095
|
+
receivesFrom: ["solo"],
|
|
108096
|
+
returnsTo: ["solo"],
|
|
108097
|
+
outboundTemplates: {
|
|
108098
|
+
solo: () => getUiuxEngineerToEntryPointHandoffTemplate("solo")
|
|
108099
|
+
}
|
|
108100
|
+
};
|
|
108101
|
+
});
|
|
108102
|
+
|
|
107968
108103
|
// ../../services/backend/prompts/teams/solo/handoff-templates/index.ts
|
|
107969
108104
|
function listSoloRoleHandoffContracts() {
|
|
107970
108105
|
return validatedSoloRoleHandoffContracts;
|
|
@@ -107977,12 +108112,14 @@ function getSoloHandoffTemplate(query) {
|
|
|
107977
108112
|
return getter?.(query) ?? null;
|
|
107978
108113
|
}
|
|
107979
108114
|
var SOLO_ROLE_HANDOFF_CONTRACTS, validatedSoloRoleHandoffContracts;
|
|
107980
|
-
var
|
|
107981
|
-
|
|
108115
|
+
var init_handoff_templates2 = __esm(() => {
|
|
108116
|
+
init_architect2();
|
|
107982
108117
|
init_solo();
|
|
108118
|
+
init_uiux_engineer2();
|
|
107983
108119
|
SOLO_ROLE_HANDOFF_CONTRACTS = [
|
|
107984
108120
|
soloHandoffContract,
|
|
107985
|
-
|
|
108121
|
+
soloArchitectHandoffContract,
|
|
108122
|
+
soloUiuxEngineerHandoffContract
|
|
107986
108123
|
];
|
|
107987
108124
|
validatedSoloRoleHandoffContracts = (() => {
|
|
107988
108125
|
validateRoleHandoffContracts(SOLO_ROLE_HANDOFF_CONTRACTS);
|
|
@@ -108040,13 +108177,21 @@ function getHandoffTemplate(query) {
|
|
|
108040
108177
|
return getSoloHandoffTemplate(query);
|
|
108041
108178
|
return null;
|
|
108042
108179
|
}
|
|
108043
|
-
var
|
|
108180
|
+
var init_handoff_templates3 = __esm(() => {
|
|
108181
|
+
init_handoff_templates();
|
|
108044
108182
|
init_handoff_templates2();
|
|
108045
|
-
init_handoff_templates3();
|
|
108046
108183
|
});
|
|
108047
108184
|
|
|
108048
108185
|
// ../../services/backend/prompts/cli/handoff/view-template.ts
|
|
108049
108186
|
function viewHandoffTemplate(params) {
|
|
108187
|
+
if (params.nextRole === undefined) {
|
|
108188
|
+
const role = params.role.trim().toLowerCase();
|
|
108189
|
+
if (role === "architect")
|
|
108190
|
+
return getGenericArchitectToEntryPointHandoffTemplate();
|
|
108191
|
+
if (role === "uiux-engineer")
|
|
108192
|
+
return getGenericUiuxEngineerToEntryPointHandoffTemplate();
|
|
108193
|
+
throw new Error(`Role-only handoff template viewing is supported only for architect or uiux-engineer, not ${params.role}`);
|
|
108194
|
+
}
|
|
108050
108195
|
const template = getHandoffTemplate({
|
|
108051
108196
|
fromRole: params.role,
|
|
108052
108197
|
toRole: params.nextRole,
|
|
@@ -108059,7 +108204,9 @@ function viewHandoffTemplate(params) {
|
|
|
108059
108204
|
return template;
|
|
108060
108205
|
}
|
|
108061
108206
|
var init_view_template2 = __esm(() => {
|
|
108062
|
-
|
|
108207
|
+
init_architect_handoff_templates();
|
|
108208
|
+
init_uiux_engineer_handoff_templates();
|
|
108209
|
+
init_handoff_templates3();
|
|
108063
108210
|
});
|
|
108064
108211
|
|
|
108065
108212
|
// src/commands/handoff/view-template.ts
|
|
@@ -108104,12 +108251,12 @@ function listHandoffTemplatesCommand(params) {
|
|
|
108104
108251
|
});
|
|
108105
108252
|
if (!listing) {
|
|
108106
108253
|
const teamId = params.teamId ?? "duo";
|
|
108107
|
-
throw new Error(`No handoff contract for role "${params.role}" in team "${teamId}". Known roles: planner, builder
|
|
108254
|
+
throw new Error(`No handoff contract for role "${params.role}" in team "${teamId}". Known roles: planner, builder (duo) or solo.`);
|
|
108108
108255
|
}
|
|
108109
108256
|
return formatHandoffTemplateListing(listing);
|
|
108110
108257
|
}
|
|
108111
108258
|
var init_list_templates = __esm(() => {
|
|
108112
|
-
|
|
108259
|
+
init_handoff_templates3();
|
|
108113
108260
|
});
|
|
108114
108261
|
|
|
108115
108262
|
// src/commands/handoff/list-templates.ts
|
|
@@ -108276,30 +108423,43 @@ function formatDecodeError(error51) {
|
|
|
108276
108423
|
return message;
|
|
108277
108424
|
}
|
|
108278
108425
|
|
|
108279
|
-
// ../../services/backend/prompts/
|
|
108280
|
-
|
|
108426
|
+
// ../../services/backend/prompts/native/session-continuity.ts
|
|
108427
|
+
function getNativeHandoffTurnEndGuidance(nextRole) {
|
|
108428
|
+
return getHandoffTurnEndGuidance(nextRole);
|
|
108429
|
+
}
|
|
108430
|
+
function getHandoffTurnEndGuidance(nextRole) {
|
|
108431
|
+
const lines = [
|
|
108432
|
+
"",
|
|
108433
|
+
"**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.**"
|
|
108434
|
+
];
|
|
108435
|
+
if (nextRole.toLowerCase() === "user") {
|
|
108436
|
+
lines.push("The system delivers the next chatroom task when the user sends one.");
|
|
108437
|
+
} else {
|
|
108438
|
+
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.`);
|
|
108439
|
+
}
|
|
108440
|
+
return lines.join(`
|
|
108441
|
+
`);
|
|
108442
|
+
}
|
|
108281
108443
|
// ../../services/backend/prompts/sections/activated-skills.ts
|
|
108282
108444
|
var init_activated_skills = () => {};
|
|
108283
108445
|
|
|
108284
108446
|
// ../../services/backend/prompts/cli/backlog/command.ts
|
|
108285
|
-
var
|
|
108447
|
+
var init_command3 = __esm(() => {
|
|
108286
108448
|
init_stdin_heredoc();
|
|
108287
108449
|
});
|
|
108288
108450
|
|
|
108289
108451
|
// ../../services/backend/src/domain/usecase/skills/modules/backlog/index.ts
|
|
108290
108452
|
var init_backlog = __esm(() => {
|
|
108291
|
-
|
|
108453
|
+
init_command3();
|
|
108292
108454
|
});
|
|
108293
108455
|
|
|
108294
108456
|
// ../../services/backend/src/domain/usecase/skills/modules/code-review/index.ts
|
|
108295
108457
|
var init_code_review = () => {};
|
|
108296
|
-
|
|
108297
108458
|
// ../../services/backend/src/domain/usecase/skills/modules/data-design/index.ts
|
|
108298
108459
|
var init_data_design = () => {};
|
|
108299
108460
|
|
|
108300
108461
|
// ../../services/backend/src/domain/usecase/skills/modules/defragmentation/index.ts
|
|
108301
108462
|
var init_defragmentation = () => {};
|
|
108302
|
-
|
|
108303
108463
|
// ../../services/backend/src/domain/usecase/skills/modules/user-centricity/index.ts
|
|
108304
108464
|
var init_user_centricity = () => {};
|
|
108305
108465
|
|
|
@@ -108388,87 +108548,17 @@ var init_general_knowledge = __esm(() => {
|
|
|
108388
108548
|
init_utils3();
|
|
108389
108549
|
});
|
|
108390
108550
|
|
|
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
108551
|
// ../../services/backend/prompts/sections/commands-reference.ts
|
|
108465
108552
|
var init_commands_reference = __esm(() => {
|
|
108466
108553
|
init_general_knowledge();
|
|
108467
108554
|
init_command();
|
|
108468
108555
|
init_reminder();
|
|
108469
|
-
|
|
108556
|
+
init_command2();
|
|
108470
108557
|
init_utils3();
|
|
108471
108558
|
});
|
|
108559
|
+
|
|
108560
|
+
// ../../services/backend/prompts/cli/roles/architect.ts
|
|
108561
|
+
var init_architect3 = () => {};
|
|
108472
108562
|
// ../../services/backend/prompts/cli/sections/core-responsibilities.ts
|
|
108473
108563
|
var init_core_responsibilities = () => {};
|
|
108474
108564
|
// ../../services/backend/prompts/cli/sections/handoff-rules.ts
|
|
@@ -108498,6 +108588,9 @@ var init_planner2 = __esm(() => {
|
|
|
108498
108588
|
init_sections();
|
|
108499
108589
|
});
|
|
108500
108590
|
|
|
108591
|
+
// ../../services/backend/prompts/cli/roles/uiux-engineer.ts
|
|
108592
|
+
var init_uiux_engineer3 = () => {};
|
|
108593
|
+
|
|
108501
108594
|
// ../../services/backend/prompts/cli/roles/planner-guidance-context.ts
|
|
108502
108595
|
var init_planner_guidance_context = __esm(() => {
|
|
108503
108596
|
init_env();
|
|
@@ -108516,11 +108609,11 @@ var init_fromContext = __esm(() => {
|
|
|
108516
108609
|
|
|
108517
108610
|
// ../../services/backend/prompts/cli/roles/fromContext.ts
|
|
108518
108611
|
var init_fromContext2 = __esm(() => {
|
|
108612
|
+
init_architect3();
|
|
108519
108613
|
init_builder2();
|
|
108520
108614
|
init_planner2();
|
|
108521
|
-
|
|
108615
|
+
init_uiux_engineer3();
|
|
108522
108616
|
init_fromContext();
|
|
108523
|
-
init_utils3();
|
|
108524
108617
|
});
|
|
108525
108618
|
|
|
108526
108619
|
// ../../services/backend/prompts/teams/duo/prompts/builder.ts
|
|
@@ -108552,7 +108645,9 @@ var init_role_guidance = __esm(() => {
|
|
|
108552
108645
|
});
|
|
108553
108646
|
|
|
108554
108647
|
// ../../services/backend/prompts/templates.ts
|
|
108555
|
-
var init_templates = () => {
|
|
108648
|
+
var init_templates = __esm(() => {
|
|
108649
|
+
init_agent_role();
|
|
108650
|
+
});
|
|
108556
108651
|
|
|
108557
108652
|
// ../../services/backend/prompts/sections/role-identity.ts
|
|
108558
108653
|
var init_role_identity = __esm(() => {
|
|
@@ -108560,14 +108655,12 @@ var init_role_identity = __esm(() => {
|
|
|
108560
108655
|
});
|
|
108561
108656
|
|
|
108562
108657
|
// ../../services/backend/prompts/native/system-prompt.ts
|
|
108563
|
-
var
|
|
108564
|
-
init_system_prompt();
|
|
108658
|
+
var init_system_prompt = __esm(() => {
|
|
108565
108659
|
init_commands_reference();
|
|
108566
108660
|
init_general_knowledge();
|
|
108567
108661
|
init_role_guidance();
|
|
108568
108662
|
init_role_identity();
|
|
108569
108663
|
init_selector_context();
|
|
108570
|
-
init_utils3();
|
|
108571
108664
|
});
|
|
108572
108665
|
|
|
108573
108666
|
// ../../services/backend/prompts/native/task-started-content.ts
|
|
@@ -108601,40 +108694,12 @@ var init_session_vs_chatroom_task = () => {};
|
|
|
108601
108694
|
// ../../services/backend/prompts/review-guidelines/index.ts
|
|
108602
108695
|
var init_review_guidelines = () => {};
|
|
108603
108696
|
// ../../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
108697
|
function generateHandoffOutput(params) {
|
|
108617
|
-
const {
|
|
108618
|
-
role,
|
|
108619
|
-
nextRole,
|
|
108620
|
-
chatroomId,
|
|
108621
|
-
convexUrl,
|
|
108622
|
-
supportsNativeIntegration,
|
|
108623
|
-
enhancerRequestQueued
|
|
108624
|
-
} = params;
|
|
108698
|
+
const { role, nextRole, chatroomId, convexUrl, supportsNativeIntegration } = params;
|
|
108625
108699
|
const cliEnvPrefix = getCliEnvPrefix(convexUrl);
|
|
108626
|
-
const
|
|
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
|
-
}
|
|
108700
|
+
const lines = [`✅ Chatroom task completed and handed off to ${nextRole}`];
|
|
108636
108701
|
if (supportsNativeIntegration) {
|
|
108637
|
-
lines.push(
|
|
108702
|
+
lines.push(getNativeHandoffTurnEndGuidance(nextRole));
|
|
108638
108703
|
} else {
|
|
108639
108704
|
lines.push("");
|
|
108640
108705
|
lines.push("✅ Level B complete (chatroom task handed off).");
|
|
@@ -108650,7 +108715,6 @@ var init_generator = __esm(() => {
|
|
|
108650
108715
|
init_command();
|
|
108651
108716
|
init_reminder();
|
|
108652
108717
|
init_system_prompt();
|
|
108653
|
-
init_system_prompt2();
|
|
108654
108718
|
init_classification_guide();
|
|
108655
108719
|
init_commands_reference();
|
|
108656
108720
|
init_general_knowledge();
|
|
@@ -108812,8 +108876,7 @@ var handoffEffect = (chatroomId, options) => exports_Effect.gen(function* () {
|
|
|
108812
108876
|
nextRole,
|
|
108813
108877
|
chatroomId,
|
|
108814
108878
|
convexUrl,
|
|
108815
|
-
supportsNativeIntegration: result.supportsNativeIntegration
|
|
108816
|
-
enhancerRequestQueued: result.enhancerRequestQueued === true
|
|
108879
|
+
supportsNativeIntegration: result.supportsNativeIntegration
|
|
108817
108880
|
}));
|
|
108818
108881
|
});
|
|
108819
108882
|
});
|
|
@@ -113606,6 +113669,8 @@ var init_model_catalog = __esm(() => {
|
|
|
113606
113669
|
init_model_variant();
|
|
113607
113670
|
CODEX_MODEL_IDS = [
|
|
113608
113671
|
"gpt-6-astra",
|
|
113672
|
+
"gpt-6-sol",
|
|
113673
|
+
"gpt-6-luna",
|
|
113609
113674
|
"gpt-5.6-terra",
|
|
113610
113675
|
"gpt-5.6-luna",
|
|
113611
113676
|
"gpt-5.6-sol",
|
|
@@ -118412,7 +118477,7 @@ async function runRestartOrchestrator(deps, event) {
|
|
|
118412
118477
|
agentHarness: event.agentHarness,
|
|
118413
118478
|
model: event.model,
|
|
118414
118479
|
workingDir: event.workingDir,
|
|
118415
|
-
reason:
|
|
118480
|
+
reason: AgentStartReasonCode.USER_RESTART,
|
|
118416
118481
|
wantResume: event.wantResume
|
|
118417
118482
|
}, context5.signal);
|
|
118418
118483
|
});
|
|
@@ -118426,7 +118491,7 @@ async function runRestartOrchestrator(deps, event) {
|
|
|
118426
118491
|
await deps.runSerializedForAgent({ chatroomId, role, workingDir: event.workingDir }, { timeoutMs: HARNESS_SESSION_READY_TIMEOUT_MS }, (ops, context5) => ops.stopAgent({
|
|
118427
118492
|
chatroomId,
|
|
118428
118493
|
role,
|
|
118429
|
-
reason:
|
|
118494
|
+
reason: AgentStartReasonCode.USER_RESTART,
|
|
118430
118495
|
pid: spawnResult.pid,
|
|
118431
118496
|
workingDir: event.workingDir
|
|
118432
118497
|
}, context5.signal));
|
|
@@ -118457,6 +118522,7 @@ async function runRestartOrchestrator(deps, event) {
|
|
|
118457
118522
|
}
|
|
118458
118523
|
var init_restart_orchestrator = __esm(() => {
|
|
118459
118524
|
init_reliability();
|
|
118525
|
+
init_agent();
|
|
118460
118526
|
init_build_agent_restart_event();
|
|
118461
118527
|
init_restart_orchestrator_in_flight();
|
|
118462
118528
|
init_api3();
|
|
@@ -135583,10 +135649,10 @@ teamCommand.command("set").description("Set the team preset for a chatroom").req
|
|
|
135583
135649
|
const { setTeam: setTeam2 } = await Promise.resolve().then(() => (init_team(), exports_team));
|
|
135584
135650
|
await setTeam2(options.chatroomId, options.team);
|
|
135585
135651
|
});
|
|
135586
|
-
handoffCommandGroup.command("view-template").description("Print
|
|
135652
|
+
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
135653
|
const parentOpts = this.parent?.opts() ?? {};
|
|
135588
|
-
if (!parentOpts.role
|
|
135589
|
-
console.error(
|
|
135654
|
+
if (!parentOpts.role) {
|
|
135655
|
+
console.error(`error: required option '--role <role>' not specified`);
|
|
135590
135656
|
process.exit(1);
|
|
135591
135657
|
}
|
|
135592
135658
|
const { printHandoffViewTemplate: printHandoffViewTemplate2 } = await Promise.resolve().then(() => (init_view_template3(), exports_view_template));
|
|
@@ -136030,4 +136096,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
136030
136096
|
});
|
|
136031
136097
|
program2.parse();
|
|
136032
136098
|
|
|
136033
|
-
//# debugId=
|
|
136099
|
+
//# debugId=35DA39C4D925D97464756E2164756E21
|