@wirecat/drive-cli 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin/drive.js +35 -40
- package/dist/bundle/all-profiles-LTHNCWQW.js +26 -0
- package/dist/bundle/anthropic-NOJEF3V2.js +71 -0
- package/dist/bundle/bun-ADJVI4HY.js +169 -0
- package/dist/bundle/bun-sqlite-GNXLBF2A.js +70 -0
- package/dist/bundle/chunk-2FTZBZOB.js +2315 -0
- package/dist/bundle/chunk-2YU3CXFD.js +3391 -0
- package/dist/bundle/chunk-35GRI4DI.js +375 -0
- package/dist/bundle/chunk-37MAA6F2.js +5624 -0
- package/dist/bundle/chunk-3V6NPZY7.js +2352 -0
- package/dist/bundle/chunk-4TIC23D2.js +9 -0
- package/dist/bundle/chunk-4TQSNQVV.js +1071 -0
- package/dist/bundle/chunk-4UE7AVHZ.js +150 -0
- package/dist/bundle/chunk-5DPV7X27.js +663 -0
- package/dist/bundle/chunk-5FONRUG6.js +24805 -0
- package/dist/bundle/chunk-5ZVLM6YR.js +19 -0
- package/dist/bundle/chunk-64WJYT2F.js +3954 -0
- package/dist/bundle/chunk-65GGKAQ7.js +82 -0
- package/dist/bundle/chunk-66N2DGGC.js +515 -0
- package/dist/bundle/chunk-6KFA6HOM.js +2941 -0
- package/dist/bundle/chunk-6Y2BYFXQ.js +65 -0
- package/dist/bundle/chunk-7NCG2SHR.js +74 -0
- package/dist/bundle/chunk-7PVNJAQ2.js +73 -0
- package/dist/bundle/chunk-7XWUOCGW.js +190 -0
- package/dist/bundle/chunk-A6ZKTNTZ.js +168 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-AH3SNVCV.js +498 -0
- package/dist/bundle/chunk-AN3GVZTU.js +76 -0
- package/dist/bundle/chunk-BPBIBVFH.js +166 -0
- package/dist/bundle/chunk-C4XP5T73.js +264 -0
- package/dist/bundle/chunk-C6SMAEED.js +18102 -0
- package/dist/bundle/chunk-CDI67JSB.js +1092 -0
- package/dist/bundle/chunk-CEO5HPRL.js +25 -0
- package/dist/bundle/chunk-CFT7UHF6.js +15572 -0
- package/dist/bundle/chunk-DC4T3FNP.js +1913 -0
- package/dist/bundle/chunk-DCTXOMOR.js +35 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-EVWXODYV.js +754 -0
- package/dist/bundle/chunk-GKHM6I64.js +2356 -0
- package/dist/bundle/chunk-GNI7INK6.js +18 -0
- package/dist/bundle/chunk-GTYY6BIE.js +58 -0
- package/dist/bundle/chunk-GX4WEMAG.js +164 -0
- package/dist/bundle/chunk-HA3WCVGY.js +8179 -0
- package/dist/bundle/chunk-HLONHTSG.js +281 -0
- package/dist/bundle/chunk-HOIUIKWS.js +236 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-I5EJHKNC.js +111 -0
- package/dist/bundle/chunk-ICKNJIGE.js +31 -0
- package/dist/bundle/chunk-IGB5CJCA.js +62 -0
- package/dist/bundle/chunk-IP4OK7RQ.js +24 -0
- package/dist/bundle/chunk-IVQ6342B.js +2 -0
- package/dist/bundle/chunk-K4N2DKE5.js +17 -0
- package/dist/bundle/chunk-LNB7BIZL.js +844 -0
- package/dist/bundle/chunk-LVDHWNJF.js +193 -0
- package/dist/bundle/chunk-LW2G4U6W.js +570 -0
- package/dist/bundle/chunk-LWT55XC5.js +60 -0
- package/dist/bundle/chunk-LY26NW3I.js +6848 -0
- package/dist/bundle/chunk-MJR2OTO4.js +1714 -0
- package/dist/bundle/chunk-MWUITL6N.js +42 -0
- package/dist/bundle/chunk-N47CYWEM.js +454 -0
- package/dist/bundle/chunk-NKZ6V4JW.js +263 -0
- package/dist/bundle/chunk-NQ6LLDDC.js +161 -0
- package/dist/bundle/chunk-NZIHPYY5.js +215 -0
- package/dist/bundle/chunk-OECPFZLP.js +3541 -0
- package/dist/bundle/chunk-P5KGFT7U.js +18 -0
- package/dist/bundle/chunk-PDH2QQQV.js +484 -0
- package/dist/bundle/chunk-PIN5RZ3D.js +63 -0
- package/dist/bundle/chunk-PJDO7AFZ.js +421 -0
- package/dist/bundle/chunk-PWKXHDBQ.js +18078 -0
- package/dist/bundle/chunk-QLZGLPJL.js +100 -0
- package/dist/bundle/chunk-SBZB7HMU.js +1055 -0
- package/dist/bundle/chunk-SGOPYPVW.js +835 -0
- package/dist/bundle/chunk-TDC6JGDA.js +630 -0
- package/dist/bundle/chunk-TOYPN2XX.js +288 -0
- package/dist/bundle/chunk-UC44ZMQV.js +78 -0
- package/dist/bundle/chunk-V7GN5BI7.js +99 -0
- package/dist/bundle/chunk-VO4KOLQZ.js +119 -0
- package/dist/bundle/chunk-WPGCDWPU.js +1855 -0
- package/dist/bundle/chunk-WQMVSQPP.js +886 -0
- package/dist/bundle/chunk-WZUJKUBK.js +384 -0
- package/dist/bundle/chunk-X5DFDGWS.js +2 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XPEWOPJR.js +431 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-Y5EJSZXV.js +220 -0
- package/dist/bundle/chunk-YE3J6DLY.js +106 -0
- package/dist/bundle/chunk-YFLKH3NZ.js +48 -0
- package/dist/bundle/chunk-YJX4X564.js +138 -0
- package/dist/bundle/chunk-YJZBJ2TM.js +71 -0
- package/dist/bundle/chunk-Z4O6C7WR.js +1973 -0
- package/dist/bundle/chunk-ZIHLE7LG.js +15992 -0
- package/dist/bundle/chunk-ZPMLLONT.js +1054 -0
- package/dist/bundle/chunk-ZQNXKWUY.js +35584 -0
- package/dist/bundle/chunk-ZS635F4O.js +45 -0
- package/dist/bundle/chunk-ZU732VCC.js +122 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-HX35D7KV.js +38 -0
- package/dist/bundle/dist-MWTMOYWT.js +7577 -0
- package/dist/bundle/dist-PY3MVR3G.js +21 -0
- package/dist/bundle/drive.js +50 -0
- package/dist/bundle/echarts-RFTK737T.js +42501 -0
- package/dist/bundle/embed-5NAGJUMD.js +37 -0
- package/dist/bundle/embedder-EWXLIGBY.js +110 -0
- package/dist/bundle/entry-YCPJ6H6U.js +15 -0
- package/dist/bundle/failure-XBWHHBEW.js +37 -0
- package/dist/bundle/first-run-LNAZDBB4.js +24 -0
- package/dist/bundle/first-screen-P5NNFJD7.js +36 -0
- package/dist/bundle/google-5FFKRHHC.js +32 -0
- package/dist/bundle/google-api-TJCFOOAP.js +82 -0
- package/dist/bundle/identity-53ZMPL2O.js +10 -0
- package/dist/bundle/instructions-FHNL7CMW.js +9 -0
- package/dist/bundle/login-VXXZZR6G.js +158 -0
- package/dist/bundle/mcp-2CJCJXSW.js +95 -0
- package/dist/bundle/mcp-F4XZO76F.js +507 -0
- package/dist/bundle/mcp-IXFC2VVR.js +165 -0
- package/dist/bundle/mdast-util-from-markdown-FXEPSNER.js +1958 -0
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +2103 -0
- package/dist/bundle/micromark-extension-gfm-GRL24TU6.js +1838 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-ZMCACJVS.js +176 -0
- package/dist/bundle/node-sqlite-QJQ5S7KS.js +46 -0
- package/dist/bundle/oauth-TZFDPAFE.js +18 -0
- package/dist/bundle/open-IYM25QTL.js +20 -0
- package/dist/bundle/process-ZPTLNVQS.js +91 -0
- package/dist/bundle/program-YX7DZMPR.js +24100 -0
- package/dist/bundle/prompt-TGWTVIEK.js +13 -0
- package/dist/bundle/reasons-Q5LOQESQ.js +11 -0
- package/dist/bundle/recognize-AGPMWKIY.js +191 -0
- package/dist/bundle/remote-QV7QSLAK.js +28 -0
- package/dist/bundle/rerank-HZKJJCS4.js +51 -0
- package/dist/bundle/serve-NRJQOVT4.js +20 -0
- package/dist/bundle/server-2UQDEWTS.js +818 -0
- package/dist/bundle/server-R4JUHFSW.js +56 -0
- package/dist/bundle/services-NZQWVMOE.js +333 -0
- package/dist/bundle/sqlite-runtime-6MXHTYYU.js +17 -0
- package/dist/bundle/state-IF2FLTSY.js +34 -0
- package/dist/bundle/store-HBD54IRL.js +142 -0
- package/dist/bundle/store-HVIBXOXS.js +125 -0
- package/dist/bundle/store-maintenance-command-U3F4RGJB.js +57 -0
- package/dist/bundle/terminal-TFCTWLOS.js +11 -0
- package/dist/bundle/tokens-5D5YUA2Q.js +103 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +106 -54
- package/dist/commands/mcp.js.map +1 -1
- package/dist/config.d.ts +3 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -1
- package/dist/config.js.map +1 -1
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +123 -83
- package/dist/contract-overrides.js.map +1 -1
- package/dist/mcp.d.ts +14 -6
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +26 -12
- package/dist/mcp.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +7 -5
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +0 -1
- package/dist/reasons.js.map +1 -1
- package/dist/registry.d.ts +2 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +8 -2
- package/dist/registry.js.map +1 -1
- package/dist/state.d.ts +6 -3
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +6 -3
- package/dist/state.js.map +1 -1
- package/dist/tokens.d.ts +4 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +44 -8
- package/dist/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
- package/scenarios/agent-access.md +2 -2
- package/skills/drive-cli/SKILL.md +2 -1
|
@@ -0,0 +1,2352 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
dateRange,
|
|
5
|
+
defineQuery,
|
|
6
|
+
parseLucene,
|
|
7
|
+
queryError,
|
|
8
|
+
queryFieldsOf,
|
|
9
|
+
timezoneOf,
|
|
10
|
+
validateQuery
|
|
11
|
+
} from "./chunk-SGOPYPVW.js";
|
|
12
|
+
import {
|
|
13
|
+
singleLine,
|
|
14
|
+
visibleControls
|
|
15
|
+
} from "./chunk-6KFA6HOM.js";
|
|
16
|
+
import {
|
|
17
|
+
CliError,
|
|
18
|
+
STEPS,
|
|
19
|
+
array,
|
|
20
|
+
boolean,
|
|
21
|
+
defineSteps,
|
|
22
|
+
integer,
|
|
23
|
+
isoTime,
|
|
24
|
+
literal,
|
|
25
|
+
maxValue,
|
|
26
|
+
minLength,
|
|
27
|
+
minValue,
|
|
28
|
+
nullable,
|
|
29
|
+
number,
|
|
30
|
+
optional,
|
|
31
|
+
pageSchema,
|
|
32
|
+
picklist,
|
|
33
|
+
pipe,
|
|
34
|
+
reference,
|
|
35
|
+
safeParse,
|
|
36
|
+
stepOf,
|
|
37
|
+
strictObject,
|
|
38
|
+
string,
|
|
39
|
+
union
|
|
40
|
+
} from "./chunk-GKHM6I64.js";
|
|
41
|
+
import {
|
|
42
|
+
__name
|
|
43
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
44
|
+
|
|
45
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
46
|
+
var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
|
|
47
|
+
const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
|
|
48
|
+
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)))
|
|
49
|
+
throw new CliError("validation_error", "context takes 0\u2013999 surrounding cues, 2\u20134194304 output bytes and a bounded read budget");
|
|
50
|
+
return { before, after, bytes, max_read_bytes };
|
|
51
|
+
}, "meetingHitContextLimits");
|
|
52
|
+
var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
|
|
53
|
+
meetingHitContextLimits(options);
|
|
54
|
+
if (typeof reference2 !== "string" || !reference2.trim() || reference2.length > 200 || options.format !== void 0 && !["json", "text", "markdown"].includes(options.format))
|
|
55
|
+
throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
|
|
56
|
+
}, "validateMeetingPassage");
|
|
57
|
+
|
|
58
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/reference.js
|
|
59
|
+
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
60
|
+
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
61
|
+
if (!Number.isSafeInteger(value) || value < minimum)
|
|
62
|
+
throw invalid();
|
|
63
|
+
return value;
|
|
64
|
+
}, "integer");
|
|
65
|
+
var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
|
|
66
|
+
const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
|
|
67
|
+
if (reference2.transcriptId !== void 0)
|
|
68
|
+
parts.push(integer2(reference2.transcriptId));
|
|
69
|
+
if (reference2.cuePosition !== void 0) {
|
|
70
|
+
if (reference2.transcriptId === void 0)
|
|
71
|
+
throw invalid();
|
|
72
|
+
parts.push(integer2(reference2.cuePosition, 0));
|
|
73
|
+
}
|
|
74
|
+
return `meeting:${parts.join("/")}`;
|
|
75
|
+
}, "formatMeetingReference");
|
|
76
|
+
var parseMeetingReference = /* @__PURE__ */ __name((text7) => {
|
|
77
|
+
const value = text7.trim();
|
|
78
|
+
if (!value.startsWith("meeting:"))
|
|
79
|
+
throw invalid();
|
|
80
|
+
const parts = value.slice(8).split("/");
|
|
81
|
+
if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
|
|
82
|
+
throw invalid();
|
|
83
|
+
const ids2 = parts.map(Number);
|
|
84
|
+
const reference2 = {
|
|
85
|
+
type: "meeting",
|
|
86
|
+
accountId: integer2(ids2[0]),
|
|
87
|
+
meetingId: integer2(ids2[1]),
|
|
88
|
+
...ids2.length > 2 ? { transcriptId: integer2(ids2[2]) } : {},
|
|
89
|
+
...ids2.length > 3 ? { cuePosition: integer2(ids2[3], 0) } : {}
|
|
90
|
+
};
|
|
91
|
+
return reference2;
|
|
92
|
+
}, "parseMeetingReference");
|
|
93
|
+
var canonicalMeetingReference = /* @__PURE__ */ __name((text7) => formatMeetingReference(parseMeetingReference(text7)), "canonicalMeetingReference");
|
|
94
|
+
|
|
95
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
96
|
+
var text = string();
|
|
97
|
+
var count = pipe(number(), integer(), minValue(0));
|
|
98
|
+
var MEETING_ISSUES = ["time_without_zone"];
|
|
99
|
+
var meetingIssuesOf = /* @__PURE__ */ __name((metadata) => {
|
|
100
|
+
const listed2 = metadata?.issues;
|
|
101
|
+
return Array.isArray(listed2) ? MEETING_ISSUES.filter((issue) => listed2.includes(issue)) : [];
|
|
102
|
+
}, "meetingIssuesOf");
|
|
103
|
+
var meeting = strictObject({
|
|
104
|
+
ref: reference,
|
|
105
|
+
id: pipe(string(), minLength(1)),
|
|
106
|
+
provider: text,
|
|
107
|
+
account: text,
|
|
108
|
+
title: nullable(text),
|
|
109
|
+
description: optional(nullable(text)),
|
|
110
|
+
location: optional(nullable(text)),
|
|
111
|
+
/** The link that joins it. */
|
|
112
|
+
url: nullable(text),
|
|
113
|
+
started_at: nullable(isoTime),
|
|
114
|
+
ended_at: nullable(isoTime),
|
|
115
|
+
duration_ms: nullable(count),
|
|
116
|
+
timezone: optional(nullable(text)),
|
|
117
|
+
participants_count: nullable(count),
|
|
118
|
+
/** Present only when something about this meeting is doubtful. */
|
|
119
|
+
issues: optional(array(picklist(MEETING_ISSUES))),
|
|
120
|
+
created_at: isoTime,
|
|
121
|
+
updated_at: isoTime
|
|
122
|
+
});
|
|
123
|
+
var iso = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
124
|
+
var meetingItem = /* @__PURE__ */ __name((row, owner) => {
|
|
125
|
+
const issues = meetingIssuesOf(row.metadata);
|
|
126
|
+
return {
|
|
127
|
+
ref: formatMeetingReference({ type: "meeting", accountId: row.accountId, meetingId: row.id }),
|
|
128
|
+
id: String(row.id),
|
|
129
|
+
provider: owner.provider,
|
|
130
|
+
account: owner.account,
|
|
131
|
+
title: row.title,
|
|
132
|
+
description: row.description,
|
|
133
|
+
location: row.location,
|
|
134
|
+
url: row.joinUrl,
|
|
135
|
+
started_at: iso(row.startedAt),
|
|
136
|
+
ended_at: iso(row.endedAt),
|
|
137
|
+
duration_ms: row.durationMs,
|
|
138
|
+
timezone: row.timezone,
|
|
139
|
+
participants_count: row.participantsCount,
|
|
140
|
+
...issues.length ? { issues } : {},
|
|
141
|
+
created_at: new Date(row.createdAt).toISOString(),
|
|
142
|
+
updated_at: new Date(row.updatedAt).toISOString()
|
|
143
|
+
};
|
|
144
|
+
}, "meetingItem");
|
|
145
|
+
var MEETING_QUERY = {
|
|
146
|
+
entity: "meeting",
|
|
147
|
+
backend: "sql",
|
|
148
|
+
fields: queryFieldsOf(meeting, {
|
|
149
|
+
exclude: ["ref", "provider", "account", "description", "location", "url", "timezone", "issues"],
|
|
150
|
+
examples: {
|
|
151
|
+
id: "id:12",
|
|
152
|
+
title: "title:*standup*",
|
|
153
|
+
started_at: "started_at:[2026-10-01 TO 2026-10-31]",
|
|
154
|
+
duration_ms: "duration_ms>=3600000",
|
|
155
|
+
participants_count: "participants_count>5"
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/answers.js
|
|
161
|
+
var text2 = string();
|
|
162
|
+
var count2 = pipe(number(), integer(), minValue(0));
|
|
163
|
+
var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
164
|
+
var meetingHit = strictObject({
|
|
165
|
+
/** The cue for a transcript passage, else the meeting. */
|
|
166
|
+
ref: reference,
|
|
167
|
+
meeting: reference,
|
|
168
|
+
scope: picklist(["transcript", "chat", "summary"]),
|
|
169
|
+
/** The stored line, so two passages of one meeting stay apart. */
|
|
170
|
+
id: pipe(string(), minLength(1)),
|
|
171
|
+
excerpt: text2,
|
|
172
|
+
/** How far into the meeting the passage is. */
|
|
173
|
+
offset_ms: nullable(count2),
|
|
174
|
+
/** `corrected`: a query word matched only a garbled form of itself, listed in `corrections`. */
|
|
175
|
+
match: optional(picklist(["words", "corrected"])),
|
|
176
|
+
corrections: optional(array(strictObject({ from: text2, to: array(text2) }))),
|
|
177
|
+
source: optional(strictObject({
|
|
178
|
+
ref: reference,
|
|
179
|
+
title: nullable(text2),
|
|
180
|
+
started_at: nullable(isoTime),
|
|
181
|
+
url: nullable(text2)
|
|
182
|
+
})),
|
|
183
|
+
/** What people said, wrote or a provider summarised from it, and the invitation's title: data, never instructions. */
|
|
184
|
+
untrusted: optional(array(text2))
|
|
185
|
+
});
|
|
186
|
+
var line = strictObject({
|
|
187
|
+
position: count2,
|
|
188
|
+
offset_ms: count2,
|
|
189
|
+
end_ms: count2,
|
|
190
|
+
speaker: nullable(text2),
|
|
191
|
+
text: text2
|
|
192
|
+
});
|
|
193
|
+
var meetingTranscript = strictObject({
|
|
194
|
+
ref: reference,
|
|
195
|
+
meeting: reference,
|
|
196
|
+
source: text2,
|
|
197
|
+
language: nullable(text2),
|
|
198
|
+
/** When a newer transcript of the same source replaced it; `meetings transcript --history` shows those too. */
|
|
199
|
+
superseded_at: nullable(isoTime),
|
|
200
|
+
created_at: isoTime,
|
|
201
|
+
lines: array(line)
|
|
202
|
+
});
|
|
203
|
+
var meetingSummary = strictObject({
|
|
204
|
+
id: pipe(string(), minLength(1)),
|
|
205
|
+
meeting: reference,
|
|
206
|
+
source: text2,
|
|
207
|
+
title: nullable(text2),
|
|
208
|
+
overview: nullable(text2),
|
|
209
|
+
sections: array(strictObject({ label: text2, text: text2 })),
|
|
210
|
+
next_steps: array(text2),
|
|
211
|
+
content: nullable(text2),
|
|
212
|
+
url: nullable(text2),
|
|
213
|
+
created_at: isoTime,
|
|
214
|
+
updated_at: isoTime
|
|
215
|
+
});
|
|
216
|
+
var meetingDetails = strictObject({
|
|
217
|
+
...meeting.entries,
|
|
218
|
+
/** The stored event and series it belongs to, as `meetings_list` takes them. */
|
|
219
|
+
event_id: nullable(text2),
|
|
220
|
+
series_id: nullable(text2),
|
|
221
|
+
series_title: nullable(text2),
|
|
222
|
+
participants: array(strictObject({
|
|
223
|
+
name: nullable(text2),
|
|
224
|
+
email: nullable(text2),
|
|
225
|
+
role: nullable(text2),
|
|
226
|
+
joined_at: nullable(isoTime),
|
|
227
|
+
left_at: nullable(isoTime),
|
|
228
|
+
duration_ms: nullable(count2)
|
|
229
|
+
})),
|
|
230
|
+
transcripts: array(strictObject({ ref: reference, source: text2, language: nullable(text2), lines_count: count2 })),
|
|
231
|
+
chat: array(strictObject({ sent_at: isoTime, sender: nullable(text2), recipient: nullable(text2), text: text2 })),
|
|
232
|
+
summaries: array(meetingSummary),
|
|
233
|
+
attachments: array(strictObject({
|
|
234
|
+
position: count2,
|
|
235
|
+
kind: text2,
|
|
236
|
+
name: nullable(text2),
|
|
237
|
+
mime: nullable(text2),
|
|
238
|
+
size: nullable(count2),
|
|
239
|
+
url: nullable(text2)
|
|
240
|
+
}))
|
|
241
|
+
});
|
|
242
|
+
var meetingRef = /* @__PURE__ */ __name((accountId, meetingId) => formatMeetingReference({ type: "meeting", accountId, meetingId }), "meetingRef");
|
|
243
|
+
var meetingTranscriptItem = /* @__PURE__ */ __name((accountId, transcript, rows) => ({
|
|
244
|
+
ref: formatMeetingReference({
|
|
245
|
+
type: "meeting",
|
|
246
|
+
accountId,
|
|
247
|
+
meetingId: transcript.meetingId,
|
|
248
|
+
transcriptId: transcript.id
|
|
249
|
+
}),
|
|
250
|
+
meeting: meetingRef(accountId, transcript.meetingId),
|
|
251
|
+
source: transcript.source,
|
|
252
|
+
language: transcript.language,
|
|
253
|
+
superseded_at: iso2(transcript.supersededAt),
|
|
254
|
+
created_at: new Date(transcript.externalCreatedAt ?? transcript.createdAt).toISOString(),
|
|
255
|
+
lines: rows.map((row) => ({
|
|
256
|
+
position: row.position,
|
|
257
|
+
offset_ms: row.startMs,
|
|
258
|
+
end_ms: row.endMs,
|
|
259
|
+
speaker: row.speakerName,
|
|
260
|
+
text: row.text
|
|
261
|
+
}))
|
|
262
|
+
}), "meetingTranscriptItem");
|
|
263
|
+
var meetingSummaryItem = /* @__PURE__ */ __name((accountId, summary) => ({
|
|
264
|
+
id: String(summary.id),
|
|
265
|
+
meeting: meetingRef(accountId, summary.meetingId),
|
|
266
|
+
source: summary.source,
|
|
267
|
+
title: summary.title,
|
|
268
|
+
overview: summary.overview,
|
|
269
|
+
sections: summary.sections.map(({ label, text: text7 }) => ({ label, text: text7 })),
|
|
270
|
+
next_steps: summary.nextSteps,
|
|
271
|
+
content: summary.content,
|
|
272
|
+
url: summary.docUrl,
|
|
273
|
+
created_at: new Date(summary.externalCreatedAt ?? summary.createdAt).toISOString(),
|
|
274
|
+
updated_at: new Date(summary.externalUpdatedAt ?? summary.updatedAt).toISOString()
|
|
275
|
+
}), "meetingSummaryItem");
|
|
276
|
+
var meetingDetailsItem = /* @__PURE__ */ __name((details, owner) => {
|
|
277
|
+
const { accountId } = details.meeting;
|
|
278
|
+
return {
|
|
279
|
+
...meetingItem(details.meeting, owner),
|
|
280
|
+
event_id: details.meeting.eventId === null ? null : String(details.meeting.eventId),
|
|
281
|
+
series_id: details.meeting.meetingSeriesId === null ? null : String(details.meeting.meetingSeriesId),
|
|
282
|
+
series_title: details.series?.title ?? null,
|
|
283
|
+
participants: details.participants.map((one) => ({
|
|
284
|
+
name: one.displayName,
|
|
285
|
+
email: one.email,
|
|
286
|
+
role: one.role,
|
|
287
|
+
joined_at: iso2(one.joinedAt),
|
|
288
|
+
left_at: iso2(one.leftAt),
|
|
289
|
+
duration_ms: one.durationMs
|
|
290
|
+
})),
|
|
291
|
+
transcripts: details.transcripts.filter(({ transcript }) => transcript.supersededAt === null && transcript.deletedAt === null).map(({ transcript, rows }) => ({
|
|
292
|
+
ref: formatMeetingReference({
|
|
293
|
+
type: "meeting",
|
|
294
|
+
accountId,
|
|
295
|
+
meetingId: transcript.meetingId,
|
|
296
|
+
transcriptId: transcript.id
|
|
297
|
+
}),
|
|
298
|
+
source: transcript.source,
|
|
299
|
+
language: transcript.language,
|
|
300
|
+
lines_count: rows.length
|
|
301
|
+
})),
|
|
302
|
+
chat: details.chat.map((one) => ({
|
|
303
|
+
sent_at: new Date(one.sentAt).toISOString(),
|
|
304
|
+
sender: one.senderName,
|
|
305
|
+
recipient: one.recipient,
|
|
306
|
+
text: one.text
|
|
307
|
+
})),
|
|
308
|
+
summaries: details.summaries.map((one) => meetingSummaryItem(accountId, one)),
|
|
309
|
+
attachments: details.attachments.map((one) => ({
|
|
310
|
+
position: one.position,
|
|
311
|
+
kind: one.kind,
|
|
312
|
+
name: one.name ?? one.title,
|
|
313
|
+
mime: one.mime,
|
|
314
|
+
size: one.size,
|
|
315
|
+
url: one.url
|
|
316
|
+
}))
|
|
317
|
+
};
|
|
318
|
+
}, "meetingDetailsItem");
|
|
319
|
+
var wholeList = /* @__PURE__ */ __name((items) => ({
|
|
320
|
+
items,
|
|
321
|
+
page: { mode: "page", limit: Math.max(1, items.length), has_more: false }
|
|
322
|
+
}), "wholeList");
|
|
323
|
+
var PAGE_NEXT = STEPS.find((step) => step.id === "page.next");
|
|
324
|
+
var MEETING_STEPS = defineSteps([
|
|
325
|
+
{
|
|
326
|
+
id: "meetings.search-again",
|
|
327
|
+
command: "*",
|
|
328
|
+
args: [],
|
|
329
|
+
why: "passages that changed since they were indexed were left out; the next search indexes them first"
|
|
330
|
+
}
|
|
331
|
+
]);
|
|
332
|
+
var SEARCH_AGAIN = MEETING_STEPS[0];
|
|
333
|
+
var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
|
|
334
|
+
ref: hit.ref,
|
|
335
|
+
meeting: meetingRef(parseMeetingReference(hit.ref).accountId, hit.meetingId),
|
|
336
|
+
scope: hit.scope,
|
|
337
|
+
id: String(hit.id),
|
|
338
|
+
excerpt: hit.text,
|
|
339
|
+
offset_ms: hit.startMs,
|
|
340
|
+
untrusted: hit.source === void 0 ? ["excerpt"] : ["excerpt", "source.title"],
|
|
341
|
+
...hit.match === void 0 ? {} : { match: hit.match },
|
|
342
|
+
...hit.corrections === void 0 ? {} : { corrections: hit.corrections },
|
|
343
|
+
...hit.source === void 0 ? {} : {
|
|
344
|
+
source: {
|
|
345
|
+
ref: hit.ref,
|
|
346
|
+
title: hit.source.title,
|
|
347
|
+
started_at: iso2(hit.source.startedAt),
|
|
348
|
+
url: hit.source.url
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}), "meetingHitItem");
|
|
352
|
+
var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
|
|
353
|
+
const items = found.items.map(meetingHitItem);
|
|
354
|
+
const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
|
|
355
|
+
const pending = found.coverage.indexing === "pending";
|
|
356
|
+
const next = [
|
|
357
|
+
...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
|
|
358
|
+
...pending ? [
|
|
359
|
+
stepOf(SEARCH_AGAIN, {
|
|
360
|
+
command,
|
|
361
|
+
args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
|
|
362
|
+
})
|
|
363
|
+
] : []
|
|
364
|
+
];
|
|
365
|
+
return {
|
|
366
|
+
items,
|
|
367
|
+
page: {
|
|
368
|
+
mode: "cursor",
|
|
369
|
+
limit,
|
|
370
|
+
has_more: cursor !== void 0,
|
|
371
|
+
...cursor === void 0 ? {} : { next_cursor: cursor }
|
|
372
|
+
},
|
|
373
|
+
...next.length > 0 ? { next } : {},
|
|
374
|
+
...pending ? {
|
|
375
|
+
missing: [
|
|
376
|
+
{
|
|
377
|
+
field: "excerpt",
|
|
378
|
+
why: "passages that changed since they were indexed were left out",
|
|
379
|
+
step: "meetings.search-again"
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
} : {},
|
|
383
|
+
...Object.keys(meta).length === 0 ? {} : { meta }
|
|
384
|
+
};
|
|
385
|
+
}, "meetingHitsList");
|
|
386
|
+
|
|
387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
|
|
388
|
+
var joinKeyOf = /* @__PURE__ */ __name((url) => {
|
|
389
|
+
const parsed = urlOf(url);
|
|
390
|
+
if (!parsed)
|
|
391
|
+
return null;
|
|
392
|
+
const host = parsed.hostname.toLowerCase().replace(/^www\./u, "");
|
|
393
|
+
const path = parsed.pathname.replace(/\/+$/u, "");
|
|
394
|
+
if (host === "zoom.us" || host.endsWith(".zoom.us") || host === "zoomgov.com" || host.endsWith(".zoomgov.com")) {
|
|
395
|
+
const number2 = /^\/(?:j|w|s|wc\/join|wc)\/(\d{9,12})(?:\/|$)/u.exec(path)?.[1];
|
|
396
|
+
if (number2)
|
|
397
|
+
return `zoom:${number2}`;
|
|
398
|
+
}
|
|
399
|
+
if (host === "meet.google.com") {
|
|
400
|
+
const code = /^\/([a-z]{3}-[a-z]{4}-[a-z]{3})$/iu.exec(path)?.[1];
|
|
401
|
+
if (code)
|
|
402
|
+
return `meet:${code.toLowerCase()}`;
|
|
403
|
+
}
|
|
404
|
+
return `${host}${path}`;
|
|
405
|
+
}, "joinKeyOf");
|
|
406
|
+
var joinUrlWithoutQuery = /* @__PURE__ */ __name((url) => {
|
|
407
|
+
const parsed = urlOf(url);
|
|
408
|
+
return parsed ? `${parsed.origin}${parsed.pathname}` : null;
|
|
409
|
+
}, "joinUrlWithoutQuery");
|
|
410
|
+
var urlOf = /* @__PURE__ */ __name((url) => {
|
|
411
|
+
if (!url?.trim())
|
|
412
|
+
return null;
|
|
413
|
+
try {
|
|
414
|
+
const parsed = new URL(url.trim());
|
|
415
|
+
return parsed.protocol === "https:" || parsed.protocol === "http:" ? parsed : null;
|
|
416
|
+
} catch {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
}, "urlOf");
|
|
420
|
+
|
|
421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
|
|
422
|
+
var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
|
|
423
|
+
var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
|
|
424
|
+
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");
|
|
425
|
+
var withoutLinkQueries = /* @__PURE__ */ __name((text7) => text7.replace(/https?:\/\/[^\s<>"')\]]+/giu, (url) => joinUrlWithoutQuery(url) ?? ""), "withoutLinkQueries");
|
|
426
|
+
var calendarText = /* @__PURE__ */ __name((text7, { dropSecretLines = true } = {}) => {
|
|
427
|
+
if (!text7)
|
|
428
|
+
return null;
|
|
429
|
+
const kept = htmlToText(text7).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
|
|
430
|
+
const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
|
|
431
|
+
return joined || null;
|
|
432
|
+
}, "calendarText");
|
|
433
|
+
var ENTRY_METADATA_KEYS = [
|
|
434
|
+
"colorId",
|
|
435
|
+
"guestsCanInviteOthers",
|
|
436
|
+
"guestsCanModify",
|
|
437
|
+
"guestsCanSeeOtherGuests",
|
|
438
|
+
"hangoutLink",
|
|
439
|
+
"locked",
|
|
440
|
+
"privateCopy"
|
|
441
|
+
];
|
|
442
|
+
var entryMetadata = /* @__PURE__ */ __name((metadata) => {
|
|
443
|
+
const kept = {};
|
|
444
|
+
for (const key of ENTRY_METADATA_KEYS) {
|
|
445
|
+
const value = metadata?.[key];
|
|
446
|
+
if (typeof value === "string")
|
|
447
|
+
kept[key] = withoutLinkQueries(value);
|
|
448
|
+
else if (typeof value === "number" || typeof value === "boolean")
|
|
449
|
+
kept[key] = value;
|
|
450
|
+
}
|
|
451
|
+
return kept;
|
|
452
|
+
}, "entryMetadata");
|
|
453
|
+
|
|
454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
|
|
455
|
+
import { createHash } from "node:crypto";
|
|
456
|
+
var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
|
|
457
|
+
reference: cue2.reference,
|
|
458
|
+
transcriptId: cue2.transcriptId,
|
|
459
|
+
contentHash: cue2.contentHash,
|
|
460
|
+
position: cue2.position,
|
|
461
|
+
startMs: cue2.startMs,
|
|
462
|
+
endMs: cue2.endMs,
|
|
463
|
+
speakerParticipantId: cue2.speakerParticipantId,
|
|
464
|
+
speakerName: cue2.speakerName,
|
|
465
|
+
text: cue2.text
|
|
466
|
+
})).digest("hex"), "meetingCueFingerprint");
|
|
467
|
+
|
|
468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
|
|
469
|
+
var EVENT_QUERY = defineQuery({
|
|
470
|
+
entity: "event",
|
|
471
|
+
backend: "sql",
|
|
472
|
+
fields: [
|
|
473
|
+
{ name: "id", type: "num", operators: ["term", "range"], example: "id:1" },
|
|
474
|
+
{ name: "origin", type: "enum", operators: ["term"], values: ["auto", "owner"], example: "origin:owner" },
|
|
475
|
+
...["starts_at", "ends_at", "created_at", "updated_at"].map((name) => ({
|
|
476
|
+
name,
|
|
477
|
+
type: "time",
|
|
478
|
+
operators: ["term", "range"],
|
|
479
|
+
example: `${name}>=2026-01-01`
|
|
480
|
+
}))
|
|
481
|
+
]
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/events.js
|
|
485
|
+
var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now()) => {
|
|
486
|
+
const current = await store.meeting(details.meeting.id);
|
|
487
|
+
if (!current)
|
|
488
|
+
return null;
|
|
489
|
+
const { meeting: meeting2, series } = current;
|
|
490
|
+
if (meeting2.eventId !== null)
|
|
491
|
+
return (await store.events()).find((e) => e.id === meeting2.eventId) ?? null;
|
|
492
|
+
const candidates = meeting2.startedAt === null ? [] : await store.eventCandidates({
|
|
493
|
+
meetingSeriesId: meeting2.meetingSeriesId,
|
|
494
|
+
joinUrl: meeting2.joinUrl,
|
|
495
|
+
startsAt: meeting2.startedAt,
|
|
496
|
+
endsAt: meeting2.endedAt ?? meeting2.startedAt
|
|
497
|
+
});
|
|
498
|
+
if (candidates.length > 1) {
|
|
499
|
+
await store.reviewMeetingLink?.(meeting2.id, candidates.map(({ id: id4 }) => id4), now);
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
let event2 = candidates[0];
|
|
503
|
+
if (!event2) {
|
|
504
|
+
let eventSeriesId = series?.eventSeriesId ?? null;
|
|
505
|
+
if (series?.kind === "recurring" && eventSeriesId === null) {
|
|
506
|
+
const created = await store.createEventSeries({ title: series.title, recurrence: null, origin: "auto" }, now);
|
|
507
|
+
eventSeriesId = created.id;
|
|
508
|
+
await store.setEventSeries(series.id, eventSeriesId, now);
|
|
509
|
+
}
|
|
510
|
+
event2 = await store.createEvent({
|
|
511
|
+
eventSeriesId,
|
|
512
|
+
title: meeting2.title,
|
|
513
|
+
description: meeting2.description,
|
|
514
|
+
location: meeting2.location,
|
|
515
|
+
startsAt: meeting2.startedAt,
|
|
516
|
+
endsAt: meeting2.endedAt,
|
|
517
|
+
timezone: meeting2.timezone,
|
|
518
|
+
origin: "auto",
|
|
519
|
+
deletedAt: null
|
|
520
|
+
}, now);
|
|
521
|
+
}
|
|
522
|
+
await store.linkMeeting(meeting2.id, event2.id, now);
|
|
523
|
+
const linked = await store.meeting(meeting2.id);
|
|
524
|
+
return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
|
|
525
|
+
}, "linkEvent");
|
|
526
|
+
|
|
527
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
|
|
528
|
+
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text7) => text7.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
|
|
529
|
+
var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
|
|
530
|
+
if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
|
|
531
|
+
throw new CliError("validation_error", "participant query must contain 1\u2013500 characters without NUL");
|
|
532
|
+
return normalizeMeetingParticipantQuery(query.trim());
|
|
533
|
+
}, "validateMeetingParticipantQuery");
|
|
534
|
+
var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) => {
|
|
535
|
+
input.signal?.throwIfAborted();
|
|
536
|
+
const normalized = validateMeetingParticipantQuery(query);
|
|
537
|
+
const bounded = /* @__PURE__ */ __name((value, maximum, name) => {
|
|
538
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > maximum)
|
|
539
|
+
throw new CliError("validation_error", `${name} must be an integer from 1 through ${maximum}`);
|
|
540
|
+
return value;
|
|
541
|
+
}, "bounded");
|
|
542
|
+
return {
|
|
543
|
+
query: normalized,
|
|
544
|
+
accountId: bounded(input.accountId, Number.MAX_SAFE_INTEGER, "accountId"),
|
|
545
|
+
limit: bounded(input.limit ?? 50, 1e3, "limit"),
|
|
546
|
+
scanLimit: bounded(input.scanLimit ?? 1e3, 1e4, "scanLimit"),
|
|
547
|
+
maxReadBytes: bounded(input.maxReadBytes ?? 1024 ** 2, 64 * 1024 ** 2, "maxReadBytes")
|
|
548
|
+
};
|
|
549
|
+
}, "validateMeetingParticipantSearch");
|
|
550
|
+
|
|
551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/reads.js
|
|
552
|
+
var MeetingError = class extends CliError {
|
|
553
|
+
static {
|
|
554
|
+
__name(this, "MeetingError");
|
|
555
|
+
}
|
|
556
|
+
constructor(code, message) {
|
|
557
|
+
super(code, message);
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
var positiveInteger = /* @__PURE__ */ __name((value) => {
|
|
561
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value <= 0)
|
|
562
|
+
throw new MeetingError("validation_error", "expected a positive integer");
|
|
563
|
+
return value;
|
|
564
|
+
}, "positiveInteger");
|
|
565
|
+
var validateFilter = /* @__PURE__ */ __name((filter) => {
|
|
566
|
+
for (const value of [filter.accountId, filter.eventId, filter.meetingSeriesId])
|
|
567
|
+
if (value !== void 0)
|
|
568
|
+
positiveInteger(value);
|
|
569
|
+
for (const value of [filter.since, filter.until])
|
|
570
|
+
if (value !== void 0 && !Number.isFinite(value))
|
|
571
|
+
throw new MeetingError("validation_error", "expected epoch milliseconds");
|
|
572
|
+
if (filter.since !== void 0 && filter.until !== void 0 && filter.since > filter.until)
|
|
573
|
+
throw new MeetingError("validation_error", "since must not exceed until");
|
|
574
|
+
for (const value of [filter.limit, filter.offset])
|
|
575
|
+
if (value !== void 0 && (!Number.isSafeInteger(value) || value < 0))
|
|
576
|
+
throw new MeetingError("validation_error", "expected a nonnegative integer");
|
|
577
|
+
}, "validateFilter");
|
|
578
|
+
var meetingShow = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
579
|
+
const details = await store.meeting(positiveInteger(id4));
|
|
580
|
+
if (!details || accountId !== void 0 && details.meeting.accountId !== accountId)
|
|
581
|
+
throw new MeetingError("not_found", "meeting not found");
|
|
582
|
+
return details;
|
|
583
|
+
}, "meetingShow");
|
|
584
|
+
var listed = /* @__PURE__ */ __name((items) => ({ items, page: 1, limit: items.length, hasMore: false }), "listed");
|
|
585
|
+
var meetingPeople = /* @__PURE__ */ __name(async (store, query, accountId, options = {}) => {
|
|
586
|
+
if (accountId === void 0)
|
|
587
|
+
validateMeetingParticipantQuery(query);
|
|
588
|
+
else
|
|
589
|
+
validateMeetingParticipantSearch(query, { ...options, accountId });
|
|
590
|
+
if (store.participantCandidates && accountId === void 0)
|
|
591
|
+
throw new MeetingError("configuration_error", "select an account for bounded participant lookup");
|
|
592
|
+
if (accountId !== void 0 && store.participantCandidates) {
|
|
593
|
+
const { limit, has_more, next_cursor, ...packet } = await store.participantCandidates(query, {
|
|
594
|
+
...options,
|
|
595
|
+
accountId
|
|
596
|
+
});
|
|
597
|
+
return {
|
|
598
|
+
...packet,
|
|
599
|
+
page: { mode: "cursor", limit, has_more, ...next_cursor ? { next_cursor } : {} },
|
|
600
|
+
...next_cursor ? {
|
|
601
|
+
next: [
|
|
602
|
+
stepOf(PAGE_NEXT2, {
|
|
603
|
+
command: "meetings people",
|
|
604
|
+
args: {
|
|
605
|
+
query,
|
|
606
|
+
limit,
|
|
607
|
+
...options.scanLimit === void 0 ? {} : { scan_limit: options.scanLimit },
|
|
608
|
+
...options.maxReadBytes === void 0 ? {} : { max_read_bytes: options.maxReadBytes },
|
|
609
|
+
cursor: next_cursor
|
|
610
|
+
},
|
|
611
|
+
values: { shown: packet.items.length }
|
|
612
|
+
})
|
|
613
|
+
]
|
|
614
|
+
} : {}
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
if (Object.values(options).some((value) => value !== void 0))
|
|
618
|
+
throw new MeetingError("configuration_error", "bounded participant lookup needs a selected account and capable store");
|
|
619
|
+
return listed(await store.participants(query, accountId));
|
|
620
|
+
}, "meetingPeople");
|
|
621
|
+
var PAGE_NEXT2 = STEPS.find((step) => step.id === "page.next");
|
|
622
|
+
var meetingsList = /* @__PURE__ */ __name(async (store, filter = {}, page = 1) => {
|
|
623
|
+
validateFilter(filter);
|
|
624
|
+
positiveInteger(page);
|
|
625
|
+
const limit = positiveInteger(filter.limit ?? 100);
|
|
626
|
+
const offset = (page - 1) * limit;
|
|
627
|
+
if (!Number.isSafeInteger(offset + limit + 1))
|
|
628
|
+
throw new MeetingError("validation_error", "pagination exceeds safe integer range");
|
|
629
|
+
const rows = await store.meetings({ ...filter, limit: limit + 1, offset });
|
|
630
|
+
const shown = rows.slice(0, limit);
|
|
631
|
+
const owners = /* @__PURE__ */ new Map();
|
|
632
|
+
for (const { accountId } of shown) {
|
|
633
|
+
if (owners.has(accountId))
|
|
634
|
+
continue;
|
|
635
|
+
const owner = await store.account(accountId);
|
|
636
|
+
if (!owner)
|
|
637
|
+
throw new MeetingError("not_found", `meeting account ${accountId} is not in the store`);
|
|
638
|
+
owners.set(accountId, owner);
|
|
639
|
+
}
|
|
640
|
+
const has_more = rows.length > limit;
|
|
641
|
+
return {
|
|
642
|
+
items: shown.map((row) => meetingItem(row, owners.get(row.accountId))),
|
|
643
|
+
page: { mode: "page", limit, has_more, ...has_more ? { next_page: page + 1 } : {} },
|
|
644
|
+
...has_more ? {
|
|
645
|
+
next: [
|
|
646
|
+
stepOf(PAGE_NEXT2, { command: "meetings list", args: { page: page + 1, limit }, values: { shown: limit } })
|
|
647
|
+
]
|
|
648
|
+
} : {}
|
|
649
|
+
};
|
|
650
|
+
}, "meetingsList");
|
|
651
|
+
var meetingsQuery = /* @__PURE__ */ __name((text7) => {
|
|
652
|
+
if (text7 === void 0 || text7.trim() === "")
|
|
653
|
+
return void 0;
|
|
654
|
+
const context3 = { command: "meetings list", guide: MEETING_QUERY_GUIDE };
|
|
655
|
+
const query = parseLucene(text7, { defaultField: "none", ...context3 });
|
|
656
|
+
validateQuery(query, MEETING_QUERY, context3);
|
|
657
|
+
return query;
|
|
658
|
+
}, "meetingsQuery");
|
|
659
|
+
var MEETING_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
660
|
+
var ownerOf = /* @__PURE__ */ __name(async (store, accountId) => {
|
|
661
|
+
const owner = await store.account(accountId);
|
|
662
|
+
if (!owner)
|
|
663
|
+
throw new MeetingError("not_found", `meeting account ${accountId} is not in the store`);
|
|
664
|
+
return owner;
|
|
665
|
+
}, "ownerOf");
|
|
666
|
+
var meetingDetailsAnswer = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
667
|
+
const details = await meetingShow(store, id4, accountId);
|
|
668
|
+
return { item: meetingDetailsItem(details, await ownerOf(store, details.meeting.accountId)) };
|
|
669
|
+
}, "meetingDetailsAnswer");
|
|
670
|
+
var meetingTranscriptAnswer = /* @__PURE__ */ __name(async (store, id4, accountId, options = {}) => {
|
|
671
|
+
const details = await meetingShow(store, id4, accountId);
|
|
672
|
+
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)));
|
|
673
|
+
}, "meetingTranscriptAnswer");
|
|
674
|
+
var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
675
|
+
const details = await meetingShow(store, id4, accountId);
|
|
676
|
+
return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
|
|
677
|
+
}, "meetingSummaryAnswer");
|
|
678
|
+
|
|
679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/export.js
|
|
680
|
+
var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
681
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
|
|
682
|
+
throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
|
|
683
|
+
const hours = Math.floor(milliseconds / 36e5);
|
|
684
|
+
const minutes = Math.floor(milliseconds % 36e5 / 6e4);
|
|
685
|
+
const seconds = Math.floor(milliseconds % 6e4 / 1e3);
|
|
686
|
+
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}.${String(milliseconds % 1e3).padStart(3, "0")}`;
|
|
687
|
+
}, "timestamp");
|
|
688
|
+
var vttText = /* @__PURE__ */ __name((text7) => {
|
|
689
|
+
if (visibleControls(text7) !== text7 || /\n\s*\n/.test(text7))
|
|
690
|
+
throw new MeetingError("validation_error", "cue paragraphs or control characters require Markdown export");
|
|
691
|
+
return text7.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
692
|
+
}, "vttText");
|
|
693
|
+
var serializeVtt = /* @__PURE__ */ __name((lines) => `WEBVTT
|
|
694
|
+
|
|
695
|
+
${lines.map((line2, index) => {
|
|
696
|
+
if (index > 0 && line2.startMs < (lines[index - 1]?.startMs ?? 0))
|
|
697
|
+
throw new MeetingError("validation_error", "WebVTT cues must have nondecreasing start times");
|
|
698
|
+
if (line2.endMs <= line2.startMs)
|
|
699
|
+
throw new MeetingError("validation_error", "a transcript cue ends before it starts");
|
|
700
|
+
const speaker = line2.speaker === null ? "" : `${vttText(line2.speaker)}: `;
|
|
701
|
+
if (line2.speaker?.includes("\n"))
|
|
702
|
+
throw new MeetingError("validation_error", "a speaker must fit on one line");
|
|
703
|
+
return `${index + 1}
|
|
704
|
+
${timestamp(line2.startMs)} --> ${timestamp(line2.endMs)}
|
|
705
|
+
${speaker}${vttText(line2.text)}
|
|
706
|
+
|
|
707
|
+
`;
|
|
708
|
+
}).join("")}`, "serializeVtt");
|
|
709
|
+
var markdown = /* @__PURE__ */ __name((text7) => visibleControls(text7).replace(/[\\`*_{}[\]()<>#+.!|~]/g, "\\$&"), "markdown");
|
|
710
|
+
var heading = /* @__PURE__ */ __name((text7) => markdown(singleLine(text7)), "heading");
|
|
711
|
+
var quote = /* @__PURE__ */ __name((text7) => markdown(text7).split(/\r\n|\r|\n/).map((line2) => `> ${line2}`).join("\n"), "quote");
|
|
712
|
+
var transcriptsOf = /* @__PURE__ */ __name((details, transcriptId) => {
|
|
713
|
+
if (transcriptId !== void 0) {
|
|
714
|
+
positiveInteger(transcriptId);
|
|
715
|
+
const transcript = details.transcripts.find((part) => part.transcript.id === transcriptId && part.transcript.deletedAt === null);
|
|
716
|
+
if (!transcript)
|
|
717
|
+
throw new MeetingError("not_found", "transcript not found in the selected meeting");
|
|
718
|
+
return [transcript];
|
|
719
|
+
}
|
|
720
|
+
return details.transcripts.filter((part) => part.transcript.supersededAt === null && part.transcript.deletedAt === null);
|
|
721
|
+
}, "transcriptsOf");
|
|
722
|
+
var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
723
|
+
if (options.format !== "markdown" && options.format !== "vtt")
|
|
724
|
+
throw new MeetingError("validation_error", "export format must be markdown or vtt");
|
|
725
|
+
const details = await meetingShow(store, id4, options.accountId);
|
|
726
|
+
const transcripts = transcriptsOf(details, options.transcriptId);
|
|
727
|
+
let content;
|
|
728
|
+
if (options.format === "vtt") {
|
|
729
|
+
const [selected] = transcripts;
|
|
730
|
+
if (!selected)
|
|
731
|
+
throw new MeetingError("not_found", "meeting has no transcript to export");
|
|
732
|
+
if (transcripts.length > 1)
|
|
733
|
+
throw new MeetingError("validation_error", "choose a transcript id when exporting multiple transcripts as VTT");
|
|
734
|
+
content = serializeVtt([...selected.rows].sort((a, b) => a.position - b.position).map((row) => ({
|
|
735
|
+
startMs: row.startMs,
|
|
736
|
+
endMs: row.endMs,
|
|
737
|
+
speaker: row.speakerName,
|
|
738
|
+
text: row.text
|
|
739
|
+
})));
|
|
740
|
+
} else {
|
|
741
|
+
const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
|
|
742
|
+
if (details.meeting.description !== null)
|
|
743
|
+
parts.push("## Description", quote(details.meeting.description));
|
|
744
|
+
for (const summary of details.summaries) {
|
|
745
|
+
parts.push(`## ${heading(summary.title ?? "Summary")}`);
|
|
746
|
+
if (summary.content !== null)
|
|
747
|
+
parts.push(quote(summary.content));
|
|
748
|
+
else {
|
|
749
|
+
if (summary.overview !== null)
|
|
750
|
+
parts.push(quote(summary.overview));
|
|
751
|
+
for (const section of summary.sections)
|
|
752
|
+
parts.push(`### ${heading(section.label)}`, quote(section.text));
|
|
753
|
+
if (summary.nextSteps.length > 0)
|
|
754
|
+
parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
for (const part of transcripts) {
|
|
758
|
+
parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
|
|
759
|
+
if (part.transcript.supersededAt !== null)
|
|
760
|
+
parts.push("Version: superseded");
|
|
761
|
+
for (const row of [...part.rows].sort((a, b) => a.position - b.position))
|
|
762
|
+
parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
|
|
763
|
+
}
|
|
764
|
+
content = `${parts.join("\n\n")}
|
|
765
|
+
`;
|
|
766
|
+
}
|
|
767
|
+
return {
|
|
768
|
+
meetingId: details.meeting.id,
|
|
769
|
+
format: options.format,
|
|
770
|
+
filename: `meeting-${details.meeting.id}${options.transcriptId === void 0 ? "" : `-transcript-${options.transcriptId}`}.${options.format === "markdown" ? "md" : "vtt"}`,
|
|
771
|
+
content
|
|
772
|
+
};
|
|
773
|
+
}, "exportMeeting");
|
|
774
|
+
|
|
775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
776
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
777
|
+
|
|
778
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/provider.js
|
|
779
|
+
var snapshotMeetingScope = /* @__PURE__ */ __name((scope2) => {
|
|
780
|
+
const provider = scope2?.provider;
|
|
781
|
+
const account = scope2?.account;
|
|
782
|
+
if (typeof provider !== "string" || !provider.trim() || provider.length > 200 || /[\0\r\n]/.test(provider) || typeof account !== "string" || !account.trim() || account.length > 1e3 || /[\0\r\n]/.test(account))
|
|
783
|
+
throw new CliError("validation_error", "meeting provider and account must be bounded nonempty identifiers");
|
|
784
|
+
return Object.freeze({ provider, account });
|
|
785
|
+
}, "snapshotMeetingScope");
|
|
786
|
+
|
|
787
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
|
|
788
|
+
var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
789
|
+
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
|
|
790
|
+
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone`);
|
|
791
|
+
const date = value.slice(0, 10);
|
|
792
|
+
const instant = Date.parse(`${date}T00:00:00Z`);
|
|
793
|
+
if (!Number.isFinite(instant) || new Date(instant).toISOString().slice(0, 10) !== date)
|
|
794
|
+
throw new CliError("validation_error", `${name} contains an invalid calendar date`);
|
|
795
|
+
return new Date(value).toISOString();
|
|
796
|
+
}, "meetingTimestamp");
|
|
797
|
+
|
|
798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
|
|
799
|
+
var nonempty = /* @__PURE__ */ __name((value, name) => {
|
|
800
|
+
if (typeof value !== "string" || !value.trim())
|
|
801
|
+
throw new CliError("validation_error", `${name} must be nonempty`);
|
|
802
|
+
return value;
|
|
803
|
+
}, "nonempty");
|
|
804
|
+
var validateMeetingChange = /* @__PURE__ */ __name((change, create) => {
|
|
805
|
+
if (!change || typeof change !== "object" || Array.isArray(change) || Object.keys(change).some((key) => !["title", "kind", "startTime", "durationMinutes", "timezone", "agenda"].includes(key)))
|
|
806
|
+
throw new CliError("validation_error", "unsupported meeting change field");
|
|
807
|
+
const result = {};
|
|
808
|
+
if (change.title !== void 0)
|
|
809
|
+
result.title = nonempty(change.title, "meeting title");
|
|
810
|
+
if (create && result.title === void 0)
|
|
811
|
+
throw new CliError("validation_error", "meeting title is required");
|
|
812
|
+
if (change.kind !== void 0) {
|
|
813
|
+
if (change.kind !== "instant" && change.kind !== "scheduled")
|
|
814
|
+
throw new CliError("validation_error", "only instant or scheduled meeting kinds are supported");
|
|
815
|
+
result.kind = change.kind;
|
|
816
|
+
}
|
|
817
|
+
if (change.startTime !== void 0) {
|
|
818
|
+
result.startTime = meetingTimestamp(change.startTime, "meeting start");
|
|
819
|
+
}
|
|
820
|
+
if (change.durationMinutes !== void 0) {
|
|
821
|
+
if (!Number.isSafeInteger(change.durationMinutes) || change.durationMinutes <= 0 || change.durationMinutes > 1440)
|
|
822
|
+
throw new CliError("validation_error", "meeting duration must be an integer from 1 to 1440 minutes");
|
|
823
|
+
result.durationMinutes = change.durationMinutes;
|
|
824
|
+
}
|
|
825
|
+
if (change.timezone !== void 0) {
|
|
826
|
+
if (typeof change.timezone !== "string" || !change.timezone.trim())
|
|
827
|
+
throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
|
|
828
|
+
try {
|
|
829
|
+
new Intl.DateTimeFormat("en", { timeZone: change.timezone }).format();
|
|
830
|
+
} catch {
|
|
831
|
+
throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
|
|
832
|
+
}
|
|
833
|
+
result.timezone = change.timezone;
|
|
834
|
+
}
|
|
835
|
+
if (change.agenda !== void 0) {
|
|
836
|
+
if (typeof change.agenda !== "string")
|
|
837
|
+
throw new CliError("validation_error", "meeting agenda must be text");
|
|
838
|
+
result.agenda = change.agenda;
|
|
839
|
+
}
|
|
840
|
+
if (create) {
|
|
841
|
+
result.kind ??= "scheduled";
|
|
842
|
+
if (result.kind === "scheduled" && result.startTime === void 0)
|
|
843
|
+
throw new CliError("validation_error", "scheduled meeting start is required");
|
|
844
|
+
} else if (!Object.keys(result).length)
|
|
845
|
+
throw new CliError("validation_error", "at least one meeting change is required");
|
|
846
|
+
return Object.freeze(result);
|
|
847
|
+
}, "validateMeetingChange");
|
|
848
|
+
var checkCancelled = /* @__PURE__ */ __name((signal) => {
|
|
849
|
+
if (!signal?.aborted)
|
|
850
|
+
return;
|
|
851
|
+
if (signal.reason instanceof CliError)
|
|
852
|
+
throw signal.reason;
|
|
853
|
+
const timeout = signal.reason instanceof Error && signal.reason.name === "TimeoutError";
|
|
854
|
+
throw new CliError(timeout ? "timeout" : "cancelled", timeout ? "meeting operation timed out" : "meeting operation cancelled");
|
|
855
|
+
}, "checkCancelled");
|
|
856
|
+
var dispatchMeetingMutation = /* @__PURE__ */ __name(async (options, dispatch) => {
|
|
857
|
+
const { apply, dryRun, signal } = options;
|
|
858
|
+
checkCancelled(signal);
|
|
859
|
+
if (apply !== true || dryRun)
|
|
860
|
+
return { applied: false };
|
|
861
|
+
return { applied: true, value: await dispatch(signal) };
|
|
862
|
+
}, "dispatchMeetingMutation");
|
|
863
|
+
|
|
864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/meeting-context.js
|
|
865
|
+
var MEETING_FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
866
|
+
var id = /* @__PURE__ */ __name((value) => {
|
|
867
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
868
|
+
throw new CliError("validation_error", "meeting context identifiers must be positive integers");
|
|
869
|
+
return value;
|
|
870
|
+
}, "id");
|
|
871
|
+
var text3 = /* @__PURE__ */ __name((value, max) => {
|
|
872
|
+
if (typeof value !== "string" || !value.trim() || value.length > max || value.includes("\0"))
|
|
873
|
+
throw new CliError("validation_error", `meeting context text must contain 1\u2013${max} characters without NUL`);
|
|
874
|
+
return value.trim();
|
|
875
|
+
}, "text");
|
|
876
|
+
var uid = /* @__PURE__ */ __name((value) => {
|
|
877
|
+
const result = text3(value, 100);
|
|
878
|
+
if (!/^[1-9]\d*$/.test(result) || !Number.isSafeInteger(Number(result)))
|
|
879
|
+
throw new CliError("validation_error", "person UID must be a positive integer");
|
|
880
|
+
return result;
|
|
881
|
+
}, "uid");
|
|
882
|
+
var strings = /* @__PURE__ */ __name((value, count6, length) => {
|
|
883
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > count6)
|
|
884
|
+
throw new CliError("validation_error", `meeting context list must contain 1\u2013${count6} entries`);
|
|
885
|
+
return Object.freeze([...new Set(value.map((entry) => text3(entry, length)))]);
|
|
886
|
+
}, "strings");
|
|
887
|
+
var fields = {
|
|
888
|
+
"note.add": ["text", "title"],
|
|
889
|
+
"tags.add": ["tags"],
|
|
890
|
+
"tags.remove": ["tags"],
|
|
891
|
+
"memory.add": ["body", "kind", "scope", "evidence", "subject"],
|
|
892
|
+
"fact.add": ["statement", "type", "scope", "evidence", "subject"],
|
|
893
|
+
"event.link": ["eventId", "expectedEventId"],
|
|
894
|
+
"person.link": ["participantId", "personUid", "targetAccountIds", "expectedPersonUid"]
|
|
895
|
+
};
|
|
896
|
+
var validateMeetingContextChange = /* @__PURE__ */ __name((change) => {
|
|
897
|
+
if (!change || typeof change !== "object" || Array.isArray(change) || !Object.hasOwn(fields, change.action) || Object.keys(change).some((key) => key !== "action" && !fields[change.action].includes(key)))
|
|
898
|
+
throw new CliError("validation_error", "unsupported meeting context change");
|
|
899
|
+
switch (change.action) {
|
|
900
|
+
case "note.add":
|
|
901
|
+
return Object.freeze({
|
|
902
|
+
action: change.action,
|
|
903
|
+
text: text3(change.text, 1e5),
|
|
904
|
+
...change.title === void 0 ? {} : { title: text3(change.title, 500) }
|
|
905
|
+
});
|
|
906
|
+
case "tags.add":
|
|
907
|
+
case "tags.remove":
|
|
908
|
+
return Object.freeze({ action: change.action, tags: strings(change.tags, 100, 200) });
|
|
909
|
+
case "memory.add": {
|
|
910
|
+
if (!["summary", "digest", "preference"].includes(change.kind) || !["personal", "work"].includes(change.scope))
|
|
911
|
+
throw new CliError("validation_error", "memory kind and explicit personal/work scope are required");
|
|
912
|
+
return Object.freeze({
|
|
913
|
+
action: change.action,
|
|
914
|
+
body: text3(change.body, 2e4),
|
|
915
|
+
kind: change.kind,
|
|
916
|
+
scope: change.scope,
|
|
917
|
+
evidence: strings(change.evidence, 100, 4e3),
|
|
918
|
+
...change.subject === void 0 ? {} : { subject: text3(change.subject, 4e3) }
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
case "fact.add": {
|
|
922
|
+
if (!MEETING_FACT_TYPES.includes(change.type) || !["personal", "work"].includes(change.scope))
|
|
923
|
+
throw new CliError("validation_error", `fact type (${MEETING_FACT_TYPES.join(", ")}) and explicit personal/work scope are required`);
|
|
924
|
+
return Object.freeze({
|
|
925
|
+
action: change.action,
|
|
926
|
+
statement: text3(change.statement, 2e4),
|
|
927
|
+
type: change.type,
|
|
928
|
+
scope: change.scope,
|
|
929
|
+
evidence: strings(change.evidence, 100, 4e3),
|
|
930
|
+
...change.subject === void 0 ? {} : { subject: text3(change.subject, 4e3) }
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
case "event.link":
|
|
934
|
+
return Object.freeze({
|
|
935
|
+
action: change.action,
|
|
936
|
+
eventId: change.eventId === null ? null : id(change.eventId),
|
|
937
|
+
...change.expectedEventId === void 0 ? {} : { expectedEventId: change.expectedEventId === null ? null : id(change.expectedEventId) }
|
|
938
|
+
});
|
|
939
|
+
case "person.link": {
|
|
940
|
+
const targets = change.targetAccountIds;
|
|
941
|
+
if (targets !== void 0 && (!Array.isArray(targets) || targets.length < 1 || targets.length > 1e3))
|
|
942
|
+
throw new CliError("validation_error", "target accounts must contain 1\u20131000 identifiers");
|
|
943
|
+
return Object.freeze({
|
|
944
|
+
action: change.action,
|
|
945
|
+
participantId: id(change.participantId),
|
|
946
|
+
personUid: uid(change.personUid),
|
|
947
|
+
...targets === void 0 ? {} : { targetAccountIds: Object.freeze([...new Set(targets.map(id))]) },
|
|
948
|
+
...change.expectedPersonUid === void 0 ? {} : { expectedPersonUid: change.expectedPersonUid === null ? null : uid(change.expectedPersonUid) }
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}, "validateMeetingContextChange");
|
|
953
|
+
var createMeetingContext = /* @__PURE__ */ __name((scope2, accountId, ports) => {
|
|
954
|
+
const fixed = snapshotMeetingScope(scope2);
|
|
955
|
+
const account = id(accountId);
|
|
956
|
+
const actions = Object.freeze([...new Set(ports.actions)]);
|
|
957
|
+
if (actions.some((action) => !Object.hasOwn(fields, action)))
|
|
958
|
+
throw new CliError("validation_error", "unsupported meeting context capability");
|
|
959
|
+
const apply = ports.apply.bind(ports);
|
|
960
|
+
return {
|
|
961
|
+
scope: fixed,
|
|
962
|
+
accountId: account,
|
|
963
|
+
actions,
|
|
964
|
+
async change(meetingId, input, options = {}) {
|
|
965
|
+
const target = id(meetingId);
|
|
966
|
+
const change = validateMeetingContextChange(input);
|
|
967
|
+
if (!actions.includes(change.action))
|
|
968
|
+
throw new CliError("provider_unavailable", `meeting context does not support ${change.action}`);
|
|
969
|
+
const context3 = Object.freeze({
|
|
970
|
+
scope: fixed,
|
|
971
|
+
accountId: account,
|
|
972
|
+
...options.signal ? { signal: options.signal } : {}
|
|
973
|
+
});
|
|
974
|
+
const outcome = await dispatchMeetingMutation(options, () => apply(target, change, context3));
|
|
975
|
+
return {
|
|
976
|
+
scope: fixed,
|
|
977
|
+
accountId: account,
|
|
978
|
+
meetingId: target,
|
|
979
|
+
change,
|
|
980
|
+
applied: outcome.applied,
|
|
981
|
+
...outcome.applied ? { result: outcome.value } : {}
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
}, "createMeetingContext");
|
|
986
|
+
|
|
987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
988
|
+
var TASK_TYPES = ["bug", "feature", "chore"];
|
|
989
|
+
var invalid2 = /* @__PURE__ */ __name((message) => {
|
|
990
|
+
throw new CliError("validation_error", message);
|
|
991
|
+
}, "invalid");
|
|
992
|
+
var text4 = /* @__PURE__ */ __name((value, limit) => {
|
|
993
|
+
if (typeof value !== "string" || !value.trim() || value.includes("\0") || value.length > limit)
|
|
994
|
+
return invalid2(`finding text must contain 1\u2013${limit} characters without NUL`);
|
|
995
|
+
return value.trim();
|
|
996
|
+
}, "text");
|
|
997
|
+
var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update(JSON.stringify(value)).digest("hex"), "findingHash");
|
|
998
|
+
var fields2 = /* @__PURE__ */ __name((value, allowed, noun) => {
|
|
999
|
+
if (Object.keys(value).some((key) => !allowed.includes(key)))
|
|
1000
|
+
invalid2(`unknown ${noun} field`);
|
|
1001
|
+
}, "fields");
|
|
1002
|
+
var validateFindings = /* @__PURE__ */ __name((input, rules) => {
|
|
1003
|
+
if (!input || typeof input !== "object" || Buffer.byteLength(JSON.stringify(input), "utf8") > 65536)
|
|
1004
|
+
return invalid2(`${rules.plural} take at most 65536 UTF-8 bytes`);
|
|
1005
|
+
fields2(input, ["schemaVersion", "key", "extractor", "findings"], rules.singular);
|
|
1006
|
+
if (input.schemaVersion !== 1 || !Array.isArray(input.findings) || input.findings.length < 1 || input.findings.length > 16)
|
|
1007
|
+
return invalid2(`schemaVersion 1 takes 1\u201316 ${rules.plural}`);
|
|
1008
|
+
const key = text4(input.key, 64);
|
|
1009
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(key))
|
|
1010
|
+
return invalid2("a findings key uses letters, digits, dot, colon, underscore or hyphen");
|
|
1011
|
+
const ids2 = /* @__PURE__ */ new Set();
|
|
1012
|
+
const findings = input.findings.map((finding) => {
|
|
1013
|
+
if (!finding || typeof finding !== "object")
|
|
1014
|
+
return invalid2("a finding is an object");
|
|
1015
|
+
const id4 = text4(finding.id, 64);
|
|
1016
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(id4) || ids2.has(id4))
|
|
1017
|
+
return invalid2("finding IDs must be unique simple keys");
|
|
1018
|
+
ids2.add(id4);
|
|
1019
|
+
const project = text4(finding.project, 64);
|
|
1020
|
+
if (!/^project:[1-9]\d*$/.test(project))
|
|
1021
|
+
return invalid2("a finding names a project reference");
|
|
1022
|
+
if (!Array.isArray(finding.evidence) || finding.evidence.length < 1 || finding.evidence.length > 8)
|
|
1023
|
+
return invalid2(`a finding requires 1\u20138 cited ${rules.cited}s`);
|
|
1024
|
+
const evidence = finding.evidence.map((item) => {
|
|
1025
|
+
if (!item || typeof item !== "object")
|
|
1026
|
+
return invalid2("finding evidence is a reference and fingerprint");
|
|
1027
|
+
fields2(item, ["reference", "fingerprint"], rules.singular);
|
|
1028
|
+
if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
|
|
1029
|
+
return invalid2("evidence requires a reference and fingerprint");
|
|
1030
|
+
const reference2 = rules.reference(item.reference);
|
|
1031
|
+
if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
|
|
1032
|
+
return invalid2(`finding evidence requires exact ${rules.cited} references and fingerprints`);
|
|
1033
|
+
return { reference: reference2, fingerprint: item.fingerprint };
|
|
1034
|
+
}).sort((a, b) => a.reference.localeCompare(b.reference));
|
|
1035
|
+
if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
|
|
1036
|
+
return invalid2(`duplicate evidence ${rules.cited}`);
|
|
1037
|
+
const base = { id: id4, project, evidence };
|
|
1038
|
+
if (finding.kind === "fact") {
|
|
1039
|
+
fields2(finding, ["id", "project", "evidence", "kind", "type", "statement"], rules.singular);
|
|
1040
|
+
if (!MEETING_FACT_TYPES.includes(finding.type))
|
|
1041
|
+
return invalid2("unknown fact finding type");
|
|
1042
|
+
return { ...base, kind: "fact", type: finding.type, statement: text4(finding.statement, 2e3) };
|
|
1043
|
+
}
|
|
1044
|
+
if (finding.kind !== "task")
|
|
1045
|
+
return invalid2("a finding is a fact or task");
|
|
1046
|
+
fields2(finding, [
|
|
1047
|
+
"id",
|
|
1048
|
+
"project",
|
|
1049
|
+
"evidence",
|
|
1050
|
+
"kind",
|
|
1051
|
+
"type",
|
|
1052
|
+
"title",
|
|
1053
|
+
"reason",
|
|
1054
|
+
"commitment",
|
|
1055
|
+
"dueAt",
|
|
1056
|
+
"dueEvidence",
|
|
1057
|
+
"assignee",
|
|
1058
|
+
"assigneeEvidence"
|
|
1059
|
+
], rules.singular);
|
|
1060
|
+
if (!TASK_TYPES.includes(finding.type))
|
|
1061
|
+
return invalid2("a task finding type is bug, chore or feature");
|
|
1062
|
+
if (!["explicit", "inferred"].includes(finding.commitment))
|
|
1063
|
+
return invalid2("task commitment must be explicit or inferred");
|
|
1064
|
+
const support = /* @__PURE__ */ __name((value) => {
|
|
1065
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref) => typeof ref !== "string" || !evidence.some((item) => item.reference === ref)))
|
|
1066
|
+
return invalid2("date and assignee support must cite the finding's evidence");
|
|
1067
|
+
return [...new Set(value)].sort();
|
|
1068
|
+
}, "support");
|
|
1069
|
+
if (finding.dueAt === void 0 !== (finding.dueEvidence === void 0) || finding.assignee === void 0 !== (finding.assigneeEvidence === void 0))
|
|
1070
|
+
return invalid2("optional dates and assignees require their supporting evidence");
|
|
1071
|
+
if (finding.assignee !== void 0 && (typeof finding.assignee !== "string" || !/^person:[1-9]\d*$/.test(finding.assignee)))
|
|
1072
|
+
return invalid2("an assignee must be a person reference");
|
|
1073
|
+
return {
|
|
1074
|
+
...base,
|
|
1075
|
+
kind: "task",
|
|
1076
|
+
type: finding.type,
|
|
1077
|
+
title: text4(finding.title, 300),
|
|
1078
|
+
reason: text4(finding.reason, 2e3),
|
|
1079
|
+
commitment: finding.commitment,
|
|
1080
|
+
...finding.dueAt === void 0 ? {} : { dueAt: meetingTimestamp(finding.dueAt, "finding due date"), dueEvidence: support(finding.dueEvidence) },
|
|
1081
|
+
...finding.assignee === void 0 ? {} : { assignee: finding.assignee, assigneeEvidence: support(finding.assigneeEvidence) }
|
|
1082
|
+
};
|
|
1083
|
+
});
|
|
1084
|
+
return { schemaVersion: 1, key, extractor: text4(input.extractor, 200), findings };
|
|
1085
|
+
}, "validateFindings");
|
|
1086
|
+
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
1087
|
+
|
|
1088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/findings.js
|
|
1089
|
+
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
1090
|
+
var cue = /* @__PURE__ */ __name((raw) => {
|
|
1091
|
+
const reference2 = canonicalMeetingReference(raw);
|
|
1092
|
+
if (parseMeetingReference(reference2).cuePosition === void 0)
|
|
1093
|
+
throw new CliError("validation_error", "finding evidence requires exact cue references and fingerprints");
|
|
1094
|
+
return reference2;
|
|
1095
|
+
}, "cue");
|
|
1096
|
+
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
1097
|
+
var meetingFindingFingerprint = findingFingerprint;
|
|
1098
|
+
|
|
1099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
1100
|
+
var context = {
|
|
1101
|
+
command: "search meetings",
|
|
1102
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
1103
|
+
};
|
|
1104
|
+
var words = ["term", "phrase"];
|
|
1105
|
+
var MOST_LINES_APART = 20;
|
|
1106
|
+
var near = /* @__PURE__ */ __name((node) => {
|
|
1107
|
+
if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
|
|
1108
|
+
queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
|
|
1109
|
+
}, "near");
|
|
1110
|
+
var MEETING_HIT_QUERY = defineQuery({
|
|
1111
|
+
entity: "meeting_hit",
|
|
1112
|
+
backend: "sql",
|
|
1113
|
+
fields: [
|
|
1114
|
+
{
|
|
1115
|
+
name: "text",
|
|
1116
|
+
type: "txt",
|
|
1117
|
+
operators: words,
|
|
1118
|
+
example: "text:budget",
|
|
1119
|
+
relation: "a passage with the word in any form, or a spelling speech recognition garbled",
|
|
1120
|
+
validate: near
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
name: "exact",
|
|
1124
|
+
type: "txt",
|
|
1125
|
+
operators: words,
|
|
1126
|
+
example: "exact:budget",
|
|
1127
|
+
relation: "a passage with the word as typed: no other forms, no garbled spellings",
|
|
1128
|
+
validate: near
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
name: "from",
|
|
1132
|
+
type: "kw",
|
|
1133
|
+
operators: words,
|
|
1134
|
+
example: 'from:"Alice Synthetic"',
|
|
1135
|
+
relation: "a line said or a chat message written by this person; attendance is --identity-id"
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1138
|
+
});
|
|
1139
|
+
var MEETING_FIELDS = defineQuery({
|
|
1140
|
+
entity: "meeting_hit",
|
|
1141
|
+
backend: "sql",
|
|
1142
|
+
fields: [
|
|
1143
|
+
...MEETING_HIT_QUERY.fields,
|
|
1144
|
+
{
|
|
1145
|
+
name: "date",
|
|
1146
|
+
type: "time",
|
|
1147
|
+
operators: ["term", "range"],
|
|
1148
|
+
example: "date>=30d",
|
|
1149
|
+
relation: "meetings that started then; the same as --since-time and --until-time"
|
|
1150
|
+
},
|
|
1151
|
+
...["project", "tag", "topic"].map((name) => ({
|
|
1152
|
+
name,
|
|
1153
|
+
type: "kw",
|
|
1154
|
+
operators: words,
|
|
1155
|
+
example: `${name}:"Example name"`,
|
|
1156
|
+
relation: `meetings in this ${name}, by name or alias; the same as --${name}`
|
|
1157
|
+
}))
|
|
1158
|
+
]
|
|
1159
|
+
});
|
|
1160
|
+
var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
|
|
1161
|
+
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now) => {
|
|
1162
|
+
let ast;
|
|
1163
|
+
try {
|
|
1164
|
+
ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
|
|
1165
|
+
} catch (error) {
|
|
1166
|
+
if (error instanceof CliError)
|
|
1167
|
+
return { query, request };
|
|
1168
|
+
throw error;
|
|
1169
|
+
}
|
|
1170
|
+
const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
|
|
1171
|
+
const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
|
|
1172
|
+
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");
|
|
1173
|
+
const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
|
|
1174
|
+
if (wrong)
|
|
1175
|
+
queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
|
|
1176
|
+
if (!lifted.length)
|
|
1177
|
+
return { query, request };
|
|
1178
|
+
const next = { ...request };
|
|
1179
|
+
const once = /* @__PURE__ */ __name((name, flag2) => {
|
|
1180
|
+
if (next[name] !== void 0)
|
|
1181
|
+
throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
|
|
1182
|
+
}, "once");
|
|
1183
|
+
for (const { node } of lifted) {
|
|
1184
|
+
if (node.field === "date") {
|
|
1185
|
+
once("since", "--since-time");
|
|
1186
|
+
once("until", "--until-time");
|
|
1187
|
+
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(), node.span, now);
|
|
1188
|
+
if (range.lower !== void 0)
|
|
1189
|
+
next.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
1190
|
+
if (range.upper !== void 0)
|
|
1191
|
+
next.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
1192
|
+
} else {
|
|
1193
|
+
const field = node.field;
|
|
1194
|
+
once(field, `--${field}`);
|
|
1195
|
+
next[field] = node.value;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
let rest = query;
|
|
1199
|
+
for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
|
|
1200
|
+
rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
|
|
1201
|
+
rest = rest.replace(/^(?:\s*AND\b)+|(?:\bAND\s*)+$/g, "").replace(/\bAND(\s+AND\b)+/g, "AND").trim();
|
|
1202
|
+
if (!rest)
|
|
1203
|
+
throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
|
|
1204
|
+
return { query: rest, request: next };
|
|
1205
|
+
}, "liftMeetingFields");
|
|
1206
|
+
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
1207
|
+
var meetingWordsQuery = /* @__PURE__ */ __name((text7) => {
|
|
1208
|
+
const found = text7.match(/[\p{L}\p{N}\p{M}]+/gu) ?? [];
|
|
1209
|
+
const span = { start: 0, end: text7.length };
|
|
1210
|
+
const clauses = found.map((value) => ({
|
|
1211
|
+
occur: "must",
|
|
1212
|
+
node: { kind: "predicate", field: "text", operator: "term", value, span }
|
|
1213
|
+
}));
|
|
1214
|
+
const root = clauses.length === 1 && clauses[0] ? clauses[0].node : { kind: "boolean", clauses, span };
|
|
1215
|
+
return { version: 1, language: "lucene-v1", root };
|
|
1216
|
+
}, "meetingWordsQuery");
|
|
1217
|
+
|
|
1218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
|
|
1219
|
+
var contentHash = /* @__PURE__ */ __name(async (text7) => {
|
|
1220
|
+
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text7));
|
|
1221
|
+
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
1222
|
+
}, "contentHash");
|
|
1223
|
+
var speakerPosition = /* @__PURE__ */ __name((name, participants) => {
|
|
1224
|
+
if (name === null)
|
|
1225
|
+
return null;
|
|
1226
|
+
const matches = participants.flatMap((p, i) => p.displayName === name ? [i] : []);
|
|
1227
|
+
return matches.length === 1 ? matches[0] ?? null : null;
|
|
1228
|
+
}, "speakerPosition");
|
|
1229
|
+
var transcriptInput = /* @__PURE__ */ __name(async (lines, participants, source, hashText = JSON.stringify(lines), format = null) => ({
|
|
1230
|
+
source,
|
|
1231
|
+
format,
|
|
1232
|
+
language: null,
|
|
1233
|
+
contentHash: await contentHash(hashText),
|
|
1234
|
+
externalCreatedAt: null,
|
|
1235
|
+
metadata: null,
|
|
1236
|
+
deletedAt: null,
|
|
1237
|
+
rows: lines.map((line2, position) => ({
|
|
1238
|
+
position,
|
|
1239
|
+
startMs: line2.startMs,
|
|
1240
|
+
endMs: line2.endMs,
|
|
1241
|
+
speakerParticipantPosition: speakerPosition(line2.speaker, participants),
|
|
1242
|
+
speakerName: line2.speaker,
|
|
1243
|
+
text: line2.text,
|
|
1244
|
+
normalizedText: null,
|
|
1245
|
+
metadata: null
|
|
1246
|
+
}))
|
|
1247
|
+
}), "transcriptInput");
|
|
1248
|
+
var timestamp2 = /* @__PURE__ */ __name((value) => {
|
|
1249
|
+
const time = Date.parse(value);
|
|
1250
|
+
if (!Number.isFinite(time))
|
|
1251
|
+
throw new Error("Invalid meeting timestamp");
|
|
1252
|
+
return time;
|
|
1253
|
+
}, "timestamp");
|
|
1254
|
+
|
|
1255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
|
|
1256
|
+
var TranscriptTextError = class extends Error {
|
|
1257
|
+
static {
|
|
1258
|
+
__name(this, "TranscriptTextError");
|
|
1259
|
+
}
|
|
1260
|
+
name = "TranscriptTextError";
|
|
1261
|
+
};
|
|
1262
|
+
var HEADER = {
|
|
1263
|
+
"\u0412\u0441\u0442\u0440\u0435\u0447\u0430: ": "title",
|
|
1264
|
+
"\u0414\u0430\u0442\u0430: ": "date",
|
|
1265
|
+
"Zoom ID: ": "meetingId",
|
|
1266
|
+
"\u0413\u043E\u0432\u043E\u0440\u044F\u0442: ": "speakers"
|
|
1267
|
+
};
|
|
1268
|
+
var LINE = /^\[(\d{2,}):([0-5]\d):([0-5]\d)\]\s*(?:([^:\n]{1,60}):\s*)?([\s\S]*)$/;
|
|
1269
|
+
var RULE = /^[—–-]{10,}[^\n]*(?:\n|$)/;
|
|
1270
|
+
var EMPTY = /* @__PURE__ */ new Set(["", "\u2014", "-"]);
|
|
1271
|
+
var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
1272
|
+
const text7 = input.replace(/^/, "").replace(/\r\n?/g, "\n");
|
|
1273
|
+
const header = { title: null, date: null, meetingId: null, speakers: [] };
|
|
1274
|
+
let sawHeader = false;
|
|
1275
|
+
for (const line2 of text7.split("\n")) {
|
|
1276
|
+
if (!line2.trim())
|
|
1277
|
+
break;
|
|
1278
|
+
for (const [prefix, key] of Object.entries(HEADER)) {
|
|
1279
|
+
if (!line2.startsWith(prefix))
|
|
1280
|
+
continue;
|
|
1281
|
+
sawHeader = true;
|
|
1282
|
+
const value = line2.slice(prefix.length).trim();
|
|
1283
|
+
if (key === "speakers")
|
|
1284
|
+
header.speakers = value.split(",").map((name) => name.trim()).filter((name) => !EMPTY.has(name));
|
|
1285
|
+
else
|
|
1286
|
+
header[key] = EMPTY.has(value) ? null : value;
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
if (!sawHeader)
|
|
1290
|
+
throw new TranscriptTextError('a text transcript starts with a header such as "\u0412\u0441\u0442\u0440\u0435\u0447\u0430: \u2026"');
|
|
1291
|
+
const found = [];
|
|
1292
|
+
for (const block of text7.split(/\n\s*\n/)) {
|
|
1293
|
+
const match = LINE.exec(block.trim().replace(RULE, ""));
|
|
1294
|
+
if (!match)
|
|
1295
|
+
continue;
|
|
1296
|
+
const [, hours = "0", minutes = "0", seconds = "0", speaker, said = ""] = match;
|
|
1297
|
+
found.push({
|
|
1298
|
+
startMs: ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3,
|
|
1299
|
+
speaker: speaker?.trim() || null,
|
|
1300
|
+
text: said.trim()
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
const lines = found.map((line2, at) => ({
|
|
1304
|
+
...line2,
|
|
1305
|
+
endMs: Math.max(line2.startMs, found[at + 1]?.startMs ?? line2.startMs)
|
|
1306
|
+
}));
|
|
1307
|
+
return { header, lines };
|
|
1308
|
+
}, "parseTranscriptText");
|
|
1309
|
+
|
|
1310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
|
|
1311
|
+
var VttError = class extends Error {
|
|
1312
|
+
static {
|
|
1313
|
+
__name(this, "VttError");
|
|
1314
|
+
}
|
|
1315
|
+
name = "VttError";
|
|
1316
|
+
};
|
|
1317
|
+
var TIMESTAMP = /^(?:(\d+):)?([0-5]\d):([0-5]\d)\.(\d{3})$/;
|
|
1318
|
+
var SKIPPED = /^(NOTE|STYLE|REGION)(\s|$)/;
|
|
1319
|
+
var millis = /* @__PURE__ */ __name((stamp, lineNo) => {
|
|
1320
|
+
const match = TIMESTAMP.exec(stamp);
|
|
1321
|
+
if (!match)
|
|
1322
|
+
throw new VttError(`line ${lineNo}: "${stamp}" is not a WebVTT timestamp`);
|
|
1323
|
+
const [, hours = "0", minutes = "0", seconds = "0", ms = "0"] = match;
|
|
1324
|
+
return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms);
|
|
1325
|
+
}, "millis");
|
|
1326
|
+
var splitSpeaker = /* @__PURE__ */ __name((text7) => {
|
|
1327
|
+
const firstLine = text7.split("\n", 1)[0] ?? "";
|
|
1328
|
+
const at = firstLine.indexOf(": ");
|
|
1329
|
+
if (at <= 0)
|
|
1330
|
+
return { speaker: null, text: text7 };
|
|
1331
|
+
return { speaker: firstLine.slice(0, at).trim(), text: text7.slice(at + 2) };
|
|
1332
|
+
}, "splitSpeaker");
|
|
1333
|
+
var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
1334
|
+
const lines = input.replace(/^/, "").split(/\r\n|\r|\n/);
|
|
1335
|
+
if (!/^WEBVTT([ \t].*)?$/.test(lines[0] ?? ""))
|
|
1336
|
+
throw new VttError('line 1: a WebVTT file starts with "WEBVTT"');
|
|
1337
|
+
const cues = [];
|
|
1338
|
+
let i = lines.findIndex((line2) => line2.trim() === "");
|
|
1339
|
+
if (i < 0)
|
|
1340
|
+
return [];
|
|
1341
|
+
while (i < lines.length) {
|
|
1342
|
+
while (i < lines.length && lines[i]?.trim() === "")
|
|
1343
|
+
i++;
|
|
1344
|
+
const start = i;
|
|
1345
|
+
while (i < lines.length && lines[i]?.trim() !== "")
|
|
1346
|
+
i++;
|
|
1347
|
+
const block = lines.slice(start, i);
|
|
1348
|
+
if (block.length === 0 || SKIPPED.test(block[0] ?? ""))
|
|
1349
|
+
continue;
|
|
1350
|
+
const timingAt = block.findIndex((line2) => line2.includes("-->"));
|
|
1351
|
+
if (timingAt < 0 || timingAt > 1)
|
|
1352
|
+
throw new VttError(`line ${start + 1}: a cue has no timing line`);
|
|
1353
|
+
const lineNo = start + timingAt + 1;
|
|
1354
|
+
const [from = "", rest = ""] = (block[timingAt] ?? "").split("-->");
|
|
1355
|
+
const to = rest.trim().split(/\s+/)[0] ?? "";
|
|
1356
|
+
const text7 = block.slice(timingAt + 1).join("\n").trim();
|
|
1357
|
+
cues.push({ startMs: millis(from.trim(), lineNo), endMs: millis(to, lineNo), ...splitSpeaker(text7) });
|
|
1358
|
+
}
|
|
1359
|
+
return cues;
|
|
1360
|
+
}, "parseVtt");
|
|
1361
|
+
|
|
1362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/import.js
|
|
1363
|
+
var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
|
|
1364
|
+
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
1365
|
+
for (const file of files) {
|
|
1366
|
+
try {
|
|
1367
|
+
const format = file.format ?? "vtt";
|
|
1368
|
+
const lines = format === "text" ? parseTranscriptText(file.content).lines : parseVtt(file.content);
|
|
1369
|
+
const participants = file.participants ?? [];
|
|
1370
|
+
const details = await store.saveMeeting({
|
|
1371
|
+
meeting: file.meeting,
|
|
1372
|
+
participants: file.participants,
|
|
1373
|
+
transcripts: [await transcriptInput(lines, participants, file.source ?? "file", file.content, format)],
|
|
1374
|
+
now,
|
|
1375
|
+
fromFile: true
|
|
1376
|
+
});
|
|
1377
|
+
await linkEvent(store, details, now);
|
|
1378
|
+
report.meetings++;
|
|
1379
|
+
report.participants += participants.length;
|
|
1380
|
+
report.transcriptRows += lines.length;
|
|
1381
|
+
} catch (error) {
|
|
1382
|
+
report.warnings.push({
|
|
1383
|
+
externalId: file.meeting.externalId,
|
|
1384
|
+
message: error instanceof Error ? error.message : "Meeting import failed"
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
const zones = new Set(files.map((file) => file.meeting.timezone).filter((zone2) => zone2 !== null && zone2 !== void 0));
|
|
1389
|
+
const [zone] = zones;
|
|
1390
|
+
if (zones.size === 1 && zone)
|
|
1391
|
+
report.timezone = zone;
|
|
1392
|
+
return report;
|
|
1393
|
+
}, "importFiles");
|
|
1394
|
+
|
|
1395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/links.js
|
|
1396
|
+
var CHAT_MESSAGES_READ = 1e5;
|
|
1397
|
+
|
|
1398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
|
|
1399
|
+
var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
1400
|
+
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
1401
|
+
throw new CliError("validation_error", "meeting preparation context is required");
|
|
1402
|
+
const input = { ...original };
|
|
1403
|
+
for (const key of Object.keys(input))
|
|
1404
|
+
if (!["accountId", "meetingId", "seriesId", "updatedAt", "limit", "maxReadBytes", "signal"].includes(key))
|
|
1405
|
+
throw new CliError("validation_error", `unknown preparation context field: ${key}`);
|
|
1406
|
+
if (input.signal !== void 0 && !(input.signal instanceof AbortSignal))
|
|
1407
|
+
throw new CliError("validation_error", "signal must be an AbortSignal");
|
|
1408
|
+
input.signal?.throwIfAborted();
|
|
1409
|
+
for (const key of ["accountId", "meetingId", "seriesId"])
|
|
1410
|
+
if (!Number.isSafeInteger(input[key]) || input[key] <= 0)
|
|
1411
|
+
throw new CliError("validation_error", `${key} must be a positive safe integer`);
|
|
1412
|
+
if (!Number.isSafeInteger(input.updatedAt) || Math.abs(input.updatedAt) > 864e13)
|
|
1413
|
+
throw new CliError("validation_error", "updatedAt must be an absolute timestamp");
|
|
1414
|
+
const limit = input.limit === void 0 ? 20 : input.limit;
|
|
1415
|
+
const maxReadBytes = input.maxReadBytes === void 0 ? 262144 : input.maxReadBytes;
|
|
1416
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
1417
|
+
throw new CliError("validation_error", "limit must be an integer from 1 to 100");
|
|
1418
|
+
if (!Number.isSafeInteger(maxReadBytes) || maxReadBytes < 1 || maxReadBytes > 4194304)
|
|
1419
|
+
throw new CliError("validation_error", "maxReadBytes must be an integer from 1 to 4194304");
|
|
1420
|
+
return { ...input, limit, maxReadBytes };
|
|
1421
|
+
}, "validateMeetingPreparationContext");
|
|
1422
|
+
|
|
1423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
|
|
1424
|
+
var count3 = pipe(number(), integer(), minValue(0));
|
|
1425
|
+
var id2 = pipe(string(), minLength(1));
|
|
1426
|
+
var meetingProjectEvidence = strictObject({
|
|
1427
|
+
schema_version: literal(1),
|
|
1428
|
+
kind: literal("meeting_project_evidence"),
|
|
1429
|
+
account_id: id2,
|
|
1430
|
+
query: string(),
|
|
1431
|
+
project: strictObject({ id: id2, name: string(), key: nullable(string()) }),
|
|
1432
|
+
term: strictObject({
|
|
1433
|
+
name: string(),
|
|
1434
|
+
kind: picklist(["canonical", "key", "alias"]),
|
|
1435
|
+
alias_id: optional(id2)
|
|
1436
|
+
}),
|
|
1437
|
+
hits: array(meetingHit),
|
|
1438
|
+
association: literal("unconfirmed-word-evidence"),
|
|
1439
|
+
vocabulary_fingerprint: id2,
|
|
1440
|
+
selection: strictObject({
|
|
1441
|
+
meeting_id: optional(id2),
|
|
1442
|
+
identity_id: optional(id2),
|
|
1443
|
+
person_id: optional(id2),
|
|
1444
|
+
tag_id: optional(id2),
|
|
1445
|
+
event_id: optional(id2),
|
|
1446
|
+
series_id: optional(id2),
|
|
1447
|
+
since: optional(isoTime),
|
|
1448
|
+
until: optional(isoTime)
|
|
1449
|
+
}),
|
|
1450
|
+
limits: strictObject({ limit: count3, max_read_bytes: count3, max_vocabulary_read_bytes: count3, max_terms: count3 }),
|
|
1451
|
+
page: pageSchema,
|
|
1452
|
+
coverage: strictObject({
|
|
1453
|
+
archive_completeness: literal("unknown"),
|
|
1454
|
+
current_revisions: literal(true),
|
|
1455
|
+
indexing: picklist(["ready", "pending"]),
|
|
1456
|
+
index_completeness: literal("unknown"),
|
|
1457
|
+
term_index: count3,
|
|
1458
|
+
terms_total: count3,
|
|
1459
|
+
remaining_terms: count3,
|
|
1460
|
+
duplicates: literal("may-repeat-between-terms")
|
|
1461
|
+
})
|
|
1462
|
+
});
|
|
1463
|
+
var PAGE_NEXT3 = STEPS.find((step) => step.id === "page.next");
|
|
1464
|
+
var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, command = "meetings projects evidence") => {
|
|
1465
|
+
const { options } = prepared;
|
|
1466
|
+
const selection = {};
|
|
1467
|
+
for (const [field, value] of [
|
|
1468
|
+
["meeting_id", options.meetingId],
|
|
1469
|
+
["identity_id", options.participantIdentityId],
|
|
1470
|
+
["person_id", options.personId],
|
|
1471
|
+
["tag_id", options.tagId],
|
|
1472
|
+
["event_id", options.eventId],
|
|
1473
|
+
["series_id", options.meetingSeriesId]
|
|
1474
|
+
])
|
|
1475
|
+
if (value !== void 0)
|
|
1476
|
+
selection[field] = String(value);
|
|
1477
|
+
if (options.since !== void 0)
|
|
1478
|
+
selection.since = new Date(options.since).toISOString();
|
|
1479
|
+
if (options.until !== void 0)
|
|
1480
|
+
selection.until = new Date(options.until).toISOString();
|
|
1481
|
+
const cursor = page.nextCursor ?? void 0;
|
|
1482
|
+
if (page.hasMore !== (cursor !== void 0))
|
|
1483
|
+
throw new CliError("invalid_response", "project evidence continuation is inconsistent");
|
|
1484
|
+
const item = {
|
|
1485
|
+
schema_version: 1,
|
|
1486
|
+
kind: "meeting_project_evidence",
|
|
1487
|
+
account_id: String(page.accountId),
|
|
1488
|
+
query: page.query,
|
|
1489
|
+
project: page.project,
|
|
1490
|
+
term: {
|
|
1491
|
+
name: page.term.name,
|
|
1492
|
+
kind: page.term.kind,
|
|
1493
|
+
...page.term.aliasId === void 0 ? {} : { alias_id: page.term.aliasId }
|
|
1494
|
+
},
|
|
1495
|
+
hits: page.hits.map(meetingHitItem),
|
|
1496
|
+
association: page.association,
|
|
1497
|
+
vocabulary_fingerprint: page.vocabularyFingerprint,
|
|
1498
|
+
selection,
|
|
1499
|
+
limits: {
|
|
1500
|
+
limit: page.limits.limit,
|
|
1501
|
+
max_read_bytes: page.limits.maxReadBytes,
|
|
1502
|
+
max_vocabulary_read_bytes: page.limits.maxVocabularyReadBytes,
|
|
1503
|
+
max_terms: page.limits.maxTerms
|
|
1504
|
+
},
|
|
1505
|
+
page: {
|
|
1506
|
+
mode: "cursor",
|
|
1507
|
+
limit: page.limits.limit,
|
|
1508
|
+
has_more: page.hasMore,
|
|
1509
|
+
...cursor === void 0 ? {} : { next_cursor: cursor }
|
|
1510
|
+
},
|
|
1511
|
+
coverage: {
|
|
1512
|
+
archive_completeness: page.coverage.archiveCompleteness,
|
|
1513
|
+
current_revisions: page.coverage.currentRevisions,
|
|
1514
|
+
indexing: page.coverage.indexing,
|
|
1515
|
+
index_completeness: page.coverage.indexCompleteness,
|
|
1516
|
+
term_index: page.coverage.termIndex,
|
|
1517
|
+
terms_total: page.coverage.termsTotal,
|
|
1518
|
+
remaining_terms: page.coverage.remainingTerms,
|
|
1519
|
+
duplicates: page.coverage.duplicates
|
|
1520
|
+
}
|
|
1521
|
+
};
|
|
1522
|
+
if (!safeParse(meetingProjectEvidence, item).success)
|
|
1523
|
+
throw new CliError("invalid_response", "project evidence does not match its answer contract");
|
|
1524
|
+
return {
|
|
1525
|
+
item,
|
|
1526
|
+
...cursor === void 0 ? {} : {
|
|
1527
|
+
next: [
|
|
1528
|
+
stepOf(PAGE_NEXT3, {
|
|
1529
|
+
command,
|
|
1530
|
+
args: {
|
|
1531
|
+
project: prepared.project,
|
|
1532
|
+
query: prepared.query,
|
|
1533
|
+
cursor,
|
|
1534
|
+
limit: page.limits.limit,
|
|
1535
|
+
max_read_bytes: page.limits.maxReadBytes
|
|
1536
|
+
},
|
|
1537
|
+
values: { shown: page.hits.length }
|
|
1538
|
+
})
|
|
1539
|
+
]
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
}, "meetingProjectEvidenceAnswer");
|
|
1543
|
+
|
|
1544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
|
|
1545
|
+
var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
1546
|
+
const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
|
|
1547
|
+
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) || [
|
|
1548
|
+
options.meetingId,
|
|
1549
|
+
options.participantIdentityId,
|
|
1550
|
+
options.personId,
|
|
1551
|
+
options.projectId,
|
|
1552
|
+
options.tagId,
|
|
1553
|
+
options.eventId,
|
|
1554
|
+
options.meetingSeriesId
|
|
1555
|
+
].some((value) => value !== void 0 && !integer3(value, 1, Number.MAX_SAFE_INTEGER)) || [options.since, options.until].some((value) => value !== void 0 && !integer3(value, -864e13, 864e13)) || options.since !== void 0 && options.until !== void 0 && options.since > options.until || options.after !== void 0 && (typeof options.after !== "string" || !/^[A-Za-z0-9_-]{1,1000}$/.test(options.after)))
|
|
1556
|
+
throw new CliError("validation_error", "invalid bounded meeting search query, cursor or limits");
|
|
1557
|
+
for (const name of [options.project, options.tag, options.topic])
|
|
1558
|
+
if (name !== void 0 && (typeof name !== "string" || !name.trim() || name.length > 200 || /[\p{Cc}\p{Cf}]/u.test(name)))
|
|
1559
|
+
throw new CliError("validation_error", "a meeting vocabulary name takes 1\u2013200 characters without control characters");
|
|
1560
|
+
if (options.project !== void 0 && options.projectId !== void 0 || [options.tag, options.topic, options.tagId].filter((value) => value !== void 0).length > 1)
|
|
1561
|
+
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
1562
|
+
}, "validateMeetingHitSearch");
|
|
1563
|
+
|
|
1564
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
|
|
1565
|
+
var ids = {
|
|
1566
|
+
meeting_id: "meetingId",
|
|
1567
|
+
identity_id: "participantIdentityId",
|
|
1568
|
+
person_id: "personId",
|
|
1569
|
+
tag_id: "tagId",
|
|
1570
|
+
event_id: "eventId",
|
|
1571
|
+
series_id: "meetingSeriesId"
|
|
1572
|
+
};
|
|
1573
|
+
var context2 = {
|
|
1574
|
+
command: "meetings projects evidence",
|
|
1575
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
|
|
1576
|
+
};
|
|
1577
|
+
var MEETING_PROJECT_EVIDENCE_QUERY = defineQuery({
|
|
1578
|
+
entity: "meeting_project_evidence",
|
|
1579
|
+
backend: "sql",
|
|
1580
|
+
fields: [
|
|
1581
|
+
...Object.keys(ids).map((name) => ({
|
|
1582
|
+
name,
|
|
1583
|
+
type: "num",
|
|
1584
|
+
operators: ["term"],
|
|
1585
|
+
example: `${name}:12`,
|
|
1586
|
+
placement: "and",
|
|
1587
|
+
relation: "meetings selected by this stored ID; identity selects participants, not speakers"
|
|
1588
|
+
})),
|
|
1589
|
+
{
|
|
1590
|
+
name: "started_at",
|
|
1591
|
+
type: "time",
|
|
1592
|
+
operators: ["term", "phrase", "range"],
|
|
1593
|
+
example: "started_at:[2026-10-01 TO 2026-10-31]",
|
|
1594
|
+
placement: "and",
|
|
1595
|
+
relation: "the meeting start time in UTC"
|
|
1596
|
+
}
|
|
1597
|
+
]
|
|
1598
|
+
});
|
|
1599
|
+
var requestKeys = /* @__PURE__ */ new Set(["query", "limit", "cursor", "maxReadBytes", "signal"]);
|
|
1600
|
+
var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {}, now = Date.now()) => {
|
|
1601
|
+
if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof project !== "string" || !project.trim() || project.length > 200 || /[\p{Cc}\p{Cf}]/u.test(project) || request.query !== void 0 && typeof request.query !== "string")
|
|
1602
|
+
throw new CliError("validation_error", "expected an existing project and bounded evidence arguments");
|
|
1603
|
+
if (request.query !== void 0 && new TextEncoder().encode(request.query).byteLength > 8192 || [request.limit, request.maxReadBytes].some((value) => value !== void 0 && typeof value !== "number"))
|
|
1604
|
+
throw new CliError("validation_error", "invalid project evidence query or budget");
|
|
1605
|
+
request.signal?.throwIfAborted();
|
|
1606
|
+
const options = {
|
|
1607
|
+
limit: request.limit ?? 100,
|
|
1608
|
+
maxReadBytes: request.maxReadBytes ?? 4194304,
|
|
1609
|
+
...request.cursor === void 0 ? {} : { cursor: request.cursor },
|
|
1610
|
+
...request.signal === void 0 ? {} : { signal: request.signal }
|
|
1611
|
+
};
|
|
1612
|
+
const terms = /* @__PURE__ */ new Map();
|
|
1613
|
+
if (request.query?.trim()) {
|
|
1614
|
+
const ast = parseLucene(request.query, { defaultField: "none", ...context2 });
|
|
1615
|
+
validateQuery(ast, MEETING_PROJECT_EVIDENCE_QUERY, context2);
|
|
1616
|
+
const add = /* @__PURE__ */ __name((node) => {
|
|
1617
|
+
if (terms.has(node.field))
|
|
1618
|
+
queryError("query.unsupported-placement", node.span, "each field only once", context2);
|
|
1619
|
+
terms.set(node.field, node);
|
|
1620
|
+
}, "add");
|
|
1621
|
+
if (ast.root.kind === "predicate")
|
|
1622
|
+
add(ast.root);
|
|
1623
|
+
else
|
|
1624
|
+
for (const clause of ast.root.clauses) {
|
|
1625
|
+
if (clause.occur !== "must" || clause.node.kind !== "predicate")
|
|
1626
|
+
queryError("query.unsupported-placement", clause.node.span, "field:value terms joined by AND", context2);
|
|
1627
|
+
add(clause.node);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
const frozen = [];
|
|
1631
|
+
for (const [field, key] of Object.entries(ids)) {
|
|
1632
|
+
const term2 = terms.get(field);
|
|
1633
|
+
if (!term2)
|
|
1634
|
+
continue;
|
|
1635
|
+
if (term2.operator !== "term" || !/^[1-9]\d*$/.test(term2.value) || !Number.isSafeInteger(Number(term2.value)))
|
|
1636
|
+
queryError("query.unsupported-operator", term2.span, "one positive safe integer ID", context2);
|
|
1637
|
+
options[key] = Number(term2.value);
|
|
1638
|
+
frozen.push(`${field}:${term2.value}`);
|
|
1639
|
+
}
|
|
1640
|
+
const term = terms.get("started_at");
|
|
1641
|
+
if (term) {
|
|
1642
|
+
const range = dateRange(term.value, term.operator === "range" ? term.upper ?? "*" : term.value, term.lower_inclusive !== false, term.upper_inclusive !== false, "UTC", term.span, now);
|
|
1643
|
+
if (range.lower !== void 0)
|
|
1644
|
+
options.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
1645
|
+
if (range.upper !== void 0)
|
|
1646
|
+
options.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
1647
|
+
frozen.push(`started_at:[${options.since === void 0 ? "*" : `"${new Date(options.since).toISOString()}"`} TO ${options.until === void 0 ? "*" : `"${new Date(options.until).toISOString()}"`}]`);
|
|
1648
|
+
}
|
|
1649
|
+
validateMeetingHitSearch(project, options);
|
|
1650
|
+
if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !/^[A-Za-z0-9_-]{1,4096}$/.test(options.cursor)))
|
|
1651
|
+
throw new CliError("validation_error", "invalid project evidence cursor");
|
|
1652
|
+
return { project: project.trim(), options, query: frozen.join(" AND ") };
|
|
1653
|
+
}, "prepareMeetingProjectEvidence");
|
|
1654
|
+
|
|
1655
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
|
|
1656
|
+
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
|
|
1657
|
+
const prepared = prepareMeetingProjectEvidence(project, request, now);
|
|
1658
|
+
const page = await read(prepared.project, prepared.options);
|
|
1659
|
+
prepared.options.signal?.throwIfAborted();
|
|
1660
|
+
return meetingProjectEvidenceAnswer(page, prepared);
|
|
1661
|
+
}, "readMeetingProjectEvidence");
|
|
1662
|
+
|
|
1663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/pull.js
|
|
1664
|
+
var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
|
|
1665
|
+
const { identityExternalId, ...fields3 } = p;
|
|
1666
|
+
const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
|
|
1667
|
+
return {
|
|
1668
|
+
...fields3,
|
|
1669
|
+
identity: {
|
|
1670
|
+
provider,
|
|
1671
|
+
externalId,
|
|
1672
|
+
name: p.displayName,
|
|
1673
|
+
metadata: p.metadata,
|
|
1674
|
+
associatePerson: Boolean(identityExternalId?.trim() || p.email?.trim() || p.externalId?.trim())
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
}, "participantInput");
|
|
1678
|
+
var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
1679
|
+
const now = options.now ?? Date.now();
|
|
1680
|
+
const lookbackMs = options.lookbackMs ?? 0;
|
|
1681
|
+
if (!Number.isSafeInteger(lookbackMs) || lookbackMs < 0 || lookbackMs > 31 * 864e5)
|
|
1682
|
+
throw new Error("lookbackMs must be an integer from 0 through 31 days");
|
|
1683
|
+
const since = options.since ?? await store.cursor(options.accountId) ?? new Date(now - 30 * 864e5).toISOString();
|
|
1684
|
+
timestamp2(since);
|
|
1685
|
+
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
1686
|
+
let failed = false;
|
|
1687
|
+
const from = timestamp2(since) - lookbackMs;
|
|
1688
|
+
const meetings = await source.meetings(lookbackMs === 0 ? since : new Date(from).toISOString());
|
|
1689
|
+
for (const m of meetings) {
|
|
1690
|
+
const id4 = m.occurrence.id;
|
|
1691
|
+
const read = /* @__PURE__ */ __name(async (part, call) => {
|
|
1692
|
+
try {
|
|
1693
|
+
return await call();
|
|
1694
|
+
} catch (error) {
|
|
1695
|
+
failed = true;
|
|
1696
|
+
const message = error instanceof Error ? error.message : "could not be read";
|
|
1697
|
+
report.warnings.push({ externalId: id4, message: `${part}: ${message}` });
|
|
1698
|
+
return void 0;
|
|
1699
|
+
}
|
|
1700
|
+
}, "read");
|
|
1701
|
+
try {
|
|
1702
|
+
const sourceParticipants = await read("participants", () => source.participants(id4));
|
|
1703
|
+
const participants = (sourceParticipants ?? []).map((p, i) => participantInput(p, source.provider, id4, i, options.accountId));
|
|
1704
|
+
const names = /* @__PURE__ */ new Map();
|
|
1705
|
+
for (const p of participants)
|
|
1706
|
+
if (p.displayName !== null) {
|
|
1707
|
+
const identities = names.get(p.displayName) ?? /* @__PURE__ */ new Set();
|
|
1708
|
+
identities.add(p.identity.externalId);
|
|
1709
|
+
names.set(p.displayName, identities);
|
|
1710
|
+
}
|
|
1711
|
+
if ([...names.values()].some((ids2) => ids2.size > 1))
|
|
1712
|
+
report.warnings.push({ externalId: id4, message: "Participant names are ambiguous" });
|
|
1713
|
+
const lines = await read("transcript", () => source.transcript(id4));
|
|
1714
|
+
const chat = await read("chat", () => source.chat(id4));
|
|
1715
|
+
const summary = await read("summary", () => source.summary(id4));
|
|
1716
|
+
const attachments = await read("files", () => source.files(id4));
|
|
1717
|
+
const startedAt = timestamp2(m.occurrence.startedAt);
|
|
1718
|
+
const endedAt = m.occurrence.endedAt === null ? null : timestamp2(m.occurrence.endedAt);
|
|
1719
|
+
if (endedAt !== null && endedAt < startedAt)
|
|
1720
|
+
throw new Error("Meeting ends before it starts");
|
|
1721
|
+
const meeting2 = {
|
|
1722
|
+
accountId: options.accountId,
|
|
1723
|
+
externalId: id4,
|
|
1724
|
+
title: m.occurrence.title,
|
|
1725
|
+
description: m.description ?? null,
|
|
1726
|
+
location: m.location ?? null,
|
|
1727
|
+
joinUrl: m.joinUrl ?? m.series?.joinUrl ?? null,
|
|
1728
|
+
startedAt,
|
|
1729
|
+
endedAt,
|
|
1730
|
+
durationMs: endedAt === null ? null : endedAt - startedAt,
|
|
1731
|
+
timezone: m.timezone ?? null,
|
|
1732
|
+
hostIdentityId: null,
|
|
1733
|
+
...sourceParticipants === void 0 ? {} : { participantsCount: sourceParticipants?.length ?? null },
|
|
1734
|
+
metadata: m.metadata ?? null,
|
|
1735
|
+
deletedAt: null
|
|
1736
|
+
};
|
|
1737
|
+
if (m.series)
|
|
1738
|
+
meeting2.series = {
|
|
1739
|
+
externalId: m.series.id,
|
|
1740
|
+
title: m.series.title,
|
|
1741
|
+
description: null,
|
|
1742
|
+
kind: m.series.kind ?? null,
|
|
1743
|
+
recurrence: m.series.recurrence ?? null,
|
|
1744
|
+
hostIdentityId: null,
|
|
1745
|
+
joinUrl: m.series.joinUrl ?? null,
|
|
1746
|
+
metadata: null,
|
|
1747
|
+
deletedAt: null
|
|
1748
|
+
};
|
|
1749
|
+
const linked = sourceParticipants !== void 0;
|
|
1750
|
+
const format = source.transcriptFormat ?? null;
|
|
1751
|
+
const transcripts = lines && linked ? [await transcriptInput(lines, participants, source.name, void 0, format)] : void 0;
|
|
1752
|
+
const details = await store.saveMeeting({
|
|
1753
|
+
meeting: meeting2,
|
|
1754
|
+
participants: sourceParticipants ? participants : void 0,
|
|
1755
|
+
transcripts,
|
|
1756
|
+
chat: chat?.map((line2) => ({
|
|
1757
|
+
externalId: null,
|
|
1758
|
+
sentAt: timestamp2(line2.sentAt),
|
|
1759
|
+
senderParticipantPosition: speakerPosition(line2.sender, participants),
|
|
1760
|
+
senderName: line2.sender,
|
|
1761
|
+
recipient: null,
|
|
1762
|
+
text: line2.text,
|
|
1763
|
+
normalizedText: null,
|
|
1764
|
+
metadata: null
|
|
1765
|
+
})),
|
|
1766
|
+
summaries: summary ? [
|
|
1767
|
+
{
|
|
1768
|
+
...summary,
|
|
1769
|
+
source: summary.source ?? source.name,
|
|
1770
|
+
content: summary.content ?? null,
|
|
1771
|
+
docUrl: summary.docUrl ?? null,
|
|
1772
|
+
externalCreatedAt: summary.externalCreatedAt ?? null,
|
|
1773
|
+
externalUpdatedAt: summary.externalUpdatedAt ?? null,
|
|
1774
|
+
metadata: summary.metadata ?? null
|
|
1775
|
+
}
|
|
1776
|
+
] : void 0,
|
|
1777
|
+
attachments: attachments ?? void 0,
|
|
1778
|
+
now
|
|
1779
|
+
});
|
|
1780
|
+
if (lines && !linked && !details.transcripts.some((t) => t.transcript.source === source.name && t.transcript.supersededAt === null))
|
|
1781
|
+
await store.saveMeeting({
|
|
1782
|
+
meeting: meeting2,
|
|
1783
|
+
transcripts: [await transcriptInput(lines, [], source.name, `${JSON.stringify(lines)}
|
|
1784
|
+
unlinked`, format)],
|
|
1785
|
+
now
|
|
1786
|
+
});
|
|
1787
|
+
await linkEvent(store, details, now);
|
|
1788
|
+
report.meetings++;
|
|
1789
|
+
report.participants += participants.length;
|
|
1790
|
+
report.transcriptRows += lines?.length ?? 0;
|
|
1791
|
+
report.summaries += summary ? 1 : 0;
|
|
1792
|
+
} catch (error) {
|
|
1793
|
+
failed = true;
|
|
1794
|
+
report.warnings.push({ externalId: id4, message: error instanceof Error ? error.message : "Meeting pull failed" });
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
if (!failed)
|
|
1798
|
+
await store.setCursor(options.accountId, new Date(now).toISOString(), now);
|
|
1799
|
+
return report;
|
|
1800
|
+
}, "pull");
|
|
1801
|
+
|
|
1802
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
|
|
1803
|
+
var text5 = string();
|
|
1804
|
+
var count4 = pipe(number(), integer(), minValue(0));
|
|
1805
|
+
var id3 = pipe(number(), integer(), minValue(1));
|
|
1806
|
+
var iso3 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
1807
|
+
var meetingReview = strictObject({
|
|
1808
|
+
ref: reference,
|
|
1809
|
+
id: pipe(string(), minLength(1)),
|
|
1810
|
+
title: nullable(text5),
|
|
1811
|
+
started_at: nullable(isoTime),
|
|
1812
|
+
duration_ms: nullable(count4),
|
|
1813
|
+
participants_count: nullable(count4),
|
|
1814
|
+
projects: array(text5),
|
|
1815
|
+
/** Null when the meeting has no current transcript. */
|
|
1816
|
+
transcript: nullable(strictObject({ lines: count4, words: count4 })),
|
|
1817
|
+
/** The three who talked longest. */
|
|
1818
|
+
speakers: array(strictObject({ name: nullable(text5), talk_ms: count4 })),
|
|
1819
|
+
/** The newest stored summary; null when there is none. */
|
|
1820
|
+
summary: nullable(strictObject({
|
|
1821
|
+
source: text5,
|
|
1822
|
+
title: nullable(text5),
|
|
1823
|
+
overview: nullable(text5),
|
|
1824
|
+
next_steps: array(text5),
|
|
1825
|
+
url: nullable(text5)
|
|
1826
|
+
}))
|
|
1827
|
+
});
|
|
1828
|
+
var meetingLink = strictObject({
|
|
1829
|
+
url: text5,
|
|
1830
|
+
domain: nullable(text5),
|
|
1831
|
+
/** The Google Docs, Sheets, Slides, Forms or Drive file it names. */
|
|
1832
|
+
document_id: nullable(text5),
|
|
1833
|
+
count: count4,
|
|
1834
|
+
first_at: isoTime,
|
|
1835
|
+
last_at: isoTime,
|
|
1836
|
+
senders: array(text5),
|
|
1837
|
+
meetings: array(strictObject({ ref: reference, title: nullable(text5) }))
|
|
1838
|
+
});
|
|
1839
|
+
var meetingSpeaker = strictObject({
|
|
1840
|
+
/** `person:<id>`, `identity:<id>`, `name:<lowercased name>` or `unknown`. */
|
|
1841
|
+
key: text5,
|
|
1842
|
+
name: nullable(text5),
|
|
1843
|
+
person_id: nullable(id3),
|
|
1844
|
+
identity_id: nullable(id3),
|
|
1845
|
+
meetings: count4,
|
|
1846
|
+
lines: count4,
|
|
1847
|
+
words: count4,
|
|
1848
|
+
talk_ms: count4,
|
|
1849
|
+
/** This speaker's part of all talk time, 0–1. */
|
|
1850
|
+
share: pipe(number(), minValue(0), maxValue(1))
|
|
1851
|
+
});
|
|
1852
|
+
var meetingStats = strictObject({
|
|
1853
|
+
time_zone: text5,
|
|
1854
|
+
meetings: count4,
|
|
1855
|
+
lines: count4,
|
|
1856
|
+
words: count4,
|
|
1857
|
+
talk_ms: count4,
|
|
1858
|
+
/** `week_start` is the Monday, as a date in `time_zone`. */
|
|
1859
|
+
weeks: array(strictObject({ week_start: text5, meetings: count4, talk_ms: count4 })),
|
|
1860
|
+
top_speakers: array(meetingSpeaker)
|
|
1861
|
+
});
|
|
1862
|
+
var truncated = /* @__PURE__ */ __name((...why) => nullable(picklist(why)), "truncated");
|
|
1863
|
+
var meetingParticipants = strictObject({
|
|
1864
|
+
schema_version: literal(1),
|
|
1865
|
+
kind: literal("meeting_participants"),
|
|
1866
|
+
account_id: id3,
|
|
1867
|
+
query: text5,
|
|
1868
|
+
items: array(strictObject({
|
|
1869
|
+
participant_id: id3,
|
|
1870
|
+
meeting_id: id3,
|
|
1871
|
+
identity_id: id3,
|
|
1872
|
+
display_name: nullable(text5),
|
|
1873
|
+
email: nullable(text5)
|
|
1874
|
+
})),
|
|
1875
|
+
/** Several identities on one page are observations, never speaker attribution or person links. */
|
|
1876
|
+
ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id3) }),
|
|
1877
|
+
coverage: strictObject({
|
|
1878
|
+
scanned: count4,
|
|
1879
|
+
read_bytes: count4,
|
|
1880
|
+
archive_completeness: literal("unknown"),
|
|
1881
|
+
truncated_by: truncated("limit", "scan_limit", "read_bytes")
|
|
1882
|
+
}),
|
|
1883
|
+
page: strictObject({
|
|
1884
|
+
mode: literal("cursor"),
|
|
1885
|
+
limit: count4,
|
|
1886
|
+
has_more: boolean(),
|
|
1887
|
+
next_cursor: optional(text5)
|
|
1888
|
+
})
|
|
1889
|
+
});
|
|
1890
|
+
var revision = picklist(["current", "superseded"]);
|
|
1891
|
+
var meetingPassage = strictObject({
|
|
1892
|
+
schema_version: literal(1),
|
|
1893
|
+
kind: literal("meeting_context"),
|
|
1894
|
+
source: reference,
|
|
1895
|
+
target_ref: reference,
|
|
1896
|
+
target_fingerprint: text5,
|
|
1897
|
+
fingerprint: text5,
|
|
1898
|
+
revision,
|
|
1899
|
+
limits: strictObject({ before: count4, after: count4, bytes: count4, max_read_bytes: count4 }),
|
|
1900
|
+
content_bytes: count4,
|
|
1901
|
+
coverage: strictObject({
|
|
1902
|
+
included: count4,
|
|
1903
|
+
before: count4,
|
|
1904
|
+
after: count4,
|
|
1905
|
+
has_before: boolean(),
|
|
1906
|
+
has_after: boolean(),
|
|
1907
|
+
truncated_by: truncated("bytes"),
|
|
1908
|
+
before_ref: nullable(reference),
|
|
1909
|
+
after_ref: nullable(reference),
|
|
1910
|
+
continuation: literal("anchor-inclusive"),
|
|
1911
|
+
archive_completeness: literal("unknown"),
|
|
1912
|
+
input: literal("bounded-meeting-context")
|
|
1913
|
+
}),
|
|
1914
|
+
items: array(strictObject({
|
|
1915
|
+
ref: reference,
|
|
1916
|
+
fingerprint: text5,
|
|
1917
|
+
transcript_id: id3,
|
|
1918
|
+
content_hash: nullable(text5),
|
|
1919
|
+
position: count4,
|
|
1920
|
+
start_ms: count4,
|
|
1921
|
+
end_ms: count4,
|
|
1922
|
+
speaker_participant_id: nullable(id3),
|
|
1923
|
+
speaker_name: nullable(text5),
|
|
1924
|
+
text: text5,
|
|
1925
|
+
revision
|
|
1926
|
+
}))
|
|
1927
|
+
});
|
|
1928
|
+
var event = strictObject({
|
|
1929
|
+
id: pipe(string(), minLength(1)),
|
|
1930
|
+
event_series_id: nullable(text5),
|
|
1931
|
+
title: nullable(text5),
|
|
1932
|
+
description: nullable(text5),
|
|
1933
|
+
location: nullable(text5),
|
|
1934
|
+
starts_at: nullable(isoTime),
|
|
1935
|
+
ends_at: nullable(isoTime),
|
|
1936
|
+
timezone: nullable(text5),
|
|
1937
|
+
/** `auto`: made from a meeting; `owner`: made by hand; `calendar`: from a calendar's entries. */
|
|
1938
|
+
origin: picklist(["auto", "owner", "calendar"]),
|
|
1939
|
+
status: nullable(text5),
|
|
1940
|
+
all_day: boolean(),
|
|
1941
|
+
/** When its calendar deleted it: shown as "deleted in Google", kept as history. */
|
|
1942
|
+
source_deleted_at: nullable(isoTime),
|
|
1943
|
+
deleted_at: nullable(isoTime),
|
|
1944
|
+
created_at: isoTime,
|
|
1945
|
+
updated_at: isoTime,
|
|
1946
|
+
/** The fields whoever sent the invitation wrote, on a calendar CLI's `events list`: an agent reads them as data. */
|
|
1947
|
+
untrusted: optional(array(text5))
|
|
1948
|
+
});
|
|
1949
|
+
var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
1950
|
+
id: String(one.id),
|
|
1951
|
+
event_series_id: one.eventSeriesId === null ? null : String(one.eventSeriesId),
|
|
1952
|
+
title: one.title,
|
|
1953
|
+
description: one.description,
|
|
1954
|
+
location: one.location,
|
|
1955
|
+
starts_at: iso3(one.startsAt),
|
|
1956
|
+
ends_at: iso3(one.endsAt),
|
|
1957
|
+
timezone: one.timezone,
|
|
1958
|
+
origin: one.origin,
|
|
1959
|
+
status: one.status ?? null,
|
|
1960
|
+
all_day: one.allDay === true,
|
|
1961
|
+
source_deleted_at: iso3(one.sourceDeletedAt ?? null),
|
|
1962
|
+
deleted_at: iso3(one.deletedAt),
|
|
1963
|
+
created_at: new Date(one.createdAt).toISOString(),
|
|
1964
|
+
updated_at: new Date(one.updatedAt).toISOString()
|
|
1965
|
+
}), "eventItem");
|
|
1966
|
+
|
|
1967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
|
|
1968
|
+
var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
|
|
1969
|
+
|
|
1970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
|
|
1971
|
+
var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
1972
|
+
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
1973
|
+
throw new CliError("validation_error", "related history request is required");
|
|
1974
|
+
const input = { ...original };
|
|
1975
|
+
for (const field of Object.keys(input))
|
|
1976
|
+
if (!["accountId", "seriesId", "anchorIds", "after", "before", "limit", "maxReadBytes", "signal"].includes(field))
|
|
1977
|
+
throw new CliError("validation_error", `unknown related history field: ${field}`);
|
|
1978
|
+
const positive = /* @__PURE__ */ __name((value) => Number.isSafeInteger(value) && value > 0, "positive");
|
|
1979
|
+
if (!positive(input.accountId) || !positive(input.seriesId))
|
|
1980
|
+
throw new CliError("validation_error", "accountId and seriesId must be positive safe integers");
|
|
1981
|
+
if (!Array.isArray(input.anchorIds) || input.anchorIds.length > 20 || input.anchorIds.some((id4) => !positive(id4)))
|
|
1982
|
+
throw new CliError("validation_error", "anchorIds must contain at most 20 positive safe integers");
|
|
1983
|
+
for (const key of ["after", "before"])
|
|
1984
|
+
if (!Number.isSafeInteger(input[key]) || Math.abs(input[key]) > 864e13)
|
|
1985
|
+
throw new CliError("validation_error", `${key} must be an absolute timestamp`);
|
|
1986
|
+
if (input.after >= input.before)
|
|
1987
|
+
throw new CliError("validation_error", "after must precede before");
|
|
1988
|
+
const limit = input.limit === void 0 ? 5 : input.limit;
|
|
1989
|
+
const maxReadBytes = input.maxReadBytes === void 0 ? 262144 : input.maxReadBytes;
|
|
1990
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 20)
|
|
1991
|
+
throw new CliError("validation_error", "limit must be an integer from 1 to 20");
|
|
1992
|
+
if (!Number.isSafeInteger(maxReadBytes) || maxReadBytes < 1 || maxReadBytes > 4194304)
|
|
1993
|
+
throw new CliError("validation_error", "maxReadBytes must be an integer from 1 to 4194304");
|
|
1994
|
+
if (input.signal !== void 0 && !(input.signal instanceof AbortSignal))
|
|
1995
|
+
throw new CliError("validation_error", "signal must be an AbortSignal");
|
|
1996
|
+
input.signal?.throwIfAborted();
|
|
1997
|
+
return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
|
|
1998
|
+
}, "validateMeetingRelatedHistory");
|
|
1999
|
+
|
|
2000
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
|
|
2001
|
+
var text6 = string();
|
|
2002
|
+
var identifier = pipe(text6, minLength(1));
|
|
2003
|
+
var nullableText = nullable(text6);
|
|
2004
|
+
var count5 = pipe(number(), integer(), minValue(0));
|
|
2005
|
+
var flag = boolean();
|
|
2006
|
+
var scope = strictObject({ provider: text6, account: text6 });
|
|
2007
|
+
var run = strictObject({
|
|
2008
|
+
meetings: count5,
|
|
2009
|
+
participants: count5,
|
|
2010
|
+
transcript_rows: count5,
|
|
2011
|
+
summaries: count5,
|
|
2012
|
+
warnings: array(strictObject({ external_id: text6, message: text6 })),
|
|
2013
|
+
timezone: optional(text6)
|
|
2014
|
+
});
|
|
2015
|
+
var exported = union([
|
|
2016
|
+
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), filename: text6, content: text6 }),
|
|
2017
|
+
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), output: text6 })
|
|
2018
|
+
]);
|
|
2019
|
+
var eventChange = strictObject({
|
|
2020
|
+
action: literal("event.link"),
|
|
2021
|
+
event_id: nullable(identifier),
|
|
2022
|
+
expected_event_id: optional(nullable(identifier))
|
|
2023
|
+
});
|
|
2024
|
+
var personChange = strictObject({
|
|
2025
|
+
action: literal("person.link"),
|
|
2026
|
+
participant_id: identifier,
|
|
2027
|
+
person_uid: text6,
|
|
2028
|
+
expected_person_uid: optional(nullableText),
|
|
2029
|
+
target_account_ids: optional(array(identifier))
|
|
2030
|
+
});
|
|
2031
|
+
var eventResult = strictObject({
|
|
2032
|
+
meeting_id: identifier,
|
|
2033
|
+
event_id: nullable(identifier),
|
|
2034
|
+
previous_event_id: nullable(identifier),
|
|
2035
|
+
changed: flag
|
|
2036
|
+
});
|
|
2037
|
+
var personResult = strictObject({
|
|
2038
|
+
meeting_id: identifier,
|
|
2039
|
+
participant_id: identifier,
|
|
2040
|
+
person_uid: text6,
|
|
2041
|
+
previous_person_uid: nullableText,
|
|
2042
|
+
changed: flag
|
|
2043
|
+
});
|
|
2044
|
+
var meetingChange = strictObject({
|
|
2045
|
+
scope,
|
|
2046
|
+
account_id: identifier,
|
|
2047
|
+
meeting_id: identifier,
|
|
2048
|
+
change: union([eventChange, personChange]),
|
|
2049
|
+
applied: flag,
|
|
2050
|
+
result: optional(union([eventResult, personResult]))
|
|
2051
|
+
});
|
|
2052
|
+
var recognition = strictObject({
|
|
2053
|
+
engine: text6,
|
|
2054
|
+
model: text6,
|
|
2055
|
+
version: optional(text6),
|
|
2056
|
+
timing: optional(picklist(["fixed-windows", "recognition-segments"]))
|
|
2057
|
+
});
|
|
2058
|
+
var transcription = union([
|
|
2059
|
+
strictObject({
|
|
2060
|
+
applied: literal(false),
|
|
2061
|
+
account_id: identifier,
|
|
2062
|
+
external_id: text6,
|
|
2063
|
+
segments: count5,
|
|
2064
|
+
media: strictObject({
|
|
2065
|
+
id: text6,
|
|
2066
|
+
content_hash: text6,
|
|
2067
|
+
size: count5,
|
|
2068
|
+
duration_ms: count5,
|
|
2069
|
+
format: text6,
|
|
2070
|
+
sample_rate: count5,
|
|
2071
|
+
channels: count5,
|
|
2072
|
+
recognition
|
|
2073
|
+
})
|
|
2074
|
+
}),
|
|
2075
|
+
strictObject({
|
|
2076
|
+
applied: literal(true),
|
|
2077
|
+
account_id: identifier,
|
|
2078
|
+
external_id: text6,
|
|
2079
|
+
meeting_id: identifier,
|
|
2080
|
+
created: flag,
|
|
2081
|
+
inserted_transcripts: count5,
|
|
2082
|
+
replayed_transcripts: count5,
|
|
2083
|
+
superseded_transcripts: count5,
|
|
2084
|
+
segments: count5,
|
|
2085
|
+
media_sha256: text6,
|
|
2086
|
+
engine: text6,
|
|
2087
|
+
model: text6,
|
|
2088
|
+
model_version: nullableText,
|
|
2089
|
+
timing: picklist(["fixed-windows", "recognition-segments"])
|
|
2090
|
+
})
|
|
2091
|
+
]);
|
|
2092
|
+
var embeddingModel = strictObject({ key: text6, dims: count5, kind: picklist(["local", "remote"]), model: text6 });
|
|
2093
|
+
var embedding = union([
|
|
2094
|
+
strictObject({
|
|
2095
|
+
account_id: identifier,
|
|
2096
|
+
model: embeddingModel,
|
|
2097
|
+
status: strictObject({ chunks: count5, embedded: count5 }),
|
|
2098
|
+
applied: literal(false),
|
|
2099
|
+
scope: literal("existing-current-chunks"),
|
|
2100
|
+
rebuild_required: literal("explicit")
|
|
2101
|
+
}),
|
|
2102
|
+
strictObject({
|
|
2103
|
+
account_id: identifier,
|
|
2104
|
+
model: embeddingModel,
|
|
2105
|
+
saved: count5,
|
|
2106
|
+
skipped: count5,
|
|
2107
|
+
has_more: flag,
|
|
2108
|
+
next_hash: optional(text6),
|
|
2109
|
+
applied: literal(true),
|
|
2110
|
+
rebuild: strictObject({
|
|
2111
|
+
transcripts: count5,
|
|
2112
|
+
chunks: count5,
|
|
2113
|
+
has_more: flag,
|
|
2114
|
+
next_transcript_id: optional(identifier)
|
|
2115
|
+
})
|
|
2116
|
+
})
|
|
2117
|
+
]);
|
|
2118
|
+
var MEETING_RESULT_ENTITIES = {
|
|
2119
|
+
meeting_ingestion: run,
|
|
2120
|
+
meeting_export: exported,
|
|
2121
|
+
meeting_association: meetingChange,
|
|
2122
|
+
meeting_transcription: transcription,
|
|
2123
|
+
meeting_embedding: embedding
|
|
2124
|
+
};
|
|
2125
|
+
|
|
2126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/review.js
|
|
2127
|
+
var REVIEW_LIMIT = { default: 50, most: 200 };
|
|
2128
|
+
|
|
2129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
|
|
2130
|
+
var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
|
|
2131
|
+
\`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
|
|
2132
|
+
|
|
2133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
|
|
2134
|
+
var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
2135
|
+
input.signal?.throwIfAborted();
|
|
2136
|
+
if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
|
|
2137
|
+
throw new CliError("validation_error", "accountId must be a positive safe integer");
|
|
2138
|
+
if (typeof input.externalId !== "string" || !input.externalId.trim() || new TextEncoder().encode(input.externalId).length > 4096 || /[\0\r\n]/.test(input.externalId))
|
|
2139
|
+
throw new CliError("validation_error", "externalId must be a bounded nonempty series identifier");
|
|
2140
|
+
for (const name of ["after", "before"])
|
|
2141
|
+
if (!Number.isSafeInteger(input[name]) || Math.abs(input[name]) > 864e13)
|
|
2142
|
+
throw new CliError("validation_error", `${name} must be an absolute timestamp in milliseconds`);
|
|
2143
|
+
if (input.after >= input.before)
|
|
2144
|
+
throw new CliError("validation_error", "after must be earlier than before");
|
|
2145
|
+
const limit = input.limit === void 0 ? 20 : input.limit;
|
|
2146
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
2147
|
+
throw new CliError("validation_error", "limit must be an integer from 1 to 100");
|
|
2148
|
+
const maxReadBytes = input.maxReadBytes === void 0 ? 256 * 1024 : input.maxReadBytes;
|
|
2149
|
+
if (!Number.isSafeInteger(maxReadBytes) || maxReadBytes < 1 || maxReadBytes > 4 * 1024 * 1024)
|
|
2150
|
+
throw new CliError("validation_error", "maxReadBytes must be an integer from 1 to 4194304");
|
|
2151
|
+
return { ...input, limit, maxReadBytes };
|
|
2152
|
+
}, "validateMeetingSeriesHistory");
|
|
2153
|
+
|
|
2154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
|
|
2155
|
+
var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
|
|
2156
|
+
|
|
2157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
|
|
2158
|
+
function invalid3(field, response = false) {
|
|
2159
|
+
throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
|
|
2160
|
+
}
|
|
2161
|
+
__name(invalid3, "invalid");
|
|
2162
|
+
var object = /* @__PURE__ */ __name((value, fields3, field, response = false) => {
|
|
2163
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
2164
|
+
invalid3(field, response);
|
|
2165
|
+
for (const key of Object.keys(value))
|
|
2166
|
+
if (!fields3.includes(key))
|
|
2167
|
+
invalid3(`${field}.${key}`, response);
|
|
2168
|
+
}, "object");
|
|
2169
|
+
var cursorDetails = /* @__PURE__ */ __name((value) => {
|
|
2170
|
+
if (typeof value !== "string" || value.length > 4096 || !/^[A-Za-z0-9_-]+$/.test(value))
|
|
2171
|
+
invalid3("cursor");
|
|
2172
|
+
try {
|
|
2173
|
+
const decoded = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
|
|
2174
|
+
object(decoded, ["version", "selection", "cursor"], "cursor");
|
|
2175
|
+
if (decoded.version !== 1 || typeof decoded.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded.selection) || !occurrenceId(decoded.cursor))
|
|
2176
|
+
invalid3("cursor");
|
|
2177
|
+
return decoded;
|
|
2178
|
+
} catch {
|
|
2179
|
+
return invalid3("cursor");
|
|
2180
|
+
}
|
|
2181
|
+
}, "cursorDetails");
|
|
2182
|
+
var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
|
|
2183
|
+
cursorDetails(value);
|
|
2184
|
+
}, "validateMeetingSeriesInventoryCursor");
|
|
2185
|
+
|
|
2186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/meetings/stats.js
|
|
2187
|
+
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
2188
|
+
const zone = timeZone ?? "UTC";
|
|
2189
|
+
try {
|
|
2190
|
+
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
2191
|
+
} catch {
|
|
2192
|
+
throw new CliError("validation_error", "expected an IANA time zone such as Europe/Madrid");
|
|
2193
|
+
}
|
|
2194
|
+
return zone;
|
|
2195
|
+
}, "zoneOf");
|
|
2196
|
+
var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
2197
|
+
var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
2198
|
+
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
2199
|
+
const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
|
|
2200
|
+
return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
2201
|
+
}, "weekStart");
|
|
2202
|
+
var UNKNOWN_SPEAKER = "unknown";
|
|
2203
|
+
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");
|
|
2204
|
+
var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
2205
|
+
const zone = zoneOf(timeZone);
|
|
2206
|
+
const format = new Intl.DateTimeFormat("en-US", {
|
|
2207
|
+
timeZone: zone,
|
|
2208
|
+
year: "numeric",
|
|
2209
|
+
month: "2-digit",
|
|
2210
|
+
day: "2-digit",
|
|
2211
|
+
weekday: "short"
|
|
2212
|
+
});
|
|
2213
|
+
const speakers = /* @__PURE__ */ new Map();
|
|
2214
|
+
const weeks = /* @__PURE__ */ new Map();
|
|
2215
|
+
const meetings = /* @__PURE__ */ new Set();
|
|
2216
|
+
let lines = 0;
|
|
2217
|
+
let words2 = 0;
|
|
2218
|
+
let talkMs = 0;
|
|
2219
|
+
for (const row of rows) {
|
|
2220
|
+
const talk = Math.max(0, row.endMs - row.startMs);
|
|
2221
|
+
meetings.add(row.meetingId);
|
|
2222
|
+
lines += 1;
|
|
2223
|
+
words2 += row.words;
|
|
2224
|
+
talkMs += talk;
|
|
2225
|
+
const who = speakerOf(row);
|
|
2226
|
+
const held = speakers.get(who.key) ?? {
|
|
2227
|
+
key: who.key,
|
|
2228
|
+
name: who.name ?? null,
|
|
2229
|
+
personId: row.personId,
|
|
2230
|
+
identityId: row.personId === null ? row.identityId : null,
|
|
2231
|
+
meetings: 0,
|
|
2232
|
+
lines: 0,
|
|
2233
|
+
words: 0,
|
|
2234
|
+
talkMs: 0,
|
|
2235
|
+
share: 0,
|
|
2236
|
+
seen: /* @__PURE__ */ new Set()
|
|
2237
|
+
};
|
|
2238
|
+
held.seen.add(row.meetingId);
|
|
2239
|
+
held.lines += 1;
|
|
2240
|
+
held.words += row.words;
|
|
2241
|
+
held.talkMs += talk;
|
|
2242
|
+
speakers.set(who.key, held);
|
|
2243
|
+
if (row.startedAt !== null) {
|
|
2244
|
+
const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
|
|
2245
|
+
week.meetings.add(row.meetingId);
|
|
2246
|
+
week.talkMs += talk;
|
|
2247
|
+
weeks.set(weekStart(row.startedAt, format), week);
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
return {
|
|
2251
|
+
timeZone: zone,
|
|
2252
|
+
meetings: meetings.size,
|
|
2253
|
+
lines,
|
|
2254
|
+
words: words2,
|
|
2255
|
+
talkMs,
|
|
2256
|
+
speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
|
|
2257
|
+
...speaker,
|
|
2258
|
+
meetings: seen.size,
|
|
2259
|
+
share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
|
|
2260
|
+
})).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
|
|
2261
|
+
weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
|
|
2262
|
+
};
|
|
2263
|
+
}, "aggregateMeetingStats");
|
|
2264
|
+
|
|
2265
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
2266
|
+
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
2267
|
+
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
2268
|
+
var tagOf = /* @__PURE__ */ __name((value) => {
|
|
2269
|
+
const tag = value.trim().toLowerCase();
|
|
2270
|
+
return TAG.test(tag) ? tag : void 0;
|
|
2271
|
+
}, "tagOf");
|
|
2272
|
+
var normalizeTag = /* @__PURE__ */ __name((value) => {
|
|
2273
|
+
const tag = tagOf(value);
|
|
2274
|
+
if (tag === void 0)
|
|
2275
|
+
throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
|
|
2276
|
+
return tag;
|
|
2277
|
+
}, "normalizeTag");
|
|
2278
|
+
|
|
2279
|
+
export {
|
|
2280
|
+
TAG_TYPES,
|
|
2281
|
+
tagOf,
|
|
2282
|
+
normalizeTag,
|
|
2283
|
+
formatMeetingReference,
|
|
2284
|
+
parseMeetingReference,
|
|
2285
|
+
canonicalMeetingReference,
|
|
2286
|
+
meeting,
|
|
2287
|
+
MEETING_QUERY,
|
|
2288
|
+
meetingHit,
|
|
2289
|
+
meetingTranscript,
|
|
2290
|
+
meetingSummary,
|
|
2291
|
+
meetingDetails,
|
|
2292
|
+
meetingHitsList,
|
|
2293
|
+
joinKeyOf,
|
|
2294
|
+
joinUrlWithoutQuery,
|
|
2295
|
+
calendarText,
|
|
2296
|
+
entryMetadata,
|
|
2297
|
+
meetingCueFingerprint,
|
|
2298
|
+
EVENT_QUERY,
|
|
2299
|
+
normalizeMeetingParticipantQuery,
|
|
2300
|
+
validateMeetingParticipantSearch,
|
|
2301
|
+
MeetingError,
|
|
2302
|
+
listed,
|
|
2303
|
+
meetingPeople,
|
|
2304
|
+
meetingsList,
|
|
2305
|
+
meetingsQuery,
|
|
2306
|
+
MEETING_QUERY_GUIDE,
|
|
2307
|
+
meetingDetailsAnswer,
|
|
2308
|
+
meetingTranscriptAnswer,
|
|
2309
|
+
meetingSummaryAnswer,
|
|
2310
|
+
exportMeeting,
|
|
2311
|
+
snapshotMeetingScope,
|
|
2312
|
+
validateMeetingChange,
|
|
2313
|
+
validateMeetingContextChange,
|
|
2314
|
+
createMeetingContext,
|
|
2315
|
+
findingHash,
|
|
2316
|
+
validateFindings,
|
|
2317
|
+
findingFingerprint,
|
|
2318
|
+
MEETING_FINDINGS_KIND,
|
|
2319
|
+
validateMeetingFindings,
|
|
2320
|
+
meetingFindingFingerprint,
|
|
2321
|
+
liftMeetingFields,
|
|
2322
|
+
parseMeetingQuery,
|
|
2323
|
+
meetingWordsQuery,
|
|
2324
|
+
importFiles,
|
|
2325
|
+
CHAT_MESSAGES_READ,
|
|
2326
|
+
meetingHitContextLimits,
|
|
2327
|
+
validateMeetingPassage,
|
|
2328
|
+
validateMeetingPreparationContext,
|
|
2329
|
+
meetingProjectEvidence,
|
|
2330
|
+
meetingProjectEvidenceAnswer,
|
|
2331
|
+
validateMeetingHitSearch,
|
|
2332
|
+
MEETING_PROJECT_EVIDENCE_QUERY,
|
|
2333
|
+
prepareMeetingProjectEvidence,
|
|
2334
|
+
readMeetingProjectEvidence,
|
|
2335
|
+
pull,
|
|
2336
|
+
meetingReview,
|
|
2337
|
+
meetingLink,
|
|
2338
|
+
meetingSpeaker,
|
|
2339
|
+
meetingStats,
|
|
2340
|
+
meetingParticipants,
|
|
2341
|
+
meetingPassage,
|
|
2342
|
+
event,
|
|
2343
|
+
eventItem,
|
|
2344
|
+
strongRecordingValidator,
|
|
2345
|
+
validateMeetingRelatedHistory,
|
|
2346
|
+
MEETING_RESULT_ENTITIES,
|
|
2347
|
+
REVIEW_LIMIT,
|
|
2348
|
+
SAVE_HELP,
|
|
2349
|
+
validateMeetingSeriesHistory,
|
|
2350
|
+
validateMeetingSeriesInventoryCursor,
|
|
2351
|
+
aggregateMeetingStats
|
|
2352
|
+
};
|