@contractspec/integration.providers-impls 1.56.1 → 1.58.0
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/README.md +115 -1
- package/dist/analytics.d.ts +2 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +3 -0
- package/dist/calendar.d.ts +1 -7
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +3 -3
- package/dist/database.d.ts +2 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +3 -0
- package/dist/email.d.ts +1 -7
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +3 -3
- package/dist/embedding.d.ts +1 -7
- package/dist/embedding.d.ts.map +1 -1
- package/dist/embedding.js +3 -3
- package/dist/impls/elevenlabs-voice.d.ts +14 -18
- package/dist/impls/elevenlabs-voice.d.ts.map +1 -1
- package/dist/impls/elevenlabs-voice.js +98 -88
- package/dist/impls/fal-voice.d.ts +25 -0
- package/dist/impls/fal-voice.d.ts.map +1 -0
- package/dist/impls/fal-voice.js +113 -0
- package/dist/impls/fathom-meeting-recorder.d.ts +38 -0
- package/dist/impls/fathom-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.js +288 -0
- package/dist/impls/fathom-meeting-recorder.mapper.d.ts +5 -0
- package/dist/impls/fathom-meeting-recorder.mapper.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.mapper.js +106 -0
- package/dist/impls/fathom-meeting-recorder.types.d.ts +20 -0
- package/dist/impls/fathom-meeting-recorder.types.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.types.js +1 -0
- package/dist/impls/fathom-meeting-recorder.utils.d.ts +11 -0
- package/dist/impls/fathom-meeting-recorder.utils.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.utils.js +73 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.d.ts +4 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.d.ts.map +1 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.js +30 -0
- package/dist/impls/fireflies-meeting-recorder.d.ts +24 -0
- package/dist/impls/fireflies-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.js +275 -0
- package/dist/impls/fireflies-meeting-recorder.queries.d.ts +4 -0
- package/dist/impls/fireflies-meeting-recorder.queries.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.queries.js +86 -0
- package/dist/impls/fireflies-meeting-recorder.types.d.ts +32 -0
- package/dist/impls/fireflies-meeting-recorder.types.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.types.js +1 -0
- package/dist/impls/fireflies-meeting-recorder.utils.d.ts +5 -0
- package/dist/impls/fireflies-meeting-recorder.utils.d.ts.map +1 -0
- package/dist/impls/fireflies-meeting-recorder.utils.js +43 -0
- package/dist/impls/gcs-storage.d.ts +18 -22
- package/dist/impls/gcs-storage.d.ts.map +1 -1
- package/dist/impls/gcs-storage.js +92 -84
- package/dist/impls/gmail-inbound.d.ts +20 -24
- package/dist/impls/gmail-inbound.d.ts.map +1 -1
- package/dist/impls/gmail-inbound.js +212 -185
- package/dist/impls/gmail-outbound.d.ts +12 -16
- package/dist/impls/gmail-outbound.d.ts.map +1 -1
- package/dist/impls/gmail-outbound.js +126 -92
- package/dist/impls/google-calendar.d.ts +17 -21
- package/dist/impls/google-calendar.d.ts.map +1 -1
- package/dist/impls/google-calendar.js +182 -145
- package/dist/impls/gradium-voice.d.ts +24 -0
- package/dist/impls/gradium-voice.d.ts.map +1 -0
- package/dist/impls/gradium-voice.js +91 -0
- package/dist/impls/granola-meeting-recorder.d.ts +34 -0
- package/dist/impls/granola-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.js +513 -0
- package/dist/impls/granola-meeting-recorder.mcp.d.ts +25 -0
- package/dist/impls/granola-meeting-recorder.mcp.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.mcp.js +279 -0
- package/dist/impls/granola-meeting-recorder.types.d.ts +61 -0
- package/dist/impls/granola-meeting-recorder.types.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.types.js +1 -0
- package/dist/impls/index.d.ts +28 -15
- package/dist/impls/index.d.ts.map +1 -0
- package/dist/impls/index.js +4659 -16
- package/dist/impls/jira.d.ts +21 -0
- package/dist/impls/jira.d.ts.map +1 -0
- package/dist/impls/jira.js +125 -0
- package/dist/impls/linear.d.ts +20 -0
- package/dist/impls/linear.d.ts.map +1 -0
- package/dist/impls/linear.js +84 -0
- package/dist/impls/mistral-embedding.d.ts +17 -21
- package/dist/impls/mistral-embedding.d.ts.map +1 -1
- package/dist/impls/mistral-embedding.js +41 -39
- package/dist/impls/mistral-llm.d.ts +25 -29
- package/dist/impls/mistral-llm.d.ts.map +1 -1
- package/dist/impls/mistral-llm.js +266 -244
- package/dist/impls/notion.d.ts +23 -0
- package/dist/impls/notion.d.ts.map +1 -0
- package/dist/impls/notion.js +161 -0
- package/dist/impls/posthog-reader.d.ts +22 -0
- package/dist/impls/posthog-reader.d.ts.map +1 -0
- package/dist/impls/posthog-reader.js +160 -0
- package/dist/impls/posthog-utils.d.ts +5 -0
- package/dist/impls/posthog-utils.d.ts.map +1 -0
- package/dist/impls/posthog-utils.js +39 -0
- package/dist/impls/posthog.d.ts +36 -0
- package/dist/impls/posthog.d.ts.map +1 -0
- package/dist/impls/posthog.js +323 -0
- package/dist/impls/postmark-email.d.ts +13 -17
- package/dist/impls/postmark-email.d.ts.map +1 -1
- package/dist/impls/postmark-email.js +55 -50
- package/dist/impls/powens-client.d.ts +111 -114
- package/dist/impls/powens-client.d.ts.map +1 -1
- package/dist/impls/powens-client.js +194 -170
- package/dist/impls/powens-openbanking.d.ts +22 -26
- package/dist/impls/powens-openbanking.d.ts.map +1 -1
- package/dist/impls/powens-openbanking.js +425 -217
- package/dist/impls/provider-factory.d.ts +29 -25
- package/dist/impls/provider-factory.d.ts.map +1 -1
- package/dist/impls/provider-factory.js +4074 -136
- package/dist/impls/qdrant-vector.d.ts +18 -22
- package/dist/impls/qdrant-vector.d.ts.map +1 -1
- package/dist/impls/qdrant-vector.js +76 -69
- package/dist/impls/stripe-payments.d.ts +22 -26
- package/dist/impls/stripe-payments.d.ts.map +1 -1
- package/dist/impls/stripe-payments.js +219 -193
- package/dist/impls/supabase-psql.d.ts +24 -0
- package/dist/impls/supabase-psql.d.ts.map +1 -0
- package/dist/impls/supabase-psql.js +151 -0
- package/dist/impls/supabase-vector.d.ts +32 -0
- package/dist/impls/supabase-vector.d.ts.map +1 -0
- package/dist/impls/supabase-vector.js +324 -0
- package/dist/impls/tldv-meeting-recorder.d.ts +21 -0
- package/dist/impls/tldv-meeting-recorder.d.ts.map +1 -0
- package/dist/impls/tldv-meeting-recorder.js +146 -0
- package/dist/impls/twilio-sms.d.ts +14 -17
- package/dist/impls/twilio-sms.d.ts.map +1 -1
- package/dist/impls/twilio-sms.js +62 -55
- package/dist/index.d.ts +15 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4700 -69
- package/dist/llm.d.ts +1 -7
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +3 -3
- package/dist/meeting-recorder.d.ts +2 -0
- package/dist/meeting-recorder.d.ts.map +1 -0
- package/dist/meeting-recorder.js +3 -0
- package/dist/node/analytics.js +2 -0
- package/dist/node/calendar.js +2 -0
- package/dist/node/database.js +2 -0
- package/dist/node/email.js +2 -0
- package/dist/node/embedding.js +2 -0
- package/dist/node/impls/elevenlabs-voice.js +102 -0
- package/dist/node/impls/fal-voice.js +112 -0
- package/dist/node/impls/fathom-meeting-recorder.js +287 -0
- package/dist/node/impls/fathom-meeting-recorder.mapper.js +105 -0
- package/dist/node/impls/fathom-meeting-recorder.types.js +0 -0
- package/dist/node/impls/fathom-meeting-recorder.utils.js +72 -0
- package/dist/node/impls/fathom-meeting-recorder.webhooks.js +29 -0
- package/dist/node/impls/fireflies-meeting-recorder.js +274 -0
- package/dist/node/impls/fireflies-meeting-recorder.queries.js +85 -0
- package/dist/node/impls/fireflies-meeting-recorder.types.js +0 -0
- package/dist/node/impls/fireflies-meeting-recorder.utils.js +42 -0
- package/dist/node/impls/gcs-storage.js +97 -0
- package/dist/node/impls/gmail-inbound.js +227 -0
- package/dist/node/impls/gmail-outbound.js +139 -0
- package/dist/node/impls/google-calendar.js +191 -0
- package/dist/node/impls/gradium-voice.js +90 -0
- package/dist/node/impls/granola-meeting-recorder.js +512 -0
- package/dist/node/impls/granola-meeting-recorder.mcp.js +278 -0
- package/dist/node/impls/granola-meeting-recorder.types.js +0 -0
- package/dist/node/impls/index.js +4658 -0
- package/dist/node/impls/jira.js +124 -0
- package/dist/node/impls/linear.js +83 -0
- package/dist/node/impls/mistral-embedding.js +43 -0
- package/dist/node/impls/mistral-llm.js +269 -0
- package/dist/node/impls/notion.js +160 -0
- package/dist/node/impls/posthog-reader.js +159 -0
- package/dist/node/impls/posthog-utils.js +38 -0
- package/dist/node/impls/posthog.js +322 -0
- package/dist/node/impls/postmark-email.js +60 -0
- package/dist/node/impls/powens-client.js +195 -0
- package/dist/node/impls/powens-openbanking.js +426 -0
- package/dist/node/impls/provider-factory.js +4080 -0
- package/dist/node/impls/qdrant-vector.js +78 -0
- package/dist/node/impls/stripe-payments.js +228 -0
- package/dist/node/impls/supabase-psql.js +150 -0
- package/dist/node/impls/supabase-vector.js +323 -0
- package/dist/node/impls/tldv-meeting-recorder.js +145 -0
- package/dist/node/impls/twilio-sms.js +65 -0
- package/dist/node/index.js +4699 -0
- package/dist/node/llm.js +2 -0
- package/dist/node/meeting-recorder.js +2 -0
- package/dist/node/openbanking.js +2 -0
- package/dist/node/payments.js +2 -0
- package/dist/node/project-management.js +2 -0
- package/dist/node/runtime.js +0 -0
- package/dist/node/secrets/provider.js +11 -0
- package/dist/node/sms.js +2 -0
- package/dist/node/storage.js +2 -0
- package/dist/node/vector-store.js +2 -0
- package/dist/node/voice.js +2 -0
- package/dist/openbanking.d.ts +1 -7
- package/dist/openbanking.d.ts.map +1 -1
- package/dist/openbanking.js +3 -3
- package/dist/payments.d.ts +1 -7
- package/dist/payments.d.ts.map +1 -1
- package/dist/payments.js +3 -3
- package/dist/project-management.d.ts +2 -0
- package/dist/project-management.d.ts.map +1 -0
- package/dist/project-management.js +3 -0
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/secrets/provider.d.ts +3 -2
- package/dist/secrets/provider.d.ts.map +1 -0
- package/dist/secrets/provider.js +12 -3
- package/dist/sms.d.ts +1 -7
- package/dist/sms.d.ts.map +1 -1
- package/dist/sms.js +3 -3
- package/dist/storage.d.ts +1 -7
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +3 -3
- package/dist/vector-store.d.ts +1 -7
- package/dist/vector-store.d.ts.map +1 -1
- package/dist/vector-store.js +3 -3
- package/dist/voice.d.ts +1 -7
- package/dist/voice.d.ts.map +1 -1
- package/dist/voice.js +3 -3
- package/package.json +419 -76
- package/dist/_virtual/rolldown_runtime.js +0 -36
- package/dist/impls/elevenlabs-voice.js.map +0 -1
- package/dist/impls/gcs-storage.js.map +0 -1
- package/dist/impls/gmail-inbound.js.map +0 -1
- package/dist/impls/gmail-outbound.js.map +0 -1
- package/dist/impls/google-calendar.js.map +0 -1
- package/dist/impls/mistral-embedding.js.map +0 -1
- package/dist/impls/mistral-llm.js.map +0 -1
- package/dist/impls/postmark-email.js.map +0 -1
- package/dist/impls/powens-client.js.map +0 -1
- package/dist/impls/powens-openbanking.js.map +0 -1
- package/dist/impls/provider-factory.js.map +0 -1
- package/dist/impls/qdrant-vector.js.map +0 -1
- package/dist/impls/stripe-payments.js.map +0 -1
- package/dist/impls/twilio-sms.js.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/granola-meeting-recorder.mcp.ts
|
|
3
|
+
var UNKNOWN_EMAIL = "unknown@granola.local";
|
|
4
|
+
var EPOCH = "1970-01-01T00:00:00.000Z";
|
|
5
|
+
|
|
6
|
+
class GranolaMcpClient {
|
|
7
|
+
requestId = 0;
|
|
8
|
+
mcpUrl;
|
|
9
|
+
mcpAccessToken;
|
|
10
|
+
mcpHeaders;
|
|
11
|
+
fetchFn;
|
|
12
|
+
constructor(options) {
|
|
13
|
+
this.mcpUrl = options.mcpUrl;
|
|
14
|
+
this.mcpAccessToken = options.mcpAccessToken;
|
|
15
|
+
this.mcpHeaders = options.mcpHeaders;
|
|
16
|
+
this.fetchFn = options.fetchFn ?? fetch;
|
|
17
|
+
}
|
|
18
|
+
async callTool(name, args) {
|
|
19
|
+
const headers = {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
...this.mcpHeaders ?? {}
|
|
22
|
+
};
|
|
23
|
+
if (this.mcpAccessToken) {
|
|
24
|
+
headers.Authorization = `Bearer ${this.mcpAccessToken}`;
|
|
25
|
+
}
|
|
26
|
+
const response = await this.fetchFn(this.mcpUrl, {
|
|
27
|
+
method: "POST",
|
|
28
|
+
headers,
|
|
29
|
+
body: JSON.stringify({
|
|
30
|
+
jsonrpc: "2.0",
|
|
31
|
+
id: ++this.requestId,
|
|
32
|
+
method: "tools/call",
|
|
33
|
+
params: {
|
|
34
|
+
name,
|
|
35
|
+
arguments: args
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
const message = await safeReadText(response);
|
|
41
|
+
throw new Error(`Granola MCP error (${response.status}): ${message}`);
|
|
42
|
+
}
|
|
43
|
+
const rpc = await response.json();
|
|
44
|
+
if (rpc.error) {
|
|
45
|
+
throw new Error(rpc.error.message ?? "Granola MCP returned an error.");
|
|
46
|
+
}
|
|
47
|
+
return extractRpcResult(rpc);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function normalizeMcpListResult(payload) {
|
|
51
|
+
const root = asObject(payload);
|
|
52
|
+
const list = asArray(payload) ?? asArray(root?.notes) ?? asArray(root?.meetings) ?? asArray(root?.items) ?? asArray(root?.results) ?? asArray(root?.data) ?? [];
|
|
53
|
+
const notes = list.map((item) => mapSummaryItem(item)).filter((item) => Boolean(item));
|
|
54
|
+
return {
|
|
55
|
+
notes,
|
|
56
|
+
nextCursor: readString(root, ["nextCursor", "next_cursor", "cursor"]),
|
|
57
|
+
hasMore: readBoolean(root, ["hasMore", "has_more"])
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function normalizeMcpMeeting(payload, targetMeetingId) {
|
|
61
|
+
const root = asObject(payload);
|
|
62
|
+
const candidates = asArray(payload) ?? asArray(root?.meetings) ?? asArray(root?.notes) ?? asArray(root?.items) ?? asArray(root?.results) ?? asArray(root?.data);
|
|
63
|
+
if (candidates?.length) {
|
|
64
|
+
const selected = candidates.find((item) => readId(item) === targetMeetingId) ?? candidates.find((item) => String(readId(item) ?? "").includes(targetMeetingId)) ?? candidates[0];
|
|
65
|
+
return selected ? mapMeetingItem(selected) : undefined;
|
|
66
|
+
}
|
|
67
|
+
const direct = mapMeetingItem(payload);
|
|
68
|
+
if (direct && direct.id === targetMeetingId) {
|
|
69
|
+
return direct;
|
|
70
|
+
}
|
|
71
|
+
return direct;
|
|
72
|
+
}
|
|
73
|
+
function normalizeMcpTranscript(payload) {
|
|
74
|
+
const root = asObject(payload);
|
|
75
|
+
const list = asArray(payload) ?? asArray(root?.transcript) ?? asArray(root?.segments) ?? asArray(root?.items) ?? asArray(root?.data) ?? [];
|
|
76
|
+
if (list.length === 0 && typeof payload === "string") {
|
|
77
|
+
return [
|
|
78
|
+
{
|
|
79
|
+
text: payload,
|
|
80
|
+
start_time: "00:00:00",
|
|
81
|
+
end_time: "00:00:00"
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
return list.map((item) => mapTranscriptSegment(item)).filter((item) => Boolean(item));
|
|
86
|
+
}
|
|
87
|
+
function extractRpcResult(rpc) {
|
|
88
|
+
const result = rpc.result;
|
|
89
|
+
if (!result)
|
|
90
|
+
return null;
|
|
91
|
+
if (result.structuredContent !== undefined)
|
|
92
|
+
return result.structuredContent;
|
|
93
|
+
if (result.data !== undefined)
|
|
94
|
+
return result.data;
|
|
95
|
+
const textPayload = result.content?.find((entry) => entry?.type === "text")?.text;
|
|
96
|
+
if (!textPayload)
|
|
97
|
+
return result;
|
|
98
|
+
try {
|
|
99
|
+
return JSON.parse(textPayload);
|
|
100
|
+
} catch {
|
|
101
|
+
return textPayload;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function mapSummaryItem(value) {
|
|
105
|
+
const object = asObject(value);
|
|
106
|
+
if (!object)
|
|
107
|
+
return;
|
|
108
|
+
const id = readId(object);
|
|
109
|
+
if (!id)
|
|
110
|
+
return;
|
|
111
|
+
const owner = mapOwner(object);
|
|
112
|
+
return {
|
|
113
|
+
id,
|
|
114
|
+
title: readString(object, ["title", "name", "meeting_title"]) ?? null,
|
|
115
|
+
owner,
|
|
116
|
+
created_at: readString(object, ["created_at", "createdAt", "date", "meeting_date"]) ?? EPOCH
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function mapMeetingItem(value) {
|
|
120
|
+
const summary = mapSummaryItem(value);
|
|
121
|
+
if (!summary)
|
|
122
|
+
return;
|
|
123
|
+
const object = asObject(value) ?? {};
|
|
124
|
+
const attendees = asArray(object.attendees) ?? asArray(object.participants) ?? asArray(object.invitees) ?? [];
|
|
125
|
+
const mappedAttendees = attendees.map((entry) => mapUser(entry)).filter((entry) => Boolean(entry));
|
|
126
|
+
const folders = asArray(object.folder_membership) ?? asArray(object.folders) ?? [];
|
|
127
|
+
const folderMembership = folders.map((entry, index) => mapFolder(entry, index)).filter((entry) => Boolean(entry));
|
|
128
|
+
const calendarEvent = asObject(object.calendar_event) ? {
|
|
129
|
+
event_title: readString(asObject(object.calendar_event), [
|
|
130
|
+
"event_title",
|
|
131
|
+
"title"
|
|
132
|
+
]) ?? null,
|
|
133
|
+
invitees: mappedAttendees.map((attendee) => ({
|
|
134
|
+
email: attendee.email
|
|
135
|
+
})),
|
|
136
|
+
organiser: readString(asObject(object.calendar_event), [
|
|
137
|
+
"organiser",
|
|
138
|
+
"organizer"
|
|
139
|
+
]) ?? summary.owner.email,
|
|
140
|
+
calendar_event_id: readString(asObject(object.calendar_event), [
|
|
141
|
+
"calendar_event_id",
|
|
142
|
+
"id"
|
|
143
|
+
]) ?? null,
|
|
144
|
+
scheduled_start_time: readString(asObject(object.calendar_event), [
|
|
145
|
+
"scheduled_start_time",
|
|
146
|
+
"start_time",
|
|
147
|
+
"start"
|
|
148
|
+
]) ?? null,
|
|
149
|
+
scheduled_end_time: readString(asObject(object.calendar_event), [
|
|
150
|
+
"scheduled_end_time",
|
|
151
|
+
"end_time",
|
|
152
|
+
"end"
|
|
153
|
+
]) ?? null
|
|
154
|
+
} : null;
|
|
155
|
+
const transcript = normalizeMcpTranscript(object.transcript ?? object.segments);
|
|
156
|
+
return {
|
|
157
|
+
...summary,
|
|
158
|
+
calendar_event: calendarEvent,
|
|
159
|
+
attendees: mappedAttendees,
|
|
160
|
+
folder_membership: folderMembership,
|
|
161
|
+
summary_text: readString(object, ["summary_text", "summary", "enhanced_notes"]) ?? "",
|
|
162
|
+
transcript: transcript.length ? transcript : null
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function mapTranscriptSegment(value) {
|
|
166
|
+
const object = asObject(value);
|
|
167
|
+
if (!object) {
|
|
168
|
+
if (typeof value !== "string")
|
|
169
|
+
return;
|
|
170
|
+
return {
|
|
171
|
+
text: value,
|
|
172
|
+
start_time: "00:00:00",
|
|
173
|
+
end_time: "00:00:00"
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const text = readString(object, ["text", "content", "utterance"]);
|
|
177
|
+
if (!text)
|
|
178
|
+
return;
|
|
179
|
+
const speakerSource = readString(asObject(object.speaker), ["source", "name"]) ?? readString(object, ["speaker", "speaker_name"]);
|
|
180
|
+
return {
|
|
181
|
+
speaker: speakerSource ? { source: speakerSource } : undefined,
|
|
182
|
+
text,
|
|
183
|
+
start_time: readString(object, ["start_time", "startTime", "timestamp", "time"]) ?? "00:00:00",
|
|
184
|
+
end_time: readString(object, ["end_time", "endTime"]) ?? "00:00:00"
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function mapOwner(object) {
|
|
188
|
+
const ownerObject = asObject(object.owner) ?? asObject(object.organizer) ?? asObject(object.organiser);
|
|
189
|
+
const attendee = asArray(object.attendees)?.[0] ?? asArray(object.participants)?.[0] ?? asArray(object.invitees)?.[0];
|
|
190
|
+
const ownerCandidate = ownerObject ?? asObject(attendee) ?? {};
|
|
191
|
+
return {
|
|
192
|
+
name: readString(ownerCandidate, ["name", "displayName"]) ?? null,
|
|
193
|
+
email: readString(ownerCandidate, ["email"]) ?? UNKNOWN_EMAIL
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function mapUser(value) {
|
|
197
|
+
if (typeof value === "string") {
|
|
198
|
+
return {
|
|
199
|
+
name: null,
|
|
200
|
+
email: value
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const object = asObject(value);
|
|
204
|
+
if (!object)
|
|
205
|
+
return;
|
|
206
|
+
const email = readString(object, ["email"]);
|
|
207
|
+
if (!email)
|
|
208
|
+
return;
|
|
209
|
+
return {
|
|
210
|
+
name: readString(object, ["name", "displayName"]) ?? null,
|
|
211
|
+
email
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function mapFolder(value, index) {
|
|
215
|
+
const object = asObject(value);
|
|
216
|
+
if (!object)
|
|
217
|
+
return;
|
|
218
|
+
const id = readString(object, ["id"]) ?? `folder-${index}`;
|
|
219
|
+
const name = readString(object, ["name"]) ?? "Folder";
|
|
220
|
+
return {
|
|
221
|
+
id,
|
|
222
|
+
object: "folder",
|
|
223
|
+
name
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function readId(value) {
|
|
227
|
+
const object = asObject(value);
|
|
228
|
+
if (!object)
|
|
229
|
+
return;
|
|
230
|
+
return readString(object, [
|
|
231
|
+
"id",
|
|
232
|
+
"meeting_id",
|
|
233
|
+
"meetingId",
|
|
234
|
+
"note_id",
|
|
235
|
+
"noteId"
|
|
236
|
+
]);
|
|
237
|
+
}
|
|
238
|
+
function readString(object, keys) {
|
|
239
|
+
if (!object)
|
|
240
|
+
return;
|
|
241
|
+
for (const key of keys) {
|
|
242
|
+
const value = object[key];
|
|
243
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
244
|
+
return value;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
function readBoolean(object, keys) {
|
|
250
|
+
if (!object)
|
|
251
|
+
return;
|
|
252
|
+
for (const key of keys) {
|
|
253
|
+
const value = object[key];
|
|
254
|
+
if (typeof value === "boolean")
|
|
255
|
+
return value;
|
|
256
|
+
}
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
function asObject(value) {
|
|
260
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
261
|
+
return;
|
|
262
|
+
return value;
|
|
263
|
+
}
|
|
264
|
+
function asArray(value) {
|
|
265
|
+
return Array.isArray(value) ? value : undefined;
|
|
266
|
+
}
|
|
267
|
+
async function safeReadText(response) {
|
|
268
|
+
try {
|
|
269
|
+
return await response.text();
|
|
270
|
+
} catch {
|
|
271
|
+
return response.statusText;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
export {
|
|
275
|
+
normalizeMcpTranscript,
|
|
276
|
+
normalizeMcpMeeting,
|
|
277
|
+
normalizeMcpListResult,
|
|
278
|
+
GranolaMcpClient
|
|
279
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface GranolaListNotesResponse {
|
|
2
|
+
notes: GranolaNoteSummary[];
|
|
3
|
+
hasMore: boolean;
|
|
4
|
+
cursor: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface GranolaNoteSummary {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string | null;
|
|
9
|
+
owner: GranolaUser;
|
|
10
|
+
created_at: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GranolaNote extends GranolaNoteSummary {
|
|
13
|
+
calendar_event: GranolaCalendarEvent | null;
|
|
14
|
+
attendees: GranolaUser[];
|
|
15
|
+
folder_membership: GranolaFolder[];
|
|
16
|
+
summary_text: string;
|
|
17
|
+
transcript: GranolaTranscriptSegment[] | null;
|
|
18
|
+
}
|
|
19
|
+
export interface GranolaUser {
|
|
20
|
+
name: string | null;
|
|
21
|
+
email: string;
|
|
22
|
+
}
|
|
23
|
+
export interface GranolaInvitee {
|
|
24
|
+
email: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GranolaCalendarEvent {
|
|
27
|
+
event_title: string | null;
|
|
28
|
+
invitees: GranolaInvitee[];
|
|
29
|
+
organiser: string | null;
|
|
30
|
+
calendar_event_id: string | null;
|
|
31
|
+
scheduled_start_time: string | null;
|
|
32
|
+
scheduled_end_time: string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface GranolaFolder {
|
|
35
|
+
id: string;
|
|
36
|
+
object: 'folder';
|
|
37
|
+
name: string;
|
|
38
|
+
}
|
|
39
|
+
export interface GranolaTranscriptSegment {
|
|
40
|
+
speaker?: {
|
|
41
|
+
source?: string;
|
|
42
|
+
} | null;
|
|
43
|
+
text: string;
|
|
44
|
+
start_time: string;
|
|
45
|
+
end_time: string;
|
|
46
|
+
}
|
|
47
|
+
export type GranolaMeetingRecorderTransport = 'api' | 'mcp';
|
|
48
|
+
export interface GranolaMcpJsonRpcResponse {
|
|
49
|
+
result?: {
|
|
50
|
+
content?: {
|
|
51
|
+
type?: string;
|
|
52
|
+
text?: string;
|
|
53
|
+
}[];
|
|
54
|
+
structuredContent?: unknown;
|
|
55
|
+
data?: unknown;
|
|
56
|
+
};
|
|
57
|
+
error?: {
|
|
58
|
+
message?: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=granola-meeting-recorder.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"granola-meeting-recorder.types.d.ts","sourceRoot":"","sources":["../../src/impls/granola-meeting-recorder.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,cAAc,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,iBAAiB,EAAE,aAAa,EAAE,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,wBAAwB,EAAE,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,+BAA+B,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5D,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
package/dist/impls/index.d.ts
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
1
|
+
export * from './mistral-llm';
|
|
2
|
+
export * from './mistral-embedding';
|
|
3
|
+
export * from './qdrant-vector';
|
|
4
|
+
export * from './supabase-vector';
|
|
5
|
+
export * from './supabase-psql';
|
|
6
|
+
export * from './gmail-inbound';
|
|
7
|
+
export * from './gmail-outbound';
|
|
8
|
+
export * from './google-calendar';
|
|
9
|
+
export * from './elevenlabs-voice';
|
|
10
|
+
export * from './gradium-voice';
|
|
11
|
+
export * from './fal-voice';
|
|
12
|
+
export * from './gcs-storage';
|
|
13
|
+
export * from './stripe-payments';
|
|
14
|
+
export * from './postmark-email';
|
|
15
|
+
export * from './posthog';
|
|
16
|
+
export * from './posthog-reader';
|
|
17
|
+
export * from './twilio-sms';
|
|
18
|
+
export * from './powens-client';
|
|
19
|
+
export * from './powens-openbanking';
|
|
20
|
+
export * from './linear';
|
|
21
|
+
export * from './jira';
|
|
22
|
+
export * from './notion';
|
|
23
|
+
export * from './granola-meeting-recorder';
|
|
24
|
+
export * from './tldv-meeting-recorder';
|
|
25
|
+
export * from './fireflies-meeting-recorder';
|
|
26
|
+
export * from './fathom-meeting-recorder';
|
|
27
|
+
export * from './provider-factory';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/impls/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
|