Sync OneOS workspace with new prototypes, annotations, and Gitea remote fix.

Add vehicle-h2-fee-ledger, customer-management, lease and self-operated ledgers, annotation sources, agent skills, and vite annotation runtime support. Update vehicle management, contract templates, and lease contract flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
王冕
2026-06-30 15:27:23 +08:00
parent 00ca1846af
commit af29b26fe8
309 changed files with 73875 additions and 3838 deletions

View File

@@ -0,0 +1,49 @@
function escapeRegExp(value: string): string {
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
function shouldSkipModuleSpecifier(specifier: string, key: string, value: string): boolean {
const pathOnly = specifier.split(/[?#]/u)[0] || specifier;
return !value
|| !specifier.startsWith('/')
|| pathOnly === '/@react-refresh'
|| pathOnly === '/@vite/client'
|| new RegExp(`[?&]${escapeRegExp(key)}=`).test(specifier);
}
export function appendSearchParamToModuleSpecifier(specifier: string, key: string, value: string): string {
if (shouldSkipModuleSpecifier(specifier, key, value)) {
return specifier;
}
const hashIndex = specifier.indexOf('#');
const withoutHash = hashIndex >= 0 ? specifier.slice(0, hashIndex) : specifier;
const hash = hashIndex >= 0 ? specifier.slice(hashIndex) : '';
const separator = withoutHash.includes('?') ? '&' : '?';
return `${withoutHash}${separator}${encodeURIComponent(key)}=${encodeURIComponent(value)}${hash}`;
}
export function appendSearchParamToModuleSpecifiersInCode(code: string, key: string, value: string): string {
if (!value) {
return code;
}
return code
.replace(
/(\bfrom\s*["'])(\/[^"']+)(["'])/gu,
(_match, prefix: string, specifier: string, suffix: string) =>
`${prefix}${appendSearchParamToModuleSpecifier(specifier, key, value)}${suffix}`,
)
.replace(
/(\bimport\s*["'])(\/[^"']+)(["'])/gu,
(_match, prefix: string, specifier: string, suffix: string) =>
`${prefix}${appendSearchParamToModuleSpecifier(specifier, key, value)}${suffix}`,
)
.replace(
/(\bimport\s*\(\s*["'])(\/[^"']+)(["']\s*\))/gu,
(_match, prefix: string, specifier: string, suffix: string) =>
`${prefix}${appendSearchParamToModuleSpecifier(specifier, key, value)}${suffix}`,
);
}
export function appendProjectIdToModuleSpecifiersInCode(code: string, projectId: string): string {
return appendSearchParamToModuleSpecifiersInCode(code, 'projectId', projectId);
}