chore: 保存剩余工作区改动并清理到干净状态
- 补 OnlyOffice callback 附件写回的 media asset bridge 适配层,并继续扩展 documents bridge/测试覆盖 - 提交当前 OMX hooks 删除与 Harness 运行状态文件更新,保留本轮任务执行轨迹 - 一并提交仓库中已跟踪的 Rust target 构建产物与相关协议桥接变更,确保工作区清零
This commit is contained in:
@@ -101,6 +101,7 @@ const DOCUMENT_BRIDGE_MUTATION_FUNCTIONS = {
|
||||
"documents.stats.update": "documents:updateStats",
|
||||
"documents.options.update": "documents:updateOptions",
|
||||
"documents.save": "documents:updateContent",
|
||||
"media.assets.replace_storage": "mediaAssets:replaceStorageFromUpload",
|
||||
} as const satisfies Record<string, string>;
|
||||
|
||||
function readHeaderValue(headerList: Headers, ...candidates: string[]): string | null {
|
||||
@@ -180,6 +181,55 @@ export async function buildDocumentBridgeContext(input: {
|
||||
};
|
||||
}
|
||||
|
||||
export function buildDocumentBridgeContextWithActor(input: {
|
||||
request: Request;
|
||||
actor: BridgeActor;
|
||||
workspaceId?: string | null;
|
||||
idempotencyKey?: string | null;
|
||||
validateOnly?: boolean;
|
||||
dryRun?: boolean;
|
||||
source?: Partial<BridgeSource>;
|
||||
authToken?: string | null;
|
||||
}): BridgeContext {
|
||||
const headerList = input.request.headers;
|
||||
const requestId =
|
||||
readHeaderValue(headerList, "x-request-id", "x-mnote-request-id") ?? makeFallbackId("req");
|
||||
const traceId =
|
||||
readHeaderValue(headerList, "x-trace-id", "x-mnote-trace-id", "x-request-id") ?? makeFallbackId("trace");
|
||||
const sourceChannel = input.source?.channel?.trim() || readHeaderValue(headerList, "x-source-channel") || "next-route";
|
||||
const sourceClient =
|
||||
input.source?.client?.trim() ||
|
||||
readHeaderValue(headerList, "x-source-client", "user-agent") ||
|
||||
"wolai-frontend";
|
||||
const deploymentId =
|
||||
readHeaderValue(headerList, "x-deployment-id") ?? process.env.VERCEL_DEPLOYMENT_ID ?? null;
|
||||
const projectId = readHeaderValue(headerList, "x-project-id") ?? process.env.VERCEL_PROJECT_ID ?? null;
|
||||
const tenantId = readHeaderValue(headerList, "x-tenant-id");
|
||||
const authToken = input.authToken ?? readHeaderValue(headerList, "authorization");
|
||||
const idempotencyKey =
|
||||
input.idempotencyKey ?? readHeaderValue(headerList, "idempotency-key", "x-idempotency-key");
|
||||
const validateOnly = input.validateOnly ?? toBooleanFlag(readHeaderValue(headerList, "x-validate-only"));
|
||||
const dryRun = input.dryRun ?? toBooleanFlag(readHeaderValue(headerList, "x-dry-run"));
|
||||
|
||||
return {
|
||||
deploymentId,
|
||||
projectId,
|
||||
workspaceId: input.workspaceId ?? null,
|
||||
requestId,
|
||||
traceId,
|
||||
actor: input.actor,
|
||||
source: {
|
||||
channel: sourceChannel,
|
||||
client: sourceClient,
|
||||
},
|
||||
tenantId,
|
||||
authToken,
|
||||
idempotencyKey,
|
||||
validateOnly,
|
||||
dryRun,
|
||||
};
|
||||
}
|
||||
|
||||
export function buildDocumentCommandEnvelope<T>(input: {
|
||||
name: string;
|
||||
payload: T;
|
||||
|
||||
Reference in New Issue
Block a user