backup current stable ejclaw state

This commit is contained in:
Codex
2026-05-27 10:53:05 +09:00
parent 646bc34372
commit 1509108e04
57 changed files with 7127 additions and 154 deletions

View File

@@ -56,7 +56,27 @@ import {
} from './types.js';
import { createScopedLogger, logger } from './logger.js';
import { hasReviewerLease } from './service-routing.js';
import { resolveGroupFolderPath } from './group-folder.js';
import type { WorkItem } from './db/work-items.js';
/**
* Build the allow-list of base directories under which an outgoing message's
* attachments may live. Each room is sandboxed to its own group folder
* (`groups/<folder>`) by default; if an explicit `workDir` is registered, that
* is added too. This way a screenshot the agent saved under
* `groups/<folder>/repo/.artifacts/...` is allowed even when the room has no
* workDir configured, while remaining isolated from sibling rooms.
*/
function getGroupAttachmentBaseDirs(group: RegisteredGroup): string[] {
const dirs: string[] = [];
try {
dirs.push(resolveGroupFolderPath(group.folder));
} catch {
// Invalid folder names should not block delivery; fall through.
}
if (group.workDir) dirs.push(group.workDir);
return dirs;
}
export {
resolveHandoffCursorKey,
resolveHandoffRoleOverride,
@@ -255,7 +275,7 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): {
channel,
item: workItem,
log: logger,
attachmentBaseDirs: group.workDir ? [group.workDir] : undefined,
attachmentBaseDirs: getGroupAttachmentBaseDirs(group),
replaceMessageId,
isDuplicateOfLastBotFinal: checkDuplicateOfLastBotFinal,
openContinuation: (targetChatJid) =>
@@ -458,7 +478,7 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): {
channel,
roleToChannel,
log,
attachmentBaseDirs: group.workDir ? [group.workDir] : undefined,
attachmentBaseDirs: getGroupAttachmentBaseDirs(group),
isPairedRoom: hasReviewerLease(chatJid),
getMissingRoleChannelMessage,
isDuplicateOfLastBotFinal: checkDuplicateOfLastBotFinal,