@twentyhq/meet 0.0.0-stage → 1.0.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 +48 -2
- package/dependencies/yarn.lock +1863 -0
- package/manifest.json +1901 -0
- package/package.json +44 -4
- package/public/gallery/meet-cover-image-1.png +0 -0
- package/public/gallery/meet-cover-image-2.png +0 -0
- package/public/gallery/meet-cover-image-3.png +0 -0
- package/public/logo.svg +1 -0
- package/src/constants/meet-call-summary-prompt.constant.ts +54 -0
- package/src/constants/meet.constant.ts +17 -0
- package/src/constants/universal-identifiers.ts +35 -0
- package/src/logic-functions/constants/calendar-event-matching.constant.ts +3 -0
- package/src/logic-functions/constants/google-docs-api.constant.ts +10 -0
- package/src/logic-functions/constants/google-drive-api.constant.ts +1 -0
- package/src/logic-functions/constants/google-pubsub-push.constant.ts +7 -0
- package/src/logic-functions/constants/google-user-info.constant.ts +2 -0
- package/src/logic-functions/constants/google-workspace-events.constant.ts +17 -0
- package/src/logic-functions/constants/meet-api.constant.ts +9 -0
- package/src/logic-functions/constants/meet-call-summary.constant.ts +3 -0
- package/src/logic-functions/constants/meet-import.constant.ts +7 -0
- package/src/logic-functions/constants/meet-recording-import.constant.ts +7 -0
- package/src/logic-functions/constants/restricted-field-placeholder.constant.ts +2 -0
- package/src/logic-functions/meet-events-resolver.mjs +1345 -0
- package/src/logic-functions/meet-events-resolver.mjs.map +7 -0
- package/src/logic-functions/meet-events-resolver.ts +89 -0
- package/src/logic-functions/meet-handle-event.mjs +665 -0
- package/src/logic-functions/meet-handle-event.mjs.map +7 -0
- package/src/logic-functions/meet-handle-event.ts +86 -0
- package/src/logic-functions/meet-identify-account.mjs +369 -0
- package/src/logic-functions/meet-identify-account.mjs.map +7 -0
- package/src/logic-functions/meet-identify-account.ts +42 -0
- package/src/logic-functions/meet-import-conference.mjs +1465 -0
- package/src/logic-functions/meet-import-conference.mjs.map +7 -0
- package/src/logic-functions/meet-import-conference.ts +101 -0
- package/src/logic-functions/meet-import-recording.mjs +794 -0
- package/src/logic-functions/meet-import-recording.mjs.map +7 -0
- package/src/logic-functions/meet-import-recording.ts +99 -0
- package/src/logic-functions/meet-queue-conference-imports.mjs +711 -0
- package/src/logic-functions/meet-queue-conference-imports.mjs.map +7 -0
- package/src/logic-functions/meet-queue-conference-imports.ts +62 -0
- package/src/logic-functions/meet-refresh-connections.mjs +457 -0
- package/src/logic-functions/meet-refresh-connections.mjs.map +7 -0
- package/src/logic-functions/meet-refresh-connections.ts +64 -0
- package/src/logic-functions/meet-register-connection.mjs +837 -0
- package/src/logic-functions/meet-register-connection.mjs.map +7 -0
- package/src/logic-functions/meet-register-connection.ts +81 -0
- package/src/logic-functions/meet-summarize-call-recording.mjs +645 -0
- package/src/logic-functions/meet-summarize-call-recording.mjs.map +7 -0
- package/src/logic-functions/meet-summarize-call-recording.ts +111 -0
- package/src/logic-functions/meet-unregister-connection.mjs +610 -0
- package/src/logic-functions/meet-unregister-connection.mjs.map +7 -0
- package/src/logic-functions/meet-unregister-connection.ts +57 -0
- package/src/logic-functions/types/calendar-event-candidate.type.ts +6 -0
- package/src/logic-functions/types/call-recording-for-summary.type.ts +5 -0
- package/src/logic-functions/types/call-recording-sync-fields.type.ts +12 -0
- package/src/logic-functions/types/call-recording-upsert-outcome.type.ts +4 -0
- package/src/logic-functions/types/google-doc-lists.type.ts +4 -0
- package/src/logic-functions/types/google-doc-markdown-segment.type.ts +5 -0
- package/src/logic-functions/types/google-doc-paragraph-element.type.ts +8 -0
- package/src/logic-functions/types/google-doc-paragraph.type.ts +7 -0
- package/src/logic-functions/types/google-doc-tab.type.ts +10 -0
- package/src/logic-functions/types/google-doc.type.ts +6 -0
- package/src/logic-functions/types/google-pubsub-push-body.type.ts +6 -0
- package/src/logic-functions/types/google-request-method.type.ts +1 -0
- package/src/logic-functions/types/google-user-info.type.ts +4 -0
- package/src/logic-functions/types/google-workspace-events-operation.type.ts +8 -0
- package/src/logic-functions/types/meet-call-summary-outcome.type.ts +6 -0
- package/src/logic-functions/types/meet-collection-page.type.ts +3 -0
- package/src/logic-functions/types/meet-conference-record.type.ts +7 -0
- package/src/logic-functions/types/meet-conference-sync-outcome.type.ts +5 -0
- package/src/logic-functions/types/meet-conference-sync-result.type.ts +7 -0
- package/src/logic-functions/types/meet-daily-job-name.type.ts +1 -0
- package/src/logic-functions/types/meet-event-data.type.ts +5 -0
- package/src/logic-functions/types/meet-event-outcome.type.ts +4 -0
- package/src/logic-functions/types/meet-event-subscription.type.ts +8 -0
- package/src/logic-functions/types/meet-event.type.ts +5 -0
- package/src/logic-functions/types/meet-exception-code.type.ts +12 -0
- package/src/logic-functions/types/meet-exception.type.ts +25 -0
- package/src/logic-functions/types/meet-participant.type.ts +8 -0
- package/src/logic-functions/types/meet-recording-import-outcome.type.ts +6 -0
- package/src/logic-functions/types/meet-recording.type.ts +7 -0
- package/src/logic-functions/types/meet-smart-note.type.ts +7 -0
- package/src/logic-functions/types/meet-space.type.ts +5 -0
- package/src/logic-functions/types/meet-transcript-entry.type.ts +8 -0
- package/src/logic-functions/types/meet-transcript.type.ts +7 -0
- package/src/logic-functions/types/transcript-entry.type.ts +7 -0
- package/src/logic-functions/utils/build-google-api-url-or-throw.util.ts +30 -0
- package/src/logic-functions/utils/build-google-doc-markdown-segment.util.ts +67 -0
- package/src/logic-functions/utils/build-meet-artifact-import-job.util.ts +25 -0
- package/src/logic-functions/utils/build-meet-call-recording-sync-fields.util.ts +48 -0
- package/src/logic-functions/utils/build-meet-call-summary-job.util.ts +19 -0
- package/src/logic-functions/utils/build-meet-call-summary-prompt.util.ts +50 -0
- package/src/logic-functions/utils/build-meet-conference-import-job.util.ts +26 -0
- package/src/logic-functions/utils/build-meet-conference-import-payload.util.ts +18 -0
- package/src/logic-functions/utils/build-meet-conference-record-filter.util.ts +8 -0
- package/src/logic-functions/utils/build-meet-daily-job.util.ts +17 -0
- package/src/logic-functions/utils/build-meet-recording-import-job.util.ts +20 -0
- package/src/logic-functions/utils/build-meet-url-or-throw.util.ts +15 -0
- package/src/logic-functions/utils/build-meet-user-target-resource.util.ts +2 -0
- package/src/logic-functions/utils/can-renew-meet-event-subscription.util.ts +18 -0
- package/src/logic-functions/utils/chunk-into-batches.util.ts +10 -0
- package/src/logic-functions/utils/claim-meet-event-subscription.util.ts +10 -0
- package/src/logic-functions/utils/compute-call-recording-id-for-meet-conference.util.ts +16 -0
- package/src/logic-functions/utils/convert-google-doc-paragraph-to-markdown.util.ts +62 -0
- package/src/logic-functions/utils/convert-google-doc-tab-to-markdown.util.ts +49 -0
- package/src/logic-functions/utils/create-meet-event-subscription-or-throw.util.ts +41 -0
- package/src/logic-functions/utils/delete-meet-event-subscription.util.ts +22 -0
- package/src/logic-functions/utils/enqueue-meet-conference-imports-or-throw.util.ts +39 -0
- package/src/logic-functions/utils/enqueue-meet-daily-jobs-or-throw.util.ts +35 -0
- package/src/logic-functions/utils/ensure-meet-event-subscription-or-throw.util.ts +51 -0
- package/src/logic-functions/utils/escape-markdown-text.util.ts +4 -0
- package/src/logic-functions/utils/escape-sql-like-pattern.util.ts +2 -0
- package/src/logic-functions/utils/extract-bearer-token.util.ts +23 -0
- package/src/logic-functions/utils/extract-meet-name-from-doc-title.util.ts +16 -0
- package/src/logic-functions/utils/fetch-meet-json.util.ts +107 -0
- package/src/logic-functions/utils/find-call-recording-for-summary.util.ts +38 -0
- package/src/logic-functions/utils/find-call-recording-video-state.util.ts +25 -0
- package/src/logic-functions/utils/find-meet-calendar-event.util.ts +74 -0
- package/src/logic-functions/utils/find-meet-conference-title.util.ts +38 -0
- package/src/logic-functions/utils/find-meet-event-subscription.util.ts +32 -0
- package/src/logic-functions/utils/find-meet-smart-notes-markdown.util.ts +32 -0
- package/src/logic-functions/utils/format-seconds-as-clock-timestamp.util.ts +20 -0
- package/src/logic-functions/utils/get-conference-record-name-from-artifact-name.util.ts +6 -0
- package/src/logic-functions/utils/get-connection-access-token-or-throw.util.ts +18 -0
- package/src/logic-functions/utils/get-google-doc-title.util.ts +31 -0
- package/src/logic-functions/utils/get-google-doc.util.ts +30 -0
- package/src/logic-functions/utils/get-google-drive-file-size-bytes-or-throw.util.ts +31 -0
- package/src/logic-functions/utils/get-meet-conference-record.util.ts +18 -0
- package/src/logic-functions/utils/get-meet-connection-subscription-key.util.ts +3 -0
- package/src/logic-functions/utils/get-meet-event-subscription-key.util.ts +2 -0
- package/src/logic-functions/utils/get-meet-participant-display-name.util.ts +20 -0
- package/src/logic-functions/utils/get-meet-recording-drive-file-id.util.ts +16 -0
- package/src/logic-functions/utils/get-meet-recording.util.ts +18 -0
- package/src/logic-functions/utils/get-meet-space.util.ts +15 -0
- package/src/logic-functions/utils/get-random-delay-milliseconds.util.ts +4 -0
- package/src/logic-functions/utils/is-google-doc-unreadable-error.util.ts +9 -0
- package/src/logic-functions/utils/is-google-pubsub-push-authorized.util.ts +31 -0
- package/src/logic-functions/utils/is-meet-ai-summary-enabled-for-member.util.ts +22 -0
- package/src/logic-functions/utils/is-transcript-entry-list.util.ts +16 -0
- package/src/logic-functions/utils/join-google-doc-markdown-segments.util.ts +102 -0
- package/src/logic-functions/utils/list-calendar-events-in-window.util.ts +142 -0
- package/src/logic-functions/utils/list-meet-collection.util.ts +79 -0
- package/src/logic-functions/utils/list-meet-conference-records.util.ts +22 -0
- package/src/logic-functions/utils/list-meet-participants.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-recordings.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-smart-notes.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-transcript-entries.util.ts +15 -0
- package/src/logic-functions/utils/list-meet-transcripts.util.ts +15 -0
- package/src/logic-functions/utils/map-meet-transcript-entries.util.ts +64 -0
- package/src/logic-functions/utils/normalize-meeting-url.util.ts +18 -0
- package/src/logic-functions/utils/open-google-drive-file-download-or-throw.util.ts +36 -0
- package/src/logic-functions/utils/parse-meet-call-summary-response.util.ts +36 -0
- package/src/logic-functions/utils/parse-meet-event-data-or-throw.util.ts +36 -0
- package/src/logic-functions/utils/parse-meet-event-or-throw.util.ts +35 -0
- package/src/logic-functions/utils/parse-retry-after-milliseconds.util.ts +27 -0
- package/src/logic-functions/utils/put-stream-to-upload-url-or-throw.util.ts +73 -0
- package/src/logic-functions/utils/read-meet-event-subscription-or-throw.util.ts +24 -0
- package/src/logic-functions/utils/release-meet-event-subscription.util.ts +29 -0
- package/src/logic-functions/utils/renew-meet-event-subscription-or-throw.util.ts +32 -0
- package/src/logic-functions/utils/run-meet-call-summarizer-or-throw.util.ts +28 -0
- package/src/logic-functions/utils/save-call-recording-summary-if-empty.util.ts +29 -0
- package/src/logic-functions/utils/save-call-recording-video.util.ts +23 -0
- package/src/logic-functions/utils/should-generate-meet-ai-summary.util.ts +17 -0
- package/src/logic-functions/utils/sleep-for-milliseconds.util.ts +2 -0
- package/src/logic-functions/utils/split-surrounding-whitespace.util.ts +10 -0
- package/src/logic-functions/utils/store-meet-connection-subscription.util.ts +46 -0
- package/src/logic-functions/utils/sync-meet-conference-or-throw.util.ts +129 -0
- package/src/logic-functions/utils/upload-google-drive-file-as-call-recording-video-or-throw.util.ts +73 -0
- package/src/logic-functions/utils/upsert-call-recording-or-throw.util.ts +104 -0
- package/src/logic-functions/utils/verify-google-pubsub-push-token-or-throw.util.ts +71 -0
- package/src/logic-functions/utils/wait-for-google-workspace-events-operation-or-throw.util.ts +53 -0
- package/tsconfig.json +39 -0
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
try {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
} catch (e3) {
|
|
13
|
+
throw mod = 0, e3;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
// node_modules/@sniptt/guards/build/guards/primitives.js
|
|
34
|
+
var require_primitives = __commonJS({
|
|
35
|
+
"node_modules/@sniptt/guards/build/guards/primitives.js"(exports) {
|
|
36
|
+
"use strict";
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.isSymbol = exports.isBigInt = exports.isString = exports.isNumber = exports.isBoolean = exports.isUndefined = void 0;
|
|
39
|
+
var isUndefined = (term) => {
|
|
40
|
+
return typeof term === "undefined";
|
|
41
|
+
};
|
|
42
|
+
exports.isUndefined = isUndefined;
|
|
43
|
+
var isBoolean = (term) => {
|
|
44
|
+
return typeof term === "boolean";
|
|
45
|
+
};
|
|
46
|
+
exports.isBoolean = isBoolean;
|
|
47
|
+
var isNumber = (term) => {
|
|
48
|
+
return typeof term === "number" && !Number.isNaN(term);
|
|
49
|
+
};
|
|
50
|
+
exports.isNumber = isNumber;
|
|
51
|
+
var isString = (term) => {
|
|
52
|
+
return typeof term === "string";
|
|
53
|
+
};
|
|
54
|
+
exports.isString = isString;
|
|
55
|
+
var isBigInt = (term) => {
|
|
56
|
+
return typeof term === "bigint";
|
|
57
|
+
};
|
|
58
|
+
exports.isBigInt = isBigInt;
|
|
59
|
+
var isSymbol = (term) => {
|
|
60
|
+
return typeof term === "symbol";
|
|
61
|
+
};
|
|
62
|
+
exports.isSymbol = isSymbol;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// node_modules/@sniptt/guards/build/guards/structural.js
|
|
67
|
+
var require_structural = __commonJS({
|
|
68
|
+
"node_modules/@sniptt/guards/build/guards/structural.js"(exports) {
|
|
69
|
+
"use strict";
|
|
70
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
+
exports.isDate = exports.isWeakSet = exports.isWeakMap = exports.isSet = exports.isMap = exports.isArray = exports.isObject = exports.isFunction = exports.isNull = void 0;
|
|
72
|
+
var isNull = (term) => {
|
|
73
|
+
return term === null;
|
|
74
|
+
};
|
|
75
|
+
exports.isNull = isNull;
|
|
76
|
+
var isFunction = (term) => {
|
|
77
|
+
return typeof term === "function";
|
|
78
|
+
};
|
|
79
|
+
exports.isFunction = isFunction;
|
|
80
|
+
var isObject3 = (term) => {
|
|
81
|
+
return !exports.isNull(term) && typeof term === "object";
|
|
82
|
+
};
|
|
83
|
+
exports.isObject = isObject3;
|
|
84
|
+
var isArray2 = (term) => {
|
|
85
|
+
return Array.isArray(term);
|
|
86
|
+
};
|
|
87
|
+
exports.isArray = isArray2;
|
|
88
|
+
var isMap = (term) => {
|
|
89
|
+
return term instanceof Map;
|
|
90
|
+
};
|
|
91
|
+
exports.isMap = isMap;
|
|
92
|
+
var isSet = (term) => {
|
|
93
|
+
return term instanceof Set;
|
|
94
|
+
};
|
|
95
|
+
exports.isSet = isSet;
|
|
96
|
+
var isWeakMap = (term) => {
|
|
97
|
+
return term instanceof WeakMap;
|
|
98
|
+
};
|
|
99
|
+
exports.isWeakMap = isWeakMap;
|
|
100
|
+
var isWeakSet = (term) => {
|
|
101
|
+
return term instanceof WeakSet;
|
|
102
|
+
};
|
|
103
|
+
exports.isWeakSet = isWeakSet;
|
|
104
|
+
var isDate = (term) => {
|
|
105
|
+
return term instanceof Date;
|
|
106
|
+
};
|
|
107
|
+
exports.isDate = isDate;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// node_modules/@sniptt/guards/build/guards/convenience.js
|
|
112
|
+
var require_convenience = __commonJS({
|
|
113
|
+
"node_modules/@sniptt/guards/build/guards/convenience.js"(exports) {
|
|
114
|
+
"use strict";
|
|
115
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
116
|
+
exports.isNegativeInteger = exports.isNonNegativeInteger = exports.isPositiveInteger = exports.isInteger = exports.isNumberOrNaN = exports.isNonEmptyString = exports.isNonEmptyArray = exports.isObjectOrNull = void 0;
|
|
117
|
+
var primitives_1 = require_primitives();
|
|
118
|
+
var structural_1 = require_structural();
|
|
119
|
+
var isObjectOrNull = (term) => {
|
|
120
|
+
return typeof term === "object";
|
|
121
|
+
};
|
|
122
|
+
exports.isObjectOrNull = isObjectOrNull;
|
|
123
|
+
var isNonEmptyArray = (term) => {
|
|
124
|
+
return structural_1.isArray(term) && term.length > 0;
|
|
125
|
+
};
|
|
126
|
+
exports.isNonEmptyArray = isNonEmptyArray;
|
|
127
|
+
var isNonEmptyString4 = (term) => {
|
|
128
|
+
return primitives_1.isString(term) && term.length > 0;
|
|
129
|
+
};
|
|
130
|
+
exports.isNonEmptyString = isNonEmptyString4;
|
|
131
|
+
var isNumberOrNaN = (term) => {
|
|
132
|
+
return typeof term === "number";
|
|
133
|
+
};
|
|
134
|
+
exports.isNumberOrNaN = isNumberOrNaN;
|
|
135
|
+
var isInteger = (term) => {
|
|
136
|
+
return primitives_1.isNumber(term) && Number.isInteger(term);
|
|
137
|
+
};
|
|
138
|
+
exports.isInteger = isInteger;
|
|
139
|
+
var isPositiveInteger = (term) => {
|
|
140
|
+
return exports.isInteger(term) && term > 0;
|
|
141
|
+
};
|
|
142
|
+
exports.isPositiveInteger = isPositiveInteger;
|
|
143
|
+
var isNonNegativeInteger = (term) => {
|
|
144
|
+
return exports.isInteger(term) && term >= 0;
|
|
145
|
+
};
|
|
146
|
+
exports.isNonNegativeInteger = isNonNegativeInteger;
|
|
147
|
+
var isNegativeInteger = (term) => {
|
|
148
|
+
return exports.isInteger(term) && term < 0;
|
|
149
|
+
};
|
|
150
|
+
exports.isNegativeInteger = isNegativeInteger;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// node_modules/@sniptt/guards/build/index.js
|
|
155
|
+
var require_build = __commonJS({
|
|
156
|
+
"node_modules/@sniptt/guards/build/index.js"(exports) {
|
|
157
|
+
"use strict";
|
|
158
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m, k, k2) {
|
|
159
|
+
if (k2 === void 0) k2 = k;
|
|
160
|
+
Object.defineProperty(o2, k2, { enumerable: true, get: function() {
|
|
161
|
+
return m[k];
|
|
162
|
+
} });
|
|
163
|
+
}) : (function(o2, m, k, k2) {
|
|
164
|
+
if (k2 === void 0) k2 = k;
|
|
165
|
+
o2[k2] = m[k];
|
|
166
|
+
}));
|
|
167
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o2, v2) {
|
|
168
|
+
Object.defineProperty(o2, "default", { enumerable: true, value: v2 });
|
|
169
|
+
}) : function(o2, v2) {
|
|
170
|
+
o2["default"] = v2;
|
|
171
|
+
});
|
|
172
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
173
|
+
if (mod && mod.__esModule) return mod;
|
|
174
|
+
var result = {};
|
|
175
|
+
if (mod != null) {
|
|
176
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
177
|
+
}
|
|
178
|
+
__setModuleDefault(result, mod);
|
|
179
|
+
return result;
|
|
180
|
+
};
|
|
181
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
182
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
183
|
+
};
|
|
184
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
|
+
exports.structural = exports.primitives = exports.convenience = void 0;
|
|
186
|
+
exports.convenience = __importStar(require_convenience());
|
|
187
|
+
__exportStar(require_convenience(), exports);
|
|
188
|
+
exports.primitives = __importStar(require_primitives());
|
|
189
|
+
__exportStar(require_primitives(), exports);
|
|
190
|
+
exports.structural = __importStar(require_structural());
|
|
191
|
+
__exportStar(require_structural(), exports);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// src/logic-functions/meet-summarize-call-recording.ts
|
|
196
|
+
var import_guards6 = __toESM(require_build());
|
|
197
|
+
import { CoreApiClient } from "twenty-client-sdk/core";
|
|
198
|
+
import { MetadataApiClient } from "twenty-client-sdk/metadata";
|
|
199
|
+
|
|
200
|
+
// twenty-sdk-define-stub:__twenty-sdk-define-stub__
|
|
201
|
+
var __defineFactoryStub = (config) => ({
|
|
202
|
+
success: true,
|
|
203
|
+
config,
|
|
204
|
+
errors: []
|
|
205
|
+
});
|
|
206
|
+
var __anyHandler = {
|
|
207
|
+
get(_target, prop) {
|
|
208
|
+
if (prop === "__esModule") return true;
|
|
209
|
+
if (prop === Symbol.toPrimitive) return () => "";
|
|
210
|
+
if (typeof prop === "symbol") return void 0;
|
|
211
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
212
|
+
},
|
|
213
|
+
apply() {
|
|
214
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
var __anyStub = new Proxy(() => void 0, __anyHandler);
|
|
218
|
+
var defineLogicFunction = __defineFactoryStub;
|
|
219
|
+
|
|
220
|
+
// node_modules/twenty-sdk/dist/utils/index.mjs
|
|
221
|
+
var import_guards = __toESM(require_build(), 1);
|
|
222
|
+
var l = (e3) => !(0, import_guards.isUndefined)(e3) && !(0, import_guards.isNull)(e3);
|
|
223
|
+
|
|
224
|
+
// src/constants/universal-identifiers.ts
|
|
225
|
+
var MEET_CALL_SUMMARIZER_AGENT_UNIVERSAL_IDENTIFIER = "2263105b-d57c-45a2-a3df-cf4f953d5371";
|
|
226
|
+
var MEET_SUMMARIZE_CALL_RECORDING_UNIVERSAL_IDENTIFIER = "707864b1-2b1c-438a-b1b8-f4a0ba99a413";
|
|
227
|
+
|
|
228
|
+
// src/logic-functions/utils/build-meet-call-summary-prompt.util.ts
|
|
229
|
+
var import_guards2 = __toESM(require_build());
|
|
230
|
+
|
|
231
|
+
// src/logic-functions/constants/meet-call-summary.constant.ts
|
|
232
|
+
var MEET_UNKNOWN_SPEAKER_NAME = "Unknown speaker";
|
|
233
|
+
var MEET_SUMMARY_UNAVAILABLE_HEADING = "## Summary unavailable";
|
|
234
|
+
|
|
235
|
+
// src/logic-functions/utils/format-seconds-as-clock-timestamp.util.ts
|
|
236
|
+
var SECONDS_PER_MINUTE = 60;
|
|
237
|
+
var SECONDS_PER_HOUR = 3600;
|
|
238
|
+
var formatSecondsAsClockTimestamp = (totalSeconds) => {
|
|
239
|
+
const wholeSeconds = Math.max(0, Math.floor(totalSeconds));
|
|
240
|
+
const hours = Math.floor(wholeSeconds / SECONDS_PER_HOUR);
|
|
241
|
+
const minutes = Math.floor(
|
|
242
|
+
wholeSeconds % SECONDS_PER_HOUR / SECONDS_PER_MINUTE
|
|
243
|
+
);
|
|
244
|
+
const paddedSeconds = String(wholeSeconds % SECONDS_PER_MINUTE).padStart(
|
|
245
|
+
2,
|
|
246
|
+
"0"
|
|
247
|
+
);
|
|
248
|
+
if (hours > 0) {
|
|
249
|
+
return `${hours}:${String(minutes).padStart(2, "0")}:${paddedSeconds}`;
|
|
250
|
+
}
|
|
251
|
+
return `${minutes}:${paddedSeconds}`;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
// src/logic-functions/utils/build-meet-call-summary-prompt.util.ts
|
|
255
|
+
var formatStartTimestamp = (startSeconds) => {
|
|
256
|
+
if (!l(startSeconds)) {
|
|
257
|
+
return "";
|
|
258
|
+
}
|
|
259
|
+
return `[${formatSecondsAsClockTimestamp(startSeconds)}] `;
|
|
260
|
+
};
|
|
261
|
+
var buildTranscriptLine = ({
|
|
262
|
+
participant,
|
|
263
|
+
words
|
|
264
|
+
}) => {
|
|
265
|
+
const text = words.map((word) => word.text.trim()).filter(import_guards2.isNonEmptyString).join(" ");
|
|
266
|
+
if (!(0, import_guards2.isNonEmptyString)(text)) {
|
|
267
|
+
return void 0;
|
|
268
|
+
}
|
|
269
|
+
return `${formatStartTimestamp(words[0]?.start_timestamp.relative)}${participant.name ?? MEET_UNKNOWN_SPEAKER_NAME}: ${text}`;
|
|
270
|
+
};
|
|
271
|
+
var buildMeetCallSummaryPrompt = ({
|
|
272
|
+
title,
|
|
273
|
+
transcriptEntries
|
|
274
|
+
}) => {
|
|
275
|
+
const lines = transcriptEntries.map(buildTranscriptLine).filter(import_guards2.isNonEmptyString);
|
|
276
|
+
if (lines.length === 0) {
|
|
277
|
+
return void 0;
|
|
278
|
+
}
|
|
279
|
+
const header = (0, import_guards2.isNonEmptyString)(title) ? `Meeting title: ${title}
|
|
280
|
+
|
|
281
|
+
` : "";
|
|
282
|
+
return `${header}Transcript:
|
|
283
|
+
${lines.join("\n")}`;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// src/logic-functions/utils/find-call-recording-for-summary.util.ts
|
|
287
|
+
var findCallRecordingForSummary = async ({
|
|
288
|
+
coreApiClient,
|
|
289
|
+
callRecordingId
|
|
290
|
+
}) => {
|
|
291
|
+
const queryResult = await coreApiClient.query({
|
|
292
|
+
callRecordings: {
|
|
293
|
+
__args: { filter: { id: { eq: callRecordingId } }, first: 1 },
|
|
294
|
+
edges: {
|
|
295
|
+
node: {
|
|
296
|
+
id: true,
|
|
297
|
+
title: true,
|
|
298
|
+
transcript: true,
|
|
299
|
+
summary: { markdown: true }
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
const node = queryResult.callRecordings?.edges?.[0]?.node;
|
|
305
|
+
if (!l(node)) {
|
|
306
|
+
return void 0;
|
|
307
|
+
}
|
|
308
|
+
return {
|
|
309
|
+
title: node.title ?? void 0,
|
|
310
|
+
transcript: node.transcript,
|
|
311
|
+
summaryMarkdown: node.summary?.markdown ?? void 0
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// src/constants/meet.constant.ts
|
|
316
|
+
var MEET_AI_SUMMARY_ENABLED_APP_VARIABLE_NAME = "GOOGLE_MEET_AI_SUMMARY_ENABLED";
|
|
317
|
+
|
|
318
|
+
// src/logic-functions/utils/is-meet-ai-summary-enabled-for-member.util.ts
|
|
319
|
+
var isMeetAiSummaryEnabledForMember = ({
|
|
320
|
+
memberApplicationVariables,
|
|
321
|
+
userWorkspaceId
|
|
322
|
+
}) => {
|
|
323
|
+
const aiSummaryEnabledValue = memberApplicationVariables.find((member) => member.userWorkspaceId === userWorkspaceId)?.variables.find(
|
|
324
|
+
({ key }) => key === MEET_AI_SUMMARY_ENABLED_APP_VARIABLE_NAME
|
|
325
|
+
)?.value;
|
|
326
|
+
return l(aiSummaryEnabledValue) && aiSummaryEnabledValue !== "false";
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// src/logic-functions/utils/is-transcript-entry-list.util.ts
|
|
330
|
+
var import_guards3 = __toESM(require_build());
|
|
331
|
+
var isTranscriptEntryList = (value) => (0, import_guards3.isArray)(value) && value.every(
|
|
332
|
+
(entry) => (0, import_guards3.isObject)(entry) && "participant" in entry && (0, import_guards3.isObject)(entry.participant) && "words" in entry && (0, import_guards3.isArray)(entry.words)
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
// src/logic-functions/utils/parse-meet-call-summary-response.util.ts
|
|
336
|
+
var import_guards4 = __toESM(require_build());
|
|
337
|
+
|
|
338
|
+
// src/constants/meet-call-summary-prompt.constant.ts
|
|
339
|
+
var MEET_CALL_SUMMARY_UNAVAILABLE_PREFIX = "SUMMARY_UNAVAILABLE:";
|
|
340
|
+
var MEET_CALL_SUMMARY_PROMPT = [
|
|
341
|
+
"You are an AI meeting note-taker for a CRM. You receive the diarized,",
|
|
342
|
+
"time-stamped transcript of a recorded call and produce clean, factual",
|
|
343
|
+
"meeting notes for the rep who attended.",
|
|
344
|
+
"",
|
|
345
|
+
"Output GitHub-flavored Markdown only \u2014 no preamble, no closing remarks, no",
|
|
346
|
+
"surrounding code fences. Emit exactly these sections, in this order, each",
|
|
347
|
+
"with its heading exactly as written. Omit a section only when its rule says",
|
|
348
|
+
"to.",
|
|
349
|
+
"",
|
|
350
|
+
"## Gist",
|
|
351
|
+
"A single sentence (no bullet) capturing the essence of the meeting.",
|
|
352
|
+
"",
|
|
353
|
+
"## Overview",
|
|
354
|
+
"One paragraph of 2-4 sentences covering what the meeting was about and how",
|
|
355
|
+
"it ended. No bullets.",
|
|
356
|
+
"",
|
|
357
|
+
"## Action Items",
|
|
358
|
+
"Concrete follow-ups, grouped by the person responsible. Write each owner as",
|
|
359
|
+
"a bold line, then their tasks as a bulleted list beneath it. Use the",
|
|
360
|
+
'speaker name from the transcript, or "Unassigned" when no owner is clear.',
|
|
361
|
+
"Example:",
|
|
362
|
+
"**Alex**",
|
|
363
|
+
"- Send the pricing deck",
|
|
364
|
+
"- Follow up on Friday",
|
|
365
|
+
"If the call produced no follow-ups, write the single line: None.",
|
|
366
|
+
"",
|
|
367
|
+
"## Notes",
|
|
368
|
+
"The discussion split into short topical sections in chronological order.",
|
|
369
|
+
"Begin each section with a bold title and the [mm:ss] timestamp it started",
|
|
370
|
+
"at, then summarize it as concise bullets. Example:",
|
|
371
|
+
"**Introductions** \u2014 0:00",
|
|
372
|
+
"- ...",
|
|
373
|
+
"**Pricing discussion** \u2014 4:12",
|
|
374
|
+
"- ...",
|
|
375
|
+
"",
|
|
376
|
+
"## Keywords",
|
|
377
|
+
"A single comma-separated line of the most important terms, names, and",
|
|
378
|
+
"topics from the call.",
|
|
379
|
+
"",
|
|
380
|
+
"Grounding rules: use only information present in the transcript. Never",
|
|
381
|
+
"invent names, numbers, commitments, outcomes, or times \u2014 reuse the [mm:ss]",
|
|
382
|
+
"timestamps exactly as they appear in the transcript.",
|
|
383
|
+
"",
|
|
384
|
+
"If the transcript is too short, unintelligible, or contains no substantive",
|
|
385
|
+
"discussion, ignore the output format above and return exactly one line in",
|
|
386
|
+
"this format:",
|
|
387
|
+
`${MEET_CALL_SUMMARY_UNAVAILABLE_PREFIX} <one short sentence explaining why the transcript cannot be summarized reliably>`,
|
|
388
|
+
"The reason must describe only what is observable in the transcript. Be",
|
|
389
|
+
"specific and do not speculate. Example:",
|
|
390
|
+
`${MEET_CALL_SUMMARY_UNAVAILABLE_PREFIX} The transcript contains only greetings and audio checks, with no substantive discussion.`
|
|
391
|
+
].join("\n");
|
|
392
|
+
|
|
393
|
+
// src/logic-functions/utils/parse-meet-call-summary-response.util.ts
|
|
394
|
+
var parseMeetCallSummaryResponse = (agentResult) => {
|
|
395
|
+
const { success, result } = agentResult;
|
|
396
|
+
if (!success || !(0, import_guards4.isObject)(result) || !("response" in result) || !(0, import_guards4.isNonEmptyString)(result.response)) {
|
|
397
|
+
return void 0;
|
|
398
|
+
}
|
|
399
|
+
const response = result.response.trim();
|
|
400
|
+
if (!response.startsWith(MEET_CALL_SUMMARY_UNAVAILABLE_PREFIX)) {
|
|
401
|
+
return response;
|
|
402
|
+
}
|
|
403
|
+
const reason = response.slice(MEET_CALL_SUMMARY_UNAVAILABLE_PREFIX.length).trim();
|
|
404
|
+
if (!(0, import_guards4.isNonEmptyString)(reason)) {
|
|
405
|
+
return void 0;
|
|
406
|
+
}
|
|
407
|
+
return `${MEET_SUMMARY_UNAVAILABLE_HEADING}
|
|
408
|
+
|
|
409
|
+
${reason}`;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
// node_modules/twenty-sdk/dist/logic-function/index.mjs
|
|
413
|
+
var import_guards5 = __toESM(require_build(), 1);
|
|
414
|
+
import { MetadataApiClient as o } from "twenty-client-sdk/metadata";
|
|
415
|
+
var c = (e3) => !(0, import_guards5.isUndefined)(e3) && !(0, import_guards5.isNull)(e3);
|
|
416
|
+
var d = "RetryableLogicFunctionError";
|
|
417
|
+
var f = class extends Error {
|
|
418
|
+
constructor(e3) {
|
|
419
|
+
super(e3), this.name = d;
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
var h = "TWENTY_API_URL";
|
|
423
|
+
var g = "TWENTY_APP_ACCESS_TOKEN";
|
|
424
|
+
var ee = "TWENTY_APP_APPLICATION_ACCESS_TOKEN";
|
|
425
|
+
var te = "TWENTY_INTERNAL_API_URL";
|
|
426
|
+
var re = (e3) => {
|
|
427
|
+
let n3 = e3[te];
|
|
428
|
+
return (0, import_guards5.isNonEmptyString)(n3) ? n3 : e3[h];
|
|
429
|
+
};
|
|
430
|
+
var v = () => process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN ?? process.env.TWENTY_APP_ACCESS_TOKEN;
|
|
431
|
+
var y = () => process.env.TWENTY_APP_ACCESS_TOKEN ?? process.env.TWENTY_APP_APPLICATION_ACCESS_TOKEN;
|
|
432
|
+
var b = ({ caller: e3, isActingAsCaller: n3 = false }) => {
|
|
433
|
+
let r2 = re(process.env), i2 = n3 ? y() : v();
|
|
434
|
+
if (!(0, import_guards5.isNonEmptyString)(r2) || !(0, import_guards5.isNonEmptyString)(i2)) throw Error(`${e3}() requires the app runtime env vars ${h} and ${ee} (or ${g}).`);
|
|
435
|
+
return {
|
|
436
|
+
apiUrl: r2,
|
|
437
|
+
accessToken: i2
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
var x = async ({ query: e3, variables: t3, caller: n3, signal: r2, isActingAsCaller: i2 = false }) => {
|
|
441
|
+
let { apiUrl: a2, accessToken: o2 } = b({
|
|
442
|
+
caller: n3,
|
|
443
|
+
isActingAsCaller: i2
|
|
444
|
+
}), s = await fetch(`${a2}/metadata`, {
|
|
445
|
+
method: "POST",
|
|
446
|
+
headers: {
|
|
447
|
+
"Content-Type": "application/json",
|
|
448
|
+
Authorization: `Bearer ${o2}`
|
|
449
|
+
},
|
|
450
|
+
body: JSON.stringify({
|
|
451
|
+
query: e3,
|
|
452
|
+
variables: t3
|
|
453
|
+
}),
|
|
454
|
+
signal: r2
|
|
455
|
+
});
|
|
456
|
+
if (!s.ok) throw Error(`${n3}() failed: HTTP ${s.status} ${s.statusText}`);
|
|
457
|
+
let c2 = await s.json();
|
|
458
|
+
if (c2.errors && c2.errors.length > 0) throw Error(`${n3}() failed: ${c2.errors.map((e4) => e4.message).join(", ")}`);
|
|
459
|
+
if (!c2.data) throw Error(`${n3}() failed: response contained no data.`);
|
|
460
|
+
return c2.data;
|
|
461
|
+
};
|
|
462
|
+
var S = ({ objectNameSingular: e3, recordId: t3, displayName: n3 }) => `[[record:${e3}:${t3}:${n3}]]`;
|
|
463
|
+
var C = "\n id\n handle\n displayName\n visibility\n connectedAccountId\n isSyncEnabled\n participantHandleFieldUniversalIdentifier\n messagingProviderUniversalIdentifier\n";
|
|
464
|
+
var w = `
|
|
465
|
+
mutation CreateAppMessageChannel($input: CreateAppMessageChannelInput!) {
|
|
466
|
+
createAppMessageChannel(input: $input) {
|
|
467
|
+
${C}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
`;
|
|
471
|
+
var E = `
|
|
472
|
+
query ListAppMessageChannels($filter: ListAppMessageChannelsInput) {
|
|
473
|
+
appMessageChannels(filter: $filter) {
|
|
474
|
+
${C}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
`;
|
|
478
|
+
var O = `
|
|
479
|
+
mutation UpdateAppMessageChannel($input: UpdateAppMessageChannelInput!) {
|
|
480
|
+
updateAppMessageChannel(input: $input) {
|
|
481
|
+
${C}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
`;
|
|
485
|
+
var A = `
|
|
486
|
+
mutation DeleteAppMessageChannel($id: UUID!) {
|
|
487
|
+
deleteAppMessageChannel(id: $id) {
|
|
488
|
+
${C}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
`;
|
|
492
|
+
var L = "\n id\n externalId\n name\n isSynced\n messageChannelId\n";
|
|
493
|
+
var R = `
|
|
494
|
+
query ListAppMessageFolders($filter: ListAppMessageFoldersInput) {
|
|
495
|
+
appMessageFolders(filter: $filter) {
|
|
496
|
+
${L}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
`;
|
|
500
|
+
var B = `
|
|
501
|
+
mutation SyncAppMessageFolders($input: SyncAppMessageFoldersInput!) {
|
|
502
|
+
syncAppMessageFolders(input: $input) {
|
|
503
|
+
${L}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
`;
|
|
507
|
+
var H = (e3) => (0, import_guards5.isString)(e3) ? [{
|
|
508
|
+
role: "user",
|
|
509
|
+
content: e3
|
|
510
|
+
}] : e3;
|
|
511
|
+
var fe = "\n mutation RunAgent($input: RunAgentInput!) {\n runAgent(input: $input) {\n threadId\n runId\n status\n result\n error\n success\n }\n }\n";
|
|
512
|
+
var pe = async ({ input: e3, ...t3 }) => {
|
|
513
|
+
let { runAgent: n3 } = await x({
|
|
514
|
+
query: fe,
|
|
515
|
+
variables: { input: c(e3) ? {
|
|
516
|
+
...t3,
|
|
517
|
+
input: H(e3)
|
|
518
|
+
} : t3 },
|
|
519
|
+
caller: "runAgent"
|
|
520
|
+
});
|
|
521
|
+
return n3;
|
|
522
|
+
};
|
|
523
|
+
var U = "agentChatAssistant";
|
|
524
|
+
var ze = S({
|
|
525
|
+
objectNameSingular: U,
|
|
526
|
+
recordId: U,
|
|
527
|
+
displayName: "Ada"
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
// src/logic-functions/utils/run-meet-call-summarizer-or-throw.util.ts
|
|
531
|
+
var runMeetCallSummarizerOrThrow = async (prompt) => {
|
|
532
|
+
const agentResult = await pe({
|
|
533
|
+
agentUniversalIdentifier: MEET_CALL_SUMMARIZER_AGENT_UNIVERSAL_IDENTIFIER,
|
|
534
|
+
input: prompt
|
|
535
|
+
}).catch((error) => {
|
|
536
|
+
throw new f(
|
|
537
|
+
`The Google Meet summarizer agent could not run: ${error instanceof Error ? error.message : String(error)}`
|
|
538
|
+
);
|
|
539
|
+
});
|
|
540
|
+
if (!agentResult.success) {
|
|
541
|
+
throw new f(
|
|
542
|
+
`The Google Meet summarizer agent failed: ${agentResult.error ?? agentResult.status}`
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
return agentResult;
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
// src/logic-functions/utils/save-call-recording-summary-if-empty.util.ts
|
|
549
|
+
var saveCallRecordingSummaryIfEmpty = async ({
|
|
550
|
+
coreApiClient,
|
|
551
|
+
callRecordingId,
|
|
552
|
+
summaryMarkdown
|
|
553
|
+
}) => {
|
|
554
|
+
const mutationResult = await coreApiClient.mutation({
|
|
555
|
+
updateCallRecordings: {
|
|
556
|
+
__args: {
|
|
557
|
+
filter: {
|
|
558
|
+
id: { eq: callRecordingId },
|
|
559
|
+
or: [
|
|
560
|
+
{ summary: { markdown: { is: "NULL" } } },
|
|
561
|
+
{ summary: { markdown: { eq: "" } } }
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
data: { summary: { blocknote: null, markdown: summaryMarkdown } }
|
|
565
|
+
},
|
|
566
|
+
id: true
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
return (mutationResult.updateCallRecordings ?? []).length > 0;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// src/logic-functions/meet-summarize-call-recording.ts
|
|
573
|
+
var meetSummarizeCallRecordingHandler = async ({
|
|
574
|
+
callRecordingId,
|
|
575
|
+
userWorkspaceId
|
|
576
|
+
}) => {
|
|
577
|
+
if (!(0, import_guards6.isNonEmptyString)(callRecordingId) || !(0, import_guards6.isNonEmptyString)(userWorkspaceId)) {
|
|
578
|
+
return { success: false, error: "Invalid Google Meet call summary job" };
|
|
579
|
+
}
|
|
580
|
+
const { myUserApplicationVariables } = await new MetadataApiClient({
|
|
581
|
+
runAs: "application"
|
|
582
|
+
}).query({
|
|
583
|
+
myUserApplicationVariables: {
|
|
584
|
+
userWorkspaceId: true,
|
|
585
|
+
variables: { key: true, value: true }
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
if (!isMeetAiSummaryEnabledForMember({
|
|
589
|
+
memberApplicationVariables: myUserApplicationVariables,
|
|
590
|
+
userWorkspaceId
|
|
591
|
+
})) {
|
|
592
|
+
return { success: true, outcome: "DISABLED" };
|
|
593
|
+
}
|
|
594
|
+
const coreApiClient = new CoreApiClient({ runAs: "application" });
|
|
595
|
+
const callRecording = await findCallRecordingForSummary({
|
|
596
|
+
coreApiClient,
|
|
597
|
+
callRecordingId
|
|
598
|
+
});
|
|
599
|
+
if (!l(callRecording)) {
|
|
600
|
+
return { success: true, outcome: "NOT_FOUND" };
|
|
601
|
+
}
|
|
602
|
+
if ((0, import_guards6.isNonEmptyString)(callRecording.summaryMarkdown)) {
|
|
603
|
+
return { success: true, outcome: "ALREADY_SUMMARIZED" };
|
|
604
|
+
}
|
|
605
|
+
if (!isTranscriptEntryList(callRecording.transcript)) {
|
|
606
|
+
return { success: true, outcome: "NO_TRANSCRIPT" };
|
|
607
|
+
}
|
|
608
|
+
const prompt = buildMeetCallSummaryPrompt({
|
|
609
|
+
title: callRecording.title,
|
|
610
|
+
transcriptEntries: callRecording.transcript
|
|
611
|
+
});
|
|
612
|
+
if (!(0, import_guards6.isNonEmptyString)(prompt)) {
|
|
613
|
+
return { success: true, outcome: "NO_TRANSCRIPT" };
|
|
614
|
+
}
|
|
615
|
+
const summaryMarkdown = parseMeetCallSummaryResponse(
|
|
616
|
+
await runMeetCallSummarizerOrThrow(prompt)
|
|
617
|
+
);
|
|
618
|
+
if (!(0, import_guards6.isNonEmptyString)(summaryMarkdown)) {
|
|
619
|
+
return {
|
|
620
|
+
success: false,
|
|
621
|
+
error: "The summarizer agent returned no summary"
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
const isSaved = await saveCallRecordingSummaryIfEmpty({
|
|
625
|
+
coreApiClient,
|
|
626
|
+
callRecordingId,
|
|
627
|
+
summaryMarkdown
|
|
628
|
+
});
|
|
629
|
+
return {
|
|
630
|
+
success: true,
|
|
631
|
+
outcome: isSaved ? "SUMMARIZED" : "ALREADY_SUMMARIZED"
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
var meet_summarize_call_recording_default = defineLogicFunction({
|
|
635
|
+
universalIdentifier: MEET_SUMMARIZE_CALL_RECORDING_UNIVERSAL_IDENTIFIER,
|
|
636
|
+
name: "meet-summarize-call-recording",
|
|
637
|
+
description: "Writes an AI summary of a Google Meet call that has a transcript but no Gemini notes.",
|
|
638
|
+
timeoutSeconds: 240,
|
|
639
|
+
handler: meetSummarizeCallRecordingHandler
|
|
640
|
+
});
|
|
641
|
+
export {
|
|
642
|
+
meet_summarize_call_recording_default as default,
|
|
643
|
+
meetSummarizeCallRecordingHandler
|
|
644
|
+
};
|
|
645
|
+
//# sourceMappingURL=meet-summarize-call-recording.mjs.map
|