@startsimpli/integrations 0.2.63 → 0.2.65

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startsimpli/integrations",
3
- "version": "0.2.63",
3
+ "version": "0.2.65",
4
4
  "description": "Provider-agnostic types, API clients, hooks, and UI primitives for email + calendar integrations across StartSimpli apps, plus foundry customer email (subpath ./comms).",
5
5
  "license": "MIT",
6
6
  "homepage": "https://startsimpli.com",
@@ -90,8 +90,8 @@
90
90
  "vitest": "^3.0.0",
91
91
  "react-native": "0.85.3",
92
92
  "react-native-safe-area-context": "~5.7.0",
93
- "@startsimpli/ui-native": "0.1.0",
94
93
  "@startsimpli/ui": "0.4.167",
94
+ "@startsimpli/ui-native": "0.1.0",
95
95
  "@startsimpli/llm": "0.4.28"
96
96
  },
97
97
  "scripts": {
@@ -52,12 +52,13 @@ describe('createNativeVoiceApi', () => {
52
52
 
53
53
  it('file replaces the about_focus edge using post + delete', async () => {
54
54
  const f = vi.fn()
55
+ .mockResolvedValueOnce(res({ id: '7', data: {} }))
55
56
  .mockResolvedValueOnce(res({ results: [{ id: 5 }] }))
56
57
  .mockResolvedValue(res({}));
57
58
  const api = createNativeVoiceApi({ baseUrl: 'http://t', authorizedFetch: f });
58
59
  await api.file('7', 'f9');
59
60
  const calls = f.mock.calls.map((c) => `${c[1].method} ${c[0].replace('http://t/', '').split('?')[0]}`);
60
- expect(calls).toEqual(['GET api/v1/relationships', 'DELETE api/v1/relationships/5', 'POST api/v1/relationships']);
61
+ expect(calls).toEqual(['GET api/v1/entities/7', 'GET api/v1/relationships', 'DELETE api/v1/relationships/5', 'POST api/v1/relationships']);
61
62
  });
62
63
 
63
64
  it('submit is not offered (recording uploads go through the upload queue)', async () => {
@@ -35,4 +35,15 @@ describe('noteSections', () => {
35
35
  const out = noteSections({ ...base, sections: [{ label: 'A', kind: 'weird', summary: 's', items: [{ text: 'a' }, { nope: 1 }, ''] }] } as never);
36
36
  expect(out[0]).toMatchObject({ label: 'A', kind: 'other', focusId: null, items: ['a'] });
37
37
  });
38
+
39
+ it('parses a legacy markdown summary into a lead sentence and its bullets', () => {
40
+ const summary = 'Tasks for the day.\n\n## Next Steps\n- **Send mom a text** (Quinn)\n- **Go on two walks**\n';
41
+ const [only] = noteSections({ ...base, summary });
42
+ expect(only.summary).toBe('Tasks for the day.');
43
+ expect(only.items).toEqual(['Send mom a text (Quinn)', 'Go on two walks']);
44
+ });
45
+
46
+ it('keeps plain summaries untouched', () => {
47
+ expect(noteSections({ ...base, summary: 'Just text. No bullets.' })[0]).toMatchObject({ summary: 'Just text. No bullets.', items: [] });
48
+ });
38
49
  });
@@ -45,15 +45,25 @@ function fromRaw(raw: unknown): NoteSection | null {
45
45
  };
46
46
  }
47
47
 
48
+ /** Older notes store one markdown summary: a lead sentence, then `## Next Steps` with `- **Title** (Owner)` bullets. */
49
+ function splitLegacySummary(summary: string): { lead: string; items: string[] } {
50
+ const text = summary ?? '';
51
+ const bullets = [...text.matchAll(/^\s*[-*]\s+\*\*(.+?)\*\*\s*(\([^)]*\))?\s*$/gm)];
52
+ if (!bullets.length) return { lead: text, items: [] };
53
+ const lead = text.split(/^\s*#{1,6}\s/m)[0].trim();
54
+ return { lead, items: bullets.map((m) => (m[1] + (m[2] ? ' ' + m[2] : '')).trim()) };
55
+ }
56
+
48
57
  export function noteSections(note: VoiceNote): NoteSection[] {
49
58
  const raw = (note as VoiceNote & { sections?: unknown }).sections;
50
59
  const sections = Array.isArray(raw) ? raw.map(fromRaw).filter((s): s is NoteSection => s !== null && Boolean(s.label || s.summary || s.items.length)) : [];
51
60
  if (sections.length) return sections;
61
+ const { lead, items } = splitLegacySummary(note.summary);
52
62
  return [{
53
63
  label: '',
54
64
  kind: note.focusId ? 'project' : 'other',
55
65
  focusId: note.focusId,
56
- summary: note.summary,
57
- items: [],
66
+ summary: lead,
67
+ items,
58
68
  }];
59
69
  }