@wirecat/mail-cli 0.32.0 → 0.34.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/CHANGELOG.md +31 -0
- package/contracts/wirecat.json +2 -2
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/{all-profiles-OTCWJSJS.js → all-profiles-2KUKROHY.js} +10 -10
- package/dist/bundle/{anthropic-GUXHDK32.js → anthropic-E5KRCEVC.js} +8 -8
- package/dist/bundle/{app-server-GX7DOE4O.js → app-server-HIQ3QO5K.js} +60 -52
- package/dist/bundle/{bun-V5QLYBZU.js → bun-KARJPE5D.js} +2 -2
- package/dist/bundle/{bun-sqlite-AXD5CCO3.js → bun-sqlite-NHGX6ZUN.js} +6 -6
- package/dist/bundle/{chunk-4YNUQGDP.js → chunk-26DYRMXE.js} +1 -1
- package/dist/bundle/{chunk-3URYKAJP.js → chunk-2GDLJKPT.js} +1 -1
- package/dist/bundle/{chunk-JUS4Y4BW.js → chunk-2SCQ7Z4I.js} +4 -4
- package/dist/bundle/{chunk-LVJWN2PR.js → chunk-2VBEBPGX.js} +21 -11
- package/dist/bundle/{chunk-OUM4ZO53.js → chunk-4SKE5GYA.js} +1 -1
- package/dist/bundle/{chunk-WNGMI6AZ.js → chunk-4URI6EAV.js} +3 -3
- package/dist/bundle/chunk-4VHK5UBM.js +170 -0
- package/dist/bundle/{chunk-O7OP5NQO.js → chunk-4VM3UCSO.js} +2 -2
- package/dist/bundle/chunk-5GANGHQI.js +721 -0
- package/dist/bundle/{chunk-SWXKS7JK.js → chunk-6G4VQFVX.js} +19 -19
- package/dist/bundle/{chunk-TDTCCHAI.js → chunk-6GGMFL7J.js} +3 -3
- package/dist/bundle/{chunk-6XNTELM5.js → chunk-6LFRZDPV.js} +1 -1
- package/dist/bundle/{chunk-CD3TAITM.js → chunk-A2Y2RFNW.js} +75 -11
- package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-AGZ7SNFF.js} +1 -1
- package/dist/bundle/chunk-CKVWAUBW.js +787 -0
- package/dist/bundle/{chunk-SZZJOSIS.js → chunk-DYQGEZA2.js} +3 -3
- package/dist/bundle/{chunk-JRGPPS6H.js → chunk-DZRP4UCK.js} +13 -13
- package/dist/bundle/{chunk-7GW4D3OW.js → chunk-EGQJDEFY.js} +85 -39
- package/dist/bundle/{chunk-7MEVD5PI.js → chunk-EZAX77SM.js} +20 -20
- package/dist/bundle/{chunk-2IYAZRTC.js → chunk-FNYWC6A3.js} +2 -2
- package/dist/bundle/chunk-FORAOCZ3.js +334 -0
- package/dist/bundle/{chunk-IX3GUNGV.js → chunk-H77ALM2Y.js} +4 -4
- package/dist/bundle/{chunk-MENP3FF5.js → chunk-HH647UBC.js} +23 -23
- package/dist/bundle/{chunk-HUWQ7LXZ.js → chunk-HRDCH2VB.js} +947 -953
- package/dist/bundle/{chunk-ZDP6A2VL.js → chunk-I3MS74OF.js} +4 -4
- package/dist/bundle/{chunk-TWHIZJAZ.js → chunk-IMQ4CVZJ.js} +2 -2
- package/dist/bundle/{chunk-NMN5JUYL.js → chunk-JVGVLRBA.js} +5 -5
- package/dist/bundle/{chunk-U57QRUP7.js → chunk-KF6O4RZO.js} +3 -3
- package/dist/bundle/{chunk-LVFI3TCG.js → chunk-KGYK3OI3.js} +6 -6
- package/dist/bundle/{chunk-PALY5PGE.js → chunk-KLI5FKZ2.js} +7 -7
- package/dist/bundle/chunk-KNVTBDTE.js +72 -0
- package/dist/bundle/{chunk-PCWAZVAD.js → chunk-LKTDW5LH.js} +7 -7
- package/dist/bundle/{chunk-ECZSYLSL.js → chunk-LOSYDRJU.js} +45 -8
- package/dist/bundle/{chunk-HFA6AZWA.js → chunk-MDISZMK4.js} +4 -4
- package/dist/bundle/{chunk-GPOTPA3S.js → chunk-MGXYIVVJ.js} +14 -13
- package/dist/bundle/{chunk-KLGZX6QT.js → chunk-NAENYLIO.js} +2 -2
- package/dist/bundle/{chunk-SDAYOJLL.js → chunk-NHD5BOJU.js} +6 -6
- package/dist/bundle/{chunk-FA3B2DHZ.js → chunk-NI4GCP2T.js} +2 -2
- package/dist/bundle/{chunk-ZAD7K4TI.js → chunk-NJVJH5MH.js} +8053 -8240
- package/dist/bundle/{chunk-IVD3JTN5.js → chunk-NWD7AFOR.js} +2 -2
- package/dist/bundle/{chunk-U346WBJ5.js → chunk-NXERDBEK.js} +4 -4
- package/dist/bundle/{chunk-AJY2IT25.js → chunk-OG5QO5RR.js} +8 -8
- package/dist/bundle/{chunk-RNBG75HW.js → chunk-OJ3BI2U4.js} +29 -30
- package/dist/bundle/chunk-OOYRMTX5.js +374 -0
- package/dist/bundle/{chunk-GSXCMQWV.js → chunk-OX5MCGXL.js} +40 -40
- package/dist/bundle/{chunk-T577U52I.js → chunk-PA4GEJXQ.js} +9 -9
- package/dist/bundle/{chunk-2UMEZY6D.js → chunk-PC3N3LH3.js} +3 -3
- package/dist/bundle/{chunk-WQOGHND4.js → chunk-PRDKEVUL.js} +1 -1
- package/dist/bundle/{chunk-Z6OKVD3R.js → chunk-PVZMN3UZ.js} +8 -8
- package/dist/bundle/{chunk-SEJBS7SI.js → chunk-QFJC6POK.js} +1 -1
- package/dist/bundle/{chunk-MVMNZ3Q3.js → chunk-QOQF2TX3.js} +893 -1491
- package/dist/bundle/{chunk-7KCBPAQS.js → chunk-QQGPV3QN.js} +2 -2
- package/dist/bundle/{chunk-6SJ7HHAE.js → chunk-QXLYLVEC.js} +1 -1
- package/dist/bundle/chunk-QXYNDMA6.js +259 -0
- package/dist/bundle/{chunk-QHXOXYAT.js → chunk-R2GS3GBJ.js} +61 -59
- package/dist/bundle/{chunk-6TRKNME5.js → chunk-RPNQXWRS.js} +4 -4
- package/dist/bundle/{chunk-7C6FGWDH.js → chunk-SK3N4CK5.js} +4 -4
- package/dist/bundle/{chunk-GDDCKTBR.js → chunk-T2EE5M7O.js} +5 -5
- package/dist/bundle/{chunk-U7RLFLTM.js → chunk-TZJC4AOK.js} +30 -29
- package/dist/bundle/{chunk-PCMQYGEM.js → chunk-V43KEZYA.js} +9 -9
- package/dist/bundle/{chunk-MSK7RNOM.js → chunk-VBVR6JRC.js} +283 -515
- package/dist/bundle/{chunk-KLFF54AF.js → chunk-VRGEDK4T.js} +8 -8
- package/dist/bundle/{chunk-ANYADN3S.js → chunk-WYGDALB3.js} +31 -85
- package/dist/bundle/{chunk-IBCGCYRU.js → chunk-X6IGETU6.js} +2 -2
- package/dist/bundle/{chunk-CAQ5GW3A.js → chunk-XIF75Z7D.js} +1 -1
- package/dist/bundle/chunk-XWU3A7H6.js +29 -0
- package/dist/bundle/{chunk-XXXVVNGI.js → chunk-YWX5X5RI.js} +19 -117
- package/dist/bundle/{chunk-FIVFP53N.js → chunk-Z6A6QPPW.js} +1 -1
- package/dist/bundle/{chunk-MHXZ62CU.js → chunk-ZGZADWD7.js} +1 -1
- package/dist/bundle/{chunk-MT2WDBG2.js → chunk-ZZEWQR43.js} +18 -14
- package/dist/bundle/command-contract-PZ7VOOXP.js +39 -0
- package/dist/bundle/{command-server-entry-BVXOPKXH.js → command-server-entry-NF45UPEV.js} +28 -25
- package/dist/bundle/decode-DUZA3EHC.js +296 -0
- package/dist/bundle/{dispatch-DSVN7MNG.js → dispatch-CDJZAMVP.js} +8 -8
- package/dist/bundle/{dist-B2JWWTNN.js → dist-RH7EMC4J.js} +29 -24
- package/dist/bundle/{echarts-QIXLXS3G.js → echarts-GZHZBNRA.js} +2 -2
- package/dist/bundle/{embed-4NC4ELYP.js → embed-VE3CSJN4.js} +6 -6
- package/dist/bundle/{embedder-HBRDIFQC.js → embedder-DSJ77DX5.js} +9 -9
- package/dist/bundle/{failure-COTPFUP4.js → failure-YH6HAGFT.js} +2 -2
- package/dist/bundle/{first-run-6QF67AAZ.js → first-run-3L7HLYTI.js} +12 -12
- package/dist/bundle/first-screen-MY5KID77.js +37 -0
- package/dist/bundle/{instructions-MD2RZT5Z.js → instructions-OZK3BLIO.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-TDKGDB4V.js → mcp-YUG4YR4R.js} +2 -2
- package/dist/bundle/meeting-combined-RYMUPY54.js +24 -0
- package/dist/bundle/meeting-model-U7LW5WEN.js +24 -0
- package/dist/bundle/meeting-semantic-64IOIQRR.js +21 -0
- package/dist/bundle/{node-IEVT2FSJ.js → node-OS3VWBUZ.js} +2 -2
- package/dist/bundle/{node-sqlite-EOTTDMOG.js → node-sqlite-RQ623VFA.js} +7 -7
- package/dist/bundle/{oauth-A5BEFGCI.js → oauth-CBPAG734.js} +7 -7
- package/dist/bundle/{open-HWN2EZYG.js → open-H4DGOMBC.js} +5 -5
- package/dist/bundle/{openai-PJKJ4CIU.js → openai-EMWRGR54.js} +28 -26
- package/dist/bundle/{process-6Q23D3TO.js → process-3TOIYASI.js} +1 -1
- package/dist/bundle/{program-WR43NPAV.js → program-WA6RGAJL.js} +3151 -2105
- package/dist/bundle/{prompt-E7Q2662O.js → prompt-22KNCMBI.js} +5 -5
- package/dist/bundle/{recognize-4F4PIL4B.js → recognize-UWD4RSCZ.js} +4 -4
- package/dist/bundle/{remote-RGJXO7XK.js → remote-LJY7MF2E.js} +9 -9
- package/dist/bundle/{rerank-EDY7PHMG.js → rerank-JJ6KNJFB.js} +7 -7
- package/dist/bundle/{serve-Q4XF6ID2.js → serve-3EPLJYVZ.js} +9 -9
- package/dist/bundle/{server-5I72DSDF.js → server-5JOFO4V4.js} +52 -44
- package/dist/bundle/server-EOQNS7B7.js +75 -0
- package/dist/bundle/{sqlite-runtime-PU3Z2H7C.js → sqlite-runtime-MGJA5E27.js} +6 -6
- package/dist/bundle/{state-CWSXJBU2.js → state-UCRDOWOP.js} +6 -6
- package/dist/bundle/{store-KQPKS3PX.js → store-265VRRQV.js} +25 -20
- package/dist/bundle/{store-ZAMKKM2A.js → store-HS272YSA.js} +21 -17
- package/dist/bundle/store-maintenance-command-IKZM5NRP.js +66 -0
- package/dist/commands/messages.js +1 -1
- package/dist/commands/messages.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -2
- package/dist/identity.js.map +1 -1
- package/dist/mail/cleanup.d.ts.map +1 -1
- package/dist/mail/cleanup.js +4 -3
- package/dist/mail/cleanup.js.map +1 -1
- package/dist/mail/rules/apply.js +1 -1
- package/dist/mail/rules/apply.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-DZ6XRIOI.js +0 -36
- package/dist/bundle/decode-STN3EHT7.js +0 -162
- package/dist/bundle/first-screen-LXSZMK2P.js +0 -34
- package/dist/bundle/server-2Y5NSP2U.js +0 -67
- package/dist/bundle/store-maintenance-command-PMTTDR6J.js +0 -58
- /package/dist/bundle/{chunk-XWBPP2HX.js → chunk-FEBUZHU3.js} +0 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
defineReasons,
|
|
10
10
|
defineSteps,
|
|
11
11
|
duplicates,
|
|
12
|
+
exactOptional,
|
|
12
13
|
integer,
|
|
13
14
|
isoTime,
|
|
14
15
|
lazy,
|
|
@@ -23,6 +24,7 @@ import {
|
|
|
23
24
|
pageSchema,
|
|
24
25
|
picklist,
|
|
25
26
|
pipe,
|
|
27
|
+
record,
|
|
26
28
|
reference,
|
|
27
29
|
safeParse,
|
|
28
30
|
stepOf,
|
|
@@ -30,18 +32,18 @@ import {
|
|
|
30
32
|
string,
|
|
31
33
|
union,
|
|
32
34
|
variant
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-LOSYDRJU.js";
|
|
34
36
|
import {
|
|
35
37
|
CliError,
|
|
36
38
|
isCliError,
|
|
37
39
|
singleLine,
|
|
38
40
|
visibleControls
|
|
39
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QQGPV3QN.js";
|
|
40
42
|
import {
|
|
41
43
|
__name
|
|
42
44
|
} from "./chunk-ZVVMGPBJ.js";
|
|
43
45
|
|
|
44
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
46
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/types.js
|
|
45
47
|
var QUERY_LIMITS = {
|
|
46
48
|
bytes: 8192,
|
|
47
49
|
depth: 32,
|
|
@@ -85,7 +87,7 @@ function queryError(reason, span, alternative, context3 = {}, details = {}) {
|
|
|
85
87
|
__name(queryError, "queryError");
|
|
86
88
|
var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
|
|
87
89
|
|
|
88
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
90
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/dates.js
|
|
89
91
|
var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
90
92
|
const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
|
|
91
93
|
try {
|
|
@@ -97,7 +99,7 @@ var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
|
97
99
|
}, "timezoneOf");
|
|
98
100
|
var calendar = /* @__PURE__ */ __name((value, span) => {
|
|
99
101
|
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value))
|
|
100
|
-
queryError("query.invalid-date", span, "use an ISO date
|
|
102
|
+
queryError("query.invalid-date", span, "use an ISO date such as 2026-10-01");
|
|
101
103
|
const year = Number(value.slice(0, 4)), month = Number(value.slice(5, 7)), day = Number(value.slice(8, 10));
|
|
102
104
|
const date = /* @__PURE__ */ new Date(0);
|
|
103
105
|
date.setUTCFullYear(year, month - 1, day);
|
|
@@ -119,9 +121,9 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
|
|
|
119
121
|
era: "short"
|
|
120
122
|
});
|
|
121
123
|
const dayAt = /* @__PURE__ */ __name((time) => {
|
|
122
|
-
const
|
|
123
|
-
const value2 = /* @__PURE__ */ __name((name) => Number(
|
|
124
|
-
const year =
|
|
124
|
+
const parts = formatter.formatToParts(time);
|
|
125
|
+
const value2 = /* @__PURE__ */ __name((name) => Number(parts.find((p) => p.type === name)?.value), "value");
|
|
126
|
+
const year = parts.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
|
|
125
127
|
return year * 1e4 + value2("month") * 100 + value2("day");
|
|
126
128
|
}, "dayAt");
|
|
127
129
|
let lo = date.getTime() - 2 * 864e5, hi = date.getTime() + 2 * 864e5;
|
|
@@ -156,8 +158,8 @@ var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
|
|
|
156
158
|
hourCycle: "h23"
|
|
157
159
|
});
|
|
158
160
|
const shown = /* @__PURE__ */ __name((instant) => {
|
|
159
|
-
const
|
|
160
|
-
return Date.UTC(
|
|
161
|
+
const parts = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
|
|
162
|
+
return Date.UTC(parts.year ?? 0, (parts.month ?? 1) - 1, parts.day, parts.hour, parts.minute, parts.second) + (instant % 1e3 + 1e3) % 1e3;
|
|
161
163
|
}, "shown");
|
|
162
164
|
const found = /* @__PURE__ */ new Set();
|
|
163
165
|
for (const probe of [wanted - 864e5, wanted, wanted + 864e5]) {
|
|
@@ -182,6 +184,7 @@ var zonedMoment = /* @__PURE__ */ __name((value, zone, span, { end = false } = {
|
|
|
182
184
|
return time;
|
|
183
185
|
}, "zonedMoment");
|
|
184
186
|
var AGO = /^(\d+)(m|h|d)$/u;
|
|
187
|
+
var MOMENT = /^(\d{4}-\d{2}-\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?$/u;
|
|
185
188
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
186
189
|
var dayOf = /* @__PURE__ */ __name((word, zone, now, span) => {
|
|
187
190
|
const today = new Intl.DateTimeFormat("en-CA", {
|
|
@@ -210,11 +213,15 @@ var dateEndpoint = /* @__PURE__ */ __name((value, zone, side, inclusive, span, n
|
|
|
210
213
|
time: dayBoundary(value, zone, side === "lower" ? !inclusive : inclusive, span),
|
|
211
214
|
inclusive: side === "lower"
|
|
212
215
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
216
|
+
const [, day, hour, minute, second = "0", offset] = MOMENT.exec(value) ?? [];
|
|
217
|
+
if (day === void 0)
|
|
218
|
+
queryError("query.invalid-date", span, "use an ISO date, a date and time such as 2026-10-01T09:00 (optional seconds and offset), today, yesterday or 30m/2h/7d ago");
|
|
219
|
+
const moment = value.replace(" ", "T");
|
|
220
|
+
if (offset === void 0)
|
|
221
|
+
return { time: wallTime(moment, zone, span), inclusive };
|
|
222
|
+
calendar(day, span);
|
|
223
|
+
const time = Date.parse(moment);
|
|
224
|
+
if (!Number.isFinite(time) || Number(hour) > 23 || Number(minute) > 59 || Number(second) > 59)
|
|
218
225
|
queryError("query.invalid-date", span);
|
|
219
226
|
return { time, inclusive };
|
|
220
227
|
}, "dateEndpoint");
|
|
@@ -230,8 +237,8 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
|
|
|
230
237
|
};
|
|
231
238
|
}, "dateRange");
|
|
232
239
|
|
|
233
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
234
|
-
var wordsOf = /* @__PURE__ */ __name((
|
|
240
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/evaluate.js
|
|
241
|
+
var wordsOf = /* @__PURE__ */ __name((text6) => text6.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
|
|
235
242
|
var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
|
|
236
243
|
var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
|
|
237
244
|
var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
|
|
@@ -239,10 +246,10 @@ var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
|
|
|
239
246
|
return false;
|
|
240
247
|
if (node.operator === "wildcard" && node.value === "*")
|
|
241
248
|
return true;
|
|
242
|
-
const
|
|
249
|
+
const text6 = String(value);
|
|
243
250
|
switch (field.type) {
|
|
244
251
|
case "txt": {
|
|
245
|
-
const words2 = wordsOf(
|
|
252
|
+
const words2 = wordsOf(text6);
|
|
246
253
|
if (node.operator === "wildcard")
|
|
247
254
|
return words2.some((word) => pattern(node.value).test(word));
|
|
248
255
|
const wanted = wordsOf(node.value);
|
|
@@ -256,13 +263,13 @@ var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
|
|
|
256
263
|
return (lower === "*" || (lowerInclusive ? number2 >= Number(lower) : number2 > Number(lower))) && (upper === "*" || (upperInclusive ? number2 <= Number(upper) : number2 < Number(upper)));
|
|
257
264
|
}
|
|
258
265
|
case "time": {
|
|
259
|
-
const time = Date.parse(
|
|
266
|
+
const time = Date.parse(text6);
|
|
260
267
|
const [lower, upper, lowerInclusive, upperInclusive] = node.operator === "range" ? [node.value, node.upper ?? "*", node.lower_inclusive ?? true, node.upper_inclusive ?? true] : [node.value, node.value, true, true];
|
|
261
268
|
const range = dateRange(lower, upper, lowerInclusive, upperInclusive, options.zone ?? "UTC", node.span, options.now);
|
|
262
269
|
return (range.lower === void 0 || (range.lower_inclusive ? time >= range.lower : time > range.lower)) && (range.upper === void 0 || (range.upper_inclusive ? time <= range.upper : time < range.upper));
|
|
263
270
|
}
|
|
264
271
|
default:
|
|
265
|
-
return node.operator === "wildcard" ? pattern(node.value).test(
|
|
272
|
+
return node.operator === "wildcard" ? pattern(node.value).test(text6) : text6.toLowerCase() === node.value.toLowerCase();
|
|
266
273
|
}
|
|
267
274
|
}, "matchOne");
|
|
268
275
|
var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
|
|
@@ -285,7 +292,7 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
|
|
|
285
292
|
}, "matches");
|
|
286
293
|
var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
|
|
287
294
|
|
|
288
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
295
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/fields.js
|
|
289
296
|
var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
|
|
290
297
|
var OPERATORS_BY_TYPE = {
|
|
291
298
|
kw: ["term", "phrase", "wildcard"],
|
|
@@ -364,8 +371,8 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
|
|
|
364
371
|
return [...own, ...relations, ...states];
|
|
365
372
|
}, "queryFieldsOf");
|
|
366
373
|
|
|
367
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
368
|
-
var shownOf = /* @__PURE__ */ __name((
|
|
374
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/help.js
|
|
375
|
+
var shownOf = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "shownOf");
|
|
369
376
|
var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
|
|
370
377
|
var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
|
|
371
378
|
var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
@@ -376,32 +383,32 @@ var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
|
376
383
|
...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
|
|
377
384
|
].join(" \xB7 "), "syntaxOf");
|
|
378
385
|
var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
|
|
379
|
-
var fieldsHelp = /* @__PURE__ */ __name((
|
|
380
|
-
const shown = shownOf(
|
|
386
|
+
var fieldsHelp = /* @__PURE__ */ __name((registry, guide) => {
|
|
387
|
+
const shown = shownOf(registry);
|
|
381
388
|
const negatable = leftOut(shown);
|
|
382
389
|
const rows = shown.map((field) => [field.name, kindOf(field), field.example]);
|
|
383
390
|
const widths = [0, 1].map((at) => Math.max(...rows.map((row) => (row[at] ?? "").length)));
|
|
384
391
|
return [
|
|
385
392
|
"Fields:",
|
|
386
|
-
...rows.map(([name = "",
|
|
387
|
-
...
|
|
393
|
+
...rows.map(([name = "", kind2 = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind2.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
|
|
394
|
+
...registry.defaults && registry.defaults.length > 0 ? [`Defaults: ${registry.defaults.join(" ")} \u2014 name the field to change it`] : [],
|
|
388
395
|
...negatable.length > 0 ? [`Leave out: -${negatable[0]}:value or NOT ${negatable[0]}:value, for ${negatable.join(", ")}`] : [],
|
|
389
|
-
`Syntax: ${syntaxOf(shown,
|
|
396
|
+
`Syntax: ${syntaxOf(shown, registry.backend)}`,
|
|
390
397
|
...guide ? [`Guide: ${guide}`] : []
|
|
391
398
|
].join("\n");
|
|
392
399
|
}, "fieldsHelp");
|
|
393
|
-
var queryDescription = /* @__PURE__ */ __name((
|
|
394
|
-
const shown = shownOf(
|
|
400
|
+
var queryDescription = /* @__PURE__ */ __name((registry) => {
|
|
401
|
+
const shown = shownOf(registry);
|
|
395
402
|
if (shown.length === 0)
|
|
396
403
|
return "field:value terms; this list filters by none yet, so any term is refused";
|
|
397
404
|
const negatable = leftOut(shown);
|
|
398
|
-
const terms =
|
|
405
|
+
const terms = registry.backend === "native" ? `field:value terms joined by AND that narrow the list${negatable.length > 0 ? `; -field:value or NOT field:value leaves out what matches, for ${negatable.join(", ")} only` : ""}` : `field:value terms that narrow the list (Lucene: AND OR NOT, -field:value${has(shown, "range") ? ", [a TO b], > <" : ""})`;
|
|
399
406
|
const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
|
|
400
|
-
const defaults =
|
|
407
|
+
const defaults = registry.defaults?.length ? `; unless named: ${registry.defaults.join(" ")}` : "";
|
|
401
408
|
return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
|
|
402
409
|
}, "queryDescription");
|
|
403
410
|
|
|
404
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
411
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/parser.js
|
|
405
412
|
var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
|
|
406
413
|
var reserved = /* @__PURE__ */ new Set([
|
|
407
414
|
"+",
|
|
@@ -444,46 +451,46 @@ var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail) => {
|
|
|
444
451
|
}
|
|
445
452
|
return out;
|
|
446
453
|
}, "decodeEscapes");
|
|
447
|
-
var tokensOf = /* @__PURE__ */ __name((
|
|
454
|
+
var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
448
455
|
const tokens = [];
|
|
449
456
|
let at = 0;
|
|
450
457
|
let range = false;
|
|
451
|
-
while (at <
|
|
458
|
+
while (at < text6.length) {
|
|
452
459
|
const start = at;
|
|
453
|
-
const c =
|
|
460
|
+
const c = text6[at] ?? "";
|
|
454
461
|
if (whitespace(c)) {
|
|
455
462
|
at++;
|
|
456
463
|
continue;
|
|
457
464
|
}
|
|
458
|
-
let
|
|
465
|
+
let kind2 = c;
|
|
459
466
|
if (c === '"' || !range && c === "/") {
|
|
460
467
|
at++;
|
|
461
|
-
while (at <
|
|
462
|
-
if (
|
|
468
|
+
while (at < text6.length && text6[at] !== c) {
|
|
469
|
+
if (text6[at] === "\\" && (c === '"' || text6[at + 1] === "/"))
|
|
463
470
|
at++;
|
|
464
471
|
at++;
|
|
465
472
|
}
|
|
466
|
-
if (at >=
|
|
467
|
-
fail("query.unclosed-literal", { start, end: at }, c === "/" ? regexHint(
|
|
473
|
+
if (at >= text6.length)
|
|
474
|
+
fail("query.unclosed-literal", { start, end: at }, c === "/" ? regexHint(text6, start) : void 0);
|
|
468
475
|
at++;
|
|
469
|
-
if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(
|
|
476
|
+
if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(text6.slice(at)))
|
|
470
477
|
fail("query.unsupported-regex-flags", { start: at, end: at + 1 }, "Lucene regex does not take JavaScript flags");
|
|
471
|
-
|
|
478
|
+
kind2 = c === '"' ? "quoted" : "regex";
|
|
472
479
|
} else if (range && c !== "]" && c !== "}") {
|
|
473
|
-
while (at <
|
|
480
|
+
while (at < text6.length && !whitespace(text6[at] ?? "") && !["]", "}"].includes(text6[at] ?? ""))
|
|
474
481
|
at++;
|
|
475
|
-
|
|
482
|
+
kind2 = "rangeValue";
|
|
476
483
|
} else if (reserved.has(c)) {
|
|
477
484
|
if (c === "\\") {
|
|
478
485
|
at += 2;
|
|
479
|
-
while (at <
|
|
486
|
+
while (at < text6.length && !whitespace(text6[at] ?? "") && (!reserved.has(text6[at] ?? "") || ["+", "-"].includes(text6[at] ?? "")))
|
|
480
487
|
at++;
|
|
481
|
-
|
|
488
|
+
kind2 = "term";
|
|
482
489
|
} else {
|
|
483
490
|
at++;
|
|
484
|
-
if ((c === "<" || c === ">") &&
|
|
491
|
+
if ((c === "<" || c === ">") && text6[at] === "=") {
|
|
485
492
|
at++;
|
|
486
|
-
|
|
493
|
+
kind2 += "=";
|
|
487
494
|
}
|
|
488
495
|
if (c === "[" || c === "{")
|
|
489
496
|
range = true;
|
|
@@ -492,15 +499,15 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
|
|
|
492
499
|
}
|
|
493
500
|
} else {
|
|
494
501
|
at++;
|
|
495
|
-
while (at <
|
|
496
|
-
const next =
|
|
502
|
+
while (at < text6.length) {
|
|
503
|
+
const next = text6[at] ?? "";
|
|
497
504
|
if (next === "\\") {
|
|
498
|
-
if (at + 1 >=
|
|
505
|
+
if (at + 1 >= text6.length)
|
|
499
506
|
fail("query.invalid-escape", { start: at, end: at + 1 });
|
|
500
507
|
at += 2;
|
|
501
508
|
continue;
|
|
502
509
|
}
|
|
503
|
-
if (next === "@" && new RegExp("^@(?:\\p{L}|[\\p{L}\\p{N}][^\\s@]*\\.[\\p{L}\\p{N}])", "u").test(
|
|
510
|
+
if (next === "@" && new RegExp("^@(?:\\p{L}|[\\p{L}\\p{N}][^\\s@]*\\.[\\p{L}\\p{N}])", "u").test(text6.slice(at))) {
|
|
504
511
|
at++;
|
|
505
512
|
continue;
|
|
506
513
|
}
|
|
@@ -509,19 +516,19 @@ var tokensOf = /* @__PURE__ */ __name((text5, fail = queryError) => {
|
|
|
509
516
|
at++;
|
|
510
517
|
}
|
|
511
518
|
const [field, colon] = tokens.slice(-2);
|
|
512
|
-
if (field?.kind === "term" && colon?.kind === ":" && colon.span.end === start &&
|
|
513
|
-
while (at <
|
|
519
|
+
if (field?.kind === "term" && colon?.kind === ":" && colon.span.end === start && text6[at] === ":" && /^[a-z][a-z_-]*$/u.test(text6.slice(start, at)) && /^:[^\s()"]/u.test(text6.slice(at)))
|
|
520
|
+
while (at < text6.length && !whitespace(text6[at] ?? "") && !["(", ")", '"'].includes(text6[at] ?? ""))
|
|
514
521
|
at++;
|
|
515
|
-
const raw =
|
|
516
|
-
|
|
522
|
+
const raw = text6.slice(start, at);
|
|
523
|
+
kind2 = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
|
|
517
524
|
}
|
|
518
|
-
tokens.push({ kind:
|
|
525
|
+
tokens.push({ kind: kind2, raw: text6.slice(start, at), span: { start, end: at } });
|
|
519
526
|
}
|
|
520
527
|
tokens.push({ kind: "EOF", raw: "", span: { start: at, end: at } });
|
|
521
528
|
return tokens;
|
|
522
529
|
}, "tokensOf");
|
|
523
|
-
var quoteHint = /* @__PURE__ */ __name((
|
|
524
|
-
for (const match of
|
|
530
|
+
var quoteHint = /* @__PURE__ */ __name((text6, at) => {
|
|
531
|
+
for (const match of text6.matchAll(/(?<=^|[\s(])([\p{L}\p{N}_.-]+):([^\s"()]+)/gu)) {
|
|
525
532
|
const [whole, field, value = ""] = match;
|
|
526
533
|
if (at < match.index || at > match.index + whole.length)
|
|
527
534
|
continue;
|
|
@@ -529,27 +536,27 @@ var quoteHint = /* @__PURE__ */ __name((text5, at) => {
|
|
|
529
536
|
}
|
|
530
537
|
return void 0;
|
|
531
538
|
}, "quoteHint");
|
|
532
|
-
var regexHint = /* @__PURE__ */ __name((
|
|
533
|
-
const word = `${/[^\s()"]*$/u.exec(
|
|
534
|
-
return quoteHint(
|
|
539
|
+
var regexHint = /* @__PURE__ */ __name((text6, at) => {
|
|
540
|
+
const word = `${/[^\s()"]*$/u.exec(text6.slice(0, at))?.[0] ?? ""}${/^[^\s()"]*/u.exec(text6.slice(at))?.[0] ?? ""}`;
|
|
541
|
+
return quoteHint(text6, at) ?? `/ starts a regular expression; put the value in quotes: "${word}"`;
|
|
535
542
|
}, "regexHint");
|
|
536
|
-
var parseLucene = /* @__PURE__ */ __name((
|
|
537
|
-
const fail = /* @__PURE__ */ __name((reason, span, alternative) => queryError(reason, span, alternative ?? quoteHint(
|
|
538
|
-
if (
|
|
539
|
-
fail("query.too-large", { start: 0, end:
|
|
540
|
-
const tokens = tokensOf(
|
|
543
|
+
var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proximity = false, ...context3 } = {}) => {
|
|
544
|
+
const fail = /* @__PURE__ */ __name((reason, span, alternative) => queryError(reason, span, alternative ?? quoteHint(text6, span.start), context3), "fail");
|
|
545
|
+
if (text6.length > QUERY_LIMITS.bytes || new TextEncoder().encode(text6).length > QUERY_LIMITS.bytes)
|
|
546
|
+
fail("query.too-large", { start: 0, end: text6.length });
|
|
547
|
+
const tokens = tokensOf(text6, fail);
|
|
541
548
|
let at = 0;
|
|
542
|
-
let
|
|
549
|
+
let count7 = 0;
|
|
543
550
|
let depth = 0;
|
|
544
551
|
const peek = /* @__PURE__ */ __name(() => tokens[at], "peek");
|
|
545
552
|
const take = /* @__PURE__ */ __name(() => tokens[at++], "take");
|
|
546
|
-
const expect = /* @__PURE__ */ __name((
|
|
547
|
-
if (peek().kind !==
|
|
553
|
+
const expect = /* @__PURE__ */ __name((kind2) => {
|
|
554
|
+
if (peek().kind !== kind2)
|
|
548
555
|
fail("query.invalid-syntax", peek().span);
|
|
549
556
|
return take();
|
|
550
557
|
}, "expect");
|
|
551
558
|
const built = /* @__PURE__ */ __name((node) => {
|
|
552
|
-
if (++
|
|
559
|
+
if (++count7 > QUERY_LIMITS.nodes)
|
|
553
560
|
fail("query.too-large", node.span);
|
|
554
561
|
return node;
|
|
555
562
|
}, "built");
|
|
@@ -616,14 +623,14 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
|
|
|
616
623
|
const value = take();
|
|
617
624
|
if (!["term", "number", "quoted"].includes(value.kind))
|
|
618
625
|
fail("query.invalid-syntax", value.span);
|
|
619
|
-
const
|
|
626
|
+
const decoded = decodeEscapes(value.kind === "quoted" ? value.raw.slice(1, -1) : value.raw, value.span, fail);
|
|
620
627
|
const lower = operator.kind.startsWith(">");
|
|
621
628
|
const node2 = built({
|
|
622
629
|
kind: "predicate",
|
|
623
630
|
field,
|
|
624
631
|
operator: "range",
|
|
625
|
-
value: lower ?
|
|
626
|
-
upper: lower ? "*" :
|
|
632
|
+
value: lower ? decoded : "*",
|
|
633
|
+
upper: lower ? "*" : decoded,
|
|
627
634
|
lower_inclusive: !lower || operator.kind.endsWith("="),
|
|
628
635
|
upper_inclusive: lower || operator.kind.endsWith("="),
|
|
629
636
|
span: { start: token.span.start, end: value.span.end }
|
|
@@ -681,10 +688,10 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
|
|
|
681
688
|
}
|
|
682
689
|
if (proximity && peek().kind === "~" && node.kind === "predicate" && node.operator === "phrase") {
|
|
683
690
|
take();
|
|
684
|
-
const
|
|
685
|
-
if (
|
|
686
|
-
fail("query.invalid-syntax",
|
|
687
|
-
node = { ...node, slop: Number(
|
|
691
|
+
const distance = take();
|
|
692
|
+
if (distance.kind !== "number" || !/^\d+$/u.test(distance.raw))
|
|
693
|
+
fail("query.invalid-syntax", distance.span, 'write the distance as a whole number: "a b"~3');
|
|
694
|
+
node = { ...node, slop: Number(distance.raw), span: { start: node.span.start, end: distance.span.end } };
|
|
688
695
|
}
|
|
689
696
|
if (peek().kind === "~")
|
|
690
697
|
fail("query.unsupported-operator", peek().span, node.kind === "predicate" && node.operator === "phrase" ? "proximity (~) is not supported \u2014 drop the ~ for the exact phrase, or join the words with AND" : "fuzzy matching (~) is not supported \u2014 use a prefix such as word* to catch word forms");
|
|
@@ -703,14 +710,14 @@ var parseLucene = /* @__PURE__ */ __name((text5, { defaultField = "text", proxim
|
|
|
703
710
|
}
|
|
704
711
|
return { version: 1, language: "lucene-v1", root };
|
|
705
712
|
}, "parseLucene");
|
|
706
|
-
var implicitTextTerms = /* @__PURE__ */ __name((
|
|
707
|
-
const tokens = tokensOf(
|
|
708
|
-
if (tokens.some(({ kind:
|
|
713
|
+
var implicitTextTerms = /* @__PURE__ */ __name((text6) => {
|
|
714
|
+
const tokens = tokensOf(text6);
|
|
715
|
+
if (tokens.some(({ kind: kind2 }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind2)))
|
|
709
716
|
return /* @__PURE__ */ new Set();
|
|
710
717
|
return new Set(tokens.flatMap((token, index) => (token.kind === "term" || token.kind === "number") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index - 1]?.kind ?? "") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index + 1]?.kind ?? "") ? [token.span.start] : []));
|
|
711
718
|
}, "implicitTextTerms");
|
|
712
719
|
|
|
713
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
720
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/validate.js
|
|
714
721
|
var inContext = /* @__PURE__ */ __name((context3, run2) => {
|
|
715
722
|
try {
|
|
716
723
|
run2();
|
|
@@ -752,8 +759,8 @@ var checkValue = /* @__PURE__ */ __name((field, node, options) => {
|
|
|
752
759
|
return;
|
|
753
760
|
}
|
|
754
761
|
}, "checkValue");
|
|
755
|
-
var validateQuery = /* @__PURE__ */ __name((ast,
|
|
756
|
-
const byName = new Map(
|
|
762
|
+
var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
|
|
763
|
+
const byName = new Map(registry.fields.map((field) => [field.name, field]));
|
|
757
764
|
const visit = /* @__PURE__ */ __name((node, required) => {
|
|
758
765
|
if (node.kind === "boolean") {
|
|
759
766
|
for (const clause of node.clauses)
|
|
@@ -763,11 +770,11 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry2, options = {}) => {
|
|
|
763
770
|
const field = byName.get(node.field);
|
|
764
771
|
if (!field)
|
|
765
772
|
queryError("query.unknown-field", node.span, `no field "${node.field}"`, options, {
|
|
766
|
-
fields:
|
|
773
|
+
fields: registry.fields.map((one) => one.name)
|
|
767
774
|
});
|
|
768
|
-
if (
|
|
775
|
+
if (registry.backend === "native" && !field.native)
|
|
769
776
|
queryError("query.unsupported-field", node.span, `the source cannot filter by ${field.name}`, options, {
|
|
770
|
-
supported:
|
|
777
|
+
supported: registry.fields.filter((one) => one.native).map((one) => one.name)
|
|
771
778
|
});
|
|
772
779
|
const presence = node.operator === "wildcard" && node.value === "*";
|
|
773
780
|
if (!presence && !field.operators.includes(node.operator))
|
|
@@ -785,48 +792,48 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry2, options = {}) => {
|
|
|
785
792
|
}, "validateQuery");
|
|
786
793
|
var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
|
|
787
794
|
|
|
788
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
789
|
-
var describeQuery = /* @__PURE__ */ __name((
|
|
790
|
-
entity:
|
|
791
|
-
backend:
|
|
792
|
-
fields:
|
|
793
|
-
...
|
|
795
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/registry.js
|
|
796
|
+
var describeQuery = /* @__PURE__ */ __name((registry) => ({
|
|
797
|
+
entity: registry.entity,
|
|
798
|
+
backend: registry.backend,
|
|
799
|
+
fields: registry.fields.map(({ validate: _, ...field }) => field),
|
|
800
|
+
...registry.defaults && registry.defaults.length > 0 ? { defaults: [...registry.defaults] } : {}
|
|
794
801
|
}), "describeQuery");
|
|
795
|
-
var exampleProblems = /* @__PURE__ */ __name((
|
|
796
|
-
const syntaxOnly = { ...
|
|
797
|
-
const problem = /* @__PURE__ */ __name((
|
|
802
|
+
var exampleProblems = /* @__PURE__ */ __name((registry) => {
|
|
803
|
+
const syntaxOnly = { ...registry, backend: "sql" };
|
|
804
|
+
const problem = /* @__PURE__ */ __name((text6, field) => {
|
|
798
805
|
try {
|
|
799
|
-
const named = walkQuery(validateQuery(parseLucene(
|
|
800
|
-
return named.every((node) => node.field === field) ? void 0 : `"${
|
|
806
|
+
const named = walkQuery(validateQuery(parseLucene(text6, { defaultField: "none" }), syntaxOnly).root);
|
|
807
|
+
return named.every((node) => node.field === field) ? void 0 : `"${text6}" does not name ${field}`;
|
|
801
808
|
} catch (failure) {
|
|
802
809
|
if (!isCliError(failure))
|
|
803
810
|
throw failure;
|
|
804
|
-
return `"${
|
|
811
|
+
return `"${text6}": ${failure.message}`;
|
|
805
812
|
}
|
|
806
813
|
}, "problem");
|
|
807
|
-
const defaults = (
|
|
814
|
+
const defaults = (registry.defaults ?? []).map((term) => {
|
|
808
815
|
const field = term.replace(/^-/, "").split(/[:<>=]/)[0] ?? "";
|
|
809
816
|
return { field, problem: problem(term.replace(/^-/, ""), field) };
|
|
810
817
|
});
|
|
811
818
|
return [
|
|
812
|
-
...
|
|
819
|
+
...registry.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
|
|
813
820
|
...defaults
|
|
814
821
|
].filter((entry) => entry.problem !== void 0);
|
|
815
822
|
}, "exampleProblems");
|
|
816
823
|
var checked = /* @__PURE__ */ new WeakSet();
|
|
817
|
-
var defineQuery = /* @__PURE__ */ __name((
|
|
818
|
-
if (checked.has(
|
|
819
|
-
return
|
|
820
|
-
const names =
|
|
824
|
+
var defineQuery = /* @__PURE__ */ __name((registry) => {
|
|
825
|
+
if (checked.has(registry))
|
|
826
|
+
return registry;
|
|
827
|
+
const names = registry.fields.map((field) => field.name);
|
|
821
828
|
const problems = [
|
|
822
829
|
...duplicates(names).map((name) => `"${name}" is listed twice`),
|
|
823
830
|
...names.filter((name) => !SNAKE_CASE.test(name)).map((name) => `"${name}" is not snake_case`),
|
|
824
|
-
...exampleProblems(
|
|
831
|
+
...exampleProblems(registry).map(({ field, problem }) => `${field}: ${problem}`)
|
|
825
832
|
];
|
|
826
833
|
if (problems.length > 0)
|
|
827
|
-
throw new RegistryError(`${
|
|
828
|
-
checked.add(
|
|
829
|
-
return
|
|
834
|
+
throw new RegistryError(`${registry.entity} query`, problems);
|
|
835
|
+
checked.add(registry);
|
|
836
|
+
return registry;
|
|
830
837
|
}, "defineQuery");
|
|
831
838
|
var SPAN = ["span", "alternative", "guide"];
|
|
832
839
|
var QUERY_REASONS = defineReasons([
|
|
@@ -856,7 +863,7 @@ var QUERY_REASONS = defineReasons([
|
|
|
856
863
|
details: [...SPAN, ...details]
|
|
857
864
|
})));
|
|
858
865
|
|
|
859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/search/service-query.js
|
|
860
867
|
var BACKENDS = ["archive", "server", "both"];
|
|
861
868
|
var MAX_BRANCHES = 64;
|
|
862
869
|
var some = /* @__PURE__ */ __name((value) => value === void 0 ? [] : [value], "some");
|
|
@@ -891,8 +898,11 @@ var windowOf = /* @__PURE__ */ __name(({ lower, upper, lower_inclusive, upper_in
|
|
|
891
898
|
...lower === void 0 ? {} : { from: lower_inclusive ? lower : lower + 1 },
|
|
892
899
|
...upper === void 0 ? {} : { to: upper_inclusive ? upper : upper - 1 }
|
|
893
900
|
}), "windowOf");
|
|
901
|
+
var RELATIVE_TIME = /^\d+[mhd]$/i;
|
|
902
|
+
var OFFSET = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
903
|
+
var readsZone = /* @__PURE__ */ __name((ast, times) => walkQuery(ast.root).some((term) => times.has(term.field) && [term.value, term.upper].some((value) => value !== void 0 && value !== "*" && !RELATIVE_TIME.test(value) && !OFFSET.test(value))), "readsZone");
|
|
894
904
|
|
|
895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/reference.js
|
|
896
906
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
897
907
|
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
898
908
|
if (!Number.isSafeInteger(value) || value < minimum)
|
|
@@ -900,24 +910,24 @@ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
|
900
910
|
return value;
|
|
901
911
|
}, "integer");
|
|
902
912
|
var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
|
|
903
|
-
const
|
|
913
|
+
const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
|
|
904
914
|
if (reference2.transcriptId !== void 0)
|
|
905
|
-
|
|
915
|
+
parts.push(integer2(reference2.transcriptId));
|
|
906
916
|
if (reference2.cuePosition !== void 0) {
|
|
907
917
|
if (reference2.transcriptId === void 0)
|
|
908
918
|
throw invalid();
|
|
909
|
-
|
|
919
|
+
parts.push(integer2(reference2.cuePosition, 0));
|
|
910
920
|
}
|
|
911
|
-
return `meeting:${
|
|
921
|
+
return `meeting:${parts.join("/")}`;
|
|
912
922
|
}, "formatMeetingReference");
|
|
913
|
-
var parseMeetingReference = /* @__PURE__ */ __name((
|
|
914
|
-
const value =
|
|
923
|
+
var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
|
|
924
|
+
const value = text6.trim();
|
|
915
925
|
if (!value.startsWith("meeting:"))
|
|
916
926
|
throw invalid();
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
927
|
+
const parts = value.slice(8).split("/");
|
|
928
|
+
if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
|
|
919
929
|
throw invalid();
|
|
920
|
-
const ids2 =
|
|
930
|
+
const ids2 = parts.map(Number);
|
|
921
931
|
const reference2 = {
|
|
922
932
|
type: "meeting",
|
|
923
933
|
accountId: integer2(ids2[0]),
|
|
@@ -927,9 +937,9 @@ var parseMeetingReference = /* @__PURE__ */ __name((text5) => {
|
|
|
927
937
|
};
|
|
928
938
|
return reference2;
|
|
929
939
|
}, "parseMeetingReference");
|
|
930
|
-
var canonicalMeetingReference = /* @__PURE__ */ __name((
|
|
940
|
+
var canonicalMeetingReference = /* @__PURE__ */ __name((text6) => formatMeetingReference(parseMeetingReference(text6)), "canonicalMeetingReference");
|
|
931
941
|
|
|
932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
942
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/payment.js
|
|
933
943
|
var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
934
944
|
var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
|
|
935
945
|
var PAYMENT_STATES = ["expected", "paid", "cancelled"];
|
|
@@ -1023,7 +1033,122 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
|
|
|
1023
1033
|
return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
|
|
1024
1034
|
}, "paymentTitle");
|
|
1025
1035
|
|
|
1026
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
1037
|
+
var context = {
|
|
1038
|
+
command: "search meetings",
|
|
1039
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
1040
|
+
};
|
|
1041
|
+
var words = ["term", "phrase"];
|
|
1042
|
+
var MOST_LINES_APART = 20;
|
|
1043
|
+
var near = /* @__PURE__ */ __name((node) => {
|
|
1044
|
+
if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
|
|
1045
|
+
queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
|
|
1046
|
+
}, "near");
|
|
1047
|
+
var MEETING_HIT_QUERY = defineQuery({
|
|
1048
|
+
entity: "meeting_hit",
|
|
1049
|
+
backend: "sql",
|
|
1050
|
+
fields: [
|
|
1051
|
+
{
|
|
1052
|
+
name: "text",
|
|
1053
|
+
type: "txt",
|
|
1054
|
+
operators: words,
|
|
1055
|
+
example: "text:budget",
|
|
1056
|
+
relation: "a passage with the word in any form, or a spelling speech recognition garbled",
|
|
1057
|
+
validate: near
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: "exact",
|
|
1061
|
+
type: "txt",
|
|
1062
|
+
operators: words,
|
|
1063
|
+
example: "exact:budget",
|
|
1064
|
+
relation: "a passage with the word as typed: no other forms, no garbled spellings",
|
|
1065
|
+
validate: near
|
|
1066
|
+
},
|
|
1067
|
+
{
|
|
1068
|
+
name: "from",
|
|
1069
|
+
type: "kw",
|
|
1070
|
+
operators: words,
|
|
1071
|
+
example: 'from:"Alice Synthetic"',
|
|
1072
|
+
relation: "a line said or a chat message written by this person; attendance is --identity-id"
|
|
1073
|
+
}
|
|
1074
|
+
]
|
|
1075
|
+
});
|
|
1076
|
+
var MEETING_FIELDS = defineQuery({
|
|
1077
|
+
entity: "meeting_hit",
|
|
1078
|
+
backend: "sql",
|
|
1079
|
+
fields: [
|
|
1080
|
+
...MEETING_HIT_QUERY.fields,
|
|
1081
|
+
{
|
|
1082
|
+
name: "date",
|
|
1083
|
+
type: "time",
|
|
1084
|
+
operators: ["term", "range"],
|
|
1085
|
+
example: "date>=30d",
|
|
1086
|
+
relation: "meetings that started then; the same as --since-time and --until-time"
|
|
1087
|
+
},
|
|
1088
|
+
...["project", "tag", "topic"].map((name) => ({
|
|
1089
|
+
name,
|
|
1090
|
+
type: "kw",
|
|
1091
|
+
operators: words,
|
|
1092
|
+
example: `${name}:"Example name"`,
|
|
1093
|
+
relation: `meetings in this ${name}, by name or alias; the same as --${name}`
|
|
1094
|
+
}))
|
|
1095
|
+
]
|
|
1096
|
+
});
|
|
1097
|
+
var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
|
|
1098
|
+
var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
|
|
1099
|
+
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
|
|
1100
|
+
let ast;
|
|
1101
|
+
try {
|
|
1102
|
+
ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
|
|
1103
|
+
} catch (error) {
|
|
1104
|
+
if (error instanceof CliError)
|
|
1105
|
+
return { query, request };
|
|
1106
|
+
throw error;
|
|
1107
|
+
}
|
|
1108
|
+
const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
|
|
1109
|
+
const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
|
|
1110
|
+
const misplaced = /* @__PURE__ */ __name((node, nested) => node.kind === "predicate" ? nested && LIFTED.has(node.field) ? node : void 0 : node.clauses.map((clause) => misplaced(clause.node, true)).find(Boolean), "misplaced");
|
|
1111
|
+
const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
|
|
1112
|
+
if (wrong)
|
|
1113
|
+
queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
|
|
1114
|
+
if (!lifted.length)
|
|
1115
|
+
return { query, request };
|
|
1116
|
+
const next = { ...request };
|
|
1117
|
+
const once = /* @__PURE__ */ __name((name, flag2) => {
|
|
1118
|
+
if (next[name] !== void 0)
|
|
1119
|
+
throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
|
|
1120
|
+
}, "once");
|
|
1121
|
+
for (const { node } of lifted) {
|
|
1122
|
+
if (node.field === "date") {
|
|
1123
|
+
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
|
|
1124
|
+
if (range.lower !== void 0) {
|
|
1125
|
+
once("since", "--since-time");
|
|
1126
|
+
next.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
1127
|
+
}
|
|
1128
|
+
if (range.upper !== void 0) {
|
|
1129
|
+
once("until", "--until-time");
|
|
1130
|
+
next.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
1131
|
+
}
|
|
1132
|
+
} else {
|
|
1133
|
+
const field = node.field;
|
|
1134
|
+
once(field, `--${field}`);
|
|
1135
|
+
next[field] = node.value;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
let rest = query;
|
|
1139
|
+
for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
|
|
1140
|
+
rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
|
|
1141
|
+
rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
|
|
1142
|
+
if (!rest)
|
|
1143
|
+
throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
|
|
1144
|
+
return { query: rest, request: next };
|
|
1145
|
+
}, "liftMeetingFields");
|
|
1146
|
+
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
1147
|
+
|
|
1148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/model.js
|
|
1149
|
+
var MEETING_CALL_DIRECTIONS = ["in", "out"];
|
|
1150
|
+
|
|
1151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
1027
1152
|
var text = string();
|
|
1028
1153
|
var count = pipe(number(), integer(), minValue(0));
|
|
1029
1154
|
var MEETING_ISSUES = ["time_without_zone"];
|
|
@@ -1031,6 +1156,12 @@ var meetingIssuesOf = /* @__PURE__ */ __name((metadata) => {
|
|
|
1031
1156
|
const listed2 = metadata?.issues;
|
|
1032
1157
|
return Array.isArray(listed2) ? MEETING_ISSUES.filter((issue) => listed2.includes(issue)) : [];
|
|
1033
1158
|
}, "meetingIssuesOf");
|
|
1159
|
+
var meetingCall = strictObject({
|
|
1160
|
+
direction: nullable(picklist(MEETING_CALL_DIRECTIONS)),
|
|
1161
|
+
manager: nullable(strictObject({ name: nullable(text), person: nullable(reference) })),
|
|
1162
|
+
client_phone: nullable(text)
|
|
1163
|
+
});
|
|
1164
|
+
var meetingCallItem = /* @__PURE__ */ __name((row) => row.direction == null && row.clientPhone == null ? void 0 : { direction: row.direction ?? null, manager: row.manager ?? null, client_phone: row.clientPhone ?? null }, "meetingCallItem");
|
|
1034
1165
|
var meetingEntries = {
|
|
1035
1166
|
ref: reference,
|
|
1036
1167
|
id: pipe(string(), minLength(1)),
|
|
@@ -1048,6 +1179,8 @@ var meetingEntries = {
|
|
|
1048
1179
|
duration_ms: nullable(count),
|
|
1049
1180
|
timezone: optional(nullable(text)),
|
|
1050
1181
|
participants_count: nullable(count),
|
|
1182
|
+
/** Present only on a phone call. */
|
|
1183
|
+
call: optional(meetingCall),
|
|
1051
1184
|
/** Present only when something about this meeting is doubtful. */
|
|
1052
1185
|
issues: optional(array(picklist(MEETING_ISSUES))),
|
|
1053
1186
|
/**
|
|
@@ -1062,9 +1195,10 @@ var meetingEntries = {
|
|
|
1062
1195
|
};
|
|
1063
1196
|
var meeting = strictObject(meetingEntries);
|
|
1064
1197
|
var MEETING_UNTRUSTED = ["title", "description", "location"];
|
|
1065
|
-
var iso = /* @__PURE__ */ __name((
|
|
1198
|
+
var iso = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
|
|
1066
1199
|
var meetingItem = /* @__PURE__ */ __name((row, owner) => {
|
|
1067
1200
|
const issues = meetingIssuesOf(row.metadata);
|
|
1201
|
+
const call = meetingCallItem(row);
|
|
1068
1202
|
return {
|
|
1069
1203
|
ref: formatMeetingReference({ type: "meeting", accountId: row.accountId, meetingId: row.id }),
|
|
1070
1204
|
id: String(row.id),
|
|
@@ -1080,6 +1214,7 @@ var meetingItem = /* @__PURE__ */ __name((row, owner) => {
|
|
|
1080
1214
|
duration_ms: row.durationMs,
|
|
1081
1215
|
timezone: row.timezone,
|
|
1082
1216
|
participants_count: row.participantsCount,
|
|
1217
|
+
...call ? { call } : {},
|
|
1083
1218
|
...issues.length ? { issues } : {},
|
|
1084
1219
|
untrusted: [...MEETING_UNTRUSTED],
|
|
1085
1220
|
created_at: new Date(row.createdAt).toISOString(),
|
|
@@ -1113,14 +1248,22 @@ var MEETING_QUERY = {
|
|
|
1113
1248
|
})
|
|
1114
1249
|
};
|
|
1115
1250
|
|
|
1116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/store.js
|
|
1117
1252
|
var MEETING_DOCUMENT_ROLES = ["transcript", "recording", "notes"];
|
|
1253
|
+
var TRANSCRIPT_WORDS = [
|
|
1254
|
+
"Transcript",
|
|
1255
|
+
"Notes by Gemini",
|
|
1256
|
+
"\u0422\u0440\u0430\u043D\u0441\u043A\u0440\u0438\u043F\u0442",
|
|
1257
|
+
"\u0417\u0430\u043C\u0435\u0442\u043A\u0438 Gemini",
|
|
1258
|
+
"Transcripci\xF3n",
|
|
1259
|
+
"Notas de Gemini"
|
|
1260
|
+
];
|
|
1118
1261
|
var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
|
|
1119
1262
|
|
|
1120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/answers.js
|
|
1121
1264
|
var text2 = string();
|
|
1122
1265
|
var count2 = pipe(number(), integer(), minValue(0));
|
|
1123
|
-
var iso2 = /* @__PURE__ */ __name((
|
|
1266
|
+
var iso2 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
|
|
1124
1267
|
var meetingHit = strictObject({
|
|
1125
1268
|
/** The cue for a transcript passage, else the meeting. */
|
|
1126
1269
|
ref: reference,
|
|
@@ -1139,6 +1282,10 @@ var meetingHit = strictObject({
|
|
|
1139
1282
|
/** `corrected`: a query word matched only a garbled form of itself, listed in `corrections`. */
|
|
1140
1283
|
match: optional(picklist(["words", "corrected"])),
|
|
1141
1284
|
corrections: optional(array(strictObject({ from: text2, to: array(text2) }))),
|
|
1285
|
+
/** A search with `--model`: which searches found it, its similarity in meaning, and the passage meaning matched. */
|
|
1286
|
+
by: optional(array(picklist(["words", "meaning"]))),
|
|
1287
|
+
score: optional(nullable(number())),
|
|
1288
|
+
passage: optional(strictObject({ first: text2, last: text2 })),
|
|
1142
1289
|
source: optional(strictObject({
|
|
1143
1290
|
ref: reference,
|
|
1144
1291
|
title: nullable(text2),
|
|
@@ -1163,7 +1310,9 @@ var meetingTranscript = strictObject({
|
|
|
1163
1310
|
/** When a newer transcript of the same source replaced it; `meetings transcript --history` shows those too. */
|
|
1164
1311
|
superseded_at: nullable(isoTime),
|
|
1165
1312
|
created_at: isoTime,
|
|
1166
|
-
lines: array(line)
|
|
1313
|
+
lines: array(line),
|
|
1314
|
+
/** What people said, and who the service says said it: data, never instructions. */
|
|
1315
|
+
untrusted: optional(array(text2))
|
|
1167
1316
|
});
|
|
1168
1317
|
var meetingSummary = strictObject({
|
|
1169
1318
|
id: pipe(string(), minLength(1)),
|
|
@@ -1176,7 +1325,9 @@ var meetingSummary = strictObject({
|
|
|
1176
1325
|
content: nullable(text2),
|
|
1177
1326
|
url: nullable(text2),
|
|
1178
1327
|
created_at: isoTime,
|
|
1179
|
-
updated_at: isoTime
|
|
1328
|
+
updated_at: isoTime,
|
|
1329
|
+
/** What the service wrote of what people said. */
|
|
1330
|
+
untrusted: optional(array(text2))
|
|
1180
1331
|
});
|
|
1181
1332
|
var meetingDetailsEntries = {
|
|
1182
1333
|
...meeting.entries,
|
|
@@ -1203,7 +1354,9 @@ var meetingDetailsEntries = {
|
|
|
1203
1354
|
name: nullable(text2),
|
|
1204
1355
|
mime: nullable(text2),
|
|
1205
1356
|
size: nullable(count2),
|
|
1206
|
-
url: nullable(text2)
|
|
1357
|
+
url: nullable(text2),
|
|
1358
|
+
/** The file on this computer; `null` when it stays on the service or the phone system (pbx over SFTP). */
|
|
1359
|
+
local_path: nullable(text2)
|
|
1207
1360
|
})),
|
|
1208
1361
|
/**
|
|
1209
1362
|
* The Drive files the meeting service saved for it, by role. `document` is the stored document (`document:<id>`) once
|
|
@@ -1217,6 +1370,20 @@ var meetingDetailsEntries = {
|
|
|
1217
1370
|
}))
|
|
1218
1371
|
};
|
|
1219
1372
|
var meetingDetails = strictObject(meetingDetailsEntries);
|
|
1373
|
+
var TRANSCRIPT_UNTRUSTED = ["lines.text", "lines.speaker"];
|
|
1374
|
+
var SUMMARY_UNTRUSTED = ["title", "overview", "sections.label", "sections.text", "next_steps", "content"];
|
|
1375
|
+
var DETAILS_UNTRUSTED = [
|
|
1376
|
+
"series_title",
|
|
1377
|
+
"participants.name",
|
|
1378
|
+
"participants.email",
|
|
1379
|
+
"participants.person.name",
|
|
1380
|
+
"chat.sender",
|
|
1381
|
+
"chat.recipient",
|
|
1382
|
+
"chat.text",
|
|
1383
|
+
"attachments.name",
|
|
1384
|
+
"documents.title"
|
|
1385
|
+
];
|
|
1386
|
+
var PARTICIPANT_UNTRUSTED = ["display_name", "email", "person.name"];
|
|
1220
1387
|
var meetingRef = /* @__PURE__ */ __name((accountId, meetingId) => formatMeetingReference({ type: "meeting", accountId, meetingId }), "meetingRef");
|
|
1221
1388
|
var meetingTranscriptItem = /* @__PURE__ */ __name((accountId, transcript, rows) => ({
|
|
1222
1389
|
ref: formatMeetingReference({
|
|
@@ -1236,7 +1403,8 @@ var meetingTranscriptItem = /* @__PURE__ */ __name((accountId, transcript, rows)
|
|
|
1236
1403
|
end_ms: row.endMs,
|
|
1237
1404
|
speaker: row.speakerName,
|
|
1238
1405
|
text: row.text
|
|
1239
|
-
}))
|
|
1406
|
+
})),
|
|
1407
|
+
untrusted: [...TRANSCRIPT_UNTRUSTED]
|
|
1240
1408
|
}), "meetingTranscriptItem");
|
|
1241
1409
|
var meetingSummaryItem = /* @__PURE__ */ __name((accountId, summary) => ({
|
|
1242
1410
|
id: String(summary.id),
|
|
@@ -1244,17 +1412,20 @@ var meetingSummaryItem = /* @__PURE__ */ __name((accountId, summary) => ({
|
|
|
1244
1412
|
source: summary.source,
|
|
1245
1413
|
title: summary.title,
|
|
1246
1414
|
overview: summary.overview,
|
|
1247
|
-
sections: summary.sections.map(({ label, text:
|
|
1415
|
+
sections: summary.sections.map(({ label, text: text6 }) => ({ label, text: text6 })),
|
|
1248
1416
|
next_steps: summary.nextSteps,
|
|
1249
1417
|
content: summary.content,
|
|
1250
1418
|
url: summary.docUrl,
|
|
1251
1419
|
created_at: new Date(summary.externalCreatedAt ?? summary.createdAt).toISOString(),
|
|
1252
|
-
updated_at: new Date(summary.externalUpdatedAt ?? summary.updatedAt).toISOString()
|
|
1420
|
+
updated_at: new Date(summary.externalUpdatedAt ?? summary.updatedAt).toISOString(),
|
|
1421
|
+
untrusted: [...SUMMARY_UNTRUSTED]
|
|
1253
1422
|
}), "meetingSummaryItem");
|
|
1254
1423
|
var meetingDetailsItem = /* @__PURE__ */ __name((details, owner) => {
|
|
1255
1424
|
const { accountId } = details.meeting;
|
|
1425
|
+
const item = meetingItem(details.meeting, owner);
|
|
1256
1426
|
return {
|
|
1257
|
-
...
|
|
1427
|
+
...item,
|
|
1428
|
+
untrusted: [...item.untrusted ?? [], ...DETAILS_UNTRUSTED],
|
|
1258
1429
|
event_id: details.meeting.eventId === null ? null : String(details.meeting.eventId),
|
|
1259
1430
|
series_id: details.meeting.meetingSeriesId === null ? null : String(details.meeting.meetingSeriesId),
|
|
1260
1431
|
series_title: details.series?.title ?? null,
|
|
@@ -1291,7 +1462,8 @@ var meetingDetailsItem = /* @__PURE__ */ __name((details, owner) => {
|
|
|
1291
1462
|
name: one.name ?? one.title,
|
|
1292
1463
|
mime: one.mime,
|
|
1293
1464
|
size: one.size,
|
|
1294
|
-
url: one.url
|
|
1465
|
+
url: one.url,
|
|
1466
|
+
local_path: one.localPath
|
|
1295
1467
|
})),
|
|
1296
1468
|
documents: (details.documents ?? []).map((one) => ({
|
|
1297
1469
|
file_id: one.fileId,
|
|
@@ -1340,10 +1512,10 @@ var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
|
|
|
1340
1512
|
var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
|
|
1341
1513
|
const items = found.items.map(meetingHitItem);
|
|
1342
1514
|
const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
|
|
1343
|
-
const
|
|
1515
|
+
const pending = found.coverage.indexing === "pending";
|
|
1344
1516
|
const next = [
|
|
1345
1517
|
...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
|
|
1346
|
-
...
|
|
1518
|
+
...pending ? [
|
|
1347
1519
|
stepOf(SEARCH_AGAIN, {
|
|
1348
1520
|
command,
|
|
1349
1521
|
args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
|
|
@@ -1359,7 +1531,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1359
1531
|
...cursor === void 0 ? {} : { next_cursor: cursor }
|
|
1360
1532
|
},
|
|
1361
1533
|
...next.length > 0 ? { next } : {},
|
|
1362
|
-
...
|
|
1534
|
+
...pending ? {
|
|
1363
1535
|
missing: [
|
|
1364
1536
|
{
|
|
1365
1537
|
field: "excerpt",
|
|
@@ -1372,7 +1544,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1372
1544
|
};
|
|
1373
1545
|
}, "meetingHitsList");
|
|
1374
1546
|
|
|
1375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1547
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
|
|
1376
1548
|
var joinKeyOf = /* @__PURE__ */ __name((url) => {
|
|
1377
1549
|
const parsed = urlOf(url);
|
|
1378
1550
|
if (!parsed)
|
|
@@ -1406,17 +1578,17 @@ var urlOf = /* @__PURE__ */ __name((url) => {
|
|
|
1406
1578
|
}
|
|
1407
1579
|
}, "urlOf");
|
|
1408
1580
|
|
|
1409
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
|
|
1410
1582
|
var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
|
|
1411
1583
|
var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
|
|
1412
1584
|
var htmlToText = /* @__PURE__ */ __name((html) => html.replace(/<\s*br\s*\/?>/giu, "\n").replace(/<\/\s*(p|div|li|tr|h[1-6])\s*>/giu, "\n").replace(/<a\s[^>]*href\s*=\s*"([^"]*)"[^>]*>/giu, " $1 ").replace(/<[^>]+>/gu, "").replace(/&(amp|lt|gt|quot|#39|apos|nbsp);/gu, (_, name) => ENTITIES[name] ?? ""), "htmlToText");
|
|
1413
|
-
var withoutLinkQueries = /* @__PURE__ */ __name((
|
|
1414
|
-
var calendarText = /* @__PURE__ */ __name((
|
|
1415
|
-
if (!
|
|
1585
|
+
var withoutLinkQueries = /* @__PURE__ */ __name((text6) => text6.replace(/https?:\/\/[^\s<>"')\]]+/giu, (url) => joinUrlWithoutQuery(url) ?? ""), "withoutLinkQueries");
|
|
1586
|
+
var calendarText = /* @__PURE__ */ __name((text6, { dropSecretLines = true } = {}) => {
|
|
1587
|
+
if (!text6)
|
|
1416
1588
|
return null;
|
|
1417
|
-
const kept = htmlToText(
|
|
1418
|
-
const
|
|
1419
|
-
return
|
|
1589
|
+
const kept = htmlToText(text6).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
|
|
1590
|
+
const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
|
|
1591
|
+
return joined || null;
|
|
1420
1592
|
}, "calendarText");
|
|
1421
1593
|
var ENTRY_METADATA_KEYS = [
|
|
1422
1594
|
"colorId",
|
|
@@ -1443,7 +1615,232 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
|
|
|
1443
1615
|
return kept;
|
|
1444
1616
|
}, "entryMetadata");
|
|
1445
1617
|
|
|
1446
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/calls.js
|
|
1619
|
+
var CALL_DIRECTIONS = ["incoming", "outgoing", "internal"];
|
|
1620
|
+
var CALL_OUTCOMES = ["answered", "voicemail", "busy", "no_answer", "failed"];
|
|
1621
|
+
|
|
1622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/call-answers.js
|
|
1623
|
+
var count3 = pipe(number(), integer(), minValue(0));
|
|
1624
|
+
var ms = count3;
|
|
1625
|
+
var id = pipe(number(), integer(), minValue(1));
|
|
1626
|
+
var counts = /* @__PURE__ */ __name((keys) => strictObject(Object.fromEntries([...keys, "unknown"].map((key) => [key, count3]))), "counts");
|
|
1627
|
+
var maybe = exactOptional;
|
|
1628
|
+
var employee = strictObject({
|
|
1629
|
+
/** `extension:<number>`, or `identity:<id>` where the provider names no extension. */
|
|
1630
|
+
key: string(),
|
|
1631
|
+
name: nullable(string()),
|
|
1632
|
+
identity_id: nullable(id),
|
|
1633
|
+
extension: nullable(string()),
|
|
1634
|
+
calls: count3,
|
|
1635
|
+
incoming: count3,
|
|
1636
|
+
outgoing: count3,
|
|
1637
|
+
internal: count3,
|
|
1638
|
+
placed: maybe(count3),
|
|
1639
|
+
answered: maybe(count3),
|
|
1640
|
+
rang_not_answered: maybe(count3),
|
|
1641
|
+
talk_ms: maybe(ms),
|
|
1642
|
+
mean_talk_ms: maybe(nullable(ms)),
|
|
1643
|
+
mean_wait_ms: maybe(nullable(ms)),
|
|
1644
|
+
max_wait_ms: maybe(nullable(ms))
|
|
1645
|
+
});
|
|
1646
|
+
var periodFields = {
|
|
1647
|
+
calls: count3,
|
|
1648
|
+
incoming: count3,
|
|
1649
|
+
outgoing: count3,
|
|
1650
|
+
internal: count3,
|
|
1651
|
+
answered: maybe(count3),
|
|
1652
|
+
missed: maybe(count3),
|
|
1653
|
+
talk_ms: maybe(ms)
|
|
1654
|
+
};
|
|
1655
|
+
var callRef = strictObject({ ref: reference, meeting_id: id, started_at: nullable(isoTime) });
|
|
1656
|
+
var callStatsSchema = strictObject({
|
|
1657
|
+
time_zone: string(),
|
|
1658
|
+
callback_within_ms: ms,
|
|
1659
|
+
short_call_under_ms: ms,
|
|
1660
|
+
calls: count3,
|
|
1661
|
+
/** Selected meetings that are not calls. */
|
|
1662
|
+
not_calls: count3,
|
|
1663
|
+
/** How many calls give each field; `roles` says who placed, answered and rang. */
|
|
1664
|
+
known: strictObject({
|
|
1665
|
+
direction: count3,
|
|
1666
|
+
outcome: count3,
|
|
1667
|
+
wait_ms: count3,
|
|
1668
|
+
talk_ms: count3,
|
|
1669
|
+
duration_ms: count3,
|
|
1670
|
+
roles: count3
|
|
1671
|
+
}),
|
|
1672
|
+
by_direction: maybe(counts(CALL_DIRECTIONS)),
|
|
1673
|
+
by_outcome: maybe(counts(CALL_OUTCOMES)),
|
|
1674
|
+
talk_ms: maybe(ms),
|
|
1675
|
+
mean_talk_ms: maybe(ms),
|
|
1676
|
+
duration_ms: maybe(ms),
|
|
1677
|
+
mean_wait_ms: maybe(nullable(ms)),
|
|
1678
|
+
max_wait_ms: maybe(nullable(ms)),
|
|
1679
|
+
short_calls: maybe(count3),
|
|
1680
|
+
employees: array(employee),
|
|
1681
|
+
/** Hours 0–23 in `time_zone`. */
|
|
1682
|
+
hours: array(strictObject({ hour: pipe(count3, maxValue(23)), ...periodFields })),
|
|
1683
|
+
/** `YYYY-MM-DD` in `time_zone`, the days with a call. */
|
|
1684
|
+
days: array(strictObject({ date: string(), ...periodFields })),
|
|
1685
|
+
missed: maybe(strictObject({
|
|
1686
|
+
calls: count3,
|
|
1687
|
+
called_back: count3,
|
|
1688
|
+
not_called_back: count3,
|
|
1689
|
+
unknown_callback: count3,
|
|
1690
|
+
unknown_outcome: count3,
|
|
1691
|
+
/** Newest first. */
|
|
1692
|
+
items: array(strictObject({
|
|
1693
|
+
...callRef.entries,
|
|
1694
|
+
outcome: picklist(["voicemail", "busy", "no_answer"]),
|
|
1695
|
+
client: nullable(strictObject({ key: string(), name: nullable(string()) })),
|
|
1696
|
+
rang: array(string()),
|
|
1697
|
+
called_back: maybe(boolean()),
|
|
1698
|
+
callback: maybe(nullable(strictObject({ ...callRef.entries, after_ms: ms, direction: picklist(["outgoing", "incoming"]) })))
|
|
1699
|
+
})),
|
|
1700
|
+
has_more: boolean()
|
|
1701
|
+
}))
|
|
1702
|
+
});
|
|
1703
|
+
var callStats = callStatsSchema;
|
|
1704
|
+
|
|
1705
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/stats.js
|
|
1706
|
+
var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
1707
|
+
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
1708
|
+
const zone = timeZone ?? "UTC";
|
|
1709
|
+
try {
|
|
1710
|
+
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
1711
|
+
} catch {
|
|
1712
|
+
throw new CliError("validation_error", "expected an IANA time zone such as Europe/Madrid");
|
|
1713
|
+
}
|
|
1714
|
+
return zone;
|
|
1715
|
+
}, "zoneOf");
|
|
1716
|
+
var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
1717
|
+
var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
1718
|
+
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
1719
|
+
const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
|
|
1720
|
+
return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
1721
|
+
}, "weekStart");
|
|
1722
|
+
var dayKey = /* @__PURE__ */ __name((at, format) => {
|
|
1723
|
+
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
1724
|
+
return `${parts.year}-${parts.month}-${parts.day}`;
|
|
1725
|
+
}, "dayKey");
|
|
1726
|
+
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
1727
|
+
timeZone: zone,
|
|
1728
|
+
year: "numeric",
|
|
1729
|
+
month: "2-digit",
|
|
1730
|
+
day: "2-digit",
|
|
1731
|
+
weekday: "short"
|
|
1732
|
+
}), "zoneFormat");
|
|
1733
|
+
var NO_SERIES = "no-series";
|
|
1734
|
+
var MOST_COUNT_ROWS = 100;
|
|
1735
|
+
var minutesOf = /* @__PURE__ */ __name((ms2) => Math.round(ms2 / 6e4), "minutesOf");
|
|
1736
|
+
var meanOf = /* @__PURE__ */ __name((ms2, timed) => timed === 0 ? null : Math.round(ms2 / timed / 6e3) / 10, "meanOf");
|
|
1737
|
+
var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
|
|
1738
|
+
if (!MEETING_COUNTS_GROUPINGS.includes(by))
|
|
1739
|
+
throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
|
|
1740
|
+
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
1741
|
+
throw new CliError("validation_error", "--limit is a positive number");
|
|
1742
|
+
const zone = zoneOf(timeZone);
|
|
1743
|
+
const format = zoneFormat(zone);
|
|
1744
|
+
const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
|
|
1745
|
+
const add = /* @__PURE__ */ __name((into, meeting2) => {
|
|
1746
|
+
into.meetings += 1;
|
|
1747
|
+
if (meeting2.durationMs !== null) {
|
|
1748
|
+
into.ms += Math.max(0, meeting2.durationMs);
|
|
1749
|
+
into.timed += 1;
|
|
1750
|
+
}
|
|
1751
|
+
if (meeting2.transcribed)
|
|
1752
|
+
into.transcripts += 1;
|
|
1753
|
+
}, "add");
|
|
1754
|
+
const total = { ...sum(), name: null };
|
|
1755
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1756
|
+
for (const meeting2 of meetings) {
|
|
1757
|
+
add(total, meeting2);
|
|
1758
|
+
const key = by === "series" ? meeting2.seriesKey === null ? NO_SERIES : `series:${meeting2.seriesKey}` : meeting2.startedAt === null ? null : by === "day" ? dayKey(meeting2.startedAt, format) : weekStart(meeting2.startedAt, format);
|
|
1759
|
+
if (key === null)
|
|
1760
|
+
continue;
|
|
1761
|
+
const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
|
|
1762
|
+
add(group, meeting2);
|
|
1763
|
+
groups.set(key, group);
|
|
1764
|
+
}
|
|
1765
|
+
const ordered = [...groups.entries()].sort(([a, one], [b, other]) => by === "series" ? other.ms - one.ms || other.meetings - one.meetings || a.localeCompare(b) : b.localeCompare(a));
|
|
1766
|
+
const kept = ordered.slice(0, limit);
|
|
1767
|
+
if (by !== "series")
|
|
1768
|
+
kept.reverse();
|
|
1769
|
+
const counted = /* @__PURE__ */ __name(({ meetings: count7, ms: ms2, timed, transcripts }) => ({
|
|
1770
|
+
meetings: count7,
|
|
1771
|
+
minutes: minutesOf(ms2),
|
|
1772
|
+
meanMinutes: meanOf(ms2, timed),
|
|
1773
|
+
transcripts
|
|
1774
|
+
}), "counted");
|
|
1775
|
+
return {
|
|
1776
|
+
by,
|
|
1777
|
+
timeZone: zone,
|
|
1778
|
+
...counted(total),
|
|
1779
|
+
rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
|
|
1780
|
+
hasMore: ordered.length > limit
|
|
1781
|
+
};
|
|
1782
|
+
}, "aggregateMeetingCounts");
|
|
1783
|
+
var UNKNOWN_SPEAKER = "unknown";
|
|
1784
|
+
var speakerOf = /* @__PURE__ */ __name((row) => row.personId !== null ? { key: `person:${row.personId}`, name: row.personName ?? row.identityName ?? row.speakerName } : row.identityId !== null ? { key: `identity:${row.identityId}`, name: row.identityName ?? row.speakerName } : row.speakerName?.trim() ? { key: `name:${row.speakerName.trim().toLowerCase()}`, name: row.speakerName.trim() } : { key: UNKNOWN_SPEAKER, name: null }, "speakerOf");
|
|
1785
|
+
var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
1786
|
+
const zone = zoneOf(timeZone);
|
|
1787
|
+
const format = zoneFormat(zone);
|
|
1788
|
+
const speakers = /* @__PURE__ */ new Map();
|
|
1789
|
+
const weeks = /* @__PURE__ */ new Map();
|
|
1790
|
+
const meetings = /* @__PURE__ */ new Set();
|
|
1791
|
+
let lines = 0;
|
|
1792
|
+
let words2 = 0;
|
|
1793
|
+
let talkMs = 0;
|
|
1794
|
+
for (const row of rows) {
|
|
1795
|
+
const talk = Math.max(0, row.endMs - row.startMs);
|
|
1796
|
+
meetings.add(row.meetingId);
|
|
1797
|
+
lines += 1;
|
|
1798
|
+
words2 += row.words;
|
|
1799
|
+
talkMs += talk;
|
|
1800
|
+
const who = speakerOf(row);
|
|
1801
|
+
const held = speakers.get(who.key) ?? {
|
|
1802
|
+
key: who.key,
|
|
1803
|
+
name: who.name ?? null,
|
|
1804
|
+
personId: row.personId,
|
|
1805
|
+
identityId: row.personId === null ? row.identityId : null,
|
|
1806
|
+
meetings: 0,
|
|
1807
|
+
lines: 0,
|
|
1808
|
+
words: 0,
|
|
1809
|
+
talkMs: 0,
|
|
1810
|
+
share: 0,
|
|
1811
|
+
seen: /* @__PURE__ */ new Set()
|
|
1812
|
+
};
|
|
1813
|
+
held.seen.add(row.meetingId);
|
|
1814
|
+
held.lines += 1;
|
|
1815
|
+
held.words += row.words;
|
|
1816
|
+
held.talkMs += talk;
|
|
1817
|
+
speakers.set(who.key, held);
|
|
1818
|
+
if (row.startedAt !== null) {
|
|
1819
|
+
const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
|
|
1820
|
+
week.meetings.add(row.meetingId);
|
|
1821
|
+
week.talkMs += talk;
|
|
1822
|
+
weeks.set(weekStart(row.startedAt, format), week);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
return {
|
|
1826
|
+
timeZone: zone,
|
|
1827
|
+
meetings: meetings.size,
|
|
1828
|
+
lines,
|
|
1829
|
+
words: words2,
|
|
1830
|
+
talkMs,
|
|
1831
|
+
speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
|
|
1832
|
+
...speaker,
|
|
1833
|
+
meetings: seen.size,
|
|
1834
|
+
share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
|
|
1835
|
+
})).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
|
|
1836
|
+
weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
|
|
1837
|
+
};
|
|
1838
|
+
}, "aggregateMeetingStats");
|
|
1839
|
+
|
|
1840
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/call-stats.js
|
|
1841
|
+
var CALLBACK_WITHIN_MS = 24 * 60 * 60 * 1e3;
|
|
1842
|
+
|
|
1843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
|
|
1447
1844
|
import { createHash } from "node:crypto";
|
|
1448
1845
|
var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
|
|
1449
1846
|
reference: cue2.reference,
|
|
@@ -1457,7 +1854,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
|
|
|
1457
1854
|
text: cue2.text
|
|
1458
1855
|
})).digest("hex"), "meetingCueFingerprint");
|
|
1459
1856
|
|
|
1460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
|
|
1461
1858
|
var EVENT_QUERY = defineQuery({
|
|
1462
1859
|
entity: "event",
|
|
1463
1860
|
backend: "sql",
|
|
@@ -1473,7 +1870,8 @@ var EVENT_QUERY = defineQuery({
|
|
|
1473
1870
|
]
|
|
1474
1871
|
});
|
|
1475
1872
|
|
|
1476
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1873
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
|
|
1874
|
+
var PARTICIPANT_RESPONSES = ["needs-action", "accepted", "tentative", "declined", "delegated"];
|
|
1477
1875
|
var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
|
|
1478
1876
|
var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
1479
1877
|
if (entry.recurrenceEndsAt !== null)
|
|
@@ -1496,7 +1894,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
|
1496
1894
|
return Math.max(entry.endsAt ?? start, start + 1) > window.from;
|
|
1497
1895
|
}, "entryInWindow");
|
|
1498
1896
|
|
|
1499
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1897
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/events.js
|
|
1500
1898
|
var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(), { create = true } = {}) => {
|
|
1501
1899
|
const current = await store.meeting(details.meeting.id);
|
|
1502
1900
|
if (!current)
|
|
@@ -1511,7 +1909,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(),
|
|
|
1511
1909
|
endsAt: meeting2.endedAt ?? meeting2.startedAt
|
|
1512
1910
|
});
|
|
1513
1911
|
if (candidates.length > 1) {
|
|
1514
|
-
await store.reviewMeetingLink?.(meeting2.id, candidates.map(({ id:
|
|
1912
|
+
await store.reviewMeetingLink?.(meeting2.id, candidates.map(({ id: id4 }) => id4), now);
|
|
1515
1913
|
return null;
|
|
1516
1914
|
}
|
|
1517
1915
|
let event2 = candidates[0];
|
|
@@ -1541,8 +1939,8 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(),
|
|
|
1541
1939
|
return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
|
|
1542
1940
|
}, "linkEvent");
|
|
1543
1941
|
|
|
1544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1545
|
-
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((
|
|
1942
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
|
|
1943
|
+
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text6) => text6.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
|
|
1546
1944
|
var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
|
|
1547
1945
|
if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
|
|
1548
1946
|
throw new CliError("validation_error", "participant query must contain 1\u2013500 characters without NUL");
|
|
@@ -1565,7 +1963,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
|
|
|
1565
1963
|
};
|
|
1566
1964
|
}, "validateMeetingParticipantSearch");
|
|
1567
1965
|
|
|
1568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1966
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/reads.js
|
|
1569
1967
|
var MeetingError = class extends CliError {
|
|
1570
1968
|
static {
|
|
1571
1969
|
__name(this, "MeetingError");
|
|
@@ -1592,8 +1990,8 @@ var validateFilter = /* @__PURE__ */ __name((filter) => {
|
|
|
1592
1990
|
if (value !== void 0 && (!Number.isSafeInteger(value) || value < 0))
|
|
1593
1991
|
throw new MeetingError("validation_error", "expected a nonnegative integer");
|
|
1594
1992
|
}, "validateFilter");
|
|
1595
|
-
var meetingShow = /* @__PURE__ */ __name(async (store,
|
|
1596
|
-
const details = await store.meeting(positiveInteger(
|
|
1993
|
+
var meetingShow = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
1994
|
+
const details = await store.meeting(positiveInteger(id4));
|
|
1597
1995
|
if (!details || accountId !== void 0 && details.meeting.accountId !== accountId)
|
|
1598
1996
|
throw new MeetingError("not_found", "meeting not found");
|
|
1599
1997
|
return details;
|
|
@@ -1617,6 +2015,7 @@ var meetingPeople = /* @__PURE__ */ __name(async (store, query, accountId, optio
|
|
|
1617
2015
|
});
|
|
1618
2016
|
return {
|
|
1619
2017
|
...packet,
|
|
2018
|
+
items: packet.items.map((one) => ({ ...one, untrusted: [...PARTICIPANT_UNTRUSTED] })),
|
|
1620
2019
|
page: { mode: "cursor", limit, has_more, ...next_cursor ? { next_cursor } : {} },
|
|
1621
2020
|
...next_cursor ? {
|
|
1622
2021
|
next: [
|
|
@@ -1637,7 +2036,14 @@ var meetingPeople = /* @__PURE__ */ __name(async (store, query, accountId, optio
|
|
|
1637
2036
|
}
|
|
1638
2037
|
if (Object.values(options).some((value) => value !== void 0))
|
|
1639
2038
|
throw new MeetingError("configuration_error", "bounded participant lookup needs a selected account and capable store");
|
|
1640
|
-
return listed(await store.participants(query, accountId))
|
|
2039
|
+
return listed((await store.participants(query, accountId)).map((one) => ({
|
|
2040
|
+
participant_id: one.id,
|
|
2041
|
+
meeting_id: one.meetingId,
|
|
2042
|
+
identity_id: one.identityId,
|
|
2043
|
+
display_name: one.displayName,
|
|
2044
|
+
email: one.email,
|
|
2045
|
+
untrusted: [...PARTICIPANT_UNTRUSTED]
|
|
2046
|
+
})));
|
|
1641
2047
|
}, "meetingPeople");
|
|
1642
2048
|
var PAGE_NEXT2 = STEPS.find((step) => step.id === "page.next");
|
|
1643
2049
|
var meetingsList = /* @__PURE__ */ __name(async (store, filter = {}) => {
|
|
@@ -1669,11 +2075,11 @@ var meetingsList = /* @__PURE__ */ __name(async (store, filter = {}) => {
|
|
|
1669
2075
|
} : {}
|
|
1670
2076
|
};
|
|
1671
2077
|
}, "meetingsList");
|
|
1672
|
-
var meetingsQuery = /* @__PURE__ */ __name((
|
|
1673
|
-
if (
|
|
2078
|
+
var meetingsQuery = /* @__PURE__ */ __name((text6) => {
|
|
2079
|
+
if (text6 === void 0 || text6.trim() === "")
|
|
1674
2080
|
return void 0;
|
|
1675
2081
|
const context3 = { command: "meetings list", guide: MEETING_QUERY_GUIDE };
|
|
1676
|
-
const query = parseLucene(
|
|
2082
|
+
const query = parseLucene(text6, { defaultField: "none", ...context3 });
|
|
1677
2083
|
validateQuery(query, MEETING_QUERY, context3);
|
|
1678
2084
|
return query;
|
|
1679
2085
|
}, "meetingsQuery");
|
|
@@ -1687,16 +2093,16 @@ var ownerOf = /* @__PURE__ */ __name(async (store, accountId) => {
|
|
|
1687
2093
|
var meetingDetailsBody = /* @__PURE__ */ __name(async (store, details) => ({
|
|
1688
2094
|
item: meetingDetailsItem(details, await ownerOf(store, details.meeting.accountId))
|
|
1689
2095
|
}), "meetingDetailsBody");
|
|
1690
|
-
var meetingTranscriptAnswer = /* @__PURE__ */ __name(async (store,
|
|
1691
|
-
const details = await meetingShow(store,
|
|
2096
|
+
var meetingTranscriptAnswer = /* @__PURE__ */ __name(async (store, id4, accountId, options = {}) => {
|
|
2097
|
+
const details = await meetingShow(store, id4, accountId);
|
|
1692
2098
|
return wholeList(details.transcripts.filter((t) => (options.history || t.transcript.supersededAt === null) && t.transcript.deletedAt === null).map((t) => meetingTranscriptItem(details.meeting.accountId, t.transcript, t.rows)));
|
|
1693
2099
|
}, "meetingTranscriptAnswer");
|
|
1694
|
-
var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store,
|
|
1695
|
-
const details = await meetingShow(store,
|
|
2100
|
+
var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
2101
|
+
const details = await meetingShow(store, id4, accountId);
|
|
1696
2102
|
return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
|
|
1697
2103
|
}, "meetingSummaryAnswer");
|
|
1698
2104
|
|
|
1699
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/export.js
|
|
1700
2106
|
var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
1701
2107
|
if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
|
|
1702
2108
|
throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
|
|
@@ -1705,10 +2111,10 @@ var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
1705
2111
|
const seconds = Math.floor(milliseconds % 6e4 / 1e3);
|
|
1706
2112
|
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(milliseconds % 1e3).padStart(3, "0")}`;
|
|
1707
2113
|
}, "timestamp");
|
|
1708
|
-
var vttText = /* @__PURE__ */ __name((
|
|
1709
|
-
if (visibleControls(
|
|
2114
|
+
var vttText = /* @__PURE__ */ __name((text6) => {
|
|
2115
|
+
if (visibleControls(text6) !== text6 || /\n\s*\n/.test(text6))
|
|
1710
2116
|
throw new MeetingError("validation_error", "cue paragraphs or control characters require Markdown export");
|
|
1711
|
-
return
|
|
2117
|
+
return text6.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
1712
2118
|
}, "vttText");
|
|
1713
2119
|
var serializeVtt = /* @__PURE__ */ __name((lines) => `WEBVTT
|
|
1714
2120
|
|
|
@@ -1726,9 +2132,9 @@ ${speaker}${vttText(line2.text)}
|
|
|
1726
2132
|
|
|
1727
2133
|
`;
|
|
1728
2134
|
}).join("")}`, "serializeVtt");
|
|
1729
|
-
var markdown = /* @__PURE__ */ __name((
|
|
1730
|
-
var heading = /* @__PURE__ */ __name((
|
|
1731
|
-
var quote = /* @__PURE__ */ __name((
|
|
2135
|
+
var markdown = /* @__PURE__ */ __name((text6) => visibleControls(text6).replace(/[\\`*_{}[\]()<>#+.!|~]/g, "\\$&"), "markdown");
|
|
2136
|
+
var heading = /* @__PURE__ */ __name((text6) => markdown(singleLine(text6)), "heading");
|
|
2137
|
+
var quote = /* @__PURE__ */ __name((text6) => markdown(text6).split(/\r\n|\r|\n/).map((line2) => `> ${line2}`).join("\n"), "quote");
|
|
1732
2138
|
var transcriptsOf = /* @__PURE__ */ __name((details, transcriptId) => {
|
|
1733
2139
|
if (transcriptId !== void 0) {
|
|
1734
2140
|
positiveInteger(transcriptId);
|
|
@@ -1739,10 +2145,10 @@ var transcriptsOf = /* @__PURE__ */ __name((details, transcriptId) => {
|
|
|
1739
2145
|
}
|
|
1740
2146
|
return details.transcripts.filter((part) => part.transcript.supersededAt === null && part.transcript.deletedAt === null);
|
|
1741
2147
|
}, "transcriptsOf");
|
|
1742
|
-
var exportMeeting = /* @__PURE__ */ __name(async (store,
|
|
2148
|
+
var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
1743
2149
|
if (options.format !== "markdown" && options.format !== "vtt")
|
|
1744
2150
|
throw new MeetingError("validation_error", "export format must be markdown or vtt");
|
|
1745
|
-
const details = await meetingShow(store,
|
|
2151
|
+
const details = await meetingShow(store, id4, options.accountId);
|
|
1746
2152
|
const transcripts = transcriptsOf(details, options.transcriptId);
|
|
1747
2153
|
let content;
|
|
1748
2154
|
if (options.format === "vtt") {
|
|
@@ -1758,44 +2164,45 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id3, options) => {
|
|
|
1758
2164
|
text: row.text
|
|
1759
2165
|
})));
|
|
1760
2166
|
} else {
|
|
1761
|
-
const
|
|
2167
|
+
const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
|
|
1762
2168
|
if (details.meeting.description !== null)
|
|
1763
|
-
|
|
2169
|
+
parts.push("## Description", quote(details.meeting.description));
|
|
1764
2170
|
for (const summary of details.summaries) {
|
|
1765
|
-
|
|
2171
|
+
parts.push(`## ${heading(summary.title ?? "Summary")}`);
|
|
1766
2172
|
if (summary.content !== null)
|
|
1767
|
-
|
|
2173
|
+
parts.push(quote(summary.content));
|
|
1768
2174
|
else {
|
|
1769
2175
|
if (summary.overview !== null)
|
|
1770
|
-
|
|
2176
|
+
parts.push(quote(summary.overview));
|
|
1771
2177
|
for (const section of summary.sections)
|
|
1772
|
-
|
|
2178
|
+
parts.push(`### ${heading(section.label)}`, quote(section.text));
|
|
1773
2179
|
if (summary.nextSteps.length > 0)
|
|
1774
|
-
|
|
2180
|
+
parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
|
|
1775
2181
|
}
|
|
1776
2182
|
}
|
|
1777
2183
|
for (const part of transcripts) {
|
|
1778
|
-
|
|
2184
|
+
parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
|
|
1779
2185
|
if (part.transcript.supersededAt !== null)
|
|
1780
|
-
|
|
2186
|
+
parts.push("Version: superseded");
|
|
1781
2187
|
for (const row of [...part.rows].sort((a, b) => a.position - b.position))
|
|
1782
|
-
|
|
2188
|
+
parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
|
|
1783
2189
|
}
|
|
1784
|
-
content = `${
|
|
2190
|
+
content = `${parts.join("\n\n")}
|
|
1785
2191
|
`;
|
|
1786
2192
|
}
|
|
1787
2193
|
return {
|
|
1788
2194
|
meetingId: details.meeting.id,
|
|
1789
2195
|
format: options.format,
|
|
1790
2196
|
filename: `meeting-${details.meeting.id}${options.transcriptId === void 0 ? "" : `-transcript-${options.transcriptId}`}.${options.format === "markdown" ? "md" : "vtt"}`,
|
|
1791
|
-
content
|
|
2197
|
+
content,
|
|
2198
|
+
untrusted: ["content"]
|
|
1792
2199
|
};
|
|
1793
2200
|
}, "exportMeeting");
|
|
1794
2201
|
|
|
1795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
1796
2203
|
import { createHash as createHash2 } from "node:crypto";
|
|
1797
2204
|
|
|
1798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2205
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
|
|
1799
2206
|
var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
1800
2207
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
|
|
1801
2208
|
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
|
|
@@ -1806,7 +2213,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
|
1806
2213
|
return new Date(value).toISOString();
|
|
1807
2214
|
}, "meetingTimestamp");
|
|
1808
2215
|
|
|
1809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
1810
2217
|
var TASK_TYPES = ["bug", "feature", "chore"];
|
|
1811
2218
|
var invalid3 = /* @__PURE__ */ __name((message) => {
|
|
1812
2219
|
throw new CliError("validation_error", message);
|
|
@@ -1819,11 +2226,11 @@ var findingText = /* @__PURE__ */ __name((value, limit) => {
|
|
|
1819
2226
|
var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update(JSON.stringify(value)).digest("hex"), "findingHash");
|
|
1820
2227
|
var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
|
|
1821
2228
|
var findingWhere = /* @__PURE__ */ __name((of) => {
|
|
1822
|
-
const
|
|
1823
|
-
const
|
|
2229
|
+
const id4 = typeof of.id === "string" ? of.id : null;
|
|
2230
|
+
const kind2 = typeof of.kind === "string" ? of.kind : null;
|
|
1824
2231
|
return {
|
|
1825
|
-
where:
|
|
1826
|
-
named: { ...
|
|
2232
|
+
where: id4 || kind2 ? ` in ${[id4, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
|
|
2233
|
+
named: { ...id4 ? { finding: id4 } : {}, ...kind2 ? { kind: kind2 } : {} }
|
|
1827
2234
|
};
|
|
1828
2235
|
}, "findingWhere");
|
|
1829
2236
|
var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
|
|
@@ -1866,16 +2273,16 @@ var validEvidence = /* @__PURE__ */ __name((raw, rules) => {
|
|
|
1866
2273
|
return evidence;
|
|
1867
2274
|
}, "validEvidence");
|
|
1868
2275
|
var findingId = /* @__PURE__ */ __name((raw, ids2) => {
|
|
1869
|
-
const
|
|
1870
|
-
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(
|
|
2276
|
+
const id4 = findingText(raw, 64);
|
|
2277
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(id4) || ids2.has(id4))
|
|
1871
2278
|
return invalid3("finding IDs must be unique simple keys");
|
|
1872
|
-
ids2.add(
|
|
1873
|
-
return
|
|
2279
|
+
ids2.add(id4);
|
|
2280
|
+
return id4;
|
|
1874
2281
|
}, "findingId");
|
|
1875
2282
|
var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
|
|
1876
2283
|
if (!finding || typeof finding !== "object")
|
|
1877
2284
|
return invalid3("a finding is an object");
|
|
1878
|
-
const
|
|
2285
|
+
const id4 = findingId(finding.id, ids2);
|
|
1879
2286
|
const project = finding.project === void 0 && rules.anySubject ? void 0 : findingText(finding.project, 64);
|
|
1880
2287
|
if (project !== void 0 && !/^project:[1-9]\d*$/.test(project))
|
|
1881
2288
|
return invalid3("a finding names a project reference");
|
|
@@ -1885,7 +2292,7 @@ var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
|
|
|
1885
2292
|
return invalid3("a task finding names the project the task goes in");
|
|
1886
2293
|
const evidence = validEvidence(finding.evidence, rules);
|
|
1887
2294
|
const base = {
|
|
1888
|
-
id:
|
|
2295
|
+
id: id4,
|
|
1889
2296
|
...project === void 0 ? {} : { project },
|
|
1890
2297
|
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
1891
2298
|
evidence
|
|
@@ -1949,162 +2356,50 @@ var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
|
|
|
1949
2356
|
type: finding.type,
|
|
1950
2357
|
title: findingText(finding.title, 300),
|
|
1951
2358
|
reason: findingText(finding.reason, 2e3),
|
|
1952
|
-
commitment: finding.commitment,
|
|
1953
|
-
...finding.dueAt === void 0 ? {} : {
|
|
1954
|
-
dueAt: meetingTimestamp(finding.dueAt, "a task's due_at"),
|
|
1955
|
-
dueEvidence: support(finding.dueEvidence, evidence, "due_evidence")
|
|
1956
|
-
},
|
|
1957
|
-
...finding.assignee === void 0 ? {} : {
|
|
1958
|
-
assignee: finding.assignee,
|
|
1959
|
-
assigneeEvidence: support(finding.assigneeEvidence, evidence, "assignee_evidence")
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1962
|
-
}, "validateFinding");
|
|
1963
|
-
var support = /* @__PURE__ */ __name((value, evidence, field) => {
|
|
1964
|
-
if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref) => typeof ref !== "string" || !evidence.some((item) => item.reference === ref)))
|
|
1965
|
-
return invalid3(`${field} lists 1\u20138 references this finding's evidence cites, as plain strings such as ["<reference>"], not evidence objects`);
|
|
1966
|
-
return [...new Set(value)].sort();
|
|
1967
|
-
}, "support");
|
|
1968
|
-
var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
|
|
1969
|
-
if (!input || typeof input !== "object" || Buffer.byteLength(JSON.stringify(input), "utf8") > 65536)
|
|
1970
|
-
return invalid3(`${rules.plural} take at most 65536 UTF-8 bytes`);
|
|
1971
|
-
findingFields(input, ["schemaVersion", "key", "extractor", "findings"], rules.singular);
|
|
1972
|
-
if (input.schemaVersion !== 1 || !Array.isArray(input.findings) || input.findings.length < 1 || input.findings.length > most)
|
|
1973
|
-
return invalid3(`schemaVersion 1 takes 1\u2013${most} ${rules.plural}`);
|
|
1974
|
-
const key = findingText(input.key, 64);
|
|
1975
|
-
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(key))
|
|
1976
|
-
return invalid3("a findings key uses letters, digits, dot, colon, underscore or hyphen");
|
|
1977
|
-
const ids2 = /* @__PURE__ */ new Set();
|
|
1978
|
-
const findings = input.findings.map((finding) => one(finding, ids2));
|
|
1979
|
-
return { schemaVersion: 1, key, extractor: findingText(input.extractor, 200), findings };
|
|
1980
|
-
}, "validateBatch");
|
|
1981
|
-
var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
|
|
1982
|
-
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
1983
|
-
|
|
1984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1985
|
-
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
1986
|
-
var cue = /* @__PURE__ */ __name((raw) => {
|
|
1987
|
-
const reference2 = canonicalMeetingReference(raw);
|
|
1988
|
-
if (parseMeetingReference(reference2).cuePosition === void 0)
|
|
1989
|
-
throw new CliError("validation_error", "finding evidence requires exact cue references and fingerprints");
|
|
1990
|
-
return reference2;
|
|
1991
|
-
}, "cue");
|
|
1992
|
-
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
1993
|
-
var meetingFindingFingerprint = findingFingerprint;
|
|
1994
|
-
|
|
1995
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
1996
|
-
var context = {
|
|
1997
|
-
command: "search meetings",
|
|
1998
|
-
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
1999
|
-
};
|
|
2000
|
-
var words = ["term", "phrase"];
|
|
2001
|
-
var MOST_LINES_APART = 20;
|
|
2002
|
-
var near = /* @__PURE__ */ __name((node) => {
|
|
2003
|
-
if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
|
|
2004
|
-
queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
|
|
2005
|
-
}, "near");
|
|
2006
|
-
var MEETING_HIT_QUERY = defineQuery({
|
|
2007
|
-
entity: "meeting_hit",
|
|
2008
|
-
backend: "sql",
|
|
2009
|
-
fields: [
|
|
2010
|
-
{
|
|
2011
|
-
name: "text",
|
|
2012
|
-
type: "txt",
|
|
2013
|
-
operators: words,
|
|
2014
|
-
example: "text:budget",
|
|
2015
|
-
relation: "a passage with the word in any form, or a spelling speech recognition garbled",
|
|
2016
|
-
validate: near
|
|
2017
|
-
},
|
|
2018
|
-
{
|
|
2019
|
-
name: "exact",
|
|
2020
|
-
type: "txt",
|
|
2021
|
-
operators: words,
|
|
2022
|
-
example: "exact:budget",
|
|
2023
|
-
relation: "a passage with the word as typed: no other forms, no garbled spellings",
|
|
2024
|
-
validate: near
|
|
2025
|
-
},
|
|
2026
|
-
{
|
|
2027
|
-
name: "from",
|
|
2028
|
-
type: "kw",
|
|
2029
|
-
operators: words,
|
|
2030
|
-
example: 'from:"Alice Synthetic"',
|
|
2031
|
-
relation: "a line said or a chat message written by this person; attendance is --identity-id"
|
|
2032
|
-
}
|
|
2033
|
-
]
|
|
2034
|
-
});
|
|
2035
|
-
var MEETING_FIELDS = defineQuery({
|
|
2036
|
-
entity: "meeting_hit",
|
|
2037
|
-
backend: "sql",
|
|
2038
|
-
fields: [
|
|
2039
|
-
...MEETING_HIT_QUERY.fields,
|
|
2040
|
-
{
|
|
2041
|
-
name: "date",
|
|
2042
|
-
type: "time",
|
|
2043
|
-
operators: ["term", "range"],
|
|
2044
|
-
example: "date>=30d",
|
|
2045
|
-
relation: "meetings that started then; the same as --since-time and --until-time"
|
|
2046
|
-
},
|
|
2047
|
-
...["project", "tag", "topic"].map((name) => ({
|
|
2048
|
-
name,
|
|
2049
|
-
type: "kw",
|
|
2050
|
-
operators: words,
|
|
2051
|
-
example: `${name}:"Example name"`,
|
|
2052
|
-
relation: `meetings in this ${name}, by name or alias; the same as --${name}`
|
|
2053
|
-
}))
|
|
2054
|
-
]
|
|
2055
|
-
});
|
|
2056
|
-
var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
|
|
2057
|
-
var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
|
|
2058
|
-
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
|
|
2059
|
-
let ast;
|
|
2060
|
-
try {
|
|
2061
|
-
ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
|
|
2062
|
-
} catch (error) {
|
|
2063
|
-
if (error instanceof CliError)
|
|
2064
|
-
return { query, request };
|
|
2065
|
-
throw error;
|
|
2066
|
-
}
|
|
2067
|
-
const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
|
|
2068
|
-
const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
|
|
2069
|
-
const misplaced = /* @__PURE__ */ __name((node, nested) => node.kind === "predicate" ? nested && LIFTED.has(node.field) ? node : void 0 : node.clauses.map((clause) => misplaced(clause.node, true)).find(Boolean), "misplaced");
|
|
2070
|
-
const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
|
|
2071
|
-
if (wrong)
|
|
2072
|
-
queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
|
|
2073
|
-
if (!lifted.length)
|
|
2074
|
-
return { query, request };
|
|
2075
|
-
const next = { ...request };
|
|
2076
|
-
const once = /* @__PURE__ */ __name((name, flag2) => {
|
|
2077
|
-
if (next[name] !== void 0)
|
|
2078
|
-
throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
|
|
2079
|
-
}, "once");
|
|
2080
|
-
for (const { node } of lifted) {
|
|
2081
|
-
if (node.field === "date") {
|
|
2082
|
-
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
|
|
2083
|
-
if (range.lower !== void 0) {
|
|
2084
|
-
once("since", "--since-time");
|
|
2085
|
-
next.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
2086
|
-
}
|
|
2087
|
-
if (range.upper !== void 0) {
|
|
2088
|
-
once("until", "--until-time");
|
|
2089
|
-
next.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
2090
|
-
}
|
|
2091
|
-
} else {
|
|
2092
|
-
const field = node.field;
|
|
2093
|
-
once(field, `--${field}`);
|
|
2094
|
-
next[field] = node.value;
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
let rest = query;
|
|
2098
|
-
for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
|
|
2099
|
-
rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
|
|
2100
|
-
rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
|
|
2101
|
-
if (!rest)
|
|
2102
|
-
throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
|
|
2103
|
-
return { query: rest, request: next };
|
|
2104
|
-
}, "liftMeetingFields");
|
|
2105
|
-
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
2359
|
+
commitment: finding.commitment,
|
|
2360
|
+
...finding.dueAt === void 0 ? {} : {
|
|
2361
|
+
dueAt: meetingTimestamp(finding.dueAt, "a task's due_at"),
|
|
2362
|
+
dueEvidence: support(finding.dueEvidence, evidence, "due_evidence")
|
|
2363
|
+
},
|
|
2364
|
+
...finding.assignee === void 0 ? {} : {
|
|
2365
|
+
assignee: finding.assignee,
|
|
2366
|
+
assigneeEvidence: support(finding.assigneeEvidence, evidence, "assignee_evidence")
|
|
2367
|
+
}
|
|
2368
|
+
};
|
|
2369
|
+
}, "validateFinding");
|
|
2370
|
+
var support = /* @__PURE__ */ __name((value, evidence, field) => {
|
|
2371
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref) => typeof ref !== "string" || !evidence.some((item) => item.reference === ref)))
|
|
2372
|
+
return invalid3(`${field} lists 1\u20138 references this finding's evidence cites, as plain strings such as ["<reference>"], not evidence objects`);
|
|
2373
|
+
return [...new Set(value)].sort();
|
|
2374
|
+
}, "support");
|
|
2375
|
+
var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
|
|
2376
|
+
if (!input || typeof input !== "object" || Buffer.byteLength(JSON.stringify(input), "utf8") > 65536)
|
|
2377
|
+
return invalid3(`${rules.plural} take at most 65536 UTF-8 bytes`);
|
|
2378
|
+
findingFields(input, ["schemaVersion", "key", "extractor", "findings"], rules.singular);
|
|
2379
|
+
if (input.schemaVersion !== 1 || !Array.isArray(input.findings) || input.findings.length < 1 || input.findings.length > most)
|
|
2380
|
+
return invalid3(`schemaVersion 1 takes 1\u2013${most} ${rules.plural}`);
|
|
2381
|
+
const key = findingText(input.key, 64);
|
|
2382
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(key))
|
|
2383
|
+
return invalid3("a findings key uses letters, digits, dot, colon, underscore or hyphen");
|
|
2384
|
+
const ids2 = /* @__PURE__ */ new Set();
|
|
2385
|
+
const findings = input.findings.map((finding) => one(finding, ids2));
|
|
2386
|
+
return { schemaVersion: 1, key, extractor: findingText(input.extractor, 200), findings };
|
|
2387
|
+
}, "validateBatch");
|
|
2388
|
+
var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
|
|
2389
|
+
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
2390
|
+
|
|
2391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/findings.js
|
|
2392
|
+
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
2393
|
+
var cue = /* @__PURE__ */ __name((raw) => {
|
|
2394
|
+
const reference2 = canonicalMeetingReference(raw);
|
|
2395
|
+
if (parseMeetingReference(reference2).cuePosition === void 0)
|
|
2396
|
+
throw new CliError("validation_error", "finding evidence requires exact cue references and fingerprints");
|
|
2397
|
+
return reference2;
|
|
2398
|
+
}, "cue");
|
|
2399
|
+
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
2400
|
+
var meetingFindingFingerprint = findingFingerprint;
|
|
2106
2401
|
|
|
2107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/language.js
|
|
2108
2403
|
var LATIN_WORDS = {
|
|
2109
2404
|
en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
|
|
2110
2405
|
es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
|
|
@@ -2119,11 +2414,11 @@ var CYRILLIC = new RegExp("\\p{Script=Cyrillic}", "gu");
|
|
|
2119
2414
|
var LATIN = new RegExp("\\p{Script=Latin}", "gu");
|
|
2120
2415
|
var MIN_LETTERS = 20;
|
|
2121
2416
|
var DOMINANT = 0.75;
|
|
2122
|
-
var countOf = /* @__PURE__ */ __name((
|
|
2417
|
+
var countOf = /* @__PURE__ */ __name((text6, pattern2) => text6.match(pattern2)?.length ?? 0, "countOf");
|
|
2123
2418
|
var latinLanguage = /* @__PURE__ */ __name((texts) => {
|
|
2124
2419
|
const votes = /* @__PURE__ */ new Map();
|
|
2125
|
-
for (const
|
|
2126
|
-
for (const word of
|
|
2420
|
+
for (const text6 of texts)
|
|
2421
|
+
for (const word of text6.toLowerCase().split(/[^\p{L}]+/u)) {
|
|
2127
2422
|
const language = LATIN_LANGUAGE.get(word);
|
|
2128
2423
|
if (language)
|
|
2129
2424
|
votes.set(language, (votes.get(language) ?? 0) + 1);
|
|
@@ -2138,10 +2433,10 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
|
|
|
2138
2433
|
let cyrillic = 0;
|
|
2139
2434
|
let latin = 0;
|
|
2140
2435
|
let ukrainian = 0;
|
|
2141
|
-
for (const
|
|
2142
|
-
cyrillic += countOf(
|
|
2143
|
-
latin += countOf(
|
|
2144
|
-
ukrainian += countOf(
|
|
2436
|
+
for (const text6 of all) {
|
|
2437
|
+
cyrillic += countOf(text6, CYRILLIC);
|
|
2438
|
+
latin += countOf(text6, LATIN);
|
|
2439
|
+
ukrainian += countOf(text6, UKRAINIAN);
|
|
2145
2440
|
}
|
|
2146
2441
|
const letters = cyrillic + latin;
|
|
2147
2442
|
if (letters < MIN_LETTERS)
|
|
@@ -2153,9 +2448,9 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
|
|
|
2153
2448
|
return null;
|
|
2154
2449
|
}, "transcriptLanguage");
|
|
2155
2450
|
|
|
2156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2157
|
-
var contentHash = /* @__PURE__ */ __name(async (
|
|
2158
|
-
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(
|
|
2451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
|
|
2452
|
+
var contentHash = /* @__PURE__ */ __name(async (text6) => {
|
|
2453
|
+
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text6));
|
|
2159
2454
|
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2160
2455
|
}, "contentHash");
|
|
2161
2456
|
var speakerPosition = /* @__PURE__ */ __name((name, participants) => {
|
|
@@ -2190,7 +2485,7 @@ var timestamp2 = /* @__PURE__ */ __name((value) => {
|
|
|
2190
2485
|
return time;
|
|
2191
2486
|
}, "timestamp");
|
|
2192
2487
|
|
|
2193
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2488
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
|
|
2194
2489
|
var TranscriptTextError = class extends Error {
|
|
2195
2490
|
static {
|
|
2196
2491
|
__name(this, "TranscriptTextError");
|
|
@@ -2207,10 +2502,10 @@ var LINE = /^\[(\d{2,}):([0-5]\d):([0-5]\d)\]\s*(?:([^:\n]{1,60}):\s*)?([\s\S]*)
|
|
|
2207
2502
|
var RULE = /^[—–-]{10,}[^\n]*(?:\n|$)/;
|
|
2208
2503
|
var EMPTY = /* @__PURE__ */ new Set(["", "\u2014", "-"]);
|
|
2209
2504
|
var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
2210
|
-
const
|
|
2505
|
+
const text6 = input.replace(/^/, "").replace(/\r\n?/g, "\n");
|
|
2211
2506
|
const header = { title: null, date: null, meetingId: null, speakers: [] };
|
|
2212
2507
|
let sawHeader = false;
|
|
2213
|
-
for (const line2 of
|
|
2508
|
+
for (const line2 of text6.split("\n")) {
|
|
2214
2509
|
if (!line2.trim())
|
|
2215
2510
|
break;
|
|
2216
2511
|
for (const [prefix, key] of Object.entries(HEADER)) {
|
|
@@ -2227,7 +2522,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
|
2227
2522
|
if (!sawHeader)
|
|
2228
2523
|
throw new TranscriptTextError('a text transcript starts with a header such as "\u0412\u0441\u0442\u0440\u0435\u0447\u0430: \u2026"');
|
|
2229
2524
|
const found = [];
|
|
2230
|
-
for (const block of
|
|
2525
|
+
for (const block of text6.split(/\n\s*\n/)) {
|
|
2231
2526
|
const match = LINE.exec(block.trim().replace(RULE, ""));
|
|
2232
2527
|
if (!match)
|
|
2233
2528
|
continue;
|
|
@@ -2245,7 +2540,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
|
2245
2540
|
return { header, lines };
|
|
2246
2541
|
}, "parseTranscriptText");
|
|
2247
2542
|
|
|
2248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2543
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
|
|
2249
2544
|
var VttError = class extends Error {
|
|
2250
2545
|
static {
|
|
2251
2546
|
__name(this, "VttError");
|
|
@@ -2258,15 +2553,15 @@ var millis = /* @__PURE__ */ __name((stamp, lineNo) => {
|
|
|
2258
2553
|
const match = TIMESTAMP.exec(stamp);
|
|
2259
2554
|
if (!match)
|
|
2260
2555
|
throw new VttError(`line ${lineNo}: "${stamp}" is not a WebVTT timestamp`);
|
|
2261
|
-
const [, hours = "0", minutes = "0", seconds = "0",
|
|
2262
|
-
return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(
|
|
2556
|
+
const [, hours = "0", minutes = "0", seconds = "0", ms2 = "0"] = match;
|
|
2557
|
+
return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms2);
|
|
2263
2558
|
}, "millis");
|
|
2264
|
-
var splitSpeaker = /* @__PURE__ */ __name((
|
|
2265
|
-
const firstLine =
|
|
2559
|
+
var splitSpeaker = /* @__PURE__ */ __name((text6) => {
|
|
2560
|
+
const firstLine = text6.split("\n", 1)[0] ?? "";
|
|
2266
2561
|
const at = firstLine.indexOf(": ");
|
|
2267
2562
|
if (at <= 0)
|
|
2268
|
-
return { speaker: null, text:
|
|
2269
|
-
return { speaker: firstLine.slice(0, at).trim(), text:
|
|
2563
|
+
return { speaker: null, text: text6 };
|
|
2564
|
+
return { speaker: firstLine.slice(0, at).trim(), text: text6.slice(at + 2) };
|
|
2270
2565
|
}, "splitSpeaker");
|
|
2271
2566
|
var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
2272
2567
|
const lines = input.replace(/^/, "").split(/\r\n|\r|\n/);
|
|
@@ -2291,13 +2586,13 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
|
2291
2586
|
const lineNo = start + timingAt + 1;
|
|
2292
2587
|
const [from = "", rest = ""] = (block[timingAt] ?? "").split("-->");
|
|
2293
2588
|
const to = rest.trim().split(/\s+/)[0] ?? "";
|
|
2294
|
-
const
|
|
2295
|
-
cues.push({ startMs: millis(from.trim(), lineNo), endMs: millis(to, lineNo), ...splitSpeaker(
|
|
2589
|
+
const text6 = block.slice(timingAt + 1).join("\n").trim();
|
|
2590
|
+
cues.push({ startMs: millis(from.trim(), lineNo), endMs: millis(to, lineNo), ...splitSpeaker(text6) });
|
|
2296
2591
|
}
|
|
2297
2592
|
return cues;
|
|
2298
2593
|
}, "parseVtt");
|
|
2299
2594
|
|
|
2300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2595
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/import.js
|
|
2301
2596
|
var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
|
|
2302
2597
|
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
2303
2598
|
for (const file of files) {
|
|
@@ -2330,74 +2625,44 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
|
|
|
2330
2625
|
return report;
|
|
2331
2626
|
}, "importFiles");
|
|
2332
2627
|
|
|
2333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2628
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/links.js
|
|
2334
2629
|
var CHAT_MESSAGES_READ = 1e5;
|
|
2335
2630
|
|
|
2336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2337
|
-
var
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
if (create && result.title === void 0)
|
|
2349
|
-
throw new CliError("validation_error", "meeting title is required");
|
|
2350
|
-
if (change.kind !== void 0) {
|
|
2351
|
-
if (change.kind !== "instant" && change.kind !== "scheduled")
|
|
2352
|
-
throw new CliError("validation_error", "only instant or scheduled meeting kinds are supported");
|
|
2353
|
-
result.kind = change.kind;
|
|
2354
|
-
}
|
|
2355
|
-
if (change.startTime !== void 0) {
|
|
2356
|
-
result.startTime = meetingTimestamp(change.startTime, "meeting start");
|
|
2357
|
-
}
|
|
2358
|
-
if (change.durationMinutes !== void 0) {
|
|
2359
|
-
if (!Number.isSafeInteger(change.durationMinutes) || change.durationMinutes <= 0 || change.durationMinutes > 1440)
|
|
2360
|
-
throw new CliError("validation_error", "meeting duration must be an integer from 1 to 1440 minutes");
|
|
2361
|
-
result.durationMinutes = change.durationMinutes;
|
|
2362
|
-
}
|
|
2363
|
-
if (change.timezone !== void 0) {
|
|
2364
|
-
if (typeof change.timezone !== "string" || !change.timezone.trim())
|
|
2365
|
-
throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
|
|
2366
|
-
try {
|
|
2367
|
-
new Intl.DateTimeFormat("en", { timeZone: change.timezone }).format();
|
|
2368
|
-
} catch {
|
|
2369
|
-
throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
|
|
2370
|
-
}
|
|
2371
|
-
result.timezone = change.timezone;
|
|
2372
|
-
}
|
|
2373
|
-
if (change.agenda !== void 0) {
|
|
2374
|
-
if (typeof change.agenda !== "string")
|
|
2375
|
-
throw new CliError("validation_error", "meeting agenda must be text");
|
|
2376
|
-
result.agenda = change.agenda;
|
|
2377
|
-
}
|
|
2378
|
-
if (create) {
|
|
2379
|
-
result.kind ??= "scheduled";
|
|
2380
|
-
if (result.kind === "scheduled" && result.startTime === void 0)
|
|
2381
|
-
throw new CliError("validation_error", "scheduled meeting start is required");
|
|
2382
|
-
} else if (!Object.keys(result).length)
|
|
2383
|
-
throw new CliError("validation_error", "at least one meeting change is required");
|
|
2384
|
-
return Object.freeze(result);
|
|
2385
|
-
}, "validateMeetingChange");
|
|
2631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
|
|
2632
|
+
var MEETING_FIELD_KEYS = Object.freeze({
|
|
2633
|
+
title: "title",
|
|
2634
|
+
kind: "kind",
|
|
2635
|
+
startTime: "start_time",
|
|
2636
|
+
durationMinutes: "duration_minutes",
|
|
2637
|
+
timezone: "timezone",
|
|
2638
|
+
agenda: "agenda"
|
|
2639
|
+
});
|
|
2640
|
+
var MEETING_FIELDS2 = Object.freeze(Object.keys(MEETING_FIELD_KEYS));
|
|
2641
|
+
var meetingFieldFlag = /* @__PURE__ */ __name((field) => `--${MEETING_FIELD_KEYS[field].replaceAll("_", "-")}`, "meetingFieldFlag");
|
|
2642
|
+
var SNAKE_CASE2 = /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/;
|
|
2386
2643
|
|
|
2387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
2388
2645
|
var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
|
|
2389
2646
|
const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
|
|
2390
2647
|
if (![before, after].every((value) => Number.isSafeInteger(value) && value >= 0) || before + after > 999 || !Number.isSafeInteger(bytes) || bytes < 2 || bytes > 4194304 || !Number.isSafeInteger(max_read_bytes) || max_read_bytes < 1 || max_read_bytes > 67108864 || expected_fingerprint !== void 0 && (typeof expected_fingerprint !== "string" || !/^[a-f0-9]{64}$/.test(expected_fingerprint)))
|
|
2391
2648
|
throw new CliError("validation_error", "context takes 0\u2013999 surrounding cues, 2\u20134194304 output bytes and a bounded read budget");
|
|
2392
2649
|
return { before, after, bytes, max_read_bytes };
|
|
2393
2650
|
}, "meetingHitContextLimits");
|
|
2651
|
+
var MEETING_CUE_UNTRUSTED = ["speaker_name", "text"];
|
|
2652
|
+
var markedPassage = /* @__PURE__ */ __name((result) => ({
|
|
2653
|
+
...result,
|
|
2654
|
+
packet: {
|
|
2655
|
+
...result.packet,
|
|
2656
|
+
items: result.packet.items.map((cue2) => ({ ...cue2, untrusted: [...MEETING_CUE_UNTRUSTED] }))
|
|
2657
|
+
}
|
|
2658
|
+
}), "markedPassage");
|
|
2394
2659
|
var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
|
|
2395
2660
|
meetingHitContextLimits(options);
|
|
2396
2661
|
if (typeof reference2 !== "string" || !reference2.trim() || reference2.length > 200 || options.format !== void 0 && !["json", "text", "markdown"].includes(options.format))
|
|
2397
2662
|
throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
|
|
2398
2663
|
}, "validateMeetingPassage");
|
|
2399
2664
|
|
|
2400
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2665
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
|
|
2401
2666
|
var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
2402
2667
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
2403
2668
|
throw new CliError("validation_error", "meeting preparation context is required");
|
|
@@ -2422,43 +2687,43 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
|
2422
2687
|
return { ...input, limit, maxReadBytes };
|
|
2423
2688
|
}, "validateMeetingPreparationContext");
|
|
2424
2689
|
|
|
2425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2426
|
-
var
|
|
2427
|
-
var
|
|
2690
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
|
|
2691
|
+
var count4 = pipe(number(), integer(), minValue(0));
|
|
2692
|
+
var id2 = pipe(string(), minLength(1));
|
|
2428
2693
|
var meetingProjectEvidence = strictObject({
|
|
2429
2694
|
schema_version: literal(1),
|
|
2430
2695
|
kind: literal("meeting_project_evidence"),
|
|
2431
|
-
account_id:
|
|
2696
|
+
account_id: id2,
|
|
2432
2697
|
query: string(),
|
|
2433
|
-
project: strictObject({ id, name: string(), key: nullable(string()) }),
|
|
2698
|
+
project: strictObject({ id: id2, name: string(), key: nullable(string()) }),
|
|
2434
2699
|
term: strictObject({
|
|
2435
2700
|
name: string(),
|
|
2436
2701
|
kind: picklist(["canonical", "key", "alias"]),
|
|
2437
|
-
alias_id: optional(
|
|
2702
|
+
alias_id: optional(id2)
|
|
2438
2703
|
}),
|
|
2439
2704
|
hits: array(meetingHit),
|
|
2440
2705
|
association: literal("unconfirmed-word-evidence"),
|
|
2441
|
-
vocabulary_fingerprint:
|
|
2706
|
+
vocabulary_fingerprint: id2,
|
|
2442
2707
|
selection: strictObject({
|
|
2443
|
-
meeting_id: optional(
|
|
2444
|
-
identity_id: optional(
|
|
2445
|
-
person_id: optional(
|
|
2446
|
-
tag_id: optional(
|
|
2447
|
-
event_id: optional(
|
|
2448
|
-
series_id: optional(
|
|
2708
|
+
meeting_id: optional(id2),
|
|
2709
|
+
identity_id: optional(id2),
|
|
2710
|
+
person_id: optional(id2),
|
|
2711
|
+
tag_id: optional(id2),
|
|
2712
|
+
event_id: optional(id2),
|
|
2713
|
+
series_id: optional(id2),
|
|
2449
2714
|
since: optional(isoTime),
|
|
2450
2715
|
until: optional(isoTime)
|
|
2451
2716
|
}),
|
|
2452
|
-
limits: strictObject({ limit:
|
|
2717
|
+
limits: strictObject({ limit: count4, max_read_bytes: count4, max_vocabulary_read_bytes: count4, max_terms: count4 }),
|
|
2453
2718
|
page: pageSchema,
|
|
2454
2719
|
coverage: strictObject({
|
|
2455
2720
|
archive_completeness: literal("unknown"),
|
|
2456
2721
|
current_revisions: literal(true),
|
|
2457
2722
|
indexing: picklist(["ready", "pending"]),
|
|
2458
2723
|
index_completeness: literal("unknown"),
|
|
2459
|
-
term_index:
|
|
2460
|
-
terms_total:
|
|
2461
|
-
remaining_terms:
|
|
2724
|
+
term_index: count4,
|
|
2725
|
+
terms_total: count4,
|
|
2726
|
+
remaining_terms: count4,
|
|
2462
2727
|
duplicates: literal("may-repeat-between-terms")
|
|
2463
2728
|
})
|
|
2464
2729
|
});
|
|
@@ -2543,7 +2808,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
|
|
|
2543
2808
|
};
|
|
2544
2809
|
}, "meetingProjectEvidenceAnswer");
|
|
2545
2810
|
|
|
2546
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
|
|
2547
2812
|
var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
2548
2813
|
const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
|
|
2549
2814
|
if (typeof query !== "string" || !query.trim() || query.includes("\0") || new TextEncoder().encode(query).byteLength > 65536 || !integer3(options.limit ?? 100, 1, 1e3) || !integer3(options.maxReadBytes ?? 4194304, 1, 67108864) || [
|
|
@@ -2563,7 +2828,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
|
2563
2828
|
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
2564
2829
|
}, "validateMeetingHitSearch");
|
|
2565
2830
|
|
|
2566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
|
|
2567
2832
|
var ids = {
|
|
2568
2833
|
meeting_id: "meetingId",
|
|
2569
2834
|
identity_id: "participantIdentityId",
|
|
@@ -2654,7 +2919,7 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {
|
|
|
2654
2919
|
return { project: project.trim(), options, query: frozen.join(" AND ") };
|
|
2655
2920
|
}, "prepareMeetingProjectEvidence");
|
|
2656
2921
|
|
|
2657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
|
|
2658
2923
|
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
|
|
2659
2924
|
const prepared = prepareMeetingProjectEvidence(project, request, now);
|
|
2660
2925
|
const page = await read(prepared.project, prepared.options);
|
|
@@ -2662,7 +2927,7 @@ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, re
|
|
|
2662
2927
|
return meetingProjectEvidenceAnswer(page, prepared);
|
|
2663
2928
|
}, "readMeetingProjectEvidence");
|
|
2664
2929
|
|
|
2665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2930
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/pull.js
|
|
2666
2931
|
var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
|
|
2667
2932
|
const { identityExternalId, phone, ...fields } = p;
|
|
2668
2933
|
const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
|
|
@@ -2686,7 +2951,7 @@ var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount
|
|
|
2686
2951
|
throw new Error("Meeting ends before it starts");
|
|
2687
2952
|
const keptEnd = kept?.endedAt ?? null;
|
|
2688
2953
|
const endedAt = given ?? (keptEnd !== null && keptEnd >= startedAt ? keptEnd : null);
|
|
2689
|
-
const
|
|
2954
|
+
const count7 = participantsCount === null && kept ? kept.participantsCount : participantsCount;
|
|
2690
2955
|
const metadata = kept?.metadata && m.metadata ? { ...kept.metadata, ...m.metadata } : m.metadata ?? kept?.metadata ?? null;
|
|
2691
2956
|
const meeting2 = {
|
|
2692
2957
|
accountId,
|
|
@@ -2700,7 +2965,8 @@ var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount
|
|
|
2700
2965
|
durationMs: endedAt === null ? null : endedAt - startedAt,
|
|
2701
2966
|
timezone: m.timezone ?? kept?.timezone ?? null,
|
|
2702
2967
|
hostIdentityId: kept?.hostIdentityId ?? null,
|
|
2703
|
-
...
|
|
2968
|
+
...count7 === void 0 ? {} : { participantsCount: count7 },
|
|
2969
|
+
...m.call ? { direction: m.call.direction ?? null, clientPhone: m.call.clientPhone ?? null } : {},
|
|
2704
2970
|
metadata,
|
|
2705
2971
|
deletedAt: null
|
|
2706
2972
|
};
|
|
@@ -2718,10 +2984,10 @@ var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount
|
|
|
2718
2984
|
};
|
|
2719
2985
|
return meeting2;
|
|
2720
2986
|
}, "sourceMeetingInput");
|
|
2721
|
-
var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m,
|
|
2722
|
-
const
|
|
2723
|
-
const { participants: sourceParticipants, transcript: lines, chat, summary } =
|
|
2724
|
-
const participants = participantInputs(source.provider,
|
|
2987
|
+
var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts, { accountId, now, kept }) => {
|
|
2988
|
+
const id4 = m.occurrence.id;
|
|
2989
|
+
const { participants: sourceParticipants, transcript: lines, chat, summary } = parts;
|
|
2990
|
+
const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], accountId);
|
|
2725
2991
|
const meeting2 = sourceMeetingInput(m, accountId, sourceParticipants === void 0 ? void 0 : sourceParticipants?.length ?? null, kept);
|
|
2726
2992
|
const linked = sourceParticipants !== void 0;
|
|
2727
2993
|
const format = source.transcriptFormat ?? null;
|
|
@@ -2751,8 +3017,8 @@ var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts2,
|
|
|
2751
3017
|
metadata: summary.metadata ?? null
|
|
2752
3018
|
}
|
|
2753
3019
|
] : void 0,
|
|
2754
|
-
attachments:
|
|
2755
|
-
documents:
|
|
3020
|
+
attachments: parts.files ?? void 0,
|
|
3021
|
+
documents: parts.documents ?? void 0,
|
|
2756
3022
|
now
|
|
2757
3023
|
});
|
|
2758
3024
|
if (lines && !linked && !details.transcripts.some((t) => t.transcript.source === source.name && t.transcript.supersededAt === null))
|
|
@@ -2771,11 +3037,11 @@ var startOf = /* @__PURE__ */ __name((m) => {
|
|
|
2771
3037
|
}, "startOf");
|
|
2772
3038
|
var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
2773
3039
|
const now = options.now ?? Date.now();
|
|
2774
|
-
for (const [name,
|
|
3040
|
+
for (const [name, ms2] of [
|
|
2775
3041
|
["lookbackMs", options.lookbackMs ?? 0],
|
|
2776
3042
|
["overlapMs", source.overlapMs ?? 0]
|
|
2777
3043
|
])
|
|
2778
|
-
if (!Number.isSafeInteger(
|
|
3044
|
+
if (!Number.isSafeInteger(ms2) || ms2 < 0 || ms2 > 31 * 864e5)
|
|
2779
3045
|
throw new Error(`${name} must be an integer from 0 through 31 days`);
|
|
2780
3046
|
const lookbackMs = Math.max(options.lookbackMs ?? 0, source.overlapMs ?? 0);
|
|
2781
3047
|
const cursor = options.rescan ? void 0 : await store.cursor(options.accountId);
|
|
@@ -2810,7 +3076,7 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2810
3076
|
await linkCallers();
|
|
2811
3077
|
return report;
|
|
2812
3078
|
}
|
|
2813
|
-
const
|
|
3079
|
+
const id4 = m.occurrence.id;
|
|
2814
3080
|
const failedHere = /* @__PURE__ */ __name(() => {
|
|
2815
3081
|
failed = true;
|
|
2816
3082
|
firstFailed ??= startOf(m);
|
|
@@ -2821,13 +3087,13 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2821
3087
|
} catch (error) {
|
|
2822
3088
|
failedHere();
|
|
2823
3089
|
const message = error instanceof Error ? error.message : "could not be read";
|
|
2824
|
-
report.warnings.push({ externalId:
|
|
3090
|
+
report.warnings.push({ externalId: id4, message: `${part}: ${message}` });
|
|
2825
3091
|
return void 0;
|
|
2826
3092
|
}
|
|
2827
3093
|
}, "read");
|
|
2828
3094
|
try {
|
|
2829
|
-
const sourceParticipants = await read("participants", () => source.participants(
|
|
2830
|
-
const participants = participantInputs(source.provider,
|
|
3095
|
+
const sourceParticipants = await read("participants", () => source.participants(id4));
|
|
3096
|
+
const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], options.accountId);
|
|
2831
3097
|
const names = /* @__PURE__ */ new Map();
|
|
2832
3098
|
for (const p of participants)
|
|
2833
3099
|
if (p.displayName !== null) {
|
|
@@ -2836,13 +3102,13 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2836
3102
|
names.set(p.displayName, identities);
|
|
2837
3103
|
}
|
|
2838
3104
|
if ([...names.values()].some((ids2) => ids2.size > 1))
|
|
2839
|
-
report.warnings.push({ externalId:
|
|
2840
|
-
const lines = await read("transcript", () => source.transcript(
|
|
2841
|
-
const chat = await read("chat", () => source.chat(
|
|
2842
|
-
const summary = await read("summary", () => source.summary(
|
|
2843
|
-
const attachments = await read("files", () => source.files(
|
|
3105
|
+
report.warnings.push({ externalId: id4, message: "Participant names are ambiguous" });
|
|
3106
|
+
const lines = await read("transcript", () => source.transcript(id4));
|
|
3107
|
+
const chat = await read("chat", () => source.chat(id4));
|
|
3108
|
+
const summary = await read("summary", () => source.summary(id4));
|
|
3109
|
+
const attachments = await read("files", () => source.files(id4));
|
|
2844
3110
|
const listDocuments = source.documents?.bind(source);
|
|
2845
|
-
const documents = listDocuments ? await read("documents", () => listDocuments(
|
|
3111
|
+
const documents = listDocuments ? await read("documents", () => listDocuments(id4)) : void 0;
|
|
2846
3112
|
await saveSourceMeeting(source, store, m, { participants: sourceParticipants, transcript: lines, chat, summary, files: attachments, documents }, { accountId: options.accountId, now });
|
|
2847
3113
|
for (const p of participants)
|
|
2848
3114
|
if (p.identity.phone)
|
|
@@ -2853,7 +3119,7 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2853
3119
|
report.summaries += summary ? 1 : 0;
|
|
2854
3120
|
} catch (error) {
|
|
2855
3121
|
failedHere();
|
|
2856
|
-
report.warnings.push({ externalId:
|
|
3122
|
+
report.warnings.push({ externalId: id4, message: error instanceof Error ? error.message : "Meeting pull failed" });
|
|
2857
3123
|
}
|
|
2858
3124
|
}
|
|
2859
3125
|
await linkCallers();
|
|
@@ -2862,23 +3128,23 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2862
3128
|
return report;
|
|
2863
3129
|
}, "pull");
|
|
2864
3130
|
|
|
2865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
|
|
2866
3132
|
var text3 = string();
|
|
2867
|
-
var
|
|
2868
|
-
var
|
|
2869
|
-
var iso3 = /* @__PURE__ */ __name((
|
|
3133
|
+
var count5 = pipe(number(), integer(), minValue(0));
|
|
3134
|
+
var id3 = pipe(number(), integer(), minValue(1));
|
|
3135
|
+
var iso3 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
|
|
2870
3136
|
var meetingReview = strictObject({
|
|
2871
3137
|
ref: reference,
|
|
2872
3138
|
id: pipe(string(), minLength(1)),
|
|
2873
3139
|
title: nullable(text3),
|
|
2874
3140
|
started_at: nullable(isoTime),
|
|
2875
|
-
duration_ms: nullable(
|
|
2876
|
-
participants_count: nullable(
|
|
3141
|
+
duration_ms: nullable(count5),
|
|
3142
|
+
participants_count: nullable(count5),
|
|
2877
3143
|
projects: array(text3),
|
|
2878
3144
|
/** Null when the meeting has no current transcript. */
|
|
2879
|
-
transcript: nullable(strictObject({ lines:
|
|
3145
|
+
transcript: nullable(strictObject({ lines: count5, words: count5 })),
|
|
2880
3146
|
/** The three who talked longest. */
|
|
2881
|
-
speakers: array(strictObject({ name: nullable(text3), talk_ms:
|
|
3147
|
+
speakers: array(strictObject({ name: nullable(text3), talk_ms: count5 })),
|
|
2882
3148
|
/** The newest stored summary; null when there is none. */
|
|
2883
3149
|
summary: nullable(strictObject({
|
|
2884
3150
|
source: text3,
|
|
@@ -2893,7 +3159,7 @@ var meetingLink = strictObject({
|
|
|
2893
3159
|
domain: nullable(text3),
|
|
2894
3160
|
/** The Google Docs, Sheets, Slides, Forms or Drive file it names. */
|
|
2895
3161
|
document_id: nullable(text3),
|
|
2896
|
-
count:
|
|
3162
|
+
count: count5,
|
|
2897
3163
|
first_at: isoTime,
|
|
2898
3164
|
last_at: isoTime,
|
|
2899
3165
|
senders: array(text3),
|
|
@@ -2903,39 +3169,39 @@ var meetingSpeaker = strictObject({
|
|
|
2903
3169
|
/** `person:<id>`, `identity:<id>`, `name:<lowercased name>` or `unknown`. */
|
|
2904
3170
|
key: text3,
|
|
2905
3171
|
name: nullable(text3),
|
|
2906
|
-
person_id: nullable(
|
|
2907
|
-
identity_id: nullable(
|
|
2908
|
-
meetings:
|
|
2909
|
-
lines:
|
|
2910
|
-
words:
|
|
2911
|
-
talk_ms:
|
|
3172
|
+
person_id: nullable(id3),
|
|
3173
|
+
identity_id: nullable(id3),
|
|
3174
|
+
meetings: count5,
|
|
3175
|
+
lines: count5,
|
|
3176
|
+
words: count5,
|
|
3177
|
+
talk_ms: count5,
|
|
2912
3178
|
/** This speaker's part of all talk time, 0–1. */
|
|
2913
3179
|
share: pipe(number(), minValue(0), maxValue(1))
|
|
2914
3180
|
});
|
|
2915
3181
|
var meetingStats = strictObject({
|
|
2916
3182
|
time_zone: text3,
|
|
2917
|
-
meetings:
|
|
2918
|
-
lines:
|
|
2919
|
-
words:
|
|
2920
|
-
talk_ms:
|
|
3183
|
+
meetings: count5,
|
|
3184
|
+
lines: count5,
|
|
3185
|
+
words: count5,
|
|
3186
|
+
talk_ms: count5,
|
|
2921
3187
|
/** `week_start` is the Monday, as a date in `time_zone`. */
|
|
2922
|
-
weeks: array(strictObject({ week_start: text3, meetings:
|
|
3188
|
+
weeks: array(strictObject({ week_start: text3, meetings: count5, talk_ms: count5 })),
|
|
2923
3189
|
top_speakers: array(meetingSpeaker)
|
|
2924
3190
|
});
|
|
2925
3191
|
var meetingCountsRow = strictObject({
|
|
2926
3192
|
key: text3,
|
|
2927
3193
|
name: nullable(text3),
|
|
2928
|
-
meetings:
|
|
2929
|
-
minutes:
|
|
3194
|
+
meetings: count5,
|
|
3195
|
+
minutes: count5,
|
|
2930
3196
|
mean_minutes: nullable(number()),
|
|
2931
|
-
transcripts:
|
|
3197
|
+
transcripts: count5
|
|
2932
3198
|
});
|
|
2933
3199
|
var meetingCounts = strictObject({
|
|
2934
3200
|
by: picklist(["day", "week", "series"]),
|
|
2935
|
-
meetings:
|
|
2936
|
-
minutes:
|
|
3201
|
+
meetings: count5,
|
|
3202
|
+
minutes: count5,
|
|
2937
3203
|
mean_minutes: nullable(number()),
|
|
2938
|
-
transcripts:
|
|
3204
|
+
transcripts: count5,
|
|
2939
3205
|
rows: array(meetingCountsRow),
|
|
2940
3206
|
has_more: boolean()
|
|
2941
3207
|
});
|
|
@@ -2943,27 +3209,28 @@ var truncated = /* @__PURE__ */ __name((...why) => nullable(picklist(why)), "tru
|
|
|
2943
3209
|
var meetingParticipants = strictObject({
|
|
2944
3210
|
schema_version: literal(1),
|
|
2945
3211
|
kind: literal("meeting_participants"),
|
|
2946
|
-
account_id:
|
|
3212
|
+
account_id: id3,
|
|
2947
3213
|
query: text3,
|
|
2948
3214
|
items: array(strictObject({
|
|
2949
|
-
participant_id:
|
|
2950
|
-
meeting_id:
|
|
2951
|
-
identity_id:
|
|
3215
|
+
participant_id: id3,
|
|
3216
|
+
meeting_id: id3,
|
|
3217
|
+
identity_id: id3,
|
|
2952
3218
|
display_name: nullable(text3),
|
|
2953
3219
|
email: nullable(text3),
|
|
2954
|
-
person: nullable(strictObject({ ref: text3, name: nullable(text3) }))
|
|
3220
|
+
person: nullable(strictObject({ ref: text3, name: nullable(text3) })),
|
|
3221
|
+
untrusted: optional(array(text3))
|
|
2955
3222
|
})),
|
|
2956
3223
|
/** Several identities on one page are observations, never speaker attribution or person links. */
|
|
2957
|
-
ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(
|
|
3224
|
+
ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id3) }),
|
|
2958
3225
|
coverage: strictObject({
|
|
2959
|
-
scanned:
|
|
2960
|
-
read_bytes:
|
|
3226
|
+
scanned: count5,
|
|
3227
|
+
read_bytes: count5,
|
|
2961
3228
|
archive_completeness: literal("unknown"),
|
|
2962
3229
|
truncated_by: truncated("limit", "scan_limit", "read_bytes")
|
|
2963
3230
|
}),
|
|
2964
3231
|
page: strictObject({
|
|
2965
3232
|
mode: literal("cursor"),
|
|
2966
|
-
limit:
|
|
3233
|
+
limit: count5,
|
|
2967
3234
|
has_more: boolean(),
|
|
2968
3235
|
next_cursor: optional(text3)
|
|
2969
3236
|
})
|
|
@@ -2977,12 +3244,12 @@ var meetingPassage = strictObject({
|
|
|
2977
3244
|
target_fingerprint: text3,
|
|
2978
3245
|
fingerprint: text3,
|
|
2979
3246
|
revision,
|
|
2980
|
-
limits: strictObject({ before:
|
|
2981
|
-
content_bytes:
|
|
3247
|
+
limits: strictObject({ before: count5, after: count5, bytes: count5, max_read_bytes: count5 }),
|
|
3248
|
+
content_bytes: count5,
|
|
2982
3249
|
coverage: strictObject({
|
|
2983
|
-
included:
|
|
2984
|
-
before:
|
|
2985
|
-
after:
|
|
3250
|
+
included: count5,
|
|
3251
|
+
before: count5,
|
|
3252
|
+
after: count5,
|
|
2986
3253
|
has_before: boolean(),
|
|
2987
3254
|
has_after: boolean(),
|
|
2988
3255
|
truncated_by: truncated("bytes"),
|
|
@@ -2995,15 +3262,17 @@ var meetingPassage = strictObject({
|
|
|
2995
3262
|
items: array(strictObject({
|
|
2996
3263
|
ref: reference,
|
|
2997
3264
|
fingerprint: text3,
|
|
2998
|
-
transcript_id:
|
|
3265
|
+
transcript_id: id3,
|
|
2999
3266
|
content_hash: nullable(text3),
|
|
3000
|
-
position:
|
|
3001
|
-
start_ms:
|
|
3002
|
-
end_ms:
|
|
3003
|
-
speaker_participant_id: nullable(
|
|
3267
|
+
position: count5,
|
|
3268
|
+
start_ms: count5,
|
|
3269
|
+
end_ms: count5,
|
|
3270
|
+
speaker_participant_id: nullable(id3),
|
|
3004
3271
|
speaker_name: nullable(text3),
|
|
3005
3272
|
text: text3,
|
|
3006
|
-
revision
|
|
3273
|
+
revision,
|
|
3274
|
+
/** What people said: `speaker_name` and `text`. */
|
|
3275
|
+
untrusted: optional(array(text3))
|
|
3007
3276
|
}))
|
|
3008
3277
|
});
|
|
3009
3278
|
var event = strictObject({
|
|
@@ -3057,13 +3326,14 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
|
3057
3326
|
updated_at: new Date(one.updatedAt).toISOString()
|
|
3058
3327
|
}), "eventItem");
|
|
3059
3328
|
|
|
3060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/read-through.js
|
|
3061
3330
|
var MEETING_SERVER_BOUNDS = { calls: 3, pages: 2 };
|
|
3062
3331
|
var ISSUES = {
|
|
3063
3332
|
offline: ["permission_error", "meetings.server-offline"],
|
|
3064
3333
|
unreachable: ["network_error", "meetings.server-unreachable"],
|
|
3065
3334
|
not_signed_in: ["authentication_error", "meetings.server-signed-out"],
|
|
3066
3335
|
refused: ["permission_error", "meetings.server-refused"],
|
|
3336
|
+
rate_limited: ["rate_limited", "meetings.server-rate-limited"],
|
|
3067
3337
|
failed: ["provider_error", "meetings.server-failed"]
|
|
3068
3338
|
};
|
|
3069
3339
|
var metaOf = /* @__PURE__ */ __name((reason, provider) => {
|
|
@@ -3076,6 +3346,7 @@ var WHY = {
|
|
|
3076
3346
|
unreachable: /* @__PURE__ */ __name((provider) => `${provider} could not be reached \u2014 the answer is the store's`, "unreachable"),
|
|
3077
3347
|
not_signed_in: /* @__PURE__ */ __name((provider) => `not signed in to ${provider} \u2014 the answer is the store's`, "not_signed_in"),
|
|
3078
3348
|
refused: /* @__PURE__ */ __name((provider) => `${provider} refused the request \u2014 the answer is the store's`, "refused"),
|
|
3349
|
+
rate_limited: /* @__PURE__ */ __name((provider) => `${provider} asked to wait before more requests \u2014 the answer is the store's`, "rate_limited"),
|
|
3079
3350
|
failed: /* @__PURE__ */ __name((provider) => `${provider} could not be read \u2014 the answer is the store's`, "failed"),
|
|
3080
3351
|
no_upcoming: /* @__PURE__ */ __name((provider) => `${provider} lists no meeting before it starts \u2014 upcoming ones are not in the answer`, "no_upcoming")
|
|
3081
3352
|
};
|
|
@@ -3087,6 +3358,8 @@ var reasonOf = /* @__PURE__ */ __name((error) => {
|
|
|
3087
3358
|
return "refused";
|
|
3088
3359
|
if (code === "network_error")
|
|
3089
3360
|
return "unreachable";
|
|
3361
|
+
if (code === "rate_limited")
|
|
3362
|
+
return "rate_limited";
|
|
3090
3363
|
return "failed";
|
|
3091
3364
|
}, "reasonOf");
|
|
3092
3365
|
var refusal = /* @__PURE__ */ __name((reason, provider, error) => error ?? new CliError("validation_error", `--backend server: ${WHY[reason](provider).replace(/ — .*$/, "")}; use --backend archive or both`, { reason }), "refusal");
|
|
@@ -3141,9 +3414,9 @@ var stepFor = /* @__PURE__ */ __name((backend) => ({
|
|
|
3141
3414
|
found: /* @__PURE__ */ new Map(),
|
|
3142
3415
|
missing: []
|
|
3143
3416
|
}), "stepFor");
|
|
3144
|
-
var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found,
|
|
3417
|
+
var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found, parts, fresh = false) => {
|
|
3145
3418
|
const stored = await storedByExternalId(store, accountId, found.meeting.occurrence.id);
|
|
3146
|
-
const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting,
|
|
3419
|
+
const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting, parts, {
|
|
3147
3420
|
accountId,
|
|
3148
3421
|
now,
|
|
3149
3422
|
...stored ? { kept: stored.meeting } : {}
|
|
@@ -3249,6 +3522,13 @@ var askServerForList = /* @__PURE__ */ __name(async (source, store, accountId, q
|
|
|
3249
3522
|
return step;
|
|
3250
3523
|
}, "askServerForList");
|
|
3251
3524
|
var meetingsListThrough = /* @__PURE__ */ __name(async (source, store, filter, access) => {
|
|
3525
|
+
const listed2 = await listThrough(source, store, filter, access);
|
|
3526
|
+
if (!filter.query || !readsZone(filter.query, MEETING_TIMES))
|
|
3527
|
+
return listed2;
|
|
3528
|
+
return { ...listed2, meta: { ...listed2.meta, timezone: timezoneOf(access.timezone) } };
|
|
3529
|
+
}, "meetingsListThrough");
|
|
3530
|
+
var MEETING_TIMES = new Set(MEETING_QUERY.fields.filter(({ type }) => type === "time").map(({ name }) => name));
|
|
3531
|
+
var listThrough = /* @__PURE__ */ __name(async (source, store, filter, access) => {
|
|
3252
3532
|
const now = access.now ?? Date.now();
|
|
3253
3533
|
const zoned = { ...filter, timezone: timezoneOf(access.timezone), now };
|
|
3254
3534
|
const step = await askServerForList(source, store, filter.accountId, filter.query, { ...access, now });
|
|
@@ -3268,22 +3548,22 @@ var meetingsListThrough = /* @__PURE__ */ __name(async (source, store, filter, a
|
|
|
3268
3548
|
items: list.items.map((item) => ({ ...item, found_in: step.found.get(Number(item.id)) ?? "archive" })),
|
|
3269
3549
|
...extras
|
|
3270
3550
|
};
|
|
3271
|
-
}, "
|
|
3551
|
+
}, "listThrough");
|
|
3272
3552
|
var storedMeeting = /* @__PURE__ */ __name(async (store, accountId, meeting2) => {
|
|
3273
|
-
const
|
|
3553
|
+
const text6 = meeting2.trim();
|
|
3274
3554
|
const own = /* @__PURE__ */ __name((details) => details?.meeting.accountId === accountId ? details : null, "own");
|
|
3275
|
-
if (/^[1-9]\d*$/.test(
|
|
3276
|
-
const byNumber = own(await store.meeting(Number(
|
|
3555
|
+
if (/^[1-9]\d*$/.test(text6) && Number.isSafeInteger(Number(text6))) {
|
|
3556
|
+
const byNumber = own(await store.meeting(Number(text6)));
|
|
3277
3557
|
if (byNumber)
|
|
3278
3558
|
return byNumber;
|
|
3279
3559
|
}
|
|
3280
|
-
if (
|
|
3281
|
-
const reference2 = parseMeetingReference(
|
|
3560
|
+
if (text6.startsWith("meeting:")) {
|
|
3561
|
+
const reference2 = parseMeetingReference(text6);
|
|
3282
3562
|
if (reference2.accountId !== accountId)
|
|
3283
3563
|
throw new MeetingError("not_found", "meeting not found");
|
|
3284
3564
|
return own(await store.meeting(reference2.meetingId));
|
|
3285
3565
|
}
|
|
3286
|
-
return store.meetingByExternalId ? own(await store.meetingByExternalId(accountId,
|
|
3566
|
+
return store.meetingByExternalId ? own(await store.meetingByExternalId(accountId, text6)) : null;
|
|
3287
3567
|
}, "storedMeeting");
|
|
3288
3568
|
var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId, meeting2, access) => {
|
|
3289
3569
|
if (!meeting2.trim())
|
|
@@ -3338,10 +3618,10 @@ var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId,
|
|
|
3338
3618
|
return { details: fresh, foundIn: step.found.get(details.meeting.id) ?? "server", server: step.report };
|
|
3339
3619
|
}, "meetingShowThrough");
|
|
3340
3620
|
|
|
3341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
|
|
3342
3622
|
var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
|
|
3343
3623
|
|
|
3344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
|
|
3345
3625
|
var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
3346
3626
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
3347
3627
|
throw new CliError("validation_error", "related history request is required");
|
|
@@ -3352,7 +3632,7 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
3352
3632
|
const positive = /* @__PURE__ */ __name((value) => Number.isSafeInteger(value) && value > 0, "positive");
|
|
3353
3633
|
if (!positive(input.accountId) || !positive(input.seriesId))
|
|
3354
3634
|
throw new CliError("validation_error", "accountId and seriesId must be positive safe integers");
|
|
3355
|
-
if (!Array.isArray(input.anchorIds) || input.anchorIds.length > 20 || input.anchorIds.some((
|
|
3635
|
+
if (!Array.isArray(input.anchorIds) || input.anchorIds.length > 20 || input.anchorIds.some((id4) => !positive(id4)))
|
|
3356
3636
|
throw new CliError("validation_error", "anchorIds must contain at most 20 positive safe integers");
|
|
3357
3637
|
for (const key of ["after", "before"])
|
|
3358
3638
|
if (!Number.isSafeInteger(input[key]) || Math.abs(input[key]) > 864e13)
|
|
@@ -3371,23 +3651,29 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
3371
3651
|
return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
|
|
3372
3652
|
}, "validateMeetingRelatedHistory");
|
|
3373
3653
|
|
|
3374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3654
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
|
|
3375
3655
|
var text4 = string();
|
|
3376
3656
|
var identifier = pipe(text4, minLength(1));
|
|
3377
3657
|
var nullableText = nullable(text4);
|
|
3378
|
-
var
|
|
3658
|
+
var count6 = pipe(number(), integer(), minValue(0));
|
|
3379
3659
|
var flag = boolean();
|
|
3380
3660
|
var scope = strictObject({ provider: text4, account: text4 });
|
|
3381
3661
|
var run = strictObject({
|
|
3382
|
-
meetings:
|
|
3383
|
-
participants:
|
|
3384
|
-
transcript_rows:
|
|
3385
|
-
summaries:
|
|
3662
|
+
meetings: count6,
|
|
3663
|
+
participants: count6,
|
|
3664
|
+
transcript_rows: count6,
|
|
3665
|
+
summaries: count6,
|
|
3386
3666
|
warnings: array(strictObject({ external_id: text4, message: text4 })),
|
|
3387
3667
|
timezone: optional(text4)
|
|
3388
3668
|
});
|
|
3389
3669
|
var exported = union([
|
|
3390
|
-
strictObject({
|
|
3670
|
+
strictObject({
|
|
3671
|
+
meeting_id: identifier,
|
|
3672
|
+
format: picklist(["markdown", "vtt"]),
|
|
3673
|
+
filename: text4,
|
|
3674
|
+
content: text4,
|
|
3675
|
+
untrusted: optional(array(text4))
|
|
3676
|
+
}),
|
|
3391
3677
|
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), output: text4 })
|
|
3392
3678
|
]);
|
|
3393
3679
|
var eventChange = strictObject({
|
|
@@ -3435,15 +3721,15 @@ var transcription = union([
|
|
|
3435
3721
|
applied: literal(false),
|
|
3436
3722
|
account_id: identifier,
|
|
3437
3723
|
external_id: text4,
|
|
3438
|
-
segments:
|
|
3724
|
+
segments: count6,
|
|
3439
3725
|
media: strictObject({
|
|
3440
3726
|
id: text4,
|
|
3441
3727
|
content_hash: text4,
|
|
3442
|
-
size:
|
|
3443
|
-
duration_ms:
|
|
3728
|
+
size: count6,
|
|
3729
|
+
duration_ms: count6,
|
|
3444
3730
|
format: text4,
|
|
3445
|
-
sample_rate:
|
|
3446
|
-
channels:
|
|
3731
|
+
sample_rate: count6,
|
|
3732
|
+
channels: count6,
|
|
3447
3733
|
recognition
|
|
3448
3734
|
})
|
|
3449
3735
|
}),
|
|
@@ -3453,10 +3739,10 @@ var transcription = union([
|
|
|
3453
3739
|
external_id: text4,
|
|
3454
3740
|
meeting_id: identifier,
|
|
3455
3741
|
created: flag,
|
|
3456
|
-
inserted_transcripts:
|
|
3457
|
-
replayed_transcripts:
|
|
3458
|
-
superseded_transcripts:
|
|
3459
|
-
segments:
|
|
3742
|
+
inserted_transcripts: count6,
|
|
3743
|
+
replayed_transcripts: count6,
|
|
3744
|
+
superseded_transcripts: count6,
|
|
3745
|
+
segments: count6,
|
|
3460
3746
|
media_sha256: text4,
|
|
3461
3747
|
engine: text4,
|
|
3462
3748
|
model: text4,
|
|
@@ -3464,12 +3750,12 @@ var transcription = union([
|
|
|
3464
3750
|
timing: picklist(["fixed-windows", "recognition-segments"])
|
|
3465
3751
|
})
|
|
3466
3752
|
]);
|
|
3467
|
-
var embeddingModel = strictObject({ key: text4, dims:
|
|
3753
|
+
var embeddingModel = strictObject({ key: text4, dims: count6, kind: picklist(["local", "remote"]), model: text4 });
|
|
3468
3754
|
var embedding = union([
|
|
3469
3755
|
strictObject({
|
|
3470
3756
|
account_id: identifier,
|
|
3471
3757
|
model: embeddingModel,
|
|
3472
|
-
status: strictObject({ chunks:
|
|
3758
|
+
status: strictObject({ chunks: count6, embedded: count6 }),
|
|
3473
3759
|
applied: literal(false),
|
|
3474
3760
|
scope: literal("existing-current-chunks"),
|
|
3475
3761
|
rebuild_required: literal("explicit")
|
|
@@ -3477,14 +3763,14 @@ var embedding = union([
|
|
|
3477
3763
|
strictObject({
|
|
3478
3764
|
account_id: identifier,
|
|
3479
3765
|
model: embeddingModel,
|
|
3480
|
-
saved:
|
|
3481
|
-
skipped:
|
|
3766
|
+
saved: count6,
|
|
3767
|
+
skipped: count6,
|
|
3482
3768
|
has_more: flag,
|
|
3483
3769
|
next_hash: optional(text4),
|
|
3484
3770
|
applied: literal(true),
|
|
3485
3771
|
rebuild: strictObject({
|
|
3486
|
-
transcripts:
|
|
3487
|
-
chunks:
|
|
3772
|
+
transcripts: count6,
|
|
3773
|
+
chunks: count6,
|
|
3488
3774
|
has_more: flag,
|
|
3489
3775
|
next_transcript_id: optional(identifier)
|
|
3490
3776
|
})
|
|
@@ -3493,8 +3779,8 @@ var embedding = union([
|
|
|
3493
3779
|
var repair = strictObject({
|
|
3494
3780
|
account_id: identifier,
|
|
3495
3781
|
applied: flag,
|
|
3496
|
-
transcripts:
|
|
3497
|
-
languages: array(strictObject({ language: nullableText, transcripts:
|
|
3782
|
+
transcripts: count6,
|
|
3783
|
+
languages: array(strictObject({ language: nullableText, transcripts: count6 }))
|
|
3498
3784
|
});
|
|
3499
3785
|
var kind = picklist(["instant", "scheduled"]);
|
|
3500
3786
|
var managedChange = strictObject({
|
|
@@ -3507,9 +3793,10 @@ var managedChange = strictObject({
|
|
|
3507
3793
|
title: optional(text4),
|
|
3508
3794
|
kind: optional(kind),
|
|
3509
3795
|
start_time: optional(text4),
|
|
3510
|
-
duration_minutes: optional(
|
|
3796
|
+
duration_minutes: optional(count6),
|
|
3511
3797
|
timezone: optional(text4),
|
|
3512
|
-
agenda: optional(text4)
|
|
3798
|
+
agenda: optional(text4),
|
|
3799
|
+
settings: optional(record(text4, union([text4, flag])))
|
|
3513
3800
|
})),
|
|
3514
3801
|
applied: flag,
|
|
3515
3802
|
meeting: optional(strictObject({
|
|
@@ -3517,11 +3804,12 @@ var managedChange = strictObject({
|
|
|
3517
3804
|
title: nullableText,
|
|
3518
3805
|
kind: nullable(kind),
|
|
3519
3806
|
start_time: nullableText,
|
|
3520
|
-
duration_minutes: nullable(
|
|
3807
|
+
duration_minutes: nullable(count6),
|
|
3521
3808
|
timezone: nullableText,
|
|
3522
3809
|
agenda: nullableText,
|
|
3523
3810
|
join_url: nullableText
|
|
3524
|
-
}))
|
|
3811
|
+
})),
|
|
3812
|
+
untrusted: optional(array(text4))
|
|
3525
3813
|
});
|
|
3526
3814
|
var invitation = strictObject({ id: identifier, invitation: text4, untrusted: optional(array(text4)) });
|
|
3527
3815
|
var MEETING_RESULT_ENTITIES = {
|
|
@@ -3535,14 +3823,14 @@ var MEETING_RESULT_ENTITIES = {
|
|
|
3535
3823
|
meeting_repair: repair
|
|
3536
3824
|
};
|
|
3537
3825
|
|
|
3538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/review.js
|
|
3539
3827
|
var REVIEW_LIMIT = { default: 50, most: 200 };
|
|
3540
3828
|
|
|
3541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
|
|
3542
3830
|
var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
|
|
3543
3831
|
\`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
|
|
3544
3832
|
|
|
3545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3833
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
|
|
3546
3834
|
var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
3547
3835
|
input.signal?.throwIfAborted();
|
|
3548
3836
|
if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
|
|
@@ -3563,10 +3851,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
|
3563
3851
|
return { ...input, limit, maxReadBytes };
|
|
3564
3852
|
}, "validateMeetingSeriesHistory");
|
|
3565
3853
|
|
|
3566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
|
|
3567
3855
|
var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
|
|
3568
3856
|
|
|
3569
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
|
|
3570
3858
|
function invalid4(field, response = false) {
|
|
3571
3859
|
throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
|
|
3572
3860
|
}
|
|
@@ -3582,11 +3870,11 @@ var cursorDetails = /* @__PURE__ */ __name((value) => {
|
|
|
3582
3870
|
if (typeof value !== "string" || value.length > 4096 || !/^[A-Za-z0-9_-]+$/.test(value))
|
|
3583
3871
|
invalid4("cursor");
|
|
3584
3872
|
try {
|
|
3585
|
-
const
|
|
3586
|
-
object2(
|
|
3587
|
-
if (
|
|
3873
|
+
const decoded = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
|
|
3874
|
+
object2(decoded, ["version", "selection", "cursor"], "cursor");
|
|
3875
|
+
if (decoded.version !== 1 || typeof decoded.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded.selection) || !occurrenceId(decoded.cursor))
|
|
3588
3876
|
invalid4("cursor");
|
|
3589
|
-
return
|
|
3877
|
+
return decoded;
|
|
3590
3878
|
} catch {
|
|
3591
3879
|
return invalid4("cursor");
|
|
3592
3880
|
}
|
|
@@ -3595,804 +3883,25 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
|
|
|
3595
3883
|
cursorDetails(value);
|
|
3596
3884
|
}, "validateMeetingSeriesInventoryCursor");
|
|
3597
3885
|
|
|
3598
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3599
|
-
var
|
|
3600
|
-
var
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
return `${parts2.year}-${parts2.month}-${parts2.day}`;
|
|
3618
|
-
}, "dayKey");
|
|
3619
|
-
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
3620
|
-
timeZone: zone,
|
|
3621
|
-
year: "numeric",
|
|
3622
|
-
month: "2-digit",
|
|
3623
|
-
day: "2-digit",
|
|
3624
|
-
weekday: "short"
|
|
3625
|
-
}), "zoneFormat");
|
|
3626
|
-
var NO_SERIES = "no-series";
|
|
3627
|
-
var MOST_COUNT_ROWS = 100;
|
|
3628
|
-
var minutesOf = /* @__PURE__ */ __name((ms) => Math.round(ms / 6e4), "minutesOf");
|
|
3629
|
-
var meanOf = /* @__PURE__ */ __name((ms, timed) => timed === 0 ? null : Math.round(ms / timed / 6e3) / 10, "meanOf");
|
|
3630
|
-
var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
|
|
3631
|
-
if (!MEETING_COUNTS_GROUPINGS.includes(by))
|
|
3632
|
-
throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
|
|
3633
|
-
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
3634
|
-
throw new CliError("validation_error", "--limit is a positive number");
|
|
3635
|
-
const zone = zoneOf(timeZone);
|
|
3636
|
-
const format = zoneFormat(zone);
|
|
3637
|
-
const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
|
|
3638
|
-
const add = /* @__PURE__ */ __name((into, meeting2) => {
|
|
3639
|
-
into.meetings += 1;
|
|
3640
|
-
if (meeting2.durationMs !== null) {
|
|
3641
|
-
into.ms += Math.max(0, meeting2.durationMs);
|
|
3642
|
-
into.timed += 1;
|
|
3643
|
-
}
|
|
3644
|
-
if (meeting2.transcribed)
|
|
3645
|
-
into.transcripts += 1;
|
|
3646
|
-
}, "add");
|
|
3647
|
-
const total = { ...sum(), name: null };
|
|
3648
|
-
const groups = /* @__PURE__ */ new Map();
|
|
3649
|
-
for (const meeting2 of meetings) {
|
|
3650
|
-
add(total, meeting2);
|
|
3651
|
-
const key = by === "series" ? meeting2.seriesKey === null ? NO_SERIES : `series:${meeting2.seriesKey}` : meeting2.startedAt === null ? null : by === "day" ? dayKey(meeting2.startedAt, format) : weekStart(meeting2.startedAt, format);
|
|
3652
|
-
if (key === null)
|
|
3653
|
-
continue;
|
|
3654
|
-
const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
|
|
3655
|
-
add(group, meeting2);
|
|
3656
|
-
groups.set(key, group);
|
|
3657
|
-
}
|
|
3658
|
-
const ordered = [...groups.entries()].sort(([a, one], [b, other]) => by === "series" ? other.ms - one.ms || other.meetings - one.meetings || a.localeCompare(b) : b.localeCompare(a));
|
|
3659
|
-
const kept = ordered.slice(0, limit);
|
|
3660
|
-
if (by !== "series")
|
|
3661
|
-
kept.reverse();
|
|
3662
|
-
const counted = /* @__PURE__ */ __name(({ meetings: count6, ms, timed, transcripts }) => ({
|
|
3663
|
-
meetings: count6,
|
|
3664
|
-
minutes: minutesOf(ms),
|
|
3665
|
-
meanMinutes: meanOf(ms, timed),
|
|
3666
|
-
transcripts
|
|
3667
|
-
}), "counted");
|
|
3668
|
-
return {
|
|
3669
|
-
by,
|
|
3670
|
-
timeZone: zone,
|
|
3671
|
-
...counted(total),
|
|
3672
|
-
rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
|
|
3673
|
-
hasMore: ordered.length > limit
|
|
3674
|
-
};
|
|
3675
|
-
}, "aggregateMeetingCounts");
|
|
3676
|
-
var UNKNOWN_SPEAKER = "unknown";
|
|
3677
|
-
var speakerOf = /* @__PURE__ */ __name((row) => row.personId !== null ? { key: `person:${row.personId}`, name: row.personName ?? row.identityName ?? row.speakerName } : row.identityId !== null ? { key: `identity:${row.identityId}`, name: row.identityName ?? row.speakerName } : row.speakerName?.trim() ? { key: `name:${row.speakerName.trim().toLowerCase()}`, name: row.speakerName.trim() } : { key: UNKNOWN_SPEAKER, name: null }, "speakerOf");
|
|
3678
|
-
var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
3679
|
-
const zone = zoneOf(timeZone);
|
|
3680
|
-
const format = zoneFormat(zone);
|
|
3681
|
-
const speakers = /* @__PURE__ */ new Map();
|
|
3682
|
-
const weeks = /* @__PURE__ */ new Map();
|
|
3683
|
-
const meetings = /* @__PURE__ */ new Set();
|
|
3684
|
-
let lines = 0;
|
|
3685
|
-
let words2 = 0;
|
|
3686
|
-
let talkMs = 0;
|
|
3687
|
-
for (const row of rows) {
|
|
3688
|
-
const talk = Math.max(0, row.endMs - row.startMs);
|
|
3689
|
-
meetings.add(row.meetingId);
|
|
3690
|
-
lines += 1;
|
|
3691
|
-
words2 += row.words;
|
|
3692
|
-
talkMs += talk;
|
|
3693
|
-
const who = speakerOf(row);
|
|
3694
|
-
const held = speakers.get(who.key) ?? {
|
|
3695
|
-
key: who.key,
|
|
3696
|
-
name: who.name ?? null,
|
|
3697
|
-
personId: row.personId,
|
|
3698
|
-
identityId: row.personId === null ? row.identityId : null,
|
|
3699
|
-
meetings: 0,
|
|
3700
|
-
lines: 0,
|
|
3701
|
-
words: 0,
|
|
3702
|
-
talkMs: 0,
|
|
3703
|
-
share: 0,
|
|
3704
|
-
seen: /* @__PURE__ */ new Set()
|
|
3705
|
-
};
|
|
3706
|
-
held.seen.add(row.meetingId);
|
|
3707
|
-
held.lines += 1;
|
|
3708
|
-
held.words += row.words;
|
|
3709
|
-
held.talkMs += talk;
|
|
3710
|
-
speakers.set(who.key, held);
|
|
3711
|
-
if (row.startedAt !== null) {
|
|
3712
|
-
const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
|
|
3713
|
-
week.meetings.add(row.meetingId);
|
|
3714
|
-
week.talkMs += talk;
|
|
3715
|
-
weeks.set(weekStart(row.startedAt, format), week);
|
|
3716
|
-
}
|
|
3717
|
-
}
|
|
3718
|
-
return {
|
|
3719
|
-
timeZone: zone,
|
|
3720
|
-
meetings: meetings.size,
|
|
3721
|
-
lines,
|
|
3722
|
-
words: words2,
|
|
3723
|
-
talkMs,
|
|
3724
|
-
speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
|
|
3725
|
-
...speaker,
|
|
3726
|
-
meetings: seen.size,
|
|
3727
|
-
share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
|
|
3728
|
-
})).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
|
|
3729
|
-
weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
|
|
3730
|
-
};
|
|
3731
|
-
}, "aggregateMeetingStats");
|
|
3732
|
-
|
|
3733
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
3734
|
-
var SCHEME = "msg:";
|
|
3735
|
-
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
|
|
3736
|
-
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
3737
|
-
var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
3738
|
-
const trimmed = reference2.trim();
|
|
3739
|
-
const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
3740
|
-
const malformed2 = /* @__PURE__ */ __name(() => new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`), "malformed");
|
|
3741
|
-
if (parts2.length !== 4 || parts2.some((part) => part === ""))
|
|
3742
|
-
throw malformed2();
|
|
3743
|
-
const decoded2 = /* @__PURE__ */ __name((part) => {
|
|
3744
|
-
try {
|
|
3745
|
-
return decodeURIComponent(part);
|
|
3746
|
-
} catch {
|
|
3747
|
-
throw malformed2();
|
|
3748
|
-
}
|
|
3749
|
-
}, "decoded");
|
|
3750
|
-
const [provider, account, chat, message] = parts2.map(decoded2);
|
|
3751
|
-
return { provider, account, chat, message };
|
|
3752
|
-
}, "parseLocator");
|
|
3753
|
-
|
|
3754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
3755
|
-
var SIMPLE_REFERENCES = [
|
|
3756
|
-
"note",
|
|
3757
|
-
"document",
|
|
3758
|
-
"person",
|
|
3759
|
-
"organization",
|
|
3760
|
-
"project",
|
|
3761
|
-
"task",
|
|
3762
|
-
"memory",
|
|
3763
|
-
"fact",
|
|
3764
|
-
"bot",
|
|
3765
|
-
"event",
|
|
3766
|
-
"invoice",
|
|
3767
|
-
"payment",
|
|
3768
|
-
"order",
|
|
3769
|
-
"deal",
|
|
3770
|
-
"lead",
|
|
3771
|
-
"pipeline",
|
|
3772
|
-
"product",
|
|
3773
|
-
"contract",
|
|
3774
|
-
"subscription",
|
|
3775
|
-
"wallet",
|
|
3776
|
-
"transaction",
|
|
3777
|
-
"entity"
|
|
3778
|
-
];
|
|
3779
|
-
var malformed = /* @__PURE__ */ __name((text5, shape) => new CliError("validation_error", `"${singleLine(text5)}" is not a reference \u2014 expected ${shape}`, {
|
|
3780
|
-
reason: "ref.malformed"
|
|
3781
|
-
}), "malformed");
|
|
3782
|
-
var decoded = /* @__PURE__ */ __name((part, text5, shape) => {
|
|
3783
|
-
try {
|
|
3784
|
-
return decodeURIComponent(part);
|
|
3785
|
-
} catch {
|
|
3786
|
-
throw malformed(text5, shape);
|
|
3787
|
-
}
|
|
3788
|
-
}, "decoded");
|
|
3789
|
-
var parts = /* @__PURE__ */ __name((rest, count6, text5, shape) => {
|
|
3790
|
-
const split = rest.split("/");
|
|
3791
|
-
if (split.length !== count6 || split.some((part) => part === ""))
|
|
3792
|
-
throw malformed(text5, shape);
|
|
3793
|
-
return split.map((part) => decoded(part, text5, shape));
|
|
3794
|
-
}, "parts");
|
|
3795
|
-
var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
|
|
3796
|
-
var folderPath = /* @__PURE__ */ __name((path) => {
|
|
3797
|
-
const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
|
|
3798
|
-
return clean === "" ? path.trim() === "" ? "" : null : clean;
|
|
3799
|
-
}, "folderPath");
|
|
3800
|
-
var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
|
|
3801
|
-
var kind2 = /* @__PURE__ */ __name((spec) => spec, "kind");
|
|
3802
|
-
var simple = /* @__PURE__ */ __name((prefix) => kind2({
|
|
3803
|
-
prefix,
|
|
3804
|
-
type: prefix,
|
|
3805
|
-
shape: `${prefix}:<id>`,
|
|
3806
|
-
parse: /* @__PURE__ */ __name((rest, text5) => {
|
|
3807
|
-
if (!rest.trim())
|
|
3808
|
-
throw new CliError("validation_error", `"${singleLine(text5)}" names no ${prefix}`, {
|
|
3809
|
-
reason: "ref.malformed"
|
|
3810
|
-
});
|
|
3811
|
-
return { type: prefix, id: rest };
|
|
3812
|
-
}, "parse"),
|
|
3813
|
-
format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
|
|
3814
|
-
}), "simple");
|
|
3815
|
-
var REF_KINDS = [
|
|
3816
|
-
kind2({
|
|
3817
|
-
prefix: "msg",
|
|
3818
|
-
type: "message",
|
|
3819
|
-
shape: "msg:<provider>/<account>/<chat>/<message>",
|
|
3820
|
-
parse: /* @__PURE__ */ __name((_, text5) => {
|
|
3821
|
-
try {
|
|
3822
|
-
return { type: "message", ...parseLocator(text5) };
|
|
3823
|
-
} catch {
|
|
3824
|
-
throw malformed(text5, "msg:<provider>/<account>/<chat>/<message>");
|
|
3825
|
-
}
|
|
3826
|
-
}, "parse"),
|
|
3827
|
-
format: formatLocator
|
|
3828
|
-
}),
|
|
3829
|
-
kind2({
|
|
3830
|
-
prefix: "chat",
|
|
3831
|
-
type: "chat",
|
|
3832
|
-
shape: "chat:<provider>/<account>/<chat>",
|
|
3833
|
-
parse: /* @__PURE__ */ __name((rest, text5) => {
|
|
3834
|
-
const [provider, account, chat] = parts(rest, 3, text5, "chat:<provider>/<account>/<chat>");
|
|
3835
|
-
return { type: "chat", provider, account, chat };
|
|
3836
|
-
}, "parse"),
|
|
3837
|
-
format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
|
|
3838
|
-
}),
|
|
3839
|
-
kind2({
|
|
3840
|
-
prefix: "contact",
|
|
3841
|
-
type: "contact",
|
|
3842
|
-
shape: "contact:<provider>/<id>",
|
|
3843
|
-
parse: /* @__PURE__ */ __name((rest, text5) => {
|
|
3844
|
-
const [provider, id3] = parts(rest, 2, text5, "contact:<provider>/<id>");
|
|
3845
|
-
return { type: "contact", provider, id: id3 };
|
|
3846
|
-
}, "parse"),
|
|
3847
|
-
format: /* @__PURE__ */ __name(({ provider, id: id3 }) => `contact:${encoded(provider, id3)}`, "format")
|
|
3848
|
-
}),
|
|
3849
|
-
kind2({
|
|
3850
|
-
prefix: "folder",
|
|
3851
|
-
type: "folder",
|
|
3852
|
-
shape: "folder:<id>[/<path>]",
|
|
3853
|
-
parse: /* @__PURE__ */ __name((rest, text5) => {
|
|
3854
|
-
const slash = rest.indexOf("/");
|
|
3855
|
-
const id3 = decoded(slash < 0 ? rest : rest.slice(0, slash), text5, "folder:<id>[/<path>]");
|
|
3856
|
-
const path = slash < 0 ? null : folderPath(decoded(rest.slice(slash + 1), text5, "folder:<id>[/<path>]"));
|
|
3857
|
-
if (!id3.trim() || path === "")
|
|
3858
|
-
throw malformed(text5, "folder:<id>[/<path>]");
|
|
3859
|
-
return { type: "folder", id: id3, path };
|
|
3860
|
-
}, "parse"),
|
|
3861
|
-
format: /* @__PURE__ */ __name(({ id: id3, path }) => path === null ? `folder:${encodeURIComponent(id3)}` : `folder:${encoded(id3, path)}`, "format")
|
|
3862
|
-
}),
|
|
3863
|
-
kind2({
|
|
3864
|
-
prefix: "meeting",
|
|
3865
|
-
type: "meeting",
|
|
3866
|
-
shape: MEETING_SHAPE,
|
|
3867
|
-
parse: /* @__PURE__ */ __name((_, text5) => {
|
|
3868
|
-
try {
|
|
3869
|
-
return parseMeetingReference(text5);
|
|
3870
|
-
} catch {
|
|
3871
|
-
throw malformed(text5, MEETING_SHAPE);
|
|
3872
|
-
}
|
|
3873
|
-
}, "parse"),
|
|
3874
|
-
format: formatMeetingReference
|
|
3875
|
-
}),
|
|
3876
|
-
...SIMPLE_REFERENCES.map(simple)
|
|
3877
|
-
];
|
|
3878
|
-
var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
|
|
3879
|
-
var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
|
|
3880
|
-
var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
|
|
3881
|
-
var distance = /* @__PURE__ */ __name((a, b) => {
|
|
3882
|
-
let row = Array.from({ length: b.length + 1 }, (_, at) => at);
|
|
3883
|
-
for (const [i, x] of [...a].entries()) {
|
|
3884
|
-
const next = [i + 1];
|
|
3885
|
-
for (const [j, y] of [...b].entries())
|
|
3886
|
-
next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
|
|
3887
|
-
row = next;
|
|
3888
|
-
}
|
|
3889
|
-
return row[b.length];
|
|
3890
|
-
}, "distance");
|
|
3891
|
-
var nearest = /* @__PURE__ */ __name((typed) => offered.find((prefix) => typed.length >= 2 && prefix.startsWith(typed)) ?? offered.map((prefix) => ({ prefix, far: distance(typed, prefix) })).filter(({ far }) => far <= 2).sort((a, b) => a.far - b.far)[0]?.prefix, "nearest");
|
|
3892
|
-
var unknownKind = /* @__PURE__ */ __name((text5, prefix, rest) => {
|
|
3893
|
-
const near2 = prefix === "" ? void 0 : nearest(prefix);
|
|
3894
|
-
const kinds = offered.map((one) => `${one}:`).join(", ");
|
|
3895
|
-
const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
|
|
3896
|
-
return new CliError("validation_error", `"${singleLine(text5)}" is no kind of reference${hint}`, {
|
|
3897
|
-
reason: "ref.unknown-kind"
|
|
3898
|
-
});
|
|
3899
|
-
}, "unknownKind");
|
|
3900
|
-
var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
|
|
3901
|
-
var parseReference = /* @__PURE__ */ __name((text5) => {
|
|
3902
|
-
const reference2 = text5.trim();
|
|
3903
|
-
const colon = reference2.indexOf(":");
|
|
3904
|
-
const prefix = colon < 0 ? "" : reference2.slice(0, colon);
|
|
3905
|
-
const rest = reference2.slice(colon + 1);
|
|
3906
|
-
const spec = byPrefix.get(prefix);
|
|
3907
|
-
if (!spec)
|
|
3908
|
-
throw unknownKind(reference2, prefix, rest);
|
|
3909
|
-
return spec.parse(rest, reference2);
|
|
3910
|
-
}, "parseReference");
|
|
3911
|
-
var canonicalReference = /* @__PURE__ */ __name((text5) => formatReference(parseReference(text5)), "canonicalReference");
|
|
3912
|
-
var looksLikeReference = /* @__PURE__ */ __name((text5) => {
|
|
3913
|
-
const match = /^([a-z]+):\S+$/.exec(text5.trim());
|
|
3914
|
-
return match !== null && byPrefix.has(match[1]);
|
|
3915
|
-
}, "looksLikeReference");
|
|
3916
|
-
|
|
3917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
3918
|
-
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
|
|
3919
|
-
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
3920
|
-
var CRM_OPENS = { deal: "deals show", lead: "leads show", pipeline: "pipelines show" };
|
|
3921
|
-
var PROVIDERS = [
|
|
3922
|
-
{ name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
|
|
3923
|
-
{ name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
|
|
3924
|
-
{ name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
|
|
3925
|
-
{ name: "max-bot", kind: "messages", aliases: [] },
|
|
3926
|
-
{ name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
|
|
3927
|
-
{ name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
|
|
3928
|
-
{ name: "email", kind: "mail", aliases: [] },
|
|
3929
|
-
{ name: "notes", kind: "notes", aliases: [] },
|
|
3930
|
-
{ name: "local", kind: "notes", aliases: [] },
|
|
3931
|
-
{ name: "obsidian", kind: "notes", aliases: [] },
|
|
3932
|
-
{ name: "added", kind: "notes", aliases: [] },
|
|
3933
|
-
{ name: "zoom", kind: "meetings", aliases: [] },
|
|
3934
|
-
{ name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
|
|
3935
|
-
// Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
|
|
3936
|
-
{ name: "telemost", kind: "meetings", aliases: [] },
|
|
3937
|
-
// A phone export's records: its SMS and its calls in the one account the import names.
|
|
3938
|
-
{ name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true },
|
|
3939
|
-
// Any other import: a folder of notes, a CRM's export, a script's records, under `import:<what it is>`.
|
|
3940
|
-
{ name: "import", kind: "documents", kinds: ["documents", "messages", "events"], aliases: [], imported: true }
|
|
3941
|
-
];
|
|
3942
|
-
var LABELS = {
|
|
3943
|
-
telegram: "Telegram",
|
|
3944
|
-
"telegram-bot": "Telegram bot",
|
|
3945
|
-
max: "MAX",
|
|
3946
|
-
"max-bot": "MAX bot",
|
|
3947
|
-
whatsapp: "WhatsApp",
|
|
3948
|
-
"whatsapp-bot": "WhatsApp bot",
|
|
3949
|
-
"google-drive": "Google Drive",
|
|
3950
|
-
"google-meet": "Google Meet",
|
|
3951
|
-
added: "added by hand",
|
|
3952
|
-
email: "mail",
|
|
3953
|
-
telemost: "Telemost"
|
|
3954
|
-
};
|
|
3955
|
-
var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
|
|
3956
|
-
var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
|
|
3957
|
-
var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
|
|
3958
|
-
var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
|
|
3959
|
-
var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
|
|
3960
|
-
var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
|
|
3961
|
-
var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
|
|
3962
|
-
var ADDED_PROVIDER = "added";
|
|
3963
|
-
var ADDED_ACCOUNT = "owner";
|
|
3964
|
-
var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
|
|
3965
|
-
var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
|
|
3966
|
-
var INTERNAL_NOTES = "internal";
|
|
3967
|
-
var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
|
|
3968
|
-
var WORD = /^[a-z0-9][a-z0-9_-]*$/;
|
|
3969
|
-
var invalid5 = /* @__PURE__ */ __name((message) => {
|
|
3970
|
-
throw new CliError("validation_error", message);
|
|
3971
|
-
}, "invalid");
|
|
3972
|
-
var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid5(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
|
|
3973
|
-
var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
|
|
3974
|
-
var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
|
|
3975
|
-
var opensOf = /* @__PURE__ */ __name((value, named) => {
|
|
3976
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
3977
|
-
return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
|
|
3978
|
-
const known = Object.entries(value).filter(([kind3]) => OPEN_KINDS.has(kind3));
|
|
3979
|
-
for (const [kind3, command] of known)
|
|
3980
|
-
if (typeof command !== "string" || !COMMAND_WORDS.test(command))
|
|
3981
|
-
invalid5(`provider ${named} opens a ${kind3} with command words, not ${JSON.stringify(command)}`);
|
|
3982
|
-
return Object.fromEntries(known);
|
|
3983
|
-
}, "opensOf");
|
|
3984
|
-
var providerEntryOf = /* @__PURE__ */ __name((value) => {
|
|
3985
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
3986
|
-
return invalid5("a provider entry is an object");
|
|
3987
|
-
const { name, kind: kind3, kinds, aliases = [], command, opens, imported } = value;
|
|
3988
|
-
const named = wordOf(name, "a provider's name");
|
|
3989
|
-
const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
|
|
3990
|
-
const given = kinds === void 0 ? [kind3] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
|
|
3991
|
-
for (const one of given)
|
|
3992
|
-
if (!isKindWord(one))
|
|
3993
|
-
invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
|
|
3994
|
-
const list = [...new Set(given)];
|
|
3995
|
-
if (kind3 !== void 0 && kind3 !== list[0])
|
|
3996
|
-
invalid5(`provider ${named}'s kind is the first of its kinds`);
|
|
3997
|
-
if (!Array.isArray(aliases))
|
|
3998
|
-
invalid5(`provider ${named}'s aliases are a list`);
|
|
3999
|
-
if (imported !== void 0 && typeof imported !== "boolean")
|
|
4000
|
-
invalid5(`provider ${named}'s imported is true or false`);
|
|
4001
|
-
return {
|
|
4002
|
-
name: named,
|
|
4003
|
-
kind: list[0],
|
|
4004
|
-
...list.length > 1 ? { kinds: list } : {},
|
|
4005
|
-
...imported === true ? { imported: true } : {},
|
|
4006
|
-
aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
|
|
4007
|
-
...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
|
|
4008
|
-
...opens === void 0 ? {} : { opens: opensOf(opens, named) }
|
|
4009
|
-
};
|
|
4010
|
-
}, "providerEntryOf");
|
|
4011
|
-
var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
|
|
4012
|
-
var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
|
|
4013
|
-
var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
|
|
4014
|
-
.../* @__PURE__ */ new Set([...known, ...entry])
|
|
4015
|
-
], "unitedKinds");
|
|
4016
|
-
var wordsOf2 = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
|
|
4017
|
-
var joined = /* @__PURE__ */ __name((known, entry) => {
|
|
4018
|
-
const same = known.find(({ name }) => name === entry.name);
|
|
4019
|
-
const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
|
|
4020
|
-
if (same && same.kind !== entry.kind)
|
|
4021
|
-
invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
|
|
4022
|
-
if (same && entry.imported === true && same.imported !== true)
|
|
4023
|
-
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
4024
|
-
const merged = same ? {
|
|
4025
|
-
...same,
|
|
4026
|
-
...kinds.length > 1 ? { kinds } : {},
|
|
4027
|
-
aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
|
|
4028
|
-
...entry.command ? { command: entry.command } : {},
|
|
4029
|
-
...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
|
|
4030
|
-
} : entry;
|
|
4031
|
-
const others = known.filter((one) => one !== same);
|
|
4032
|
-
for (const word of wordsOf2(merged)) {
|
|
4033
|
-
const owner = others.find((one) => wordsOf2(one).includes(word));
|
|
4034
|
-
if (owner)
|
|
4035
|
-
invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
|
|
4036
|
-
}
|
|
4037
|
-
return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
|
|
4038
|
-
}, "joined");
|
|
4039
|
-
var registry = PROVIDERS;
|
|
4040
|
-
var providers = /* @__PURE__ */ __name(() => registry, "providers");
|
|
4041
|
-
var useProviders = /* @__PURE__ */ __name((entries) => {
|
|
4042
|
-
registry = entries.map(providerEntryOf).reduce(joined, PROVIDERS);
|
|
4043
|
-
}, "useProviders");
|
|
4044
|
-
var useStoredProviders = /* @__PURE__ */ __name((entries) => {
|
|
4045
|
-
const left = [];
|
|
4046
|
-
registry = entries.reduce((known, entry) => {
|
|
4047
|
-
try {
|
|
4048
|
-
return joined(known, providerEntryOf(entry));
|
|
4049
|
-
} catch (error) {
|
|
4050
|
-
if (!(error instanceof CliError))
|
|
4051
|
-
throw error;
|
|
4052
|
-
left.push(entry);
|
|
4053
|
-
return known;
|
|
4054
|
-
}
|
|
4055
|
-
}, PROVIDERS);
|
|
4056
|
-
return left;
|
|
4057
|
-
}, "useStoredProviders");
|
|
4058
|
-
var addProvider = /* @__PURE__ */ __name((entry) => {
|
|
4059
|
-
registry = joined(registry, providerEntryOf(entry));
|
|
4060
|
-
}, "addProvider");
|
|
4061
|
-
var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
|
|
4062
|
-
var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
4063
|
-
const wanted = word.toLowerCase();
|
|
4064
|
-
return registry.find((entry) => wordsOf2(entry).includes(wanted));
|
|
4065
|
-
}, "providerNamed");
|
|
4066
|
-
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
4067
|
-
var kindsIn = /* @__PURE__ */ __name((provider) => {
|
|
4068
|
-
if (isFolderProvider(provider))
|
|
4069
|
-
return ["notes"];
|
|
4070
|
-
const entry = registry.find(({ name }) => name === provider);
|
|
4071
|
-
if (!entry)
|
|
4072
|
-
return [];
|
|
4073
|
-
return entry.imported ? unitedKinds(kindsOfEntry(entry), ["documents"]) : kindsOfEntry(entry);
|
|
4074
|
-
}, "kindsIn");
|
|
4075
|
-
var importedOf = /* @__PURE__ */ __name((entry, held) => {
|
|
4076
|
-
const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
|
|
4077
|
-
if (builtIn) {
|
|
4078
|
-
if (entry.imported === true && builtIn.imported !== true)
|
|
4079
|
-
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
4080
|
-
return builtIn.imported === true;
|
|
4081
|
-
}
|
|
4082
|
-
if (held === void 0)
|
|
4083
|
-
return entry.imported === true;
|
|
4084
|
-
if (entry.imported === true && held.imported !== true)
|
|
4085
|
-
invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
|
|
4086
|
-
return held.imported === true;
|
|
4087
|
-
}, "importedOf");
|
|
4088
|
-
var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
|
|
4089
|
-
var holdsKind = /* @__PURE__ */ __name((provider, kind3) => kindsIn(provider).includes(kind3), "holdsKind");
|
|
4090
|
-
var holdsKindOf = /* @__PURE__ */ __name((provider, kind3) => kindIn(provider) === void 0 ? kind3 === "messages" : holdsKind(provider, kind3), "holdsKindOf");
|
|
4091
|
-
var kindOf2 = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
4092
|
-
|
|
4093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
4094
|
-
var CURRENCY_SCALES = {
|
|
4095
|
-
AED: 2,
|
|
4096
|
-
AMD: 2,
|
|
4097
|
-
AUD: 2,
|
|
4098
|
-
BHD: 3,
|
|
4099
|
-
BYN: 2,
|
|
4100
|
-
CAD: 2,
|
|
4101
|
-
CHF: 2,
|
|
4102
|
-
CLP: 0,
|
|
4103
|
-
CNY: 2,
|
|
4104
|
-
CZK: 2,
|
|
4105
|
-
DKK: 2,
|
|
4106
|
-
EUR: 2,
|
|
4107
|
-
GBP: 2,
|
|
4108
|
-
GEL: 2,
|
|
4109
|
-
HUF: 2,
|
|
4110
|
-
ILS: 2,
|
|
4111
|
-
INR: 2,
|
|
4112
|
-
ISK: 0,
|
|
4113
|
-
JPY: 0,
|
|
4114
|
-
KGS: 2,
|
|
4115
|
-
KRW: 0,
|
|
4116
|
-
KWD: 3,
|
|
4117
|
-
KZT: 2,
|
|
4118
|
-
NOK: 2,
|
|
4119
|
-
PLN: 2,
|
|
4120
|
-
RSD: 2,
|
|
4121
|
-
RUB: 2,
|
|
4122
|
-
SEK: 2,
|
|
4123
|
-
THB: 2,
|
|
4124
|
-
TRY: 2,
|
|
4125
|
-
UAH: 2,
|
|
4126
|
-
USD: 2,
|
|
4127
|
-
UZS: 2,
|
|
4128
|
-
VND: 0
|
|
4129
|
-
};
|
|
4130
|
-
var refuse = /* @__PURE__ */ __name((message, reason) => {
|
|
4131
|
-
throw new CliError("validation_error", message, { reason });
|
|
4132
|
-
}, "refuse");
|
|
4133
|
-
var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
|
|
4134
|
-
var parseDecimal = /* @__PURE__ */ __name((text5, scale) => {
|
|
4135
|
-
const match = DECIMAL.exec(text5.trim());
|
|
4136
|
-
if (!match || (match[2] ?? "").length > scale)
|
|
4137
|
-
return void 0;
|
|
4138
|
-
return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
|
|
4139
|
-
}, "parseDecimal");
|
|
4140
|
-
var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
|
|
4141
|
-
const value = BigInt(units);
|
|
4142
|
-
if (value < 0n)
|
|
4143
|
-
return `-${formatDecimal(-value, scale)}`;
|
|
4144
|
-
const digits = value.toString().padStart(scale + 1, "0");
|
|
4145
|
-
return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
|
|
4146
|
-
}, "formatDecimal");
|
|
4147
|
-
var groupDigits = /* @__PURE__ */ __name((decimal) => {
|
|
4148
|
-
const [whole = "0", fraction] = decimal.split(".");
|
|
4149
|
-
const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
4150
|
-
return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
|
|
4151
|
-
}, "groupDigits");
|
|
4152
|
-
var currencyOf = /* @__PURE__ */ __name((text5) => {
|
|
4153
|
-
const code = typeof text5 === "string" ? text5.trim().toUpperCase() : "";
|
|
4154
|
-
if (CURRENCY_SCALES[code] === void 0)
|
|
4155
|
-
return refuse(`${typeof text5 === "string" && text5.trim() ? text5.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
|
|
4156
|
-
return code;
|
|
4157
|
-
}, "currencyOf");
|
|
4158
|
-
var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
|
|
4159
|
-
var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
4160
|
-
const scale = scaleOf(currency);
|
|
4161
|
-
const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
|
|
4162
|
-
if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
|
|
4163
|
-
return refuse(`${what} is a decimal string with at most ${scale} decimal${scale === 1 ? "" : "s"} for ${currency}, such as "${formatDecimal(5e3 * 10 ** scale, scale)}"`, "money.amount");
|
|
4164
|
-
return Number(units);
|
|
4165
|
-
}, "minorUnits");
|
|
4166
|
-
var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
4167
|
-
if (typeof amount !== "string" || !amount.trim().startsWith("-"))
|
|
4168
|
-
return minorUnits(amount, currency, what);
|
|
4169
|
-
const units = minorUnits(amount.trim().slice(1), currency, what);
|
|
4170
|
-
return units === 0 ? 0 : -units;
|
|
4171
|
-
}, "signedMinorUnits");
|
|
4172
|
-
var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
|
|
4173
|
-
amount: formatDecimal(units, scaleOf(currency)),
|
|
4174
|
-
currency
|
|
4175
|
-
}), "moneyOf");
|
|
4176
|
-
var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
|
|
4177
|
-
var QUANTITY_SCALE = 3;
|
|
4178
|
-
var quantityOf = /* @__PURE__ */ __name((text5) => {
|
|
4179
|
-
const thousandths = typeof text5 === "string" ? parseDecimal(text5, QUANTITY_SCALE) : void 0;
|
|
4180
|
-
if (thousandths === void 0 || thousandths === 0n)
|
|
4181
|
-
return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
|
|
4182
|
-
const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
|
|
4183
|
-
return { text: plain, thousandths };
|
|
4184
|
-
}, "quantityOf");
|
|
4185
|
-
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
4186
|
-
|
|
4187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/deals.js
|
|
4188
|
-
var DEAL_KINDS = ["deal", "lead"];
|
|
4189
|
-
var DEAL_STATUSES = ["open", "won", "lost"];
|
|
4190
|
-
var STAGE_OUTCOMES = DEAL_STATUSES;
|
|
4191
|
-
var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
|
|
4192
|
-
var dealLine = /* @__PURE__ */ __name((deal) => {
|
|
4193
|
-
const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
|
|
4194
|
-
return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
|
|
4195
|
-
}, "dealLine");
|
|
4196
|
-
|
|
4197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
4198
|
-
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
4199
|
-
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
4200
|
-
var MONEY_DIRECTIONS = ["in", "out"];
|
|
4201
|
-
var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
|
|
4202
|
-
var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
|
|
4203
|
-
if (current === "draft" || current === "void")
|
|
4204
|
-
return current;
|
|
4205
|
-
if (paid <= 0)
|
|
4206
|
-
return "issued";
|
|
4207
|
-
return paid < total ? "partly_paid" : "paid";
|
|
4208
|
-
}, "settledStatus");
|
|
4209
|
-
var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
|
|
4210
|
-
var notes = /* @__PURE__ */ __name((...words2) => {
|
|
4211
|
-
const kept = words2.filter((word) => word !== null);
|
|
4212
|
-
return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
|
|
4213
|
-
}, "notes");
|
|
4214
|
-
var invoiceLine = /* @__PURE__ */ __name((invoice) => {
|
|
4215
|
-
const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
|
|
4216
|
-
const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
|
|
4217
|
-
return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
|
|
4218
|
-
}, "invoiceLine");
|
|
4219
|
-
var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
4220
|
-
const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
|
|
4221
|
-
return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
|
|
4222
|
-
}, "paymentLine");
|
|
4223
|
-
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
4224
|
-
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
4225
|
-
|
|
4226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/orders.js
|
|
4227
|
-
var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
|
|
4228
|
-
var ORDER_PURPOSES = ["personal", "business", "client", "other"];
|
|
4229
|
-
var orderLine = /* @__PURE__ */ __name((order) => {
|
|
4230
|
-
const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
|
|
4231
|
-
const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
|
|
4232
|
-
const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
|
|
4233
|
-
return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
|
|
4234
|
-
}, "orderLine");
|
|
4235
|
-
var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
|
|
4236
|
-
|
|
4237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/relations.js
|
|
4238
|
-
var ORGANIZATION_ROLES = [
|
|
4239
|
-
"employee",
|
|
4240
|
-
"contractor",
|
|
4241
|
-
"founder",
|
|
4242
|
-
"owner",
|
|
4243
|
-
"manager",
|
|
4244
|
-
"adviser",
|
|
4245
|
-
"contact"
|
|
4246
|
-
];
|
|
4247
|
-
var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
|
|
4248
|
-
var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
|
|
4249
|
-
var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
|
|
4250
|
-
var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
|
|
4251
|
-
var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
|
|
4252
|
-
var checkEngagement = /* @__PURE__ */ __name((kind3, from, to, level) => {
|
|
4253
|
-
if (kind3 !== "member-of" || from !== "person" || to !== "project")
|
|
4254
|
-
throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
|
|
4255
|
-
reason: "relationship.engagement-ends"
|
|
4256
|
-
});
|
|
4257
|
-
if (!isEngagement(level))
|
|
4258
|
-
throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
|
|
4259
|
-
reason: "relationship.engagement-unknown"
|
|
4260
|
-
});
|
|
4261
|
-
return level;
|
|
4262
|
-
}, "checkEngagement");
|
|
4263
|
-
var ENGAGEMENT_ORDER = { high: 0, medium: 1, unknown: 2, low: 3, none: 4 };
|
|
4264
|
-
var engagementRank = /* @__PURE__ */ __name((level) => ENGAGEMENT_ORDER[level ?? "unknown"], "engagementRank");
|
|
4265
|
-
var byEngagement = /* @__PURE__ */ __name((items) => items.map((item, index) => ({ item, index })).sort((a, b) => engagementRank(a.item.engagement) - engagementRank(b.item.engagement) || a.index - b.index).map(({ item }) => item), "byEngagement");
|
|
4266
|
-
var RELATIONS = {
|
|
4267
|
-
"member-of": {
|
|
4268
|
-
from: ["person", "organization", "project", "chat", "email_thread"],
|
|
4269
|
-
to: ["organization", "project"],
|
|
4270
|
-
roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
|
|
4271
|
-
},
|
|
4272
|
-
"reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
|
|
4273
|
-
"customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
|
|
4274
|
-
"partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
|
|
4275
|
-
"related-to": {
|
|
4276
|
-
from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
|
|
4277
|
-
to: ["person", "organization", "project", "task"],
|
|
4278
|
-
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
|
|
4279
|
-
}
|
|
4280
|
-
};
|
|
4281
|
-
var RELATION_KINDS = Object.keys(RELATIONS);
|
|
4282
|
-
var specOf = /* @__PURE__ */ __name((kind3) => Object.hasOwn(RELATIONS, kind3) ? RELATIONS[kind3] : void 0, "specOf");
|
|
4283
|
-
var isRelationKind = /* @__PURE__ */ __name((kind3) => specOf(kind3) !== void 0, "isRelationKind");
|
|
4284
|
-
var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
|
|
4285
|
-
var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
|
|
4286
|
-
var checkEnds = /* @__PURE__ */ __name((kind3, from, to) => {
|
|
4287
|
-
const spec = specOf(kind3);
|
|
4288
|
-
if (!spec)
|
|
4289
|
-
throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
|
|
4290
|
-
if (memberOnly(from) && (kind3 !== "member-of" || to !== "project"))
|
|
4291
|
-
throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
|
|
4292
|
-
if (partyOnly(from, to))
|
|
4293
|
-
throw new CliError("validation_error", "a contract is related only to a person or an organization");
|
|
4294
|
-
if (!spec.from.includes(from) || !spec.to.includes(to))
|
|
4295
|
-
throw new CliError("validation_error", `${kind3} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
|
|
4296
|
-
return spec;
|
|
4297
|
-
}, "checkEnds");
|
|
4298
|
-
var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
|
|
4299
|
-
var rolesOf = /* @__PURE__ */ __name((kind3, from, to) => {
|
|
4300
|
-
const spec = specOf(kind3);
|
|
4301
|
-
if (kind3 === "member-of" && from !== "person")
|
|
4302
|
-
return void 0;
|
|
4303
|
-
return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
|
|
4304
|
-
}, "rolesOf");
|
|
4305
|
-
var ROLE_LISTS = {
|
|
4306
|
-
organization: ORGANIZATION_ROLES,
|
|
4307
|
-
project: PROJECT_ROLES,
|
|
4308
|
-
deal: DEAL_ROLES,
|
|
4309
|
-
contract: CONTRACT_ROLES,
|
|
4310
|
-
related: RELATED_ROLES
|
|
4311
|
-
};
|
|
4312
|
-
var roleListOf = /* @__PURE__ */ __name((kind3, from, to) => {
|
|
4313
|
-
if (kind3 === "related-to" && isParty(from) && isParty(to))
|
|
4314
|
-
return "related";
|
|
4315
|
-
const roles = rolesOf(kind3, from, to);
|
|
4316
|
-
return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
|
|
4317
|
-
}, "roleListOf");
|
|
4318
|
-
var checkRole = /* @__PURE__ */ __name((kind3, from, to, role, extra = []) => {
|
|
4319
|
-
const roles = rolesOf(kind3, from, to)?.concat(extra);
|
|
4320
|
-
if (roles && !roles.includes(role))
|
|
4321
|
-
throw new CliError("validation_error", `a ${from}'s role on ${kind3} ${to} is one of ${roles.join(", ")}`, {
|
|
4322
|
-
reason: "relationship.role-unknown"
|
|
4323
|
-
});
|
|
4324
|
-
return role;
|
|
4325
|
-
}, "checkRole");
|
|
4326
|
-
var isSymmetric = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric === true, "isSymmetric");
|
|
4327
|
-
var inverseOf = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric ? kind3 : specOf(kind3)?.inverse ?? null, "inverseOf");
|
|
4328
|
-
var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
|
|
4329
|
-
var standingOf = /* @__PURE__ */ __name((link, now) => {
|
|
4330
|
-
if (link.endsAt != null && link.endsAt <= now)
|
|
4331
|
-
return "ended";
|
|
4332
|
-
if (link.confirmed)
|
|
4333
|
-
return "confirmed";
|
|
4334
|
-
if (link.deletedAt != null)
|
|
4335
|
-
return "ended";
|
|
4336
|
-
return link.accountId != null ? "reported" : "proposed";
|
|
4337
|
-
}, "standingOf");
|
|
4338
|
-
var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
|
|
4339
|
-
var usableLink = /* @__PURE__ */ __name((link, now) => isUsable(standingOf(link, now)), "usableLink");
|
|
4340
|
-
var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
|
|
4341
|
-
var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
|
|
4342
|
-
var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
|
|
4343
|
-
|
|
4344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/crm.js
|
|
4345
|
-
var CRM_KINDS = ["organization", "person", "deal", "lead"];
|
|
4346
|
-
var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
|
|
4347
|
-
var isCrmUserId = /* @__PURE__ */ __name((id3) => /^\d{1,20}$/.test(id3), "isCrmUserId");
|
|
4348
|
-
var normalCrmUserId = /* @__PURE__ */ __name((id3) => {
|
|
4349
|
-
const text5 = id3.trim();
|
|
4350
|
-
return /^\d+$/.test(text5) ? text5.replace(/^0+(?=\d)/, "") : text5;
|
|
4351
|
-
}, "normalCrmUserId");
|
|
4352
|
-
var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
|
|
4353
|
-
|
|
4354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
4355
|
-
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
4356
|
-
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
4357
|
-
var tagOf = /* @__PURE__ */ __name((value) => {
|
|
4358
|
-
const tag = value.trim().toLowerCase();
|
|
4359
|
-
return TAG.test(tag) ? tag : void 0;
|
|
4360
|
-
}, "tagOf");
|
|
4361
|
-
var normalizeTag = /* @__PURE__ */ __name((value) => {
|
|
4362
|
-
const tag = tagOf(value);
|
|
4363
|
-
if (tag === void 0)
|
|
4364
|
-
throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
|
|
4365
|
-
return tag;
|
|
4366
|
-
}, "normalizeTag");
|
|
4367
|
-
|
|
4368
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/business.js
|
|
4369
|
-
var CATALOG_KINDS = ["product", "service"];
|
|
4370
|
-
var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
|
|
4371
|
-
var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
|
|
4372
|
-
var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
|
|
4373
|
-
var PERIOD_UNITS = ["day", "week", "month", "year"];
|
|
4374
|
-
var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
|
|
4375
|
-
var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
|
|
4376
|
-
var TRANSACTION_STATUSES = ["pending", "booked"];
|
|
4377
|
-
var ORDER_DIRECTIONS = ["purchase", "sale"];
|
|
4378
|
-
var intervalOf = /* @__PURE__ */ __name((text5, reason = "subscription.interval") => {
|
|
4379
|
-
const match = typeof text5 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text5.trim()) : null;
|
|
4380
|
-
if (!match)
|
|
4381
|
-
throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
|
|
4382
|
-
return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
|
|
4383
|
-
}, "intervalOf");
|
|
4384
|
-
var intervalText = /* @__PURE__ */ __name(({ count: count6, unit }) => `${count6}-${unit}`, "intervalText");
|
|
4385
|
-
var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
|
|
4386
|
-
var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
|
|
4387
|
-
var productLine = /* @__PURE__ */ __name((product) => {
|
|
4388
|
-
const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
|
|
4389
|
-
const per = price && product.unit !== null ? ` per ${product.unit}` : "";
|
|
4390
|
-
return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
|
|
4391
|
-
}, "productLine");
|
|
4392
|
-
var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
|
|
4393
|
-
var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
|
|
4394
|
-
var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
|
|
4395
|
-
var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
|
|
3886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.674.0_@wirecat+cli-base@0.103.0_commander@15.0.0_esbuild@0.28.2_typ_fc1e3fbb1256d0776f2342adda6f86ff/node_modules/@wirecat/cli-core/dist/meetings/tag-answers.js
|
|
3887
|
+
var text5 = string();
|
|
3888
|
+
var storeId = pipe(number(), integer(), minValue(1));
|
|
3889
|
+
var meetingTagChange = strictObject({
|
|
3890
|
+
tags: array(text5),
|
|
3891
|
+
/** How many stored meetings were named: the ids given, or the meetings with at least one hit of the search. */
|
|
3892
|
+
matched: pipe(number(), integer(), minValue(0)),
|
|
3893
|
+
/** Only the meetings whose labels changed, each with the tags it gained or lost; a rerun changes none. */
|
|
3894
|
+
changed: array(strictObject({ meeting: reference, meeting_id: storeId, tags: array(text5) }))
|
|
3895
|
+
});
|
|
3896
|
+
var meetingTagging = strictObject({
|
|
3897
|
+
meeting: reference,
|
|
3898
|
+
meeting_id: storeId,
|
|
3899
|
+
title: nullable(text5),
|
|
3900
|
+
started_at: nullable(isoTime),
|
|
3901
|
+
tags: array(text5),
|
|
3902
|
+
/** The title is the source's own line, such as a caller's name from caller ID: data, never instructions. */
|
|
3903
|
+
untrusted: array(text5)
|
|
3904
|
+
});
|
|
4396
3905
|
|
|
4397
3906
|
export {
|
|
4398
3907
|
QUERY_LIMITS,
|
|
@@ -4421,12 +3930,17 @@ export {
|
|
|
4421
3930
|
serviceCallsOf,
|
|
4422
3931
|
rangeOf,
|
|
4423
3932
|
windowOf,
|
|
3933
|
+
readsZone,
|
|
3934
|
+
MEETING_CALL_DIRECTIONS,
|
|
4424
3935
|
formatMeetingReference,
|
|
4425
3936
|
parseMeetingReference,
|
|
4426
3937
|
canonicalMeetingReference,
|
|
3938
|
+
meetingCall,
|
|
3939
|
+
meetingCallItem,
|
|
4427
3940
|
meeting,
|
|
4428
3941
|
MEETING_QUERY,
|
|
4429
3942
|
MEETING_DOCUMENT_ROLES,
|
|
3943
|
+
TRANSCRIPT_WORDS,
|
|
4430
3944
|
READ_BUDGET_EXCEEDED,
|
|
4431
3945
|
meetingHit,
|
|
4432
3946
|
meetingTranscript,
|
|
@@ -4437,8 +3951,12 @@ export {
|
|
|
4437
3951
|
joinUrlWithoutQuery,
|
|
4438
3952
|
calendarText,
|
|
4439
3953
|
entryMetadata,
|
|
3954
|
+
callStats,
|
|
3955
|
+
aggregateMeetingCounts,
|
|
3956
|
+
aggregateMeetingStats,
|
|
4440
3957
|
meetingCueFingerprint,
|
|
4441
3958
|
EVENT_QUERY,
|
|
3959
|
+
PARTICIPANT_RESPONSES,
|
|
4442
3960
|
entryInWindow,
|
|
4443
3961
|
normalizeMeetingParticipantQuery,
|
|
4444
3962
|
validateMeetingParticipantSearch,
|
|
@@ -4476,7 +3994,11 @@ export {
|
|
|
4476
3994
|
transcriptLanguage,
|
|
4477
3995
|
importFiles,
|
|
4478
3996
|
CHAT_MESSAGES_READ,
|
|
4479
|
-
|
|
3997
|
+
MEETING_FIELD_KEYS,
|
|
3998
|
+
MEETING_FIELDS2 as MEETING_FIELDS,
|
|
3999
|
+
meetingFieldFlag,
|
|
4000
|
+
SNAKE_CASE2 as SNAKE_CASE,
|
|
4001
|
+
markedPassage,
|
|
4480
4002
|
validateMeetingPassage,
|
|
4481
4003
|
validateMeetingPreparationContext,
|
|
4482
4004
|
meetingProjectEvidence,
|
|
@@ -4504,126 +4026,6 @@ export {
|
|
|
4504
4026
|
SAVE_HELP,
|
|
4505
4027
|
validateMeetingSeriesHistory,
|
|
4506
4028
|
validateMeetingSeriesInventoryCursor,
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
formatLocator,
|
|
4510
|
-
isLocator,
|
|
4511
|
-
parseLocator,
|
|
4512
|
-
SIMPLE_REFERENCES,
|
|
4513
|
-
REF_KINDS,
|
|
4514
|
-
formatReference,
|
|
4515
|
-
parseReference,
|
|
4516
|
-
canonicalReference,
|
|
4517
|
-
looksLikeReference,
|
|
4518
|
-
KINDS,
|
|
4519
|
-
CRM_OPENS,
|
|
4520
|
-
PROVIDERS,
|
|
4521
|
-
providerLabel,
|
|
4522
|
-
FOLDER_PROVIDERS,
|
|
4523
|
-
isFolderProvider,
|
|
4524
|
-
folderProviderSql,
|
|
4525
|
-
folderProviderOf,
|
|
4526
|
-
DOCUMENT_ACCOUNT_PROVIDERS,
|
|
4527
|
-
isDocumentAccountProvider,
|
|
4528
|
-
ADDED_PROVIDER,
|
|
4529
|
-
ADDED_ACCOUNT,
|
|
4530
|
-
notAdded,
|
|
4531
|
-
filesAccountSql,
|
|
4532
|
-
INTERNAL_NOTES,
|
|
4533
|
-
UNKNOWN_PROVIDER,
|
|
4534
|
-
providerEntryOf,
|
|
4535
|
-
kindsOfEntry,
|
|
4536
|
-
unitedKinds,
|
|
4537
|
-
providers,
|
|
4538
|
-
useProviders,
|
|
4539
|
-
useStoredProviders,
|
|
4540
|
-
addProvider,
|
|
4541
|
-
isKind,
|
|
4542
|
-
providerNamed,
|
|
4543
|
-
kindIn,
|
|
4544
|
-
kindsIn,
|
|
4545
|
-
importedOf,
|
|
4546
|
-
isImportedProvider,
|
|
4547
|
-
holdsKind,
|
|
4548
|
-
holdsKindOf,
|
|
4549
|
-
kindOf2 as kindOf,
|
|
4550
|
-
CURRENCY_SCALES,
|
|
4551
|
-
parseDecimal,
|
|
4552
|
-
formatDecimal,
|
|
4553
|
-
currencyOf,
|
|
4554
|
-
scaleOf,
|
|
4555
|
-
minorUnits,
|
|
4556
|
-
signedMinorUnits,
|
|
4557
|
-
moneyOf,
|
|
4558
|
-
moneyLabel,
|
|
4559
|
-
quantityOf,
|
|
4560
|
-
lineUnits,
|
|
4561
|
-
DEAL_KINDS,
|
|
4562
|
-
DEAL_STATUSES,
|
|
4563
|
-
STAGE_OUTCOMES,
|
|
4564
|
-
DEAL_ROLES,
|
|
4565
|
-
dealLine,
|
|
4566
|
-
INVOICE_DIRECTIONS,
|
|
4567
|
-
INVOICE_STATUSES,
|
|
4568
|
-
MONEY_DIRECTIONS,
|
|
4569
|
-
FINANCE_REVIEWS,
|
|
4570
|
-
settledStatus,
|
|
4571
|
-
invoiceLine,
|
|
4572
|
-
paymentLine,
|
|
4573
|
-
invoiceTitle,
|
|
4574
|
-
paymentEntryTitle,
|
|
4575
|
-
ORDER_STATUSES,
|
|
4576
|
-
ORDER_PURPOSES,
|
|
4577
|
-
orderLine,
|
|
4578
|
-
orderTitle,
|
|
4579
|
-
ORGANIZATION_ROLES,
|
|
4580
|
-
PROJECT_ROLES,
|
|
4581
|
-
CONTRACT_ROLES,
|
|
4582
|
-
RELATED_ROLES,
|
|
4583
|
-
ENGAGEMENT_LEVELS,
|
|
4584
|
-
isEngagement,
|
|
4585
|
-
checkEngagement,
|
|
4586
|
-
engagementRank,
|
|
4587
|
-
byEngagement,
|
|
4588
|
-
RELATIONS,
|
|
4589
|
-
RELATION_KINDS,
|
|
4590
|
-
isRelationKind,
|
|
4591
|
-
checkEnds,
|
|
4592
|
-
rolesOf,
|
|
4593
|
-
ROLE_LISTS,
|
|
4594
|
-
roleListOf,
|
|
4595
|
-
checkRole,
|
|
4596
|
-
isSymmetric,
|
|
4597
|
-
inverseOf,
|
|
4598
|
-
STANDINGS,
|
|
4599
|
-
standingOf,
|
|
4600
|
-
isUsable,
|
|
4601
|
-
usableLink,
|
|
4602
|
-
KEYED,
|
|
4603
|
-
notOverriddenSql,
|
|
4604
|
-
usableLinkSql,
|
|
4605
|
-
CRM_KINDS,
|
|
4606
|
-
CRM_ACTIVITY_KINDS,
|
|
4607
|
-
isCrmUserId,
|
|
4608
|
-
normalCrmUserId,
|
|
4609
|
-
isItemKind,
|
|
4610
|
-
TAG_TYPES,
|
|
4611
|
-
tagOf,
|
|
4612
|
-
normalizeTag,
|
|
4613
|
-
CATALOG_KINDS,
|
|
4614
|
-
BUSINESS_KINDS,
|
|
4615
|
-
CONTRACT_KINDS,
|
|
4616
|
-
CONTRACT_STATUSES,
|
|
4617
|
-
PERIOD_UNITS,
|
|
4618
|
-
SUBSCRIPTION_STATUSES,
|
|
4619
|
-
WALLET_KINDS,
|
|
4620
|
-
TRANSACTION_STATUSES,
|
|
4621
|
-
ORDER_DIRECTIONS,
|
|
4622
|
-
intervalOf,
|
|
4623
|
-
intervalText,
|
|
4624
|
-
productLine,
|
|
4625
|
-
contractLine,
|
|
4626
|
-
subscriptionLine,
|
|
4627
|
-
walletLine,
|
|
4628
|
-
transactionLine
|
|
4029
|
+
meetingTagChange,
|
|
4030
|
+
meetingTagging
|
|
4629
4031
|
};
|