@wirecat/tg-cli 0.115.0 → 0.117.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/dist/bin/tg.js +2 -2
- package/dist/bot/transport.d.ts +11 -9
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +58 -32
- package/dist/bot/transport.js.map +1 -1
- package/dist/bundle/{adapter-ODK7R4LY.js → adapter-VNQ72MBK.js} +98 -63
- package/dist/bundle/{all-profiles-AQYM65BS.js → all-profiles-3W2UQTCK.js} +10 -9
- package/dist/bundle/{anthropic-VBDSVNIM.js → anthropic-DFUW2KTG.js} +6 -6
- package/dist/bundle/{app-server-YOIHLBNS.js → app-server-5XJIMLHB.js} +49 -45
- package/dist/bundle/{bot-api-TRYLGQKK.js → bot-api-HRRBF3W6.js} +50 -49
- package/dist/bundle/{bot-history-7DTJLBBJ.js → bot-history-GBH5XE4N.js} +18 -17
- package/dist/bundle/{bun-XIMM6EHD.js → bun-ZMOYGG6F.js} +2 -2
- package/dist/bundle/{bun-sqlite-6B3BL5IV.js → bun-sqlite-6FZFMA7K.js} +5 -5
- package/dist/bundle/{chunk-DIABP7ZP.js → chunk-2452HCIV.js} +3 -3
- package/dist/bundle/{chunk-WMG4IGEB.js → chunk-2XLKZL6K.js} +77 -38
- package/dist/bundle/chunk-3GRX7WP6.js +35 -0
- package/dist/bundle/{chunk-WINKEV4F.js → chunk-3MQOLYAN.js} +4 -4
- package/dist/bundle/{chunk-KDOBY524.js → chunk-3RJYLN5V.js} +133 -27
- package/dist/bundle/{chunk-Y3AQHPAJ.js → chunk-4JDGN6OD.js} +1 -1
- package/dist/bundle/{chunk-JZXQZW2D.js → chunk-56Q5JV3Z.js} +2 -2
- package/dist/bundle/{chunk-XIYRHIBK.js → chunk-66FZBLRJ.js} +13 -13
- package/dist/bundle/{chunk-OUX3QMYI.js → chunk-6GFUL4OU.js} +228 -84
- package/dist/bundle/{chunk-O7CBGHI7.js → chunk-6HRN7BW6.js} +1 -1
- package/dist/bundle/{chunk-TQYMLXDS.js → chunk-7NBUT62O.js} +3 -3
- package/dist/bundle/{chunk-A4BQGSKI.js → chunk-7Y3RUEVY.js} +6 -6
- package/dist/bundle/chunk-AG6HWPQP.js +64 -0
- package/dist/bundle/{chunk-GCFU6WBE.js → chunk-AUBRELCM.js} +3 -3
- package/dist/bundle/{chunk-PEKTB3FQ.js → chunk-B2YPB5AE.js} +56 -27
- package/dist/bundle/{chunk-CCHHEMPM.js → chunk-BXTDAGM4.js} +3 -2
- package/dist/bundle/{chunk-QK6VLKG5.js → chunk-C6TUVV7E.js} +674 -316
- package/dist/bundle/{chunk-XY7IGVVS.js → chunk-EA2PGDER.js} +2 -2
- package/dist/bundle/{chunk-KIZT2MI6.js → chunk-EL6I4WTB.js} +1 -1
- package/dist/bundle/{chunk-77M3IAVU.js → chunk-EPCFXKTX.js} +27 -8
- package/dist/bundle/{chunk-L4CMCC3V.js → chunk-EZTYJ43A.js} +4 -2
- package/dist/bundle/{chunk-PEJHI7QO.js → chunk-F6KBVIJP.js} +4 -4
- package/dist/bundle/{chunk-UY7GJRGY.js → chunk-FAHHERJ7.js} +4 -4
- package/dist/bundle/{chunk-WOQGUIXE.js → chunk-FEKXHILZ.js} +1 -1
- package/dist/bundle/chunk-G7B5UIE7.js +182 -0
- package/dist/bundle/{chunk-RFRI2HFT.js → chunk-GFHNQBD2.js} +1 -1
- package/dist/bundle/{chunk-TMATSEP5.js → chunk-HORGORHK.js} +12 -12
- package/dist/bundle/{chunk-2TC76TLJ.js → chunk-HWYSRB64.js} +2 -2
- package/dist/bundle/{chunk-GX4DMI4H.js → chunk-HZZGOLGP.js} +15 -12
- package/dist/bundle/{chunk-MUZ4KYGY.js → chunk-JWIUK3SK.js} +2 -2
- package/dist/bundle/{chunk-WDNNN3J4.js → chunk-KVTLT4V7.js} +6 -6
- package/dist/bundle/{chunk-UBQ3LOF6.js → chunk-L5WNE4WS.js} +2 -2
- package/dist/bundle/{chunk-OMP6ALBT.js → chunk-M7V5XRM6.js} +3 -3
- package/dist/bundle/{chunk-LUIPXRKN.js → chunk-MLHKQDUN.js} +647 -129
- package/dist/bundle/{chunk-VQCWVZWG.js → chunk-MP7M6FFU.js} +6 -6
- package/dist/bundle/{chunk-5ROWSRK7.js → chunk-NUCDEOFC.js} +2 -2
- package/dist/bundle/{chunk-ILHTNOIV.js → chunk-P3ASN72F.js} +1 -1
- package/dist/bundle/{chunk-VVKEWWSO.js → chunk-PTIB7NEE.js} +1 -1
- package/dist/bundle/{chunk-D4E345BC.js → chunk-Q7O4CQDO.js} +4 -2
- package/dist/bundle/{chunk-EW3XTUPB.js → chunk-QOGYHU3Q.js} +4 -4
- package/dist/bundle/{chunk-BEQPZA3S.js → chunk-RDH2QBUE.js} +3 -3
- package/dist/bundle/{chunk-AVWPMJ6E.js → chunk-RDSLSV4M.js} +2 -2
- package/dist/bundle/{chunk-YCUQKFGD.js → chunk-SQXB5ZUZ.js} +3 -3
- package/dist/bundle/{chunk-RHUNMU4Q.js → chunk-TFBHDIGY.js} +4 -4
- package/dist/bundle/{chunk-OSP335AJ.js → chunk-TG6ZYL4B.js} +8 -8
- package/dist/bundle/{chunk-IUDIRZVU.js → chunk-UGPZCNYC.js} +991 -536
- package/dist/bundle/{chunk-AICS3TSF.js → chunk-UYK5AXSW.js} +4 -4
- package/dist/bundle/{chunk-PZAEI4NM.js → chunk-V2T7NYNU.js} +55 -46
- package/dist/bundle/{chunk-HZKWB6WS.js → chunk-V47NPSSV.js} +28 -28
- package/dist/bundle/{chunk-U67TSAAO.js → chunk-VMCQGZIA.js} +1893 -840
- package/dist/bundle/{chunk-CNO3R4O4.js → chunk-VRDVXXXD.js} +8 -8
- package/dist/bundle/{chunk-PQLBPYJR.js → chunk-VW6BF6M7.js} +1 -1
- package/dist/bundle/{chunk-M7B5IMH3.js → chunk-X3CD475M.js} +1336 -366
- package/dist/bundle/chunk-XW5C4TI7.js +91 -0
- package/dist/bundle/{chunk-NTW5ZE47.js → chunk-YHZFGUAP.js} +39 -33
- package/dist/bundle/{chunk-BIEBJLYO.js → chunk-YIXXH74F.js} +2 -2
- package/dist/bundle/{chunk-BPPRR7TV.js → chunk-Z4QKLHJW.js} +15587 -1637
- package/dist/bundle/{chunk-POKTQZOM.js → chunk-ZPILMEFY.js} +12 -89
- package/dist/bundle/command-contract-KMMHARMR.js +33 -0
- package/dist/bundle/{decode-2GATBZGH.js → decode-YMSOY2AY.js} +5 -5
- package/dist/bundle/{dispatch-MJMW7WDH.js → dispatch-OP27MWX5.js} +8 -8
- package/dist/bundle/{echarts-GKEZEAL7.js → echarts-7XS55TQY.js} +2 -2
- package/dist/bundle/{embed-TBQPLA4Y.js → embed-QTOE7NN3.js} +6 -6
- package/dist/bundle/{embedder-B5DTNCRO.js → embedder-KBBRYSNH.js} +9 -9
- package/dist/bundle/{entry-A6DEW2TD.js → entry-HGEUYYMX.js} +7 -7
- package/dist/bundle/{failure-TLF3SISS.js → failure-4JUQFXJT.js} +2 -2
- package/dist/bundle/{first-run-3N5AABEY.js → first-run-CSGMEJXY.js} +11 -11
- package/dist/bundle/first-screen-K2PBNJNE.js +31 -0
- package/dist/bundle/{instructions-P5E34PQR.js → instructions-S6ZXCTFH.js} +1 -1
- package/dist/bundle/{mcp-MNI62HHE.js → mcp-M4QN2E7R.js} +2 -2
- package/dist/bundle/{node-GKPRXS5Y.js → node-LCIUWXXG.js} +2 -2
- package/dist/bundle/{node-sqlite-GIDPALK3.js → node-sqlite-HL4WY4N2.js} +6 -6
- package/dist/bundle/{oauth-C57W4IMD.js → oauth-U4KIMDKG.js} +7 -7
- package/dist/bundle/{open-E6Q4WRPU.js → open-EH7OS7M7.js} +5 -5
- package/dist/bundle/{openai-5WMXY2KP.js → openai-W5TB3NA5.js} +14 -14
- package/dist/bundle/{process-U2P5Z6UF.js → process-3CVLTCTA.js} +1 -1
- package/dist/bundle/{program-FEUDU6GF.js → program-LOIZTK2P.js} +58 -50
- package/dist/bundle/{prompt-4NGAZGHE.js → prompt-IDNH7N3W.js} +5 -5
- package/dist/bundle/{proxy-transport-MGCJ7JAW.js → proxy-transport-4DPZB2W2.js} +5 -5
- package/dist/bundle/{recognize-EUHRBA7V.js → recognize-G5EWYXIF.js} +4 -4
- package/dist/bundle/{remote-3JHLB2FV.js → remote-4XTBZVZD.js} +7 -7
- package/dist/bundle/{rerank-ZZ45SZPC.js → rerank-OWSTDLZN.js} +7 -7
- package/dist/bundle/{serve-XOGX5FC5.js → serve-YCPSEWP3.js} +9 -9
- package/dist/bundle/server-KELKX6S3.js +60 -0
- package/dist/bundle/{server-I6O72XP5.js → server-ODG4A2KK.js} +35 -34
- package/dist/bundle/{state-BIUYTGH6.js → state-OL2235G5.js} +6 -6
- package/dist/bundle/{store-FOJFYOMR.js → store-5AACYNDM.js} +17 -12
- package/dist/bundle/store-maintenance-command-3J7WZYVN.js +50 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +7 -0
- package/dist/commands/session.js.map +1 -1
- package/dist/telegram/account.d.ts.map +1 -1
- package/dist/telegram/account.js +4 -1
- package/dist/telegram/account.js.map +1 -1
- package/dist/telegram/errors.d.ts.map +1 -1
- package/dist/telegram/errors.js +2 -1
- package/dist/telegram/errors.js.map +1 -1
- package/dist/telegram/feature.d.ts +4 -1
- package/dist/telegram/feature.d.ts.map +1 -1
- package/dist/telegram/feature.js +5 -2
- package/dist/telegram/feature.js.map +1 -1
- package/dist/telegram/login.d.ts +2 -0
- package/dist/telegram/login.d.ts.map +1 -1
- package/dist/telegram/login.js +31 -2
- package/dist/telegram/login.js.map +1 -1
- package/dist/telegram/sending.d.ts.map +1 -1
- package/dist/telegram/sending.js +24 -10
- package/dist/telegram/sending.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-63YKD7YA.js +0 -18
- package/dist/bundle/chunk-GWDMKEDY.js +0 -48
- package/dist/bundle/chunk-WMRFAK5B.js +0 -132
- package/dist/bundle/command-contract-YF4KGFXC.js +0 -32
- package/dist/bundle/first-screen-HANARM67.js +0 -30
- package/dist/bundle/server-DRE5MJ76.js +0 -59
- package/dist/bundle/store-maintenance-command-YKV2C34N.js +0 -49
- /package/dist/bundle/{chunk-NUN6OGOV.js → chunk-VOXIGICJ.js} +0 -0
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
duplicates,
|
|
12
12
|
integer,
|
|
13
13
|
isoTime,
|
|
14
|
+
isoTimestamp,
|
|
14
15
|
lazy,
|
|
15
16
|
literal,
|
|
16
17
|
maxValue,
|
|
@@ -23,25 +24,27 @@ import {
|
|
|
23
24
|
pageSchema,
|
|
24
25
|
picklist,
|
|
25
26
|
pipe,
|
|
27
|
+
record,
|
|
26
28
|
reference,
|
|
27
29
|
safeParse,
|
|
28
30
|
stepOf,
|
|
29
31
|
strictObject,
|
|
30
32
|
string,
|
|
31
33
|
union,
|
|
34
|
+
unknown,
|
|
32
35
|
variant
|
|
33
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-EPCFXKTX.js";
|
|
34
37
|
import {
|
|
35
38
|
CliError,
|
|
36
39
|
isCliError,
|
|
37
40
|
singleLine,
|
|
38
41
|
visibleControls
|
|
39
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-BXTDAGM4.js";
|
|
40
43
|
import {
|
|
41
44
|
__name
|
|
42
45
|
} from "./chunk-ZVVMGPBJ.js";
|
|
43
46
|
|
|
44
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
47
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/types.js
|
|
45
48
|
var QUERY_LIMITS = {
|
|
46
49
|
bytes: 8192,
|
|
47
50
|
depth: 32,
|
|
@@ -85,7 +88,7 @@ function queryError(reason, span, alternative, context3 = {}, details = {}) {
|
|
|
85
88
|
__name(queryError, "queryError");
|
|
86
89
|
var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
|
|
87
90
|
|
|
88
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
91
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/dates.js
|
|
89
92
|
var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
90
93
|
const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
|
|
91
94
|
try {
|
|
@@ -118,8 +121,8 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
|
|
|
118
121
|
day: "2-digit",
|
|
119
122
|
era: "short"
|
|
120
123
|
});
|
|
121
|
-
const dayAt = /* @__PURE__ */ __name((
|
|
122
|
-
const parts = formatter.formatToParts(
|
|
124
|
+
const dayAt = /* @__PURE__ */ __name((time2) => {
|
|
125
|
+
const parts = formatter.formatToParts(time2);
|
|
123
126
|
const value2 = /* @__PURE__ */ __name((name) => Number(parts.find((p) => p.type === name)?.value), "value");
|
|
124
127
|
const year = parts.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
|
|
125
128
|
return year * 1e4 + value2("month") * 100 + value2("day");
|
|
@@ -175,11 +178,11 @@ var zonedMoment = /* @__PURE__ */ __name((value, zone, span, { end = false } = {
|
|
|
175
178
|
return dayBoundary(value, zone, end, span) - (end ? 1 : 0);
|
|
176
179
|
if (!ZONED.test(value))
|
|
177
180
|
return wallTime(value, zone, span);
|
|
178
|
-
const
|
|
179
|
-
if (!/^\d{4}-\d{2}-\d{2}T/u.test(value) || !Number.isFinite(
|
|
181
|
+
const time2 = Date.parse(value);
|
|
182
|
+
if (!/^\d{4}-\d{2}-\d{2}T/u.test(value) || !Number.isFinite(time2))
|
|
180
183
|
queryError("query.invalid-date", span);
|
|
181
184
|
calendar(value.slice(0, 10), span);
|
|
182
|
-
return
|
|
185
|
+
return time2;
|
|
183
186
|
}, "zonedMoment");
|
|
184
187
|
var AGO = /^(\d+)(m|h|d)$/u;
|
|
185
188
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
@@ -213,10 +216,10 @@ var dateEndpoint = /* @__PURE__ */ __name((value, zone, side, inclusive, span, n
|
|
|
213
216
|
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?(?:Z|[+-]\d{2}:\d{2})$/u.test(value))
|
|
214
217
|
queryError("query.invalid-date", span, "use an ISO date, today, yesterday, 30m/2h/7d ago, or a quoted timestamp with offset");
|
|
215
218
|
calendar(value.slice(0, 10), span);
|
|
216
|
-
const
|
|
217
|
-
if (!Number.isFinite(
|
|
219
|
+
const time2 = Date.parse(value);
|
|
220
|
+
if (!Number.isFinite(time2) || Number(value.slice(11, 13)) > 23 || Number(value.slice(14, 16)) > 59 || Number(value.slice(17, 19)) > 59)
|
|
218
221
|
queryError("query.invalid-date", span);
|
|
219
|
-
return { time, inclusive };
|
|
222
|
+
return { time: time2, inclusive };
|
|
220
223
|
}, "dateEndpoint");
|
|
221
224
|
var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclusive, zone, span, now = Date.now()) => {
|
|
222
225
|
const since = lower === upper && AGO.test(lower.toLowerCase());
|
|
@@ -230,7 +233,7 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
|
|
|
230
233
|
};
|
|
231
234
|
}, "dateRange");
|
|
232
235
|
|
|
233
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
236
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/fields.js
|
|
234
237
|
var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
|
|
235
238
|
var OPERATORS_BY_TYPE = {
|
|
236
239
|
kw: ["term", "phrase", "wildcard"],
|
|
@@ -309,22 +312,17 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
|
|
|
309
312
|
return [...own, ...relations, ...states];
|
|
310
313
|
}, "queryFieldsOf");
|
|
311
314
|
|
|
312
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
313
|
-
var QUERY_SYNTAX = 'field:value \xB7 "a phrase" \xB7 word* \xB7 AND OR NOT \xB7 ( ) \xB7 [a TO b] \xB7 > >= < <=';
|
|
315
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/help.js
|
|
314
316
|
var shownOf = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "shownOf");
|
|
315
|
-
var leftOut = /* @__PURE__ */ __name((
|
|
316
|
-
var has = /* @__PURE__ */ __name((
|
|
317
|
-
var syntaxOf = /* @__PURE__ */ __name((shown, backend) =>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
"terms joined by AND",
|
|
325
|
-
...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
|
|
326
|
-
].join(" \xB7 ");
|
|
327
|
-
}, "syntaxOf");
|
|
317
|
+
var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
|
|
318
|
+
var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
|
|
319
|
+
var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
320
|
+
"field:value",
|
|
321
|
+
...has(shown, "phrase") ? ['"a phrase"'] : [],
|
|
322
|
+
...has(shown, "wildcard") ? ["word*"] : [],
|
|
323
|
+
...backend === "native" ? ["terms joined by AND"] : ["AND OR NOT", "( )"],
|
|
324
|
+
...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
|
|
325
|
+
].join(" \xB7 "), "syntaxOf");
|
|
328
326
|
var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
|
|
329
327
|
var fieldsHelp = /* @__PURE__ */ __name((registry, guide) => {
|
|
330
328
|
const shown = shownOf(registry);
|
|
@@ -345,13 +343,13 @@ var queryDescription = /* @__PURE__ */ __name((registry) => {
|
|
|
345
343
|
if (shown.length === 0)
|
|
346
344
|
return "field:value terms; this list filters by none yet, so any term is refused";
|
|
347
345
|
const negatable = leftOut(shown);
|
|
348
|
-
const terms = registry.backend === "native" ? `field:value terms joined by AND that narrow the list${negatable.length > 0 ? `; -field:value or NOT field:value leaves out what matches, for ${negatable.join(", ")} only` : ""}` :
|
|
349
|
-
const
|
|
346
|
+
const terms = registry.backend === "native" ? `field:value terms joined by AND that narrow the list${negatable.length > 0 ? `; -field:value or NOT field:value leaves out what matches, for ${negatable.join(", ")} only` : ""}` : `field:value terms that narrow the list (Lucene: AND OR NOT, -field:value${has(shown, "range") ? ", [a TO b], > <" : ""})`;
|
|
347
|
+
const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
|
|
350
348
|
const defaults = registry.defaults?.length ? `; unless named: ${registry.defaults.join(" ")}` : "";
|
|
351
|
-
return `${terms}; fields: ${
|
|
349
|
+
return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
|
|
352
350
|
}, "queryDescription");
|
|
353
351
|
|
|
354
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
352
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/validate.js
|
|
355
353
|
var inContext = /* @__PURE__ */ __name((context3, run2) => {
|
|
356
354
|
try {
|
|
357
355
|
run2();
|
|
@@ -426,7 +424,7 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
|
|
|
426
424
|
}, "validateQuery");
|
|
427
425
|
var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
|
|
428
426
|
|
|
429
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
427
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/parser.js
|
|
430
428
|
var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
|
|
431
429
|
var reserved = /* @__PURE__ */ new Set([
|
|
432
430
|
"+",
|
|
@@ -533,6 +531,10 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
|
533
531
|
break;
|
|
534
532
|
at++;
|
|
535
533
|
}
|
|
534
|
+
const [field, colon] = tokens.slice(-2);
|
|
535
|
+
if (field?.kind === "term" && colon?.kind === ":" && colon.span.end === start && text6[at] === ":" && /^[a-z][a-z_-]*$/u.test(text6.slice(start, at)) && /^:[^\s()"]/u.test(text6.slice(at)))
|
|
536
|
+
while (at < text6.length && !whitespace(text6[at] ?? "") && !["(", ")", '"'].includes(text6[at] ?? ""))
|
|
537
|
+
at++;
|
|
536
538
|
const raw = text6.slice(start, at);
|
|
537
539
|
kind = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
|
|
538
540
|
}
|
|
@@ -560,7 +562,7 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
560
562
|
fail("query.too-large", { start: 0, end: text6.length });
|
|
561
563
|
const tokens = tokensOf(text6, fail);
|
|
562
564
|
let at = 0;
|
|
563
|
-
let
|
|
565
|
+
let count7 = 0;
|
|
564
566
|
let depth = 0;
|
|
565
567
|
const peek = /* @__PURE__ */ __name(() => tokens[at], "peek");
|
|
566
568
|
const take = /* @__PURE__ */ __name(() => tokens[at++], "take");
|
|
@@ -570,7 +572,7 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
570
572
|
return take();
|
|
571
573
|
}, "expect");
|
|
572
574
|
const built = /* @__PURE__ */ __name((node) => {
|
|
573
|
-
if (++
|
|
575
|
+
if (++count7 > QUERY_LIMITS.nodes)
|
|
574
576
|
fail("query.too-large", node.span);
|
|
575
577
|
return node;
|
|
576
578
|
}, "built");
|
|
@@ -731,7 +733,7 @@ var implicitTextTerms = /* @__PURE__ */ __name((text6) => {
|
|
|
731
733
|
return new Set(tokens.flatMap((token, index) => (token.kind === "term" || token.kind === "number") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index - 1]?.kind ?? "") && ![":", "=", "<", ">", "<=", ">="].includes(tokens[index + 1]?.kind ?? "") ? [token.span.start] : []));
|
|
732
734
|
}, "implicitTextTerms");
|
|
733
735
|
|
|
734
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
736
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/registry.js
|
|
735
737
|
var describeQuery = /* @__PURE__ */ __name((registry) => ({
|
|
736
738
|
entity: registry.entity,
|
|
737
739
|
backend: registry.backend,
|
|
@@ -802,7 +804,7 @@ var QUERY_REASONS = defineReasons([
|
|
|
802
804
|
details: [...SPAN, ...details]
|
|
803
805
|
})));
|
|
804
806
|
|
|
805
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
807
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/evaluate.js
|
|
806
808
|
var wordsOf = /* @__PURE__ */ __name((text6) => text6.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
|
|
807
809
|
var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
|
|
808
810
|
var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
|
|
@@ -828,10 +830,10 @@ var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
|
|
|
828
830
|
return (lower === "*" || (lowerInclusive ? number2 >= Number(lower) : number2 > Number(lower))) && (upper === "*" || (upperInclusive ? number2 <= Number(upper) : number2 < Number(upper)));
|
|
829
831
|
}
|
|
830
832
|
case "time": {
|
|
831
|
-
const
|
|
833
|
+
const time2 = Date.parse(text6);
|
|
832
834
|
const [lower, upper, lowerInclusive, upperInclusive] = node.operator === "range" ? [node.value, node.upper ?? "*", node.lower_inclusive ?? true, node.upper_inclusive ?? true] : [node.value, node.value, true, true];
|
|
833
835
|
const range = dateRange(lower, upper, lowerInclusive, upperInclusive, options.zone ?? "UTC", node.span, options.now);
|
|
834
|
-
return (range.lower === void 0 || (range.lower_inclusive ?
|
|
836
|
+
return (range.lower === void 0 || (range.lower_inclusive ? time2 >= range.lower : time2 > range.lower)) && (range.upper === void 0 || (range.upper_inclusive ? time2 <= range.upper : time2 < range.upper));
|
|
835
837
|
}
|
|
836
838
|
default:
|
|
837
839
|
return node.operator === "wildcard" ? pattern(node.value).test(text6) : text6.toLowerCase() === node.value.toLowerCase();
|
|
@@ -855,9 +857,9 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
|
|
|
855
857
|
const value = item[node.field];
|
|
856
858
|
return Array.isArray(value) ? value.some((one) => matchOne(field, node, one, options)) : matchOne(field, node, value, options);
|
|
857
859
|
}, "matches");
|
|
858
|
-
var evaluate = /* @__PURE__ */ __name((ast,
|
|
860
|
+
var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
|
|
859
861
|
|
|
860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/reference.js
|
|
861
863
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
862
864
|
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
863
865
|
if (!Number.isSafeInteger(value) || value < minimum)
|
|
@@ -894,7 +896,7 @@ var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
|
|
|
894
896
|
}, "parseMeetingReference");
|
|
895
897
|
var canonicalMeetingReference = /* @__PURE__ */ __name((text6) => formatMeetingReference(parseMeetingReference(text6)), "canonicalMeetingReference");
|
|
896
898
|
|
|
897
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
899
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
898
900
|
var text = string();
|
|
899
901
|
var count = pipe(number(), integer(), minValue(0));
|
|
900
902
|
var MEETING_ISSUES = ["time_without_zone"];
|
|
@@ -959,7 +961,7 @@ var MEETING_QUERY = {
|
|
|
959
961
|
})
|
|
960
962
|
};
|
|
961
963
|
|
|
962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
964
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
|
|
963
965
|
var joinKeyOf = /* @__PURE__ */ __name((url) => {
|
|
964
966
|
const parsed = urlOf(url);
|
|
965
967
|
if (!parsed)
|
|
@@ -993,7 +995,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
|
|
|
993
995
|
}
|
|
994
996
|
}, "urlOf");
|
|
995
997
|
|
|
996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
998
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
|
|
997
999
|
var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
|
|
998
1000
|
var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
|
|
999
1001
|
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");
|
|
@@ -1026,7 +1028,7 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
|
|
|
1026
1028
|
return kept;
|
|
1027
1029
|
}, "entryMetadata");
|
|
1028
1030
|
|
|
1029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
|
|
1030
1032
|
import { createHash } from "node:crypto";
|
|
1031
1033
|
var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
|
|
1032
1034
|
reference: cue2.reference,
|
|
@@ -1040,7 +1042,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
|
|
|
1040
1042
|
text: cue2.text
|
|
1041
1043
|
})).digest("hex"), "meetingCueFingerprint");
|
|
1042
1044
|
|
|
1043
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
|
|
1044
1046
|
var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
|
|
1045
1047
|
var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
1046
1048
|
if (entry.recurrenceEndsAt !== null)
|
|
@@ -1063,7 +1065,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
|
1063
1065
|
return Math.max(entry.endsAt ?? start, start + 1) > window.from;
|
|
1064
1066
|
}, "entryInWindow");
|
|
1065
1067
|
|
|
1066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/answers.js
|
|
1067
1069
|
var text2 = string();
|
|
1068
1070
|
var count2 = pipe(number(), integer(), minValue(0));
|
|
1069
1071
|
var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
@@ -1298,7 +1300,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1298
1300
|
};
|
|
1299
1301
|
}, "meetingHitsList");
|
|
1300
1302
|
|
|
1301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1303
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
|
|
1302
1304
|
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text6) => text6.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
|
|
1303
1305
|
var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
|
|
1304
1306
|
if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
|
|
@@ -1322,7 +1324,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
|
|
|
1322
1324
|
};
|
|
1323
1325
|
}, "validateMeetingParticipantSearch");
|
|
1324
1326
|
|
|
1325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1327
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/reads.js
|
|
1326
1328
|
var MeetingError = class extends CliError {
|
|
1327
1329
|
static {
|
|
1328
1330
|
__name(this, "MeetingError");
|
|
@@ -1349,8 +1351,8 @@ var validateFilter = /* @__PURE__ */ __name((filter) => {
|
|
|
1349
1351
|
if (value !== void 0 && (!Number.isSafeInteger(value) || value < 0))
|
|
1350
1352
|
throw new MeetingError("validation_error", "expected a nonnegative integer");
|
|
1351
1353
|
}, "validateFilter");
|
|
1352
|
-
var meetingShow = /* @__PURE__ */ __name(async (store,
|
|
1353
|
-
const details = await store.meeting(positiveInteger(
|
|
1354
|
+
var meetingShow = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
1355
|
+
const details = await store.meeting(positiveInteger(id4));
|
|
1354
1356
|
if (!details || accountId !== void 0 && details.meeting.accountId !== accountId)
|
|
1355
1357
|
throw new MeetingError("not_found", "meeting not found");
|
|
1356
1358
|
return details;
|
|
@@ -1441,20 +1443,20 @@ var ownerOf = /* @__PURE__ */ __name(async (store, accountId) => {
|
|
|
1441
1443
|
throw new MeetingError("not_found", `meeting account ${accountId} is not in the store`);
|
|
1442
1444
|
return owner;
|
|
1443
1445
|
}, "ownerOf");
|
|
1444
|
-
var meetingDetailsAnswer = /* @__PURE__ */ __name(async (store,
|
|
1445
|
-
const details = await meetingShow(store,
|
|
1446
|
+
var meetingDetailsAnswer = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
1447
|
+
const details = await meetingShow(store, id4, accountId);
|
|
1446
1448
|
return { item: meetingDetailsItem(details, await ownerOf(store, details.meeting.accountId)) };
|
|
1447
1449
|
}, "meetingDetailsAnswer");
|
|
1448
|
-
var meetingTranscriptAnswer = /* @__PURE__ */ __name(async (store,
|
|
1449
|
-
const details = await meetingShow(store,
|
|
1450
|
+
var meetingTranscriptAnswer = /* @__PURE__ */ __name(async (store, id4, accountId, options = {}) => {
|
|
1451
|
+
const details = await meetingShow(store, id4, accountId);
|
|
1450
1452
|
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)));
|
|
1451
1453
|
}, "meetingTranscriptAnswer");
|
|
1452
|
-
var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store,
|
|
1453
|
-
const details = await meetingShow(store,
|
|
1454
|
+
var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id4, accountId) => {
|
|
1455
|
+
const details = await meetingShow(store, id4, accountId);
|
|
1454
1456
|
return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
|
|
1455
1457
|
}, "meetingSummaryAnswer");
|
|
1456
1458
|
|
|
1457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/export.js
|
|
1458
1460
|
var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
1459
1461
|
if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
|
|
1460
1462
|
throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
|
|
@@ -1497,10 +1499,10 @@ var transcriptsOf = /* @__PURE__ */ __name((details, transcriptId) => {
|
|
|
1497
1499
|
}
|
|
1498
1500
|
return details.transcripts.filter((part) => part.transcript.supersededAt === null && part.transcript.deletedAt === null);
|
|
1499
1501
|
}, "transcriptsOf");
|
|
1500
|
-
var exportMeeting = /* @__PURE__ */ __name(async (store,
|
|
1502
|
+
var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
1501
1503
|
if (options.format !== "markdown" && options.format !== "vtt")
|
|
1502
1504
|
throw new MeetingError("validation_error", "export format must be markdown or vtt");
|
|
1503
|
-
const details = await meetingShow(store,
|
|
1505
|
+
const details = await meetingShow(store, id4, options.accountId);
|
|
1504
1506
|
const transcripts = transcriptsOf(details, options.transcriptId);
|
|
1505
1507
|
let content;
|
|
1506
1508
|
if (options.format === "vtt") {
|
|
@@ -1550,8 +1552,8 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id3, options) => {
|
|
|
1550
1552
|
};
|
|
1551
1553
|
}, "exportMeeting");
|
|
1552
1554
|
|
|
1553
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1554
|
-
var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"
|
|
1555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/payment.js
|
|
1556
|
+
var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
1555
1557
|
var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
|
|
1556
1558
|
var PAYMENT_STATES = ["expected", "paid", "cancelled"];
|
|
1557
1559
|
var invalid2 = /* @__PURE__ */ __name((message) => {
|
|
@@ -1572,7 +1574,7 @@ var amountOf = /* @__PURE__ */ __name((value) => {
|
|
|
1572
1574
|
var dateOf = /* @__PURE__ */ __name((value) => {
|
|
1573
1575
|
const date = typeof value === "string" ? value.trim() : "";
|
|
1574
1576
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(date) || (/* @__PURE__ */ new Date(`${date}T00:00:00Z`)).toISOString().slice(0, 10) !== date)
|
|
1575
|
-
return invalid2("a payment's
|
|
1577
|
+
return invalid2("a payment's dates are ISO dates, such as 2026-10-31");
|
|
1576
1578
|
return date;
|
|
1577
1579
|
}, "dateOf");
|
|
1578
1580
|
var optionalText = /* @__PURE__ */ __name((value, what, limit) => {
|
|
@@ -1587,20 +1589,33 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
1587
1589
|
return invalid2(`a payment's ${what} is one of ${allowed.join(", ")}`);
|
|
1588
1590
|
return value;
|
|
1589
1591
|
}, "oneOf");
|
|
1590
|
-
var FIELDS = [
|
|
1592
|
+
var FIELDS = [
|
|
1593
|
+
"amount",
|
|
1594
|
+
"currency",
|
|
1595
|
+
"direction",
|
|
1596
|
+
"counterparty",
|
|
1597
|
+
"counterparty_name",
|
|
1598
|
+
"due_at",
|
|
1599
|
+
"state",
|
|
1600
|
+
"item",
|
|
1601
|
+
"paid_at"
|
|
1602
|
+
];
|
|
1591
1603
|
var validatePayment = /* @__PURE__ */ __name((input) => {
|
|
1592
1604
|
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
1593
1605
|
return invalid2("a payment is an object");
|
|
1594
1606
|
const raw = input;
|
|
1595
|
-
const
|
|
1596
|
-
if (
|
|
1597
|
-
return invalid2(`a payment has no field ${
|
|
1607
|
+
const unknown2 = Object.keys(raw).filter((key) => !FIELDS.includes(key));
|
|
1608
|
+
if (unknown2.length)
|
|
1609
|
+
return invalid2(`a payment has no field ${unknown2.join(", ")}; its fields are ${FIELDS.join(", ")}`);
|
|
1598
1610
|
const currency = typeof raw.currency === "string" ? raw.currency.trim().toUpperCase() : "";
|
|
1599
1611
|
if (!/^[A-Z]{3}$/.test(currency) || !CURRENCIES.has(currency))
|
|
1600
1612
|
return invalid2("a payment's currency is an ISO 4217 code, such as EUR or RUB");
|
|
1601
1613
|
const counterparty = optionalText(raw.counterparty, "counterparty", 80);
|
|
1602
1614
|
if (counterparty !== null && !COUNTERPARTY.test(counterparty))
|
|
1603
1615
|
return invalid2("a payment's counterparty is a person:, organization: or project: reference");
|
|
1616
|
+
const state = oneOf(raw.state, PAYMENT_STATES, "state");
|
|
1617
|
+
if (raw.paid_at != null && state !== "paid")
|
|
1618
|
+
return invalid2("only a paid payment has paid_at");
|
|
1604
1619
|
return {
|
|
1605
1620
|
amount: amountOf(raw.amount),
|
|
1606
1621
|
currency,
|
|
@@ -1608,8 +1623,10 @@ var validatePayment = /* @__PURE__ */ __name((input) => {
|
|
|
1608
1623
|
counterparty,
|
|
1609
1624
|
counterparty_name: optionalText(raw.counterparty_name, "counterparty name", 200),
|
|
1610
1625
|
due_at: raw.due_at === void 0 || raw.due_at === null ? null : dateOf(raw.due_at),
|
|
1611
|
-
state
|
|
1612
|
-
item: optionalText(raw.item, "item", 200)
|
|
1626
|
+
state,
|
|
1627
|
+
item: optionalText(raw.item, "item", 200),
|
|
1628
|
+
// Left out when absent, so a finding staged before the field keeps its fingerprint.
|
|
1629
|
+
...raw.paid_at == null ? {} : { paid_at: dateOf(raw.paid_at) }
|
|
1613
1630
|
};
|
|
1614
1631
|
}, "validatePayment");
|
|
1615
1632
|
var grouped = /* @__PURE__ */ __name((amount) => {
|
|
@@ -1629,13 +1646,13 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
|
|
|
1629
1646
|
return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
|
|
1630
1647
|
}, "paymentTitle");
|
|
1631
1648
|
|
|
1632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
1633
1650
|
import { createHash as createHash2 } from "node:crypto";
|
|
1634
1651
|
|
|
1635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1652
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
|
|
1636
1653
|
var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
1637
1654
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
|
|
1638
|
-
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone`);
|
|
1655
|
+
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
|
|
1639
1656
|
const date = value.slice(0, 10);
|
|
1640
1657
|
const instant = Date.parse(`${date}T00:00:00Z`);
|
|
1641
1658
|
if (!Number.isFinite(instant) || new Date(instant).toISOString().slice(0, 10) !== date)
|
|
@@ -1643,132 +1660,180 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
|
1643
1660
|
return new Date(value).toISOString();
|
|
1644
1661
|
}, "meetingTimestamp");
|
|
1645
1662
|
|
|
1646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
1647
1664
|
var TASK_TYPES = ["bug", "feature", "chore"];
|
|
1648
1665
|
var invalid3 = /* @__PURE__ */ __name((message) => {
|
|
1649
1666
|
throw new CliError("validation_error", message);
|
|
1650
1667
|
}, "invalid");
|
|
1651
|
-
var
|
|
1668
|
+
var findingText = /* @__PURE__ */ __name((value, limit) => {
|
|
1652
1669
|
if (typeof value !== "string" || !value.trim() || value.includes("\0") || value.length > limit)
|
|
1653
1670
|
return invalid3(`finding text must contain 1\u2013${limit} characters without NUL`);
|
|
1654
1671
|
return value.trim();
|
|
1655
|
-
}, "
|
|
1672
|
+
}, "findingText");
|
|
1656
1673
|
var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update(JSON.stringify(value)).digest("hex"), "findingHash");
|
|
1657
|
-
var
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1674
|
+
var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
|
|
1675
|
+
var findingWhere = /* @__PURE__ */ __name((of) => {
|
|
1676
|
+
const id4 = typeof of.id === "string" ? of.id : null;
|
|
1677
|
+
const kind = typeof of.kind === "string" ? of.kind : null;
|
|
1678
|
+
return {
|
|
1679
|
+
where: id4 || kind ? ` in ${[id4, kind && `(${kind})`].filter(Boolean).join(" ")}` : "",
|
|
1680
|
+
named: { ...id4 ? { finding: id4 } : {}, ...kind ? { kind } : {} }
|
|
1681
|
+
};
|
|
1682
|
+
}, "findingWhere");
|
|
1683
|
+
var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
|
|
1684
|
+
const unknown2 = Object.keys(value).filter((key) => !allowed.includes(key));
|
|
1685
|
+
if (!unknown2.length)
|
|
1686
|
+
return;
|
|
1687
|
+
const fields = unknown2.map(snakeCase);
|
|
1688
|
+
const takes = allowed.map(snakeCase);
|
|
1689
|
+
const { where, named } = findingWhere(of);
|
|
1690
|
+
throw new CliError("validation_error", `unknown ${noun} field${fields.length > 1 ? "s" : ""} ${fields.join(", ")}${where}; it takes ${takes.join(", ")}`, { reason: "finding.unknown-field", fields, allowed: takes, ...named });
|
|
1691
|
+
}, "findingFields");
|
|
1692
|
+
var findingNeeds = /* @__PURE__ */ __name((value, needed, noun) => {
|
|
1693
|
+
const missing = needed.filter((key) => value[key] === void 0);
|
|
1694
|
+
if (!missing.length)
|
|
1695
|
+
return;
|
|
1696
|
+
const fields = missing.map(snakeCase);
|
|
1697
|
+
const needs = needed.map(snakeCase);
|
|
1698
|
+
const { where, named } = findingWhere(value);
|
|
1699
|
+
throw new CliError("validation_error", `missing ${noun} field${fields.length > 1 ? "s" : ""} ${fields.join(", ")}${where}; it needs ${needs.join(", ")}`, { reason: "finding.missing-field", fields, needs, ...named });
|
|
1700
|
+
}, "findingNeeds");
|
|
1661
1701
|
var SUBJECT = /^(person|organization|project):[1-9]\d*$|^task:[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/;
|
|
1662
|
-
var
|
|
1702
|
+
var validEvidence = /* @__PURE__ */ __name((raw, rules) => {
|
|
1703
|
+
if (!Array.isArray(raw) || raw.length < 1 || raw.length > 8)
|
|
1704
|
+
return invalid3(`a finding requires 1\u20138 cited ${rules.cited}s`);
|
|
1705
|
+
const evidence = raw.map((item) => {
|
|
1706
|
+
if (!item || typeof item !== "object")
|
|
1707
|
+
return invalid3("finding evidence is a reference and fingerprint");
|
|
1708
|
+
findingFields(item, ["reference", "fingerprint"], rules.singular);
|
|
1709
|
+
if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
|
|
1710
|
+
return invalid3("evidence requires a reference and fingerprint");
|
|
1711
|
+
const reference2 = rules.reference(item.reference);
|
|
1712
|
+
if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
|
|
1713
|
+
return invalid3(`finding evidence requires exact ${rules.cited} references and fingerprints`);
|
|
1714
|
+
return { reference: reference2, fingerprint: item.fingerprint };
|
|
1715
|
+
}).sort((a, b) => a.reference.localeCompare(b.reference));
|
|
1716
|
+
if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
|
|
1717
|
+
return invalid3(`duplicate evidence ${rules.cited}`);
|
|
1718
|
+
return evidence;
|
|
1719
|
+
}, "validEvidence");
|
|
1720
|
+
var findingId = /* @__PURE__ */ __name((raw, ids2) => {
|
|
1721
|
+
const id4 = findingText(raw, 64);
|
|
1722
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(id4) || ids2.has(id4))
|
|
1723
|
+
return invalid3("finding IDs must be unique simple keys");
|
|
1724
|
+
ids2.add(id4);
|
|
1725
|
+
return id4;
|
|
1726
|
+
}, "findingId");
|
|
1727
|
+
var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
|
|
1728
|
+
if (!finding || typeof finding !== "object")
|
|
1729
|
+
return invalid3("a finding is an object");
|
|
1730
|
+
const id4 = findingId(finding.id, ids2);
|
|
1731
|
+
const project2 = finding.project === void 0 && rules.anySubject ? void 0 : findingText(finding.project, 64);
|
|
1732
|
+
if (project2 !== void 0 && !/^project:[1-9]\d*$/.test(project2))
|
|
1733
|
+
return invalid3("a finding names a project reference");
|
|
1734
|
+
if (finding.subject !== void 0 && (!rules.anySubject || !SUBJECT.test(findingText(finding.subject, 80))))
|
|
1735
|
+
return invalid3("a finding's subject is a person:, organization:, task: or project: reference");
|
|
1736
|
+
if (finding.kind === "task" && project2 === void 0 && !rules.inboxTasks)
|
|
1737
|
+
return invalid3("a task finding names the project the task goes in");
|
|
1738
|
+
const evidence = validEvidence(finding.evidence, rules);
|
|
1739
|
+
const base = {
|
|
1740
|
+
id: id4,
|
|
1741
|
+
...project2 === void 0 ? {} : { project: project2 },
|
|
1742
|
+
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
1743
|
+
evidence
|
|
1744
|
+
};
|
|
1745
|
+
if (finding.kind === "fact") {
|
|
1746
|
+
findingFields(finding, ["id", "project", "subject", "evidence", "kind", "type", "statement"], rules.singular);
|
|
1747
|
+
if (finding.type === "payment")
|
|
1748
|
+
return invalid3("a payment is a finding of kind payment; money is a payments row, not a fact");
|
|
1749
|
+
if (!FACT_TYPES.includes(finding.type))
|
|
1750
|
+
return invalid3("unknown fact finding type");
|
|
1751
|
+
return { ...base, kind: "fact", type: finding.type, statement: findingText(finding.statement, 2e3) };
|
|
1752
|
+
}
|
|
1753
|
+
if (finding.kind === "payment" && rules.payments) {
|
|
1754
|
+
findingFields(finding, ["id", "project", "subject", "evidence", "kind", "statement", "payment", "supersedes"], rules.singular);
|
|
1755
|
+
if (finding.supersedes !== void 0 && !/^invoice:[1-9]\d*$/.test(String(finding.supersedes)))
|
|
1756
|
+
return invalid3("a payment finding supersedes an invoice: reference, the expected payment it settles or voids");
|
|
1757
|
+
const payment = validatePayment(finding.payment);
|
|
1758
|
+
if (payment.state === "expected" && finding.supersedes !== void 0)
|
|
1759
|
+
return invalid3("an expected payment supersedes nothing; a paid or cancelled one supersedes its invoice");
|
|
1760
|
+
if (payment.state === "cancelled" && finding.supersedes === void 0)
|
|
1761
|
+
return invalid3("a cancelled payment names the invoice: it cancels in supersedes");
|
|
1762
|
+
if (payment.state === "expected" && !/^(person|organization):/.test(payment.counterparty ?? ""))
|
|
1763
|
+
return invalid3("an expected payment becomes an invoice, which names its counterparty as a person: or organization:");
|
|
1764
|
+
return {
|
|
1765
|
+
...base,
|
|
1766
|
+
kind: "payment",
|
|
1767
|
+
...finding.statement === void 0 ? {} : { statement: findingText(finding.statement, 2e3) },
|
|
1768
|
+
payment,
|
|
1769
|
+
...finding.supersedes === void 0 ? {} : { supersedes: finding.supersedes }
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
if (finding.kind !== "task")
|
|
1773
|
+
return invalid3(`a finding is a fact${rules.payments ? ", payment" : ""} or task`);
|
|
1774
|
+
findingFields(finding, [
|
|
1775
|
+
"id",
|
|
1776
|
+
"project",
|
|
1777
|
+
"evidence",
|
|
1778
|
+
"kind",
|
|
1779
|
+
"type",
|
|
1780
|
+
"title",
|
|
1781
|
+
"reason",
|
|
1782
|
+
"commitment",
|
|
1783
|
+
"dueAt",
|
|
1784
|
+
"dueEvidence",
|
|
1785
|
+
"assignee",
|
|
1786
|
+
"assigneeEvidence"
|
|
1787
|
+
], rules.singular);
|
|
1788
|
+
if (!TASK_TYPES.includes(finding.type))
|
|
1789
|
+
return invalid3("a task finding type is bug, chore or feature");
|
|
1790
|
+
if (!["explicit", "inferred"].includes(finding.commitment))
|
|
1791
|
+
return invalid3("task commitment must be explicit or inferred");
|
|
1792
|
+
if (finding.dueAt === void 0 !== (finding.dueEvidence === void 0))
|
|
1793
|
+
return invalid3(`due_at comes with due_evidence: the ${rules.cited} references of this finding's evidence that give the date, as a list of strings such as ["<reference>"]`);
|
|
1794
|
+
if (finding.assignee === void 0 !== (finding.assigneeEvidence === void 0))
|
|
1795
|
+
return invalid3(`assignee comes with assignee_evidence: the ${rules.cited} references of this finding's evidence that name them, as a list of strings such as ["<reference>"]`);
|
|
1796
|
+
if (finding.assignee !== void 0 && (typeof finding.assignee !== "string" || !/^person:[1-9]\d*$/.test(finding.assignee)))
|
|
1797
|
+
return invalid3("an assignee must be a person reference");
|
|
1798
|
+
return {
|
|
1799
|
+
...base,
|
|
1800
|
+
kind: "task",
|
|
1801
|
+
type: finding.type,
|
|
1802
|
+
title: findingText(finding.title, 300),
|
|
1803
|
+
reason: findingText(finding.reason, 2e3),
|
|
1804
|
+
commitment: finding.commitment,
|
|
1805
|
+
...finding.dueAt === void 0 ? {} : {
|
|
1806
|
+
dueAt: meetingTimestamp(finding.dueAt, "a task's due_at"),
|
|
1807
|
+
dueEvidence: support(finding.dueEvidence, evidence, "due_evidence")
|
|
1808
|
+
},
|
|
1809
|
+
...finding.assignee === void 0 ? {} : {
|
|
1810
|
+
assignee: finding.assignee,
|
|
1811
|
+
assigneeEvidence: support(finding.assigneeEvidence, evidence, "assignee_evidence")
|
|
1812
|
+
}
|
|
1813
|
+
};
|
|
1814
|
+
}, "validateFinding");
|
|
1815
|
+
var support = /* @__PURE__ */ __name((value, evidence, field) => {
|
|
1816
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref) => typeof ref !== "string" || !evidence.some((item) => item.reference === ref)))
|
|
1817
|
+
return invalid3(`${field} lists 1\u20138 references this finding's evidence cites, as plain strings such as ["<reference>"], not evidence objects`);
|
|
1818
|
+
return [...new Set(value)].sort();
|
|
1819
|
+
}, "support");
|
|
1820
|
+
var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
|
|
1663
1821
|
if (!input || typeof input !== "object" || Buffer.byteLength(JSON.stringify(input), "utf8") > 65536)
|
|
1664
1822
|
return invalid3(`${rules.plural} take at most 65536 UTF-8 bytes`);
|
|
1665
|
-
|
|
1666
|
-
if (input.schemaVersion !== 1 || !Array.isArray(input.findings) || input.findings.length < 1 || input.findings.length >
|
|
1667
|
-
return invalid3(`schemaVersion 1 takes 1\
|
|
1668
|
-
const key =
|
|
1823
|
+
findingFields(input, ["schemaVersion", "key", "extractor", "findings"], rules.singular);
|
|
1824
|
+
if (input.schemaVersion !== 1 || !Array.isArray(input.findings) || input.findings.length < 1 || input.findings.length > most)
|
|
1825
|
+
return invalid3(`schemaVersion 1 takes 1\u2013${most} ${rules.plural}`);
|
|
1826
|
+
const key = findingText(input.key, 64);
|
|
1669
1827
|
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(key))
|
|
1670
1828
|
return invalid3("a findings key uses letters, digits, dot, colon, underscore or hyphen");
|
|
1671
1829
|
const ids2 = /* @__PURE__ */ new Set();
|
|
1672
|
-
const findings = input.findings.map((finding) =>
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
if (!/^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$/.test(id3) || ids2.has(id3))
|
|
1677
|
-
return invalid3("finding IDs must be unique simple keys");
|
|
1678
|
-
ids2.add(id3);
|
|
1679
|
-
const project = finding.project === void 0 && rules.anySubject ? void 0 : text3(finding.project, 64);
|
|
1680
|
-
if (project !== void 0 && !/^project:[1-9]\d*$/.test(project))
|
|
1681
|
-
return invalid3("a finding names a project reference");
|
|
1682
|
-
if (finding.subject !== void 0 && (!rules.anySubject || !SUBJECT.test(text3(finding.subject, 80))))
|
|
1683
|
-
return invalid3("a finding's subject is a person:, organization:, task: or project: reference");
|
|
1684
|
-
if (finding.kind === "task" && project === void 0)
|
|
1685
|
-
return invalid3("a task finding names the project the task goes in");
|
|
1686
|
-
if (!Array.isArray(finding.evidence) || finding.evidence.length < 1 || finding.evidence.length > 8)
|
|
1687
|
-
return invalid3(`a finding requires 1\u20138 cited ${rules.cited}s`);
|
|
1688
|
-
const evidence = finding.evidence.map((item) => {
|
|
1689
|
-
if (!item || typeof item !== "object")
|
|
1690
|
-
return invalid3("finding evidence is a reference and fingerprint");
|
|
1691
|
-
fields(item, ["reference", "fingerprint"], rules.singular);
|
|
1692
|
-
if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
|
|
1693
|
-
return invalid3("evidence requires a reference and fingerprint");
|
|
1694
|
-
const reference2 = rules.reference(item.reference);
|
|
1695
|
-
if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
|
|
1696
|
-
return invalid3(`finding evidence requires exact ${rules.cited} references and fingerprints`);
|
|
1697
|
-
return { reference: reference2, fingerprint: item.fingerprint };
|
|
1698
|
-
}).sort((a, b) => a.reference.localeCompare(b.reference));
|
|
1699
|
-
if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
|
|
1700
|
-
return invalid3(`duplicate evidence ${rules.cited}`);
|
|
1701
|
-
const base = {
|
|
1702
|
-
id: id3,
|
|
1703
|
-
...project === void 0 ? {} : { project },
|
|
1704
|
-
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
1705
|
-
evidence
|
|
1706
|
-
};
|
|
1707
|
-
if (finding.kind === "fact") {
|
|
1708
|
-
fields(finding, ["id", "project", "subject", "evidence", "kind", "type", "statement"], rules.singular);
|
|
1709
|
-
if (finding.type === "payment")
|
|
1710
|
-
return invalid3("a payment is a finding of kind payment");
|
|
1711
|
-
if (!FACT_TYPES.includes(finding.type))
|
|
1712
|
-
return invalid3("unknown fact finding type");
|
|
1713
|
-
return { ...base, kind: "fact", type: finding.type, statement: text3(finding.statement, 2e3) };
|
|
1714
|
-
}
|
|
1715
|
-
if (finding.kind === "payment" && rules.payments) {
|
|
1716
|
-
fields(finding, ["id", "project", "subject", "evidence", "kind", "statement", "payment", "supersedes"], rules.singular);
|
|
1717
|
-
if (finding.supersedes !== void 0 && !/^fact:[1-9]\d*$/.test(String(finding.supersedes)))
|
|
1718
|
-
return invalid3("a payment finding supersedes a fact: reference");
|
|
1719
|
-
return {
|
|
1720
|
-
...base,
|
|
1721
|
-
kind: "payment",
|
|
1722
|
-
...finding.statement === void 0 ? {} : { statement: text3(finding.statement, 2e3) },
|
|
1723
|
-
payment: validatePayment(finding.payment),
|
|
1724
|
-
...finding.supersedes === void 0 ? {} : { supersedes: finding.supersedes }
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
if (finding.kind !== "task")
|
|
1728
|
-
return invalid3(`a finding is a fact${rules.payments ? ", payment" : ""} or task`);
|
|
1729
|
-
fields(finding, [
|
|
1730
|
-
"id",
|
|
1731
|
-
"project",
|
|
1732
|
-
"evidence",
|
|
1733
|
-
"kind",
|
|
1734
|
-
"type",
|
|
1735
|
-
"title",
|
|
1736
|
-
"reason",
|
|
1737
|
-
"commitment",
|
|
1738
|
-
"dueAt",
|
|
1739
|
-
"dueEvidence",
|
|
1740
|
-
"assignee",
|
|
1741
|
-
"assigneeEvidence"
|
|
1742
|
-
], rules.singular);
|
|
1743
|
-
if (!TASK_TYPES.includes(finding.type))
|
|
1744
|
-
return invalid3("a task finding type is bug, chore or feature");
|
|
1745
|
-
if (!["explicit", "inferred"].includes(finding.commitment))
|
|
1746
|
-
return invalid3("task commitment must be explicit or inferred");
|
|
1747
|
-
const support = /* @__PURE__ */ __name((value) => {
|
|
1748
|
-
if (!Array.isArray(value) || value.length < 1 || value.length > 8 || value.some((ref) => typeof ref !== "string" || !evidence.some((item) => item.reference === ref)))
|
|
1749
|
-
return invalid3("date and assignee support must cite the finding's evidence");
|
|
1750
|
-
return [...new Set(value)].sort();
|
|
1751
|
-
}, "support");
|
|
1752
|
-
if (finding.dueAt === void 0 !== (finding.dueEvidence === void 0) || finding.assignee === void 0 !== (finding.assigneeEvidence === void 0))
|
|
1753
|
-
return invalid3("optional dates and assignees require their supporting evidence");
|
|
1754
|
-
if (finding.assignee !== void 0 && (typeof finding.assignee !== "string" || !/^person:[1-9]\d*$/.test(finding.assignee)))
|
|
1755
|
-
return invalid3("an assignee must be a person reference");
|
|
1756
|
-
return {
|
|
1757
|
-
...base,
|
|
1758
|
-
kind: "task",
|
|
1759
|
-
type: finding.type,
|
|
1760
|
-
title: text3(finding.title, 300),
|
|
1761
|
-
reason: text3(finding.reason, 2e3),
|
|
1762
|
-
commitment: finding.commitment,
|
|
1763
|
-
...finding.dueAt === void 0 ? {} : { dueAt: meetingTimestamp(finding.dueAt, "finding due date"), dueEvidence: support(finding.dueEvidence) },
|
|
1764
|
-
...finding.assignee === void 0 ? {} : { assignee: finding.assignee, assigneeEvidence: support(finding.assigneeEvidence) }
|
|
1765
|
-
};
|
|
1766
|
-
});
|
|
1767
|
-
return { schemaVersion: 1, key, extractor: text3(input.extractor, 200), findings };
|
|
1768
|
-
}, "validateFindings");
|
|
1830
|
+
const findings = input.findings.map((finding) => one(finding, ids2));
|
|
1831
|
+
return { schemaVersion: 1, key, extractor: findingText(input.extractor, 200), findings };
|
|
1832
|
+
}, "validateBatch");
|
|
1833
|
+
var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
|
|
1769
1834
|
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
1770
1835
|
|
|
1771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/findings.js
|
|
1772
1837
|
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
1773
1838
|
var cue = /* @__PURE__ */ __name((raw) => {
|
|
1774
1839
|
const reference2 = canonicalMeetingReference(raw);
|
|
@@ -1779,24 +1844,24 @@ var cue = /* @__PURE__ */ __name((raw) => {
|
|
|
1779
1844
|
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
1780
1845
|
var meetingFindingFingerprint = findingFingerprint;
|
|
1781
1846
|
|
|
1782
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1783
|
-
var
|
|
1784
|
-
var identifier = pipe(
|
|
1785
|
-
var nullableText = nullable(
|
|
1847
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
|
|
1848
|
+
var text3 = string();
|
|
1849
|
+
var identifier = pipe(text3, minLength(1));
|
|
1850
|
+
var nullableText = nullable(text3);
|
|
1786
1851
|
var count3 = pipe(number(), integer(), minValue(0));
|
|
1787
1852
|
var flag = boolean();
|
|
1788
|
-
var scope = strictObject({ provider:
|
|
1853
|
+
var scope = strictObject({ provider: text3, account: text3 });
|
|
1789
1854
|
var run = strictObject({
|
|
1790
1855
|
meetings: count3,
|
|
1791
1856
|
participants: count3,
|
|
1792
1857
|
transcript_rows: count3,
|
|
1793
1858
|
summaries: count3,
|
|
1794
|
-
warnings: array(strictObject({ external_id:
|
|
1795
|
-
timezone: optional(
|
|
1859
|
+
warnings: array(strictObject({ external_id: text3, message: text3 })),
|
|
1860
|
+
timezone: optional(text3)
|
|
1796
1861
|
});
|
|
1797
1862
|
var exported = union([
|
|
1798
|
-
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), filename:
|
|
1799
|
-
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), output:
|
|
1863
|
+
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), filename: text3, content: text3 }),
|
|
1864
|
+
strictObject({ meeting_id: identifier, format: picklist(["markdown", "vtt"]), output: text3 })
|
|
1800
1865
|
]);
|
|
1801
1866
|
var eventChange = strictObject({
|
|
1802
1867
|
action: literal("event.link"),
|
|
@@ -1806,7 +1871,7 @@ var eventChange = strictObject({
|
|
|
1806
1871
|
var personChange = strictObject({
|
|
1807
1872
|
action: literal("person.link"),
|
|
1808
1873
|
participant_id: identifier,
|
|
1809
|
-
person_uid:
|
|
1874
|
+
person_uid: text3,
|
|
1810
1875
|
expected_person_uid: optional(nullableText),
|
|
1811
1876
|
target_account_ids: optional(array(identifier))
|
|
1812
1877
|
});
|
|
@@ -1819,7 +1884,7 @@ var eventResult = strictObject({
|
|
|
1819
1884
|
var personResult = strictObject({
|
|
1820
1885
|
meeting_id: identifier,
|
|
1821
1886
|
participant_id: identifier,
|
|
1822
|
-
person_uid:
|
|
1887
|
+
person_uid: text3,
|
|
1823
1888
|
previous_person_uid: nullableText,
|
|
1824
1889
|
changed: flag
|
|
1825
1890
|
});
|
|
@@ -1832,23 +1897,23 @@ var meetingChange = strictObject({
|
|
|
1832
1897
|
result: optional(union([eventResult, personResult]))
|
|
1833
1898
|
});
|
|
1834
1899
|
var recognition = strictObject({
|
|
1835
|
-
engine:
|
|
1836
|
-
model:
|
|
1837
|
-
version: optional(
|
|
1900
|
+
engine: text3,
|
|
1901
|
+
model: text3,
|
|
1902
|
+
version: optional(text3),
|
|
1838
1903
|
timing: optional(picklist(["fixed-windows", "recognition-segments"]))
|
|
1839
1904
|
});
|
|
1840
1905
|
var transcription = union([
|
|
1841
1906
|
strictObject({
|
|
1842
1907
|
applied: literal(false),
|
|
1843
1908
|
account_id: identifier,
|
|
1844
|
-
external_id:
|
|
1909
|
+
external_id: text3,
|
|
1845
1910
|
segments: count3,
|
|
1846
1911
|
media: strictObject({
|
|
1847
|
-
id:
|
|
1848
|
-
content_hash:
|
|
1912
|
+
id: text3,
|
|
1913
|
+
content_hash: text3,
|
|
1849
1914
|
size: count3,
|
|
1850
1915
|
duration_ms: count3,
|
|
1851
|
-
format:
|
|
1916
|
+
format: text3,
|
|
1852
1917
|
sample_rate: count3,
|
|
1853
1918
|
channels: count3,
|
|
1854
1919
|
recognition
|
|
@@ -1857,21 +1922,21 @@ var transcription = union([
|
|
|
1857
1922
|
strictObject({
|
|
1858
1923
|
applied: literal(true),
|
|
1859
1924
|
account_id: identifier,
|
|
1860
|
-
external_id:
|
|
1925
|
+
external_id: text3,
|
|
1861
1926
|
meeting_id: identifier,
|
|
1862
1927
|
created: flag,
|
|
1863
1928
|
inserted_transcripts: count3,
|
|
1864
1929
|
replayed_transcripts: count3,
|
|
1865
1930
|
superseded_transcripts: count3,
|
|
1866
1931
|
segments: count3,
|
|
1867
|
-
media_sha256:
|
|
1868
|
-
engine:
|
|
1869
|
-
model:
|
|
1932
|
+
media_sha256: text3,
|
|
1933
|
+
engine: text3,
|
|
1934
|
+
model: text3,
|
|
1870
1935
|
model_version: nullableText,
|
|
1871
1936
|
timing: picklist(["fixed-windows", "recognition-segments"])
|
|
1872
1937
|
})
|
|
1873
1938
|
]);
|
|
1874
|
-
var embeddingModel = strictObject({ key:
|
|
1939
|
+
var embeddingModel = strictObject({ key: text3, dims: count3, kind: picklist(["local", "remote"]), model: text3 });
|
|
1875
1940
|
var embedding = union([
|
|
1876
1941
|
strictObject({
|
|
1877
1942
|
account_id: identifier,
|
|
@@ -1887,7 +1952,7 @@ var embedding = union([
|
|
|
1887
1952
|
saved: count3,
|
|
1888
1953
|
skipped: count3,
|
|
1889
1954
|
has_more: flag,
|
|
1890
|
-
next_hash: optional(
|
|
1955
|
+
next_hash: optional(text3),
|
|
1891
1956
|
applied: literal(true),
|
|
1892
1957
|
rebuild: strictObject({
|
|
1893
1958
|
transcripts: count3,
|
|
@@ -1912,7 +1977,7 @@ var MEETING_RESULT_ENTITIES = {
|
|
|
1912
1977
|
meeting_repair: repair
|
|
1913
1978
|
};
|
|
1914
1979
|
|
|
1915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
|
|
1916
1981
|
var EVENT_QUERY = defineQuery({
|
|
1917
1982
|
entity: "event",
|
|
1918
1983
|
backend: "sql",
|
|
@@ -1928,7 +1993,7 @@ var EVENT_QUERY = defineQuery({
|
|
|
1928
1993
|
]
|
|
1929
1994
|
});
|
|
1930
1995
|
|
|
1931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/events.js
|
|
1932
1997
|
var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now()) => {
|
|
1933
1998
|
const current = await store.meeting(details.meeting.id);
|
|
1934
1999
|
if (!current)
|
|
@@ -1943,7 +2008,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now())
|
|
|
1943
2008
|
endsAt: meeting2.endedAt ?? meeting2.startedAt
|
|
1944
2009
|
});
|
|
1945
2010
|
if (candidates.length > 1) {
|
|
1946
|
-
await store.reviewMeetingLink?.(meeting2.id, candidates.map(({ id:
|
|
2011
|
+
await store.reviewMeetingLink?.(meeting2.id, candidates.map(({ id: id4 }) => id4), now);
|
|
1947
2012
|
return null;
|
|
1948
2013
|
}
|
|
1949
2014
|
let event2 = candidates[0];
|
|
@@ -1971,7 +2036,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now())
|
|
|
1971
2036
|
return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
|
|
1972
2037
|
}, "linkEvent");
|
|
1973
2038
|
|
|
1974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
1975
2040
|
var context = {
|
|
1976
2041
|
command: "search meetings",
|
|
1977
2042
|
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
@@ -2034,7 +2099,7 @@ var MEETING_FIELDS = defineQuery({
|
|
|
2034
2099
|
});
|
|
2035
2100
|
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
2036
2101
|
|
|
2037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/language.js
|
|
2038
2103
|
var LATIN_WORDS = {
|
|
2039
2104
|
en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
|
|
2040
2105
|
es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
|
|
@@ -2083,7 +2148,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
|
|
|
2083
2148
|
return null;
|
|
2084
2149
|
}, "transcriptLanguage");
|
|
2085
2150
|
|
|
2086
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
|
|
2087
2152
|
var contentHash = /* @__PURE__ */ __name(async (text6) => {
|
|
2088
2153
|
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text6));
|
|
2089
2154
|
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -2114,13 +2179,13 @@ var transcriptInput = /* @__PURE__ */ __name(async (lines, participants, source,
|
|
|
2114
2179
|
}))
|
|
2115
2180
|
}), "transcriptInput");
|
|
2116
2181
|
var timestamp2 = /* @__PURE__ */ __name((value) => {
|
|
2117
|
-
const
|
|
2118
|
-
if (!Number.isFinite(
|
|
2182
|
+
const time2 = Date.parse(value);
|
|
2183
|
+
if (!Number.isFinite(time2))
|
|
2119
2184
|
throw new Error("Invalid meeting timestamp");
|
|
2120
|
-
return
|
|
2185
|
+
return time2;
|
|
2121
2186
|
}, "timestamp");
|
|
2122
2187
|
|
|
2123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
|
|
2124
2189
|
var TranscriptTextError = class extends Error {
|
|
2125
2190
|
static {
|
|
2126
2191
|
__name(this, "TranscriptTextError");
|
|
@@ -2175,7 +2240,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
|
2175
2240
|
return { header, lines };
|
|
2176
2241
|
}, "parseTranscriptText");
|
|
2177
2242
|
|
|
2178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
|
|
2179
2244
|
var VttError = class extends Error {
|
|
2180
2245
|
static {
|
|
2181
2246
|
__name(this, "VttError");
|
|
@@ -2227,7 +2292,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
|
2227
2292
|
return cues;
|
|
2228
2293
|
}, "parseVtt");
|
|
2229
2294
|
|
|
2230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/import.js
|
|
2231
2296
|
var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
|
|
2232
2297
|
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
2233
2298
|
for (const file of files) {
|
|
@@ -2260,10 +2325,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
|
|
|
2260
2325
|
return report;
|
|
2261
2326
|
}, "importFiles");
|
|
2262
2327
|
|
|
2263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/links.js
|
|
2264
2329
|
var CHAT_MESSAGES_READ = 1e5;
|
|
2265
2330
|
|
|
2266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
|
|
2267
2332
|
var nonempty = /* @__PURE__ */ __name((value, name) => {
|
|
2268
2333
|
if (typeof value !== "string" || !value.trim())
|
|
2269
2334
|
throw new CliError("validation_error", `${name} must be nonempty`);
|
|
@@ -2314,7 +2379,7 @@ var validateMeetingChange = /* @__PURE__ */ __name((change, create) => {
|
|
|
2314
2379
|
return Object.freeze(result);
|
|
2315
2380
|
}, "validateMeetingChange");
|
|
2316
2381
|
|
|
2317
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
2318
2383
|
var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
|
|
2319
2384
|
const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
|
|
2320
2385
|
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)))
|
|
@@ -2327,7 +2392,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
|
|
|
2327
2392
|
throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
|
|
2328
2393
|
}, "validateMeetingPassage");
|
|
2329
2394
|
|
|
2330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
|
|
2331
2396
|
var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
2332
2397
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
2333
2398
|
throw new CliError("validation_error", "meeting preparation context is required");
|
|
@@ -2352,7 +2417,7 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
|
2352
2417
|
return { ...input, limit, maxReadBytes };
|
|
2353
2418
|
}, "validateMeetingPreparationContext");
|
|
2354
2419
|
|
|
2355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
|
|
2356
2421
|
var count4 = pipe(number(), integer(), minValue(0));
|
|
2357
2422
|
var id = pipe(string(), minLength(1));
|
|
2358
2423
|
var meetingProjectEvidence = strictObject({
|
|
@@ -2473,7 +2538,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
|
|
|
2473
2538
|
};
|
|
2474
2539
|
}, "meetingProjectEvidenceAnswer");
|
|
2475
2540
|
|
|
2476
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2541
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
|
|
2477
2542
|
var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
2478
2543
|
const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
|
|
2479
2544
|
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) || [
|
|
@@ -2493,7 +2558,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
|
2493
2558
|
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
2494
2559
|
}, "validateMeetingHitSearch");
|
|
2495
2560
|
|
|
2496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
|
|
2497
2562
|
var ids = {
|
|
2498
2563
|
meeting_id: "meetingId",
|
|
2499
2564
|
identity_id: "participantIdentityId",
|
|
@@ -2529,8 +2594,8 @@ var MEETING_PROJECT_EVIDENCE_QUERY = defineQuery({
|
|
|
2529
2594
|
]
|
|
2530
2595
|
});
|
|
2531
2596
|
var requestKeys = /* @__PURE__ */ new Set(["query", "limit", "cursor", "maxReadBytes", "signal"]);
|
|
2532
|
-
var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((
|
|
2533
|
-
if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof
|
|
2597
|
+
var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request = {}, now = Date.now()) => {
|
|
2598
|
+
if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof project2 !== "string" || !project2.trim() || project2.length > 200 || /[\p{Cc}\p{Cf}]/u.test(project2) || request.query !== void 0 && typeof request.query !== "string")
|
|
2534
2599
|
throw new CliError("validation_error", "expected an existing project and bounded evidence arguments");
|
|
2535
2600
|
if (request.query !== void 0 && new TextEncoder().encode(request.query).byteLength > 8192 || [request.limit, request.maxReadBytes].some((value) => value !== void 0 && typeof value !== "number"))
|
|
2536
2601
|
throw new CliError("validation_error", "invalid project evidence query or budget");
|
|
@@ -2578,26 +2643,26 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {
|
|
|
2578
2643
|
options.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
2579
2644
|
frozen.push(`started_at:[${options.since === void 0 ? "*" : `"${new Date(options.since).toISOString()}"`} TO ${options.until === void 0 ? "*" : `"${new Date(options.until).toISOString()}"`}]`);
|
|
2580
2645
|
}
|
|
2581
|
-
validateMeetingHitSearch(
|
|
2646
|
+
validateMeetingHitSearch(project2, options);
|
|
2582
2647
|
if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !/^[A-Za-z0-9_-]{1,4096}$/.test(options.cursor)))
|
|
2583
2648
|
throw new CliError("validation_error", "invalid project evidence cursor");
|
|
2584
|
-
return { project:
|
|
2649
|
+
return { project: project2.trim(), options, query: frozen.join(" AND ") };
|
|
2585
2650
|
}, "prepareMeetingProjectEvidence");
|
|
2586
2651
|
|
|
2587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2588
|
-
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read,
|
|
2589
|
-
const prepared = prepareMeetingProjectEvidence(
|
|
2652
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
|
|
2653
|
+
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, request = {}, now = Date.now()) => {
|
|
2654
|
+
const prepared = prepareMeetingProjectEvidence(project2, request, now);
|
|
2590
2655
|
const page = await read(prepared.project, prepared.options);
|
|
2591
2656
|
prepared.options.signal?.throwIfAborted();
|
|
2592
2657
|
return meetingProjectEvidenceAnswer(page, prepared);
|
|
2593
2658
|
}, "readMeetingProjectEvidence");
|
|
2594
2659
|
|
|
2595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/pull.js
|
|
2596
2661
|
var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
|
|
2597
|
-
const { identityExternalId, ...
|
|
2662
|
+
const { identityExternalId, ...fields } = p;
|
|
2598
2663
|
const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
|
|
2599
2664
|
return {
|
|
2600
|
-
...
|
|
2665
|
+
...fields,
|
|
2601
2666
|
identity: {
|
|
2602
2667
|
provider,
|
|
2603
2668
|
externalId,
|
|
@@ -2619,20 +2684,20 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2619
2684
|
const from = timestamp2(since) - lookbackMs;
|
|
2620
2685
|
const meetings = await source.meetings(lookbackMs === 0 ? since : new Date(from).toISOString());
|
|
2621
2686
|
for (const m of meetings) {
|
|
2622
|
-
const
|
|
2687
|
+
const id4 = m.occurrence.id;
|
|
2623
2688
|
const read = /* @__PURE__ */ __name(async (part, call) => {
|
|
2624
2689
|
try {
|
|
2625
2690
|
return await call();
|
|
2626
2691
|
} catch (error) {
|
|
2627
2692
|
failed = true;
|
|
2628
2693
|
const message = error instanceof Error ? error.message : "could not be read";
|
|
2629
|
-
report.warnings.push({ externalId:
|
|
2694
|
+
report.warnings.push({ externalId: id4, message: `${part}: ${message}` });
|
|
2630
2695
|
return void 0;
|
|
2631
2696
|
}
|
|
2632
2697
|
}, "read");
|
|
2633
2698
|
try {
|
|
2634
|
-
const sourceParticipants = await read("participants", () => source.participants(
|
|
2635
|
-
const participants = (sourceParticipants ?? []).map((p, i) => participantInput(p, source.provider,
|
|
2699
|
+
const sourceParticipants = await read("participants", () => source.participants(id4));
|
|
2700
|
+
const participants = (sourceParticipants ?? []).map((p, i) => participantInput(p, source.provider, id4, i, options.accountId));
|
|
2636
2701
|
const names = /* @__PURE__ */ new Map();
|
|
2637
2702
|
for (const p of participants)
|
|
2638
2703
|
if (p.displayName !== null) {
|
|
@@ -2641,18 +2706,18 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
2641
2706
|
names.set(p.displayName, identities);
|
|
2642
2707
|
}
|
|
2643
2708
|
if ([...names.values()].some((ids2) => ids2.size > 1))
|
|
2644
|
-
report.warnings.push({ externalId:
|
|
2645
|
-
const lines = await read("transcript", () => source.transcript(
|
|
2646
|
-
const chat = await read("chat", () => source.chat(
|
|
2647
|
-
const summary = await read("summary", () => source.summary(
|
|
2648
|
-
const attachments = await read("files", () => source.files(
|
|
2709
|
+
report.warnings.push({ externalId: id4, message: "Participant names are ambiguous" });
|
|
2710
|
+
const lines = await read("transcript", () => source.transcript(id4));
|
|
2711
|
+
const chat = await read("chat", () => source.chat(id4));
|
|
2712
|
+
const summary = await read("summary", () => source.summary(id4));
|
|
2713
|
+
const attachments = await read("files", () => source.files(id4));
|
|
2649
2714
|
const startedAt = timestamp2(m.occurrence.startedAt);
|
|
2650
2715
|
const endedAt = m.occurrence.endedAt === null ? null : timestamp2(m.occurrence.endedAt);
|
|
2651
2716
|
if (endedAt !== null && endedAt < startedAt)
|
|
2652
2717
|
throw new Error("Meeting ends before it starts");
|
|
2653
2718
|
const meeting2 = {
|
|
2654
2719
|
accountId: options.accountId,
|
|
2655
|
-
externalId:
|
|
2720
|
+
externalId: id4,
|
|
2656
2721
|
title: m.occurrence.title,
|
|
2657
2722
|
description: m.description ?? null,
|
|
2658
2723
|
location: m.location ?? null,
|
|
@@ -2723,7 +2788,7 @@ unlinked`, format)],
|
|
|
2723
2788
|
report.summaries += summary ? 1 : 0;
|
|
2724
2789
|
} catch (error) {
|
|
2725
2790
|
failed = true;
|
|
2726
|
-
report.warnings.push({ externalId:
|
|
2791
|
+
report.warnings.push({ externalId: id4, message: error instanceof Error ? error.message : "Meeting pull failed" });
|
|
2727
2792
|
}
|
|
2728
2793
|
}
|
|
2729
2794
|
if (!failed)
|
|
@@ -2731,47 +2796,47 @@ unlinked`, format)],
|
|
|
2731
2796
|
return report;
|
|
2732
2797
|
}, "pull");
|
|
2733
2798
|
|
|
2734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2735
|
-
var
|
|
2799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
|
|
2800
|
+
var text4 = string();
|
|
2736
2801
|
var count5 = pipe(number(), integer(), minValue(0));
|
|
2737
2802
|
var id2 = pipe(number(), integer(), minValue(1));
|
|
2738
2803
|
var iso3 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
2739
2804
|
var meetingReview = strictObject({
|
|
2740
2805
|
ref: reference,
|
|
2741
2806
|
id: pipe(string(), minLength(1)),
|
|
2742
|
-
title: nullable(
|
|
2807
|
+
title: nullable(text4),
|
|
2743
2808
|
started_at: nullable(isoTime),
|
|
2744
2809
|
duration_ms: nullable(count5),
|
|
2745
2810
|
participants_count: nullable(count5),
|
|
2746
|
-
projects: array(
|
|
2811
|
+
projects: array(text4),
|
|
2747
2812
|
/** Null when the meeting has no current transcript. */
|
|
2748
2813
|
transcript: nullable(strictObject({ lines: count5, words: count5 })),
|
|
2749
2814
|
/** The three who talked longest. */
|
|
2750
|
-
speakers: array(strictObject({ name: nullable(
|
|
2815
|
+
speakers: array(strictObject({ name: nullable(text4), talk_ms: count5 })),
|
|
2751
2816
|
/** The newest stored summary; null when there is none. */
|
|
2752
2817
|
summary: nullable(strictObject({
|
|
2753
|
-
source:
|
|
2754
|
-
title: nullable(
|
|
2755
|
-
overview: nullable(
|
|
2756
|
-
next_steps: array(
|
|
2757
|
-
url: nullable(
|
|
2818
|
+
source: text4,
|
|
2819
|
+
title: nullable(text4),
|
|
2820
|
+
overview: nullable(text4),
|
|
2821
|
+
next_steps: array(text4),
|
|
2822
|
+
url: nullable(text4)
|
|
2758
2823
|
}))
|
|
2759
2824
|
});
|
|
2760
2825
|
var meetingLink = strictObject({
|
|
2761
|
-
url:
|
|
2762
|
-
domain: nullable(
|
|
2826
|
+
url: text4,
|
|
2827
|
+
domain: nullable(text4),
|
|
2763
2828
|
/** The Google Docs, Sheets, Slides, Forms or Drive file it names. */
|
|
2764
|
-
document_id: nullable(
|
|
2829
|
+
document_id: nullable(text4),
|
|
2765
2830
|
count: count5,
|
|
2766
2831
|
first_at: isoTime,
|
|
2767
2832
|
last_at: isoTime,
|
|
2768
|
-
senders: array(
|
|
2769
|
-
meetings: array(strictObject({ ref: reference, title: nullable(
|
|
2833
|
+
senders: array(text4),
|
|
2834
|
+
meetings: array(strictObject({ ref: reference, title: nullable(text4) }))
|
|
2770
2835
|
});
|
|
2771
2836
|
var meetingSpeaker = strictObject({
|
|
2772
2837
|
/** `person:<id>`, `identity:<id>`, `name:<lowercased name>` or `unknown`. */
|
|
2773
|
-
key:
|
|
2774
|
-
name: nullable(
|
|
2838
|
+
key: text4,
|
|
2839
|
+
name: nullable(text4),
|
|
2775
2840
|
person_id: nullable(id2),
|
|
2776
2841
|
identity_id: nullable(id2),
|
|
2777
2842
|
meetings: count5,
|
|
@@ -2782,27 +2847,44 @@ var meetingSpeaker = strictObject({
|
|
|
2782
2847
|
share: pipe(number(), minValue(0), maxValue(1))
|
|
2783
2848
|
});
|
|
2784
2849
|
var meetingStats = strictObject({
|
|
2785
|
-
time_zone:
|
|
2850
|
+
time_zone: text4,
|
|
2786
2851
|
meetings: count5,
|
|
2787
2852
|
lines: count5,
|
|
2788
2853
|
words: count5,
|
|
2789
2854
|
talk_ms: count5,
|
|
2790
2855
|
/** `week_start` is the Monday, as a date in `time_zone`. */
|
|
2791
|
-
weeks: array(strictObject({ week_start:
|
|
2856
|
+
weeks: array(strictObject({ week_start: text4, meetings: count5, talk_ms: count5 })),
|
|
2792
2857
|
top_speakers: array(meetingSpeaker)
|
|
2793
2858
|
});
|
|
2859
|
+
var meetingCountsRow = strictObject({
|
|
2860
|
+
key: text4,
|
|
2861
|
+
name: nullable(text4),
|
|
2862
|
+
meetings: count5,
|
|
2863
|
+
minutes: count5,
|
|
2864
|
+
mean_minutes: nullable(number()),
|
|
2865
|
+
transcripts: count5
|
|
2866
|
+
});
|
|
2867
|
+
var meetingCounts = strictObject({
|
|
2868
|
+
by: picklist(["day", "week", "series"]),
|
|
2869
|
+
meetings: count5,
|
|
2870
|
+
minutes: count5,
|
|
2871
|
+
mean_minutes: nullable(number()),
|
|
2872
|
+
transcripts: count5,
|
|
2873
|
+
rows: array(meetingCountsRow),
|
|
2874
|
+
has_more: boolean()
|
|
2875
|
+
});
|
|
2794
2876
|
var truncated = /* @__PURE__ */ __name((...why) => nullable(picklist(why)), "truncated");
|
|
2795
2877
|
var meetingParticipants = strictObject({
|
|
2796
2878
|
schema_version: literal(1),
|
|
2797
2879
|
kind: literal("meeting_participants"),
|
|
2798
2880
|
account_id: id2,
|
|
2799
|
-
query:
|
|
2881
|
+
query: text4,
|
|
2800
2882
|
items: array(strictObject({
|
|
2801
2883
|
participant_id: id2,
|
|
2802
2884
|
meeting_id: id2,
|
|
2803
2885
|
identity_id: id2,
|
|
2804
|
-
display_name: nullable(
|
|
2805
|
-
email: nullable(
|
|
2886
|
+
display_name: nullable(text4),
|
|
2887
|
+
email: nullable(text4)
|
|
2806
2888
|
})),
|
|
2807
2889
|
/** Several identities on one page are observations, never speaker attribution or person links. */
|
|
2808
2890
|
ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id2) }),
|
|
@@ -2816,7 +2898,7 @@ var meetingParticipants = strictObject({
|
|
|
2816
2898
|
mode: literal("cursor"),
|
|
2817
2899
|
limit: count5,
|
|
2818
2900
|
has_more: boolean(),
|
|
2819
|
-
next_cursor: optional(
|
|
2901
|
+
next_cursor: optional(text4)
|
|
2820
2902
|
})
|
|
2821
2903
|
});
|
|
2822
2904
|
var revision = picklist(["current", "superseded"]);
|
|
@@ -2825,8 +2907,8 @@ var meetingPassage = strictObject({
|
|
|
2825
2907
|
kind: literal("meeting_context"),
|
|
2826
2908
|
source: reference,
|
|
2827
2909
|
target_ref: reference,
|
|
2828
|
-
target_fingerprint:
|
|
2829
|
-
fingerprint:
|
|
2910
|
+
target_fingerprint: text4,
|
|
2911
|
+
fingerprint: text4,
|
|
2830
2912
|
revision,
|
|
2831
2913
|
limits: strictObject({ before: count5, after: count5, bytes: count5, max_read_bytes: count5 }),
|
|
2832
2914
|
content_bytes: count5,
|
|
@@ -2845,30 +2927,30 @@ var meetingPassage = strictObject({
|
|
|
2845
2927
|
}),
|
|
2846
2928
|
items: array(strictObject({
|
|
2847
2929
|
ref: reference,
|
|
2848
|
-
fingerprint:
|
|
2930
|
+
fingerprint: text4,
|
|
2849
2931
|
transcript_id: id2,
|
|
2850
|
-
content_hash: nullable(
|
|
2932
|
+
content_hash: nullable(text4),
|
|
2851
2933
|
position: count5,
|
|
2852
2934
|
start_ms: count5,
|
|
2853
2935
|
end_ms: count5,
|
|
2854
2936
|
speaker_participant_id: nullable(id2),
|
|
2855
|
-
speaker_name: nullable(
|
|
2856
|
-
text:
|
|
2937
|
+
speaker_name: nullable(text4),
|
|
2938
|
+
text: text4,
|
|
2857
2939
|
revision
|
|
2858
2940
|
}))
|
|
2859
2941
|
});
|
|
2860
2942
|
var event = strictObject({
|
|
2861
2943
|
id: pipe(string(), minLength(1)),
|
|
2862
|
-
event_series_id: nullable(
|
|
2863
|
-
title: nullable(
|
|
2864
|
-
description: nullable(
|
|
2865
|
-
location: nullable(
|
|
2944
|
+
event_series_id: nullable(text4),
|
|
2945
|
+
title: nullable(text4),
|
|
2946
|
+
description: nullable(text4),
|
|
2947
|
+
location: nullable(text4),
|
|
2866
2948
|
starts_at: nullable(isoTime),
|
|
2867
2949
|
ends_at: nullable(isoTime),
|
|
2868
|
-
timezone: nullable(
|
|
2950
|
+
timezone: nullable(text4),
|
|
2869
2951
|
/** `auto`: made from a meeting; `owner`: made by hand; `calendar`: from a calendar's entries. */
|
|
2870
2952
|
origin: picklist(["auto", "owner", "calendar"]),
|
|
2871
|
-
status: nullable(
|
|
2953
|
+
status: nullable(text4),
|
|
2872
2954
|
all_day: boolean(),
|
|
2873
2955
|
/** When its calendar deleted it: shown as "deleted in Google", kept as history. */
|
|
2874
2956
|
source_deleted_at: nullable(isoTime),
|
|
@@ -2876,7 +2958,7 @@ var event = strictObject({
|
|
|
2876
2958
|
created_at: isoTime,
|
|
2877
2959
|
updated_at: isoTime,
|
|
2878
2960
|
/** The fields whoever sent the invitation wrote, on a calendar CLI's `events list`: an agent reads them as data. */
|
|
2879
|
-
untrusted: optional(array(
|
|
2961
|
+
untrusted: optional(array(text4)),
|
|
2880
2962
|
/** On a calendar CLI's `events list changed:<date>`: what changed since then, and when the store saw it. */
|
|
2881
2963
|
change: optional(picklist(["new", "moved", "cancelled"])),
|
|
2882
2964
|
changed_at: optional(nullable(isoTime)),
|
|
@@ -2888,7 +2970,7 @@ var event = strictObject({
|
|
|
2888
2970
|
*/
|
|
2889
2971
|
overlapping: optional(boolean()),
|
|
2890
2972
|
/** With `overlapping:true`: the events it overlaps, as `event:<id>`. */
|
|
2891
|
-
overlaps: optional(array(
|
|
2973
|
+
overlaps: optional(array(text4))
|
|
2892
2974
|
});
|
|
2893
2975
|
var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
2894
2976
|
id: String(one.id),
|
|
@@ -2908,10 +2990,10 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
|
2908
2990
|
updated_at: new Date(one.updatedAt).toISOString()
|
|
2909
2991
|
}), "eventItem");
|
|
2910
2992
|
|
|
2911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2993
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
|
|
2912
2994
|
var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
|
|
2913
2995
|
|
|
2914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
|
|
2915
2997
|
var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
2916
2998
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
2917
2999
|
throw new CliError("validation_error", "related history request is required");
|
|
@@ -2922,7 +3004,7 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
2922
3004
|
const positive = /* @__PURE__ */ __name((value) => Number.isSafeInteger(value) && value > 0, "positive");
|
|
2923
3005
|
if (!positive(input.accountId) || !positive(input.seriesId))
|
|
2924
3006
|
throw new CliError("validation_error", "accountId and seriesId must be positive safe integers");
|
|
2925
|
-
if (!Array.isArray(input.anchorIds) || input.anchorIds.length > 20 || input.anchorIds.some((
|
|
3007
|
+
if (!Array.isArray(input.anchorIds) || input.anchorIds.length > 20 || input.anchorIds.some((id4) => !positive(id4)))
|
|
2926
3008
|
throw new CliError("validation_error", "anchorIds must contain at most 20 positive safe integers");
|
|
2927
3009
|
for (const key of ["after", "before"])
|
|
2928
3010
|
if (!Number.isSafeInteger(input[key]) || Math.abs(input[key]) > 864e13)
|
|
@@ -2941,14 +3023,14 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
2941
3023
|
return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
|
|
2942
3024
|
}, "validateMeetingRelatedHistory");
|
|
2943
3025
|
|
|
2944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/review.js
|
|
2945
3027
|
var REVIEW_LIMIT = { default: 50, most: 200 };
|
|
2946
3028
|
|
|
2947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
|
|
2948
3030
|
var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
|
|
2949
3031
|
\`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
|
|
2950
3032
|
|
|
2951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3033
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
|
|
2952
3034
|
var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
2953
3035
|
input.signal?.throwIfAborted();
|
|
2954
3036
|
if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
|
|
@@ -2969,19 +3051,19 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
|
2969
3051
|
return { ...input, limit, maxReadBytes };
|
|
2970
3052
|
}, "validateMeetingSeriesHistory");
|
|
2971
3053
|
|
|
2972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3054
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
|
|
2973
3055
|
var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
|
|
2974
3056
|
|
|
2975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
|
|
2976
3058
|
function invalid4(field, response = false) {
|
|
2977
3059
|
throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
|
|
2978
3060
|
}
|
|
2979
3061
|
__name(invalid4, "invalid");
|
|
2980
|
-
var object2 = /* @__PURE__ */ __name((value,
|
|
3062
|
+
var object2 = /* @__PURE__ */ __name((value, fields, field, response = false) => {
|
|
2981
3063
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
2982
3064
|
invalid4(field, response);
|
|
2983
3065
|
for (const key of Object.keys(value))
|
|
2984
|
-
if (!
|
|
3066
|
+
if (!fields.includes(key))
|
|
2985
3067
|
invalid4(`${field}.${key}`, response);
|
|
2986
3068
|
}, "object");
|
|
2987
3069
|
var cursorDetails = /* @__PURE__ */ __name((value) => {
|
|
@@ -3001,7 +3083,8 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
|
|
|
3001
3083
|
cursorDetails(value);
|
|
3002
3084
|
}, "validateMeetingSeriesInventoryCursor");
|
|
3003
3085
|
|
|
3004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3086
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/meetings/stats.js
|
|
3087
|
+
var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
3005
3088
|
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
3006
3089
|
const zone = timeZone ?? "UTC";
|
|
3007
3090
|
try {
|
|
@@ -3017,17 +3100,72 @@ var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
|
3017
3100
|
const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
|
|
3018
3101
|
return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
3019
3102
|
}, "weekStart");
|
|
3103
|
+
var dayKey = /* @__PURE__ */ __name((at, format) => {
|
|
3104
|
+
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
3105
|
+
return `${parts.year}-${parts.month}-${parts.day}`;
|
|
3106
|
+
}, "dayKey");
|
|
3107
|
+
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
3108
|
+
timeZone: zone,
|
|
3109
|
+
year: "numeric",
|
|
3110
|
+
month: "2-digit",
|
|
3111
|
+
day: "2-digit",
|
|
3112
|
+
weekday: "short"
|
|
3113
|
+
}), "zoneFormat");
|
|
3114
|
+
var NO_SERIES = "no-series";
|
|
3115
|
+
var MOST_COUNT_ROWS = 100;
|
|
3116
|
+
var minutesOf = /* @__PURE__ */ __name((ms) => Math.round(ms / 6e4), "minutesOf");
|
|
3117
|
+
var meanOf = /* @__PURE__ */ __name((ms, timed) => timed === 0 ? null : Math.round(ms / timed / 6e3) / 10, "meanOf");
|
|
3118
|
+
var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
|
|
3119
|
+
if (!MEETING_COUNTS_GROUPINGS.includes(by))
|
|
3120
|
+
throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
|
|
3121
|
+
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
3122
|
+
throw new CliError("validation_error", "--limit is a positive number");
|
|
3123
|
+
const zone = zoneOf(timeZone);
|
|
3124
|
+
const format = zoneFormat(zone);
|
|
3125
|
+
const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
|
|
3126
|
+
const add = /* @__PURE__ */ __name((into, meeting2) => {
|
|
3127
|
+
into.meetings += 1;
|
|
3128
|
+
if (meeting2.durationMs !== null) {
|
|
3129
|
+
into.ms += Math.max(0, meeting2.durationMs);
|
|
3130
|
+
into.timed += 1;
|
|
3131
|
+
}
|
|
3132
|
+
if (meeting2.transcribed)
|
|
3133
|
+
into.transcripts += 1;
|
|
3134
|
+
}, "add");
|
|
3135
|
+
const total = { ...sum(), name: null };
|
|
3136
|
+
const groups = /* @__PURE__ */ new Map();
|
|
3137
|
+
for (const meeting2 of meetings) {
|
|
3138
|
+
add(total, meeting2);
|
|
3139
|
+
const key = by === "series" ? meeting2.seriesKey === null ? NO_SERIES : `series:${meeting2.seriesKey}` : meeting2.startedAt === null ? null : by === "day" ? dayKey(meeting2.startedAt, format) : weekStart(meeting2.startedAt, format);
|
|
3140
|
+
if (key === null)
|
|
3141
|
+
continue;
|
|
3142
|
+
const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
|
|
3143
|
+
add(group, meeting2);
|
|
3144
|
+
groups.set(key, group);
|
|
3145
|
+
}
|
|
3146
|
+
const ordered = [...groups.entries()].sort(([a, one], [b, other]) => by === "series" ? other.ms - one.ms || other.meetings - one.meetings || a.localeCompare(b) : b.localeCompare(a));
|
|
3147
|
+
const kept = ordered.slice(0, limit);
|
|
3148
|
+
if (by !== "series")
|
|
3149
|
+
kept.reverse();
|
|
3150
|
+
const counted = /* @__PURE__ */ __name(({ meetings: count7, ms, timed, transcripts }) => ({
|
|
3151
|
+
meetings: count7,
|
|
3152
|
+
minutes: minutesOf(ms),
|
|
3153
|
+
meanMinutes: meanOf(ms, timed),
|
|
3154
|
+
transcripts
|
|
3155
|
+
}), "counted");
|
|
3156
|
+
return {
|
|
3157
|
+
by,
|
|
3158
|
+
timeZone: zone,
|
|
3159
|
+
...counted(total),
|
|
3160
|
+
rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
|
|
3161
|
+
hasMore: ordered.length > limit
|
|
3162
|
+
};
|
|
3163
|
+
}, "aggregateMeetingCounts");
|
|
3020
3164
|
var UNKNOWN_SPEAKER = "unknown";
|
|
3021
3165
|
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");
|
|
3022
3166
|
var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
3023
3167
|
const zone = zoneOf(timeZone);
|
|
3024
|
-
const format =
|
|
3025
|
-
timeZone: zone,
|
|
3026
|
-
year: "numeric",
|
|
3027
|
-
month: "2-digit",
|
|
3028
|
-
day: "2-digit",
|
|
3029
|
-
weekday: "short"
|
|
3030
|
-
});
|
|
3168
|
+
const format = zoneFormat(zone);
|
|
3031
3169
|
const speakers = /* @__PURE__ */ new Map();
|
|
3032
3170
|
const weeks = /* @__PURE__ */ new Map();
|
|
3033
3171
|
const meetings = /* @__PURE__ */ new Set();
|
|
@@ -3080,7 +3218,7 @@ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
|
3080
3218
|
};
|
|
3081
3219
|
}, "aggregateMeetingStats");
|
|
3082
3220
|
|
|
3083
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
3084
3222
|
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
3085
3223
|
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
3086
3224
|
var tagOf = /* @__PURE__ */ __name((value) => {
|
|
@@ -3094,7 +3232,7 @@ var normalizeTag = /* @__PURE__ */ __name((value) => {
|
|
|
3094
3232
|
return tag;
|
|
3095
3233
|
}, "normalizeTag");
|
|
3096
3234
|
|
|
3097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3235
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
|
|
3098
3236
|
var LINK_KINDS = [
|
|
3099
3237
|
"links-to",
|
|
3100
3238
|
"blocked-by",
|
|
@@ -3115,7 +3253,7 @@ var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
|
|
|
3115
3253
|
var RELATION_KINDS = ["member-of", "related-to"];
|
|
3116
3254
|
var linkKind = /* @__PURE__ */ __name((kind) => `'${kind}'`, "linkKind");
|
|
3117
3255
|
|
|
3118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3256
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/tasks/model.js
|
|
3119
3257
|
var TASK_KINDS = ["question", "request", "mention", "promise"];
|
|
3120
3258
|
var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
|
|
3121
3259
|
var CLOSED_STATES = ["done", "dismissed"];
|
|
@@ -3130,13 +3268,13 @@ function closeTask(task, state, by, at, reason) {
|
|
|
3130
3268
|
}
|
|
3131
3269
|
__name(closeTask, "closeTask");
|
|
3132
3270
|
|
|
3133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3271
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/tasks/store.js
|
|
3134
3272
|
function matches2(task, filter) {
|
|
3135
3273
|
return (filter.account === void 0 || task.account === filter.account) && (filter.state === void 0 || task.state === filter.state) && (filter.group === void 0 || task.group === filter.group) && (filter.kind === void 0 || task.kind === filter.kind) && (filter.createdBefore === void 0 || task.createdAt < filter.createdBefore);
|
|
3136
3274
|
}
|
|
3137
3275
|
__name(matches2, "matches");
|
|
3138
3276
|
|
|
3139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/tasks/priority.js
|
|
3140
3278
|
var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
|
|
3141
3279
|
var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
|
|
3142
3280
|
var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
|
|
@@ -3165,12 +3303,12 @@ var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
|
3165
3303
|
}, "priorityOf");
|
|
3166
3304
|
var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
|
|
3167
3305
|
|
|
3168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/tasks/service.js
|
|
3169
3307
|
function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
|
|
3170
|
-
async function find(
|
|
3171
|
-
const task = await store.get(
|
|
3308
|
+
async function find(id4) {
|
|
3309
|
+
const task = await store.get(id4);
|
|
3172
3310
|
if (!task)
|
|
3173
|
-
throw new CliError("not_found", `no task ${
|
|
3311
|
+
throw new CliError("not_found", `no task ${id4}`);
|
|
3174
3312
|
return task;
|
|
3175
3313
|
}
|
|
3176
3314
|
__name(find, "find");
|
|
@@ -3192,8 +3330,8 @@ function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PUR
|
|
|
3192
3330
|
return { task, created: true };
|
|
3193
3331
|
return { task, created: true, review: await store.reviewDuplicates(task.id) };
|
|
3194
3332
|
},
|
|
3195
|
-
async close(
|
|
3196
|
-
const task = closeTask(await find(
|
|
3333
|
+
async close(id4, { as, by, reason }) {
|
|
3334
|
+
const task = closeTask(await find(id4), as, by, now(), reason);
|
|
3197
3335
|
await store.update(task);
|
|
3198
3336
|
return task;
|
|
3199
3337
|
},
|
|
@@ -3225,7 +3363,7 @@ function median(values) {
|
|
|
3225
3363
|
}
|
|
3226
3364
|
__name(median, "median");
|
|
3227
3365
|
|
|
3228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
|
|
3229
3367
|
var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
|
|
3230
3368
|
var MEMORY_KINDS = ["summary", "digest", "preference"];
|
|
3231
3369
|
var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
|
|
@@ -3233,6 +3371,184 @@ var MEMORY_SCOPES = ["personal", "work"];
|
|
|
3233
3371
|
var WORK_TASK_TYPES = ["bug", "feature", "chore"];
|
|
3234
3372
|
var TASK_TYPES2 = [...WORK_TASK_TYPES, ...TASK_KINDS];
|
|
3235
3373
|
|
|
3374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
3375
|
+
var CURRENCY_SCALES = {
|
|
3376
|
+
AED: 2,
|
|
3377
|
+
AMD: 2,
|
|
3378
|
+
AUD: 2,
|
|
3379
|
+
BHD: 3,
|
|
3380
|
+
BYN: 2,
|
|
3381
|
+
CAD: 2,
|
|
3382
|
+
CHF: 2,
|
|
3383
|
+
CLP: 0,
|
|
3384
|
+
CNY: 2,
|
|
3385
|
+
CZK: 2,
|
|
3386
|
+
DKK: 2,
|
|
3387
|
+
EUR: 2,
|
|
3388
|
+
GBP: 2,
|
|
3389
|
+
GEL: 2,
|
|
3390
|
+
HUF: 2,
|
|
3391
|
+
ILS: 2,
|
|
3392
|
+
INR: 2,
|
|
3393
|
+
ISK: 0,
|
|
3394
|
+
JPY: 0,
|
|
3395
|
+
KGS: 2,
|
|
3396
|
+
KRW: 0,
|
|
3397
|
+
KWD: 3,
|
|
3398
|
+
KZT: 2,
|
|
3399
|
+
NOK: 2,
|
|
3400
|
+
PLN: 2,
|
|
3401
|
+
RSD: 2,
|
|
3402
|
+
RUB: 2,
|
|
3403
|
+
SEK: 2,
|
|
3404
|
+
THB: 2,
|
|
3405
|
+
TRY: 2,
|
|
3406
|
+
UAH: 2,
|
|
3407
|
+
USD: 2,
|
|
3408
|
+
UZS: 2,
|
|
3409
|
+
VND: 0
|
|
3410
|
+
};
|
|
3411
|
+
var refuse = /* @__PURE__ */ __name((message, reason) => {
|
|
3412
|
+
throw new CliError("validation_error", message, { reason });
|
|
3413
|
+
}, "refuse");
|
|
3414
|
+
var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
|
|
3415
|
+
var parseDecimal = /* @__PURE__ */ __name((text6, scale) => {
|
|
3416
|
+
const match = DECIMAL.exec(text6.trim());
|
|
3417
|
+
if (!match || (match[2] ?? "").length > scale)
|
|
3418
|
+
return void 0;
|
|
3419
|
+
return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
|
|
3420
|
+
}, "parseDecimal");
|
|
3421
|
+
var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
|
|
3422
|
+
const digits = BigInt(units).toString().padStart(scale + 1, "0");
|
|
3423
|
+
return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
|
|
3424
|
+
}, "formatDecimal");
|
|
3425
|
+
var groupDigits = /* @__PURE__ */ __name((decimal) => {
|
|
3426
|
+
const [whole = "0", fraction] = decimal.split(".");
|
|
3427
|
+
const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
3428
|
+
return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
|
|
3429
|
+
}, "groupDigits");
|
|
3430
|
+
var currencyOf = /* @__PURE__ */ __name((text6) => {
|
|
3431
|
+
const code = typeof text6 === "string" ? text6.trim().toUpperCase() : "";
|
|
3432
|
+
if (CURRENCY_SCALES[code] === void 0)
|
|
3433
|
+
return refuse(`${typeof text6 === "string" && text6.trim() ? text6.trim() : "an empty currency"} is not a currency the store keeps; use one of ${Object.keys(CURRENCY_SCALES).join(", ")}`, "money.currency");
|
|
3434
|
+
return code;
|
|
3435
|
+
}, "currencyOf");
|
|
3436
|
+
var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
|
|
3437
|
+
var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
3438
|
+
const scale = scaleOf(currency);
|
|
3439
|
+
const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
|
|
3440
|
+
if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
|
|
3441
|
+
return refuse(`${what} is a decimal string with at most ${scale} decimal${scale === 1 ? "" : "s"} for ${currency}, such as "${formatDecimal(5e3 * 10 ** scale, scale)}"`, "money.amount");
|
|
3442
|
+
return Number(units);
|
|
3443
|
+
}, "minorUnits");
|
|
3444
|
+
var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
|
|
3445
|
+
amount: formatDecimal(units, scaleOf(currency)),
|
|
3446
|
+
currency
|
|
3447
|
+
}), "moneyOf");
|
|
3448
|
+
var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
|
|
3449
|
+
var QUANTITY_SCALE = 3;
|
|
3450
|
+
var quantityOf = /* @__PURE__ */ __name((text6) => {
|
|
3451
|
+
const thousandths = typeof text6 === "string" ? parseDecimal(text6, QUANTITY_SCALE) : void 0;
|
|
3452
|
+
if (thousandths === void 0 || thousandths === 0n)
|
|
3453
|
+
return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
|
|
3454
|
+
const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
|
|
3455
|
+
return { text: plain, thousandths };
|
|
3456
|
+
}, "quantityOf");
|
|
3457
|
+
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
3458
|
+
|
|
3459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
3460
|
+
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
3461
|
+
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
3462
|
+
var MONEY_DIRECTIONS = ["in", "out"];
|
|
3463
|
+
var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
|
|
3464
|
+
var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
|
|
3465
|
+
if (current === "draft" || current === "void")
|
|
3466
|
+
return current;
|
|
3467
|
+
if (paid <= 0)
|
|
3468
|
+
return "issued";
|
|
3469
|
+
return paid < total ? "partly_paid" : "paid";
|
|
3470
|
+
}, "settledStatus");
|
|
3471
|
+
var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
|
|
3472
|
+
var notes = /* @__PURE__ */ __name((...words2) => {
|
|
3473
|
+
const kept = words2.filter((word) => word !== null);
|
|
3474
|
+
return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
|
|
3475
|
+
}, "notes");
|
|
3476
|
+
var invoiceLine = /* @__PURE__ */ __name((invoice) => {
|
|
3477
|
+
const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
|
|
3478
|
+
const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
|
|
3479
|
+
return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
|
|
3480
|
+
}, "invoiceLine");
|
|
3481
|
+
var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
3482
|
+
const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
|
|
3483
|
+
return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
|
|
3484
|
+
}, "paymentLine");
|
|
3485
|
+
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
3486
|
+
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
3487
|
+
|
|
3488
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/domain/orders.js
|
|
3489
|
+
var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
|
|
3490
|
+
var ORDER_PURPOSES = ["personal", "business", "client", "other"];
|
|
3491
|
+
var orderLine = /* @__PURE__ */ __name((order) => {
|
|
3492
|
+
const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
|
|
3493
|
+
const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
|
|
3494
|
+
return `${order.number ?? `#${order.id}`} \xB7 ${order.supplierName}${money} (${notes2})`;
|
|
3495
|
+
}, "orderLine");
|
|
3496
|
+
var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
|
|
3497
|
+
|
|
3498
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/entities/fields.js
|
|
3499
|
+
var text5 = string();
|
|
3500
|
+
var id3 = pipe(string(), minLength(1));
|
|
3501
|
+
var time = isoTime;
|
|
3502
|
+
var zonedTime = pipe(string(), isoTimestamp("an ISO 8601 time with a zone"));
|
|
3503
|
+
var count6 = pipe(number(), integer(), minValue(0));
|
|
3504
|
+
var untrusted = optional(array(text5));
|
|
3505
|
+
var providerMetadata = optional(record(string(), unknown()));
|
|
3506
|
+
var evidenceSource = strictObject({
|
|
3507
|
+
ref: nullable(reference),
|
|
3508
|
+
kind: text5,
|
|
3509
|
+
title: nullable(text5),
|
|
3510
|
+
sender: nullable(text5),
|
|
3511
|
+
at: nullable(time),
|
|
3512
|
+
excerpt: nullable(text5),
|
|
3513
|
+
tool: nullable(text5),
|
|
3514
|
+
missing: boolean()
|
|
3515
|
+
});
|
|
3516
|
+
var author = strictObject({
|
|
3517
|
+
type: picklist(["person", "bot"]),
|
|
3518
|
+
id: id3,
|
|
3519
|
+
name: nullable(text5)
|
|
3520
|
+
});
|
|
3521
|
+
|
|
3522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
|
|
3523
|
+
var organization = strictObject({
|
|
3524
|
+
id: id3,
|
|
3525
|
+
ref: reference,
|
|
3526
|
+
kind: picklist(["company", "team", "family", "community"]),
|
|
3527
|
+
name: text5,
|
|
3528
|
+
scope: picklist(["personal", "work"]),
|
|
3529
|
+
created_at: time
|
|
3530
|
+
});
|
|
3531
|
+
var project = strictObject({
|
|
3532
|
+
id: id3,
|
|
3533
|
+
ref: reference,
|
|
3534
|
+
key: text5,
|
|
3535
|
+
name: text5,
|
|
3536
|
+
kind: picklist(["project", "inbox"]),
|
|
3537
|
+
type: picklist(["work", "client", "personal", "oss", "other"]),
|
|
3538
|
+
organization_id: nullable(id3),
|
|
3539
|
+
scope: picklist(["personal", "work"]),
|
|
3540
|
+
created_at: time
|
|
3541
|
+
});
|
|
3542
|
+
var reminder = strictObject({
|
|
3543
|
+
id: id3,
|
|
3544
|
+
task: text5,
|
|
3545
|
+
due_at: time,
|
|
3546
|
+
timezone: text5,
|
|
3547
|
+
state: picklist(["pending", "leased", "delivered", "cancelled"]),
|
|
3548
|
+
revision: number(),
|
|
3549
|
+
receipt: nullable(text5)
|
|
3550
|
+
});
|
|
3551
|
+
|
|
3236
3552
|
export {
|
|
3237
3553
|
QUERY_LIMITS,
|
|
3238
3554
|
queryAstSchema,
|
|
@@ -3286,11 +3602,17 @@ export {
|
|
|
3286
3602
|
meetingSummaryAnswer,
|
|
3287
3603
|
exportMeeting,
|
|
3288
3604
|
FACT_TYPES,
|
|
3289
|
-
PAYMENT_DIRECTIONS,
|
|
3290
|
-
PAYMENT_STATES,
|
|
3291
3605
|
validatePayment,
|
|
3292
3606
|
paymentTitle,
|
|
3607
|
+
meetingTimestamp,
|
|
3608
|
+
findingText,
|
|
3293
3609
|
findingHash,
|
|
3610
|
+
findingFields,
|
|
3611
|
+
findingNeeds,
|
|
3612
|
+
validEvidence,
|
|
3613
|
+
findingId,
|
|
3614
|
+
validateFinding,
|
|
3615
|
+
validateBatch,
|
|
3294
3616
|
validateFindings,
|
|
3295
3617
|
findingFingerprint,
|
|
3296
3618
|
MEETING_FINDINGS_KIND,
|
|
@@ -3314,6 +3636,7 @@ export {
|
|
|
3314
3636
|
meetingLink,
|
|
3315
3637
|
meetingSpeaker,
|
|
3316
3638
|
meetingStats,
|
|
3639
|
+
meetingCounts,
|
|
3317
3640
|
meetingParticipants,
|
|
3318
3641
|
meetingPassage,
|
|
3319
3642
|
event,
|
|
@@ -3325,6 +3648,7 @@ export {
|
|
|
3325
3648
|
SAVE_HELP,
|
|
3326
3649
|
validateMeetingSeriesHistory,
|
|
3327
3650
|
validateMeetingSeriesInventoryCursor,
|
|
3651
|
+
aggregateMeetingCounts,
|
|
3328
3652
|
aggregateMeetingStats,
|
|
3329
3653
|
TAG_TYPES,
|
|
3330
3654
|
tagOf,
|
|
@@ -3352,5 +3676,39 @@ export {
|
|
|
3352
3676
|
MEMORY_STATUSES,
|
|
3353
3677
|
MEMORY_SCOPES,
|
|
3354
3678
|
WORK_TASK_TYPES,
|
|
3355
|
-
TASK_TYPES2 as TASK_TYPES
|
|
3679
|
+
TASK_TYPES2 as TASK_TYPES,
|
|
3680
|
+
parseDecimal,
|
|
3681
|
+
formatDecimal,
|
|
3682
|
+
currencyOf,
|
|
3683
|
+
scaleOf,
|
|
3684
|
+
minorUnits,
|
|
3685
|
+
moneyOf,
|
|
3686
|
+
moneyLabel,
|
|
3687
|
+
quantityOf,
|
|
3688
|
+
lineUnits,
|
|
3689
|
+
INVOICE_DIRECTIONS,
|
|
3690
|
+
INVOICE_STATUSES,
|
|
3691
|
+
MONEY_DIRECTIONS,
|
|
3692
|
+
FINANCE_REVIEWS,
|
|
3693
|
+
settledStatus,
|
|
3694
|
+
invoiceLine,
|
|
3695
|
+
paymentLine,
|
|
3696
|
+
invoiceTitle,
|
|
3697
|
+
paymentEntryTitle,
|
|
3698
|
+
ORDER_STATUSES,
|
|
3699
|
+
ORDER_PURPOSES,
|
|
3700
|
+
orderLine,
|
|
3701
|
+
orderTitle,
|
|
3702
|
+
text5 as text,
|
|
3703
|
+
id3 as id,
|
|
3704
|
+
time,
|
|
3705
|
+
zonedTime,
|
|
3706
|
+
count6 as count,
|
|
3707
|
+
untrusted,
|
|
3708
|
+
providerMetadata,
|
|
3709
|
+
evidenceSource,
|
|
3710
|
+
author,
|
|
3711
|
+
organization,
|
|
3712
|
+
project,
|
|
3713
|
+
reminder
|
|
3356
3714
|
};
|