@startsimpli/integrations 0.2.197 → 0.2.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/src/__tests__/briefing-actions.test.ts +11 -0
- package/src/__tests__/briefing-edits.test.ts +98 -0
- package/src/__tests__/converse-brain.test.ts +64 -1
- package/src/__tests__/converse-handoff.test.ts +8 -0
- package/src/__tests__/converse-meeting-brief.test.ts +72 -8
- package/src/__tests__/converse-meeting-duplex.test.ts +132 -0
- package/src/__tests__/converse-meeting-keep-speech.test.ts +87 -0
- package/src/__tests__/converse-meeting-vad.test.ts +1 -1
- package/src/__tests__/converse-spoken-form.test.ts +10 -0
- package/src/__tests__/converse-spoken-summary.test.ts +27 -6
- package/src/__tests__/converse.test.ts +29 -2
- package/src/__tests__/corpus-ask-items.test.ts +14 -0
- package/src/__tests__/corpus-ask.test.ts +22 -0
- package/src/__tests__/corpus-tracker.test.tsx +12 -0
- package/src/__tests__/extract-classify.test.ts +17 -0
- package/src/__tests__/fleet-page.test.tsx +57 -0
- package/src/__tests__/fleet-view.test.ts +149 -0
- package/src/__tests__/project-basis-entity.test.ts +19 -0
- package/src/__tests__/project-basis.test.ts +21 -0
- package/src/__tests__/relay-cli.test.ts +10 -1
- package/src/__tests__/spoken-time.test.ts +4 -0
- package/src/__tests__/task-detail-project-guess.test.tsx +46 -0
- package/src/__tests__/voice-due-later-sentence.test.ts +26 -0
- package/src/components/index.ts +2 -0
- package/src/components/pages/FleetPage.tsx +115 -0
- package/src/components/pages/TaskDetailPage.tsx +27 -1
- package/src/components/pages/TrackerPage.tsx +1 -1
- package/src/components/pages/task-tracker/ProjectGuess.tsx +42 -0
- package/src/corpus/ask-items-intent.ts +24 -0
- package/src/corpus/ask-items.ts +7 -4
- package/src/corpus/ask.ts +1 -1
- package/src/corpus/briefing/actions/confirm.ts +9 -1
- package/src/corpus/briefing/actions/execute.ts +71 -11
- package/src/corpus/briefing/actions/log.ts +1 -1
- package/src/corpus/briefing/actions/seam.ts +18 -2
- package/src/corpus/briefing/actions/types.ts +14 -0
- package/src/corpus/briefing/intent/describe.ts +5 -1
- package/src/corpus/briefing/intent/edits.ts +92 -0
- package/src/corpus/briefing/intent/grammar.ts +3 -0
- package/src/corpus/briefing/intent/ground.ts +5 -1
- package/src/corpus/briefing/intent/match.ts +3 -1
- package/src/corpus/briefing/intent/model.ts +36 -3
- package/src/corpus/briefing/intent/resolve.ts +12 -1
- package/src/corpus/briefing/intent/types.ts +8 -0
- package/src/corpus/briefing/speak.ts +13 -0
- package/src/corpus/client.ts +2 -0
- package/src/corpus/converse/brain.ts +41 -13
- package/src/corpus/converse/briefing-queue.ts +105 -27
- package/src/corpus/converse/client.ts +6 -0
- package/src/corpus/converse/fleet-view.ts +126 -0
- package/src/corpus/converse/fleet.ts +18 -5
- package/src/corpus/converse/followups.ts +12 -2
- package/src/corpus/converse/handle.ts +21 -12
- package/src/corpus/converse/handoff.ts +7 -2
- package/src/corpus/converse/index.ts +5 -3
- package/src/corpus/converse/meeting-config.ts +8 -4
- package/src/corpus/converse/meeting.ts +66 -11
- package/src/corpus/converse/respond.ts +14 -2
- package/src/corpus/converse/spoken-form.ts +9 -2
- package/src/corpus/converse/spoken-summary.ts +30 -8
- package/src/corpus/converse/store.ts +2 -0
- package/src/corpus/converse/types.ts +14 -1
- package/src/corpus/entities.ts +2 -0
- package/src/corpus/extract.ts +9 -4
- package/src/corpus/project-basis.ts +23 -0
- package/src/corpus/spoken-time.ts +18 -2
- package/src/corpus/types.ts +6 -0
- package/src/corpus/voice-due.ts +24 -0
- package/src/native/app/converseServices.ts +5 -3
- package/src/native/app/device.ts +2 -0
- package/src/native/converse/ConverseScreen.tsx +28 -0
- package/src/native/converse/__tests__/liveScreen.test.tsx +35 -2
- package/src/native/converse/__tests__/meetingIO.test.ts +55 -1
- package/src/native/converse/format.ts +2 -2
- package/src/native/converse/io.ts +15 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { spokenSummary } from '../corpus/converse/spoken-summary';
|
|
3
|
+
import { spokenRest, spokenSummary, WANTS_THE_REST } from '../corpus/converse/spoken-summary';
|
|
4
4
|
|
|
5
5
|
describe('what is said aloud for a long answer', () => {
|
|
6
6
|
it('a short answer is said whole', () => {
|
|
@@ -10,21 +10,42 @@ describe('what is said aloud for a long answer', () => {
|
|
|
10
10
|
|
|
11
11
|
it('a numbered list: the lead-in, three items, and N more', () => {
|
|
12
12
|
const said = spokenSummary('This week, the following tasks are due: 1. Plan out the week ahead (due 2026-11-20). 2. Build lead QC on staging. 3. Launch lead for Crochet V2. 4. Order the bench. 5. Call the bank. 6. Pay the rent.');
|
|
13
|
-
expect(said).toBe('This week, the following tasks are due. Plan out the week ahead (due 2026-11-20). Build lead QC on staging. Launch lead for Crochet V2. And 3 more.');
|
|
13
|
+
expect(said).toBe('This week, the following tasks are due. Plan out the week ahead (due 2026-11-20). Build lead QC on staging. Launch lead for Crochet V2. And 3 more. Want the rest?');
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it('a long run-on list is cut at a comma and points to the screen', () => {
|
|
17
17
|
const long = 'Today, you have tasks that include checking the debug AI backend and UI updates, completing two sessions of 15 minutes on the debug UI, completing two sessions of 15 minutes on the marketing agent UI, running a quick check of the V2 marketing agent deployed app, reviewing and providing feedback on the animated video builder, creating two videos for top articles and one video for landing pages';
|
|
18
18
|
const said = spokenSummary(long)!;
|
|
19
|
-
expect(said.split(/\s+/).length).toBeLessThan(
|
|
20
|
-
expect(said).toMatch(/
|
|
19
|
+
expect(said.split(/\s+/).length).toBeLessThan(35);
|
|
20
|
+
expect(said).toMatch(/Want the rest\?$/);
|
|
21
21
|
expect(said.startsWith('Today, you have tasks that include')).toBe(true);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it('long prose is cut at a sentence', () => {
|
|
25
25
|
const prose = `${'The relay shipped the combined roll and verified production across every service. '.repeat(5)}`;
|
|
26
26
|
const said = spokenSummary(prose)!;
|
|
27
|
-
expect(said).toMatch(/
|
|
28
|
-
expect(said.split(/\s+/).length).toBeLessThanOrEqual(
|
|
27
|
+
expect(said).toMatch(/Want the rest\?$/);
|
|
28
|
+
expect(said.split(/\s+/).length).toBeLessThanOrEqual(35);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('spokenRest is what was not said: the other list items, the other sentences', () => {
|
|
32
|
+
const list = 'This week: 1. Plan. 2. Build. 3. Launch. 4. Order the bench. 5. Call the bank.';
|
|
33
|
+
expect(spokenRest(list)).toBe('Order the bench. Call the bank.');
|
|
34
|
+
const prose = 'The relay shipped the combined roll and verified production across every service. '.repeat(4).trim();
|
|
35
|
+
expect(spokenRest(prose)).toBe('The relay shipped the combined roll and verified production across every service. The relay shipped the combined roll and verified production across every service.');
|
|
36
|
+
expect(spokenRest('Two things are due today.')).toBeUndefined();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('a long remainder is itself said short, so "yes" walks through the answer a piece at a time', () => {
|
|
40
|
+
let left: string | undefined = 'This is a sentence that carries a handful of words in it. '.repeat(12).trim();
|
|
41
|
+
let pieces = 0;
|
|
42
|
+
while (left && pieces < 20) { const next = spokenRest(left); pieces += 1; left = next; }
|
|
43
|
+
expect(pieces).toBeGreaterThan(2);
|
|
44
|
+
expect(left).toBeUndefined();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('recognizes the yes that asks for the rest, and nothing else', () => {
|
|
48
|
+
for (const y of ['yes', 'Yeah, go on.', 'the rest', 'yes please', 'read the rest', 'continue']) expect(WANTS_THE_REST.test(y)).toBe(true);
|
|
49
|
+
for (const n of ['yes move the car service to friday', 'what is due tomorrow', 'no']) expect(WANTS_THE_REST.test(n)).toBe(false);
|
|
29
50
|
});
|
|
30
51
|
});
|
|
@@ -164,10 +164,10 @@ describe('what is said after wrapping up', () => {
|
|
|
164
164
|
const { deps, t } = setup();
|
|
165
165
|
const asks = ['Call the bank', 'Review the checkout copy', 'Order the bench', 'Pay rent', 'Check the greenhouse'];
|
|
166
166
|
const brains = [{ text: 'Got it.', intent: 'note' as const }, { text: 'Filing it now.', intent: 'note' as const, finish: true }];
|
|
167
|
-
const withBrain = { ...deps, brain: async () => brains.shift()!, extract: async () => ({ asks, decisions: [] }), handoff: async () =>
|
|
167
|
+
const withBrain = { ...deps, brain: async () => brains.shift()!, extract: async () => ({ asks, decisions: [] }), handoff: async () => ({ project: 'Hours' }) };
|
|
168
168
|
const first = await handleConverseTurn(withBrain as never, { text: 'a long note about my day' });
|
|
169
169
|
const last = await handleConverseTurn(withBrain as never, { text: 'parse that note', conversationId: first.conversation_id });
|
|
170
|
-
expect(last.reply_text).toBe('Filed the note and 5 to-dos: Call the bank, Review the checkout copy, Order the bench, and 2 more.');
|
|
170
|
+
expect(last.reply_text).toBe('Filed the note under Hours and 5 to-dos: Call the bank, Review the checkout copy, Order the bench, and 2 more.');
|
|
171
171
|
const row = [...t.rows.values()].find((r) => r.data.source === 'conversation')!;
|
|
172
172
|
expect(row.data.status).toBe('ended');
|
|
173
173
|
expect(row.data.turns).toHaveLength(2);
|
|
@@ -181,6 +181,15 @@ describe('what is said after wrapping up', () => {
|
|
|
181
181
|
const last = await handleConverseTurn(withBrain as never, { text: "that's it", conversationId: first.conversation_id });
|
|
182
182
|
expect(last.reply_text).toBe('Filed the note.');
|
|
183
183
|
});
|
|
184
|
+
it('says when no project fit, and counts only what was really filed (not an ask already added during the talk)', async () => {
|
|
185
|
+
const { deps } = setup();
|
|
186
|
+
const brains = [{ text: 'Added Call the bank.', intent: 'command' as const, did: ['Added Call the bank.'] }, { text: 'Filing it now.', intent: 'note' as const, finish: true }];
|
|
187
|
+
const withBrain = { ...deps, brain: async () => brains.shift()!, extract: async () => ({ asks: ['Call the bank', 'Pay rent'], decisions: [] }), handoff: async () => ({ project: null }) };
|
|
188
|
+
const first = await handleConverseTurn(withBrain as never, { text: 'call the bank' });
|
|
189
|
+
const last = await handleConverseTurn(withBrain as never, { text: 'parse that note', conversationId: first.conversation_id });
|
|
190
|
+
expect(last.reply_text).toBe('Filed the note with no project and 1 to-do: Pay rent.');
|
|
191
|
+
expect(last.filed).toEqual({ note: true, todos: 1 });
|
|
192
|
+
});
|
|
184
193
|
});
|
|
185
194
|
|
|
186
195
|
describe('the turn wraps the conversation up itself', () => {
|
|
@@ -232,6 +241,24 @@ describe('the items an answer listed are kept for follow-ups', () => {
|
|
|
232
241
|
});
|
|
233
242
|
});
|
|
234
243
|
|
|
244
|
+
describe('a which-one question is kept for the next turn (startsim-ym54h.31)', () => {
|
|
245
|
+
it('the next turn gets it, and it is gone after that turn and after End', async () => {
|
|
246
|
+
const { deps, t } = setup();
|
|
247
|
+
const seen: unknown[] = [];
|
|
248
|
+
const pending = { utterance: 'move the bench one', question: 'Which one: A or B?' };
|
|
249
|
+
const turns = [{ text: pending.question, pending }, { text: 'Moved.', pending: null }, { text: 'ok' }];
|
|
250
|
+
const withBrain = { ...deps, brain: async (input: any) => { seen.push(input.pending); return turns.shift()!; } };
|
|
251
|
+
const first = await handleConverseTurn(withBrain as never, { text: pending.utterance });
|
|
252
|
+
const row = () => [...t.rows.values()].find((r) => r.data.source === 'conversation');
|
|
253
|
+
expect(row().data.pending).toEqual(pending);
|
|
254
|
+
await handleConverseTurn(withBrain as never, { text: 'the A one', conversationId: first.conversation_id });
|
|
255
|
+
expect(seen[1]).toEqual(pending);
|
|
256
|
+
expect(row().data.pending).toBeNull();
|
|
257
|
+
await handleConverseTurn(withBrain as never, { text: 'thanks', conversationId: first.conversation_id });
|
|
258
|
+
expect(seen[2]).toBeNull();
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
235
262
|
describe('the voice says dates and ids the way a person would, the screen keeps the text', () => {
|
|
236
263
|
it('speaks "Friday" for an ISO date and drops the ticket id; stores the text as written', async () => {
|
|
237
264
|
const { deps, t } = setup();
|
|
@@ -53,6 +53,20 @@ describe('itemIntent', () => {
|
|
|
53
53
|
const i = itemIntent('what did I commit to this week?', NOW)!;
|
|
54
54
|
expect([i.focus, i.from, i.to, i.mine]).toEqual(['committed', '2026-11-09', '2026-11-15', true]);
|
|
55
55
|
});
|
|
56
|
+
it('reads a month name as that whole month', () => {
|
|
57
|
+
const i = itemIntent('What is due in December?', NOW)!;
|
|
58
|
+
expect([i.focus, i.from, i.to]).toEqual(['due', '2026-12-01', '2026-12-31']);
|
|
59
|
+
expect(itemIntent('what is due in February 2027', NOW)!.to).toBe('2027-02-28');
|
|
60
|
+
});
|
|
61
|
+
it('reads a month already passed this year as next year, and the current month whole', () => {
|
|
62
|
+
expect(itemIntent('what is due in March', NOW)!.from).toBe('2027-03-01');
|
|
63
|
+
const nov = itemIntent('what is due in November', NOW)!;
|
|
64
|
+
expect([nov.from, nov.to]).toEqual(['2026-11-01', '2026-11-30']);
|
|
65
|
+
});
|
|
66
|
+
it('reads next month', () => {
|
|
67
|
+
const i = itemIntent('what is due next month', NOW)!;
|
|
68
|
+
expect([i.from, i.to]).toEqual(['2026-12-01', '2026-12-31']);
|
|
69
|
+
});
|
|
56
70
|
it('uses the reader zone for today', () => {
|
|
57
71
|
expect(itemIntent('what is overdue', Date.parse('2026-11-12T02:00:00Z'), 'America/New_York')!.today).toBe('2026-11-11');
|
|
58
72
|
});
|
|
@@ -345,3 +345,25 @@ describe('generate mode', () => {
|
|
|
345
345
|
expect(result.citations[0].document.source).toBe('dropbox');
|
|
346
346
|
});
|
|
347
347
|
});
|
|
348
|
+
|
|
349
|
+
describe('project names are read beside the item list, not before it (startsim-ym54h.23)', () => {
|
|
350
|
+
it('the commitments read starts while the project names are still loading, and the names still reach the item records', async () => {
|
|
351
|
+
const NOW = Date.parse('2026-11-16T17:00:00Z');
|
|
352
|
+
let release: (v: Record<string, string>) => void = () => undefined;
|
|
353
|
+
const names = new Promise<Record<string, string>>((resolve) => { release = resolve; });
|
|
354
|
+
let listed = false;
|
|
355
|
+
const commitments = {
|
|
356
|
+
listCommitments: async () => {
|
|
357
|
+
listed = true;
|
|
358
|
+
release({ f1: 'Website' });
|
|
359
|
+
return { count: 1, next: null, previous: null, results: [{ id: 'c1', externalId: 'c1', title: 'Fix header', status: 'open', dueAt: '2026-11-17', focusId: 'f1', firstSeenAt: '2026-11-15T16:00:00Z', lastSeenAt: '2026-11-15T16:00:00Z', source: 'voice', scope: { orgId: FIXTURE_ORG } }] };
|
|
360
|
+
},
|
|
361
|
+
} as never;
|
|
362
|
+
const calls: any[] = [];
|
|
363
|
+
const corpus = createFixtureCorpusApi({ scope: SCOPE });
|
|
364
|
+
await askCorpus(ask('what is due tomorrow'), { corpus, llm: scriptedLlm({ answer: 'ok', citations: [] }, calls), commitments }, { now: NOW, timeZone: 'America/Denver', focusNames: names });
|
|
365
|
+
expect(listed).toBe(true);
|
|
366
|
+
const item = calls[0].documents.find((d: any) => d.id === 'item:c1');
|
|
367
|
+
expect(item.text).toContain('Project: Website');
|
|
368
|
+
});
|
|
369
|
+
});
|
|
@@ -808,3 +808,15 @@ describe('TrackerPage — 400+ open to-dos, paged by the server (bd startsim-768
|
|
|
808
808
|
expect(queries.filter((q) => q.page).map((q) => q.page)).toEqual([2, 3]);
|
|
809
809
|
});
|
|
810
810
|
});
|
|
811
|
+
|
|
812
|
+
describe('TrackerPage — a guessed project (bd startsim-tmrvi.22)', () => {
|
|
813
|
+
it('marks a project that was only guessed from the topic, and leaves a named one plain', async () => {
|
|
814
|
+
const rows = [
|
|
815
|
+
commitment({ externalId: 'commit:g1', title: 'Send the lease paperwork', focusId: 'f1', projectBasis: 'guessed from the topic' }),
|
|
816
|
+
commitment({ externalId: 'commit:g2', title: 'Call the plumber', focusId: 'f1' }),
|
|
817
|
+
];
|
|
818
|
+
render(<TrackerPage api={makeApi({ rows })} scope={SCOPE} now={NOW} projectNames={{ f1: 'Home admin' }} />);
|
|
819
|
+
expect(await screen.findByText('Home admin (guessed)')).toBeInTheDocument();
|
|
820
|
+
expect(screen.getAllByText('Home admin')).toHaveLength(1);
|
|
821
|
+
});
|
|
822
|
+
});
|
|
@@ -227,3 +227,20 @@ describe('the model adapter', () => {
|
|
|
227
227
|
expect(bad.chat).toHaveBeenCalledTimes(2);
|
|
228
228
|
});
|
|
229
229
|
});
|
|
230
|
+
|
|
231
|
+
describe('a project placed only by topic is marked as a guess (bd startsim-tmrvi.22)', () => {
|
|
232
|
+
it('marks classifier-placed items, never a personal one', async () => {
|
|
233
|
+
const { corpus, saves } = world();
|
|
234
|
+
await extractCommitments({ scope: SCOPE }, { corpus, extractor: extractor(reader()) });
|
|
235
|
+
const items = saves[0].items;
|
|
236
|
+
const placed = items.filter((i) => i.focusId);
|
|
237
|
+
expect(placed.length).toBeGreaterThan(0);
|
|
238
|
+
for (const item of placed) {
|
|
239
|
+
const title = NOV5_CANDIDATES.find((c) => c.id === item.focusId)!.title.toLowerCase();
|
|
240
|
+
const named = `${item.title} ${item.detail ?? ''} ${item.mentions.map((m) => m.quote).join(' ')}`.toLowerCase().includes(title);
|
|
241
|
+
expect(item.projectBasis, item.title).toBe(named ? undefined : 'guessed from the topic');
|
|
242
|
+
}
|
|
243
|
+
expect(placed.some((i) => i.projectBasis === 'guessed from the topic')).toBe(true);
|
|
244
|
+
expect(byTitle(items, 'bench').projectBasis).toBeUndefined();
|
|
245
|
+
});
|
|
246
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { cleanup, render, screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
|
|
6
|
+
import { FleetPage, type FleetPayload } from '../components/pages/FleetPage';
|
|
7
|
+
|
|
8
|
+
afterEach(cleanup);
|
|
9
|
+
const s = (id: string, name: string, goal = '') => ({ id, name, goal, machine: 'Mac/x', repo: 'r', branch: 'b', status: 'live' as const });
|
|
10
|
+
const view = {
|
|
11
|
+
relay: s('7afdf27a', 'Relay: fleet manager', 'Runs the fleet'),
|
|
12
|
+
leads: [
|
|
13
|
+
{ role: 'Tandem coordinator', notes: 'owns stack', session: s('0ec3d1ff', 'Tandem coordinator', 'Coordinate Tandem'), children: [s('9eb03770', 'lane two', 'Voice notes')] },
|
|
14
|
+
{ role: 'Platform coordinator', notes: 'PR waits', session: null, children: [] },
|
|
15
|
+
],
|
|
16
|
+
others: [s('11112222', 'stray', 'Something else')],
|
|
17
|
+
waitingOnQuinn: ['Sidebar name?'], waitingOnSessions: ['platform f7ebc9cc: proof'], rolesUpdated: 'x', loopsUpdated: '2026-11-16', unparsed: ['a stray line'], sections: [{ title: 'State 11-18', items: ['Crochets live'] }],
|
|
18
|
+
ports: [{ project: 'Tandem', range: '4300-4309', base: '4300', url: 'http://localhost:4300', notes: '' }],
|
|
19
|
+
};
|
|
20
|
+
const payload = (over: Partial<FleetPayload> = {}): FleetPayload => ({ snapshot: { text: 'notes', updatedAt: new Date().toISOString(), view }, ...over });
|
|
21
|
+
|
|
22
|
+
describe('FleetPage', () => {
|
|
23
|
+
it('shows what waits on Quinn first, then relay, leads, children, others', async () => {
|
|
24
|
+
render(<FleetPage load={async () => payload()} />);
|
|
25
|
+
await waitFor(() => expect(screen.getByTestId('fleet-waiting-quinn')).toBeTruthy());
|
|
26
|
+
expect(screen.getByTestId('fleet-waiting-quinn').textContent).toContain('Sidebar name?');
|
|
27
|
+
expect(screen.getByTestId('fleet-relay').textContent).toContain('Runs the fleet');
|
|
28
|
+
const lead = screen.getByTestId('fleet-lead-Tandem coordinator');
|
|
29
|
+
expect(lead.textContent).toContain('Coordinate Tandem');
|
|
30
|
+
expect(lead.textContent).toContain('Voice notes');
|
|
31
|
+
expect(screen.getByTestId('fleet-lead-Platform coordinator').textContent).toContain('No live session');
|
|
32
|
+
expect(screen.getByTestId('fleet-others').textContent).toContain('Something else');
|
|
33
|
+
});
|
|
34
|
+
it('lists local stack URLs and the lines it could not place', async () => {
|
|
35
|
+
render(<FleetPage load={async () => payload()} />);
|
|
36
|
+
await waitFor(() => expect(screen.getByTestId('fleet-ports')).toBeTruthy());
|
|
37
|
+
expect(screen.getByTestId('fleet-ports').querySelector('a')?.getAttribute('href')).toBe('http://localhost:4300');
|
|
38
|
+
expect(screen.getByTestId('fleet-sections').textContent).toContain('State 11-18');
|
|
39
|
+
expect(screen.getByTestId('fleet-unparsed').textContent).toContain('a stray line');
|
|
40
|
+
});
|
|
41
|
+
it('flags an old snapshot as stale', async () => {
|
|
42
|
+
render(<FleetPage load={async () => payload({ snapshot: { text: 'n', updatedAt: new Date(Date.now() - 3 * 3600_000).toISOString(), view } })} />);
|
|
43
|
+
await waitFor(() => expect(screen.getByTestId('fleet-age').textContent).toMatch(/3 hours ago/));
|
|
44
|
+
expect(screen.getByTestId('fleet-age').getAttribute('data-stale')).toBe('true');
|
|
45
|
+
});
|
|
46
|
+
it('says so when the relay has not posted, and falls back to text without a view', async () => {
|
|
47
|
+
const { rerender } = render(<FleetPage load={async () => ({ snapshot: null })} />);
|
|
48
|
+
await waitFor(() => expect(screen.getByTestId('fleet-empty')).toBeTruthy());
|
|
49
|
+
rerender(<FleetPage load={async () => payload({ snapshot: { text: 'plain notes', updatedAt: new Date().toISOString(), view: null } })} key="b" />);
|
|
50
|
+
await waitFor(() => expect(screen.getByTestId('fleet-text').textContent).toContain('plain notes'));
|
|
51
|
+
});
|
|
52
|
+
it('shows a load error with retry', async () => {
|
|
53
|
+
const load = vi.fn().mockRejectedValueOnce(new Error('boom')).mockResolvedValue(payload());
|
|
54
|
+
render(<FleetPage load={load} />);
|
|
55
|
+
await waitFor(() => expect(screen.getByTestId('load-error')).toBeTruthy());
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
/** The structured fleet view (Tandem /fleet): roles.md + open-loops ledger + `bridge find` -> relay, leads, children. */
|
|
3
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
+
|
|
5
|
+
import { buildFleetView, parseBridgeFind, parseLoops, parseRoles } from '../corpus/converse';
|
|
6
|
+
|
|
7
|
+
const ROLES = `# Role registry
|
|
8
|
+
Updated 2026-11-18 ~12:30 MT
|
|
9
|
+
|
|
10
|
+
| Role | Live session | Notes |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Tandem coordinator | 0ec3d1ff | owns Tandem stack; lane 2 = 9eb03770 reports to it |
|
|
13
|
+
| Crochets coordinator | a90ab874 (spawn daf13afc, live) | no live children; old c91210f5 ended |
|
|
14
|
+
| DebuggAI platform coordinator | none live (abe4c934 ended) | PR 837 await promote |
|
|
15
|
+
| Relay | 7afdf27a | relay.json current |
|
|
16
|
+
|
|
17
|
+
Rules: message only these.`;
|
|
18
|
+
|
|
19
|
+
const LOOPS = `# Relay open loops
|
|
20
|
+
Updated 2026-11-16 ~11:10 MT.
|
|
21
|
+
|
|
22
|
+
## Waiting on Quinn (restate in full when asking)
|
|
23
|
+
- Sidebar name: "Plan" or "Strategy"?
|
|
24
|
+
- Unpause crochet-patterns later?
|
|
25
|
+
|
|
26
|
+
## Waiting on sessions (I follow up if silent)
|
|
27
|
+
- platform f7ebc9cc: crawl guard proof
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const FIND = [
|
|
31
|
+
'[live] `Mac/last-chance · Relay: Quinn\'s fleet manager · 7afdf27a` Quinn\'s relay start-simpli@green/x',
|
|
32
|
+
'[live] `Mac/last-chance · Tandem coordinator: assistant · 0ec3d1ff` Coordinate Tandem work start-simpli@spawn/86b8 [model claude-sonnet-5-5]',
|
|
33
|
+
'[live] `Mac/last-chance · lane two · 9eb03770` Voice notes start-simpli@spawn/x',
|
|
34
|
+
'[live] `Mac/last-chance · Crochets coordinator · a90ab874` Fix patterns start-simpli@spawn/daf1',
|
|
35
|
+
'[live] `Mac/last-chance · spawn runner · runner-l` starts sessions spawn-runner',
|
|
36
|
+
'[live] `Mac/last-chance · stray · 11112222` Something else crochet@main',
|
|
37
|
+
'[dormant] `Mac/last-chance · asleep · 33334444` Napping start-simpli@y',
|
|
38
|
+
' resume (on last-chance@debugg.ai): claude --resume 33334444',
|
|
39
|
+
].join('\n');
|
|
40
|
+
|
|
41
|
+
describe('parsers', () => {
|
|
42
|
+
it('reads roles', () => {
|
|
43
|
+
const r = parseRoles(ROLES);
|
|
44
|
+
expect(r.updated).toBe('2026-11-18 ~12:30 MT');
|
|
45
|
+
expect(r.rows.map((x) => [x.role, x.sessionId])).toEqual([['Tandem coordinator', '0ec3d1ff'], ['Crochets coordinator', 'a90ab874'], ['DebuggAI platform coordinator', null], ['Relay', '7afdf27a']]);
|
|
46
|
+
expect(r.rows[0].childIds).toEqual(['9eb03770']);
|
|
47
|
+
expect(r.rows[1].childIds).toEqual(['daf13afc', 'c91210f5'].filter((x) => x !== 'daf13afc'));
|
|
48
|
+
});
|
|
49
|
+
it('reads loops by section', () => {
|
|
50
|
+
const l = parseLoops(LOOPS);
|
|
51
|
+
expect(l.updated).toBe('2026-11-16 ~11:10 MT.');
|
|
52
|
+
expect(l.waitingOnQuinn).toEqual(['Sidebar name: "Plan" or "Strategy"?', 'Unpause crochet-patterns later?']);
|
|
53
|
+
expect(l.waitingOnSessions).toEqual(['platform f7ebc9cc: crawl guard proof']);
|
|
54
|
+
});
|
|
55
|
+
it('reads bridge find, skipping runners and resume lines', () => {
|
|
56
|
+
const s = parseBridgeFind(FIND);
|
|
57
|
+
expect(s.map((x) => x.id)).toEqual(['7afdf27a', '0ec3d1ff', '9eb03770', 'a90ab874', '11112222', '33334444']);
|
|
58
|
+
expect(s[1]).toMatchObject({ name: 'Tandem coordinator: assistant', goal: 'Coordinate Tandem work', repo: 'start-simpli', branch: 'spawn/86b8', status: 'live', machine: 'Mac/last-chance' });
|
|
59
|
+
expect(s[5].status).toBe('dormant');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const PORTS = `# Local dev port ranges
|
|
64
|
+
| Project | Range | Base (staging) | Notes |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| Tandem | 4300-4309 | 4300 gateway (tandem-web) | 4303 fast loop |
|
|
67
|
+
| Other | 4360+ | ask relay | |`;
|
|
68
|
+
|
|
69
|
+
describe('tolerance', () => {
|
|
70
|
+
it('keeps lines it cannot place instead of failing', () => {
|
|
71
|
+
const v = buildFleetView({ roles: ROLES + '\nsomeone typed a stray note here\n| broken row |', loops: LOOPS + '\nfree text under the ledger\n## Misc\n- random\n## PRIORITIES (Quinn, today)\n- one', ports: PORTS, sessions: 'garbage\n[live] `no id here` x' });
|
|
72
|
+
expect(v.unparsed).toEqual(expect.arrayContaining(['Rules: message only these.', 'someone typed a stray note here', '| broken row |']));
|
|
73
|
+
expect(v.waitingOnSessions).toContain('free text under the ledger'); // stays in the section it was written under
|
|
74
|
+
expect(v.sections).toEqual([{ title: 'Misc', items: ['random'] }, { title: 'PRIORITIES (Quinn, today)', items: ['one'] }]);
|
|
75
|
+
expect(v.waitingOnQuinn).toHaveLength(2);
|
|
76
|
+
expect(v.leads.length).toBe(3);
|
|
77
|
+
});
|
|
78
|
+
it('lists per-project base URLs from ports.md', () => {
|
|
79
|
+
const v = buildFleetView({ ports: PORTS });
|
|
80
|
+
expect(v.ports).toEqual([
|
|
81
|
+
{ project: 'Tandem', range: '4300-4309', base: '4300 gateway (tandem-web)', url: 'http://localhost:4300', notes: '4303 fast loop' },
|
|
82
|
+
{ project: 'Other', range: '4360+', base: 'ask relay', url: null, notes: '' },
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
describe('buildFleetView', () => {
|
|
88
|
+
it('nests relay -> leads -> children and lists the rest', () => {
|
|
89
|
+
const v = buildFleetView({ roles: ROLES, loops: LOOPS, sessions: FIND });
|
|
90
|
+
expect(v.relay?.id).toBe('7afdf27a');
|
|
91
|
+
expect(v.leads.map((l) => l.role)).toEqual(['Tandem coordinator', 'Crochets coordinator', 'DebuggAI platform coordinator']);
|
|
92
|
+
expect(v.leads[0].session?.id).toBe('0ec3d1ff');
|
|
93
|
+
expect(v.leads[0].children.map((c) => c.id)).toEqual(['9eb03770']);
|
|
94
|
+
expect(v.leads[2].session).toBeNull();
|
|
95
|
+
expect(v.others.map((o) => o.id)).toEqual(['11112222', '33334444']);
|
|
96
|
+
expect(v.waitingOnQuinn).toHaveLength(2);
|
|
97
|
+
expect(v.rolesUpdated).toBe('2026-11-18 ~12:30 MT');
|
|
98
|
+
});
|
|
99
|
+
it('falls back to a live session named for the role when the listed id is not live', () => {
|
|
100
|
+
const v = buildFleetView({ roles: ROLES.replace('0ec3d1ff', 'deadbeef'), sessions: FIND });
|
|
101
|
+
expect(v.leads[0].session?.id).toBe('0ec3d1ff');
|
|
102
|
+
expect(v.leads[0].listedId).toBe('deadbeef');
|
|
103
|
+
});
|
|
104
|
+
it('survives empty inputs', () => {
|
|
105
|
+
const v = buildFleetView({});
|
|
106
|
+
expect(v).toMatchObject({ relay: null, leads: [], others: [], waitingOnQuinn: [], waitingOnSessions: [] });
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
describe('fleet-status round trip', () => {
|
|
111
|
+
it('stores the raw inputs and serves the parsed view', async () => {
|
|
112
|
+
const { converseFleetStatusResponse, converseFleetViewResponse } = await import('../corpus/converse');
|
|
113
|
+
const rows: any[] = [];
|
|
114
|
+
const http = {
|
|
115
|
+
get: vi.fn(async () => ({ results: rows })),
|
|
116
|
+
post: vi.fn(async (_p: string, body: any) => { const r = { id: 1, external_id: body.external_id, data: body.data }; rows.splice(0, rows.length, r); return r; }),
|
|
117
|
+
};
|
|
118
|
+
const deps: any = { http, ownerSub: 'me', now: () => Date.UTC(2026, 10, 19) };
|
|
119
|
+
const empty = await converseFleetViewResponse(deps);
|
|
120
|
+
expect(await empty.json()).toEqual({ snapshot: null });
|
|
121
|
+
const post = await converseFleetStatusResponse(new Request('http://x', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ text: 'notes', inputs: { roles: ROLES, loops: LOOPS, sessions: FIND, junk: 'x' } }) }), deps);
|
|
122
|
+
expect(post.status).toBe(200);
|
|
123
|
+
expect(Object.keys(rows[0].data.fleet_inputs).sort()).toEqual(['loops', 'roles', 'sessions']);
|
|
124
|
+
const body: any = await (await converseFleetViewResponse(deps)).json();
|
|
125
|
+
expect(body.snapshot.text).toBe('notes');
|
|
126
|
+
expect(body.snapshot.view.leads).toHaveLength(3);
|
|
127
|
+
expect(body.snapshot.view.waitingOnQuinn).toHaveLength(2);
|
|
128
|
+
});
|
|
129
|
+
it('old snapshots without inputs give view: null', async () => {
|
|
130
|
+
const { converseFleetStatusResponse, converseFleetViewResponse } = await import('../corpus/converse');
|
|
131
|
+
const rows: any[] = [];
|
|
132
|
+
const http = { get: vi.fn(async () => ({ results: rows })), post: vi.fn(async (_p: string, b: any) => { const r = { id: 1, external_id: b.external_id, data: b.data }; rows.splice(0, rows.length, r); return r; }) };
|
|
133
|
+
const deps: any = { http, ownerSub: 'me' };
|
|
134
|
+
await converseFleetStatusResponse(new Request('http://x', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ text: 'only text' }) }), deps);
|
|
135
|
+
expect(((await (await converseFleetViewResponse(deps)).json()) as any).snapshot.view).toBeNull();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe('converse client fleet()', () => {
|
|
140
|
+
it('GETs fleet-status with the bearer', async () => {
|
|
141
|
+
const { createConverseClient } = await import('../corpus/converse');
|
|
142
|
+
const f = vi.fn(async () => Response.json({ snapshot: null }));
|
|
143
|
+
const c = createConverseClient({ getToken: async () => 'tok', fetch: f as any });
|
|
144
|
+
expect(await c.fleet()).toEqual({ snapshot: null });
|
|
145
|
+
const [url, init] = f.mock.calls[0] as any;
|
|
146
|
+
expect(url).toBe('/corpus/converse/fleet-status');
|
|
147
|
+
expect(init.headers.authorization).toBe('Bearer tok');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { commitmentToEntity, toCommitment } from '../corpus/entities';
|
|
4
|
+
import type { Commitment } from '../corpus/types';
|
|
5
|
+
|
|
6
|
+
const scope = { orgId: 'o', userId: 'u' } as never;
|
|
7
|
+
const base = { externalId: 'commit:x', title: 'Send paperwork', mentions: [], status: 'open', subjectKey: 's', actionKey: 'a', dedupeKey: 'd' } as unknown as Commitment;
|
|
8
|
+
|
|
9
|
+
describe('projectBasis on a commitment', () => {
|
|
10
|
+
it('is written to the row and read back', () => {
|
|
11
|
+
const wire = commitmentToEntity({ ...base, projectBasis: 'guessed from the topic' });
|
|
12
|
+
expect(wire.data.project_basis).toBe('guessed from the topic');
|
|
13
|
+
const back = toCommitment({ id: '1', external_id: 'commit:x', entity_type: 'commitment', name: 'x', data: wire.data } as never, scope);
|
|
14
|
+
expect(back.projectBasis).toBe('guessed from the topic');
|
|
15
|
+
});
|
|
16
|
+
it('is absent when nothing was guessed', () => {
|
|
17
|
+
expect('project_basis' in commitmentToEntity(base).data).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { PROJECT_GUESSED, projectBasisFor } from '../corpus/project-basis';
|
|
4
|
+
|
|
5
|
+
const item = { title: 'Send the lease paperwork', detail: '', mentions: [{ quote: 'send the lease paperwork to the landlord' }] };
|
|
6
|
+
|
|
7
|
+
describe('projectBasisFor', () => {
|
|
8
|
+
it('marks a project that the item never names as a guess from the topic', () => {
|
|
9
|
+
expect(projectBasisFor(item, 'Home admin', 'I need to send the lease paperwork to the landlord.')).toBe(PROJECT_GUESSED);
|
|
10
|
+
});
|
|
11
|
+
it('leaves it unmarked when the project is named in what was said', () => {
|
|
12
|
+
expect(projectBasisFor(item, 'Home admin', 'For home admin: send the lease paperwork to the landlord.')).toBeUndefined();
|
|
13
|
+
});
|
|
14
|
+
it('leaves it unmarked when the item itself names the project', () => {
|
|
15
|
+
expect(projectBasisFor({ ...item, title: 'Home admin: lease paperwork' }, 'Home admin', '')).toBeUndefined();
|
|
16
|
+
});
|
|
17
|
+
it('ignores case and a missing project title', () => {
|
|
18
|
+
expect(projectBasisFor(item, 'HOME ADMIN', 'home admin first')).toBeUndefined();
|
|
19
|
+
expect(projectBasisFor(item, '', 'anything')).toBeUndefined();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -6,7 +6,7 @@ import { join } from 'node:path';
|
|
|
6
6
|
import { describe, expect, it, vi } from 'vitest';
|
|
7
7
|
|
|
8
8
|
// @ts-expect-error plain .mjs scripts
|
|
9
|
-
import { composeSnapshot, loadNotes, parseSessions, saveNotes } from '../../../../scripts/relay-converse/fleet.mjs';
|
|
9
|
+
import { composeSnapshot, loadNotes, parseSessions, readFleetInputs, saveNotes } from '../../../../scripts/relay-converse/fleet.mjs';
|
|
10
10
|
// @ts-expect-error plain .mjs scripts
|
|
11
11
|
import { accessToken, saveState } from '../../../../scripts/relay-converse/oauth.mjs';
|
|
12
12
|
// @ts-expect-error plain .mjs scripts
|
|
@@ -28,6 +28,15 @@ describe('fleet snapshot composition', () => {
|
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
describe('fleet inputs for the /fleet page', () => {
|
|
32
|
+
it('reads roles.md, the loops ledger and the raw bridge listing; leaves out what is missing', async () => {
|
|
33
|
+
const dir = mkdtempSync(join(tmpdir(), 'rc-'));
|
|
34
|
+
writeFileSync(join(dir, 'roles.md'), '| Role | s | n |');
|
|
35
|
+
const env = { RELAY_ROLES_FILE: join(dir, 'roles.md'), RELAY_LOOPS_FILE: join(dir, 'nope.md'), RELAY_PORTS_FILE: join(dir, 'nope2.md') };
|
|
36
|
+
expect(await readFleetInputs(env, '[live] `a · b · 12345678` g')).toEqual({ roles: '| Role | s | n |', sessions: '[live] `a · b · 12345678` g' });
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
31
40
|
describe('shared access token', () => {
|
|
32
41
|
it('reuses an unexpired access token for the same base and rotates the refresh token only once when expired', async () => {
|
|
33
42
|
const dir = mkdtempSync(join(tmpdir(), 'rc-'));
|
|
@@ -37,6 +37,10 @@ describe('resolveSpokenTime', () => {
|
|
|
37
37
|
['by the end of the month', '2026-11-30'],
|
|
38
38
|
['on November 20', '2026-11-20'],
|
|
39
39
|
['by the 20th', '2026-11-20'],
|
|
40
|
+
['due on the fifteenth', '2026-11-15'],
|
|
41
|
+
['by the twenty-first', '2026-11-21'],
|
|
42
|
+
['on the third', '2026-12-03'],
|
|
43
|
+
['the thirtieth', '2026-11-30'],
|
|
40
44
|
['ASAP', '2026-11-06'],
|
|
41
45
|
['right away', '2026-11-06'],
|
|
42
46
|
['sometime in the next few hours', '2026-11-06'],
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import { TaskDetailPage } from '../components/pages/TaskDetailPage';
|
|
5
|
+
import { toCommitment, type TenantEntity } from '../corpus/entities';
|
|
6
|
+
import type { Commitment } from '../corpus/types';
|
|
7
|
+
|
|
8
|
+
const make = (data: Record<string, unknown>): Commitment => ({
|
|
9
|
+
...toCommitment({
|
|
10
|
+
id: 'a', external_id: 'commit:a', name: 'a', entity_type: 'commitment', version: 1,
|
|
11
|
+
data: { title: 'Send the lease paperwork', status: 'open', subtype: 'action', mentions: [], ...data },
|
|
12
|
+
} as unknown as TenantEntity, { orgId: 'o' }), focusId: 'f1' });
|
|
13
|
+
|
|
14
|
+
function setup(item: Commitment, withFiling = true) {
|
|
15
|
+
const api = {
|
|
16
|
+
listCommitments: vi.fn(async (q: { page?: number } = {}) => ({ results: (q.page ?? 1) === 1 ? [item] : [], count: 1 })) as never,
|
|
17
|
+
updateCommitment: vi.fn(async (i: Commitment, patch: object) => ({ ...i, ...patch })) as never,
|
|
18
|
+
...(withFiling ? { fileCommitment: vi.fn(async () => undefined) } : {}),
|
|
19
|
+
};
|
|
20
|
+
render(<TaskDetailPage api={api} scope={{ orgId: 'o' } as never} itemId="commit:a" projectNames={{ f1: 'Home admin', f2: 'Tandem' }} />);
|
|
21
|
+
return api as typeof api & { fileCommitment: ReturnType<typeof vi.fn> };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('a project that was only guessed', () => {
|
|
25
|
+
it('says so next to the project and offers a one-tap change', async () => {
|
|
26
|
+
const api = setup(make({ project_basis: 'guessed from the topic' }));
|
|
27
|
+
expect(await screen.findByTestId('project-guess')).toBeInTheDocument();
|
|
28
|
+
expect(screen.getByText(/guessed from the topic/i)).toBeInTheDocument();
|
|
29
|
+
fireEvent.change(screen.getByLabelText(/change project/i), { target: { value: 'f2' } });
|
|
30
|
+
await waitFor(() => expect(api.fileCommitment).toHaveBeenCalledWith(expect.anything(), 'f2'));
|
|
31
|
+
await waitFor(() => expect(api.updateCommitment).toHaveBeenCalledWith(expect.anything(), { projectBasis: null }));
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('"That is right" keeps the project and clears the guess marker', async () => {
|
|
35
|
+
const api = setup(make({ project_basis: 'guessed from the topic' }));
|
|
36
|
+
fireEvent.click(await screen.findByRole('button', { name: /that.s right/i }));
|
|
37
|
+
await waitFor(() => expect(api.updateCommitment).toHaveBeenCalledWith(expect.anything(), { projectBasis: null }));
|
|
38
|
+
expect(api.fileCommitment).not.toHaveBeenCalled();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('shows nothing extra for a project that was named', async () => {
|
|
42
|
+
setup(make({}));
|
|
43
|
+
expect(await screen.findByText(/home admin/i)).toBeInTheDocument();
|
|
44
|
+
expect(screen.queryByText(/guessed from the topic/i)).toBeNull();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A date stated in a LATER sentence about the same thing belongs to that item (bd startsim-tmrvi.23, found in the
|
|
3
|
+
* tmrvi.8 measurement): "Today I have to pay the AWS bill. The AWS bill is due on the fifteenth." was acted on as today.
|
|
4
|
+
*/
|
|
5
|
+
import { describe, expect, it } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { resolveItemFields } from '../corpus/voice-due';
|
|
8
|
+
import type { VoiceItem, VoiceSection } from '../corpus/voice-sections';
|
|
9
|
+
|
|
10
|
+
const TRANSCRIPT = 'Today I have to call the vet and pay the AWS bill. The AWS bill is due on the fifteenth. Also fix the login bug.';
|
|
11
|
+
const ctx = { now: Date.parse('2026-11-09T17:00:00Z'), timeZone: 'America/Boise', transcript: TRANSCRIPT, noteWhen: 'today' };
|
|
12
|
+
const section: VoiceSection = { label: 'Work', kind: 'other', focusId: null, items: [], when: 'today' } as never;
|
|
13
|
+
const item = (title: string, when?: string): VoiceItem => ({ title, ...(when ? { when } : {}) });
|
|
14
|
+
|
|
15
|
+
describe('a date stated in a later sentence about the item', () => {
|
|
16
|
+
it('is the item\'s due date, stated, not the day of the note', () => {
|
|
17
|
+
const f = resolveItemFields(item('Pay the AWS bill'), section, ctx);
|
|
18
|
+
expect(f.due.value).toBe('2026-11-15');
|
|
19
|
+
expect(f.due.source).toBe('stated');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('does not reach items the sentence is not about', () => {
|
|
23
|
+
const f = resolveItemFields(item('Fix the login bug'), section, ctx);
|
|
24
|
+
expect(f.due.value).not.toBe('2026-11-15');
|
|
25
|
+
});
|
|
26
|
+
});
|
package/src/components/index.ts
CHANGED
|
@@ -76,6 +76,8 @@ export { ConnectorPage } from './pages/ConnectorPage';
|
|
|
76
76
|
export type { ConnectorPageProps, ConnectorClassNames } from './pages/ConnectorPage';
|
|
77
77
|
export { DecisionsPage } from './pages/DecisionsPage';
|
|
78
78
|
export type { DecisionsPageProps, DecisionsClassNames } from './pages/DecisionsPage';
|
|
79
|
+
export { FleetPage } from './pages/FleetPage';
|
|
80
|
+
export type { FleetPageProps, FleetPayload } from './pages/FleetPage';
|
|
79
81
|
export type { VoiceRecordButtonProps, VoiceRecordClassNames } from './pages/VoiceRecordButton';
|
|
80
82
|
export * from './pages/home';
|
|
81
83
|
export * from './pages/questions';
|