feat: add paired review workspace flow

This commit is contained in:
Eyejoker
2026-03-28 21:14:25 +09:00
parent 79a8a2639e
commit e7f49d77da
19 changed files with 2719 additions and 20 deletions

View File

@@ -10,6 +10,8 @@ const SESSION_COMMAND_CONTROL_PATTERNS = [
/^Failed to process messages before \/compact\. Try again\.$/,
/^\/compact failed\. The session is unchanged\.$/,
/^Conversation compacted\.$/,
/^Review snapshot updated\.$/,
/^Review-ready is unavailable for this room\./,
];
/**
@@ -24,6 +26,7 @@ export function extractSessionCommand(
text = text.replace(triggerPattern, '').trim();
if (text === '/compact') return '/compact';
if (text === '/clear') return '/clear';
if (text === '/review-ready') return '/review-ready';
return null;
}
@@ -68,6 +71,7 @@ export interface SessionCommandDeps {
isAdminSender: (msg: NewMessage) => boolean;
/** Whether the denied sender would normally be allowed to interact (for denial messages). */
canSenderInteract: (msg: NewMessage) => boolean;
markReviewReady: () => Promise<string | null>;
}
function resultToText(result: string | object | null | undefined): string {
@@ -149,6 +153,16 @@ export async function handleSessionCommand(opts: {
return { handled: true, success: true };
}
if (command === '/review-ready') {
const result = await deps.markReviewReady();
deps.advanceCursor(cmdMsg.timestamp);
await deps.sendMessage(
result ??
'Review-ready is unavailable for this room. Paired workspaces require a configured project workDir.',
);
return { handled: true, success: true };
}
const cmdIndex = missedMessages.indexOf(cmdMsg);
const preCompactMsgs = missedMessages.slice(0, cmdIndex);