execl问题修复

This commit is contained in:
andy
2026-09-10 17:30:27 +08:00
parent be7d765018
commit 07b23fce9e
18 changed files with 287 additions and 27 deletions

View File

@@ -100,7 +100,7 @@ const persistedExtensionResultVersions = new Map();
let taskCreateInProgress = false;
const AUTO_HANDOFF_RETRY_MS = 30_000;
const REQUIRED_EXTENSION_VERSION = '0.5.172';
const REQUIRED_EXTENSION_VERSION = '0.5.173';
const MANUAL_HANDOFF_LABEL = '确认并提交到 ERP 插件';
const RETRY_HANDOFF_LABEL = '继续提交到 ERP 插件';
const RECONCILE_LABEL = '只读回查 ERP 现有结果';

View File

@@ -1736,15 +1736,20 @@ function passengerCell(row, header) {
return '';
}
function normalizePassengerTsvText(text) {
// Tabs represent columns, including empty final fields; trim only boundary newlines.
return String(text || '').replace(/\r\n?/g, '\n').replace(/^\n+|\n+$/g, '');
}
function buildPassengerTsv(value = {}) {
if (typeof value.text === 'string' && value.text.trim()) return value.text.trim().replace(/\r\n?/g, '\n');
if (typeof value.text === 'string' && value.text.trim()) return normalizePassengerTsvText(value.text);
const rows = Array.isArray(value.rows) ? value.rows : [];
if (!rows.length) return '';
return [PASSENGER_HEADERS.join('\t'), ...rows.map((row) => PASSENGER_HEADERS.map((header) => passengerCell(row, header)).join('\t'))].join('\n');
}
function validatePassengerLeaderContact(value, text, path, errors) {
const lines = String(text || '').trim().replace(/\r\n?/g, '\n').split('\n').filter((line) => line.length > 0);
const lines = normalizePassengerTsvText(text).split('\n').filter((line) => line.length > 0);
const headers = String(lines[0] || '').split('\t').map((header) => header.trim());
if (headers.length !== PASSENGER_HEADERS.length
|| headers.some((header, index) => header !== PASSENGER_HEADERS[index])) return;
@@ -1987,7 +1992,7 @@ function validateAgentPassengerList(value, errors) {
errors.push(`${path}.text 必须包含本次提供的 13 列名单 TSV。`);
return;
}
const lines = value.text.trim().replace(/\r\n?/g, '\n').split('\n').filter((line) => line.length > 0);
const lines = normalizePassengerTsvText(value.text).split('\n').filter((line) => line.length > 0);
const header = String(lines[0] || '').split('\t');
if (header.length !== PASSENGER_HEADERS.length
|| header.some((name, index) => name.trim() !== PASSENGER_HEADERS[index])) {