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

@@ -20,8 +20,10 @@ describe('canvasHotUpdateFilterPlugin', () => {
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/canvas.excalidraw')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/canvas-assets/screenshot.png')).toBe(true);
expect(isCanvasHotUpdateFile('src/prototypes/home/canvas-assets/embed.png')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/.spec/ai-image-history.json')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/.spec/generation-artifacts.json')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/.spec/review.md')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/annotation-source.json')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/annotation-source.json?import&t=123')).toBe(true);
expect(isCanvasHotUpdateFile('/project/src/prototypes/home/index.tsx')).toBe(false);
});
@@ -38,15 +40,39 @@ describe('canvasHotUpdateFilterPlugin', () => {
modules: [{ id: 'screenshot' }],
})).toEqual([]);
expect(await handleHotUpdate({
file: '/project/src/prototypes/home/.spec/ai-image-history.json',
file: '/project/src/prototypes/home/.spec/generation-artifacts.json',
modules: [{ id: 'history' }],
})).toEqual([]);
expect(await handleHotUpdate({
file: '/project/src/prototypes/home/annotation-source.json',
modules: [{ id: 'annotation-source' }],
})).toEqual([]);
expect(await handleHotUpdate({
file: '/project/src/prototypes/home/index.tsx',
modules: [{ id: 'index' }],
})).toBeUndefined();
});
it('invalidates annotation source modules while suppressing browser reloads', async () => {
const plugin = canvasHotUpdateFilterPlugin();
const handleHotUpdate = plugin.handleHotUpdate as any;
const annotationModule = { id: 'annotation-source' };
const otherModule = { id: 'canvas' };
const invalidateModule = vi.fn();
expect(await handleHotUpdate({
file: '/project/src/prototypes/home/annotation-source.json',
modules: [annotationModule, otherModule],
server: {
moduleGraph: { invalidateModule },
},
timestamp: 123,
})).toEqual([]);
expect(invalidateModule).toHaveBeenCalledWith(annotationModule, undefined, 123, true);
expect(invalidateModule).toHaveBeenCalledWith(otherModule, undefined, 123, true);
});
it('drops Vite full reload payloads caused by canvas data files', async () => {
const hotSend = vi.fn();
const wsSend = vi.fn();
@@ -70,6 +96,10 @@ describe('canvasHotUpdateFilterPlugin', () => {
type: 'full-reload',
triggeredBy: '/project/src/prototypes/home/.spec/review.md',
});
server.ws.send({
type: 'full-reload',
triggeredBy: '/project/src/prototypes/home/annotation-source.json',
});
expect(hotSend).not.toHaveBeenCalled();
expect(wsSend).not.toHaveBeenCalled();
@@ -84,6 +114,69 @@ describe('canvasHotUpdateFilterPlugin', () => {
expect(wsSend).toHaveBeenCalledTimes(1);
});
it('drops Vite update payloads caused only by annotation source modules', async () => {
const hotSend = vi.fn();
const server = {
hot: { send: hotSend },
ws: { send: vi.fn() },
};
const plugin = canvasHotUpdateFilterPlugin();
await runConfigureServer(plugin, server);
server.hot.send({
type: 'update',
updates: [{
type: 'js-update',
timestamp: 1,
path: '/src/prototypes/home/annotation-source.json?import&t=123',
acceptedPath: '/src/prototypes/home/annotation-source.json?import&t=123',
}],
});
expect(hotSend).not.toHaveBeenCalled();
});
it('keeps non-canvas Vite updates when they are batched with annotation source modules', async () => {
const hotSend = vi.fn();
const server = {
hot: { send: hotSend },
ws: { send: vi.fn() },
};
const plugin = canvasHotUpdateFilterPlugin();
await runConfigureServer(plugin, server);
server.hot.send({
type: 'update',
updates: [
{
type: 'js-update',
timestamp: 1,
path: '/src/prototypes/home/annotation-source.json?import&t=123',
acceptedPath: '/src/prototypes/home/annotation-source.json?import&t=123',
},
{
type: 'js-update',
timestamp: 1,
path: '/src/prototypes/home/index.tsx',
acceptedPath: '/src/prototypes/home/index.tsx',
},
],
});
expect(hotSend).toHaveBeenCalledTimes(1);
expect(hotSend.mock.calls[0]?.[0]).toEqual({
type: 'update',
updates: [{
type: 'js-update',
timestamp: 1,
path: '/src/prototypes/home/index.tsx',
acceptedPath: '/src/prototypes/home/index.tsx',
}],
});
});
it('identifies only canvas-triggered full reload payloads as droppable', () => {
expect(shouldDropCanvasFullReloadPayload({
type: 'full-reload',
@@ -95,7 +188,11 @@ describe('canvasHotUpdateFilterPlugin', () => {
})).toBe(true);
expect(shouldDropCanvasFullReloadPayload({
type: 'full-reload',
triggeredBy: '/project/src/prototypes/home/.spec/ai-image-history.json',
triggeredBy: '/project/src/prototypes/home/.spec/generation-artifacts.json',
})).toBe(true);
expect(shouldDropCanvasFullReloadPayload({
type: 'full-reload',
triggeredBy: '/project/src/prototypes/home/annotation-source.json',
})).toBe(true);
expect(shouldDropCanvasFullReloadPayload({
type: 'full-reload',