@wirecat/tg-cli 0.128.0 → 0.130.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/contracts/wirecat.json +26 -0
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-JOI34QLS.js → adapter-2XFPXBTA.js} +60 -52
- package/dist/bundle/{all-profiles-2BZEE7J2.js → all-profiles-GXFPZLYU.js} +9 -9
- package/dist/bundle/{anthropic-NW7DL3S3.js → anthropic-FHS5XNK5.js} +5 -5
- package/dist/bundle/{app-server-RUTYKELF.js → app-server-IZMFSFP2.js} +54 -46
- package/dist/bundle/{bot-api-DW6NAZAQ.js → bot-api-V3ZJ75KE.js} +61 -53
- package/dist/bundle/{bot-history-FAJ2W42U.js → bot-history-EJQOD4AQ.js} +22 -18
- package/dist/bundle/{bun-IVP5LSVI.js → bun-GBAZFRCV.js} +2 -2
- package/dist/bundle/{bun-sqlite-ATPCJ4CT.js → bun-sqlite-JB4BX6X7.js} +6 -6
- package/dist/bundle/chunk-2JZJPVBH.js +334 -0
- package/dist/bundle/{chunk-FHGAJK4I.js → chunk-2LPODKIF.js} +15 -15
- package/dist/bundle/chunk-3KZG63EH.js +170 -0
- package/dist/bundle/chunk-3XMUP55N.js +372 -0
- package/dist/bundle/{chunk-OX6574YV.js → chunk-42LRWOTT.js} +15 -15
- package/dist/bundle/{chunk-MDGLKMLD.js → chunk-4BJAQNJ5.js} +9 -9
- package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-66PL7P4C.js} +1 -1
- package/dist/bundle/{chunk-MOUPWPNL.js → chunk-66UG67CE.js} +12 -12
- package/dist/bundle/{chunk-R4QVV3LN.js → chunk-6JBRQ6PM.js} +41 -19
- package/dist/bundle/{chunk-GYO4WXLG.js → chunk-6M3FAHPS.js} +3 -3
- package/dist/bundle/{chunk-WMF6SL5D.js → chunk-6WGAWISN.js} +2 -2
- package/dist/bundle/{chunk-2QHIOPSA.js → chunk-7F3LOHRB.js} +261 -501
- package/dist/bundle/{chunk-XS5C5TQ7.js → chunk-AUNNJDVD.js} +25 -8
- package/dist/bundle/{chunk-7D6LI2N7.js → chunk-B5RGPZDZ.js} +7 -7
- package/dist/bundle/{chunk-YRZXOQOB.js → chunk-B6NQJAUC.js} +2 -2
- package/dist/bundle/{chunk-IV2KJQ5F.js → chunk-BMSS3PCY.js} +58 -33
- package/dist/bundle/{chunk-LTADKMP5.js → chunk-C4ALE7CH.js} +1 -1
- package/dist/bundle/{chunk-WG3BF7SA.js → chunk-CKJ73EF3.js} +1 -1
- package/dist/bundle/{chunk-IX3GUNGV.js → chunk-CLG2ISQH.js} +4 -4
- package/dist/bundle/{chunk-G3PL3R45.js → chunk-EB2JE722.js} +1 -1
- package/dist/bundle/{chunk-J3SX36NE.js → chunk-EUL7HMUL.js} +2 -2
- package/dist/bundle/{chunk-PJA43HVE.js → chunk-F6CV4KUN.js} +2 -2
- package/dist/bundle/{chunk-7KCBPAQS.js → chunk-F6MLJ3V5.js} +2 -2
- package/dist/bundle/{chunk-3UGRMFWK.js → chunk-FH4YIBBH.js} +4 -4
- package/dist/bundle/chunk-FIO5NMK3.js +771 -0
- package/dist/bundle/{chunk-7I5NMVX7.js → chunk-G2SMVYBU.js} +2 -2
- package/dist/bundle/{chunk-FIVFP53N.js → chunk-GA3URWIF.js} +1 -1
- package/dist/bundle/{chunk-2A3TC52A.js → chunk-GGGBPWUS.js} +10 -15
- package/dist/bundle/{chunk-KKZQK6IK.js → chunk-GSHTLLCJ.js} +2 -2
- package/dist/bundle/{chunk-F4UIBEQK.js → chunk-GYCKRIRK.js} +3 -3
- package/dist/bundle/{chunk-WPMJQIEU.js → chunk-HHUK3XO5.js} +1 -1
- package/dist/bundle/{chunk-NM5GBJME.js → chunk-HT6OFANN.js} +19 -19
- package/dist/bundle/{chunk-ODBK56ZR.js → chunk-I5PILOTU.js} +1 -1
- package/dist/bundle/chunk-IBSHQWIJ.js +29 -0
- package/dist/bundle/{chunk-RZFIQMOA.js → chunk-IRWSZJYL.js} +60 -58
- package/dist/bundle/{chunk-BVCRDHI2.js → chunk-IV6SIKVH.js} +4 -4
- package/dist/bundle/{chunk-URFBZNLU.js → chunk-JUFLELQ7.js} +2 -2
- package/dist/bundle/{chunk-XYAH6QQO.js → chunk-KY3JLXW2.js} +4 -4
- package/dist/bundle/{chunk-YSXDCSBP.js → chunk-LPT5T6PU.js} +29 -30
- package/dist/bundle/chunk-LQPZDDDP.js +259 -0
- package/dist/bundle/{chunk-JI2PFQFL.js → chunk-M327UNS6.js} +6 -6
- package/dist/bundle/{chunk-SDLJJF7E.js → chunk-MS6YEIG5.js} +13 -13
- package/dist/bundle/{chunk-WMUPZ3IY.js → chunk-MVFSWKTM.js} +12 -12
- package/dist/bundle/{chunk-YVV5S2QA.js → chunk-NRCY3WBC.js} +2 -2
- package/dist/bundle/{chunk-2IL4YDGG.js → chunk-O2ULG7OO.js} +3 -3
- package/dist/bundle/{chunk-E56QE3UC.js → chunk-OJMDKWWL.js} +627 -503
- package/dist/bundle/{chunk-UURJO46N.js → chunk-OKTRB4ZQ.js} +1 -1
- package/dist/bundle/{chunk-IIHCSJV2.js → chunk-OWVQMK7G.js} +700 -837
- package/dist/bundle/{chunk-LD42OGKK.js → chunk-PS7ZS5HD.js} +4 -4
- package/dist/bundle/{chunk-EAUHYQUK.js → chunk-PWQKGFS2.js} +36 -34
- package/dist/bundle/{chunk-MGBVVQTU.js → chunk-QBNEWEJC.js} +3 -3
- package/dist/bundle/{chunk-QYN5RDTZ.js → chunk-QDEP2QOA.js} +3 -3
- package/dist/bundle/{chunk-QO4ON2X7.js → chunk-QFVIHBLD.js} +1 -1
- package/dist/bundle/{chunk-ZVLYK6CZ.js → chunk-QJDHRBXL.js} +7 -7
- package/dist/bundle/{chunk-IHLNXL2D.js → chunk-QJLCEOAP.js} +1 -1
- package/dist/bundle/{chunk-KF2Q776U.js → chunk-RAFK5KXU.js} +9 -9
- package/dist/bundle/{chunk-RIGNCUZD.js → chunk-RPWYTOLI.js} +5 -5
- package/dist/bundle/{chunk-4DSIGS2E.js → chunk-RZPMFVWM.js} +6 -6
- package/dist/bundle/chunk-S5UTBEV3.js +1974 -0
- package/dist/bundle/{chunk-MC6FOTCV.js → chunk-SYZXOEHY.js} +3 -3
- package/dist/bundle/{chunk-5AP25FMW.js → chunk-SZB5WRMI.js} +2 -2
- package/dist/bundle/{chunk-Q3ZO6Q3M.js → chunk-TGRB4SSZ.js} +4 -4
- package/dist/bundle/{chunk-TQFUAKU6.js → chunk-VSPSHBAC.js} +2 -2
- package/dist/bundle/{chunk-TGUXKG4B.js → chunk-VTJ3AOTT.js} +17 -17
- package/dist/bundle/{chunk-T2CWSFGY.js → chunk-VXWDQDRU.js} +6341 -6902
- package/dist/bundle/{chunk-JJGPU24U.js → chunk-X5H5NERR.js} +6 -6
- package/dist/bundle/{chunk-AF2XVV5P.js → chunk-XHX5D5VE.js} +727 -2598
- package/dist/bundle/chunk-XXW6PFAX.js +16 -0
- package/dist/bundle/{chunk-NXDQXDRN.js → chunk-ZRQQOGAZ.js} +4 -4
- package/dist/bundle/command-contract-G752BLKA.js +37 -0
- package/dist/bundle/{command-server-entry-BU3X4XNL.js → command-server-entry-YR6ONDWO.js} +27 -24
- package/dist/bundle/decode-VUKGWFSW.js +296 -0
- package/dist/bundle/{dispatch-PRAIGIFS.js → dispatch-ST5FK2KI.js} +8 -8
- package/dist/bundle/{echarts-NAXLKJLA.js → echarts-GOV5M733.js} +2 -2
- package/dist/bundle/{embed-LB6ONWHX.js → embed-2IVIYNAJ.js} +6 -6
- package/dist/bundle/{embedder-WE7B2RU5.js → embedder-2HU7JYZK.js} +9 -9
- package/dist/bundle/{entry-W6Y52ZRN.js → entry-CSTCXYI5.js} +9 -9
- package/dist/bundle/{failure-7Y34AUJT.js → failure-GMUQKQ5K.js} +2 -2
- package/dist/bundle/{first-run-NVYNZZA6.js → first-run-3IZGXZT5.js} +12 -11
- package/dist/bundle/first-screen-7QSNCZIK.js +35 -0
- package/dist/bundle/{instructions-MRUC57NS.js → instructions-YSXV6FAC.js} +1 -1
- package/dist/bundle/{mcp-TDKGDB4V.js → mcp-VFIOZDVY.js} +2 -2
- package/dist/bundle/meeting-combined-X4E3LSIJ.js +23 -0
- package/dist/bundle/meeting-model-FQBDHGRU.js +24 -0
- package/dist/bundle/meeting-semantic-ONNEOJX5.js +21 -0
- package/dist/bundle/{node-G7PMDYQV.js → node-FMQWCZRS.js} +2 -2
- package/dist/bundle/{node-sqlite-RXWQ3SES.js → node-sqlite-YN5OKOC6.js} +7 -7
- package/dist/bundle/{oauth-6ZWOL6KX.js → oauth-EW7PTZVT.js} +7 -7
- package/dist/bundle/{open-V7LMZCFI.js → open-Q2RDY344.js} +5 -5
- package/dist/bundle/{openai-P472V4ZM.js → openai-STON6G3O.js} +28 -26
- package/dist/bundle/{process-GSNPENHL.js → process-OQUC2TW3.js} +1 -1
- package/dist/bundle/{program-IELITPKT.js → program-N5BT75OC.js} +66 -57
- package/dist/bundle/{prompt-2CP6CQ5N.js → prompt-WHVF7UTW.js} +5 -5
- package/dist/bundle/{proxy-transport-DP7SIMIC.js → proxy-transport-A4MRO3PF.js} +5 -5
- package/dist/bundle/{recognize-R2DEQ5TC.js → recognize-YDQWMXNI.js} +4 -4
- package/dist/bundle/{remote-JG3POFES.js → remote-477LQHP6.js} +9 -9
- package/dist/bundle/{rerank-TVMR3OLL.js → rerank-4YPB26FG.js} +7 -7
- package/dist/bundle/{serve-DBWSMLPH.js → serve-FXJNUOTS.js} +9 -9
- package/dist/bundle/{server-EXJ2WNZY.js → server-2S6HFBGR.js} +44 -36
- package/dist/bundle/server-UOSUTZNE.js +69 -0
- package/dist/bundle/{sqlite-runtime-AWMY7W4Q.js → sqlite-runtime-RXYNJYMC.js} +6 -6
- package/dist/bundle/{state-HN44BWNQ.js → state-I2GGYGRL.js} +6 -6
- package/dist/bundle/{store-LOVKYQDC.js → store-KX3AAQZH.js} +25 -20
- package/dist/bundle/{store-GIYS3LHV.js → store-VQXIB6KV.js} +17 -13
- package/dist/bundle/store-maintenance-command-LW2MMDLY.js +60 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +11 -4
- package/dist/bundle/command-contract-3BSXDYBC.js +0 -34
- package/dist/bundle/decode-NXB7E46F.js +0 -162
- package/dist/bundle/first-screen-Z6TVHK6I.js +0 -32
- package/dist/bundle/server-SXNFFAIR.js +0 -61
- package/dist/bundle/store-maintenance-command-X3VOYNCG.js +0 -52
- /package/dist/bundle/{chunk-XWBPP2HX.js → chunk-ZI3YTXSF.js} +0 -0
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
isCliFailure,
|
|
5
|
-
isStoreDamage
|
|
6
|
-
} from "./chunk-MGBVVQTU.js";
|
|
7
|
-
import {
|
|
8
|
-
refuseOwnerStoreInTests
|
|
9
|
-
} from "./chunk-TQFUAKU6.js";
|
|
10
|
-
import {
|
|
11
|
-
createRecordLog,
|
|
12
|
-
resolvePaths,
|
|
13
|
-
traceIdOf,
|
|
14
|
-
writeSecurely
|
|
15
|
-
} from "./chunk-NM5GBJME.js";
|
|
16
3
|
import {
|
|
17
4
|
RegistryError,
|
|
18
5
|
SNAKE_CASE,
|
|
@@ -22,9 +9,9 @@ import {
|
|
|
22
9
|
defineReasons,
|
|
23
10
|
defineSteps,
|
|
24
11
|
duplicates,
|
|
12
|
+
exactOptional,
|
|
25
13
|
integer,
|
|
26
14
|
isoTime,
|
|
27
|
-
isoTimestamp,
|
|
28
15
|
lazy,
|
|
29
16
|
literal,
|
|
30
17
|
maxValue,
|
|
@@ -37,546 +24,66 @@ import {
|
|
|
37
24
|
pageSchema,
|
|
38
25
|
picklist,
|
|
39
26
|
pipe,
|
|
40
|
-
record,
|
|
41
27
|
reference,
|
|
42
28
|
safeParse,
|
|
43
29
|
stepOf,
|
|
44
30
|
strictObject,
|
|
45
31
|
string,
|
|
46
32
|
union,
|
|
47
|
-
unknown,
|
|
48
33
|
variant
|
|
49
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AUNNJDVD.js";
|
|
50
35
|
import {
|
|
51
36
|
CliError,
|
|
52
37
|
isCliError,
|
|
53
38
|
singleLine,
|
|
54
39
|
visibleControls
|
|
55
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-F6MLJ3V5.js";
|
|
56
41
|
import {
|
|
57
42
|
__name
|
|
58
43
|
} from "./chunk-ZVVMGPBJ.js";
|
|
59
44
|
|
|
60
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
|
|
76
|
-
var snakeLogger = /* @__PURE__ */ __name((logger) => ({
|
|
77
|
-
debug: /* @__PURE__ */ __name((event2, message) => logger.debug(logAttributes(event2), message), "debug"),
|
|
78
|
-
info: /* @__PURE__ */ __name((event2, message) => logger.info(logAttributes(event2), message), "info"),
|
|
79
|
-
warn: /* @__PURE__ */ __name((event2, message) => logger.warn(logAttributes(event2), message), "warn"),
|
|
80
|
-
error: /* @__PURE__ */ __name((event2, message) => logger.error(logAttributes(event2), message), "error")
|
|
81
|
-
}), "snakeLogger");
|
|
82
|
-
|
|
83
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
|
|
84
|
-
var diagnostic = {
|
|
85
|
-
event: true,
|
|
86
|
-
operation: true,
|
|
87
|
-
opcode: true,
|
|
88
|
-
seq: true,
|
|
89
|
-
status: true,
|
|
90
|
-
method: true,
|
|
91
|
-
endpointTemplate: true,
|
|
92
|
-
bytes: true,
|
|
93
|
-
ids: true,
|
|
94
|
-
counts: true,
|
|
95
|
-
durationMs: true,
|
|
96
|
-
outcome: true,
|
|
97
|
-
errorCode: true,
|
|
98
|
-
providerError: true,
|
|
99
|
-
level: true,
|
|
100
|
-
transport: true,
|
|
101
|
-
attempt: true,
|
|
102
|
-
waitMs: true,
|
|
103
|
-
code: true,
|
|
104
|
-
detail: true,
|
|
105
|
-
reason: true,
|
|
106
|
-
ageMs: true,
|
|
107
|
-
kind: true,
|
|
108
|
-
table: true,
|
|
109
|
-
op: true,
|
|
110
|
-
n: true
|
|
111
|
-
};
|
|
112
|
-
var send = {
|
|
113
|
-
profile: true,
|
|
114
|
-
chatId: true,
|
|
115
|
-
outcome: true,
|
|
116
|
-
kind: true,
|
|
117
|
-
action: true,
|
|
118
|
-
people: true,
|
|
119
|
-
messageId: true,
|
|
120
|
-
key: true,
|
|
121
|
-
count: true,
|
|
122
|
-
forEveryone: true,
|
|
123
|
-
sendId: true,
|
|
124
|
-
operationId: true,
|
|
125
|
-
parentOperationId: true,
|
|
126
|
-
replyTo: true,
|
|
127
|
-
threadId: true,
|
|
128
|
-
sendAs: true,
|
|
129
|
-
resultChatId: true,
|
|
130
|
-
length: true,
|
|
131
|
-
attachments: true,
|
|
132
|
-
scheduledFor: true,
|
|
133
|
-
notify: true,
|
|
134
|
-
origin: true,
|
|
135
|
-
reservation: true,
|
|
136
|
-
errorCode: true
|
|
137
|
-
};
|
|
138
|
-
var background = [
|
|
139
|
-
"job",
|
|
140
|
-
"pid",
|
|
141
|
-
"schedule",
|
|
142
|
-
"exitCode",
|
|
143
|
-
"tool",
|
|
144
|
-
"tier",
|
|
145
|
-
"actorType",
|
|
146
|
-
"actorId",
|
|
147
|
-
"agent",
|
|
148
|
-
"targetType",
|
|
149
|
-
"targetId"
|
|
150
|
-
];
|
|
151
|
-
var crash = ["errorClass", "frames"];
|
|
152
|
-
var dropped = ["dropped"];
|
|
153
|
-
var LOG_ATTRIBUTES = [
|
|
154
|
-
...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
|
|
155
|
-
].sort();
|
|
156
|
-
|
|
157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/runs/run.js
|
|
158
|
-
var KEEP_RUNS_FOR_DAYS = 30;
|
|
159
|
-
var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
|
|
160
|
-
var KEEP_STORE_RUNS_FOR_DAYS = 3;
|
|
161
|
-
var RUNS_SIZE_LIMIT_MB = 200;
|
|
162
|
-
var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
|
|
163
|
-
var startRun = /* @__PURE__ */ __name((options) => {
|
|
164
|
-
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
165
|
-
const startedAt = options.startedAt ?? now();
|
|
166
|
-
const id4 = options.runId ?? newRunId(startedAt, options.command);
|
|
167
|
-
const dir = join(options.runsDir, day(startedAt), id4);
|
|
168
|
-
pruneRuns(options.runsDir, {
|
|
169
|
-
keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
|
|
170
|
-
keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
171
|
-
keepStoreDays: options.keepStoreDays ?? KEEP_STORE_RUNS_FOR_DAYS,
|
|
172
|
-
maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
|
|
173
|
-
now: startedAt
|
|
174
|
-
});
|
|
175
|
-
refuseRealStateInTests(dir);
|
|
176
|
-
const metadata = {
|
|
177
|
-
runId: id4,
|
|
178
|
-
command: options.command,
|
|
179
|
-
...options.profile === void 0 ? {} : { profile: options.profile },
|
|
180
|
-
startedAt: startedAt.toISOString(),
|
|
181
|
-
status: "running",
|
|
182
|
-
cliVersion: options.cliVersion,
|
|
183
|
-
runtime: runtime(),
|
|
184
|
-
platform: process.platform,
|
|
185
|
-
arch: process.arch,
|
|
186
|
-
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
187
|
-
...options.context
|
|
188
|
-
};
|
|
189
|
-
let file;
|
|
190
|
-
const opened = /* @__PURE__ */ __name(() => {
|
|
191
|
-
if (file)
|
|
192
|
-
return file;
|
|
193
|
-
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
194
|
-
const events = join(dir, "events.jsonl");
|
|
195
|
-
writeFileSync(events, "", { flag: "a", mode: 384 });
|
|
196
|
-
file = snakeLogger(createRecordLog({
|
|
197
|
-
to: events,
|
|
198
|
-
runId: id4,
|
|
199
|
-
command: options.command,
|
|
200
|
-
resource: { service: options.service, version: options.cliVersion },
|
|
201
|
-
allow: LOG_ATTRIBUTES,
|
|
202
|
-
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
203
|
-
...options.onError === void 0 ? {} : { onError: options.onError }
|
|
204
|
-
}));
|
|
205
|
-
writeRunFile(dir, metadata);
|
|
206
|
-
return file;
|
|
207
|
-
}, "opened");
|
|
208
|
-
if (!options.lazy)
|
|
209
|
-
opened();
|
|
210
|
-
let finished = false;
|
|
211
|
-
const operations = /* @__PURE__ */ new Set();
|
|
212
|
-
const codes = /* @__PURE__ */ new Set();
|
|
213
|
-
const tables = /* @__PURE__ */ new Set();
|
|
214
|
-
const noted = /* @__PURE__ */ __name((level) => (event2, message) => {
|
|
215
|
-
const { operation, errorCode, error_code, code, kind: kind3, table } = event2;
|
|
216
|
-
if (typeof operation === "string")
|
|
217
|
-
operations.add(operation);
|
|
218
|
-
if (kind3 === "store" && typeof table === "string")
|
|
219
|
-
tables.add(table);
|
|
220
|
-
for (const value of [errorCode, error_code, code])
|
|
221
|
-
if (typeof value === "string")
|
|
222
|
-
codes.add(value);
|
|
223
|
-
if (finished)
|
|
224
|
-
return;
|
|
225
|
-
opened()[level](event2, message);
|
|
226
|
-
}, "noted");
|
|
227
|
-
const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
|
|
228
|
-
return {
|
|
229
|
-
id: id4,
|
|
230
|
-
dir,
|
|
231
|
-
logger,
|
|
232
|
-
finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
|
|
233
|
-
if (finished)
|
|
234
|
-
return;
|
|
235
|
-
finished = true;
|
|
236
|
-
const completedAt = now();
|
|
237
|
-
const final = {
|
|
238
|
-
...metadata,
|
|
239
|
-
...extra,
|
|
240
|
-
status,
|
|
241
|
-
completedAt: completedAt.toISOString(),
|
|
242
|
-
durationMs: completedAt.getTime() - startedAt.getTime(),
|
|
243
|
-
operations: [...operations].sort(),
|
|
244
|
-
codes: [...codes].sort(),
|
|
245
|
-
...tables.size > 0 ? { tables: [...tables].sort() } : {}
|
|
246
|
-
};
|
|
247
|
-
if (file || status !== "success") {
|
|
248
|
-
opened();
|
|
249
|
-
writeRunFile(dir, final);
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
try {
|
|
253
|
-
mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
|
|
254
|
-
appendIndex(join(dir, ".."), runFileOf(final));
|
|
255
|
-
} catch (error) {
|
|
256
|
-
options.onError?.(error);
|
|
257
|
-
}
|
|
258
|
-
}, "finish")
|
|
259
|
-
};
|
|
260
|
-
}, "startRun");
|
|
261
|
-
var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
|
|
262
|
-
if (env.VITEST === void 0)
|
|
263
|
-
return;
|
|
264
|
-
let home;
|
|
265
|
-
try {
|
|
266
|
-
home = userInfo().homedir;
|
|
267
|
-
} catch {
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
if (dir.startsWith(join(home, ".local", "share") + sep))
|
|
271
|
-
throw new Error(`a test opened a run in the real data folder: ${dir}`);
|
|
272
|
-
}, "refuseRealStateInTests");
|
|
273
|
-
var runtime = /* @__PURE__ */ __name(() => {
|
|
274
|
-
const bun = process.versions.bun;
|
|
275
|
-
return bun ? `bun ${bun}` : `node ${process.versions.node}`;
|
|
276
|
-
}, "runtime");
|
|
277
|
-
var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
|
|
278
|
-
const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
|
|
279
|
-
const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
|
|
280
|
-
return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
|
|
281
|
-
}, "newRunId");
|
|
282
|
-
var INDEX = "index.jsonl";
|
|
283
|
-
var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
|
|
284
|
-
appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
|
|
285
|
-
`, { mode: 384 });
|
|
286
|
-
}, "appendIndex");
|
|
287
|
-
var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
|
|
288
|
-
const written = runFileOf(metadata);
|
|
289
|
-
writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
|
|
290
|
-
`, 384);
|
|
291
|
-
try {
|
|
292
|
-
appendIndex(join(dir, ".."), written);
|
|
293
|
-
} catch {
|
|
294
|
-
}
|
|
295
|
-
}, "writeRunFile");
|
|
296
|
-
var matchesListFilter = /* @__PURE__ */ __name((run2, filter) => (filter.runId === void 0 || run2.runId === filter.runId) && (filter.command === void 0 || run2.command === filter.command) && (filter.profile === void 0 || run2.profile === filter.profile) && (filter.status === void 0 || run2.status === filter.status) && (filter.errorCode === void 0 || run2.errorCode === filter.errorCode), "matchesListFilter");
|
|
297
|
-
var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
|
|
298
|
-
const first = since === void 0 ? void 0 : day(new Date(since));
|
|
299
|
-
const runs = [];
|
|
300
|
-
for (const date of days(runsDir).sort().reverse()) {
|
|
301
|
-
if (first !== void 0 && date < first || runs.length >= atLeast)
|
|
302
|
-
break;
|
|
303
|
-
for (const metadata of runsOfDay(join(runsDir, date))) {
|
|
304
|
-
if (matchesListFilter(metadata, filter))
|
|
305
|
-
runs.push(metadata);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return runs;
|
|
309
|
-
}, "listRuns");
|
|
310
|
-
var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
|
|
311
|
-
const latest = /* @__PURE__ */ new Map();
|
|
312
|
-
let raw = "";
|
|
313
|
-
try {
|
|
314
|
-
raw = readFileSync(join(dayDir, INDEX), "utf8");
|
|
315
|
-
} catch {
|
|
316
|
-
}
|
|
317
|
-
for (const line2 of raw.split("\n")) {
|
|
318
|
-
if (line2.trim() === "")
|
|
319
|
-
continue;
|
|
320
|
-
try {
|
|
321
|
-
const metadata = metadataOf(JSON.parse(line2));
|
|
322
|
-
if (typeof metadata.runId === "string")
|
|
323
|
-
latest.set(metadata.runId, metadata);
|
|
324
|
-
} catch {
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return latest;
|
|
328
|
-
}, "indexedRuns");
|
|
329
|
-
var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
|
|
330
|
-
const latest = indexedRuns(dayDir);
|
|
331
|
-
for (const entry of safeReaddir(dayDir)) {
|
|
332
|
-
if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
|
|
333
|
-
continue;
|
|
334
|
-
const metadata = readRun(join(dayDir, entry));
|
|
335
|
-
if (metadata)
|
|
336
|
-
latest.set(metadata.runId, metadata);
|
|
337
|
-
}
|
|
338
|
-
return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
|
|
339
|
-
}, "runsOfDay");
|
|
340
|
-
var findRun = /* @__PURE__ */ __name((runsDir, id4) => {
|
|
341
|
-
const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id4);
|
|
342
|
-
const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
|
|
343
|
-
const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
|
|
344
|
-
for (const date of dates) {
|
|
345
|
-
const dir = join(runsDir, date, id4);
|
|
346
|
-
const metadata = readRun(dir);
|
|
347
|
-
if (metadata)
|
|
348
|
-
return { dir, metadata };
|
|
349
|
-
}
|
|
350
|
-
for (const date of dates) {
|
|
351
|
-
const metadata = indexedRuns(join(runsDir, date)).get(id4);
|
|
352
|
-
if (metadata)
|
|
353
|
-
return { dir: join(runsDir, date, id4), metadata };
|
|
354
|
-
}
|
|
355
|
-
return void 0;
|
|
356
|
-
}, "findRun");
|
|
357
|
-
var readEvents = /* @__PURE__ */ __name((dir) => {
|
|
358
|
-
let raw;
|
|
359
|
-
try {
|
|
360
|
-
raw = readFileSync(join(dir, "events.jsonl"), "utf8");
|
|
361
|
-
} catch {
|
|
362
|
-
return [];
|
|
363
|
-
}
|
|
364
|
-
const events = [];
|
|
365
|
-
for (const line2 of raw.split("\n")) {
|
|
366
|
-
if (line2.trim() === "")
|
|
367
|
-
continue;
|
|
368
|
-
try {
|
|
369
|
-
const parsed = JSON.parse(line2);
|
|
370
|
-
if (parsed !== null && typeof parsed === "object")
|
|
371
|
-
events.push(eventOf(parsed));
|
|
372
|
-
} catch {
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return events;
|
|
376
|
-
}, "readEvents");
|
|
377
|
-
var eventOf = /* @__PURE__ */ __name((line2) => {
|
|
378
|
-
const { attributes, time: time2, severity: severity2 } = line2;
|
|
379
|
-
if (attributes === null || typeof attributes !== "object")
|
|
380
|
-
return logAttributes(line2);
|
|
381
|
-
return { time: time2, severity: severity2, ...logAttributes(attributes) };
|
|
382
|
-
}, "eventOf");
|
|
383
|
-
var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, keepStoreDays = KEEP_STORE_RUNS_FOR_DAYS, maxBytes, now }) => {
|
|
384
|
-
const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
|
|
385
|
-
const before = /* @__PURE__ */ __name((days2) => day(new Date(now.getTime() - Math.min(days2, keepDays) * DAY_MS)), "before");
|
|
386
|
-
const successCutoff = before(keepSuccessDays);
|
|
387
|
-
const storeCutoff = before(keepStoreDays);
|
|
388
|
-
const keptFor = /* @__PURE__ */ __name((metadata) => metadata.keptBecauseStore ? keepStoreDays : metadata.operations?.includes(STORE_WRITE) ? Math.max(keepSuccessDays, keepStoreDays) : keepSuccessDays, "keptFor");
|
|
389
|
-
let removed = 0;
|
|
390
|
-
for (const date of days(runsDir)) {
|
|
391
|
-
if (date >= cutoff) {
|
|
392
|
-
if (date < storeCutoff)
|
|
393
|
-
dropSuccesses(join(runsDir, date), STORE_RUNS_DROPPED, (metadata) => keptFor(metadata) <= keepStoreDays);
|
|
394
|
-
if (date < successCutoff)
|
|
395
|
-
dropSuccesses(join(runsDir, date), SUCCESSES_DROPPED, (metadata) => keptFor(metadata) <= keepSuccessDays);
|
|
396
|
-
continue;
|
|
397
|
-
}
|
|
398
|
-
try {
|
|
399
|
-
rmSync(join(runsDir, date), { recursive: true, force: true });
|
|
400
|
-
removed += 1;
|
|
401
|
-
} catch {
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
if (maxBytes !== void 0)
|
|
405
|
-
removed += fitSize(runsDir, maxBytes, now);
|
|
406
|
-
return removed;
|
|
407
|
-
}, "pruneRuns");
|
|
408
|
-
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
409
|
-
var STORE_WRITE = "store.write";
|
|
410
|
-
var SUCCESSES_DROPPED = ".successes-dropped";
|
|
411
|
-
var STORE_RUNS_DROPPED = ".store-runs-dropped";
|
|
412
|
-
var SIZE_CHECKED = ".size-checked";
|
|
413
|
-
var dropSuccesses = /* @__PURE__ */ __name((dayDir, marker = SUCCESSES_DROPPED, drops = () => true) => {
|
|
414
|
-
const done = join(dayDir, marker);
|
|
415
|
-
try {
|
|
416
|
-
statSync(done);
|
|
417
|
-
return;
|
|
418
|
-
} catch {
|
|
419
|
-
}
|
|
420
|
-
const dropped2 = /* @__PURE__ */ __name((metadata) => metadata?.status === "success" && drops(metadata), "dropped");
|
|
421
|
-
try {
|
|
422
|
-
const kept = [];
|
|
423
|
-
for (const [id4, metadata] of indexedRuns(dayDir)) {
|
|
424
|
-
if (dropped2(metadata))
|
|
425
|
-
rmSync(join(dayDir, id4), { recursive: true, force: true });
|
|
426
|
-
else
|
|
427
|
-
kept.push(JSON.stringify(runFileOf(metadata)));
|
|
428
|
-
}
|
|
429
|
-
for (const entry of safeReaddir(dayDir)) {
|
|
430
|
-
if (entry === INDEX || entry.startsWith("."))
|
|
431
|
-
continue;
|
|
432
|
-
if (dropped2(readRun(join(dayDir, entry))))
|
|
433
|
-
rmSync(join(dayDir, entry), { recursive: true, force: true });
|
|
434
|
-
}
|
|
435
|
-
writeSecurely(join(dayDir, INDEX), kept.map((line2) => `${line2}
|
|
436
|
-
`).join(""), 384);
|
|
437
|
-
writeFileSync(done, "", { mode: 384 });
|
|
438
|
-
} catch {
|
|
439
|
-
}
|
|
440
|
-
}, "dropSuccesses");
|
|
441
|
-
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
442
|
-
let total = 0;
|
|
443
|
-
for (const entry of safeReaddir(path)) {
|
|
444
|
-
const full = join(path, entry);
|
|
445
|
-
try {
|
|
446
|
-
const stat = statSync(full);
|
|
447
|
-
total += stat.isDirectory() ? sizeOf(full) : stat.size;
|
|
448
|
-
} catch {
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
return total;
|
|
452
|
-
}, "sizeOf");
|
|
453
|
-
var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
|
|
454
|
-
const stamp = join(runsDir, SIZE_CHECKED);
|
|
455
|
-
const today = day(now);
|
|
456
|
-
try {
|
|
457
|
-
if (readFileSync(stamp, "utf8").trim() === today)
|
|
458
|
-
return 0;
|
|
459
|
-
} catch {
|
|
460
|
-
}
|
|
461
|
-
const dates = days(runsDir).sort();
|
|
462
|
-
const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
|
|
463
|
-
let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
|
|
464
|
-
let removed = 0;
|
|
465
|
-
for (const date of dates) {
|
|
466
|
-
if (total <= maxBytes || date === today)
|
|
467
|
-
break;
|
|
468
|
-
dropSuccesses(join(runsDir, date));
|
|
469
|
-
const after = sizeOf(join(runsDir, date));
|
|
470
|
-
total -= (sizes.get(date) ?? 0) - after;
|
|
471
|
-
sizes.set(date, after);
|
|
472
|
-
}
|
|
473
|
-
for (const date of dates) {
|
|
474
|
-
if (total <= maxBytes || date === today)
|
|
475
|
-
break;
|
|
476
|
-
try {
|
|
477
|
-
rmSync(join(runsDir, date), { recursive: true, force: true });
|
|
478
|
-
total -= sizes.get(date) ?? 0;
|
|
479
|
-
removed += 1;
|
|
480
|
-
} catch {
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
try {
|
|
484
|
-
mkdirSync(runsDir, { recursive: true, mode: 448 });
|
|
485
|
-
writeFileSync(stamp, today, { mode: 384 });
|
|
486
|
-
} catch {
|
|
487
|
-
}
|
|
488
|
-
return removed;
|
|
489
|
-
}, "fitSize");
|
|
490
|
-
var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
|
|
491
|
-
var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
|
|
492
|
-
var readRun = /* @__PURE__ */ __name((dir) => {
|
|
493
|
-
try {
|
|
494
|
-
return metadataOf(JSON.parse(readFileSync(join(dir, "run.json"), "utf8")));
|
|
495
|
-
} catch {
|
|
496
|
-
return void 0;
|
|
497
|
-
}
|
|
498
|
-
}, "readRun");
|
|
499
|
-
var safeReaddir = /* @__PURE__ */ __name((dir) => {
|
|
500
|
-
try {
|
|
501
|
-
return readdirSync(dir);
|
|
502
|
-
} catch {
|
|
503
|
-
return [];
|
|
45
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/reference.js
|
|
46
|
+
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
47
|
+
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
48
|
+
if (!Number.isSafeInteger(value) || value < minimum)
|
|
49
|
+
throw invalid();
|
|
50
|
+
return value;
|
|
51
|
+
}, "integer");
|
|
52
|
+
var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
|
|
53
|
+
const parts = [integer2(reference2.accountId), integer2(reference2.meetingId)];
|
|
54
|
+
if (reference2.transcriptId !== void 0)
|
|
55
|
+
parts.push(integer2(reference2.transcriptId));
|
|
56
|
+
if (reference2.cuePosition !== void 0) {
|
|
57
|
+
if (reference2.transcriptId === void 0)
|
|
58
|
+
throw invalid();
|
|
59
|
+
parts.push(integer2(reference2.cuePosition, 0));
|
|
504
60
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
if (
|
|
513
|
-
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
61
|
+
return `meeting:${parts.join("/")}`;
|
|
62
|
+
}, "formatMeetingReference");
|
|
63
|
+
var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
|
|
64
|
+
const value = text6.trim();
|
|
65
|
+
if (!value.startsWith("meeting:"))
|
|
66
|
+
throw invalid();
|
|
67
|
+
const parts = value.slice(8).split("/");
|
|
68
|
+
if (parts.length < 2 || parts.length > 4 || parts.some((part) => !/^\d+$/.test(part)))
|
|
69
|
+
throw invalid();
|
|
70
|
+
const ids2 = parts.map(Number);
|
|
71
|
+
const reference2 = {
|
|
72
|
+
type: "meeting",
|
|
73
|
+
accountId: integer2(ids2[0]),
|
|
74
|
+
meetingId: integer2(ids2[1]),
|
|
75
|
+
...ids2.length > 2 ? { transcriptId: integer2(ids2[2]) } : {},
|
|
76
|
+
...ids2.length > 3 ? { cuePosition: integer2(ids2[3], 0) } : {}
|
|
521
77
|
};
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
var scopes = new AsyncLocalStorage();
|
|
526
|
-
var processScope;
|
|
527
|
-
var ownProcesses = new AsyncLocalStorage();
|
|
528
|
-
var asOwnProcess = /* @__PURE__ */ __name((body) => ownProcesses.run({}, body), "asOwnProcess");
|
|
529
|
-
var currentRun = /* @__PURE__ */ __name(() => {
|
|
530
|
-
const scope2 = scopes.getStore();
|
|
531
|
-
if (scope2)
|
|
532
|
-
return scope2;
|
|
533
|
-
const own = ownProcesses.getStore();
|
|
534
|
-
const fresh = /* @__PURE__ */ __name(() => ({
|
|
535
|
-
runId: newRunId(/* @__PURE__ */ new Date(), "process"),
|
|
536
|
-
command: "",
|
|
537
|
-
startedAt: Date.now(),
|
|
538
|
-
...traceOf(process.env)
|
|
539
|
-
}), "fresh");
|
|
540
|
-
if (own) {
|
|
541
|
-
own.scope ??= fresh();
|
|
542
|
-
return own.scope;
|
|
543
|
-
}
|
|
544
|
-
processScope ??= fresh();
|
|
545
|
-
return processScope;
|
|
546
|
-
}, "currentRun");
|
|
547
|
-
var inRun = /* @__PURE__ */ __name((scope2, body) => scopes.run(scope2, body), "inRun");
|
|
548
|
-
var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
|
|
549
|
-
var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
|
|
550
|
-
var useAsProcessRun = /* @__PURE__ */ __name((scope2) => {
|
|
551
|
-
const own = ownProcesses.getStore();
|
|
552
|
-
if (own)
|
|
553
|
-
own.scope = scope2;
|
|
554
|
-
else
|
|
555
|
-
processScope = scope2;
|
|
556
|
-
}, "useAsProcessRun");
|
|
557
|
-
var processRun = /* @__PURE__ */ __name(() => {
|
|
558
|
-
const own = ownProcesses.getStore();
|
|
559
|
-
return own ? own.scope : processScope;
|
|
560
|
-
}, "processRun");
|
|
561
|
-
var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
|
|
562
|
-
var traceOf = /* @__PURE__ */ __name((env) => {
|
|
563
|
-
const traceId = traceIdOf(env.TRACEPARENT);
|
|
564
|
-
return traceId === void 0 ? {} : { traceId };
|
|
565
|
-
}, "traceOf");
|
|
566
|
-
var childTrace = /* @__PURE__ */ __name(() => {
|
|
567
|
-
const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
|
|
568
|
-
const traceId = hex(16);
|
|
569
|
-
return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
|
|
570
|
-
}, "childTrace");
|
|
571
|
-
var attempts = new AsyncLocalStorage();
|
|
572
|
-
var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
|
|
573
|
-
var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
|
|
78
|
+
return reference2;
|
|
79
|
+
}, "parseMeetingReference");
|
|
80
|
+
var canonicalMeetingReference = /* @__PURE__ */ __name((text6) => formatMeetingReference(parseMeetingReference(text6)), "canonicalMeetingReference");
|
|
574
81
|
|
|
575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
82
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/payment.js
|
|
576
83
|
var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
577
84
|
var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
|
|
578
85
|
var PAYMENT_STATES = ["expected", "paid", "cancelled"];
|
|
579
|
-
var
|
|
86
|
+
var invalid2 = /* @__PURE__ */ __name((message) => {
|
|
580
87
|
throw new CliError("validation_error", message);
|
|
581
88
|
}, "invalid");
|
|
582
89
|
var CURRENCIES = new Set(Intl.supportedValuesOf("currency"));
|
|
@@ -585,28 +92,28 @@ var COUNTERPARTY = /^(person|organization|project):[1-9]\d*$/;
|
|
|
585
92
|
var amountOf = /* @__PURE__ */ __name((value) => {
|
|
586
93
|
const match = AMOUNT.exec(typeof value === "number" ? String(value) : typeof value === "string" ? value.trim() : "");
|
|
587
94
|
if (!match)
|
|
588
|
-
return
|
|
95
|
+
return invalid2("a payment's amount is a positive number with at most 2 decimals, such as 1200.50");
|
|
589
96
|
const amount = `${BigInt(match[1] ?? "0")}.${(match[2] ?? "").padEnd(2, "0")}`;
|
|
590
97
|
if (amount === "0.00")
|
|
591
|
-
return
|
|
98
|
+
return invalid2("a payment's amount is more than 0");
|
|
592
99
|
return amount;
|
|
593
100
|
}, "amountOf");
|
|
594
101
|
var dateOf = /* @__PURE__ */ __name((value) => {
|
|
595
102
|
const date = typeof value === "string" ? value.trim() : "";
|
|
596
103
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(date) || (/* @__PURE__ */ new Date(`${date}T00:00:00Z`)).toISOString().slice(0, 10) !== date)
|
|
597
|
-
return
|
|
104
|
+
return invalid2("a payment's dates are ISO dates, such as 2026-10-31");
|
|
598
105
|
return date;
|
|
599
106
|
}, "dateOf");
|
|
600
107
|
var optionalText = /* @__PURE__ */ __name((value, what, limit) => {
|
|
601
108
|
if (value === void 0 || value === null)
|
|
602
109
|
return null;
|
|
603
110
|
if (typeof value !== "string" || !value.trim() || value.length > limit || value.includes("\0"))
|
|
604
|
-
return
|
|
111
|
+
return invalid2(`a payment's ${what} takes 1\u2013${limit} characters`);
|
|
605
112
|
return value.trim();
|
|
606
113
|
}, "optionalText");
|
|
607
114
|
var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
608
115
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
609
|
-
return
|
|
116
|
+
return invalid2(`a payment's ${what} is one of ${allowed.join(", ")}`);
|
|
610
117
|
return value;
|
|
611
118
|
}, "oneOf");
|
|
612
119
|
var FIELDS = [
|
|
@@ -622,20 +129,20 @@ var FIELDS = [
|
|
|
622
129
|
];
|
|
623
130
|
var validatePayment = /* @__PURE__ */ __name((input) => {
|
|
624
131
|
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
625
|
-
return
|
|
132
|
+
return invalid2("a payment is an object");
|
|
626
133
|
const raw = input;
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
629
|
-
return
|
|
134
|
+
const unknown = Object.keys(raw).filter((key) => !FIELDS.includes(key));
|
|
135
|
+
if (unknown.length)
|
|
136
|
+
return invalid2(`a payment has no field ${unknown.join(", ")}; its fields are ${FIELDS.join(", ")}`);
|
|
630
137
|
const currency = typeof raw.currency === "string" ? raw.currency.trim().toUpperCase() : "";
|
|
631
138
|
if (!/^[A-Z]{3}$/.test(currency) || !CURRENCIES.has(currency))
|
|
632
|
-
return
|
|
139
|
+
return invalid2("a payment's currency is an ISO 4217 code, such as EUR or RUB");
|
|
633
140
|
const counterparty = optionalText(raw.counterparty, "counterparty", 80);
|
|
634
141
|
if (counterparty !== null && !COUNTERPARTY.test(counterparty))
|
|
635
|
-
return
|
|
142
|
+
return invalid2("a payment's counterparty is a person:, organization: or project: reference");
|
|
636
143
|
const state = oneOf(raw.state, PAYMENT_STATES, "state");
|
|
637
144
|
if (raw.paid_at != null && state !== "paid")
|
|
638
|
-
return
|
|
145
|
+
return invalid2("only a paid payment has paid_at");
|
|
639
146
|
return {
|
|
640
147
|
amount: amountOf(raw.amount),
|
|
641
148
|
currency,
|
|
@@ -666,7 +173,7 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
|
|
|
666
173
|
return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
|
|
667
174
|
}, "paymentTitle");
|
|
668
175
|
|
|
669
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
176
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/types.js
|
|
670
177
|
var QUERY_LIMITS = {
|
|
671
178
|
bytes: 8192,
|
|
672
179
|
depth: 32,
|
|
@@ -710,7 +217,7 @@ function queryError(reason, span, alternative, context3 = {}, details = {}) {
|
|
|
710
217
|
__name(queryError, "queryError");
|
|
711
218
|
var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
|
|
712
219
|
|
|
713
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
220
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/dates.js
|
|
714
221
|
var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
715
222
|
const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
|
|
716
223
|
try {
|
|
@@ -722,12 +229,12 @@ var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
|
722
229
|
}, "timezoneOf");
|
|
723
230
|
var calendar = /* @__PURE__ */ __name((value, span) => {
|
|
724
231
|
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value))
|
|
725
|
-
queryError("query.invalid-date", span, "use an ISO date
|
|
726
|
-
const year = Number(value.slice(0, 4)), month = Number(value.slice(5, 7)),
|
|
232
|
+
queryError("query.invalid-date", span, "use an ISO date such as 2026-10-01");
|
|
233
|
+
const year = Number(value.slice(0, 4)), month = Number(value.slice(5, 7)), day = Number(value.slice(8, 10));
|
|
727
234
|
const date = /* @__PURE__ */ new Date(0);
|
|
728
|
-
date.setUTCFullYear(year, month - 1,
|
|
235
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
729
236
|
date.setUTCHours(0, 0, 0, 0);
|
|
730
|
-
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !==
|
|
237
|
+
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !== day)
|
|
731
238
|
queryError("query.invalid-date", span);
|
|
732
239
|
return date;
|
|
733
240
|
}, "calendar");
|
|
@@ -743,10 +250,10 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
|
|
|
743
250
|
day: "2-digit",
|
|
744
251
|
era: "short"
|
|
745
252
|
});
|
|
746
|
-
const dayAt = /* @__PURE__ */ __name((
|
|
747
|
-
const
|
|
748
|
-
const value2 = /* @__PURE__ */ __name((name) => Number(
|
|
749
|
-
const year =
|
|
253
|
+
const dayAt = /* @__PURE__ */ __name((time) => {
|
|
254
|
+
const parts = formatter.formatToParts(time);
|
|
255
|
+
const value2 = /* @__PURE__ */ __name((name) => Number(parts.find((p) => p.type === name)?.value), "value");
|
|
256
|
+
const year = parts.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
|
|
750
257
|
return year * 1e4 + value2("month") * 100 + value2("day");
|
|
751
258
|
}, "dayAt");
|
|
752
259
|
let lo = date.getTime() - 2 * 864e5, hi = date.getTime() + 2 * 864e5;
|
|
@@ -763,12 +270,12 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
|
|
|
763
270
|
}, "dayBoundary");
|
|
764
271
|
var WALL = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/u;
|
|
765
272
|
var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
|
|
766
|
-
const [, year, month,
|
|
273
|
+
const [, year, month, day, hour, minute, second = "0", fraction = "0"] = WALL.exec(value) ?? [];
|
|
767
274
|
if (year === void 0)
|
|
768
275
|
queryError("query.invalid-date", span, "use YYYY-MM-DDTHH:mm, with optional seconds");
|
|
769
|
-
const wanted = Date.UTC(Number(year), Number(month) - 1, Number(
|
|
276
|
+
const wanted = Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second), Number(fraction.padEnd(3, "0")));
|
|
770
277
|
const check = new Date(wanted);
|
|
771
|
-
if (check.getUTCDate() !== Number(
|
|
278
|
+
if (check.getUTCDate() !== Number(day) || check.getUTCHours() !== Number(hour) || check.getUTCMinutes() !== Number(minute) || check.getUTCSeconds() !== Number(second))
|
|
772
279
|
queryError("query.invalid-date", span);
|
|
773
280
|
const formatter = new Intl.DateTimeFormat("en-CA", {
|
|
774
281
|
timeZone: zone,
|
|
@@ -781,8 +288,8 @@ var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
|
|
|
781
288
|
hourCycle: "h23"
|
|
782
289
|
});
|
|
783
290
|
const shown = /* @__PURE__ */ __name((instant) => {
|
|
784
|
-
const
|
|
785
|
-
return Date.UTC(
|
|
291
|
+
const parts = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
|
|
292
|
+
return Date.UTC(parts.year ?? 0, (parts.month ?? 1) - 1, parts.day, parts.hour, parts.minute, parts.second) + (instant % 1e3 + 1e3) % 1e3;
|
|
786
293
|
}, "shown");
|
|
787
294
|
const found = /* @__PURE__ */ new Set();
|
|
788
295
|
for (const probe of [wanted - 864e5, wanted, wanted + 864e5]) {
|
|
@@ -800,13 +307,14 @@ var zonedMoment = /* @__PURE__ */ __name((value, zone, span, { end = false } = {
|
|
|
800
307
|
return dayBoundary(value, zone, end, span) - (end ? 1 : 0);
|
|
801
308
|
if (!ZONED.test(value))
|
|
802
309
|
return wallTime(value, zone, span);
|
|
803
|
-
const
|
|
804
|
-
if (!/^\d{4}-\d{2}-\d{2}T/u.test(value) || !Number.isFinite(
|
|
310
|
+
const time = Date.parse(value);
|
|
311
|
+
if (!/^\d{4}-\d{2}-\d{2}T/u.test(value) || !Number.isFinite(time))
|
|
805
312
|
queryError("query.invalid-date", span);
|
|
806
313
|
calendar(value.slice(0, 10), span);
|
|
807
|
-
return
|
|
314
|
+
return time;
|
|
808
315
|
}, "zonedMoment");
|
|
809
316
|
var AGO = /^(\d+)(m|h|d)$/u;
|
|
317
|
+
var MOMENT = /^(\d{4}-\d{2}-\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?$/u;
|
|
810
318
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
811
319
|
var dayOf = /* @__PURE__ */ __name((word, zone, now, span) => {
|
|
812
320
|
const today = new Intl.DateTimeFormat("en-CA", {
|
|
@@ -835,13 +343,17 @@ var dateEndpoint = /* @__PURE__ */ __name((value, zone, side, inclusive, span, n
|
|
|
835
343
|
time: dayBoundary(value, zone, side === "lower" ? !inclusive : inclusive, span),
|
|
836
344
|
inclusive: side === "lower"
|
|
837
345
|
};
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
346
|
+
const [, day, hour, minute, second = "0", offset] = MOMENT.exec(value) ?? [];
|
|
347
|
+
if (day === void 0)
|
|
348
|
+
queryError("query.invalid-date", span, "use an ISO date, a date and time such as 2026-10-01T09:00 (optional seconds and offset), today, yesterday or 30m/2h/7d ago");
|
|
349
|
+
const moment = value.replace(" ", "T");
|
|
350
|
+
if (offset === void 0)
|
|
351
|
+
return { time: wallTime(moment, zone, span), inclusive };
|
|
352
|
+
calendar(day, span);
|
|
353
|
+
const time = Date.parse(moment);
|
|
354
|
+
if (!Number.isFinite(time) || Number(hour) > 23 || Number(minute) > 59 || Number(second) > 59)
|
|
843
355
|
queryError("query.invalid-date", span);
|
|
844
|
-
return { time
|
|
356
|
+
return { time, inclusive };
|
|
845
357
|
}, "dateEndpoint");
|
|
846
358
|
var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclusive, zone, span, now = Date.now()) => {
|
|
847
359
|
const since = lower === upper && AGO.test(lower.toLowerCase());
|
|
@@ -855,7 +367,7 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
|
|
|
855
367
|
};
|
|
856
368
|
}, "dateRange");
|
|
857
369
|
|
|
858
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
370
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/evaluate.js
|
|
859
371
|
var wordsOf = /* @__PURE__ */ __name((text6) => text6.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
|
|
860
372
|
var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
|
|
861
373
|
var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
|
|
@@ -881,10 +393,10 @@ var matchOne = /* @__PURE__ */ __name((field, node, value, options) => {
|
|
|
881
393
|
return (lower === "*" || (lowerInclusive ? number2 >= Number(lower) : number2 > Number(lower))) && (upper === "*" || (upperInclusive ? number2 <= Number(upper) : number2 < Number(upper)));
|
|
882
394
|
}
|
|
883
395
|
case "time": {
|
|
884
|
-
const
|
|
396
|
+
const time = Date.parse(text6);
|
|
885
397
|
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];
|
|
886
398
|
const range = dateRange(lower, upper, lowerInclusive, upperInclusive, options.zone ?? "UTC", node.span, options.now);
|
|
887
|
-
return (range.lower === void 0 || (range.lower_inclusive ?
|
|
399
|
+
return (range.lower === void 0 || (range.lower_inclusive ? time >= range.lower : time > range.lower)) && (range.upper === void 0 || (range.upper_inclusive ? time <= range.upper : time < range.upper));
|
|
888
400
|
}
|
|
889
401
|
default:
|
|
890
402
|
return node.operator === "wildcard" ? pattern(node.value).test(text6) : text6.toLowerCase() === node.value.toLowerCase();
|
|
@@ -910,7 +422,7 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
|
|
|
910
422
|
}, "matches");
|
|
911
423
|
var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
|
|
912
424
|
|
|
913
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
425
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/fields.js
|
|
914
426
|
var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
|
|
915
427
|
var OPERATORS_BY_TYPE = {
|
|
916
428
|
kw: ["term", "phrase", "wildcard"],
|
|
@@ -989,8 +501,8 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
|
|
|
989
501
|
return [...own, ...relations, ...states];
|
|
990
502
|
}, "queryFieldsOf");
|
|
991
503
|
|
|
992
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
993
|
-
var shownOf = /* @__PURE__ */ __name((
|
|
504
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/help.js
|
|
505
|
+
var shownOf = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "shownOf");
|
|
994
506
|
var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
|
|
995
507
|
var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
|
|
996
508
|
var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
@@ -1001,32 +513,32 @@ var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
|
1001
513
|
...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
|
|
1002
514
|
].join(" \xB7 "), "syntaxOf");
|
|
1003
515
|
var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
|
|
1004
|
-
var fieldsHelp = /* @__PURE__ */ __name((
|
|
1005
|
-
const shown = shownOf(
|
|
516
|
+
var fieldsHelp = /* @__PURE__ */ __name((registry, guide) => {
|
|
517
|
+
const shown = shownOf(registry);
|
|
1006
518
|
const negatable = leftOut(shown);
|
|
1007
519
|
const rows = shown.map((field) => [field.name, kindOf(field), field.example]);
|
|
1008
520
|
const widths = [0, 1].map((at) => Math.max(...rows.map((row) => (row[at] ?? "").length)));
|
|
1009
521
|
return [
|
|
1010
522
|
"Fields:",
|
|
1011
|
-
...rows.map(([name = "",
|
|
1012
|
-
...
|
|
523
|
+
...rows.map(([name = "", kind2 = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind2.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
|
|
524
|
+
...registry.defaults && registry.defaults.length > 0 ? [`Defaults: ${registry.defaults.join(" ")} \u2014 name the field to change it`] : [],
|
|
1013
525
|
...negatable.length > 0 ? [`Leave out: -${negatable[0]}:value or NOT ${negatable[0]}:value, for ${negatable.join(", ")}`] : [],
|
|
1014
|
-
`Syntax: ${syntaxOf(shown,
|
|
526
|
+
`Syntax: ${syntaxOf(shown, registry.backend)}`,
|
|
1015
527
|
...guide ? [`Guide: ${guide}`] : []
|
|
1016
528
|
].join("\n");
|
|
1017
529
|
}, "fieldsHelp");
|
|
1018
|
-
var queryDescription = /* @__PURE__ */ __name((
|
|
1019
|
-
const shown = shownOf(
|
|
530
|
+
var queryDescription = /* @__PURE__ */ __name((registry) => {
|
|
531
|
+
const shown = shownOf(registry);
|
|
1020
532
|
if (shown.length === 0)
|
|
1021
533
|
return "field:value terms; this list filters by none yet, so any term is refused";
|
|
1022
534
|
const negatable = leftOut(shown);
|
|
1023
|
-
const terms =
|
|
535
|
+
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], > <" : ""})`;
|
|
1024
536
|
const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
|
|
1025
|
-
const defaults =
|
|
537
|
+
const defaults = registry.defaults?.length ? `; unless named: ${registry.defaults.join(" ")}` : "";
|
|
1026
538
|
return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
|
|
1027
539
|
}, "queryDescription");
|
|
1028
540
|
|
|
1029
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
541
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/parser.js
|
|
1030
542
|
var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
|
|
1031
543
|
var reserved = /* @__PURE__ */ new Set([
|
|
1032
544
|
"+",
|
|
@@ -1049,7 +561,7 @@ var reserved = /* @__PURE__ */ new Set([
|
|
|
1049
561
|
"\\",
|
|
1050
562
|
"/"
|
|
1051
563
|
]);
|
|
1052
|
-
var decodeEscapes = /* @__PURE__ */ __name((raw, span,
|
|
564
|
+
var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail) => {
|
|
1053
565
|
let out = "";
|
|
1054
566
|
for (let at = 0; at < raw.length; at++) {
|
|
1055
567
|
if (raw[at] !== "\\") {
|
|
@@ -1057,11 +569,11 @@ var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail3) => {
|
|
|
1057
569
|
continue;
|
|
1058
570
|
}
|
|
1059
571
|
if (++at >= raw.length)
|
|
1060
|
-
|
|
572
|
+
fail("query.invalid-escape", span);
|
|
1061
573
|
if (raw[at] === "u") {
|
|
1062
574
|
const hex = raw.slice(at + 1, at + 5);
|
|
1063
575
|
if (!/^[0-9a-fA-F]{4}$/.test(hex))
|
|
1064
|
-
|
|
576
|
+
fail("query.invalid-escape", span);
|
|
1065
577
|
out += String.fromCharCode(Number.parseInt(hex, 16));
|
|
1066
578
|
at += 4;
|
|
1067
579
|
} else
|
|
@@ -1069,7 +581,7 @@ var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail3) => {
|
|
|
1069
581
|
}
|
|
1070
582
|
return out;
|
|
1071
583
|
}, "decodeEscapes");
|
|
1072
|
-
var tokensOf = /* @__PURE__ */ __name((text6,
|
|
584
|
+
var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
1073
585
|
const tokens = [];
|
|
1074
586
|
let at = 0;
|
|
1075
587
|
let range = false;
|
|
@@ -1080,7 +592,7 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail3 = queryError) => {
|
|
|
1080
592
|
at++;
|
|
1081
593
|
continue;
|
|
1082
594
|
}
|
|
1083
|
-
let
|
|
595
|
+
let kind2 = c;
|
|
1084
596
|
if (c === '"' || !range && c === "/") {
|
|
1085
597
|
at++;
|
|
1086
598
|
while (at < text6.length && text6[at] !== c) {
|
|
@@ -1089,26 +601,26 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail3 = queryError) => {
|
|
|
1089
601
|
at++;
|
|
1090
602
|
}
|
|
1091
603
|
if (at >= text6.length)
|
|
1092
|
-
|
|
604
|
+
fail("query.unclosed-literal", { start, end: at }, c === "/" ? regexHint(text6, start) : void 0);
|
|
1093
605
|
at++;
|
|
1094
606
|
if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(text6.slice(at)))
|
|
1095
|
-
|
|
1096
|
-
|
|
607
|
+
fail("query.unsupported-regex-flags", { start: at, end: at + 1 }, "Lucene regex does not take JavaScript flags");
|
|
608
|
+
kind2 = c === '"' ? "quoted" : "regex";
|
|
1097
609
|
} else if (range && c !== "]" && c !== "}") {
|
|
1098
610
|
while (at < text6.length && !whitespace(text6[at] ?? "") && !["]", "}"].includes(text6[at] ?? ""))
|
|
1099
611
|
at++;
|
|
1100
|
-
|
|
612
|
+
kind2 = "rangeValue";
|
|
1101
613
|
} else if (reserved.has(c)) {
|
|
1102
614
|
if (c === "\\") {
|
|
1103
615
|
at += 2;
|
|
1104
616
|
while (at < text6.length && !whitespace(text6[at] ?? "") && (!reserved.has(text6[at] ?? "") || ["+", "-"].includes(text6[at] ?? "")))
|
|
1105
617
|
at++;
|
|
1106
|
-
|
|
618
|
+
kind2 = "term";
|
|
1107
619
|
} else {
|
|
1108
620
|
at++;
|
|
1109
621
|
if ((c === "<" || c === ">") && text6[at] === "=") {
|
|
1110
622
|
at++;
|
|
1111
|
-
|
|
623
|
+
kind2 += "=";
|
|
1112
624
|
}
|
|
1113
625
|
if (c === "[" || c === "{")
|
|
1114
626
|
range = true;
|
|
@@ -1121,7 +633,7 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail3 = queryError) => {
|
|
|
1121
633
|
const next = text6[at] ?? "";
|
|
1122
634
|
if (next === "\\") {
|
|
1123
635
|
if (at + 1 >= text6.length)
|
|
1124
|
-
|
|
636
|
+
fail("query.invalid-escape", { start: at, end: at + 1 });
|
|
1125
637
|
at += 2;
|
|
1126
638
|
continue;
|
|
1127
639
|
}
|
|
@@ -1138,9 +650,9 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail3 = queryError) => {
|
|
|
1138
650
|
while (at < text6.length && !whitespace(text6[at] ?? "") && !["(", ")", '"'].includes(text6[at] ?? ""))
|
|
1139
651
|
at++;
|
|
1140
652
|
const raw = text6.slice(start, at);
|
|
1141
|
-
|
|
653
|
+
kind2 = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
|
|
1142
654
|
}
|
|
1143
|
-
tokens.push({ kind:
|
|
655
|
+
tokens.push({ kind: kind2, raw: text6.slice(start, at), span: { start, end: at } });
|
|
1144
656
|
}
|
|
1145
657
|
tokens.push({ kind: "EOF", raw: "", span: { start: at, end: at } });
|
|
1146
658
|
return tokens;
|
|
@@ -1159,30 +671,30 @@ var regexHint = /* @__PURE__ */ __name((text6, at) => {
|
|
|
1159
671
|
return quoteHint(text6, at) ?? `/ starts a regular expression; put the value in quotes: "${word}"`;
|
|
1160
672
|
}, "regexHint");
|
|
1161
673
|
var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proximity = false, ...context3 } = {}) => {
|
|
1162
|
-
const
|
|
674
|
+
const fail = /* @__PURE__ */ __name((reason, span, alternative) => queryError(reason, span, alternative ?? quoteHint(text6, span.start), context3), "fail");
|
|
1163
675
|
if (text6.length > QUERY_LIMITS.bytes || new TextEncoder().encode(text6).length > QUERY_LIMITS.bytes)
|
|
1164
|
-
|
|
1165
|
-
const tokens = tokensOf(text6,
|
|
676
|
+
fail("query.too-large", { start: 0, end: text6.length });
|
|
677
|
+
const tokens = tokensOf(text6, fail);
|
|
1166
678
|
let at = 0;
|
|
1167
679
|
let count7 = 0;
|
|
1168
680
|
let depth = 0;
|
|
1169
681
|
const peek = /* @__PURE__ */ __name(() => tokens[at], "peek");
|
|
1170
682
|
const take = /* @__PURE__ */ __name(() => tokens[at++], "take");
|
|
1171
|
-
const expect = /* @__PURE__ */ __name((
|
|
1172
|
-
if (peek().kind !==
|
|
1173
|
-
|
|
683
|
+
const expect = /* @__PURE__ */ __name((kind2) => {
|
|
684
|
+
if (peek().kind !== kind2)
|
|
685
|
+
fail("query.invalid-syntax", peek().span);
|
|
1174
686
|
return take();
|
|
1175
687
|
}, "expect");
|
|
1176
688
|
const built = /* @__PURE__ */ __name((node) => {
|
|
1177
689
|
if (++count7 > QUERY_LIMITS.nodes)
|
|
1178
|
-
|
|
690
|
+
fail("query.too-large", node.span);
|
|
1179
691
|
return node;
|
|
1180
692
|
}, "built");
|
|
1181
693
|
const combine = /* @__PURE__ */ __name((clauses, occur) => {
|
|
1182
694
|
const first = clauses[0];
|
|
1183
695
|
const last = clauses.at(-1);
|
|
1184
696
|
if (!first || !last)
|
|
1185
|
-
|
|
697
|
+
fail("query.invalid-syntax", peek().span);
|
|
1186
698
|
if (clauses.length === 1)
|
|
1187
699
|
return first;
|
|
1188
700
|
return {
|
|
@@ -1195,7 +707,7 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
1195
707
|
}, "combine");
|
|
1196
708
|
const query = /* @__PURE__ */ __name((field, implicit = false) => {
|
|
1197
709
|
if (++depth > QUERY_LIMITS.depth)
|
|
1198
|
-
|
|
710
|
+
fail("query.too-large", peek().span);
|
|
1199
711
|
const clauses = [];
|
|
1200
712
|
do {
|
|
1201
713
|
clauses.push(disjunction(field, implicit));
|
|
@@ -1231,7 +743,7 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
1231
743
|
let implicit = inheritedImplicit;
|
|
1232
744
|
if (peek().kind === "term" && [":", "=", "<", ">", "<=", ">="].includes(tokens[at + 1]?.kind ?? "")) {
|
|
1233
745
|
const token = take();
|
|
1234
|
-
field = decodeEscapes(token.raw, token.span,
|
|
746
|
+
field = decodeEscapes(token.raw, token.span, fail);
|
|
1235
747
|
start = token.span.start;
|
|
1236
748
|
implicit = false;
|
|
1237
749
|
let operator = take();
|
|
@@ -1240,15 +752,15 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
1240
752
|
if (["<", ">", "<=", ">="].includes(operator.kind)) {
|
|
1241
753
|
const value = take();
|
|
1242
754
|
if (!["term", "number", "quoted"].includes(value.kind))
|
|
1243
|
-
|
|
1244
|
-
const
|
|
755
|
+
fail("query.invalid-syntax", value.span);
|
|
756
|
+
const decoded = decodeEscapes(value.kind === "quoted" ? value.raw.slice(1, -1) : value.raw, value.span, fail);
|
|
1245
757
|
const lower = operator.kind.startsWith(">");
|
|
1246
758
|
const node2 = built({
|
|
1247
759
|
kind: "predicate",
|
|
1248
760
|
field,
|
|
1249
761
|
operator: "range",
|
|
1250
|
-
value: lower ?
|
|
1251
|
-
upper: lower ? "*" :
|
|
762
|
+
value: lower ? decoded : "*",
|
|
763
|
+
upper: lower ? "*" : decoded,
|
|
1252
764
|
lower_inclusive: !lower || operator.kind.endsWith("="),
|
|
1253
765
|
upper_inclusive: lower || operator.kind.endsWith("="),
|
|
1254
766
|
span: { start: token.span.start, end: value.span.end }
|
|
@@ -1266,17 +778,17 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
1266
778
|
const opening = take();
|
|
1267
779
|
const lower = take();
|
|
1268
780
|
if (!["rangeValue", "quoted"].includes(lower.kind))
|
|
1269
|
-
|
|
781
|
+
fail("query.invalid-syntax", lower.span);
|
|
1270
782
|
const separator = take();
|
|
1271
783
|
if (separator.raw !== "TO")
|
|
1272
|
-
|
|
784
|
+
fail("query.invalid-syntax", separator.span);
|
|
1273
785
|
const upper = take();
|
|
1274
786
|
if (!["rangeValue", "quoted"].includes(upper.kind))
|
|
1275
|
-
|
|
787
|
+
fail("query.invalid-syntax", upper.span);
|
|
1276
788
|
const closing = take();
|
|
1277
789
|
if (!["]", "}"].includes(closing.kind))
|
|
1278
|
-
|
|
1279
|
-
const decode = /* @__PURE__ */ __name((t) => decodeEscapes(t.kind === "quoted" ? t.raw.slice(1, -1) : t.raw, t.span,
|
|
790
|
+
fail("query.invalid-syntax", closing.span);
|
|
791
|
+
const decode = /* @__PURE__ */ __name((t) => decodeEscapes(t.kind === "quoted" ? t.raw.slice(1, -1) : t.raw, t.span, fail), "decode");
|
|
1280
792
|
node = built({
|
|
1281
793
|
kind: "predicate",
|
|
1282
794
|
field,
|
|
@@ -1290,31 +802,31 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
1290
802
|
} else {
|
|
1291
803
|
const token = take();
|
|
1292
804
|
if (!["term", "number", "quoted", "regex"].includes(token.kind))
|
|
1293
|
-
|
|
805
|
+
fail("query.invalid-syntax", token.span);
|
|
1294
806
|
const raw = ["term", "number"].includes(token.kind) ? token.raw : token.raw.slice(1, -1);
|
|
1295
807
|
if (field === "fn")
|
|
1296
|
-
|
|
808
|
+
fail("query.unsupported-operator", token.span, "interval functions are not supported");
|
|
1297
809
|
const wildcard = ["term", "number"].includes(token.kind) && /(?<!\\)[*?]/u.test(raw);
|
|
1298
810
|
node = built({
|
|
1299
811
|
kind: "predicate",
|
|
1300
812
|
field,
|
|
1301
813
|
operator: token.kind === "regex" ? "regex" : token.kind === "quoted" ? "phrase" : wildcard ? "wildcard" : "term",
|
|
1302
|
-
value: token.kind === "regex" || wildcard ? raw : decodeEscapes(raw, token.span,
|
|
814
|
+
value: token.kind === "regex" || wildcard ? raw : decodeEscapes(raw, token.span, fail),
|
|
1303
815
|
span: { start: start ?? token.span.start, end: token.span.end },
|
|
1304
816
|
...implicit ? { implicit: true } : {}
|
|
1305
817
|
});
|
|
1306
818
|
}
|
|
1307
819
|
if (proximity && peek().kind === "~" && node.kind === "predicate" && node.operator === "phrase") {
|
|
1308
820
|
take();
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
1312
|
-
node = { ...node, slop: Number(
|
|
821
|
+
const distance = take();
|
|
822
|
+
if (distance.kind !== "number" || !/^\d+$/u.test(distance.raw))
|
|
823
|
+
fail("query.invalid-syntax", distance.span, 'write the distance as a whole number: "a b"~3');
|
|
824
|
+
node = { ...node, slop: Number(distance.raw), span: { start: node.span.start, end: distance.span.end } };
|
|
1313
825
|
}
|
|
1314
826
|
if (peek().kind === "~")
|
|
1315
|
-
|
|
827
|
+
fail("query.unsupported-operator", peek().span, node.kind === "predicate" && node.operator === "phrase" ? "proximity (~) is not supported \u2014 drop the ~ for the exact phrase, or join the words with AND" : "fuzzy matching (~) is not supported \u2014 use a prefix such as word* to catch word forms");
|
|
1316
828
|
if (["^", "@"].includes(peek().kind))
|
|
1317
|
-
|
|
829
|
+
fail("query.unsupported-operator", peek().span, "boost and minimum-should-match are not supported");
|
|
1318
830
|
return { node, ...modifier ? { modifier } : {} };
|
|
1319
831
|
}, "clause");
|
|
1320
832
|
const root = query(defaultField, true);
|
|
@@ -1330,12 +842,12 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
1330
842
|
}, "parseLucene");
|
|
1331
843
|
var implicitTextTerms = /* @__PURE__ */ __name((text6) => {
|
|
1332
844
|
const tokens = tokensOf(text6);
|
|
1333
|
-
if (tokens.some(({ kind:
|
|
845
|
+
if (tokens.some(({ kind: kind2 }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind2)))
|
|
1334
846
|
return /* @__PURE__ */ new Set();
|
|
1335
847
|
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] : []));
|
|
1336
848
|
}, "implicitTextTerms");
|
|
1337
849
|
|
|
1338
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
850
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/validate.js
|
|
1339
851
|
var inContext = /* @__PURE__ */ __name((context3, run2) => {
|
|
1340
852
|
try {
|
|
1341
853
|
run2();
|
|
@@ -1348,24 +860,24 @@ var inContext = /* @__PURE__ */ __name((context3, run2) => {
|
|
|
1348
860
|
}, "inContext");
|
|
1349
861
|
var bounds = /* @__PURE__ */ __name((node) => node.operator === "range" ? [node.value, node.upper ?? "*"].filter((bound) => bound !== "*") : [node.value], "bounds");
|
|
1350
862
|
var checkValue = /* @__PURE__ */ __name((field, node, options) => {
|
|
1351
|
-
const
|
|
863
|
+
const fail = /* @__PURE__ */ __name((reason, alternative) => queryError(reason, node.span, alternative, options), "fail");
|
|
1352
864
|
if (node.value === "" && field.type !== "txt")
|
|
1353
|
-
|
|
865
|
+
fail("query.missing-value");
|
|
1354
866
|
if (node.operator === "wildcard")
|
|
1355
867
|
return;
|
|
1356
868
|
switch (field.type) {
|
|
1357
869
|
case "enum":
|
|
1358
870
|
if (!field.values?.includes(node.value.toLowerCase()))
|
|
1359
|
-
|
|
871
|
+
fail("query.unknown-value", `${field.name} takes ${field.values?.join(", ")}`);
|
|
1360
872
|
return;
|
|
1361
873
|
case "bool":
|
|
1362
874
|
if (!["true", "false"].includes(node.value.toLowerCase()))
|
|
1363
|
-
|
|
875
|
+
fail("query.unknown-value", `${field.name} takes true, false`);
|
|
1364
876
|
return;
|
|
1365
877
|
case "num":
|
|
1366
878
|
for (const bound of bounds(node))
|
|
1367
879
|
if (!Number.isFinite(Number(bound)) || bound.trim() === "")
|
|
1368
|
-
|
|
880
|
+
fail("query.invalid-number", `${field.name} takes a number`);
|
|
1369
881
|
return;
|
|
1370
882
|
case "time":
|
|
1371
883
|
inContext(options, () => {
|
|
@@ -1377,8 +889,8 @@ var checkValue = /* @__PURE__ */ __name((field, node, options) => {
|
|
|
1377
889
|
return;
|
|
1378
890
|
}
|
|
1379
891
|
}, "checkValue");
|
|
1380
|
-
var validateQuery = /* @__PURE__ */ __name((ast,
|
|
1381
|
-
const byName = new Map(
|
|
892
|
+
var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
|
|
893
|
+
const byName = new Map(registry.fields.map((field) => [field.name, field]));
|
|
1382
894
|
const visit = /* @__PURE__ */ __name((node, required) => {
|
|
1383
895
|
if (node.kind === "boolean") {
|
|
1384
896
|
for (const clause of node.clauses)
|
|
@@ -1388,11 +900,11 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry3, options = {}) => {
|
|
|
1388
900
|
const field = byName.get(node.field);
|
|
1389
901
|
if (!field)
|
|
1390
902
|
queryError("query.unknown-field", node.span, `no field "${node.field}"`, options, {
|
|
1391
|
-
fields:
|
|
903
|
+
fields: registry.fields.map((one) => one.name)
|
|
1392
904
|
});
|
|
1393
|
-
if (
|
|
905
|
+
if (registry.backend === "native" && !field.native)
|
|
1394
906
|
queryError("query.unsupported-field", node.span, `the source cannot filter by ${field.name}`, options, {
|
|
1395
|
-
supported:
|
|
907
|
+
supported: registry.fields.filter((one) => one.native).map((one) => one.name)
|
|
1396
908
|
});
|
|
1397
909
|
const presence = node.operator === "wildcard" && node.value === "*";
|
|
1398
910
|
if (!presence && !field.operators.includes(node.operator))
|
|
@@ -1410,15 +922,15 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry3, options = {}) => {
|
|
|
1410
922
|
}, "validateQuery");
|
|
1411
923
|
var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
|
|
1412
924
|
|
|
1413
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1414
|
-
var describeQuery = /* @__PURE__ */ __name((
|
|
1415
|
-
entity:
|
|
1416
|
-
backend:
|
|
1417
|
-
fields:
|
|
1418
|
-
...
|
|
925
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/query/registry.js
|
|
926
|
+
var describeQuery = /* @__PURE__ */ __name((registry) => ({
|
|
927
|
+
entity: registry.entity,
|
|
928
|
+
backend: registry.backend,
|
|
929
|
+
fields: registry.fields.map(({ validate: _, ...field }) => field),
|
|
930
|
+
...registry.defaults && registry.defaults.length > 0 ? { defaults: [...registry.defaults] } : {}
|
|
1419
931
|
}), "describeQuery");
|
|
1420
|
-
var exampleProblems = /* @__PURE__ */ __name((
|
|
1421
|
-
const syntaxOnly = { ...
|
|
932
|
+
var exampleProblems = /* @__PURE__ */ __name((registry) => {
|
|
933
|
+
const syntaxOnly = { ...registry, backend: "sql" };
|
|
1422
934
|
const problem = /* @__PURE__ */ __name((text6, field) => {
|
|
1423
935
|
try {
|
|
1424
936
|
const named = walkQuery(validateQuery(parseLucene(text6, { defaultField: "none" }), syntaxOnly).root);
|
|
@@ -1429,29 +941,29 @@ var exampleProblems = /* @__PURE__ */ __name((registry3) => {
|
|
|
1429
941
|
return `"${text6}": ${failure.message}`;
|
|
1430
942
|
}
|
|
1431
943
|
}, "problem");
|
|
1432
|
-
const defaults = (
|
|
944
|
+
const defaults = (registry.defaults ?? []).map((term) => {
|
|
1433
945
|
const field = term.replace(/^-/, "").split(/[:<>=]/)[0] ?? "";
|
|
1434
946
|
return { field, problem: problem(term.replace(/^-/, ""), field) };
|
|
1435
947
|
});
|
|
1436
948
|
return [
|
|
1437
|
-
...
|
|
949
|
+
...registry.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
|
|
1438
950
|
...defaults
|
|
1439
951
|
].filter((entry) => entry.problem !== void 0);
|
|
1440
952
|
}, "exampleProblems");
|
|
1441
953
|
var checked = /* @__PURE__ */ new WeakSet();
|
|
1442
|
-
var defineQuery = /* @__PURE__ */ __name((
|
|
1443
|
-
if (checked.has(
|
|
1444
|
-
return
|
|
1445
|
-
const names =
|
|
954
|
+
var defineQuery = /* @__PURE__ */ __name((registry) => {
|
|
955
|
+
if (checked.has(registry))
|
|
956
|
+
return registry;
|
|
957
|
+
const names = registry.fields.map((field) => field.name);
|
|
1446
958
|
const problems = [
|
|
1447
959
|
...duplicates(names).map((name) => `"${name}" is listed twice`),
|
|
1448
960
|
...names.filter((name) => !SNAKE_CASE.test(name)).map((name) => `"${name}" is not snake_case`),
|
|
1449
|
-
...exampleProblems(
|
|
961
|
+
...exampleProblems(registry).map(({ field, problem }) => `${field}: ${problem}`)
|
|
1450
962
|
];
|
|
1451
963
|
if (problems.length > 0)
|
|
1452
|
-
throw new RegistryError(`${
|
|
1453
|
-
checked.add(
|
|
1454
|
-
return
|
|
964
|
+
throw new RegistryError(`${registry.entity} query`, problems);
|
|
965
|
+
checked.add(registry);
|
|
966
|
+
return registry;
|
|
1455
967
|
}, "defineQuery");
|
|
1456
968
|
var SPAN = ["span", "alternative", "guide"];
|
|
1457
969
|
var QUERY_REASONS = defineReasons([
|
|
@@ -1481,7 +993,119 @@ var QUERY_REASONS = defineReasons([
|
|
|
1481
993
|
details: [...SPAN, ...details]
|
|
1482
994
|
})));
|
|
1483
995
|
|
|
1484
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
997
|
+
var context = {
|
|
998
|
+
command: "search meetings",
|
|
999
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
1000
|
+
};
|
|
1001
|
+
var words = ["term", "phrase"];
|
|
1002
|
+
var MOST_LINES_APART = 20;
|
|
1003
|
+
var near = /* @__PURE__ */ __name((node) => {
|
|
1004
|
+
if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
|
|
1005
|
+
queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
|
|
1006
|
+
}, "near");
|
|
1007
|
+
var MEETING_HIT_QUERY = defineQuery({
|
|
1008
|
+
entity: "meeting_hit",
|
|
1009
|
+
backend: "sql",
|
|
1010
|
+
fields: [
|
|
1011
|
+
{
|
|
1012
|
+
name: "text",
|
|
1013
|
+
type: "txt",
|
|
1014
|
+
operators: words,
|
|
1015
|
+
example: "text:budget",
|
|
1016
|
+
relation: "a passage with the word in any form, or a spelling speech recognition garbled",
|
|
1017
|
+
validate: near
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
name: "exact",
|
|
1021
|
+
type: "txt",
|
|
1022
|
+
operators: words,
|
|
1023
|
+
example: "exact:budget",
|
|
1024
|
+
relation: "a passage with the word as typed: no other forms, no garbled spellings",
|
|
1025
|
+
validate: near
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
name: "from",
|
|
1029
|
+
type: "kw",
|
|
1030
|
+
operators: words,
|
|
1031
|
+
example: 'from:"Alice Synthetic"',
|
|
1032
|
+
relation: "a line said or a chat message written by this person; attendance is --identity-id"
|
|
1033
|
+
}
|
|
1034
|
+
]
|
|
1035
|
+
});
|
|
1036
|
+
var MEETING_FIELDS = defineQuery({
|
|
1037
|
+
entity: "meeting_hit",
|
|
1038
|
+
backend: "sql",
|
|
1039
|
+
fields: [
|
|
1040
|
+
...MEETING_HIT_QUERY.fields,
|
|
1041
|
+
{
|
|
1042
|
+
name: "date",
|
|
1043
|
+
type: "time",
|
|
1044
|
+
operators: ["term", "range"],
|
|
1045
|
+
example: "date>=30d",
|
|
1046
|
+
relation: "meetings that started then; the same as --since-time and --until-time"
|
|
1047
|
+
},
|
|
1048
|
+
...["project", "tag", "topic"].map((name) => ({
|
|
1049
|
+
name,
|
|
1050
|
+
type: "kw",
|
|
1051
|
+
operators: words,
|
|
1052
|
+
example: `${name}:"Example name"`,
|
|
1053
|
+
relation: `meetings in this ${name}, by name or alias; the same as --${name}`
|
|
1054
|
+
}))
|
|
1055
|
+
]
|
|
1056
|
+
});
|
|
1057
|
+
var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
|
|
1058
|
+
var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
|
|
1059
|
+
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
|
|
1060
|
+
let ast;
|
|
1061
|
+
try {
|
|
1062
|
+
ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
|
|
1063
|
+
} catch (error) {
|
|
1064
|
+
if (error instanceof CliError)
|
|
1065
|
+
return { query, request };
|
|
1066
|
+
throw error;
|
|
1067
|
+
}
|
|
1068
|
+
const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
|
|
1069
|
+
const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
|
|
1070
|
+
const misplaced = /* @__PURE__ */ __name((node, nested) => node.kind === "predicate" ? nested && LIFTED.has(node.field) ? node : void 0 : node.clauses.map((clause) => misplaced(clause.node, true)).find(Boolean), "misplaced");
|
|
1071
|
+
const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
|
|
1072
|
+
if (wrong)
|
|
1073
|
+
queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
|
|
1074
|
+
if (!lifted.length)
|
|
1075
|
+
return { query, request };
|
|
1076
|
+
const next = { ...request };
|
|
1077
|
+
const once = /* @__PURE__ */ __name((name, flag2) => {
|
|
1078
|
+
if (next[name] !== void 0)
|
|
1079
|
+
throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
|
|
1080
|
+
}, "once");
|
|
1081
|
+
for (const { node } of lifted) {
|
|
1082
|
+
if (node.field === "date") {
|
|
1083
|
+
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
|
|
1084
|
+
if (range.lower !== void 0) {
|
|
1085
|
+
once("since", "--since-time");
|
|
1086
|
+
next.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
1087
|
+
}
|
|
1088
|
+
if (range.upper !== void 0) {
|
|
1089
|
+
once("until", "--until-time");
|
|
1090
|
+
next.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
1091
|
+
}
|
|
1092
|
+
} else {
|
|
1093
|
+
const field = node.field;
|
|
1094
|
+
once(field, `--${field}`);
|
|
1095
|
+
next[field] = node.value;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
let rest = query;
|
|
1099
|
+
for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
|
|
1100
|
+
rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
|
|
1101
|
+
rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
|
|
1102
|
+
if (!rest)
|
|
1103
|
+
throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
|
|
1104
|
+
return { query: rest, request: next };
|
|
1105
|
+
}, "liftMeetingFields");
|
|
1106
|
+
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
1107
|
+
|
|
1108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/search/service-query.js
|
|
1485
1109
|
var BACKENDS = ["archive", "server", "both"];
|
|
1486
1110
|
var MAX_BRANCHES = 64;
|
|
1487
1111
|
var some = /* @__PURE__ */ __name((value) => value === void 0 ? [] : [value], "some");
|
|
@@ -1516,45 +1140,11 @@ var windowOf = /* @__PURE__ */ __name(({ lower, upper, lower_inclusive, upper_in
|
|
|
1516
1140
|
...lower === void 0 ? {} : { from: lower_inclusive ? lower : lower + 1 },
|
|
1517
1141
|
...upper === void 0 ? {} : { to: upper_inclusive ? upper : upper - 1 }
|
|
1518
1142
|
}), "windowOf");
|
|
1143
|
+
var RELATIVE_TIME = /^\d+[mhd]$/i;
|
|
1144
|
+
var OFFSET = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
1145
|
+
var readsZone = /* @__PURE__ */ __name((ast, times) => walkQuery(ast.root).some((term) => times.has(term.field) && [term.value, term.upper].some((value) => value !== void 0 && value !== "*" && !RELATIVE_TIME.test(value) && !OFFSET.test(value))), "readsZone");
|
|
1519
1146
|
|
|
1520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1521
|
-
var invalid2 = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
1522
|
-
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
1523
|
-
if (!Number.isSafeInteger(value) || value < minimum)
|
|
1524
|
-
throw invalid2();
|
|
1525
|
-
return value;
|
|
1526
|
-
}, "integer");
|
|
1527
|
-
var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
|
|
1528
|
-
const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
|
|
1529
|
-
if (reference2.transcriptId !== void 0)
|
|
1530
|
-
parts2.push(integer2(reference2.transcriptId));
|
|
1531
|
-
if (reference2.cuePosition !== void 0) {
|
|
1532
|
-
if (reference2.transcriptId === void 0)
|
|
1533
|
-
throw invalid2();
|
|
1534
|
-
parts2.push(integer2(reference2.cuePosition, 0));
|
|
1535
|
-
}
|
|
1536
|
-
return `meeting:${parts2.join("/")}`;
|
|
1537
|
-
}, "formatMeetingReference");
|
|
1538
|
-
var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
|
|
1539
|
-
const value = text6.trim();
|
|
1540
|
-
if (!value.startsWith("meeting:"))
|
|
1541
|
-
throw invalid2();
|
|
1542
|
-
const parts2 = value.slice(8).split("/");
|
|
1543
|
-
if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
|
|
1544
|
-
throw invalid2();
|
|
1545
|
-
const ids2 = parts2.map(Number);
|
|
1546
|
-
const reference2 = {
|
|
1547
|
-
type: "meeting",
|
|
1548
|
-
accountId: integer2(ids2[0]),
|
|
1549
|
-
meetingId: integer2(ids2[1]),
|
|
1550
|
-
...ids2.length > 2 ? { transcriptId: integer2(ids2[2]) } : {},
|
|
1551
|
-
...ids2.length > 3 ? { cuePosition: integer2(ids2[3], 0) } : {}
|
|
1552
|
-
};
|
|
1553
|
-
return reference2;
|
|
1554
|
-
}, "parseMeetingReference");
|
|
1555
|
-
var canonicalMeetingReference = /* @__PURE__ */ __name((text6) => formatMeetingReference(parseMeetingReference(text6)), "canonicalMeetingReference");
|
|
1556
|
-
|
|
1557
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
1147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
1558
1148
|
var text = string();
|
|
1559
1149
|
var count = pipe(number(), integer(), minValue(0));
|
|
1560
1150
|
var MEETING_ISSUES = ["time_without_zone"];
|
|
@@ -1593,7 +1183,7 @@ var meetingEntries = {
|
|
|
1593
1183
|
};
|
|
1594
1184
|
var meeting = strictObject(meetingEntries);
|
|
1595
1185
|
var MEETING_UNTRUSTED = ["title", "description", "location"];
|
|
1596
|
-
var iso = /* @__PURE__ */ __name((
|
|
1186
|
+
var iso = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
|
|
1597
1187
|
var meetingItem = /* @__PURE__ */ __name((row, owner) => {
|
|
1598
1188
|
const issues = meetingIssuesOf(row.metadata);
|
|
1599
1189
|
return {
|
|
@@ -1644,14 +1234,14 @@ var MEETING_QUERY = {
|
|
|
1644
1234
|
})
|
|
1645
1235
|
};
|
|
1646
1236
|
|
|
1647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/store.js
|
|
1648
1238
|
var MEETING_DOCUMENT_ROLES = ["transcript", "recording", "notes"];
|
|
1649
1239
|
var READ_BUDGET_EXCEEDED = "Meeting search exceeds its stored text byte budget";
|
|
1650
1240
|
|
|
1651
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1241
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/answers.js
|
|
1652
1242
|
var text2 = string();
|
|
1653
1243
|
var count2 = pipe(number(), integer(), minValue(0));
|
|
1654
|
-
var iso2 = /* @__PURE__ */ __name((
|
|
1244
|
+
var iso2 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
|
|
1655
1245
|
var meetingHit = strictObject({
|
|
1656
1246
|
/** The cue for a transcript passage, else the meeting. */
|
|
1657
1247
|
ref: reference,
|
|
@@ -1670,6 +1260,10 @@ var meetingHit = strictObject({
|
|
|
1670
1260
|
/** `corrected`: a query word matched only a garbled form of itself, listed in `corrections`. */
|
|
1671
1261
|
match: optional(picklist(["words", "corrected"])),
|
|
1672
1262
|
corrections: optional(array(strictObject({ from: text2, to: array(text2) }))),
|
|
1263
|
+
/** A search with `--model`: which searches found it, its similarity in meaning, and the passage meaning matched. */
|
|
1264
|
+
by: optional(array(picklist(["words", "meaning"]))),
|
|
1265
|
+
score: optional(nullable(number())),
|
|
1266
|
+
passage: optional(strictObject({ first: text2, last: text2 })),
|
|
1673
1267
|
source: optional(strictObject({
|
|
1674
1268
|
ref: reference,
|
|
1675
1269
|
title: nullable(text2),
|
|
@@ -1871,10 +1465,10 @@ var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
|
|
|
1871
1465
|
var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
|
|
1872
1466
|
const items = found.items.map(meetingHitItem);
|
|
1873
1467
|
const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
|
|
1874
|
-
const
|
|
1468
|
+
const pending = found.coverage.indexing === "pending";
|
|
1875
1469
|
const next = [
|
|
1876
1470
|
...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
|
|
1877
|
-
...
|
|
1471
|
+
...pending ? [
|
|
1878
1472
|
stepOf(SEARCH_AGAIN, {
|
|
1879
1473
|
command,
|
|
1880
1474
|
args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
|
|
@@ -1890,7 +1484,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1890
1484
|
...cursor === void 0 ? {} : { next_cursor: cursor }
|
|
1891
1485
|
},
|
|
1892
1486
|
...next.length > 0 ? { next } : {},
|
|
1893
|
-
...
|
|
1487
|
+
...pending ? {
|
|
1894
1488
|
missing: [
|
|
1895
1489
|
{
|
|
1896
1490
|
field: "excerpt",
|
|
@@ -1903,7 +1497,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1903
1497
|
};
|
|
1904
1498
|
}, "meetingHitsList");
|
|
1905
1499
|
|
|
1906
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1500
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
|
|
1907
1501
|
var joinKeyOf = /* @__PURE__ */ __name((url) => {
|
|
1908
1502
|
const parsed = urlOf(url);
|
|
1909
1503
|
if (!parsed)
|
|
@@ -1937,7 +1531,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
|
|
|
1937
1531
|
}
|
|
1938
1532
|
}, "urlOf");
|
|
1939
1533
|
|
|
1940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
|
|
1941
1535
|
var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
|
|
1942
1536
|
var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
|
|
1943
1537
|
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");
|
|
@@ -1946,8 +1540,8 @@ var calendarText = /* @__PURE__ */ __name((text6, { dropSecretLines = true } = {
|
|
|
1946
1540
|
if (!text6)
|
|
1947
1541
|
return null;
|
|
1948
1542
|
const kept = htmlToText(text6).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
|
|
1949
|
-
const
|
|
1950
|
-
return
|
|
1543
|
+
const joined = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
|
|
1544
|
+
return joined || null;
|
|
1951
1545
|
}, "calendarText");
|
|
1952
1546
|
var ENTRY_METADATA_KEYS = [
|
|
1953
1547
|
"colorId",
|
|
@@ -1974,12 +1568,237 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
|
|
|
1974
1568
|
return kept;
|
|
1975
1569
|
}, "entryMetadata");
|
|
1976
1570
|
|
|
1977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1978
|
-
|
|
1979
|
-
var
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1571
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/calls.js
|
|
1572
|
+
var CALL_DIRECTIONS = ["incoming", "outgoing", "internal"];
|
|
1573
|
+
var CALL_OUTCOMES = ["answered", "voicemail", "busy", "no_answer", "failed"];
|
|
1574
|
+
|
|
1575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/call-answers.js
|
|
1576
|
+
var count3 = pipe(number(), integer(), minValue(0));
|
|
1577
|
+
var ms = count3;
|
|
1578
|
+
var id = pipe(number(), integer(), minValue(1));
|
|
1579
|
+
var counts = /* @__PURE__ */ __name((keys) => strictObject(Object.fromEntries([...keys, "unknown"].map((key) => [key, count3]))), "counts");
|
|
1580
|
+
var maybe = exactOptional;
|
|
1581
|
+
var employee = strictObject({
|
|
1582
|
+
/** `extension:<number>`, or `identity:<id>` where the provider names no extension. */
|
|
1583
|
+
key: string(),
|
|
1584
|
+
name: nullable(string()),
|
|
1585
|
+
identity_id: nullable(id),
|
|
1586
|
+
extension: nullable(string()),
|
|
1587
|
+
calls: count3,
|
|
1588
|
+
incoming: count3,
|
|
1589
|
+
outgoing: count3,
|
|
1590
|
+
internal: count3,
|
|
1591
|
+
placed: maybe(count3),
|
|
1592
|
+
answered: maybe(count3),
|
|
1593
|
+
rang_not_answered: maybe(count3),
|
|
1594
|
+
talk_ms: maybe(ms),
|
|
1595
|
+
mean_talk_ms: maybe(nullable(ms)),
|
|
1596
|
+
mean_wait_ms: maybe(nullable(ms)),
|
|
1597
|
+
max_wait_ms: maybe(nullable(ms))
|
|
1598
|
+
});
|
|
1599
|
+
var periodFields = {
|
|
1600
|
+
calls: count3,
|
|
1601
|
+
incoming: count3,
|
|
1602
|
+
outgoing: count3,
|
|
1603
|
+
internal: count3,
|
|
1604
|
+
answered: maybe(count3),
|
|
1605
|
+
missed: maybe(count3),
|
|
1606
|
+
talk_ms: maybe(ms)
|
|
1607
|
+
};
|
|
1608
|
+
var callRef = strictObject({ ref: reference, meeting_id: id, started_at: nullable(isoTime) });
|
|
1609
|
+
var callStatsSchema = strictObject({
|
|
1610
|
+
time_zone: string(),
|
|
1611
|
+
callback_within_ms: ms,
|
|
1612
|
+
short_call_under_ms: ms,
|
|
1613
|
+
calls: count3,
|
|
1614
|
+
/** Selected meetings that are not calls. */
|
|
1615
|
+
not_calls: count3,
|
|
1616
|
+
/** How many calls give each field; `roles` says who placed, answered and rang. */
|
|
1617
|
+
known: strictObject({
|
|
1618
|
+
direction: count3,
|
|
1619
|
+
outcome: count3,
|
|
1620
|
+
wait_ms: count3,
|
|
1621
|
+
talk_ms: count3,
|
|
1622
|
+
duration_ms: count3,
|
|
1623
|
+
roles: count3
|
|
1624
|
+
}),
|
|
1625
|
+
by_direction: maybe(counts(CALL_DIRECTIONS)),
|
|
1626
|
+
by_outcome: maybe(counts(CALL_OUTCOMES)),
|
|
1627
|
+
talk_ms: maybe(ms),
|
|
1628
|
+
mean_talk_ms: maybe(ms),
|
|
1629
|
+
duration_ms: maybe(ms),
|
|
1630
|
+
mean_wait_ms: maybe(nullable(ms)),
|
|
1631
|
+
max_wait_ms: maybe(nullable(ms)),
|
|
1632
|
+
short_calls: maybe(count3),
|
|
1633
|
+
employees: array(employee),
|
|
1634
|
+
/** Hours 0–23 in `time_zone`. */
|
|
1635
|
+
hours: array(strictObject({ hour: pipe(count3, maxValue(23)), ...periodFields })),
|
|
1636
|
+
/** `YYYY-MM-DD` in `time_zone`, the days with a call. */
|
|
1637
|
+
days: array(strictObject({ date: string(), ...periodFields })),
|
|
1638
|
+
missed: maybe(strictObject({
|
|
1639
|
+
calls: count3,
|
|
1640
|
+
called_back: count3,
|
|
1641
|
+
not_called_back: count3,
|
|
1642
|
+
unknown_callback: count3,
|
|
1643
|
+
unknown_outcome: count3,
|
|
1644
|
+
/** Newest first. */
|
|
1645
|
+
items: array(strictObject({
|
|
1646
|
+
...callRef.entries,
|
|
1647
|
+
outcome: picklist(["voicemail", "busy", "no_answer"]),
|
|
1648
|
+
client: nullable(strictObject({ key: string(), name: nullable(string()) })),
|
|
1649
|
+
rang: array(string()),
|
|
1650
|
+
called_back: maybe(boolean()),
|
|
1651
|
+
callback: maybe(nullable(strictObject({ ...callRef.entries, after_ms: ms, direction: picklist(["outgoing", "incoming"]) })))
|
|
1652
|
+
})),
|
|
1653
|
+
has_more: boolean()
|
|
1654
|
+
}))
|
|
1655
|
+
});
|
|
1656
|
+
var callStats = callStatsSchema;
|
|
1657
|
+
|
|
1658
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/stats.js
|
|
1659
|
+
var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
1660
|
+
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
1661
|
+
const zone = timeZone ?? "UTC";
|
|
1662
|
+
try {
|
|
1663
|
+
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
1664
|
+
} catch {
|
|
1665
|
+
throw new CliError("validation_error", "expected an IANA time zone such as Europe/Madrid");
|
|
1666
|
+
}
|
|
1667
|
+
return zone;
|
|
1668
|
+
}, "zoneOf");
|
|
1669
|
+
var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
1670
|
+
var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
1671
|
+
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
1672
|
+
const day = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day));
|
|
1673
|
+
return new Date(day - DAYS.indexOf(parts.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
1674
|
+
}, "weekStart");
|
|
1675
|
+
var dayKey = /* @__PURE__ */ __name((at, format) => {
|
|
1676
|
+
const parts = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
1677
|
+
return `${parts.year}-${parts.month}-${parts.day}`;
|
|
1678
|
+
}, "dayKey");
|
|
1679
|
+
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
1680
|
+
timeZone: zone,
|
|
1681
|
+
year: "numeric",
|
|
1682
|
+
month: "2-digit",
|
|
1683
|
+
day: "2-digit",
|
|
1684
|
+
weekday: "short"
|
|
1685
|
+
}), "zoneFormat");
|
|
1686
|
+
var NO_SERIES = "no-series";
|
|
1687
|
+
var MOST_COUNT_ROWS = 100;
|
|
1688
|
+
var minutesOf = /* @__PURE__ */ __name((ms2) => Math.round(ms2 / 6e4), "minutesOf");
|
|
1689
|
+
var meanOf = /* @__PURE__ */ __name((ms2, timed) => timed === 0 ? null : Math.round(ms2 / timed / 6e3) / 10, "meanOf");
|
|
1690
|
+
var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
|
|
1691
|
+
if (!MEETING_COUNTS_GROUPINGS.includes(by))
|
|
1692
|
+
throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
|
|
1693
|
+
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
1694
|
+
throw new CliError("validation_error", "--limit is a positive number");
|
|
1695
|
+
const zone = zoneOf(timeZone);
|
|
1696
|
+
const format = zoneFormat(zone);
|
|
1697
|
+
const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
|
|
1698
|
+
const add = /* @__PURE__ */ __name((into, meeting2) => {
|
|
1699
|
+
into.meetings += 1;
|
|
1700
|
+
if (meeting2.durationMs !== null) {
|
|
1701
|
+
into.ms += Math.max(0, meeting2.durationMs);
|
|
1702
|
+
into.timed += 1;
|
|
1703
|
+
}
|
|
1704
|
+
if (meeting2.transcribed)
|
|
1705
|
+
into.transcripts += 1;
|
|
1706
|
+
}, "add");
|
|
1707
|
+
const total = { ...sum(), name: null };
|
|
1708
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1709
|
+
for (const meeting2 of meetings) {
|
|
1710
|
+
add(total, meeting2);
|
|
1711
|
+
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);
|
|
1712
|
+
if (key === null)
|
|
1713
|
+
continue;
|
|
1714
|
+
const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
|
|
1715
|
+
add(group, meeting2);
|
|
1716
|
+
groups.set(key, group);
|
|
1717
|
+
}
|
|
1718
|
+
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));
|
|
1719
|
+
const kept = ordered.slice(0, limit);
|
|
1720
|
+
if (by !== "series")
|
|
1721
|
+
kept.reverse();
|
|
1722
|
+
const counted = /* @__PURE__ */ __name(({ meetings: count7, ms: ms2, timed, transcripts }) => ({
|
|
1723
|
+
meetings: count7,
|
|
1724
|
+
minutes: minutesOf(ms2),
|
|
1725
|
+
meanMinutes: meanOf(ms2, timed),
|
|
1726
|
+
transcripts
|
|
1727
|
+
}), "counted");
|
|
1728
|
+
return {
|
|
1729
|
+
by,
|
|
1730
|
+
timeZone: zone,
|
|
1731
|
+
...counted(total),
|
|
1732
|
+
rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
|
|
1733
|
+
hasMore: ordered.length > limit
|
|
1734
|
+
};
|
|
1735
|
+
}, "aggregateMeetingCounts");
|
|
1736
|
+
var UNKNOWN_SPEAKER = "unknown";
|
|
1737
|
+
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");
|
|
1738
|
+
var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
1739
|
+
const zone = zoneOf(timeZone);
|
|
1740
|
+
const format = zoneFormat(zone);
|
|
1741
|
+
const speakers = /* @__PURE__ */ new Map();
|
|
1742
|
+
const weeks = /* @__PURE__ */ new Map();
|
|
1743
|
+
const meetings = /* @__PURE__ */ new Set();
|
|
1744
|
+
let lines = 0;
|
|
1745
|
+
let words2 = 0;
|
|
1746
|
+
let talkMs = 0;
|
|
1747
|
+
for (const row of rows) {
|
|
1748
|
+
const talk = Math.max(0, row.endMs - row.startMs);
|
|
1749
|
+
meetings.add(row.meetingId);
|
|
1750
|
+
lines += 1;
|
|
1751
|
+
words2 += row.words;
|
|
1752
|
+
talkMs += talk;
|
|
1753
|
+
const who = speakerOf(row);
|
|
1754
|
+
const held = speakers.get(who.key) ?? {
|
|
1755
|
+
key: who.key,
|
|
1756
|
+
name: who.name ?? null,
|
|
1757
|
+
personId: row.personId,
|
|
1758
|
+
identityId: row.personId === null ? row.identityId : null,
|
|
1759
|
+
meetings: 0,
|
|
1760
|
+
lines: 0,
|
|
1761
|
+
words: 0,
|
|
1762
|
+
talkMs: 0,
|
|
1763
|
+
share: 0,
|
|
1764
|
+
seen: /* @__PURE__ */ new Set()
|
|
1765
|
+
};
|
|
1766
|
+
held.seen.add(row.meetingId);
|
|
1767
|
+
held.lines += 1;
|
|
1768
|
+
held.words += row.words;
|
|
1769
|
+
held.talkMs += talk;
|
|
1770
|
+
speakers.set(who.key, held);
|
|
1771
|
+
if (row.startedAt !== null) {
|
|
1772
|
+
const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
|
|
1773
|
+
week.meetings.add(row.meetingId);
|
|
1774
|
+
week.talkMs += talk;
|
|
1775
|
+
weeks.set(weekStart(row.startedAt, format), week);
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
return {
|
|
1779
|
+
timeZone: zone,
|
|
1780
|
+
meetings: meetings.size,
|
|
1781
|
+
lines,
|
|
1782
|
+
words: words2,
|
|
1783
|
+
talkMs,
|
|
1784
|
+
speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
|
|
1785
|
+
...speaker,
|
|
1786
|
+
meetings: seen.size,
|
|
1787
|
+
share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
|
|
1788
|
+
})).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
|
|
1789
|
+
weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
|
|
1790
|
+
};
|
|
1791
|
+
}, "aggregateMeetingStats");
|
|
1792
|
+
|
|
1793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/call-stats.js
|
|
1794
|
+
var CALLBACK_WITHIN_MS = 24 * 60 * 60 * 1e3;
|
|
1795
|
+
|
|
1796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
|
|
1797
|
+
import { createHash } from "node:crypto";
|
|
1798
|
+
var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
|
|
1799
|
+
reference: cue2.reference,
|
|
1800
|
+
transcriptId: cue2.transcriptId,
|
|
1801
|
+
contentHash: cue2.contentHash,
|
|
1983
1802
|
position: cue2.position,
|
|
1984
1803
|
startMs: cue2.startMs,
|
|
1985
1804
|
endMs: cue2.endMs,
|
|
@@ -1988,7 +1807,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
|
|
|
1988
1807
|
text: cue2.text
|
|
1989
1808
|
})).digest("hex"), "meetingCueFingerprint");
|
|
1990
1809
|
|
|
1991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
|
|
1992
1811
|
var EVENT_QUERY = defineQuery({
|
|
1993
1812
|
entity: "event",
|
|
1994
1813
|
backend: "sql",
|
|
@@ -2004,7 +1823,8 @@ var EVENT_QUERY = defineQuery({
|
|
|
2004
1823
|
]
|
|
2005
1824
|
});
|
|
2006
1825
|
|
|
2007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
|
|
1827
|
+
var PARTICIPANT_RESPONSES = ["needs-action", "accepted", "tentative", "declined", "delegated"];
|
|
2008
1828
|
var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
|
|
2009
1829
|
var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
2010
1830
|
if (entry.recurrenceEndsAt !== null)
|
|
@@ -2013,8 +1833,8 @@ var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
|
2013
1833
|
const until = rule === void 0 ? null : UNTIL.exec(rule.slice("RRULE:".length));
|
|
2014
1834
|
if (!until)
|
|
2015
1835
|
return Number.POSITIVE_INFINITY;
|
|
2016
|
-
const [, year, month,
|
|
2017
|
-
return Date.UTC(Number(year), Number(month) - 1, Number(
|
|
1836
|
+
const [, year, month, day, hour = "23", minute = "59", second = "59"] = until;
|
|
1837
|
+
return Date.UTC(Number(year), Number(month) - 1, Number(day), Number(hour), Number(minute), Number(second)) + 864e5;
|
|
2018
1838
|
}, "seriesEnd");
|
|
2019
1839
|
var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
2020
1840
|
if (entry.kind === "occurrence" && !entry.exception)
|
|
@@ -2027,7 +1847,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
|
2027
1847
|
return Math.max(entry.endsAt ?? start, start + 1) > window.from;
|
|
2028
1848
|
}, "entryInWindow");
|
|
2029
1849
|
|
|
2030
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/events.js
|
|
2031
1851
|
var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(), { create = true } = {}) => {
|
|
2032
1852
|
const current = await store.meeting(details.meeting.id);
|
|
2033
1853
|
if (!current)
|
|
@@ -2072,7 +1892,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now(),
|
|
|
2072
1892
|
return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
|
|
2073
1893
|
}, "linkEvent");
|
|
2074
1894
|
|
|
2075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1895
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
|
|
2076
1896
|
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text6) => text6.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
|
|
2077
1897
|
var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
|
|
2078
1898
|
if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
|
|
@@ -2096,7 +1916,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
|
|
|
2096
1916
|
};
|
|
2097
1917
|
}, "validateMeetingParticipantSearch");
|
|
2098
1918
|
|
|
2099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/reads.js
|
|
2100
1920
|
var MeetingError = class extends CliError {
|
|
2101
1921
|
static {
|
|
2102
1922
|
__name(this, "MeetingError");
|
|
@@ -2227,7 +2047,7 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id4, accountId)
|
|
|
2227
2047
|
return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
|
|
2228
2048
|
}, "meetingSummaryAnswer");
|
|
2229
2049
|
|
|
2230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/export.js
|
|
2231
2051
|
var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
2232
2052
|
if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
|
|
2233
2053
|
throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
|
|
@@ -2289,30 +2109,30 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
|
2289
2109
|
text: row.text
|
|
2290
2110
|
})));
|
|
2291
2111
|
} else {
|
|
2292
|
-
const
|
|
2112
|
+
const parts = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
|
|
2293
2113
|
if (details.meeting.description !== null)
|
|
2294
|
-
|
|
2114
|
+
parts.push("## Description", quote(details.meeting.description));
|
|
2295
2115
|
for (const summary of details.summaries) {
|
|
2296
|
-
|
|
2116
|
+
parts.push(`## ${heading(summary.title ?? "Summary")}`);
|
|
2297
2117
|
if (summary.content !== null)
|
|
2298
|
-
|
|
2118
|
+
parts.push(quote(summary.content));
|
|
2299
2119
|
else {
|
|
2300
2120
|
if (summary.overview !== null)
|
|
2301
|
-
|
|
2121
|
+
parts.push(quote(summary.overview));
|
|
2302
2122
|
for (const section of summary.sections)
|
|
2303
|
-
|
|
2123
|
+
parts.push(`### ${heading(section.label)}`, quote(section.text));
|
|
2304
2124
|
if (summary.nextSteps.length > 0)
|
|
2305
|
-
|
|
2125
|
+
parts.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
|
|
2306
2126
|
}
|
|
2307
2127
|
}
|
|
2308
2128
|
for (const part of transcripts) {
|
|
2309
|
-
|
|
2129
|
+
parts.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
|
|
2310
2130
|
if (part.transcript.supersededAt !== null)
|
|
2311
|
-
|
|
2131
|
+
parts.push("Version: superseded");
|
|
2312
2132
|
for (const row of [...part.rows].sort((a, b) => a.position - b.position))
|
|
2313
|
-
|
|
2133
|
+
parts.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
|
|
2314
2134
|
}
|
|
2315
|
-
content = `${
|
|
2135
|
+
content = `${parts.join("\n\n")}
|
|
2316
2136
|
`;
|
|
2317
2137
|
}
|
|
2318
2138
|
return {
|
|
@@ -2323,10 +2143,10 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
|
2323
2143
|
};
|
|
2324
2144
|
}, "exportMeeting");
|
|
2325
2145
|
|
|
2326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
2327
2147
|
import { createHash as createHash2 } from "node:crypto";
|
|
2328
2148
|
|
|
2329
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
|
|
2330
2150
|
var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
2331
2151
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
|
|
2332
2152
|
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
|
|
@@ -2337,7 +2157,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
|
2337
2157
|
return new Date(value).toISOString();
|
|
2338
2158
|
}, "meetingTimestamp");
|
|
2339
2159
|
|
|
2340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
2341
2161
|
var TASK_TYPES = ["bug", "feature", "chore"];
|
|
2342
2162
|
var invalid3 = /* @__PURE__ */ __name((message) => {
|
|
2343
2163
|
throw new CliError("validation_error", message);
|
|
@@ -2351,17 +2171,17 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
|
|
|
2351
2171
|
var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
|
|
2352
2172
|
var findingWhere = /* @__PURE__ */ __name((of) => {
|
|
2353
2173
|
const id4 = typeof of.id === "string" ? of.id : null;
|
|
2354
|
-
const
|
|
2174
|
+
const kind2 = typeof of.kind === "string" ? of.kind : null;
|
|
2355
2175
|
return {
|
|
2356
|
-
where: id4 ||
|
|
2357
|
-
named: { ...id4 ? { finding: id4 } : {}, ...
|
|
2176
|
+
where: id4 || kind2 ? ` in ${[id4, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
|
|
2177
|
+
named: { ...id4 ? { finding: id4 } : {}, ...kind2 ? { kind: kind2 } : {} }
|
|
2358
2178
|
};
|
|
2359
2179
|
}, "findingWhere");
|
|
2360
2180
|
var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
|
|
2361
|
-
const
|
|
2362
|
-
if (!
|
|
2181
|
+
const unknown = Object.keys(value).filter((key) => !allowed.includes(key));
|
|
2182
|
+
if (!unknown.length)
|
|
2363
2183
|
return;
|
|
2364
|
-
const fields =
|
|
2184
|
+
const fields = unknown.map(snakeCase);
|
|
2365
2185
|
const takes = allowed.map(snakeCase);
|
|
2366
2186
|
const { where, named } = findingWhere(of);
|
|
2367
2187
|
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 });
|
|
@@ -2407,17 +2227,17 @@ var validateFinding = /* @__PURE__ */ __name((finding, rules, ids2) => {
|
|
|
2407
2227
|
if (!finding || typeof finding !== "object")
|
|
2408
2228
|
return invalid3("a finding is an object");
|
|
2409
2229
|
const id4 = findingId(finding.id, ids2);
|
|
2410
|
-
const
|
|
2411
|
-
if (
|
|
2230
|
+
const project = finding.project === void 0 && rules.anySubject ? void 0 : findingText(finding.project, 64);
|
|
2231
|
+
if (project !== void 0 && !/^project:[1-9]\d*$/.test(project))
|
|
2412
2232
|
return invalid3("a finding names a project reference");
|
|
2413
2233
|
if (finding.subject !== void 0 && (!rules.anySubject || !SUBJECT.test(findingText(finding.subject, 80))))
|
|
2414
2234
|
return invalid3("a finding's subject is a person:, organization:, task: or project: reference");
|
|
2415
|
-
if (finding.kind === "task" &&
|
|
2235
|
+
if (finding.kind === "task" && project === void 0 && !rules.inboxTasks)
|
|
2416
2236
|
return invalid3("a task finding names the project the task goes in");
|
|
2417
2237
|
const evidence = validEvidence(finding.evidence, rules);
|
|
2418
2238
|
const base = {
|
|
2419
2239
|
id: id4,
|
|
2420
|
-
...
|
|
2240
|
+
...project === void 0 ? {} : { project },
|
|
2421
2241
|
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
2422
2242
|
evidence
|
|
2423
2243
|
};
|
|
@@ -2512,7 +2332,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
|
|
|
2512
2332
|
var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
|
|
2513
2333
|
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
2514
2334
|
|
|
2515
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/findings.js
|
|
2516
2336
|
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
2517
2337
|
var cue = /* @__PURE__ */ __name((raw) => {
|
|
2518
2338
|
const reference2 = canonicalMeetingReference(raw);
|
|
@@ -2523,119 +2343,7 @@ var cue = /* @__PURE__ */ __name((raw) => {
|
|
|
2523
2343
|
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
2524
2344
|
var meetingFindingFingerprint = findingFingerprint;
|
|
2525
2345
|
|
|
2526
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2527
|
-
var context = {
|
|
2528
|
-
command: "search meetings",
|
|
2529
|
-
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
2530
|
-
};
|
|
2531
|
-
var words = ["term", "phrase"];
|
|
2532
|
-
var MOST_LINES_APART = 20;
|
|
2533
|
-
var near = /* @__PURE__ */ __name((node) => {
|
|
2534
|
-
if (node.slop !== void 0 && node.slop > MOST_LINES_APART)
|
|
2535
|
-
queryError("query.invalid-number", node.span, `words at most ${MOST_LINES_APART} lines apart: "a b"~${MOST_LINES_APART}`, context);
|
|
2536
|
-
}, "near");
|
|
2537
|
-
var MEETING_HIT_QUERY = defineQuery({
|
|
2538
|
-
entity: "meeting_hit",
|
|
2539
|
-
backend: "sql",
|
|
2540
|
-
fields: [
|
|
2541
|
-
{
|
|
2542
|
-
name: "text",
|
|
2543
|
-
type: "txt",
|
|
2544
|
-
operators: words,
|
|
2545
|
-
example: "text:budget",
|
|
2546
|
-
relation: "a passage with the word in any form, or a spelling speech recognition garbled",
|
|
2547
|
-
validate: near
|
|
2548
|
-
},
|
|
2549
|
-
{
|
|
2550
|
-
name: "exact",
|
|
2551
|
-
type: "txt",
|
|
2552
|
-
operators: words,
|
|
2553
|
-
example: "exact:budget",
|
|
2554
|
-
relation: "a passage with the word as typed: no other forms, no garbled spellings",
|
|
2555
|
-
validate: near
|
|
2556
|
-
},
|
|
2557
|
-
{
|
|
2558
|
-
name: "from",
|
|
2559
|
-
type: "kw",
|
|
2560
|
-
operators: words,
|
|
2561
|
-
example: 'from:"Alice Synthetic"',
|
|
2562
|
-
relation: "a line said or a chat message written by this person; attendance is --identity-id"
|
|
2563
|
-
}
|
|
2564
|
-
]
|
|
2565
|
-
});
|
|
2566
|
-
var MEETING_FIELDS = defineQuery({
|
|
2567
|
-
entity: "meeting_hit",
|
|
2568
|
-
backend: "sql",
|
|
2569
|
-
fields: [
|
|
2570
|
-
...MEETING_HIT_QUERY.fields,
|
|
2571
|
-
{
|
|
2572
|
-
name: "date",
|
|
2573
|
-
type: "time",
|
|
2574
|
-
operators: ["term", "range"],
|
|
2575
|
-
example: "date>=30d",
|
|
2576
|
-
relation: "meetings that started then; the same as --since-time and --until-time"
|
|
2577
|
-
},
|
|
2578
|
-
...["project", "tag", "topic"].map((name) => ({
|
|
2579
|
-
name,
|
|
2580
|
-
type: "kw",
|
|
2581
|
-
operators: words,
|
|
2582
|
-
example: `${name}:"Example name"`,
|
|
2583
|
-
relation: `meetings in this ${name}, by name or alias; the same as --${name}`
|
|
2584
|
-
}))
|
|
2585
|
-
]
|
|
2586
|
-
});
|
|
2587
|
-
var LIFTED = /* @__PURE__ */ new Set(["date", "project", "tag", "topic"]);
|
|
2588
|
-
var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
|
|
2589
|
-
var liftMeetingFields = /* @__PURE__ */ __name((query, request, now, timezone) => {
|
|
2590
|
-
let ast;
|
|
2591
|
-
try {
|
|
2592
|
-
ast = validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_FIELDS, context);
|
|
2593
|
-
} catch (error) {
|
|
2594
|
-
if (error instanceof CliError)
|
|
2595
|
-
return { query, request };
|
|
2596
|
-
throw error;
|
|
2597
|
-
}
|
|
2598
|
-
const top = ast.root.kind === "boolean" ? ast.root.clauses : [{ occur: "must", node: ast.root }];
|
|
2599
|
-
const lifted = top.filter((clause) => clause.node.kind === "predicate" && LIFTED.has(clause.node.field));
|
|
2600
|
-
const misplaced = /* @__PURE__ */ __name((node, nested) => node.kind === "predicate" ? nested && LIFTED.has(node.field) ? node : void 0 : node.clauses.map((clause) => misplaced(clause.node, true)).find(Boolean), "misplaced");
|
|
2601
|
-
const wrong = lifted.find((clause) => clause.occur !== "must")?.node ?? top.map((clause) => clause.node.kind === "boolean" ? misplaced(clause.node, true) : void 0).find(Boolean);
|
|
2602
|
-
if (wrong)
|
|
2603
|
-
queryError("query.unsupported-field", wrong.span, `${wrong.field}: chooses meetings; join it to the words with AND, outside OR, NOT and groups`, context);
|
|
2604
|
-
if (!lifted.length)
|
|
2605
|
-
return { query, request };
|
|
2606
|
-
const next = { ...request };
|
|
2607
|
-
const once = /* @__PURE__ */ __name((name, flag2) => {
|
|
2608
|
-
if (next[name] !== void 0)
|
|
2609
|
-
throw new CliError("validation_error", `give ${flag2.replace(/^--/, "")} once: as ${flag2} or in the query`);
|
|
2610
|
-
}, "once");
|
|
2611
|
-
for (const { node } of lifted) {
|
|
2612
|
-
if (node.field === "date") {
|
|
2613
|
-
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive !== false, node.upper_inclusive !== false, timezoneOf(timezone), node.span, now);
|
|
2614
|
-
if (range.lower !== void 0) {
|
|
2615
|
-
once("since", "--since-time");
|
|
2616
|
-
next.since = range.lower + (range.lower_inclusive ? 0 : 1);
|
|
2617
|
-
}
|
|
2618
|
-
if (range.upper !== void 0) {
|
|
2619
|
-
once("until", "--until-time");
|
|
2620
|
-
next.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
2621
|
-
}
|
|
2622
|
-
} else {
|
|
2623
|
-
const field = node.field;
|
|
2624
|
-
once(field, `--${field}`);
|
|
2625
|
-
next[field] = node.value;
|
|
2626
|
-
}
|
|
2627
|
-
}
|
|
2628
|
-
let rest = query;
|
|
2629
|
-
for (const { node } of [...lifted].sort((a, b) => b.node.span.start - a.node.span.start))
|
|
2630
|
-
rest = `${rest.slice(0, node.span.start)}${rest.slice(node.span.end)}`;
|
|
2631
|
-
rest = rest.replace(/(^|\s)\+(?=\s|$)/g, "$1").replace(/^(?:\s*(?:AND\b|&&))+|(?:(?:\bAND|&&)\s*)+$/g, "").replace(/(?:\bAND|&&)(\s+(?:AND\b|&&))+/g, "AND").trim();
|
|
2632
|
-
if (!rest)
|
|
2633
|
-
throw new CliError("validation_error", "give words to find besides date:, project:, tag: and topic:");
|
|
2634
|
-
return { query: rest, request: next };
|
|
2635
|
-
}, "liftMeetingFields");
|
|
2636
|
-
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
2637
|
-
|
|
2638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/meetings/language.js
|
|
2346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/language.js
|
|
2639
2347
|
var LATIN_WORDS = {
|
|
2640
2348
|
en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
|
|
2641
2349
|
es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
|
|
@@ -2684,7 +2392,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
|
|
|
2684
2392
|
return null;
|
|
2685
2393
|
}, "transcriptLanguage");
|
|
2686
2394
|
|
|
2687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
|
|
2688
2396
|
var contentHash = /* @__PURE__ */ __name(async (text6) => {
|
|
2689
2397
|
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text6));
|
|
2690
2398
|
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -2692,8 +2400,8 @@ var contentHash = /* @__PURE__ */ __name(async (text6) => {
|
|
|
2692
2400
|
var speakerPosition = /* @__PURE__ */ __name((name, participants) => {
|
|
2693
2401
|
if (name === null)
|
|
2694
2402
|
return null;
|
|
2695
|
-
const
|
|
2696
|
-
return
|
|
2403
|
+
const matches2 = participants.flatMap((p, i) => p.displayName === name ? [i] : []);
|
|
2404
|
+
return matches2.length === 1 ? matches2[0] ?? null : null;
|
|
2697
2405
|
}, "speakerPosition");
|
|
2698
2406
|
var transcriptInput = /* @__PURE__ */ __name(async (lines, participants, source, hashText = JSON.stringify(lines), format = null) => ({
|
|
2699
2407
|
source,
|
|
@@ -2715,13 +2423,13 @@ var transcriptInput = /* @__PURE__ */ __name(async (lines, participants, source,
|
|
|
2715
2423
|
}))
|
|
2716
2424
|
}), "transcriptInput");
|
|
2717
2425
|
var timestamp2 = /* @__PURE__ */ __name((value) => {
|
|
2718
|
-
const
|
|
2719
|
-
if (!Number.isFinite(
|
|
2426
|
+
const time = Date.parse(value);
|
|
2427
|
+
if (!Number.isFinite(time))
|
|
2720
2428
|
throw new Error("Invalid meeting timestamp");
|
|
2721
|
-
return
|
|
2429
|
+
return time;
|
|
2722
2430
|
}, "timestamp");
|
|
2723
2431
|
|
|
2724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2432
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
|
|
2725
2433
|
var TranscriptTextError = class extends Error {
|
|
2726
2434
|
static {
|
|
2727
2435
|
__name(this, "TranscriptTextError");
|
|
@@ -2776,7 +2484,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
|
2776
2484
|
return { header, lines };
|
|
2777
2485
|
}, "parseTranscriptText");
|
|
2778
2486
|
|
|
2779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2487
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
|
|
2780
2488
|
var VttError = class extends Error {
|
|
2781
2489
|
static {
|
|
2782
2490
|
__name(this, "VttError");
|
|
@@ -2789,8 +2497,8 @@ var millis = /* @__PURE__ */ __name((stamp, lineNo) => {
|
|
|
2789
2497
|
const match = TIMESTAMP.exec(stamp);
|
|
2790
2498
|
if (!match)
|
|
2791
2499
|
throw new VttError(`line ${lineNo}: "${stamp}" is not a WebVTT timestamp`);
|
|
2792
|
-
const [, hours = "0", minutes = "0", seconds = "0",
|
|
2793
|
-
return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(
|
|
2500
|
+
const [, hours = "0", minutes = "0", seconds = "0", ms2 = "0"] = match;
|
|
2501
|
+
return ((Number(hours) * 60 + Number(minutes)) * 60 + Number(seconds)) * 1e3 + Number(ms2);
|
|
2794
2502
|
}, "millis");
|
|
2795
2503
|
var splitSpeaker = /* @__PURE__ */ __name((text6) => {
|
|
2796
2504
|
const firstLine = text6.split("\n", 1)[0] ?? "";
|
|
@@ -2828,7 +2536,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
|
2828
2536
|
return cues;
|
|
2829
2537
|
}, "parseVtt");
|
|
2830
2538
|
|
|
2831
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/import.js
|
|
2832
2540
|
var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
|
|
2833
2541
|
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
2834
2542
|
for (const file of files) {
|
|
@@ -2861,61 +2569,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
|
|
|
2861
2569
|
return report;
|
|
2862
2570
|
}, "importFiles");
|
|
2863
2571
|
|
|
2864
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/links.js
|
|
2865
2573
|
var CHAT_MESSAGES_READ = 1e5;
|
|
2866
2574
|
|
|
2867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2868
|
-
var nonempty = /* @__PURE__ */ __name((value, name) => {
|
|
2869
|
-
if (typeof value !== "string" || !value.trim())
|
|
2870
|
-
throw new CliError("validation_error", `${name} must be nonempty`);
|
|
2871
|
-
return value;
|
|
2872
|
-
}, "nonempty");
|
|
2873
|
-
var validateMeetingChange = /* @__PURE__ */ __name((change, create) => {
|
|
2874
|
-
if (!change || typeof change !== "object" || Array.isArray(change) || Object.keys(change).some((key) => !["title", "kind", "startTime", "durationMinutes", "timezone", "agenda"].includes(key)))
|
|
2875
|
-
throw new CliError("validation_error", "unsupported meeting change field");
|
|
2876
|
-
const result = {};
|
|
2877
|
-
if (change.title !== void 0)
|
|
2878
|
-
result.title = nonempty(change.title, "meeting title");
|
|
2879
|
-
if (create && result.title === void 0)
|
|
2880
|
-
throw new CliError("validation_error", "meeting title is required");
|
|
2881
|
-
if (change.kind !== void 0) {
|
|
2882
|
-
if (change.kind !== "instant" && change.kind !== "scheduled")
|
|
2883
|
-
throw new CliError("validation_error", "only instant or scheduled meeting kinds are supported");
|
|
2884
|
-
result.kind = change.kind;
|
|
2885
|
-
}
|
|
2886
|
-
if (change.startTime !== void 0) {
|
|
2887
|
-
result.startTime = meetingTimestamp(change.startTime, "meeting start");
|
|
2888
|
-
}
|
|
2889
|
-
if (change.durationMinutes !== void 0) {
|
|
2890
|
-
if (!Number.isSafeInteger(change.durationMinutes) || change.durationMinutes <= 0 || change.durationMinutes > 1440)
|
|
2891
|
-
throw new CliError("validation_error", "meeting duration must be an integer from 1 to 1440 minutes");
|
|
2892
|
-
result.durationMinutes = change.durationMinutes;
|
|
2893
|
-
}
|
|
2894
|
-
if (change.timezone !== void 0) {
|
|
2895
|
-
if (typeof change.timezone !== "string" || !change.timezone.trim())
|
|
2896
|
-
throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
|
|
2897
|
-
try {
|
|
2898
|
-
new Intl.DateTimeFormat("en", { timeZone: change.timezone }).format();
|
|
2899
|
-
} catch {
|
|
2900
|
-
throw new CliError("validation_error", "meeting timezone must be a valid IANA timezone");
|
|
2901
|
-
}
|
|
2902
|
-
result.timezone = change.timezone;
|
|
2903
|
-
}
|
|
2904
|
-
if (change.agenda !== void 0) {
|
|
2905
|
-
if (typeof change.agenda !== "string")
|
|
2906
|
-
throw new CliError("validation_error", "meeting agenda must be text");
|
|
2907
|
-
result.agenda = change.agenda;
|
|
2908
|
-
}
|
|
2909
|
-
if (create) {
|
|
2910
|
-
result.kind ??= "scheduled";
|
|
2911
|
-
if (result.kind === "scheduled" && result.startTime === void 0)
|
|
2912
|
-
throw new CliError("validation_error", "scheduled meeting start is required");
|
|
2913
|
-
} else if (!Object.keys(result).length)
|
|
2914
|
-
throw new CliError("validation_error", "at least one meeting change is required");
|
|
2915
|
-
return Object.freeze(result);
|
|
2916
|
-
}, "validateMeetingChange");
|
|
2917
|
-
|
|
2918
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
2575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
2919
2576
|
var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
|
|
2920
2577
|
const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
|
|
2921
2578
|
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)))
|
|
@@ -2928,7 +2585,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
|
|
|
2928
2585
|
throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
|
|
2929
2586
|
}, "validateMeetingPassage");
|
|
2930
2587
|
|
|
2931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2588
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
|
|
2932
2589
|
var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
2933
2590
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
2934
2591
|
throw new CliError("validation_error", "meeting preparation context is required");
|
|
@@ -2953,43 +2610,43 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
|
2953
2610
|
return { ...input, limit, maxReadBytes };
|
|
2954
2611
|
}, "validateMeetingPreparationContext");
|
|
2955
2612
|
|
|
2956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2957
|
-
var
|
|
2958
|
-
var
|
|
2613
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
|
|
2614
|
+
var count4 = pipe(number(), integer(), minValue(0));
|
|
2615
|
+
var id2 = pipe(string(), minLength(1));
|
|
2959
2616
|
var meetingProjectEvidence = strictObject({
|
|
2960
2617
|
schema_version: literal(1),
|
|
2961
2618
|
kind: literal("meeting_project_evidence"),
|
|
2962
|
-
account_id:
|
|
2619
|
+
account_id: id2,
|
|
2963
2620
|
query: string(),
|
|
2964
|
-
project: strictObject({ id, name: string(), key: nullable(string()) }),
|
|
2621
|
+
project: strictObject({ id: id2, name: string(), key: nullable(string()) }),
|
|
2965
2622
|
term: strictObject({
|
|
2966
2623
|
name: string(),
|
|
2967
2624
|
kind: picklist(["canonical", "key", "alias"]),
|
|
2968
|
-
alias_id: optional(
|
|
2625
|
+
alias_id: optional(id2)
|
|
2969
2626
|
}),
|
|
2970
2627
|
hits: array(meetingHit),
|
|
2971
2628
|
association: literal("unconfirmed-word-evidence"),
|
|
2972
|
-
vocabulary_fingerprint:
|
|
2629
|
+
vocabulary_fingerprint: id2,
|
|
2973
2630
|
selection: strictObject({
|
|
2974
|
-
meeting_id: optional(
|
|
2975
|
-
identity_id: optional(
|
|
2976
|
-
person_id: optional(
|
|
2977
|
-
tag_id: optional(
|
|
2978
|
-
event_id: optional(
|
|
2979
|
-
series_id: optional(
|
|
2631
|
+
meeting_id: optional(id2),
|
|
2632
|
+
identity_id: optional(id2),
|
|
2633
|
+
person_id: optional(id2),
|
|
2634
|
+
tag_id: optional(id2),
|
|
2635
|
+
event_id: optional(id2),
|
|
2636
|
+
series_id: optional(id2),
|
|
2980
2637
|
since: optional(isoTime),
|
|
2981
2638
|
until: optional(isoTime)
|
|
2982
2639
|
}),
|
|
2983
|
-
limits: strictObject({ limit:
|
|
2640
|
+
limits: strictObject({ limit: count4, max_read_bytes: count4, max_vocabulary_read_bytes: count4, max_terms: count4 }),
|
|
2984
2641
|
page: pageSchema,
|
|
2985
2642
|
coverage: strictObject({
|
|
2986
2643
|
archive_completeness: literal("unknown"),
|
|
2987
2644
|
current_revisions: literal(true),
|
|
2988
2645
|
indexing: picklist(["ready", "pending"]),
|
|
2989
2646
|
index_completeness: literal("unknown"),
|
|
2990
|
-
term_index:
|
|
2991
|
-
terms_total:
|
|
2992
|
-
remaining_terms:
|
|
2647
|
+
term_index: count4,
|
|
2648
|
+
terms_total: count4,
|
|
2649
|
+
remaining_terms: count4,
|
|
2993
2650
|
duplicates: literal("may-repeat-between-terms")
|
|
2994
2651
|
})
|
|
2995
2652
|
});
|
|
@@ -3074,7 +2731,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
|
|
|
3074
2731
|
};
|
|
3075
2732
|
}, "meetingProjectEvidenceAnswer");
|
|
3076
2733
|
|
|
3077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
|
|
3078
2735
|
var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
3079
2736
|
const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
|
|
3080
2737
|
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) || [
|
|
@@ -3094,7 +2751,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
|
3094
2751
|
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
3095
2752
|
}, "validateMeetingHitSearch");
|
|
3096
2753
|
|
|
3097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
|
|
3098
2755
|
var ids = {
|
|
3099
2756
|
meeting_id: "meetingId",
|
|
3100
2757
|
identity_id: "participantIdentityId",
|
|
@@ -3130,8 +2787,8 @@ var MEETING_PROJECT_EVIDENCE_QUERY = defineQuery({
|
|
|
3130
2787
|
]
|
|
3131
2788
|
});
|
|
3132
2789
|
var requestKeys = /* @__PURE__ */ new Set(["query", "limit", "cursor", "maxReadBytes", "signal"]);
|
|
3133
|
-
var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((
|
|
3134
|
-
if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof
|
|
2790
|
+
var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project, request = {}, now = Date.now()) => {
|
|
2791
|
+
if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => !requestKeys.has(key)) || typeof project !== "string" || !project.trim() || project.length > 200 || /[\p{Cc}\p{Cf}]/u.test(project) || request.query !== void 0 && typeof request.query !== "string")
|
|
3135
2792
|
throw new CliError("validation_error", "expected an existing project and bounded evidence arguments");
|
|
3136
2793
|
if (request.query !== void 0 && new TextEncoder().encode(request.query).byteLength > 8192 || [request.limit, request.maxReadBytes].some((value) => value !== void 0 && typeof value !== "number"))
|
|
3137
2794
|
throw new CliError("validation_error", "invalid project evidence query or budget");
|
|
@@ -3179,21 +2836,21 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request =
|
|
|
3179
2836
|
options.until = range.upper - (range.upper_inclusive ? 0 : 1);
|
|
3180
2837
|
frozen.push(`started_at:[${options.since === void 0 ? "*" : `"${new Date(options.since).toISOString()}"`} TO ${options.until === void 0 ? "*" : `"${new Date(options.until).toISOString()}"`}]`);
|
|
3181
2838
|
}
|
|
3182
|
-
validateMeetingHitSearch(
|
|
2839
|
+
validateMeetingHitSearch(project, options);
|
|
3183
2840
|
if (options.cursor !== void 0 && (typeof options.cursor !== "string" || !/^[A-Za-z0-9_-]{1,4096}$/.test(options.cursor)))
|
|
3184
2841
|
throw new CliError("validation_error", "invalid project evidence cursor");
|
|
3185
|
-
return { project:
|
|
2842
|
+
return { project: project.trim(), options, query: frozen.join(" AND ") };
|
|
3186
2843
|
}, "prepareMeetingProjectEvidence");
|
|
3187
2844
|
|
|
3188
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3189
|
-
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read,
|
|
3190
|
-
const prepared = prepareMeetingProjectEvidence(
|
|
2845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
|
|
2846
|
+
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project, request = {}, now = Date.now()) => {
|
|
2847
|
+
const prepared = prepareMeetingProjectEvidence(project, request, now);
|
|
3191
2848
|
const page = await read(prepared.project, prepared.options);
|
|
3192
2849
|
prepared.options.signal?.throwIfAborted();
|
|
3193
2850
|
return meetingProjectEvidenceAnswer(page, prepared);
|
|
3194
2851
|
}, "readMeetingProjectEvidence");
|
|
3195
2852
|
|
|
3196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/pull.js
|
|
3197
2854
|
var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
|
|
3198
2855
|
const { identityExternalId, phone, ...fields } = p;
|
|
3199
2856
|
const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
|
|
@@ -3249,9 +2906,9 @@ var sourceMeetingInput = /* @__PURE__ */ __name((m, accountId, participantsCount
|
|
|
3249
2906
|
};
|
|
3250
2907
|
return meeting2;
|
|
3251
2908
|
}, "sourceMeetingInput");
|
|
3252
|
-
var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m,
|
|
2909
|
+
var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts, { accountId, now, kept }) => {
|
|
3253
2910
|
const id4 = m.occurrence.id;
|
|
3254
|
-
const { participants: sourceParticipants, transcript: lines, chat, summary } =
|
|
2911
|
+
const { participants: sourceParticipants, transcript: lines, chat, summary } = parts;
|
|
3255
2912
|
const participants = participantInputs(source.provider, id4, sourceParticipants ?? [], accountId);
|
|
3256
2913
|
const meeting2 = sourceMeetingInput(m, accountId, sourceParticipants === void 0 ? void 0 : sourceParticipants?.length ?? null, kept);
|
|
3257
2914
|
const linked = sourceParticipants !== void 0;
|
|
@@ -3282,8 +2939,8 @@ var saveSourceMeeting = /* @__PURE__ */ __name(async (source, store, m, parts2,
|
|
|
3282
2939
|
metadata: summary.metadata ?? null
|
|
3283
2940
|
}
|
|
3284
2941
|
] : void 0,
|
|
3285
|
-
attachments:
|
|
3286
|
-
documents:
|
|
2942
|
+
attachments: parts.files ?? void 0,
|
|
2943
|
+
documents: parts.documents ?? void 0,
|
|
3287
2944
|
now
|
|
3288
2945
|
});
|
|
3289
2946
|
if (lines && !linked && !details.transcripts.some((t) => t.transcript.source === source.name && t.transcript.supersededAt === null))
|
|
@@ -3302,11 +2959,11 @@ var startOf = /* @__PURE__ */ __name((m) => {
|
|
|
3302
2959
|
}, "startOf");
|
|
3303
2960
|
var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
3304
2961
|
const now = options.now ?? Date.now();
|
|
3305
|
-
for (const [name,
|
|
2962
|
+
for (const [name, ms2] of [
|
|
3306
2963
|
["lookbackMs", options.lookbackMs ?? 0],
|
|
3307
2964
|
["overlapMs", source.overlapMs ?? 0]
|
|
3308
2965
|
])
|
|
3309
|
-
if (!Number.isSafeInteger(
|
|
2966
|
+
if (!Number.isSafeInteger(ms2) || ms2 < 0 || ms2 > 31 * 864e5)
|
|
3310
2967
|
throw new Error(`${name} must be an integer from 0 through 31 days`);
|
|
3311
2968
|
const lookbackMs = Math.max(options.lookbackMs ?? 0, source.overlapMs ?? 0);
|
|
3312
2969
|
const cursor = options.rescan ? void 0 : await store.cursor(options.accountId);
|
|
@@ -3393,23 +3050,23 @@ var pull = /* @__PURE__ */ __name(async (source, store, options) => {
|
|
|
3393
3050
|
return report;
|
|
3394
3051
|
}, "pull");
|
|
3395
3052
|
|
|
3396
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
|
|
3397
3054
|
var text3 = string();
|
|
3398
|
-
var
|
|
3399
|
-
var
|
|
3400
|
-
var iso3 = /* @__PURE__ */ __name((
|
|
3055
|
+
var count5 = pipe(number(), integer(), minValue(0));
|
|
3056
|
+
var id3 = pipe(number(), integer(), minValue(1));
|
|
3057
|
+
var iso3 = /* @__PURE__ */ __name((ms2) => ms2 === null ? null : new Date(ms2).toISOString(), "iso");
|
|
3401
3058
|
var meetingReview = strictObject({
|
|
3402
3059
|
ref: reference,
|
|
3403
3060
|
id: pipe(string(), minLength(1)),
|
|
3404
3061
|
title: nullable(text3),
|
|
3405
3062
|
started_at: nullable(isoTime),
|
|
3406
|
-
duration_ms: nullable(
|
|
3407
|
-
participants_count: nullable(
|
|
3063
|
+
duration_ms: nullable(count5),
|
|
3064
|
+
participants_count: nullable(count5),
|
|
3408
3065
|
projects: array(text3),
|
|
3409
3066
|
/** Null when the meeting has no current transcript. */
|
|
3410
|
-
transcript: nullable(strictObject({ lines:
|
|
3067
|
+
transcript: nullable(strictObject({ lines: count5, words: count5 })),
|
|
3411
3068
|
/** The three who talked longest. */
|
|
3412
|
-
speakers: array(strictObject({ name: nullable(text3), talk_ms:
|
|
3069
|
+
speakers: array(strictObject({ name: nullable(text3), talk_ms: count5 })),
|
|
3413
3070
|
/** The newest stored summary; null when there is none. */
|
|
3414
3071
|
summary: nullable(strictObject({
|
|
3415
3072
|
source: text3,
|
|
@@ -3424,7 +3081,7 @@ var meetingLink = strictObject({
|
|
|
3424
3081
|
domain: nullable(text3),
|
|
3425
3082
|
/** The Google Docs, Sheets, Slides, Forms or Drive file it names. */
|
|
3426
3083
|
document_id: nullable(text3),
|
|
3427
|
-
count:
|
|
3084
|
+
count: count5,
|
|
3428
3085
|
first_at: isoTime,
|
|
3429
3086
|
last_at: isoTime,
|
|
3430
3087
|
senders: array(text3),
|
|
@@ -3434,39 +3091,39 @@ var meetingSpeaker = strictObject({
|
|
|
3434
3091
|
/** `person:<id>`, `identity:<id>`, `name:<lowercased name>` or `unknown`. */
|
|
3435
3092
|
key: text3,
|
|
3436
3093
|
name: nullable(text3),
|
|
3437
|
-
person_id: nullable(
|
|
3438
|
-
identity_id: nullable(
|
|
3439
|
-
meetings:
|
|
3440
|
-
lines:
|
|
3441
|
-
words:
|
|
3442
|
-
talk_ms:
|
|
3094
|
+
person_id: nullable(id3),
|
|
3095
|
+
identity_id: nullable(id3),
|
|
3096
|
+
meetings: count5,
|
|
3097
|
+
lines: count5,
|
|
3098
|
+
words: count5,
|
|
3099
|
+
talk_ms: count5,
|
|
3443
3100
|
/** This speaker's part of all talk time, 0–1. */
|
|
3444
3101
|
share: pipe(number(), minValue(0), maxValue(1))
|
|
3445
3102
|
});
|
|
3446
3103
|
var meetingStats = strictObject({
|
|
3447
3104
|
time_zone: text3,
|
|
3448
|
-
meetings:
|
|
3449
|
-
lines:
|
|
3450
|
-
words:
|
|
3451
|
-
talk_ms:
|
|
3105
|
+
meetings: count5,
|
|
3106
|
+
lines: count5,
|
|
3107
|
+
words: count5,
|
|
3108
|
+
talk_ms: count5,
|
|
3452
3109
|
/** `week_start` is the Monday, as a date in `time_zone`. */
|
|
3453
|
-
weeks: array(strictObject({ week_start: text3, meetings:
|
|
3110
|
+
weeks: array(strictObject({ week_start: text3, meetings: count5, talk_ms: count5 })),
|
|
3454
3111
|
top_speakers: array(meetingSpeaker)
|
|
3455
3112
|
});
|
|
3456
3113
|
var meetingCountsRow = strictObject({
|
|
3457
3114
|
key: text3,
|
|
3458
3115
|
name: nullable(text3),
|
|
3459
|
-
meetings:
|
|
3460
|
-
minutes:
|
|
3116
|
+
meetings: count5,
|
|
3117
|
+
minutes: count5,
|
|
3461
3118
|
mean_minutes: nullable(number()),
|
|
3462
|
-
transcripts:
|
|
3119
|
+
transcripts: count5
|
|
3463
3120
|
});
|
|
3464
3121
|
var meetingCounts = strictObject({
|
|
3465
3122
|
by: picklist(["day", "week", "series"]),
|
|
3466
|
-
meetings:
|
|
3467
|
-
minutes:
|
|
3123
|
+
meetings: count5,
|
|
3124
|
+
minutes: count5,
|
|
3468
3125
|
mean_minutes: nullable(number()),
|
|
3469
|
-
transcripts:
|
|
3126
|
+
transcripts: count5,
|
|
3470
3127
|
rows: array(meetingCountsRow),
|
|
3471
3128
|
has_more: boolean()
|
|
3472
3129
|
});
|
|
@@ -3474,27 +3131,27 @@ var truncated = /* @__PURE__ */ __name((...why) => nullable(picklist(why)), "tru
|
|
|
3474
3131
|
var meetingParticipants = strictObject({
|
|
3475
3132
|
schema_version: literal(1),
|
|
3476
3133
|
kind: literal("meeting_participants"),
|
|
3477
|
-
account_id:
|
|
3134
|
+
account_id: id3,
|
|
3478
3135
|
query: text3,
|
|
3479
3136
|
items: array(strictObject({
|
|
3480
|
-
participant_id:
|
|
3481
|
-
meeting_id:
|
|
3482
|
-
identity_id:
|
|
3137
|
+
participant_id: id3,
|
|
3138
|
+
meeting_id: id3,
|
|
3139
|
+
identity_id: id3,
|
|
3483
3140
|
display_name: nullable(text3),
|
|
3484
3141
|
email: nullable(text3),
|
|
3485
3142
|
person: nullable(strictObject({ ref: text3, name: nullable(text3) }))
|
|
3486
3143
|
})),
|
|
3487
3144
|
/** Several identities on one page are observations, never speaker attribution or person links. */
|
|
3488
|
-
ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(
|
|
3145
|
+
ambiguity: strictObject({ scope: literal("page"), multiple_identities: boolean(), identity_ids: array(id3) }),
|
|
3489
3146
|
coverage: strictObject({
|
|
3490
|
-
scanned:
|
|
3491
|
-
read_bytes:
|
|
3147
|
+
scanned: count5,
|
|
3148
|
+
read_bytes: count5,
|
|
3492
3149
|
archive_completeness: literal("unknown"),
|
|
3493
3150
|
truncated_by: truncated("limit", "scan_limit", "read_bytes")
|
|
3494
3151
|
}),
|
|
3495
3152
|
page: strictObject({
|
|
3496
3153
|
mode: literal("cursor"),
|
|
3497
|
-
limit:
|
|
3154
|
+
limit: count5,
|
|
3498
3155
|
has_more: boolean(),
|
|
3499
3156
|
next_cursor: optional(text3)
|
|
3500
3157
|
})
|
|
@@ -3508,12 +3165,12 @@ var meetingPassage = strictObject({
|
|
|
3508
3165
|
target_fingerprint: text3,
|
|
3509
3166
|
fingerprint: text3,
|
|
3510
3167
|
revision,
|
|
3511
|
-
limits: strictObject({ before:
|
|
3512
|
-
content_bytes:
|
|
3168
|
+
limits: strictObject({ before: count5, after: count5, bytes: count5, max_read_bytes: count5 }),
|
|
3169
|
+
content_bytes: count5,
|
|
3513
3170
|
coverage: strictObject({
|
|
3514
|
-
included:
|
|
3515
|
-
before:
|
|
3516
|
-
after:
|
|
3171
|
+
included: count5,
|
|
3172
|
+
before: count5,
|
|
3173
|
+
after: count5,
|
|
3517
3174
|
has_before: boolean(),
|
|
3518
3175
|
has_after: boolean(),
|
|
3519
3176
|
truncated_by: truncated("bytes"),
|
|
@@ -3526,12 +3183,12 @@ var meetingPassage = strictObject({
|
|
|
3526
3183
|
items: array(strictObject({
|
|
3527
3184
|
ref: reference,
|
|
3528
3185
|
fingerprint: text3,
|
|
3529
|
-
transcript_id:
|
|
3186
|
+
transcript_id: id3,
|
|
3530
3187
|
content_hash: nullable(text3),
|
|
3531
|
-
position:
|
|
3532
|
-
start_ms:
|
|
3533
|
-
end_ms:
|
|
3534
|
-
speaker_participant_id: nullable(
|
|
3188
|
+
position: count5,
|
|
3189
|
+
start_ms: count5,
|
|
3190
|
+
end_ms: count5,
|
|
3191
|
+
speaker_participant_id: nullable(id3),
|
|
3535
3192
|
speaker_name: nullable(text3),
|
|
3536
3193
|
text: text3,
|
|
3537
3194
|
revision
|
|
@@ -3588,7 +3245,7 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
|
3588
3245
|
updated_at: new Date(one.updatedAt).toISOString()
|
|
3589
3246
|
}), "eventItem");
|
|
3590
3247
|
|
|
3591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/read-through.js
|
|
3592
3249
|
var MEETING_SERVER_BOUNDS = { calls: 3, pages: 2 };
|
|
3593
3250
|
var ISSUES = {
|
|
3594
3251
|
offline: ["permission_error", "meetings.server-offline"],
|
|
@@ -3672,9 +3329,9 @@ var stepFor = /* @__PURE__ */ __name((backend) => ({
|
|
|
3672
3329
|
found: /* @__PURE__ */ new Map(),
|
|
3673
3330
|
missing: []
|
|
3674
3331
|
}), "stepFor");
|
|
3675
|
-
var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found,
|
|
3332
|
+
var keep = /* @__PURE__ */ __name(async (source, store, accountId, now, step, found, parts, fresh = false) => {
|
|
3676
3333
|
const stored = await storedByExternalId(store, accountId, found.meeting.occurrence.id);
|
|
3677
|
-
const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting,
|
|
3334
|
+
const details = stored && !fresh && unchanged(found, stored, accountId) ? stored : await saveSourceMeeting(source, store, found.meeting, parts, {
|
|
3678
3335
|
accountId,
|
|
3679
3336
|
now,
|
|
3680
3337
|
...stored ? { kept: stored.meeting } : {}
|
|
@@ -3780,6 +3437,13 @@ var askServerForList = /* @__PURE__ */ __name(async (source, store, accountId, q
|
|
|
3780
3437
|
return step;
|
|
3781
3438
|
}, "askServerForList");
|
|
3782
3439
|
var meetingsListThrough = /* @__PURE__ */ __name(async (source, store, filter, access) => {
|
|
3440
|
+
const listed2 = await listThrough(source, store, filter, access);
|
|
3441
|
+
if (!filter.query || !readsZone(filter.query, MEETING_TIMES))
|
|
3442
|
+
return listed2;
|
|
3443
|
+
return { ...listed2, meta: { ...listed2.meta, timezone: timezoneOf(access.timezone) } };
|
|
3444
|
+
}, "meetingsListThrough");
|
|
3445
|
+
var MEETING_TIMES = new Set(MEETING_QUERY.fields.filter(({ type }) => type === "time").map(({ name }) => name));
|
|
3446
|
+
var listThrough = /* @__PURE__ */ __name(async (source, store, filter, access) => {
|
|
3783
3447
|
const now = access.now ?? Date.now();
|
|
3784
3448
|
const zoned = { ...filter, timezone: timezoneOf(access.timezone), now };
|
|
3785
3449
|
const step = await askServerForList(source, store, filter.accountId, filter.query, { ...access, now });
|
|
@@ -3799,7 +3463,7 @@ var meetingsListThrough = /* @__PURE__ */ __name(async (source, store, filter, a
|
|
|
3799
3463
|
items: list.items.map((item) => ({ ...item, found_in: step.found.get(Number(item.id)) ?? "archive" })),
|
|
3800
3464
|
...extras
|
|
3801
3465
|
};
|
|
3802
|
-
}, "
|
|
3466
|
+
}, "listThrough");
|
|
3803
3467
|
var storedMeeting = /* @__PURE__ */ __name(async (store, accountId, meeting2) => {
|
|
3804
3468
|
const text6 = meeting2.trim();
|
|
3805
3469
|
const own = /* @__PURE__ */ __name((details) => details?.meeting.accountId === accountId ? details : null, "own");
|
|
@@ -3869,10 +3533,10 @@ var meetingShowThrough = /* @__PURE__ */ __name(async (source, store, accountId,
|
|
|
3869
3533
|
return { details: fresh, foundIn: step.found.get(details.meeting.id) ?? "server", server: step.report };
|
|
3870
3534
|
}, "meetingShowThrough");
|
|
3871
3535
|
|
|
3872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
|
|
3873
3537
|
var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
|
|
3874
3538
|
|
|
3875
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
|
|
3876
3540
|
var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
3877
3541
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
3878
3542
|
throw new CliError("validation_error", "related history request is required");
|
|
@@ -3902,18 +3566,18 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
3902
3566
|
return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
|
|
3903
3567
|
}, "validateMeetingRelatedHistory");
|
|
3904
3568
|
|
|
3905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3569
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
|
|
3906
3570
|
var text4 = string();
|
|
3907
3571
|
var identifier = pipe(text4, minLength(1));
|
|
3908
3572
|
var nullableText = nullable(text4);
|
|
3909
|
-
var
|
|
3573
|
+
var count6 = pipe(number(), integer(), minValue(0));
|
|
3910
3574
|
var flag = boolean();
|
|
3911
3575
|
var scope = strictObject({ provider: text4, account: text4 });
|
|
3912
3576
|
var run = strictObject({
|
|
3913
|
-
meetings:
|
|
3914
|
-
participants:
|
|
3915
|
-
transcript_rows:
|
|
3916
|
-
summaries:
|
|
3577
|
+
meetings: count6,
|
|
3578
|
+
participants: count6,
|
|
3579
|
+
transcript_rows: count6,
|
|
3580
|
+
summaries: count6,
|
|
3917
3581
|
warnings: array(strictObject({ external_id: text4, message: text4 })),
|
|
3918
3582
|
timezone: optional(text4)
|
|
3919
3583
|
});
|
|
@@ -3966,15 +3630,15 @@ var transcription = union([
|
|
|
3966
3630
|
applied: literal(false),
|
|
3967
3631
|
account_id: identifier,
|
|
3968
3632
|
external_id: text4,
|
|
3969
|
-
segments:
|
|
3633
|
+
segments: count6,
|
|
3970
3634
|
media: strictObject({
|
|
3971
3635
|
id: text4,
|
|
3972
3636
|
content_hash: text4,
|
|
3973
|
-
size:
|
|
3974
|
-
duration_ms:
|
|
3637
|
+
size: count6,
|
|
3638
|
+
duration_ms: count6,
|
|
3975
3639
|
format: text4,
|
|
3976
|
-
sample_rate:
|
|
3977
|
-
channels:
|
|
3640
|
+
sample_rate: count6,
|
|
3641
|
+
channels: count6,
|
|
3978
3642
|
recognition
|
|
3979
3643
|
})
|
|
3980
3644
|
}),
|
|
@@ -3984,10 +3648,10 @@ var transcription = union([
|
|
|
3984
3648
|
external_id: text4,
|
|
3985
3649
|
meeting_id: identifier,
|
|
3986
3650
|
created: flag,
|
|
3987
|
-
inserted_transcripts:
|
|
3988
|
-
replayed_transcripts:
|
|
3989
|
-
superseded_transcripts:
|
|
3990
|
-
segments:
|
|
3651
|
+
inserted_transcripts: count6,
|
|
3652
|
+
replayed_transcripts: count6,
|
|
3653
|
+
superseded_transcripts: count6,
|
|
3654
|
+
segments: count6,
|
|
3991
3655
|
media_sha256: text4,
|
|
3992
3656
|
engine: text4,
|
|
3993
3657
|
model: text4,
|
|
@@ -3995,12 +3659,12 @@ var transcription = union([
|
|
|
3995
3659
|
timing: picklist(["fixed-windows", "recognition-segments"])
|
|
3996
3660
|
})
|
|
3997
3661
|
]);
|
|
3998
|
-
var embeddingModel = strictObject({ key: text4, dims:
|
|
3662
|
+
var embeddingModel = strictObject({ key: text4, dims: count6, kind: picklist(["local", "remote"]), model: text4 });
|
|
3999
3663
|
var embedding = union([
|
|
4000
3664
|
strictObject({
|
|
4001
3665
|
account_id: identifier,
|
|
4002
3666
|
model: embeddingModel,
|
|
4003
|
-
status: strictObject({ chunks:
|
|
3667
|
+
status: strictObject({ chunks: count6, embedded: count6 }),
|
|
4004
3668
|
applied: literal(false),
|
|
4005
3669
|
scope: literal("existing-current-chunks"),
|
|
4006
3670
|
rebuild_required: literal("explicit")
|
|
@@ -4008,14 +3672,14 @@ var embedding = union([
|
|
|
4008
3672
|
strictObject({
|
|
4009
3673
|
account_id: identifier,
|
|
4010
3674
|
model: embeddingModel,
|
|
4011
|
-
saved:
|
|
4012
|
-
skipped:
|
|
3675
|
+
saved: count6,
|
|
3676
|
+
skipped: count6,
|
|
4013
3677
|
has_more: flag,
|
|
4014
3678
|
next_hash: optional(text4),
|
|
4015
3679
|
applied: literal(true),
|
|
4016
3680
|
rebuild: strictObject({
|
|
4017
|
-
transcripts:
|
|
4018
|
-
chunks:
|
|
3681
|
+
transcripts: count6,
|
|
3682
|
+
chunks: count6,
|
|
4019
3683
|
has_more: flag,
|
|
4020
3684
|
next_transcript_id: optional(identifier)
|
|
4021
3685
|
})
|
|
@@ -4024,8 +3688,8 @@ var embedding = union([
|
|
|
4024
3688
|
var repair = strictObject({
|
|
4025
3689
|
account_id: identifier,
|
|
4026
3690
|
applied: flag,
|
|
4027
|
-
transcripts:
|
|
4028
|
-
languages: array(strictObject({ language: nullableText, transcripts:
|
|
3691
|
+
transcripts: count6,
|
|
3692
|
+
languages: array(strictObject({ language: nullableText, transcripts: count6 }))
|
|
4029
3693
|
});
|
|
4030
3694
|
var kind = picklist(["instant", "scheduled"]);
|
|
4031
3695
|
var managedChange = strictObject({
|
|
@@ -4038,7 +3702,7 @@ var managedChange = strictObject({
|
|
|
4038
3702
|
title: optional(text4),
|
|
4039
3703
|
kind: optional(kind),
|
|
4040
3704
|
start_time: optional(text4),
|
|
4041
|
-
duration_minutes: optional(
|
|
3705
|
+
duration_minutes: optional(count6),
|
|
4042
3706
|
timezone: optional(text4),
|
|
4043
3707
|
agenda: optional(text4)
|
|
4044
3708
|
})),
|
|
@@ -4048,7 +3712,7 @@ var managedChange = strictObject({
|
|
|
4048
3712
|
title: nullableText,
|
|
4049
3713
|
kind: nullable(kind),
|
|
4050
3714
|
start_time: nullableText,
|
|
4051
|
-
duration_minutes: nullable(
|
|
3715
|
+
duration_minutes: nullable(count6),
|
|
4052
3716
|
timezone: nullableText,
|
|
4053
3717
|
agenda: nullableText,
|
|
4054
3718
|
join_url: nullableText
|
|
@@ -4066,14 +3730,14 @@ var MEETING_RESULT_ENTITIES = {
|
|
|
4066
3730
|
meeting_repair: repair
|
|
4067
3731
|
};
|
|
4068
3732
|
|
|
4069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/review.js
|
|
4070
3734
|
var REVIEW_LIMIT = { default: 50, most: 200 };
|
|
4071
3735
|
|
|
4072
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
|
|
4073
3737
|
var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
|
|
4074
3738
|
\`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
|
|
4075
3739
|
|
|
4076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3740
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
|
|
4077
3741
|
var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
4078
3742
|
input.signal?.throwIfAborted();
|
|
4079
3743
|
if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
|
|
@@ -4094,10 +3758,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
|
4094
3758
|
return { ...input, limit, maxReadBytes };
|
|
4095
3759
|
}, "validateMeetingSeriesHistory");
|
|
4096
3760
|
|
|
4097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3761
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
|
|
4098
3762
|
var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
|
|
4099
3763
|
|
|
4100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
|
|
4101
3765
|
function invalid4(field, response = false) {
|
|
4102
3766
|
throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
|
|
4103
3767
|
}
|
|
@@ -4113,11 +3777,11 @@ var cursorDetails = /* @__PURE__ */ __name((value) => {
|
|
|
4113
3777
|
if (typeof value !== "string" || value.length > 4096 || !/^[A-Za-z0-9_-]+$/.test(value))
|
|
4114
3778
|
invalid4("cursor");
|
|
4115
3779
|
try {
|
|
4116
|
-
const
|
|
4117
|
-
object2(
|
|
4118
|
-
if (
|
|
3780
|
+
const decoded = JSON.parse(new TextDecoder("utf8", { fatal: true }).decode(Buffer.from(value, "base64url")));
|
|
3781
|
+
object2(decoded, ["version", "selection", "cursor"], "cursor");
|
|
3782
|
+
if (decoded.version !== 1 || typeof decoded.selection !== "string" || !/^[a-f0-9]{64}$/.test(decoded.selection) || !occurrenceId(decoded.cursor))
|
|
4119
3783
|
invalid4("cursor");
|
|
4120
|
-
return
|
|
3784
|
+
return decoded;
|
|
4121
3785
|
} catch {
|
|
4122
3786
|
return invalid4("cursor");
|
|
4123
3787
|
}
|
|
@@ -4126,1393 +3790,27 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
|
|
|
4126
3790
|
cursorDetails(value);
|
|
4127
3791
|
}, "validateMeetingSeriesInventoryCursor");
|
|
4128
3792
|
|
|
4129
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4130
|
-
var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
4131
|
-
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
4132
|
-
const zone = timeZone ?? "UTC";
|
|
4133
|
-
try {
|
|
4134
|
-
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
4135
|
-
} catch {
|
|
4136
|
-
throw new CliError("validation_error", "expected an IANA time zone such as Europe/Madrid");
|
|
4137
|
-
}
|
|
4138
|
-
return zone;
|
|
4139
|
-
}, "zoneOf");
|
|
4140
|
-
var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
4141
|
-
var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
4142
|
-
const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
4143
|
-
const day2 = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
|
|
4144
|
-
return new Date(day2 - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
4145
|
-
}, "weekStart");
|
|
4146
|
-
var dayKey = /* @__PURE__ */ __name((at, format) => {
|
|
4147
|
-
const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
4148
|
-
return `${parts2.year}-${parts2.month}-${parts2.day}`;
|
|
4149
|
-
}, "dayKey");
|
|
4150
|
-
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
4151
|
-
timeZone: zone,
|
|
4152
|
-
year: "numeric",
|
|
4153
|
-
month: "2-digit",
|
|
4154
|
-
day: "2-digit",
|
|
4155
|
-
weekday: "short"
|
|
4156
|
-
}), "zoneFormat");
|
|
4157
|
-
var NO_SERIES = "no-series";
|
|
4158
|
-
var MOST_COUNT_ROWS = 100;
|
|
4159
|
-
var minutesOf = /* @__PURE__ */ __name((ms) => Math.round(ms / 6e4), "minutesOf");
|
|
4160
|
-
var meanOf = /* @__PURE__ */ __name((ms, timed) => timed === 0 ? null : Math.round(ms / timed / 6e3) / 10, "meanOf");
|
|
4161
|
-
var aggregateMeetingCounts = /* @__PURE__ */ __name((meetings, by, timeZone, limit = MOST_COUNT_ROWS) => {
|
|
4162
|
-
if (!MEETING_COUNTS_GROUPINGS.includes(by))
|
|
4163
|
-
throw new CliError("validation_error", `--by takes ${MEETING_COUNTS_GROUPINGS.join(", ")}`);
|
|
4164
|
-
if (!Number.isSafeInteger(limit) || limit < 1)
|
|
4165
|
-
throw new CliError("validation_error", "--limit is a positive number");
|
|
4166
|
-
const zone = zoneOf(timeZone);
|
|
4167
|
-
const format = zoneFormat(zone);
|
|
4168
|
-
const sum = /* @__PURE__ */ __name(() => ({ meetings: 0, ms: 0, timed: 0, transcripts: 0 }), "sum");
|
|
4169
|
-
const add = /* @__PURE__ */ __name((into, meeting2) => {
|
|
4170
|
-
into.meetings += 1;
|
|
4171
|
-
if (meeting2.durationMs !== null) {
|
|
4172
|
-
into.ms += Math.max(0, meeting2.durationMs);
|
|
4173
|
-
into.timed += 1;
|
|
4174
|
-
}
|
|
4175
|
-
if (meeting2.transcribed)
|
|
4176
|
-
into.transcripts += 1;
|
|
4177
|
-
}, "add");
|
|
4178
|
-
const total = { ...sum(), name: null };
|
|
4179
|
-
const groups = /* @__PURE__ */ new Map();
|
|
4180
|
-
for (const meeting2 of meetings) {
|
|
4181
|
-
add(total, meeting2);
|
|
4182
|
-
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);
|
|
4183
|
-
if (key === null)
|
|
4184
|
-
continue;
|
|
4185
|
-
const group = groups.get(key) ?? { ...sum(), name: by === "series" ? meeting2.seriesTitle : null };
|
|
4186
|
-
add(group, meeting2);
|
|
4187
|
-
groups.set(key, group);
|
|
4188
|
-
}
|
|
4189
|
-
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));
|
|
4190
|
-
const kept = ordered.slice(0, limit);
|
|
4191
|
-
if (by !== "series")
|
|
4192
|
-
kept.reverse();
|
|
4193
|
-
const counted = /* @__PURE__ */ __name(({ meetings: count7, ms, timed, transcripts }) => ({
|
|
4194
|
-
meetings: count7,
|
|
4195
|
-
minutes: minutesOf(ms),
|
|
4196
|
-
meanMinutes: meanOf(ms, timed),
|
|
4197
|
-
transcripts
|
|
4198
|
-
}), "counted");
|
|
4199
|
-
return {
|
|
4200
|
-
by,
|
|
4201
|
-
timeZone: zone,
|
|
4202
|
-
...counted(total),
|
|
4203
|
-
rows: kept.map(([key, group]) => ({ key, name: group.name, ...counted(group) })),
|
|
4204
|
-
hasMore: ordered.length > limit
|
|
4205
|
-
};
|
|
4206
|
-
}, "aggregateMeetingCounts");
|
|
4207
|
-
var UNKNOWN_SPEAKER = "unknown";
|
|
4208
|
-
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");
|
|
4209
|
-
var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
4210
|
-
const zone = zoneOf(timeZone);
|
|
4211
|
-
const format = zoneFormat(zone);
|
|
4212
|
-
const speakers = /* @__PURE__ */ new Map();
|
|
4213
|
-
const weeks = /* @__PURE__ */ new Map();
|
|
4214
|
-
const meetings = /* @__PURE__ */ new Set();
|
|
4215
|
-
let lines = 0;
|
|
4216
|
-
let words2 = 0;
|
|
4217
|
-
let talkMs = 0;
|
|
4218
|
-
for (const row of rows) {
|
|
4219
|
-
const talk = Math.max(0, row.endMs - row.startMs);
|
|
4220
|
-
meetings.add(row.meetingId);
|
|
4221
|
-
lines += 1;
|
|
4222
|
-
words2 += row.words;
|
|
4223
|
-
talkMs += talk;
|
|
4224
|
-
const who = speakerOf(row);
|
|
4225
|
-
const held = speakers.get(who.key) ?? {
|
|
4226
|
-
key: who.key,
|
|
4227
|
-
name: who.name ?? null,
|
|
4228
|
-
personId: row.personId,
|
|
4229
|
-
identityId: row.personId === null ? row.identityId : null,
|
|
4230
|
-
meetings: 0,
|
|
4231
|
-
lines: 0,
|
|
4232
|
-
words: 0,
|
|
4233
|
-
talkMs: 0,
|
|
4234
|
-
share: 0,
|
|
4235
|
-
seen: /* @__PURE__ */ new Set()
|
|
4236
|
-
};
|
|
4237
|
-
held.seen.add(row.meetingId);
|
|
4238
|
-
held.lines += 1;
|
|
4239
|
-
held.words += row.words;
|
|
4240
|
-
held.talkMs += talk;
|
|
4241
|
-
speakers.set(who.key, held);
|
|
4242
|
-
if (row.startedAt !== null) {
|
|
4243
|
-
const week = weeks.get(weekStart(row.startedAt, format)) ?? { meetings: /* @__PURE__ */ new Set(), talkMs: 0 };
|
|
4244
|
-
week.meetings.add(row.meetingId);
|
|
4245
|
-
week.talkMs += talk;
|
|
4246
|
-
weeks.set(weekStart(row.startedAt, format), week);
|
|
4247
|
-
}
|
|
4248
|
-
}
|
|
4249
|
-
return {
|
|
4250
|
-
timeZone: zone,
|
|
4251
|
-
meetings: meetings.size,
|
|
4252
|
-
lines,
|
|
4253
|
-
words: words2,
|
|
4254
|
-
talkMs,
|
|
4255
|
-
speakers: [...speakers.values()].map(({ seen, ...speaker }) => ({
|
|
4256
|
-
...speaker,
|
|
4257
|
-
meetings: seen.size,
|
|
4258
|
-
share: talkMs === 0 ? 0 : Math.round(speaker.talkMs / talkMs * 1e3) / 1e3
|
|
4259
|
-
})).sort((a, b) => b.talkMs - a.talkMs || a.key.localeCompare(b.key)),
|
|
4260
|
-
weeks: [...weeks.entries()].map(([start, week]) => ({ weekStart: start, meetings: week.meetings.size, talkMs: week.talkMs })).sort((a, b) => a.weekStart.localeCompare(b.weekStart))
|
|
4261
|
-
};
|
|
4262
|
-
}, "aggregateMeetingStats");
|
|
4263
|
-
|
|
4264
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/store/source-review.js
|
|
4265
|
-
var SOURCE_REVIEW_KIND = "memory_source_review";
|
|
4266
|
-
var SOURCE_REVIEW_CAUSES = ["changed", "outdated", "deleted", "contradicted"];
|
|
4267
|
-
var ERASED_TEXT = "[source erased]";
|
|
4268
|
-
var severity = /* @__PURE__ */ __name((cause) => SOURCE_REVIEW_CAUSES.indexOf(cause), "severity");
|
|
4269
|
-
var graver = /* @__PURE__ */ __name((a, b) => severity(b) > severity(a) ? b : a, "graver");
|
|
4270
|
-
|
|
4271
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/tasks/model.js
|
|
4272
|
-
var TASK_KINDS = ["question", "request", "mention", "promise"];
|
|
4273
|
-
var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
|
|
4274
|
-
var CLOSED_STATES = ["done", "dismissed"];
|
|
4275
|
-
var TASK_ORIGINS = ["rule", "agent", "owner"];
|
|
4276
|
-
var TASK_VERDICTS = ["useful", "not_useful"];
|
|
4277
|
-
var isClosedState = /* @__PURE__ */ __name((state) => CLOSED_STATES.includes(state), "isClosedState");
|
|
4278
|
-
function closeTask(task, state, by, at, reason) {
|
|
4279
|
-
if (isClosedState(task.state))
|
|
4280
|
-
throw new CliError("validation_error", `task ${task.id} is already ${task.state}`, { reason: "task.closed" });
|
|
4281
|
-
const { claimedBy: _by, claimedUntil: _until, ...unclaimed } = task;
|
|
4282
|
-
return { ...unclaimed, state, closedAt: at, closedBy: by, ...reason === void 0 ? {} : { reason } };
|
|
4283
|
-
}
|
|
4284
|
-
__name(closeTask, "closeTask");
|
|
4285
|
-
|
|
4286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/tasks/priority.js
|
|
4287
|
-
var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
|
|
4288
|
-
var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
|
|
4289
|
-
var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
|
|
4290
|
-
var priorityLabel = /* @__PURE__ */ __name((score) => score === null ? null : PRIORITY_LABELS[Math.min(3, Math.max(0, Math.floor(score * 4)))], "priorityLabel");
|
|
4291
|
-
var priorityBand = /* @__PURE__ */ __name((label) => {
|
|
4292
|
-
const at = PRIORITY_LABELS.indexOf(label);
|
|
4293
|
-
return { from: at / 4, to: (at + 1) / 4 };
|
|
4294
|
-
}, "priorityBand");
|
|
4295
|
-
var legacyPriority = /* @__PURE__ */ __name((score) => score === null ? null : score < 0.125 ? 4 : 3 - PRIORITY_LABELS.indexOf(priorityLabel(score)), "legacyPriority");
|
|
4296
|
-
var checkedScore = /* @__PURE__ */ __name((score) => {
|
|
4297
|
-
if (!Number.isFinite(score) || score < 0 || score > 1)
|
|
4298
|
-
throw new CliError("validation_error", "a priority score is 0 to 1");
|
|
4299
|
-
return score;
|
|
4300
|
-
}, "checkedScore");
|
|
4301
|
-
var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
4302
|
-
const word = value.trim().toLowerCase();
|
|
4303
|
-
if (word === "none")
|
|
4304
|
-
return null;
|
|
4305
|
-
if (PRIORITY_LABELS.includes(word))
|
|
4306
|
-
return MIDDLE[word];
|
|
4307
|
-
if (/^[0-4]$/.test(word))
|
|
4308
|
-
return LEGACY_PRIORITY_SCORES[Number(word)];
|
|
4309
|
-
if (/^(0?\.\d+|[01]\.\d*)$/.test(word) && Number(word) <= 1)
|
|
4310
|
-
return Number(word);
|
|
4311
|
-
throw new CliError("validation_error", `a priority is ${PRIORITY_LABELS.join(", ")}, none, or a score from 0.0 to 1.0 with its decimal point; 0 (urgent) \u2026 4 (low) still work as critical, high, medium, low, low`);
|
|
4312
|
-
}, "priorityOf");
|
|
4313
|
-
var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
|
|
4314
|
-
|
|
4315
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/tasks/service.js
|
|
4316
|
-
function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
|
|
4317
|
-
async function find(id4) {
|
|
4318
|
-
const task = await store.get(id4);
|
|
4319
|
-
if (!task)
|
|
4320
|
-
throw new CliError("not_found", `no task ${id4}`);
|
|
4321
|
-
return task;
|
|
4322
|
-
}
|
|
4323
|
-
__name(find, "find");
|
|
4324
|
-
return {
|
|
4325
|
-
/**
|
|
4326
|
-
* A rule never makes a second task from a source it has seen, whatever that task's state, so a
|
|
4327
|
-
* dismissed one stays dismissed — nor from a message attached or merged into a task. A person or an agent may
|
|
4328
|
-
* add a task of another kind to it. A task a rule opens goes through the host's duplicate check.
|
|
4329
|
-
*/
|
|
4330
|
-
async add(input) {
|
|
4331
|
-
const rule = input.origin === "rule";
|
|
4332
|
-
const existing = await store.findBySource(input.account, input.source, rule ? { linked: true } : void 0);
|
|
4333
|
-
const same = rule ? existing[0] : existing.find((task2) => task2.kind === input.kind);
|
|
4334
|
-
if (same)
|
|
4335
|
-
return { task: same, created: false };
|
|
4336
|
-
const task = { ...input, id: newId(), state: "open", createdAt: now() };
|
|
4337
|
-
await store.insert(task);
|
|
4338
|
-
if (!rule || !store.reviewDuplicates)
|
|
4339
|
-
return { task, created: true };
|
|
4340
|
-
return { task, created: true, review: await store.reviewDuplicates(task.id) };
|
|
4341
|
-
},
|
|
4342
|
-
async close(id4, { as, by, reason }) {
|
|
4343
|
-
const task = closeTask(await find(id4), as, by, now(), reason);
|
|
4344
|
-
await store.update(task);
|
|
4345
|
-
return task;
|
|
4346
|
-
},
|
|
4347
|
-
list: /* @__PURE__ */ __name((filter = {}) => store.list(filter), "list"),
|
|
4348
|
-
async stats(filter = {}) {
|
|
4349
|
-
const byGroup = /* @__PURE__ */ new Map();
|
|
4350
|
-
for (const task of await store.list(filter))
|
|
4351
|
-
byGroup.set(task.group, [...byGroup.get(task.group) ?? [], task]);
|
|
4352
|
-
return [...byGroup].map(([group, tasks]) => {
|
|
4353
|
-
const open = tasks.filter((task) => !isClosedState(task.state));
|
|
4354
|
-
const closeMs = tasks.flatMap((task) => task.closedAt ? [task.closedAt.getTime() - task.createdAt.getTime()] : []);
|
|
4355
|
-
const oldestOpenAt = open.map((task) => task.createdAt).sort((a, b) => a.getTime() - b.getTime())[0];
|
|
4356
|
-
return {
|
|
4357
|
-
group,
|
|
4358
|
-
open: open.length,
|
|
4359
|
-
...oldestOpenAt ? { oldestOpenAt } : {},
|
|
4360
|
-
...closeMs.length > 0 ? { medianCloseMs: median(closeMs) } : {}
|
|
4361
|
-
};
|
|
4362
|
-
});
|
|
4363
|
-
}
|
|
4364
|
-
};
|
|
4365
|
-
}
|
|
4366
|
-
__name(createTaskService, "createTaskService");
|
|
4367
|
-
function median(values) {
|
|
4368
|
-
const sorted = [...values].sort((a, b) => a - b);
|
|
4369
|
-
const middle = Math.floor(sorted.length / 2);
|
|
4370
|
-
const upper = sorted[middle] ?? 0;
|
|
4371
|
-
return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
|
|
4372
|
-
}
|
|
4373
|
-
__name(median, "median");
|
|
4374
|
-
|
|
4375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/tasks/store.js
|
|
4376
|
-
function matches2(task, filter) {
|
|
4377
|
-
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);
|
|
4378
|
-
}
|
|
4379
|
-
__name(matches2, "matches");
|
|
4380
|
-
|
|
4381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
|
|
4382
|
-
var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
|
|
4383
|
-
var MEMORY_KINDS = ["summary", "digest", "preference"];
|
|
4384
|
-
var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
|
|
4385
|
-
var MEMORY_SCOPES = ["personal", "work"];
|
|
4386
|
-
var WORK_TASK_TYPES = ["bug", "feature", "chore"];
|
|
4387
|
-
var TASK_TYPES2 = [...WORK_TASK_TYPES, ...TASK_KINDS];
|
|
4388
|
-
|
|
4389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/entities/fields.js
|
|
3793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/meetings/tag-answers.js
|
|
4390
3794
|
var text5 = string();
|
|
4391
|
-
var
|
|
4392
|
-
var
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
ref: nullable(reference),
|
|
4399
|
-
kind: text5,
|
|
4400
|
-
title: nullable(text5),
|
|
4401
|
-
sender: nullable(text5),
|
|
4402
|
-
at: nullable(time),
|
|
4403
|
-
excerpt: nullable(text5),
|
|
4404
|
-
tool: nullable(text5),
|
|
4405
|
-
missing: boolean()
|
|
4406
|
-
});
|
|
4407
|
-
var sourceReview = nullable(strictObject({ id: id3, cause: picklist(SOURCE_REVIEW_CAUSES) }));
|
|
4408
|
-
var author = strictObject({
|
|
4409
|
-
type: picklist(["person", "bot"]),
|
|
4410
|
-
id: id3,
|
|
4411
|
-
name: nullable(text5)
|
|
3795
|
+
var storeId = pipe(number(), integer(), minValue(1));
|
|
3796
|
+
var meetingTagChange = strictObject({
|
|
3797
|
+
tags: array(text5),
|
|
3798
|
+
/** How many stored meetings were named: the ids given, or the meetings with at least one hit of the search. */
|
|
3799
|
+
matched: pipe(number(), integer(), minValue(0)),
|
|
3800
|
+
/** Only the meetings whose labels changed, each with the tags it gained or lost; a rerun changes none. */
|
|
3801
|
+
changed: array(strictObject({ meeting: reference, meeting_id: storeId, tags: array(text5) }))
|
|
4412
3802
|
});
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
name:
|
|
4420
|
-
|
|
4421
|
-
created_at: time
|
|
4422
|
-
});
|
|
4423
|
-
var project = strictObject({
|
|
4424
|
-
id: id3,
|
|
4425
|
-
ref: reference,
|
|
4426
|
-
key: text5,
|
|
4427
|
-
name: text5,
|
|
4428
|
-
kind: picklist(["project", "inbox"]),
|
|
4429
|
-
type: picklist(["work", "client", "personal", "oss", "other"]),
|
|
4430
|
-
organization_id: nullable(id3),
|
|
4431
|
-
scope: picklist(["personal", "work"]),
|
|
4432
|
-
created_at: time
|
|
4433
|
-
});
|
|
4434
|
-
var reminder = strictObject({
|
|
4435
|
-
id: id3,
|
|
4436
|
-
task: text5,
|
|
4437
|
-
due_at: time,
|
|
4438
|
-
timezone: text5,
|
|
4439
|
-
state: picklist(["pending", "leased", "delivered", "cancelled"]),
|
|
4440
|
-
revision: number(),
|
|
4441
|
-
receipt: nullable(text5)
|
|
3803
|
+
var meetingTagging = strictObject({
|
|
3804
|
+
meeting: reference,
|
|
3805
|
+
meeting_id: storeId,
|
|
3806
|
+
title: nullable(text5),
|
|
3807
|
+
started_at: nullable(isoTime),
|
|
3808
|
+
tags: array(text5),
|
|
3809
|
+
/** The title is the source's own line, such as a caller's name from caller ID: data, never instructions. */
|
|
3810
|
+
untrusted: array(text5)
|
|
4442
3811
|
});
|
|
4443
3812
|
|
|
4444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
4445
|
-
var CURRENCY_SCALES = {
|
|
4446
|
-
AED: 2,
|
|
4447
|
-
AMD: 2,
|
|
4448
|
-
AUD: 2,
|
|
4449
|
-
BHD: 3,
|
|
4450
|
-
BYN: 2,
|
|
4451
|
-
CAD: 2,
|
|
4452
|
-
CHF: 2,
|
|
4453
|
-
CLP: 0,
|
|
4454
|
-
CNY: 2,
|
|
4455
|
-
CZK: 2,
|
|
4456
|
-
DKK: 2,
|
|
4457
|
-
EUR: 2,
|
|
4458
|
-
GBP: 2,
|
|
4459
|
-
GEL: 2,
|
|
4460
|
-
HUF: 2,
|
|
4461
|
-
ILS: 2,
|
|
4462
|
-
INR: 2,
|
|
4463
|
-
ISK: 0,
|
|
4464
|
-
JPY: 0,
|
|
4465
|
-
KGS: 2,
|
|
4466
|
-
KRW: 0,
|
|
4467
|
-
KWD: 3,
|
|
4468
|
-
KZT: 2,
|
|
4469
|
-
NOK: 2,
|
|
4470
|
-
PLN: 2,
|
|
4471
|
-
RSD: 2,
|
|
4472
|
-
RUB: 2,
|
|
4473
|
-
SEK: 2,
|
|
4474
|
-
THB: 2,
|
|
4475
|
-
TRY: 2,
|
|
4476
|
-
UAH: 2,
|
|
4477
|
-
USD: 2,
|
|
4478
|
-
UZS: 2,
|
|
4479
|
-
VND: 0
|
|
4480
|
-
};
|
|
4481
|
-
var refuse = /* @__PURE__ */ __name((message, reason) => {
|
|
4482
|
-
throw new CliError("validation_error", message, { reason });
|
|
4483
|
-
}, "refuse");
|
|
4484
|
-
var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
|
|
4485
|
-
var parseDecimal = /* @__PURE__ */ __name((text6, scale) => {
|
|
4486
|
-
const match = DECIMAL.exec(text6.trim());
|
|
4487
|
-
if (!match || (match[2] ?? "").length > scale)
|
|
4488
|
-
return void 0;
|
|
4489
|
-
return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
|
|
4490
|
-
}, "parseDecimal");
|
|
4491
|
-
var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
|
|
4492
|
-
const value = BigInt(units);
|
|
4493
|
-
if (value < 0n)
|
|
4494
|
-
return `-${formatDecimal(-value, scale)}`;
|
|
4495
|
-
const digits = value.toString().padStart(scale + 1, "0");
|
|
4496
|
-
return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
|
|
4497
|
-
}, "formatDecimal");
|
|
4498
|
-
var groupDigits = /* @__PURE__ */ __name((decimal) => {
|
|
4499
|
-
const [whole = "0", fraction] = decimal.split(".");
|
|
4500
|
-
const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
4501
|
-
return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
|
|
4502
|
-
}, "groupDigits");
|
|
4503
|
-
var currencyOf = /* @__PURE__ */ __name((text6) => {
|
|
4504
|
-
const code = typeof text6 === "string" ? text6.trim().toUpperCase() : "";
|
|
4505
|
-
if (CURRENCY_SCALES[code] === void 0)
|
|
4506
|
-
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");
|
|
4507
|
-
return code;
|
|
4508
|
-
}, "currencyOf");
|
|
4509
|
-
var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
|
|
4510
|
-
var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
4511
|
-
const scale = scaleOf(currency);
|
|
4512
|
-
const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
|
|
4513
|
-
if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
|
|
4514
|
-
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");
|
|
4515
|
-
return Number(units);
|
|
4516
|
-
}, "minorUnits");
|
|
4517
|
-
var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
4518
|
-
if (typeof amount !== "string" || !amount.trim().startsWith("-"))
|
|
4519
|
-
return minorUnits(amount, currency, what);
|
|
4520
|
-
const units = minorUnits(amount.trim().slice(1), currency, what);
|
|
4521
|
-
return units === 0 ? 0 : -units;
|
|
4522
|
-
}, "signedMinorUnits");
|
|
4523
|
-
var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
|
|
4524
|
-
amount: formatDecimal(units, scaleOf(currency)),
|
|
4525
|
-
currency
|
|
4526
|
-
}), "moneyOf");
|
|
4527
|
-
var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
|
|
4528
|
-
var QUANTITY_SCALE = 3;
|
|
4529
|
-
var quantityOf = /* @__PURE__ */ __name((text6) => {
|
|
4530
|
-
const thousandths = typeof text6 === "string" ? parseDecimal(text6, QUANTITY_SCALE) : void 0;
|
|
4531
|
-
if (thousandths === void 0 || thousandths === 0n)
|
|
4532
|
-
return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
|
|
4533
|
-
const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
|
|
4534
|
-
return { text: plain, thousandths };
|
|
4535
|
-
}, "quantityOf");
|
|
4536
|
-
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
4537
|
-
|
|
4538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
4539
|
-
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
4540
|
-
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
4541
|
-
var MONEY_DIRECTIONS = ["in", "out"];
|
|
4542
|
-
var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
|
|
4543
|
-
var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
|
|
4544
|
-
if (current === "draft" || current === "void")
|
|
4545
|
-
return current;
|
|
4546
|
-
if (paid <= 0)
|
|
4547
|
-
return "issued";
|
|
4548
|
-
return paid < total ? "partly_paid" : "paid";
|
|
4549
|
-
}, "settledStatus");
|
|
4550
|
-
var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
|
|
4551
|
-
var notes = /* @__PURE__ */ __name((...words2) => {
|
|
4552
|
-
const kept = words2.filter((word) => word !== null);
|
|
4553
|
-
return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
|
|
4554
|
-
}, "notes");
|
|
4555
|
-
var invoiceLine = /* @__PURE__ */ __name((invoice) => {
|
|
4556
|
-
const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
|
|
4557
|
-
const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
|
|
4558
|
-
return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
|
|
4559
|
-
}, "invoiceLine");
|
|
4560
|
-
var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
4561
|
-
const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
|
|
4562
|
-
return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
|
|
4563
|
-
}, "paymentLine");
|
|
4564
|
-
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
4565
|
-
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
4566
|
-
|
|
4567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/business.js
|
|
4568
|
-
var CATALOG_KINDS = ["product", "service"];
|
|
4569
|
-
var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
|
|
4570
|
-
var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
|
|
4571
|
-
var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
|
|
4572
|
-
var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
|
|
4573
|
-
var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
|
|
4574
|
-
var TRANSACTION_STATUSES = ["pending", "booked"];
|
|
4575
|
-
var ORDER_DIRECTIONS = ["purchase", "sale"];
|
|
4576
|
-
var intervalOf = /* @__PURE__ */ __name((text6, reason = "subscription.interval") => {
|
|
4577
|
-
const match = typeof text6 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text6.trim()) : null;
|
|
4578
|
-
if (!match)
|
|
4579
|
-
throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
|
|
4580
|
-
return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
|
|
4581
|
-
}, "intervalOf");
|
|
4582
|
-
var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
|
|
4583
|
-
var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
|
|
4584
|
-
var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
|
|
4585
|
-
var productLine = /* @__PURE__ */ __name((product) => {
|
|
4586
|
-
const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
|
|
4587
|
-
const per = price && product.unit !== null ? ` per ${product.unit}` : "";
|
|
4588
|
-
return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
|
|
4589
|
-
}, "productLine");
|
|
4590
|
-
var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
|
|
4591
|
-
var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
|
|
4592
|
-
var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
|
|
4593
|
-
var transactionLine = /* @__PURE__ */ __name((transaction) => `${moneyLabel(transaction.amount, transaction.currency)} ${transaction.direction}${transaction.label === null ? "" : ` \xB7 ${transaction.label}`}, ${dayMonth(transaction.date)}` + notes(transaction.status === "pending" ? "pending" : null, pending(transaction.review)), "transactionLine");
|
|
4594
|
-
|
|
4595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/store/marks.js
|
|
4596
|
-
import { readFileSync as readFileSync2, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
4597
|
-
var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
|
|
4598
|
-
var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
|
|
4599
|
-
var journalMarkPath = /* @__PURE__ */ __name((store) => `${store}.journal.json`, "journalMarkPath");
|
|
4600
|
-
var inodeOf = /* @__PURE__ */ __name((store) => statSync2(store, { throwIfNoEntry: false })?.ino, "inodeOf");
|
|
4601
|
-
var readJson = /* @__PURE__ */ __name((path) => {
|
|
4602
|
-
try {
|
|
4603
|
-
return JSON.parse(readFileSync2(path, "utf8"));
|
|
4604
|
-
} catch (error) {
|
|
4605
|
-
if (error.code === "ENOENT")
|
|
4606
|
-
return null;
|
|
4607
|
-
throw error;
|
|
4608
|
-
}
|
|
4609
|
-
}, "readJson");
|
|
4610
|
-
var ownerStoreInTests = /* @__PURE__ */ __name((store) => {
|
|
4611
|
-
try {
|
|
4612
|
-
refuseOwnerStoreInTests(store);
|
|
4613
|
-
return false;
|
|
4614
|
-
} catch {
|
|
4615
|
-
return true;
|
|
4616
|
-
}
|
|
4617
|
-
}, "ownerStoreInTests");
|
|
4618
|
-
var sqliteFailure = /* @__PURE__ */ __name((error) => isCliFailure(error) && error.details?.reason === "store.damaged" ? error.cause : error, "sqliteFailure");
|
|
4619
|
-
var markStoreDamaged = /* @__PURE__ */ __name((error, { store, command, version, runId, now = Date.now }) => {
|
|
4620
|
-
const failure = sqliteFailure(error);
|
|
4621
|
-
if (!isStoreDamage(failure) || ownerStoreInTests(store))
|
|
4622
|
-
return false;
|
|
4623
|
-
const inode = inodeOf(store);
|
|
4624
|
-
if (inode === void 0)
|
|
4625
|
-
return false;
|
|
4626
|
-
const mark = {
|
|
4627
|
-
at: new Date(now()).toISOString(),
|
|
4628
|
-
command,
|
|
4629
|
-
...version ? { cli_version: version } : {},
|
|
4630
|
-
...runId ? { run_id: runId } : {},
|
|
4631
|
-
error: failure.message.slice(0, 500),
|
|
4632
|
-
inode
|
|
4633
|
-
};
|
|
4634
|
-
try {
|
|
4635
|
-
writeFileSync2(damageMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
4636
|
-
`, { flag: "wx", mode: 384 });
|
|
4637
|
-
return true;
|
|
4638
|
-
} catch {
|
|
4639
|
-
return false;
|
|
4640
|
-
}
|
|
4641
|
-
}, "markStoreDamaged");
|
|
4642
|
-
var readDamageMark = /* @__PURE__ */ __name((store) => {
|
|
4643
|
-
const path = damageMarkPath(store);
|
|
4644
|
-
let mark;
|
|
4645
|
-
try {
|
|
4646
|
-
mark = readJson(path);
|
|
4647
|
-
} catch {
|
|
4648
|
-
return { at: "unknown", command: "unknown", error: `${path} cannot be read`, inode: inodeOf(store) ?? 0 };
|
|
4649
|
-
}
|
|
4650
|
-
if (mark === null)
|
|
4651
|
-
return null;
|
|
4652
|
-
if (mark.inode !== inodeOf(store)) {
|
|
4653
|
-
clearDamageMark(store);
|
|
4654
|
-
return null;
|
|
4655
|
-
}
|
|
4656
|
-
return mark;
|
|
4657
|
-
}, "readDamageMark");
|
|
4658
|
-
var clearDamageMark = /* @__PURE__ */ __name((store) => rmSync2(damageMarkPath(store), { force: true }), "clearDamageMark");
|
|
4659
|
-
var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
|
|
4660
|
-
const mark = readDamageMark(store);
|
|
4661
|
-
if (!mark)
|
|
4662
|
-
return;
|
|
4663
|
-
throw new CliError("configuration_error", `the store was found damaged at ${mark.at} by \`${mark.command}\` (${mark.error}), so nothing writes to it until it is recovered; \`${cli ?? "<cli>"} store recover\` says what is damaged and what to do`, { reason: "store.damaged" });
|
|
4664
|
-
}, "refuseDamagedStore");
|
|
4665
|
-
var markJournalLost = /* @__PURE__ */ __name((store, { seen, command, now = Date.now }) => {
|
|
4666
|
-
if (ownerStoreInTests(store))
|
|
4667
|
-
return;
|
|
4668
|
-
const mark = { at: new Date(now()).toISOString(), command, seen };
|
|
4669
|
-
try {
|
|
4670
|
-
writeFileSync2(journalMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
4671
|
-
`, { flag: "wx", mode: 384 });
|
|
4672
|
-
} catch {
|
|
4673
|
-
}
|
|
4674
|
-
}, "markJournalLost");
|
|
4675
|
-
var readJournalMark = /* @__PURE__ */ __name((store) => {
|
|
4676
|
-
try {
|
|
4677
|
-
return readJson(journalMarkPath(store));
|
|
4678
|
-
} catch {
|
|
4679
|
-
return null;
|
|
4680
|
-
}
|
|
4681
|
-
}, "readJournalMark");
|
|
4682
|
-
var readHealthMark = /* @__PURE__ */ __name((store) => {
|
|
4683
|
-
try {
|
|
4684
|
-
return readJson(healthMarkPath(store));
|
|
4685
|
-
} catch {
|
|
4686
|
-
return null;
|
|
4687
|
-
}
|
|
4688
|
-
}, "readHealthMark");
|
|
4689
|
-
var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, schema, now = Date.now }) => {
|
|
4690
|
-
const previous = readHealthMark(store);
|
|
4691
|
-
if (ownerStoreInTests(store))
|
|
4692
|
-
return { previous, cleared: null };
|
|
4693
|
-
const checkedAt = new Date(now()).toISOString();
|
|
4694
|
-
const mark = {
|
|
4695
|
-
checked_at: checkedAt,
|
|
4696
|
-
ok: health.ok,
|
|
4697
|
-
problems: health.problems ?? 0,
|
|
4698
|
-
schema,
|
|
4699
|
-
cli,
|
|
4700
|
-
...version ? { cli_version: version } : {},
|
|
4701
|
-
last_ok_at: health.ok ? checkedAt : previous?.last_ok_at ?? null
|
|
4702
|
-
};
|
|
4703
|
-
const cleared = health.ok ? readDamageMark(store) : null;
|
|
4704
|
-
try {
|
|
4705
|
-
writeFileSync2(healthMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
4706
|
-
`, { mode: 384 });
|
|
4707
|
-
} catch {
|
|
4708
|
-
}
|
|
4709
|
-
if (cleared)
|
|
4710
|
-
clearDamageMark(store);
|
|
4711
|
-
if (health.ok)
|
|
4712
|
-
rmSync2(journalMarkPath(store), { force: true });
|
|
4713
|
-
return { previous, cleared };
|
|
4714
|
-
}, "recordDeepCheck");
|
|
4715
|
-
|
|
4716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/deals.js
|
|
4717
|
-
var DEAL_KINDS = ["deal", "lead"];
|
|
4718
|
-
var DEAL_STATUSES = ["open", "won", "lost"];
|
|
4719
|
-
var STAGE_OUTCOMES = DEAL_STATUSES;
|
|
4720
|
-
var DEAL_ROLES = ["owner", "contact", "decision-maker", "influencer"];
|
|
4721
|
-
var dealLine = /* @__PURE__ */ __name((deal) => {
|
|
4722
|
-
const money = deal.amount === null || deal.currency === null ? "" : `, ${moneyLabel(deal.amount, deal.currency)}`;
|
|
4723
|
-
return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
|
|
4724
|
-
}, "dealLine");
|
|
4725
|
-
|
|
4726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/orders.js
|
|
4727
|
-
var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
|
|
4728
|
-
var ORDER_PURPOSES = ["personal", "business", "client", "other"];
|
|
4729
|
-
var orderLine = /* @__PURE__ */ __name((order) => {
|
|
4730
|
-
const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
|
|
4731
|
-
const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
|
|
4732
|
-
const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
|
|
4733
|
-
return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
|
|
4734
|
-
}, "orderLine");
|
|
4735
|
-
var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
|
|
4736
|
-
|
|
4737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/relations.js
|
|
4738
|
-
var ORGANIZATION_ROLES = [
|
|
4739
|
-
"employee",
|
|
4740
|
-
"contractor",
|
|
4741
|
-
"founder",
|
|
4742
|
-
"owner",
|
|
4743
|
-
"manager",
|
|
4744
|
-
"adviser",
|
|
4745
|
-
"contact"
|
|
4746
|
-
];
|
|
4747
|
-
var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
|
|
4748
|
-
var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
|
|
4749
|
-
var RELATED_ROLES = ["colleague", "adviser", "investor", "mentor", "family", "friend"];
|
|
4750
|
-
var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
|
|
4751
|
-
var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
|
|
4752
|
-
var checkEngagement = /* @__PURE__ */ __name((kind3, from, to, level) => {
|
|
4753
|
-
if (kind3 !== "member-of" || from !== "person" || to !== "project")
|
|
4754
|
-
throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
|
|
4755
|
-
reason: "relationship.engagement-ends"
|
|
4756
|
-
});
|
|
4757
|
-
if (!isEngagement(level))
|
|
4758
|
-
throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
|
|
4759
|
-
reason: "relationship.engagement-unknown"
|
|
4760
|
-
});
|
|
4761
|
-
return level;
|
|
4762
|
-
}, "checkEngagement");
|
|
4763
|
-
var RELATIONS = {
|
|
4764
|
-
"member-of": {
|
|
4765
|
-
from: ["person", "organization", "project", "chat", "email_thread"],
|
|
4766
|
-
to: ["organization", "project"],
|
|
4767
|
-
roles: { to: { organization: ORGANIZATION_ROLES, project: PROJECT_ROLES } }
|
|
4768
|
-
},
|
|
4769
|
-
"reports-to": { from: ["person"], to: ["person"], inverse: "manages" },
|
|
4770
|
-
"customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
|
|
4771
|
-
"partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
|
|
4772
|
-
"related-to": {
|
|
4773
|
-
from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
|
|
4774
|
-
to: ["person", "organization", "project", "task"],
|
|
4775
|
-
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
|
|
4776
|
-
}
|
|
4777
|
-
};
|
|
4778
|
-
var RELATION_KINDS = Object.keys(RELATIONS);
|
|
4779
|
-
var specOf = /* @__PURE__ */ __name((kind3) => Object.hasOwn(RELATIONS, kind3) ? RELATIONS[kind3] : void 0, "specOf");
|
|
4780
|
-
var isRelationKind = /* @__PURE__ */ __name((kind3) => specOf(kind3) !== void 0, "isRelationKind");
|
|
4781
|
-
var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
|
|
4782
|
-
var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
|
|
4783
|
-
var checkEnds = /* @__PURE__ */ __name((kind3, from, to) => {
|
|
4784
|
-
const spec = specOf(kind3);
|
|
4785
|
-
if (!spec)
|
|
4786
|
-
throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
|
|
4787
|
-
if (memberOnly(from) && (kind3 !== "member-of" || to !== "project"))
|
|
4788
|
-
throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
|
|
4789
|
-
if (partyOnly(from, to))
|
|
4790
|
-
throw new CliError("validation_error", "a contract is related only to a person or an organization");
|
|
4791
|
-
if (!spec.from.includes(from) || !spec.to.includes(to))
|
|
4792
|
-
throw new CliError("validation_error", `${kind3} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
|
|
4793
|
-
return spec;
|
|
4794
|
-
}, "checkEnds");
|
|
4795
|
-
var isParty = /* @__PURE__ */ __name((type) => type === "person" || type === "organization", "isParty");
|
|
4796
|
-
var rolesOf = /* @__PURE__ */ __name((kind3, from, to) => {
|
|
4797
|
-
const spec = specOf(kind3);
|
|
4798
|
-
if (kind3 === "member-of" && from !== "person")
|
|
4799
|
-
return void 0;
|
|
4800
|
-
return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
|
|
4801
|
-
}, "rolesOf");
|
|
4802
|
-
var ROLE_LISTS = {
|
|
4803
|
-
organization: ORGANIZATION_ROLES,
|
|
4804
|
-
project: PROJECT_ROLES,
|
|
4805
|
-
deal: DEAL_ROLES,
|
|
4806
|
-
contract: CONTRACT_ROLES,
|
|
4807
|
-
related: RELATED_ROLES
|
|
4808
|
-
};
|
|
4809
|
-
var roleListOf = /* @__PURE__ */ __name((kind3, from, to) => {
|
|
4810
|
-
if (kind3 === "related-to" && isParty(from) && isParty(to))
|
|
4811
|
-
return "related";
|
|
4812
|
-
const roles = rolesOf(kind3, from, to);
|
|
4813
|
-
return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
|
|
4814
|
-
}, "roleListOf");
|
|
4815
|
-
var checkRole = /* @__PURE__ */ __name((kind3, from, to, role, extra = []) => {
|
|
4816
|
-
const roles = rolesOf(kind3, from, to)?.concat(extra);
|
|
4817
|
-
if (roles && !roles.includes(role))
|
|
4818
|
-
throw new CliError("validation_error", `a ${from}'s role on ${kind3} ${to} is one of ${roles.join(", ")}`, {
|
|
4819
|
-
reason: "relationship.role-unknown"
|
|
4820
|
-
});
|
|
4821
|
-
return role;
|
|
4822
|
-
}, "checkRole");
|
|
4823
|
-
var isSymmetric = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric === true, "isSymmetric");
|
|
4824
|
-
var inverseOf = /* @__PURE__ */ __name((kind3) => specOf(kind3)?.symmetric ? kind3 : specOf(kind3)?.inverse ?? null, "inverseOf");
|
|
4825
|
-
var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
|
|
4826
|
-
var standingOf = /* @__PURE__ */ __name((link, now) => {
|
|
4827
|
-
if (link.endsAt != null && link.endsAt <= now)
|
|
4828
|
-
return "ended";
|
|
4829
|
-
if (link.confirmed)
|
|
4830
|
-
return "confirmed";
|
|
4831
|
-
if (link.deletedAt != null)
|
|
4832
|
-
return "ended";
|
|
4833
|
-
return link.accountId != null ? "reported" : "proposed";
|
|
4834
|
-
}, "standingOf");
|
|
4835
|
-
var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" || standing === "reported", "isUsable");
|
|
4836
|
-
var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
|
|
4837
|
-
var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE ${KEYED} AND override.kind = ${alias}.kind AND override.from_type = ${alias}.from_type AND override.from_id = ${alias}.from_id AND override.to_type = ${alias}.to_type AND override.to_id = ${alias}.to_id AND json_extract(override.metadata, '$.overrides') = ${alias}.id)`, "notOverriddenSql");
|
|
4838
|
-
var usableLinkSql = /* @__PURE__ */ __name((alias, now) => `(${alias}.confirmed = 1 OR (${alias}.account_id IS NOT NULL AND ${alias}.deleted_at IS NULL))` + (now === void 0 ? "" : ` AND (${alias}.ends_at IS NULL OR ${alias}.ends_at > ${Math.trunc(now)})`), "usableLinkSql");
|
|
4839
|
-
|
|
4840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/crm.js
|
|
4841
|
-
var CRM_ACTIVITY_KINDS = ["call", "email", "meeting", "todo", "task", "comment", "other"];
|
|
4842
|
-
var isCrmUserId = /* @__PURE__ */ __name((id4) => /^\d{1,20}$/.test(id4), "isCrmUserId");
|
|
4843
|
-
var normalCrmUserId = /* @__PURE__ */ __name((id4) => {
|
|
4844
|
-
const text6 = id4.trim();
|
|
4845
|
-
return /^\d+$/.test(text6) ? text6.replace(/^0+(?=\d)/, "") : text6;
|
|
4846
|
-
}, "normalCrmUserId");
|
|
4847
|
-
var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
|
|
4848
|
-
|
|
4849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
4850
|
-
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
4851
|
-
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
4852
|
-
var tagOf = /* @__PURE__ */ __name((value) => {
|
|
4853
|
-
const tag = value.trim().toLowerCase();
|
|
4854
|
-
return TAG.test(tag) ? tag : void 0;
|
|
4855
|
-
}, "tagOf");
|
|
4856
|
-
var normalizeTag = /* @__PURE__ */ __name((value) => {
|
|
4857
|
-
const tag = tagOf(value);
|
|
4858
|
-
if (tag === void 0)
|
|
4859
|
-
throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
|
|
4860
|
-
return tag;
|
|
4861
|
-
}, "normalizeTag");
|
|
4862
|
-
|
|
4863
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
|
|
4864
|
-
var REPORTER_SQL = "(SELECT provider || ':' || external_id FROM accounts r WHERE r.id = links.account_id) AS reporter";
|
|
4865
|
-
var sourceOf = /* @__PURE__ */ __name((database, row, metadata) => {
|
|
4866
|
-
const reporter = row.account_id == null ? void 0 : "reporter" in row ? row.reporter : database.prepare("SELECT provider || ':' || external_id AS key FROM accounts WHERE id = ?").get(Number(row.account_id))?.key;
|
|
4867
|
-
return {
|
|
4868
|
-
...typeof reporter === "string" ? { account: reporter } : {},
|
|
4869
|
-
...typeof metadata.derived === "string" ? { derived: metadata.derived } : {}
|
|
4870
|
-
};
|
|
4871
|
-
}, "sourceOf");
|
|
4872
|
-
|
|
4873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
|
|
4874
|
-
var LINK_KINDS = [
|
|
4875
|
-
"links-to",
|
|
4876
|
-
"blocked-by",
|
|
4877
|
-
"follow-up-of",
|
|
4878
|
-
"about",
|
|
4879
|
-
"member-of",
|
|
4880
|
-
"labelled",
|
|
4881
|
-
"answered-by",
|
|
4882
|
-
"evidence",
|
|
4883
|
-
"created-from",
|
|
4884
|
-
"duplicate-of",
|
|
4885
|
-
"related-to",
|
|
4886
|
-
"reports-to",
|
|
4887
|
-
"customer-of",
|
|
4888
|
-
"partner-of",
|
|
4889
|
-
"assigned-to",
|
|
4890
|
-
"attached"
|
|
4891
|
-
];
|
|
4892
|
-
var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
|
|
4893
|
-
var LINK_SOURCES = [...LINK_ORIGINS, "calendar", "meeting"];
|
|
4894
|
-
var linkKind = /* @__PURE__ */ __name((kind3) => `'${kind3}'`, "linkKind");
|
|
4895
|
-
var COUNTERPART_ROLE = "counterpart";
|
|
4896
|
-
|
|
4897
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
4898
|
-
var SCHEME = "msg:";
|
|
4899
|
-
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
|
|
4900
|
-
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
4901
|
-
var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
4902
|
-
const trimmed = reference2.trim();
|
|
4903
|
-
const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
4904
|
-
const malformed2 = /* @__PURE__ */ __name(() => new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`), "malformed");
|
|
4905
|
-
if (parts2.length !== 4 || parts2.some((part) => part === ""))
|
|
4906
|
-
throw malformed2();
|
|
4907
|
-
const decoded2 = /* @__PURE__ */ __name((part) => {
|
|
4908
|
-
try {
|
|
4909
|
-
return decodeURIComponent(part);
|
|
4910
|
-
} catch {
|
|
4911
|
-
throw malformed2();
|
|
4912
|
-
}
|
|
4913
|
-
}, "decoded");
|
|
4914
|
-
const [provider, account, chat, message] = parts2.map(decoded2);
|
|
4915
|
-
return { provider, account, chat, message };
|
|
4916
|
-
}, "parseLocator");
|
|
4917
|
-
|
|
4918
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
4919
|
-
var SIMPLE_REFERENCES = [
|
|
4920
|
-
"note",
|
|
4921
|
-
"document",
|
|
4922
|
-
"person",
|
|
4923
|
-
"organization",
|
|
4924
|
-
"project",
|
|
4925
|
-
"task",
|
|
4926
|
-
"memory",
|
|
4927
|
-
"fact",
|
|
4928
|
-
"bot",
|
|
4929
|
-
"event",
|
|
4930
|
-
"invoice",
|
|
4931
|
-
"payment",
|
|
4932
|
-
"order",
|
|
4933
|
-
"deal",
|
|
4934
|
-
"lead",
|
|
4935
|
-
"pipeline",
|
|
4936
|
-
"product",
|
|
4937
|
-
"contract",
|
|
4938
|
-
"subscription",
|
|
4939
|
-
"wallet",
|
|
4940
|
-
"transaction",
|
|
4941
|
-
"entity"
|
|
4942
|
-
];
|
|
4943
|
-
var malformed = /* @__PURE__ */ __name((text6, shape) => new CliError("validation_error", `"${singleLine(text6)}" is not a reference \u2014 expected ${shape}`, {
|
|
4944
|
-
reason: "ref.malformed"
|
|
4945
|
-
}), "malformed");
|
|
4946
|
-
var decoded = /* @__PURE__ */ __name((part, text6, shape) => {
|
|
4947
|
-
try {
|
|
4948
|
-
return decodeURIComponent(part);
|
|
4949
|
-
} catch {
|
|
4950
|
-
throw malformed(text6, shape);
|
|
4951
|
-
}
|
|
4952
|
-
}, "decoded");
|
|
4953
|
-
var parts = /* @__PURE__ */ __name((rest, count7, text6, shape) => {
|
|
4954
|
-
const split = rest.split("/");
|
|
4955
|
-
if (split.length !== count7 || split.some((part) => part === ""))
|
|
4956
|
-
throw malformed(text6, shape);
|
|
4957
|
-
return split.map((part) => decoded(part, text6, shape));
|
|
4958
|
-
}, "parts");
|
|
4959
|
-
var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
|
|
4960
|
-
var folderPath = /* @__PURE__ */ __name((path) => {
|
|
4961
|
-
const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
|
|
4962
|
-
return clean === "" ? path.trim() === "" ? "" : null : clean;
|
|
4963
|
-
}, "folderPath");
|
|
4964
|
-
var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
|
|
4965
|
-
var kind2 = /* @__PURE__ */ __name((spec) => spec, "kind");
|
|
4966
|
-
var simple = /* @__PURE__ */ __name((prefix) => kind2({
|
|
4967
|
-
prefix,
|
|
4968
|
-
type: prefix,
|
|
4969
|
-
shape: `${prefix}:<id>`,
|
|
4970
|
-
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
4971
|
-
if (!rest.trim())
|
|
4972
|
-
throw new CliError("validation_error", `"${singleLine(text6)}" names no ${prefix}`, {
|
|
4973
|
-
reason: "ref.malformed"
|
|
4974
|
-
});
|
|
4975
|
-
return { type: prefix, id: rest };
|
|
4976
|
-
}, "parse"),
|
|
4977
|
-
format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
|
|
4978
|
-
}), "simple");
|
|
4979
|
-
var REF_KINDS = [
|
|
4980
|
-
kind2({
|
|
4981
|
-
prefix: "msg",
|
|
4982
|
-
type: "message",
|
|
4983
|
-
shape: "msg:<provider>/<account>/<chat>/<message>",
|
|
4984
|
-
parse: /* @__PURE__ */ __name((_, text6) => {
|
|
4985
|
-
try {
|
|
4986
|
-
return { type: "message", ...parseLocator(text6) };
|
|
4987
|
-
} catch {
|
|
4988
|
-
throw malformed(text6, "msg:<provider>/<account>/<chat>/<message>");
|
|
4989
|
-
}
|
|
4990
|
-
}, "parse"),
|
|
4991
|
-
format: formatLocator
|
|
4992
|
-
}),
|
|
4993
|
-
kind2({
|
|
4994
|
-
prefix: "chat",
|
|
4995
|
-
type: "chat",
|
|
4996
|
-
shape: "chat:<provider>/<account>/<chat>",
|
|
4997
|
-
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
4998
|
-
const [provider, account, chat] = parts(rest, 3, text6, "chat:<provider>/<account>/<chat>");
|
|
4999
|
-
return { type: "chat", provider, account, chat };
|
|
5000
|
-
}, "parse"),
|
|
5001
|
-
format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
|
|
5002
|
-
}),
|
|
5003
|
-
kind2({
|
|
5004
|
-
prefix: "contact",
|
|
5005
|
-
type: "contact",
|
|
5006
|
-
shape: "contact:<provider>/<id>",
|
|
5007
|
-
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
5008
|
-
const [provider, id4] = parts(rest, 2, text6, "contact:<provider>/<id>");
|
|
5009
|
-
return { type: "contact", provider, id: id4 };
|
|
5010
|
-
}, "parse"),
|
|
5011
|
-
format: /* @__PURE__ */ __name(({ provider, id: id4 }) => `contact:${encoded(provider, id4)}`, "format")
|
|
5012
|
-
}),
|
|
5013
|
-
kind2({
|
|
5014
|
-
prefix: "folder",
|
|
5015
|
-
type: "folder",
|
|
5016
|
-
shape: "folder:<id>[/<path>]",
|
|
5017
|
-
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
5018
|
-
const slash = rest.indexOf("/");
|
|
5019
|
-
const id4 = decoded(slash < 0 ? rest : rest.slice(0, slash), text6, "folder:<id>[/<path>]");
|
|
5020
|
-
const path = slash < 0 ? null : folderPath(decoded(rest.slice(slash + 1), text6, "folder:<id>[/<path>]"));
|
|
5021
|
-
if (!id4.trim() || path === "")
|
|
5022
|
-
throw malformed(text6, "folder:<id>[/<path>]");
|
|
5023
|
-
return { type: "folder", id: id4, path };
|
|
5024
|
-
}, "parse"),
|
|
5025
|
-
format: /* @__PURE__ */ __name(({ id: id4, path }) => path === null ? `folder:${encodeURIComponent(id4)}` : `folder:${encoded(id4, path)}`, "format")
|
|
5026
|
-
}),
|
|
5027
|
-
kind2({
|
|
5028
|
-
prefix: "meeting",
|
|
5029
|
-
type: "meeting",
|
|
5030
|
-
shape: MEETING_SHAPE,
|
|
5031
|
-
parse: /* @__PURE__ */ __name((_, text6) => {
|
|
5032
|
-
try {
|
|
5033
|
-
return parseMeetingReference(text6);
|
|
5034
|
-
} catch {
|
|
5035
|
-
throw malformed(text6, MEETING_SHAPE);
|
|
5036
|
-
}
|
|
5037
|
-
}, "parse"),
|
|
5038
|
-
format: formatMeetingReference
|
|
5039
|
-
}),
|
|
5040
|
-
...SIMPLE_REFERENCES.map(simple)
|
|
5041
|
-
];
|
|
5042
|
-
var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
|
|
5043
|
-
var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
|
|
5044
|
-
var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
|
|
5045
|
-
var distance = /* @__PURE__ */ __name((a, b) => {
|
|
5046
|
-
let row = Array.from({ length: b.length + 1 }, (_, at) => at);
|
|
5047
|
-
for (const [i, x] of [...a].entries()) {
|
|
5048
|
-
const next = [i + 1];
|
|
5049
|
-
for (const [j, y] of [...b].entries())
|
|
5050
|
-
next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
|
|
5051
|
-
row = next;
|
|
5052
|
-
}
|
|
5053
|
-
return row[b.length];
|
|
5054
|
-
}, "distance");
|
|
5055
|
-
var nearest = /* @__PURE__ */ __name((typed) => offered.find((prefix) => typed.length >= 2 && prefix.startsWith(typed)) ?? offered.map((prefix) => ({ prefix, far: distance(typed, prefix) })).filter(({ far }) => far <= 2).sort((a, b) => a.far - b.far)[0]?.prefix, "nearest");
|
|
5056
|
-
var unknownKind = /* @__PURE__ */ __name((text6, prefix, rest) => {
|
|
5057
|
-
const near2 = prefix === "" ? void 0 : nearest(prefix);
|
|
5058
|
-
const kinds = offered.map((one) => `${one}:`).join(", ");
|
|
5059
|
-
const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
|
|
5060
|
-
return new CliError("validation_error", `"${singleLine(text6)}" is no kind of reference${hint}`, {
|
|
5061
|
-
reason: "ref.unknown-kind"
|
|
5062
|
-
});
|
|
5063
|
-
}, "unknownKind");
|
|
5064
|
-
var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
|
|
5065
|
-
var parseReference = /* @__PURE__ */ __name((text6) => {
|
|
5066
|
-
const reference2 = text6.trim();
|
|
5067
|
-
const colon = reference2.indexOf(":");
|
|
5068
|
-
const prefix = colon < 0 ? "" : reference2.slice(0, colon);
|
|
5069
|
-
const rest = reference2.slice(colon + 1);
|
|
5070
|
-
const spec = byPrefix.get(prefix);
|
|
5071
|
-
if (!spec)
|
|
5072
|
-
throw unknownKind(reference2, prefix, rest);
|
|
5073
|
-
return spec.parse(rest, reference2);
|
|
5074
|
-
}, "parseReference");
|
|
5075
|
-
var canonicalReference = /* @__PURE__ */ __name((text6) => formatReference(parseReference(text6)), "canonicalReference");
|
|
5076
|
-
var looksLikeReference = /* @__PURE__ */ __name((text6) => {
|
|
5077
|
-
const match = /^([a-z]+):\S+$/.exec(text6.trim());
|
|
5078
|
-
return match !== null && byPrefix.has(match[1]);
|
|
5079
|
-
}, "looksLikeReference");
|
|
5080
|
-
|
|
5081
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
5082
|
-
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
|
|
5083
|
-
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
5084
|
-
var PROVIDERS = [
|
|
5085
|
-
{ name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
|
|
5086
|
-
{ name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
|
|
5087
|
-
{ name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
|
|
5088
|
-
{ name: "max-bot", kind: "messages", aliases: [] },
|
|
5089
|
-
{ name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
|
|
5090
|
-
{ name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
|
|
5091
|
-
{ name: "email", kind: "mail", aliases: [] },
|
|
5092
|
-
{ name: "notes", kind: "notes", aliases: [] },
|
|
5093
|
-
{ name: "local", kind: "notes", aliases: [] },
|
|
5094
|
-
{ name: "obsidian", kind: "notes", aliases: [] },
|
|
5095
|
-
{ name: "added", kind: "notes", aliases: [] },
|
|
5096
|
-
{ name: "zoom", kind: "meetings", aliases: [] },
|
|
5097
|
-
{ name: "google-meet", kind: "meetings", aliases: [], command: "gmeet" },
|
|
5098
|
-
// Its meetings come from the notes Telemost mails (`keeper@telemost.yandex.ru`), read by a mail rule.
|
|
5099
|
-
{ name: "telemost", kind: "meetings", aliases: [] },
|
|
5100
|
-
// A phone export's records: its SMS and its calls in the one account the import names.
|
|
5101
|
-
{ name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true },
|
|
5102
|
-
// Any other import: a folder of notes, a CRM's export, a script's records, under `import:<what it is>`.
|
|
5103
|
-
{ name: "import", kind: "documents", kinds: ["documents", "messages", "events"], aliases: [], imported: true }
|
|
5104
|
-
];
|
|
5105
|
-
var LABELS = {
|
|
5106
|
-
telegram: "Telegram",
|
|
5107
|
-
"telegram-bot": "Telegram bot",
|
|
5108
|
-
max: "MAX",
|
|
5109
|
-
"max-bot": "MAX bot",
|
|
5110
|
-
whatsapp: "WhatsApp",
|
|
5111
|
-
"whatsapp-bot": "WhatsApp bot",
|
|
5112
|
-
"google-drive": "Google Drive",
|
|
5113
|
-
"google-meet": "Google Meet",
|
|
5114
|
-
added: "added by hand",
|
|
5115
|
-
email: "mail",
|
|
5116
|
-
telemost: "Telemost"
|
|
5117
|
-
};
|
|
5118
|
-
var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
|
|
5119
|
-
var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
|
|
5120
|
-
var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
|
|
5121
|
-
var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
|
|
5122
|
-
var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
|
|
5123
|
-
var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
|
|
5124
|
-
var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
|
|
5125
|
-
var ADDED_PROVIDER = "added";
|
|
5126
|
-
var ADDED_ACCOUNT = "owner";
|
|
5127
|
-
var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
|
|
5128
|
-
var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
|
|
5129
|
-
var INTERNAL_NOTES = "internal";
|
|
5130
|
-
var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
|
|
5131
|
-
var WORD = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5132
|
-
var invalid5 = /* @__PURE__ */ __name((message) => {
|
|
5133
|
-
throw new CliError("validation_error", message);
|
|
5134
|
-
}, "invalid");
|
|
5135
|
-
var wordOf = /* @__PURE__ */ __name((value, what) => typeof value === "string" && WORD.test(value) ? value : invalid5(`${what} is lowercase letters, digits, - and _ \u2014 not ${JSON.stringify(value)}`), "wordOf");
|
|
5136
|
-
var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
|
|
5137
|
-
var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
|
|
5138
|
-
var opensOf = /* @__PURE__ */ __name((value, named) => {
|
|
5139
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
5140
|
-
return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
|
|
5141
|
-
const known = Object.entries(value).filter(([kind3]) => OPEN_KINDS.has(kind3));
|
|
5142
|
-
for (const [kind3, command] of known)
|
|
5143
|
-
if (typeof command !== "string" || !COMMAND_WORDS.test(command))
|
|
5144
|
-
invalid5(`provider ${named} opens a ${kind3} with command words, not ${JSON.stringify(command)}`);
|
|
5145
|
-
return Object.fromEntries(known);
|
|
5146
|
-
}, "opensOf");
|
|
5147
|
-
var providerEntryOf = /* @__PURE__ */ __name((value) => {
|
|
5148
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
5149
|
-
return invalid5("a provider entry is an object");
|
|
5150
|
-
const { name, kind: kind3, kinds, aliases = [], command, opens, imported } = value;
|
|
5151
|
-
const named = wordOf(name, "a provider's name");
|
|
5152
|
-
const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
|
|
5153
|
-
const given = kinds === void 0 ? [kind3] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
|
|
5154
|
-
for (const one of given)
|
|
5155
|
-
if (!isKindWord(one))
|
|
5156
|
-
invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
|
|
5157
|
-
const list = [...new Set(given)];
|
|
5158
|
-
if (kind3 !== void 0 && kind3 !== list[0])
|
|
5159
|
-
invalid5(`provider ${named}'s kind is the first of its kinds`);
|
|
5160
|
-
if (!Array.isArray(aliases))
|
|
5161
|
-
invalid5(`provider ${named}'s aliases are a list`);
|
|
5162
|
-
if (imported !== void 0 && typeof imported !== "boolean")
|
|
5163
|
-
invalid5(`provider ${named}'s imported is true or false`);
|
|
5164
|
-
return {
|
|
5165
|
-
name: named,
|
|
5166
|
-
kind: list[0],
|
|
5167
|
-
...list.length > 1 ? { kinds: list } : {},
|
|
5168
|
-
...imported === true ? { imported: true } : {},
|
|
5169
|
-
aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
|
|
5170
|
-
...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
|
|
5171
|
-
...opens === void 0 ? {} : { opens: opensOf(opens, named) }
|
|
5172
|
-
};
|
|
5173
|
-
}, "providerEntryOf");
|
|
5174
|
-
var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
|
|
5175
|
-
var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
|
|
5176
|
-
var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
|
|
5177
|
-
.../* @__PURE__ */ new Set([...known, ...entry])
|
|
5178
|
-
], "unitedKinds");
|
|
5179
|
-
var wordsOf2 = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
|
|
5180
|
-
var joined = /* @__PURE__ */ __name((known, entry) => {
|
|
5181
|
-
const same = known.find(({ name }) => name === entry.name);
|
|
5182
|
-
const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
|
|
5183
|
-
if (same && same.kind !== entry.kind)
|
|
5184
|
-
invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
|
|
5185
|
-
if (same && entry.imported === true && same.imported !== true)
|
|
5186
|
-
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
5187
|
-
const merged = same ? {
|
|
5188
|
-
...same,
|
|
5189
|
-
...kinds.length > 1 ? { kinds } : {},
|
|
5190
|
-
aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
|
|
5191
|
-
...entry.command ? { command: entry.command } : {},
|
|
5192
|
-
...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
|
|
5193
|
-
} : entry;
|
|
5194
|
-
const others = known.filter((one) => one !== same);
|
|
5195
|
-
for (const word of wordsOf2(merged)) {
|
|
5196
|
-
const owner = others.find((one) => wordsOf2(one).includes(word));
|
|
5197
|
-
if (owner)
|
|
5198
|
-
invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
|
|
5199
|
-
}
|
|
5200
|
-
return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
|
|
5201
|
-
}, "joined");
|
|
5202
|
-
var registry = PROVIDERS;
|
|
5203
|
-
var providers = /* @__PURE__ */ __name(() => registry, "providers");
|
|
5204
|
-
var useStoredProviders = /* @__PURE__ */ __name((entries) => {
|
|
5205
|
-
const left = [];
|
|
5206
|
-
registry = entries.reduce((known, entry) => {
|
|
5207
|
-
try {
|
|
5208
|
-
return joined(known, providerEntryOf(entry));
|
|
5209
|
-
} catch (error) {
|
|
5210
|
-
if (!(error instanceof CliError))
|
|
5211
|
-
throw error;
|
|
5212
|
-
left.push(entry);
|
|
5213
|
-
return known;
|
|
5214
|
-
}
|
|
5215
|
-
}, PROVIDERS);
|
|
5216
|
-
return left;
|
|
5217
|
-
}, "useStoredProviders");
|
|
5218
|
-
var addProvider = /* @__PURE__ */ __name((entry) => {
|
|
5219
|
-
registry = joined(registry, providerEntryOf(entry));
|
|
5220
|
-
}, "addProvider");
|
|
5221
|
-
var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
|
|
5222
|
-
var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
5223
|
-
const wanted = word.toLowerCase();
|
|
5224
|
-
return registry.find((entry) => wordsOf2(entry).includes(wanted));
|
|
5225
|
-
}, "providerNamed");
|
|
5226
|
-
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
5227
|
-
var kindsIn = /* @__PURE__ */ __name((provider) => {
|
|
5228
|
-
if (isFolderProvider(provider))
|
|
5229
|
-
return ["notes"];
|
|
5230
|
-
const entry = registry.find(({ name }) => name === provider);
|
|
5231
|
-
if (!entry)
|
|
5232
|
-
return [];
|
|
5233
|
-
return entry.imported ? unitedKinds(kindsOfEntry(entry), ["documents"]) : kindsOfEntry(entry);
|
|
5234
|
-
}, "kindsIn");
|
|
5235
|
-
var importedOf = /* @__PURE__ */ __name((entry, held) => {
|
|
5236
|
-
const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
|
|
5237
|
-
if (builtIn) {
|
|
5238
|
-
if (entry.imported === true && builtIn.imported !== true)
|
|
5239
|
-
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
5240
|
-
return builtIn.imported === true;
|
|
5241
|
-
}
|
|
5242
|
-
if (held === void 0)
|
|
5243
|
-
return entry.imported === true;
|
|
5244
|
-
if (entry.imported === true && held.imported !== true)
|
|
5245
|
-
invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
|
|
5246
|
-
return held.imported === true;
|
|
5247
|
-
}, "importedOf");
|
|
5248
|
-
var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
|
|
5249
|
-
var holdsKind = /* @__PURE__ */ __name((provider, kind3) => kindsIn(provider).includes(kind3), "holdsKind");
|
|
5250
|
-
var holdsKindOf = /* @__PURE__ */ __name((provider, kind3) => kindIn(provider) === void 0 ? kind3 === "messages" : holdsKind(provider, kind3), "holdsKindOf");
|
|
5251
|
-
var kindOf2 = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
5252
|
-
|
|
5253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
5254
|
-
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
5255
|
-
var inSource = /* @__PURE__ */ __name((source, provider) => source === "all" || source === "bots" && isBotProvider(provider) || source === "personal" && !isBotProvider(provider) || source === provider || providerNamed(source)?.name === provider || isKind(source) && holdsKindOf(provider, source), "inSource");
|
|
5256
|
-
var fail = /* @__PURE__ */ __name((message) => {
|
|
5257
|
-
throw new CliError("validation_error", message);
|
|
5258
|
-
}, "fail");
|
|
5259
|
-
var sourceOf2 = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
5260
|
-
const sources = [...providers2, "personal", "bots", "all"];
|
|
5261
|
-
const source = value.toLowerCase();
|
|
5262
|
-
if (sources.includes(source))
|
|
5263
|
-
return source;
|
|
5264
|
-
if (source === "mail")
|
|
5265
|
-
return "email";
|
|
5266
|
-
if (source === "messages")
|
|
5267
|
-
return source;
|
|
5268
|
-
if (isKind(source))
|
|
5269
|
-
fail(`${name}${source} names ${source}, which a message search does not read \u2014 search ${source === "meetings" || source === "events" ? `all --source ${source}` : "notes"} does`);
|
|
5270
|
-
const named = providerNamed(source);
|
|
5271
|
-
if (named && providers2.includes(named.name))
|
|
5272
|
-
return named.name;
|
|
5273
|
-
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
5274
|
-
}, "sourceOf");
|
|
5275
|
-
|
|
5276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
5277
|
-
var ACCOUNT_GROUPS = "accountGroups";
|
|
5278
|
-
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
5279
|
-
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
5280
|
-
var fail2 = /* @__PURE__ */ __name((message) => {
|
|
5281
|
-
throw new CliError("validation_error", message);
|
|
5282
|
-
}, "fail");
|
|
5283
|
-
var isAccountList = /* @__PURE__ */ __name((value) => value.includes(",") || value.includes(":"), "isAccountList");
|
|
5284
|
-
var itemsOf = /* @__PURE__ */ __name((value) => {
|
|
5285
|
-
const items = value.split(",").map((item) => item.trim());
|
|
5286
|
-
if (items.some((item) => item === ""))
|
|
5287
|
-
fail2(`"${value}" has an empty entry \u2014 separate accounts with one comma`);
|
|
5288
|
-
return items;
|
|
5289
|
-
}, "itemsOf");
|
|
5290
|
-
var isGroupName = /* @__PURE__ */ __name((name) => GROUP_NAME.test(name), "isGroupName");
|
|
5291
|
-
var groupName = /* @__PURE__ */ __name((name) => isGroupName(name) ? name : fail2(`a group name is letters, digits, - and _ \u2014 not "${name}"`), "groupName");
|
|
5292
|
-
var groupMembers = /* @__PURE__ */ __name((value) => itemsOf(value).map((item) => item.toLowerCase().startsWith("group:") ? fail2(`a group lists accounts, not other groups \u2014 "${item}"`) : item.includes(":") && item.split(":")[1] === "" ? fail2(`"${item}" names no account after the colon`) : item), "groupMembers");
|
|
5293
|
-
var describe2 = /* @__PURE__ */ __name((accounts) => accounts.map(({ provider, account, name }) => `${provider}:${account}${name ? ` (${name})` : ""}`).join(", "), "describe");
|
|
5294
|
-
var listedHolds = /* @__PURE__ */ __name((account, kind3) => (account.kinds ?? (account.kind === void 0 ? [] : [account.kind])).includes(kind3), "listedHolds");
|
|
5295
|
-
var kindHere = /* @__PURE__ */ __name((provider, running) => provider === running.provider ? kindOf2(provider) : kindIn(provider), "kindHere");
|
|
5296
|
-
var kindsOfHere = /* @__PURE__ */ __name((provider, running) => {
|
|
5297
|
-
const kinds = kindsIn(provider);
|
|
5298
|
-
return { kind: kindHere(provider, running), ...kinds.length > 1 ? { kinds } : {} };
|
|
5299
|
-
}, "kindsOfHere");
|
|
5300
|
-
var heldOf = /* @__PURE__ */ __name((stored, running) => [
|
|
5301
|
-
...stored.filter(({ provider }) => kindIn(provider) !== "notes" && !isDocumentAccountProvider(provider)).map(({ provider, account, name }) => ({ provider, account, name, ...kindsOfHere(provider, running) })),
|
|
5302
|
-
{ provider: "notes", account: INTERNAL_NOTES, name: null, kind: "notes" },
|
|
5303
|
-
...stored.filter(({ provider }) => isFolderProvider(provider)).map(({ id: id4, name, provider, account }) => ({
|
|
5304
|
-
provider: "notes",
|
|
5305
|
-
account: String(id4),
|
|
5306
|
-
name,
|
|
5307
|
-
kind: "notes",
|
|
5308
|
-
stored: { provider, account }
|
|
5309
|
-
})),
|
|
5310
|
-
...stored.filter(({ provider }) => isDocumentAccountProvider(provider) || provider === ADDED_PROVIDER).map(({ id: id4, provider, account, name }) => ({
|
|
5311
|
-
provider: "notes",
|
|
5312
|
-
account: String(id4),
|
|
5313
|
-
name,
|
|
5314
|
-
kind: "notes",
|
|
5315
|
-
stored: { provider, account }
|
|
5316
|
-
}))
|
|
5317
|
-
], "heldOf");
|
|
5318
|
-
var storedAs = /* @__PURE__ */ __name((held, key) => held.filter(({ stored }) => stored?.provider === key.provider && (key.account === "" || stored.account === key.account)), "storedAs");
|
|
5319
|
-
var registry2 = /* @__PURE__ */ __name(() => providers().map(({ name, aliases }) => aliases.length ? `${name} (${aliases.join(", ")})` : name).join(", "), "registry");
|
|
5320
|
-
var providerOf = /* @__PURE__ */ __name((prefix, held, { running, profiles }) => {
|
|
5321
|
-
const wanted = prefix.toLowerCase();
|
|
5322
|
-
if (wanted === running.command?.toLowerCase())
|
|
5323
|
-
return running.provider;
|
|
5324
|
-
const providers2 = [...new Set(held.map(({ provider }) => provider))];
|
|
5325
|
-
if (providers2.includes(wanted) || isDocumentAccountProvider(wanted))
|
|
5326
|
-
return wanted;
|
|
5327
|
-
const named = providerNamed(wanted);
|
|
5328
|
-
if (named)
|
|
5329
|
-
return named.name;
|
|
5330
|
-
const recorded = Object.values(profiles[wanted] ?? {})[0];
|
|
5331
|
-
if (recorded)
|
|
5332
|
-
return recorded.provider;
|
|
5333
|
-
return fail2(`${prefix} is not a provider \u2014 they are ${registry2()}; the store holds ${providers2.join(", ")}`);
|
|
5334
|
-
}, "providerOf");
|
|
5335
|
-
var profilesOf = /* @__PURE__ */ __name((provider, profiles) => Object.values(profiles).flatMap((named) => Object.entries(named).filter(([, key]) => key.provider === provider)), "profilesOf");
|
|
5336
|
-
var accountOf = /* @__PURE__ */ __name((prefix, ref, held, context3) => {
|
|
5337
|
-
const provider = providerOf(prefix, held, context3);
|
|
5338
|
-
if (isDocumentAccountProvider(provider) && !context3.profiles[prefix.toLowerCase()]?.[ref]) {
|
|
5339
|
-
const stored = storedAs(held, { provider, account: ref })[0];
|
|
5340
|
-
if (stored)
|
|
5341
|
-
return stored;
|
|
5342
|
-
}
|
|
5343
|
-
const folder = isFolderProvider(provider);
|
|
5344
|
-
const ofProvider = folder ? storedAs(held, { provider, account: "" }) : held.filter((one) => one.provider === provider);
|
|
5345
|
-
const byId = ofProvider.find(({ account, stored }) => account === ref || account === ref.toLowerCase() || folder && stored?.account === ref.toUpperCase());
|
|
5346
|
-
if (byId)
|
|
5347
|
-
return byId;
|
|
5348
|
-
const keyed = /* @__PURE__ */ __name((key) => ofProvider.find(({ account }) => account === key.account) ?? {
|
|
5349
|
-
...key,
|
|
5350
|
-
name: null,
|
|
5351
|
-
...kindsOfHere(key.provider, context3.running)
|
|
5352
|
-
}, "keyed");
|
|
5353
|
-
const recorded = context3.profiles[prefix.toLowerCase()]?.[ref];
|
|
5354
|
-
if (recorded && isFolderProvider(recorded.provider)) {
|
|
5355
|
-
const folder2 = held.find((one) => one.provider === "notes" && one.name === recorded.account);
|
|
5356
|
-
if (folder2)
|
|
5357
|
-
return folder2;
|
|
5358
|
-
return fail2(`no stored folder for ${prefix}:${ref}; sync that profile first`);
|
|
5359
|
-
}
|
|
5360
|
-
if (recorded && isDocumentAccountProvider(recorded.provider)) {
|
|
5361
|
-
const account = storedAs(held, recorded)[0];
|
|
5362
|
-
if (account)
|
|
5363
|
-
return account;
|
|
5364
|
-
return fail2(`no stored documents for ${prefix}:${ref}; sync that profile first`);
|
|
5365
|
-
}
|
|
5366
|
-
if (recorded)
|
|
5367
|
-
return keyed(recorded);
|
|
5368
|
-
const byProfile = [
|
|
5369
|
-
...new Map(profilesOf(provider, context3.profiles).filter(([name]) => name === ref).map(([, key]) => [key.account, key])).values()
|
|
5370
|
-
];
|
|
5371
|
-
if (byProfile.length === 1)
|
|
5372
|
-
return keyed(byProfile[0]);
|
|
5373
|
-
const byName = ofProvider.filter(({ name }) => name?.toLowerCase() === ref.toLowerCase());
|
|
5374
|
-
if (byName.length === 1)
|
|
5375
|
-
return byName[0];
|
|
5376
|
-
if (byName.length > 1 || byProfile.length > 1)
|
|
5377
|
-
fail2(`${provider}:${ref} names more than one account \u2014 use the id: ${describe2(ofProvider)}`);
|
|
5378
|
-
const names = profilesOf(provider, context3.profiles).map(([name]) => name);
|
|
5379
|
-
return fail2(`no ${provider} account "${ref}" \u2014 the store holds ${describe2(ofProvider) || "none"}` + (names.length ? `; profiles: ${[...new Set(names)].join(", ")}` : ""));
|
|
5380
|
-
}, "accountOf");
|
|
5381
|
-
var accountsOfWord = /* @__PURE__ */ __name((word, held, context3) => {
|
|
5382
|
-
const wanted = word.toLowerCase();
|
|
5383
|
-
if (wanted === "all")
|
|
5384
|
-
return [...held];
|
|
5385
|
-
if (wanted === "personal" || wanted === "bots")
|
|
5386
|
-
return held.filter((one) => listedHolds(one, "messages") && isBotProvider(one.provider) === (wanted === "bots"));
|
|
5387
|
-
if (isKind(wanted))
|
|
5388
|
-
return held.filter((one) => listedHolds(one, wanted));
|
|
5389
|
-
const recorded = context3.profiles[wanted];
|
|
5390
|
-
if (recorded && Object.values(recorded).every((key) => isFolderProvider(key.provider) || isDocumentAccountProvider(key.provider)))
|
|
5391
|
-
return Object.keys(recorded).map((profile) => accountOf(word, profile, held, context3));
|
|
5392
|
-
const provider = providerOf(word, held, context3);
|
|
5393
|
-
if (isDocumentAccountProvider(provider) || isFolderProvider(provider))
|
|
5394
|
-
return storedAs(held, { provider, account: "" });
|
|
5395
|
-
return held.filter((one) => one.provider === provider);
|
|
5396
|
-
}, "accountsOfWord");
|
|
5397
|
-
var keyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "keyOf");
|
|
5398
|
-
var sourceOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "sourceOf");
|
|
5399
|
-
var sameAs = /* @__PURE__ */ __name((key) => (one) => one.provider === key.provider && one.account === key.account, "sameAs");
|
|
5400
|
-
var entriesOfList = /* @__PURE__ */ __name((value, context3) => {
|
|
5401
|
-
const held = heldOf(context3.held, context3.running);
|
|
5402
|
-
const entries = [];
|
|
5403
|
-
const entry = /* @__PURE__ */ __name((item, group) => {
|
|
5404
|
-
const colon = item.indexOf(":");
|
|
5405
|
-
if (colon === -1) {
|
|
5406
|
-
try {
|
|
5407
|
-
entries.push({ entry: item, accounts: accountsOfWord(item, held, context3) });
|
|
5408
|
-
} catch (error) {
|
|
5409
|
-
if (!group || !(error instanceof CliError))
|
|
5410
|
-
throw error;
|
|
5411
|
-
fail2(`"${item}" in group ${group}: ${error.message}`);
|
|
5412
|
-
}
|
|
5413
|
-
return;
|
|
5414
|
-
}
|
|
5415
|
-
const prefix = item.slice(0, colon);
|
|
5416
|
-
const ref = item.slice(colon + 1).trim();
|
|
5417
|
-
if (ref === "")
|
|
5418
|
-
fail2(`"${item}" names no account after the colon`);
|
|
5419
|
-
if (prefix.toLowerCase() === "group") {
|
|
5420
|
-
if (group)
|
|
5421
|
-
fail2(`group ${group} lists another group \u2014 a group lists accounts`);
|
|
5422
|
-
const members = context3.groups[ref];
|
|
5423
|
-
if (!members) {
|
|
5424
|
-
const known = Object.keys(context3.groups);
|
|
5425
|
-
fail2(`no account group "${ref}" \u2014 ${known.length ? `there are ${known.join(", ")}` : "none saved yet"}; \`config set ${ACCOUNT_GROUPS_SETTING}.${ref} <accounts>\` saves one`);
|
|
5426
|
-
}
|
|
5427
|
-
for (const member of members)
|
|
5428
|
-
entry(member, ref);
|
|
5429
|
-
return;
|
|
5430
|
-
}
|
|
5431
|
-
entries.push({ entry: item, accounts: [accountOf(prefix, ref, held, context3)] });
|
|
5432
|
-
}, "entry");
|
|
5433
|
-
for (const item of itemsOf(value))
|
|
5434
|
-
entry(item);
|
|
5435
|
-
const { only } = context3;
|
|
5436
|
-
return entries.map(({ entry: entry2, accounts }) => ({
|
|
5437
|
-
entry: entry2,
|
|
5438
|
-
accounts: accounts.filter((one) => only === void 0 || only.has(keyOf(one))).map(({ provider, account, kind: kind3, kinds }) => ({
|
|
5439
|
-
provider,
|
|
5440
|
-
account,
|
|
5441
|
-
kind: kind3,
|
|
5442
|
-
...kinds === void 0 ? {} : { kinds }
|
|
5443
|
-
}))
|
|
5444
|
-
}));
|
|
5445
|
-
}, "entriesOfList");
|
|
5446
|
-
var accountsOfList = /* @__PURE__ */ __name((value, context3) => {
|
|
5447
|
-
const chosen = /* @__PURE__ */ new Map();
|
|
5448
|
-
for (const { accounts } of entriesOfList(value, context3))
|
|
5449
|
-
for (const one of accounts)
|
|
5450
|
-
if (!chosen.has(keyOf(one)))
|
|
5451
|
-
chosen.set(keyOf(one), one);
|
|
5452
|
-
return [...chosen.values()];
|
|
5453
|
-
}, "accountsOfList");
|
|
5454
|
-
var READS = {
|
|
5455
|
-
messages: "messenger messages \u2014 search messages reads them",
|
|
5456
|
-
mail: "a mailbox \u2014 memo search mail reads it",
|
|
5457
|
-
notes: "notes \u2014 search notes reads them",
|
|
5458
|
-
documents: "documents \u2014 search notes reads them",
|
|
5459
|
-
meetings: "meetings \u2014 search all reads them",
|
|
5460
|
-
events: "calendar events \u2014 no search reads them yet",
|
|
5461
|
-
crm: "CRM deals and leads \u2014 search all reads them"
|
|
5462
|
-
};
|
|
5463
|
-
var fitting = /* @__PURE__ */ __name((entries, kinds, what, reasonOf2 = (kind3) => READS[kind3], alsoFits = () => false) => {
|
|
5464
|
-
const chosen = /* @__PURE__ */ new Map();
|
|
5465
|
-
const skipped = [];
|
|
5466
|
-
for (const { entry, accounts } of entries) {
|
|
5467
|
-
const fits = accounts.filter((one) => kinds.some((kind3) => listedHolds(one, kind3)) || alsoFits(one));
|
|
5468
|
-
for (const { provider, account } of fits)
|
|
5469
|
-
if (!chosen.has(keyOf({ provider, account })))
|
|
5470
|
-
chosen.set(keyOf({ provider, account }), { provider, account });
|
|
5471
|
-
const known = accounts.filter(({ kind: kind3 }) => kind3 !== void 0);
|
|
5472
|
-
const unknown2 = accounts.filter((one) => one.kind === void 0 && !alsoFits(one));
|
|
5473
|
-
if (known.length)
|
|
5474
|
-
for (const { provider, account } of unknown2)
|
|
5475
|
-
skipped.push({ source: `${provider}:${account}`, code: "not_found", reason: UNKNOWN_PROVIDER });
|
|
5476
|
-
if (fits.length)
|
|
5477
|
-
continue;
|
|
5478
|
-
const other = known[0];
|
|
5479
|
-
skipped.push(other?.kind ? { source: entry, code: "validation_error", reason: reasonOf2(other.kind) } : unknown2.length ? { source: entry, code: "not_found", reason: UNKNOWN_PROVIDER } : { source: entry, code: "not_found", reason: "no account in the store" });
|
|
5480
|
-
}
|
|
5481
|
-
if (chosen.size === 0)
|
|
5482
|
-
fail2(`--source names nothing ${what} reads: ${skipped.map(({ source, reason }) => `${source} (${reason})`).join(", ")}`);
|
|
5483
|
-
return { accounts: [...chosen.values()], skipped };
|
|
5484
|
-
}, "fitting");
|
|
5485
|
-
|
|
5486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/domain/categories.js
|
|
5487
|
-
var CATEGORIES = ["client", "supplier", "partner", "employer"];
|
|
5488
|
-
|
|
5489
3813
|
export {
|
|
5490
|
-
logAttributes,
|
|
5491
|
-
fromLogAttributes,
|
|
5492
|
-
snakeLogger,
|
|
5493
|
-
LOG_ATTRIBUTES,
|
|
5494
|
-
KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
5495
|
-
KEEP_STORE_RUNS_FOR_DAYS,
|
|
5496
|
-
RUNS_SIZE_LIMIT_MB,
|
|
5497
|
-
runsDirFor,
|
|
5498
|
-
startRun,
|
|
5499
|
-
runtime,
|
|
5500
|
-
newRunId,
|
|
5501
|
-
listRuns,
|
|
5502
|
-
findRun,
|
|
5503
|
-
readEvents,
|
|
5504
|
-
asOwnProcess,
|
|
5505
|
-
currentRun,
|
|
5506
|
-
inRun,
|
|
5507
|
-
runEvent,
|
|
5508
|
-
typedCommand,
|
|
5509
|
-
useAsProcessRun,
|
|
5510
|
-
processRun,
|
|
5511
|
-
enclosingTraceId,
|
|
5512
|
-
traceOf,
|
|
5513
|
-
childTrace,
|
|
5514
|
-
withAttempt,
|
|
5515
|
-
currentAttempt,
|
|
5516
3814
|
FIELD_TYPES,
|
|
5517
3815
|
OPERATORS_BY_TYPE,
|
|
5518
3816
|
QUERY_BACKENDS,
|
|
@@ -5539,6 +3837,7 @@ export {
|
|
|
5539
3837
|
serviceCallsOf,
|
|
5540
3838
|
rangeOf,
|
|
5541
3839
|
windowOf,
|
|
3840
|
+
readsZone,
|
|
5542
3841
|
formatMeetingReference,
|
|
5543
3842
|
parseMeetingReference,
|
|
5544
3843
|
canonicalMeetingReference,
|
|
@@ -5555,8 +3854,12 @@ export {
|
|
|
5555
3854
|
joinUrlWithoutQuery,
|
|
5556
3855
|
calendarText,
|
|
5557
3856
|
entryMetadata,
|
|
3857
|
+
callStats,
|
|
3858
|
+
aggregateMeetingCounts,
|
|
3859
|
+
aggregateMeetingStats,
|
|
5558
3860
|
meetingCueFingerprint,
|
|
5559
3861
|
EVENT_QUERY,
|
|
3862
|
+
PARTICIPANT_RESPONSES,
|
|
5560
3863
|
entryInWindow,
|
|
5561
3864
|
normalizeMeetingParticipantQuery,
|
|
5562
3865
|
validateMeetingParticipantSearch,
|
|
@@ -5594,7 +3897,6 @@ export {
|
|
|
5594
3897
|
transcriptLanguage,
|
|
5595
3898
|
importFiles,
|
|
5596
3899
|
CHAT_MESSAGES_READ,
|
|
5597
|
-
validateMeetingChange,
|
|
5598
3900
|
validateMeetingPassage,
|
|
5599
3901
|
validateMeetingPreparationContext,
|
|
5600
3902
|
meetingProjectEvidence,
|
|
@@ -5622,179 +3924,6 @@ export {
|
|
|
5622
3924
|
SAVE_HELP,
|
|
5623
3925
|
validateMeetingSeriesHistory,
|
|
5624
3926
|
validateMeetingSeriesInventoryCursor,
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
SOURCE_REVIEW_KIND,
|
|
5628
|
-
SOURCE_REVIEW_CAUSES,
|
|
5629
|
-
ERASED_TEXT,
|
|
5630
|
-
severity,
|
|
5631
|
-
graver,
|
|
5632
|
-
text5 as text,
|
|
5633
|
-
id3 as id,
|
|
5634
|
-
time,
|
|
5635
|
-
zonedTime,
|
|
5636
|
-
count6 as count,
|
|
5637
|
-
untrusted,
|
|
5638
|
-
providerMetadata,
|
|
5639
|
-
evidenceSource,
|
|
5640
|
-
sourceReview,
|
|
5641
|
-
author,
|
|
5642
|
-
TASK_KINDS,
|
|
5643
|
-
TASK_STATES,
|
|
5644
|
-
CLOSED_STATES,
|
|
5645
|
-
TASK_ORIGINS,
|
|
5646
|
-
TASK_VERDICTS,
|
|
5647
|
-
isClosedState,
|
|
5648
|
-
PRIORITY_LABELS,
|
|
5649
|
-
priorityLabel,
|
|
5650
|
-
priorityBand,
|
|
5651
|
-
legacyPriority,
|
|
5652
|
-
checkedScore,
|
|
5653
|
-
priorityOf,
|
|
5654
|
-
priorityOption,
|
|
5655
|
-
createTaskService,
|
|
5656
|
-
matches2 as matches,
|
|
5657
|
-
FACT_STATUSES,
|
|
5658
|
-
MEMORY_KINDS,
|
|
5659
|
-
MEMORY_STATUSES,
|
|
5660
|
-
MEMORY_SCOPES,
|
|
5661
|
-
WORK_TASK_TYPES,
|
|
5662
|
-
TASK_TYPES2 as TASK_TYPES,
|
|
5663
|
-
CATEGORIES,
|
|
5664
|
-
parseDecimal,
|
|
5665
|
-
formatDecimal,
|
|
5666
|
-
currencyOf,
|
|
5667
|
-
scaleOf,
|
|
5668
|
-
minorUnits,
|
|
5669
|
-
signedMinorUnits,
|
|
5670
|
-
moneyOf,
|
|
5671
|
-
moneyLabel,
|
|
5672
|
-
quantityOf,
|
|
5673
|
-
lineUnits,
|
|
5674
|
-
DEAL_KINDS,
|
|
5675
|
-
DEAL_STATUSES,
|
|
5676
|
-
STAGE_OUTCOMES,
|
|
5677
|
-
DEAL_ROLES,
|
|
5678
|
-
dealLine,
|
|
5679
|
-
INVOICE_DIRECTIONS,
|
|
5680
|
-
INVOICE_STATUSES,
|
|
5681
|
-
MONEY_DIRECTIONS,
|
|
5682
|
-
FINANCE_REVIEWS,
|
|
5683
|
-
settledStatus,
|
|
5684
|
-
invoiceLine,
|
|
5685
|
-
paymentLine,
|
|
5686
|
-
invoiceTitle,
|
|
5687
|
-
paymentEntryTitle,
|
|
5688
|
-
ORDER_STATUSES,
|
|
5689
|
-
ORDER_PURPOSES,
|
|
5690
|
-
orderLine,
|
|
5691
|
-
orderTitle,
|
|
5692
|
-
isEngagement,
|
|
5693
|
-
checkEngagement,
|
|
5694
|
-
RELATION_KINDS,
|
|
5695
|
-
isRelationKind,
|
|
5696
|
-
checkEnds,
|
|
5697
|
-
rolesOf,
|
|
5698
|
-
ROLE_LISTS,
|
|
5699
|
-
roleListOf,
|
|
5700
|
-
checkRole,
|
|
5701
|
-
isSymmetric,
|
|
5702
|
-
inverseOf,
|
|
5703
|
-
STANDINGS,
|
|
5704
|
-
standingOf,
|
|
5705
|
-
isUsable,
|
|
5706
|
-
KEYED,
|
|
5707
|
-
notOverriddenSql,
|
|
5708
|
-
usableLinkSql,
|
|
5709
|
-
CRM_ACTIVITY_KINDS,
|
|
5710
|
-
isCrmUserId,
|
|
5711
|
-
normalCrmUserId,
|
|
5712
|
-
isItemKind,
|
|
5713
|
-
organization,
|
|
5714
|
-
project,
|
|
5715
|
-
reminder,
|
|
5716
|
-
CATALOG_KINDS,
|
|
5717
|
-
BUSINESS_KINDS,
|
|
5718
|
-
CONTRACT_KINDS,
|
|
5719
|
-
CONTRACT_STATUSES,
|
|
5720
|
-
SUBSCRIPTION_STATUSES,
|
|
5721
|
-
WALLET_KINDS,
|
|
5722
|
-
TRANSACTION_STATUSES,
|
|
5723
|
-
ORDER_DIRECTIONS,
|
|
5724
|
-
intervalOf,
|
|
5725
|
-
productLine,
|
|
5726
|
-
contractLine,
|
|
5727
|
-
subscriptionLine,
|
|
5728
|
-
walletLine,
|
|
5729
|
-
transactionLine,
|
|
5730
|
-
TAG_TYPES,
|
|
5731
|
-
tagOf,
|
|
5732
|
-
normalizeTag,
|
|
5733
|
-
REPORTER_SQL,
|
|
5734
|
-
sourceOf,
|
|
5735
|
-
LINK_KINDS,
|
|
5736
|
-
LINK_ORIGINS,
|
|
5737
|
-
LINK_SOURCES,
|
|
5738
|
-
linkKind,
|
|
5739
|
-
COUNTERPART_ROLE,
|
|
5740
|
-
damageMarkPath,
|
|
5741
|
-
healthMarkPath,
|
|
5742
|
-
journalMarkPath,
|
|
5743
|
-
markStoreDamaged,
|
|
5744
|
-
readDamageMark,
|
|
5745
|
-
clearDamageMark,
|
|
5746
|
-
refuseDamagedStore,
|
|
5747
|
-
markJournalLost,
|
|
5748
|
-
readJournalMark,
|
|
5749
|
-
readHealthMark,
|
|
5750
|
-
recordDeepCheck,
|
|
5751
|
-
formatLocator,
|
|
5752
|
-
isLocator,
|
|
5753
|
-
parseLocator,
|
|
5754
|
-
SIMPLE_REFERENCES,
|
|
5755
|
-
formatReference,
|
|
5756
|
-
parseReference,
|
|
5757
|
-
canonicalReference,
|
|
5758
|
-
looksLikeReference,
|
|
5759
|
-
providerLabel,
|
|
5760
|
-
isFolderProvider,
|
|
5761
|
-
folderProviderSql,
|
|
5762
|
-
folderProviderOf,
|
|
5763
|
-
DOCUMENT_ACCOUNT_PROVIDERS,
|
|
5764
|
-
isDocumentAccountProvider,
|
|
5765
|
-
ADDED_PROVIDER,
|
|
5766
|
-
ADDED_ACCOUNT,
|
|
5767
|
-
notAdded,
|
|
5768
|
-
filesAccountSql,
|
|
5769
|
-
INTERNAL_NOTES,
|
|
5770
|
-
UNKNOWN_PROVIDER,
|
|
5771
|
-
providerEntryOf,
|
|
5772
|
-
kindsOfEntry,
|
|
5773
|
-
unitedKinds,
|
|
5774
|
-
providers,
|
|
5775
|
-
useStoredProviders,
|
|
5776
|
-
addProvider,
|
|
5777
|
-
isKind,
|
|
5778
|
-
providerNamed,
|
|
5779
|
-
kindIn,
|
|
5780
|
-
importedOf,
|
|
5781
|
-
isImportedProvider,
|
|
5782
|
-
holdsKind,
|
|
5783
|
-
holdsKindOf,
|
|
5784
|
-
isBotProvider,
|
|
5785
|
-
inSource,
|
|
5786
|
-
sourceOf2,
|
|
5787
|
-
ACCOUNT_GROUPS,
|
|
5788
|
-
ACCOUNT_GROUPS_SETTING,
|
|
5789
|
-
isAccountList,
|
|
5790
|
-
isGroupName,
|
|
5791
|
-
groupName,
|
|
5792
|
-
groupMembers,
|
|
5793
|
-
listedHolds,
|
|
5794
|
-
keyOf,
|
|
5795
|
-
sourceOf3,
|
|
5796
|
-
sameAs,
|
|
5797
|
-
entriesOfList,
|
|
5798
|
-
accountsOfList,
|
|
5799
|
-
fitting
|
|
3927
|
+
meetingTagChange,
|
|
3928
|
+
meetingTagging
|
|
5800
3929
|
};
|