212ff3ff80
Introduce UMS ingest/snapshot pipeline, Context Planner with multi-source recall, runtime context injection, canonical user mapping, and session snapshot loading on auth/me. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { scheduleItemToTimelineItem } from './adapters/calendar.mjs';
|
|
|
|
test('scheduleItemToTimelineItem maps event with startAt', () => {
|
|
const ctx = {
|
|
temporalMode: 'PLANNED_IN',
|
|
time: {
|
|
mention_range: {
|
|
start: '2026-09-03T00:00:00+08:00',
|
|
end: '2026-09-04T00:00:00+08:00',
|
|
},
|
|
event_range: {
|
|
start: '2026-09-03T00:00:00+08:00',
|
|
end: '2026-09-04T00:00:00+08:00',
|
|
},
|
|
},
|
|
};
|
|
const item = scheduleItemToTimelineItem(
|
|
{
|
|
id: 'sched-1',
|
|
userId: 'user-1',
|
|
kind: 'event',
|
|
title: '与张总开会',
|
|
description: '项目方案确认',
|
|
startAt: new Date('2026-09-03T07:00:00.000Z').getTime(),
|
|
dueAt: null,
|
|
createdAt: new Date('2026-09-02T10:00:00.000Z').getTime(),
|
|
timezone: 'Asia/Shanghai',
|
|
location: null,
|
|
},
|
|
ctx,
|
|
);
|
|
assert.ok(item);
|
|
assert.equal(item.source, 'calendar');
|
|
assert.equal(item.type, 'event');
|
|
assert.equal(item.status, 'planned');
|
|
assert.equal(item.confidence, 0.98);
|
|
assert.match(item.source_ref, /^calendar:schedule:/);
|
|
});
|