@wirecat/mail-cli 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +3 -0
- package/contracts/wirecat.json +1325 -0
- package/dist/bin/mail.js +2 -2
- package/dist/bin/mail.js.map +1 -1
- package/dist/bundle/{all-profiles-VS7P6DJY.js → all-profiles-6NXVQLUQ.js} +11 -11
- package/dist/bundle/{anthropic-C5JXKGBS.js → anthropic-OLNFE2CL.js} +17 -10
- package/dist/bundle/{app-server-HU3LVU42.js → app-server-J76N6XIK.js} +60 -49
- package/dist/bundle/{bun-QLFX47WZ.js → bun-6PYDHXNR.js} +2 -2
- package/dist/bundle/{bun-sqlite-W4PGAKVY.js → bun-sqlite-QD5PFHPS.js} +9 -5
- package/dist/bundle/{chunk-WOX7FZJP.js → chunk-2E2EV4HD.js} +130 -77
- package/dist/bundle/{chunk-A6J4MPTI.js → chunk-2TCS4PLJ.js} +1 -1
- package/dist/bundle/{chunk-QI3PXUOJ.js → chunk-3J2UJFBJ.js} +39 -32
- package/dist/bundle/{chunk-LVGX7VTD.js → chunk-3RY4HC4V.js} +63 -5
- package/dist/bundle/chunk-3XTKQ5EM.js +54 -0
- package/dist/bundle/{chunk-ZO4MQWIK.js → chunk-4Q6KAV4O.js} +8 -8
- package/dist/bundle/{chunk-JOQGJUFT.js → chunk-52M5BAEG.js} +1 -1
- package/dist/bundle/{chunk-Q4OKEN3B.js → chunk-5WROIMUV.js} +12 -7
- package/dist/bundle/{chunk-VVL4MKYH.js → chunk-66C66FNK.js} +1 -1
- package/dist/bundle/{chunk-O373QEAJ.js → chunk-76EKZSDK.js} +27 -27
- package/dist/bundle/{chunk-AUTX2MLF.js → chunk-76VSHS5Y.js} +15 -10
- package/dist/bundle/{chunk-HBZAJINU.js → chunk-7C6FGWDH.js} +4 -4
- package/dist/bundle/{chunk-VUBZFMGP.js → chunk-7KCBPAQS.js} +2 -2
- package/dist/bundle/{chunk-FNLUKODV.js → chunk-7MEVD5PI.js} +57 -28
- package/dist/bundle/chunk-A3EBRXOQ.js +16 -0
- package/dist/bundle/{chunk-C3NYJW6B.js → chunk-A6XETABW.js} +852 -278
- package/dist/bundle/{chunk-VNKWSCN7.js → chunk-AJ5K74X6.js} +17 -17
- package/dist/bundle/{chunk-BFQQV22T.js → chunk-BDYQQ6G2.js} +1 -1
- package/dist/bundle/{chunk-ZR2BDNGG.js → chunk-BMGRDZM3.js} +1 -1
- package/dist/bundle/{chunk-TLEBSMC7.js → chunk-CFBIPM7T.js} +4109 -3575
- package/dist/bundle/{chunk-IRUN4XOV.js → chunk-CZI45AQM.js} +2 -2
- package/dist/bundle/{chunk-QVMOEB3I.js → chunk-DKIVYAXW.js} +18 -17
- package/dist/bundle/{chunk-X7J3TTDO.js → chunk-ECZSYLSL.js} +48 -9
- package/dist/bundle/{chunk-EKGRNFYQ.js → chunk-EDWJ7IYH.js} +1 -1
- package/dist/bundle/{chunk-MCPOZNWG.js → chunk-FIVFP53N.js} +1 -1
- package/dist/bundle/{chunk-5X3GU5LI.js → chunk-GIG7F6UW.js} +6 -6
- package/dist/bundle/{chunk-RN7OI5KL.js → chunk-H2IJQH5X.js} +20 -112
- package/dist/bundle/{chunk-NWKKPDZV.js → chunk-HI5XUETY.js} +2 -2
- package/dist/bundle/{chunk-YBQ5AYLZ.js → chunk-HNSBXC6U.js} +3 -3
- package/dist/bundle/{chunk-4W4EVVL4.js → chunk-IX3GUNGV.js} +4 -4
- package/dist/bundle/{chunk-PT6MF2VU.js → chunk-JNKXU7AE.js} +340 -108
- package/dist/bundle/{chunk-64ZG5ERD.js → chunk-JVJG54QK.js} +40 -2
- package/dist/bundle/{chunk-KGOVFEWZ.js → chunk-KXASCNOV.js} +3 -3
- package/dist/bundle/{chunk-5NLHDK7P.js → chunk-LMTQMYUF.js} +31 -31
- package/dist/bundle/{chunk-Q6K2XUGU.js → chunk-LTZGLOKE.js} +3 -2
- package/dist/bundle/{chunk-RLQZFZLK.js → chunk-M2LATBP2.js} +84 -10
- package/dist/bundle/{chunk-RX5CJ55S.js → chunk-M4OP5ASJ.js} +1 -1
- package/dist/bundle/{chunk-H5FJTHVA.js → chunk-M4Y33SJJ.js} +2 -2
- package/dist/bundle/{chunk-SWKQ6IAR.js → chunk-M7ECSGSN.js} +3 -3
- package/dist/bundle/{chunk-MTO6YVMN.js → chunk-M7RHPCXM.js} +3 -3
- package/dist/bundle/{chunk-PRQ2U7HF.js → chunk-MIWSCTLG.js} +2 -2
- package/dist/bundle/{chunk-NSIN5IM4.js → chunk-NBJU6MBU.js} +10 -15
- package/dist/bundle/{chunk-JWMLMAHP.js → chunk-NMFPK3MU.js} +14 -5
- package/dist/bundle/{chunk-4QNHAM3J.js → chunk-OGE7YG4J.js} +2 -2
- package/dist/bundle/{chunk-XBEO472U.js → chunk-PJ6YMNJG.js} +26515 -24466
- package/dist/bundle/{chunk-RUASZW3M.js → chunk-PY2IOVUN.js} +5 -5
- package/dist/bundle/{chunk-OQW6GHUA.js → chunk-QI6EXKSH.js} +1 -1
- package/dist/bundle/{chunk-KV4VTKF3.js → chunk-QJGG6QYV.js} +69 -6
- package/dist/bundle/{chunk-JMLIKXFO.js → chunk-RXKIP2ML.js} +2 -2
- package/dist/bundle/{chunk-6VV7J2TN.js → chunk-T7SHPALQ.js} +35 -28
- package/dist/bundle/{chunk-YI544LHI.js → chunk-UE2NKPA4.js} +9 -9
- package/dist/bundle/{chunk-X47BL4M5.js → chunk-UNJUCK5R.js} +13 -13
- package/dist/bundle/{chunk-C5BMCLCQ.js → chunk-V32L23NN.js} +4 -4
- package/dist/bundle/{chunk-DW3F6DUW.js → chunk-V4PFD25P.js} +1 -1
- package/dist/bundle/{chunk-U6MMQNNK.js → chunk-VA4V73SL.js} +6 -6
- package/dist/bundle/{chunk-3KSK5BBB.js → chunk-VJPLIXV4.js} +8 -2
- package/dist/bundle/{chunk-YA45XV6G.js → chunk-VWRT57QU.js} +4 -4
- package/dist/bundle/{chunk-FKWUUCX2.js → chunk-XELZCDWE.js} +427 -189
- package/dist/bundle/{chunk-3FD3IATT.js → chunk-XUJEZ5YF.js} +6 -6
- package/dist/bundle/{chunk-TI7ZIPA2.js → chunk-XZ7CQ6NA.js} +4 -4
- package/dist/bundle/{chunk-NCRSE647.js → chunk-YM345236.js} +159 -46
- package/dist/bundle/{chunk-6PWCQKMD.js → chunk-YXGHC3NP.js} +14 -14
- package/dist/bundle/{chunk-RNZKQMFY.js → chunk-ZZSZN4CJ.js} +22 -15
- package/dist/bundle/command-contract-NNEXHZW5.js +36 -0
- package/dist/bundle/{command-server-entry-5E3PPDE5.js → command-server-entry-AIBWNC5D.js} +25 -24
- package/dist/bundle/{decode-AVWV7SVZ.js → decode-H7KLRD33.js} +5 -5
- package/dist/bundle/{dispatch-BXPHSNK5.js → dispatch-DSVN7MNG.js} +8 -8
- package/dist/bundle/{dist-PIOOKBWT.js → dist-YYSP43J3.js} +29 -18
- package/dist/bundle/{echarts-7K6YQV52.js → echarts-VSD3LS6D.js} +2 -2
- package/dist/bundle/{embed-4NT76GJK.js → embed-UENZ5HN3.js} +6 -6
- package/dist/bundle/{embedder-ITQFF7EN.js → embedder-MJMGOJT7.js} +9 -9
- package/dist/bundle/{failure-3Q65JOPD.js → failure-COTPFUP4.js} +2 -2
- package/dist/bundle/{first-run-PM74YU4X.js → first-run-HYALREFN.js} +12 -11
- package/dist/bundle/first-screen-GPF5RHBX.js +34 -0
- package/dist/bundle/{instructions-JDSITYHV.js → instructions-WOHRYOLN.js} +1 -1
- package/dist/bundle/mail.js +15 -20
- package/dist/bundle/{mcp-7KQUJNFN.js → mcp-TDKGDB4V.js} +2 -2
- package/dist/bundle/{node-D6YIJOJI.js → node-4BRWJJCE.js} +2 -2
- package/dist/bundle/{node-sqlite-PJOHHB4X.js → node-sqlite-D3QESEYQ.js} +10 -6
- package/dist/bundle/{oauth-BOWJ3IBT.js → oauth-T7TTOBIZ.js} +7 -7
- package/dist/bundle/{open-FIAKKZMW.js → open-6P6627QB.js} +5 -5
- package/dist/bundle/{openai-QL54VVLC.js → openai-FIMCJGAP.js} +24 -19
- package/dist/bundle/{process-AYHK7WRC.js → process-35IH3WHC.js} +1 -1
- package/dist/bundle/{program-6FKWOTBK.js → program-IEXB72IK.js} +6685 -5463
- package/dist/bundle/{prompt-XJZCBELC.js → prompt-HFBCPMVL.js} +5 -5
- package/dist/bundle/{recognize-OQKWAHBY.js → recognize-CNL4HJ7Z.js} +4 -4
- package/dist/bundle/{remote-NLVUZ5WK.js → remote-AYGZI7HT.js} +9 -7
- package/dist/bundle/{rerank-NRPZDTJ7.js → rerank-5C2OZZXD.js} +7 -7
- package/dist/bundle/{serve-O4YUI7F6.js → serve-S6OYBDIB.js} +9 -9
- package/dist/bundle/{server-WAL3M4OO.js → server-VKO6E6PI.js} +42 -40
- package/dist/bundle/server-WXSHVDME.js +68 -0
- package/dist/bundle/{sqlite-runtime-5YHGI4D4.js → sqlite-runtime-DBTGNTVE.js} +6 -6
- package/dist/bundle/{state-WYYOJ7KK.js → state-ZQG6AL2Y.js} +6 -6
- package/dist/bundle/{store-X72GOJHD.js → store-B7BXWILZ.js} +25 -18
- package/dist/bundle/{store-6BJO3F2J.js → store-LY4QKTOO.js} +19 -16
- package/dist/bundle/store-maintenance-command-UR6NQDVV.js +58 -0
- package/dist/commands/rules.d.ts.map +1 -1
- package/dist/commands/rules.js +57 -19
- package/dist/commands/rules.js.map +1 -1
- package/dist/commands/session-start.d.ts.map +1 -1
- package/dist/commands/session-start.js +1 -1
- package/dist/commands/session-start.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -12
- package/dist/config.js.map +1 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +7 -2
- package/dist/discovery.js.map +1 -1
- package/dist/identity.d.ts +2 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +34 -0
- package/dist/identity.js.map +1 -1
- package/dist/mail/domain-age.d.ts +1 -1
- package/dist/mail/domain-age.d.ts.map +1 -1
- package/dist/mail/domain-age.js +9 -3
- package/dist/mail/domain-age.js.map +1 -1
- package/dist/mail/rules/file.d.ts.map +1 -1
- package/dist/mail/rules/file.js +4 -1
- package/dist/mail/rules/file.js.map +1 -1
- package/dist/mail/rules/query.d.ts +2 -1
- package/dist/mail/rules/query.d.ts.map +1 -1
- package/dist/mail/rules/query.js +16 -3
- package/dist/mail/rules/query.js.map +1 -1
- package/dist/oauth.d.ts +3 -1
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +48 -34
- package/dist/oauth.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +5 -0
- package/dist/reasons.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +2 -21
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +10 -9
- package/dist/bundle/chunk-B72343TK.js +0 -35
- package/dist/bundle/command-contract-ERYYPAD2.js +0 -35
- package/dist/bundle/first-screen-WBVGVSMY.js +0 -33
- package/dist/bundle/server-6OT5ZEWL.js +0 -66
- package/dist/bundle/store-maintenance-command-ASS7RBYC.js +0 -54
- /package/dist/bundle/{chunk-YVNHQFLC.js → chunk-XWBPP2HX.js} +0 -0
|
@@ -11,23 +11,29 @@ import {
|
|
|
11
11
|
ORDER_DIRECTIONS,
|
|
12
12
|
ORDER_PURPOSES,
|
|
13
13
|
ORDER_STATUSES,
|
|
14
|
+
QUERY_LIMITS,
|
|
14
15
|
SUBSCRIPTION_STATUSES,
|
|
15
16
|
TRANSACTION_STATUSES,
|
|
16
17
|
WALLET_KINDS,
|
|
17
18
|
looksLikeReference,
|
|
18
19
|
parseReference,
|
|
19
20
|
providerLabel,
|
|
20
|
-
providerNamed
|
|
21
|
-
|
|
21
|
+
providerNamed,
|
|
22
|
+
queryError
|
|
23
|
+
} from "./chunk-2E2EV4HD.js";
|
|
24
|
+
import {
|
|
25
|
+
fold
|
|
26
|
+
} from "./chunk-A3EBRXOQ.js";
|
|
22
27
|
import {
|
|
23
28
|
CliError,
|
|
29
|
+
isCliError,
|
|
24
30
|
singleLine
|
|
25
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7KCBPAQS.js";
|
|
26
32
|
import {
|
|
27
33
|
__name
|
|
28
34
|
} from "./chunk-ZVVMGPBJ.js";
|
|
29
35
|
|
|
30
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
31
37
|
var TAKES = {
|
|
32
38
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
33
39
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -41,8 +47,8 @@ var wrongProvider = /* @__PURE__ */ __name((text2, provider, kind) => {
|
|
|
41
47
|
const command = entry?.command;
|
|
42
48
|
const opens = kind === "entity" ? void 0 : entry?.opens?.[kind];
|
|
43
49
|
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text2}` : "open it with its own CLI";
|
|
44
|
-
const
|
|
45
|
-
return new CliError("validation_error", `${text2} is ${article(
|
|
50
|
+
const label2 = providerLabel(provider);
|
|
51
|
+
return new CliError("validation_error", `${text2} is ${article(label2.toLowerCase())} ${label2} ${kind}; ${how}`, {
|
|
46
52
|
reason: "ref.wrong-provider"
|
|
47
53
|
});
|
|
48
54
|
}, "wrongProvider");
|
|
@@ -87,7 +93,461 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn)
|
|
|
87
93
|
throw wrongAccount(reference, scope, profiles);
|
|
88
94
|
}, "ensureAccount");
|
|
89
95
|
|
|
90
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
96
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
97
|
+
var QUERY_VERSION = 1;
|
|
98
|
+
var QUERY_LIMITS2 = {
|
|
99
|
+
...QUERY_LIMITS,
|
|
100
|
+
pattern: 1024,
|
|
101
|
+
states: 1e4,
|
|
102
|
+
expansions: 1e4,
|
|
103
|
+
candidates: 5e4,
|
|
104
|
+
bodyBytes: 8388608,
|
|
105
|
+
milliseconds: 2e3,
|
|
106
|
+
work: 1e7
|
|
107
|
+
};
|
|
108
|
+
var SEARCH_QUERY = {
|
|
109
|
+
command: "search",
|
|
110
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
|
|
111
|
+
};
|
|
112
|
+
var MESSAGE_PARSING = { ...SEARCH_QUERY, proximity: true };
|
|
113
|
+
var MOST_WORDS_APART = 50;
|
|
114
|
+
function searchError(reason, span, alternative) {
|
|
115
|
+
queryError(reason, span, alternative, SEARCH_QUERY);
|
|
116
|
+
}
|
|
117
|
+
__name(searchError, "searchError");
|
|
118
|
+
var ANSWER_MS = 1e3;
|
|
119
|
+
var searchTimeLimit = /* @__PURE__ */ __name((deadline, now = Date.now()) => deadline?.explicit ? Math.max(QUERY_LIMITS2.milliseconds, deadline.endsAt - now - ANSWER_MS) : void 0, "searchTimeLimit");
|
|
120
|
+
function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
|
|
121
|
+
throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
|
|
122
|
+
}
|
|
123
|
+
__name(outOfTime, "outOfTime");
|
|
124
|
+
var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
|
|
125
|
+
function exhausted(budget) {
|
|
126
|
+
throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
|
|
127
|
+
reason: "query.too-large",
|
|
128
|
+
budget,
|
|
129
|
+
complete: false
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
__name(exhausted, "exhausted");
|
|
133
|
+
function tooWideTerm([term], budget) {
|
|
134
|
+
if (term === void 0)
|
|
135
|
+
exhausted(budget);
|
|
136
|
+
const part = term.replace(/[*?]+/gu, " ").trim().split(/\s+/u).sort((a, b) => b.length - a.length)[0] ?? term;
|
|
137
|
+
throw new CliError("validation_error", `search exceeded its ${budget} budget: ${term} is checked word by word, and too many messages hold it \u2014 write *${part}* (any word holding it, read from the index), more of the word, or add chat: or date:`, { reason: "query.too-large", budget, term, complete: false });
|
|
138
|
+
}
|
|
139
|
+
__name(tooWideTerm, "tooWideTerm");
|
|
140
|
+
|
|
141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
142
|
+
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
143
|
+
var literal = /* @__PURE__ */ __name((c) => ({
|
|
144
|
+
kind: "char",
|
|
145
|
+
ranges: [[c.codePointAt(0) ?? 0, c.codePointAt(0) ?? 0]],
|
|
146
|
+
negate: false
|
|
147
|
+
}), "literal");
|
|
148
|
+
var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end: pattern.length }) => {
|
|
149
|
+
if (pattern.length > QUERY_LIMITS2.pattern * 2)
|
|
150
|
+
exhausted("pattern");
|
|
151
|
+
const chars = [...pattern];
|
|
152
|
+
if (chars.length > QUERY_LIMITS2.pattern)
|
|
153
|
+
exhausted("pattern");
|
|
154
|
+
let at = 0, depth = 0;
|
|
155
|
+
const failure = /* @__PURE__ */ __name(() => searchError("query.invalid-regex", span, "use the supported Lucene regex subset"), "failure");
|
|
156
|
+
const character = /* @__PURE__ */ __name(() => {
|
|
157
|
+
if (at >= chars.length)
|
|
158
|
+
return failure();
|
|
159
|
+
return chars[at++];
|
|
160
|
+
}, "character");
|
|
161
|
+
const predefined = /* @__PURE__ */ __name(() => {
|
|
162
|
+
if (chars[at] !== "\\")
|
|
163
|
+
return void 0;
|
|
164
|
+
const name = chars[at + 1] ?? "";
|
|
165
|
+
let ranges;
|
|
166
|
+
if (name.toLowerCase() === "d")
|
|
167
|
+
ranges = [[48, 57]];
|
|
168
|
+
if (name.toLowerCase() === "w")
|
|
169
|
+
ranges = [
|
|
170
|
+
[48, 57],
|
|
171
|
+
[65, 90],
|
|
172
|
+
[95, 95],
|
|
173
|
+
[97, 122]
|
|
174
|
+
];
|
|
175
|
+
if (name.toLowerCase() === "s")
|
|
176
|
+
ranges = [
|
|
177
|
+
[9, 10],
|
|
178
|
+
[13, 13],
|
|
179
|
+
[32, 32]
|
|
180
|
+
];
|
|
181
|
+
if (ranges) {
|
|
182
|
+
at += 2;
|
|
183
|
+
return { kind: "char", ranges, negate: name === name.toUpperCase() };
|
|
184
|
+
}
|
|
185
|
+
if (/^[a-zA-Z]$/u.test(name))
|
|
186
|
+
return failure();
|
|
187
|
+
return void 0;
|
|
188
|
+
}, "predefined");
|
|
189
|
+
const escaped = /* @__PURE__ */ __name(() => {
|
|
190
|
+
if (chars[at] === "\\")
|
|
191
|
+
at++;
|
|
192
|
+
return character();
|
|
193
|
+
}, "escaped");
|
|
194
|
+
const union = /* @__PURE__ */ __name(() => {
|
|
195
|
+
if (++depth > QUERY_LIMITS2.depth)
|
|
196
|
+
exhausted("pattern depth");
|
|
197
|
+
const children = [concat()];
|
|
198
|
+
while (chars[at] === "|") {
|
|
199
|
+
at++;
|
|
200
|
+
children.push(concat());
|
|
201
|
+
}
|
|
202
|
+
depth--;
|
|
203
|
+
return children.length === 1 ? children[0] : { kind: "union", children };
|
|
204
|
+
}, "union");
|
|
205
|
+
const concat = /* @__PURE__ */ __name(() => {
|
|
206
|
+
const children = [];
|
|
207
|
+
do {
|
|
208
|
+
children.push(repeat());
|
|
209
|
+
} while (at < chars.length && ![")", "|", "&"].includes(chars[at] ?? ""));
|
|
210
|
+
if (chars[at] === "&")
|
|
211
|
+
searchError("query.unsupported-regex", span, "automaton intersection is not supported");
|
|
212
|
+
return children.length === 1 ? children[0] : { kind: "concat", children };
|
|
213
|
+
}, "concat");
|
|
214
|
+
const repeat = /* @__PURE__ */ __name(() => {
|
|
215
|
+
let child = simple();
|
|
216
|
+
while (["?", "*", "+", "{"].includes(chars[at] ?? "")) {
|
|
217
|
+
const op = character();
|
|
218
|
+
let min = op === "+" ? 1 : 0, max = op === "?" ? 1 : null;
|
|
219
|
+
if (op === "{") {
|
|
220
|
+
const number = /* @__PURE__ */ __name(() => {
|
|
221
|
+
const start2 = at;
|
|
222
|
+
while (/^[0-9]$/u.test(chars[at] ?? ""))
|
|
223
|
+
at++;
|
|
224
|
+
if (at === start2)
|
|
225
|
+
return failure();
|
|
226
|
+
return Number(chars.slice(start2, at).join(""));
|
|
227
|
+
}, "number");
|
|
228
|
+
min = number();
|
|
229
|
+
max = min;
|
|
230
|
+
if (chars[at] === ",") {
|
|
231
|
+
at++;
|
|
232
|
+
max = chars[at] === "}" ? null : number();
|
|
233
|
+
}
|
|
234
|
+
if (character() !== "}" || max !== null && max < min)
|
|
235
|
+
return failure();
|
|
236
|
+
}
|
|
237
|
+
if (min > QUERY_LIMITS2.states || max !== null && max > QUERY_LIMITS2.states)
|
|
238
|
+
exhausted("automaton states");
|
|
239
|
+
child = { kind: "repeat", child, min, max };
|
|
240
|
+
}
|
|
241
|
+
return child;
|
|
242
|
+
}, "repeat");
|
|
243
|
+
const simple = /* @__PURE__ */ __name(() => {
|
|
244
|
+
const predefinedAtom = predefined();
|
|
245
|
+
if (predefinedAtom)
|
|
246
|
+
return predefinedAtom;
|
|
247
|
+
const c = character();
|
|
248
|
+
if (c === "~" || c === "<")
|
|
249
|
+
searchError("query.unsupported-regex", span, "complement, named automata and numeric intervals are not supported");
|
|
250
|
+
if (c === ".")
|
|
251
|
+
return any;
|
|
252
|
+
if (c === "#")
|
|
253
|
+
return { kind: "empty" };
|
|
254
|
+
if (c === "@")
|
|
255
|
+
return { kind: "repeat", child: any, min: 0, max: null };
|
|
256
|
+
if (c === '"') {
|
|
257
|
+
const children = [];
|
|
258
|
+
while (chars[at] !== '"')
|
|
259
|
+
children.push(literal(character()));
|
|
260
|
+
at++;
|
|
261
|
+
return { kind: "concat", children };
|
|
262
|
+
}
|
|
263
|
+
if (c === "(") {
|
|
264
|
+
if (chars[at] === ")") {
|
|
265
|
+
at++;
|
|
266
|
+
return { kind: "epsilon" };
|
|
267
|
+
}
|
|
268
|
+
if (chars[at] === "?")
|
|
269
|
+
searchError("query.unsupported-regex", span, "JavaScript groups and lookaround are not Lucene operators");
|
|
270
|
+
const child = union();
|
|
271
|
+
if (character() !== ")")
|
|
272
|
+
return failure();
|
|
273
|
+
return child;
|
|
274
|
+
}
|
|
275
|
+
if (c === "[") {
|
|
276
|
+
const negate = chars[at] === "^";
|
|
277
|
+
if (negate)
|
|
278
|
+
at++;
|
|
279
|
+
const choices = [];
|
|
280
|
+
do {
|
|
281
|
+
const pre = predefined();
|
|
282
|
+
if (pre) {
|
|
283
|
+
choices.push(pre);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
const lo = escaped().codePointAt(0) ?? 0;
|
|
287
|
+
let hi = lo;
|
|
288
|
+
if (chars[at] === "-") {
|
|
289
|
+
at++;
|
|
290
|
+
hi = escaped().codePointAt(0) ?? 0;
|
|
291
|
+
}
|
|
292
|
+
if (hi < lo)
|
|
293
|
+
return failure();
|
|
294
|
+
choices.push({ kind: "char", ranges: [[lo, hi]], negate: false });
|
|
295
|
+
} while (at < chars.length && chars[at] !== "]");
|
|
296
|
+
if (character() !== "]")
|
|
297
|
+
return failure();
|
|
298
|
+
if (!negate)
|
|
299
|
+
return { kind: "union", children: choices };
|
|
300
|
+
const ranges = [];
|
|
301
|
+
for (const choice of choices) {
|
|
302
|
+
if (choice.kind !== "char" || choice.negate)
|
|
303
|
+
searchError("query.unsupported-regex", span, "negative predefined classes inside a negated class are not supported");
|
|
304
|
+
ranges.push(...choice.ranges);
|
|
305
|
+
}
|
|
306
|
+
return { kind: "char", ranges, negate: true };
|
|
307
|
+
}
|
|
308
|
+
if (c === "\\")
|
|
309
|
+
return literal(character());
|
|
310
|
+
return literal(c);
|
|
311
|
+
}, "simple");
|
|
312
|
+
const expression = chars.length === 0 ? { kind: "epsilon" } : union();
|
|
313
|
+
if (at !== chars.length)
|
|
314
|
+
return failure();
|
|
315
|
+
const states = [];
|
|
316
|
+
const state = /* @__PURE__ */ __name(() => {
|
|
317
|
+
if (states.length >= QUERY_LIMITS2.states)
|
|
318
|
+
exhausted("automaton states");
|
|
319
|
+
states.push({ epsilon: [], edges: [] });
|
|
320
|
+
return states.length - 1;
|
|
321
|
+
}, "state");
|
|
322
|
+
const epsilon = /* @__PURE__ */ __name((from, to) => {
|
|
323
|
+
;
|
|
324
|
+
states[from].epsilon.push(to);
|
|
325
|
+
}, "epsilon");
|
|
326
|
+
const build = /* @__PURE__ */ __name((node, from, to) => {
|
|
327
|
+
if (node.kind === "char") {
|
|
328
|
+
;
|
|
329
|
+
states[from].edges.push({ to, atom: node });
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
if (node.kind === "empty")
|
|
333
|
+
return;
|
|
334
|
+
if (node.kind === "epsilon") {
|
|
335
|
+
epsilon(from, to);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (node.kind === "union") {
|
|
339
|
+
for (const child of node.children)
|
|
340
|
+
build(child, from, to);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (node.kind === "concat") {
|
|
344
|
+
let current2 = from;
|
|
345
|
+
node.children.forEach((child, index) => {
|
|
346
|
+
const next = index === node.children.length - 1 ? to : state();
|
|
347
|
+
build(child, current2, next);
|
|
348
|
+
current2 = next;
|
|
349
|
+
});
|
|
350
|
+
if (node.children.length === 0)
|
|
351
|
+
epsilon(from, to);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
let current = from;
|
|
355
|
+
for (let i = 0; i < node.min; i++) {
|
|
356
|
+
const next = state();
|
|
357
|
+
build(node.child, current, next);
|
|
358
|
+
current = next;
|
|
359
|
+
}
|
|
360
|
+
if (node.max === null) {
|
|
361
|
+
epsilon(current, to);
|
|
362
|
+
const end2 = state();
|
|
363
|
+
build(node.child, current, end2);
|
|
364
|
+
epsilon(end2, current);
|
|
365
|
+
} else {
|
|
366
|
+
for (let i = node.min; i < node.max; i++) {
|
|
367
|
+
epsilon(current, to);
|
|
368
|
+
const next = state();
|
|
369
|
+
build(node.child, current, next);
|
|
370
|
+
current = next;
|
|
371
|
+
}
|
|
372
|
+
epsilon(current, to);
|
|
373
|
+
}
|
|
374
|
+
}, "build");
|
|
375
|
+
const start = state(), end = state();
|
|
376
|
+
build(expression, start, end);
|
|
377
|
+
return {
|
|
378
|
+
states: states.length,
|
|
379
|
+
test: /* @__PURE__ */ __name((text2, budget = { work: 0 }) => {
|
|
380
|
+
const spend = /* @__PURE__ */ __name(() => {
|
|
381
|
+
if (++budget.work > (budget.maxWork ?? QUERY_LIMITS2.work))
|
|
382
|
+
exhausted("automaton work");
|
|
383
|
+
}, "spend");
|
|
384
|
+
const closure = /* @__PURE__ */ __name((initial) => {
|
|
385
|
+
const stack = [...initial];
|
|
386
|
+
while (stack.length) {
|
|
387
|
+
const id = stack.pop();
|
|
388
|
+
for (const next of states[id].epsilon) {
|
|
389
|
+
spend();
|
|
390
|
+
if (!initial.has(next)) {
|
|
391
|
+
initial.add(next);
|
|
392
|
+
stack.push(next);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return initial;
|
|
397
|
+
}, "closure");
|
|
398
|
+
let current = closure(/* @__PURE__ */ new Set([start]));
|
|
399
|
+
for (const c of text2) {
|
|
400
|
+
const point = c.codePointAt(0) ?? 0;
|
|
401
|
+
const next = /* @__PURE__ */ new Set();
|
|
402
|
+
for (const id of current)
|
|
403
|
+
for (const edge of states[id].edges) {
|
|
404
|
+
spend();
|
|
405
|
+
const inside = edge.atom.ranges.some(([lo, hi]) => point >= lo && point <= hi);
|
|
406
|
+
if (inside !== edge.atom.negate)
|
|
407
|
+
next.add(edge.to);
|
|
408
|
+
}
|
|
409
|
+
current = closure(next);
|
|
410
|
+
if (current.size === 0)
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
return current.has(end);
|
|
414
|
+
}, "test")
|
|
415
|
+
};
|
|
416
|
+
}, "compileAutomaton");
|
|
417
|
+
var wildcardPattern = /* @__PURE__ */ __name((value) => {
|
|
418
|
+
const chars = [...value];
|
|
419
|
+
let pattern = "";
|
|
420
|
+
for (let at = 0; at < chars.length; at++) {
|
|
421
|
+
const c = chars[at];
|
|
422
|
+
if (c === "\\") {
|
|
423
|
+
const escaped = chars[++at];
|
|
424
|
+
if (escaped === void 0)
|
|
425
|
+
searchError("query.invalid-escape", { start: 0, end: value.length });
|
|
426
|
+
pattern += /[|&?*+(){}[\].#@<>"~\\]/u.test(escaped) ? `\\${escaped}` : escaped;
|
|
427
|
+
} else
|
|
428
|
+
pattern += c === "*" ? ".*" : c === "?" ? "." : /[|&?*+(){}[\].#@<>"~\\]/u.test(c) ? `\\${c}` : c;
|
|
429
|
+
}
|
|
430
|
+
return pattern;
|
|
431
|
+
}, "wildcardPattern");
|
|
432
|
+
var FOLD_RANGE = 4096;
|
|
433
|
+
var unfoldable = /* @__PURE__ */ __name((span, what) => searchError("query.unsupported-regex", span, `${what} has no single lowercase form without accents, which is what text: words are \u2014 write it that way, or use body:/\u2026/ to match the original text`), "unfoldable");
|
|
434
|
+
var classChar = /* @__PURE__ */ __name((point) => {
|
|
435
|
+
const c = String.fromCodePoint(point);
|
|
436
|
+
return /[\p{L}\p{N}]/u.test(c) ? c : `\\${c}`;
|
|
437
|
+
}, "classChar");
|
|
438
|
+
var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
439
|
+
const chars = [...pattern.normalize("NFC")];
|
|
440
|
+
let out = "";
|
|
441
|
+
let at = 0;
|
|
442
|
+
const literal2 = /* @__PURE__ */ __name((c) => {
|
|
443
|
+
if (!/[\p{L}\p{N}\p{M}]/u.test(c))
|
|
444
|
+
return c;
|
|
445
|
+
const folded = fold(c);
|
|
446
|
+
if (folded === "")
|
|
447
|
+
return unfoldable(span, `"${c}"`);
|
|
448
|
+
if ([...folded].length === 1 && /[\p{L}\p{N}]/u.test(folded))
|
|
449
|
+
return folded;
|
|
450
|
+
if (folded.includes('"'))
|
|
451
|
+
return unfoldable(span, `"${c}"`);
|
|
452
|
+
return `"${folded}"`;
|
|
453
|
+
}, "literal");
|
|
454
|
+
const characterClass = /* @__PURE__ */ __name(() => {
|
|
455
|
+
const begin = at - 1;
|
|
456
|
+
let negate = "";
|
|
457
|
+
if (chars[at] === "^") {
|
|
458
|
+
negate = "^";
|
|
459
|
+
at++;
|
|
460
|
+
}
|
|
461
|
+
const kept2 = [];
|
|
462
|
+
const points = /* @__PURE__ */ new Set();
|
|
463
|
+
do {
|
|
464
|
+
const start = at;
|
|
465
|
+
if (chars[at] === "\\" && /^[a-zA-Z]$/u.test(chars[at + 1] ?? "")) {
|
|
466
|
+
kept2.push(`\\${chars[at + 1]}`);
|
|
467
|
+
at += 2;
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
const escaped = /* @__PURE__ */ __name(() => {
|
|
471
|
+
if (chars[at] === "\\")
|
|
472
|
+
at++;
|
|
473
|
+
return (chars[at++] ?? "").codePointAt(0) ?? 0;
|
|
474
|
+
}, "escaped");
|
|
475
|
+
const lo = escaped();
|
|
476
|
+
let hi = lo;
|
|
477
|
+
if (chars[at] === "-") {
|
|
478
|
+
at++;
|
|
479
|
+
hi = escaped();
|
|
480
|
+
}
|
|
481
|
+
if (at > chars.length) {
|
|
482
|
+
out += chars.slice(begin).join("");
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
const single = /* @__PURE__ */ __name((point) => [...fold(String.fromCodePoint(point))], "single");
|
|
486
|
+
if (hi < lo)
|
|
487
|
+
kept2.push(chars.slice(start, at).join(""));
|
|
488
|
+
else if (hi - lo >= FOLD_RANGE) {
|
|
489
|
+
if (single(lo).join("") !== String.fromCodePoint(lo) || single(hi).join("") !== String.fromCodePoint(hi))
|
|
490
|
+
unfoldable(span, `the range ${chars.slice(start, at).join("")}`);
|
|
491
|
+
kept2.push(chars.slice(start, at).join(""));
|
|
492
|
+
} else
|
|
493
|
+
for (let point = lo; point <= hi; point++) {
|
|
494
|
+
const folded = single(point);
|
|
495
|
+
if (folded.length === 1)
|
|
496
|
+
points.add(folded[0]?.codePointAt(0) ?? 0);
|
|
497
|
+
else if (lo === hi)
|
|
498
|
+
unfoldable(span, `"${String.fromCodePoint(point)}"`);
|
|
499
|
+
}
|
|
500
|
+
} while (at < chars.length && chars[at] !== "]");
|
|
501
|
+
const sorted = [...points].sort((a, b) => a - b);
|
|
502
|
+
const ranges = [];
|
|
503
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
504
|
+
const first = sorted[i];
|
|
505
|
+
while (sorted[i + 1] === sorted[i] + 1)
|
|
506
|
+
i++;
|
|
507
|
+
const last = sorted[i];
|
|
508
|
+
ranges.push(last === first ? classChar(first) : `${classChar(first)}-${classChar(last)}`);
|
|
509
|
+
}
|
|
510
|
+
if (!kept2.length && !ranges.length)
|
|
511
|
+
unfoldable(span, "the class");
|
|
512
|
+
out += `[${negate}${kept2.join("")}${ranges.join("")}`;
|
|
513
|
+
}, "characterClass");
|
|
514
|
+
while (at < chars.length) {
|
|
515
|
+
const c = chars[at++];
|
|
516
|
+
if (c === "\\") {
|
|
517
|
+
const next = chars[at++];
|
|
518
|
+
if (next === void 0)
|
|
519
|
+
out += c;
|
|
520
|
+
else
|
|
521
|
+
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` : literal2(next);
|
|
522
|
+
} else if (c === '"') {
|
|
523
|
+
const end = chars.indexOf('"', at);
|
|
524
|
+
if (end < 0) {
|
|
525
|
+
out += chars.slice(at - 1).join("");
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
const folded = fold(chars.slice(at, end).join(""));
|
|
529
|
+
if (folded.includes('"'))
|
|
530
|
+
unfoldable(span, `"${chars.slice(at, end).join("")}"`);
|
|
531
|
+
out += `"${folded}"`;
|
|
532
|
+
at = end + 1;
|
|
533
|
+
} else if (c === "[")
|
|
534
|
+
characterClass();
|
|
535
|
+
else
|
|
536
|
+
out += literal2(c);
|
|
537
|
+
}
|
|
538
|
+
return out;
|
|
539
|
+
}, "foldRegex");
|
|
540
|
+
|
|
541
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
542
|
+
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
543
|
+
const padded = ` ${term} `;
|
|
544
|
+
const pieces = /* @__PURE__ */ new Set();
|
|
545
|
+
for (let at = 0; at + 3 <= padded.length; at++)
|
|
546
|
+
pieces.add(padded.slice(at, at + 3));
|
|
547
|
+
return [...pieces];
|
|
548
|
+
}, "trigrams");
|
|
549
|
+
|
|
550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
91
551
|
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
92
552
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
93
553
|
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
@@ -115,24 +575,50 @@ var pickPerson = /* @__PURE__ */ __name((reference, people) => {
|
|
|
115
575
|
throw new CliError("not_found", `no person ${trimmed} in what this account has seen`);
|
|
116
576
|
const wanted = foldName(trimmed.replace(/^@/, ""));
|
|
117
577
|
const everyone = people.all().toSorted((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
578
|
+
const exact = everyone.filter((person) => namesOf(person).includes(wanted));
|
|
579
|
+
const containing = everyone.filter((person) => namesOf(person).some((one) => one.includes(wanted)));
|
|
580
|
+
if (exact.length === 1 && exact[0])
|
|
581
|
+
return exact[0];
|
|
582
|
+
if (containing.length === 1 && containing[0])
|
|
583
|
+
return containing[0];
|
|
584
|
+
if (containing.length === 0)
|
|
124
585
|
throw new CliError("not_found", `nobody matches "${reference}"`);
|
|
586
|
+
const matches = exact.length > 0 ? [...exact, ...containing.filter((person) => !exact.includes(person))] : containing;
|
|
125
587
|
throw ambiguous(reference, "people", matches.map(({ id, name, username }) => ({ id, name, username })), ({ name, username }) => singleLine([name, username && `@${username}`].filter(isPresent).join(" ")));
|
|
126
588
|
}, "pickPerson");
|
|
127
|
-
var
|
|
589
|
+
var namesOf = /* @__PURE__ */ __name((person, byAddress = false) => [person.alias, person.name, person.username, byAddress ? person.id : void 0].filter(isPresent).map(foldName), "namesOf");
|
|
590
|
+
var chatNamesOf = /* @__PURE__ */ __name((chat) => [chat.title, chat.providerMetadata?.username].filter((one) => typeof one === "string" && one !== "").map(foldName), "chatNamesOf");
|
|
591
|
+
var namePattern = /* @__PURE__ */ __name((pattern) => {
|
|
592
|
+
const automaton = compileAutomaton(wildcardPattern(foldName(pattern.trim().replace(/^@/, ""))));
|
|
593
|
+
return (names) => names.some((one) => automaton.test(one));
|
|
594
|
+
}, "namePattern");
|
|
595
|
+
var peopleMatching = /* @__PURE__ */ __name((pattern, people, { byAddress = false } = {}) => {
|
|
596
|
+
const fits = namePattern(pattern);
|
|
597
|
+
return people.filter((person) => fits(namesOf(person, byAddress)));
|
|
598
|
+
}, "peopleMatching");
|
|
599
|
+
var chatsMatching = /* @__PURE__ */ __name((pattern, chats) => {
|
|
600
|
+
const fits = namePattern(pattern);
|
|
601
|
+
return chats.filter((chat) => fits(chatNamesOf(chat)));
|
|
602
|
+
}, "chatsMatching");
|
|
603
|
+
var nearest = /* @__PURE__ */ __name((pattern, items, names, most = 5) => {
|
|
604
|
+
const pieces = /* @__PURE__ */ __name((text2) => foldName(text2).split(/\s+/u).flatMap(trigrams), "pieces");
|
|
605
|
+
const wanted = new Set(pieces(pattern.replace(/\\(.)/gu, "$1").replace(/[*?@]/gu, " ").trim()));
|
|
606
|
+
if (wanted.size === 0)
|
|
607
|
+
return [];
|
|
608
|
+
return items.map((item) => ({
|
|
609
|
+
item,
|
|
610
|
+
score: names(item).flatMap(pieces).filter((piece) => wanted.has(piece)).length
|
|
611
|
+
})).filter(({ score }) => score > 1).toSorted((a, b) => b.score - a.score).slice(0, most).map(({ item }) => item);
|
|
612
|
+
}, "nearest");
|
|
613
|
+
var ambiguous = /* @__PURE__ */ __name((reference, what, candidates, label2) => {
|
|
128
614
|
const width = Math.max(...candidates.map(({ id }) => id.length));
|
|
129
|
-
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${
|
|
615
|
+
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label2(candidate)}`).join("\n");
|
|
130
616
|
return new CliError("validation_error", `"${singleLine(reference)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
131
617
|
${lines}`, { candidates });
|
|
132
618
|
}, "ambiguous");
|
|
133
619
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
134
620
|
|
|
135
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
136
622
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
137
623
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
138
624
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -182,7 +668,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
|
182
668
|
}), "arrayOf");
|
|
183
669
|
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
184
670
|
|
|
185
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
186
672
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
187
673
|
var PARTY = ["person", "organization"];
|
|
188
674
|
var ORGANIZATION = ["organization"];
|
|
@@ -480,6 +966,7 @@ var RECORD_TYPES = {
|
|
|
480
966
|
update: "in-place",
|
|
481
967
|
tombstone: true,
|
|
482
968
|
importOnly: true,
|
|
969
|
+
sheet: false,
|
|
483
970
|
fields: objectOf({
|
|
484
971
|
kind: enumOf(["sms"], "sms: a text message of the phone"),
|
|
485
972
|
direction: enumOf(SMS_DIRECTIONS, "in: the other side wrote it; out: the owner did"),
|
|
@@ -497,6 +984,7 @@ var RECORD_TYPES = {
|
|
|
497
984
|
update: "in-place",
|
|
498
985
|
tombstone: true,
|
|
499
986
|
importOnly: true,
|
|
987
|
+
sheet: false,
|
|
500
988
|
fields: objectOf({
|
|
501
989
|
kind: enumOf(["call"], "call: a phone call"),
|
|
502
990
|
direction: enumOf(CALL_DIRECTIONS, "in, out, or missed: a call the owner did not take"),
|
|
@@ -506,6 +994,25 @@ var RECORD_TYPES = {
|
|
|
506
994
|
}, { required: ["kind", "direction", "phone", "started_at"] }),
|
|
507
995
|
roles: COUNTERPART
|
|
508
996
|
},
|
|
997
|
+
document: {
|
|
998
|
+
table: "documents",
|
|
999
|
+
review: "direct",
|
|
1000
|
+
update: "in-place",
|
|
1001
|
+
tombstone: true,
|
|
1002
|
+
importOnly: true,
|
|
1003
|
+
fieldsBytes: 1048576,
|
|
1004
|
+
fields: objectOf({
|
|
1005
|
+
title: text("What the document is called; its external id when left out", 500),
|
|
1006
|
+
text: { type: "string", maxLength: 1e6, description: "The text search reads" },
|
|
1007
|
+
created_at: instant("When the source made it"),
|
|
1008
|
+
updated_at: instant("When the source last changed it: what date: reads"),
|
|
1009
|
+
url: text("Where the original is", 4096),
|
|
1010
|
+
metadata: { type: "object", description: "Anything else the source knows about it, kept as sent" }
|
|
1011
|
+
}, { required: ["text"] }),
|
|
1012
|
+
roles: {
|
|
1013
|
+
about: { targets: ["person", "organization", "deal", "event"], many: true }
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
509
1016
|
pipeline: {
|
|
510
1017
|
table: "pipelines",
|
|
511
1018
|
review: "direct",
|
|
@@ -526,7 +1033,7 @@ var RECORD_TYPES = {
|
|
|
526
1033
|
}
|
|
527
1034
|
};
|
|
528
1035
|
var isRecordType = /* @__PURE__ */ __name((type) => Object.hasOwn(RECORD_TYPES, type), "isRecordType");
|
|
529
|
-
var isBusinessType = /* @__PURE__ */ __name((type) => isRecordType(type) && RECORD_TYPES[type].review !== "identity", "isBusinessType");
|
|
1036
|
+
var isBusinessType = /* @__PURE__ */ __name((type) => isRecordType(type) && RECORD_TYPES[type].review !== "identity" && type !== "document", "isBusinessType");
|
|
530
1037
|
var isIdentityType = /* @__PURE__ */ __name((type) => typeof type === "string" && isRecordType(type) && RECORD_TYPES[type].review === "identity", "isIdentityType");
|
|
531
1038
|
var RECORD_ENTITY_TYPES = Object.keys(RECORD_TYPES);
|
|
532
1039
|
var RECORD_TABLES = Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, spec]) => [type, spec.table]));
|
|
@@ -556,44 +1063,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf(type).some(([, role])
|
|
|
556
1063
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
557
1064
|
var article2 = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
|
|
558
1065
|
|
|
559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
560
|
-
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
561
|
-
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
562
|
-
var counterValue = /* @__PURE__ */ __name((message, field) => {
|
|
563
|
-
const value = field === "reactions" ? message.reactions?.total : message.providerMetadata?.[field];
|
|
564
|
-
return validCounter(value) ? value : null;
|
|
565
|
-
}, "counterValue");
|
|
566
|
-
var counterObservationTime = /* @__PURE__ */ __name((observation, now) => {
|
|
567
|
-
const at = Date.parse(observation.observedAt);
|
|
568
|
-
if (!validCounter(observation.value) || !Number.isSafeInteger(at) || at < 0 || at > now || !["remote_fetch", "remote_update"].includes(observation.source))
|
|
569
|
-
throw new CliError("validation_error", "counter observation needs a valid value, source and nonfuture observation time");
|
|
570
|
-
if (observation.reactions && (!validCounter(observation.reactions.total) || observation.reactions.total !== observation.value))
|
|
571
|
-
throw new CliError("validation_error", "reaction observation payload and total disagree");
|
|
572
|
-
return at;
|
|
573
|
-
}, "counterObservationTime");
|
|
574
|
-
var observedCounters = /* @__PURE__ */ __name((message, observedAt, fields, source = "remote_fetch") => {
|
|
575
|
-
const observations = {};
|
|
576
|
-
for (const field of fields) {
|
|
577
|
-
const value = counterValue(message, field);
|
|
578
|
-
if (value !== null)
|
|
579
|
-
observations[field] = {
|
|
580
|
-
value,
|
|
581
|
-
observedAt,
|
|
582
|
-
source,
|
|
583
|
-
...field === "reactions" && message.reactions ? { reactions: message.reactions } : {}
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
return { ...message, counterObservations: observations };
|
|
587
|
-
}, "observedCounters");
|
|
588
|
-
var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
589
|
-
if (!states.length || states.every((one) => one.freshness === "unknown"))
|
|
590
|
-
return "unknown";
|
|
591
|
-
if (states.some((one) => one.freshness === "unknown"))
|
|
592
|
-
return "partial";
|
|
593
|
-
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
594
|
-
}, "counterFreshness");
|
|
595
|
-
|
|
596
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
1066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
597
1067
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
598
1068
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
599
1069
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -639,208 +1109,23 @@ var ROLE_ADDRESS_WORDS = {
|
|
|
639
1109
|
"orders",
|
|
640
1110
|
"feedback",
|
|
641
1111
|
"newsletter",
|
|
642
|
-
"notifications",
|
|
643
|
-
"alerts"
|
|
644
|
-
]
|
|
645
|
-
};
|
|
646
|
-
var bare = /* @__PURE__ */ __name((word) => word.replace(/[.\-_]/gu, ""), "bare");
|
|
647
|
-
var NO_REPLY = new Set(ROLE_ADDRESS_WORDS.noReply.map(bare));
|
|
648
|
-
var ROLE = new Set([...ROLE_ADDRESS_WORDS.shared, ...ROLE_ADDRESS_WORDS.noReply].map(bare));
|
|
649
|
-
var localWord = /* @__PURE__ */ __name((address) => {
|
|
650
|
-
const local = address.trim().toLowerCase().split("@")[0] ?? "";
|
|
651
|
-
return bare(local.split("+")[0] ?? "");
|
|
652
|
-
}, "localWord");
|
|
653
|
-
var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)), "isRoleAddress");
|
|
654
|
-
var
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
var QUOTES = [
|
|
658
|
-
['"', '"'],
|
|
659
|
-
["'", "'"],
|
|
660
|
-
["\xAB", "\xBB"],
|
|
661
|
-
["\u201C", "\u201D"],
|
|
662
|
-
["\u201E", "\u201C"],
|
|
663
|
-
["\u2018", "\u2019"],
|
|
664
|
-
["`", "`"]
|
|
665
|
-
];
|
|
666
|
-
var READABLE = /[\p{L}\p{N}]/u;
|
|
667
|
-
var PLACEHOLDERS = /* @__PURE__ */ new Set(["null", "undefined", "none", "\u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0438", "deleted account", "\u0443\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442"]);
|
|
668
|
-
var unquoted = /* @__PURE__ */ __name((text2) => {
|
|
669
|
-
let at = text2.replace(/\s+/gu, " ").trim();
|
|
670
|
-
for (; ; ) {
|
|
671
|
-
const pair = QUOTES.find(([open, close]) => at.length >= 2 && at.startsWith(open) && at.endsWith(close));
|
|
672
|
-
if (pair === void 0)
|
|
673
|
-
return at;
|
|
674
|
-
at = at.slice(pair[0].length, at.length - pair[1].length).trim();
|
|
675
|
-
}
|
|
676
|
-
}, "unquoted");
|
|
677
|
-
var given = /* @__PURE__ */ __name((value) => {
|
|
678
|
-
const text2 = typeof value === "string" ? value.trim() : "";
|
|
679
|
-
return text2 === "" ? void 0 : text2;
|
|
680
|
-
}, "given");
|
|
681
|
-
var displayName = /* @__PURE__ */ __name((name, fallbacks = {}) => {
|
|
682
|
-
const unwrapped = typeof name === "string" ? unquoted(name) : "";
|
|
683
|
-
const cleaned = PLACEHOLDERS.has(unwrapped.toLowerCase()) ? "" : unwrapped;
|
|
684
|
-
if (READABLE.test(cleaned))
|
|
685
|
-
return cleaned;
|
|
686
|
-
const username = given(fallbacks.username);
|
|
687
|
-
return (username === void 0 ? void 0 : username.startsWith("@") ? username : `@${username}`) ?? given(fallbacks.phone) ?? given(fallbacks.email) ?? (cleaned === "" ? null : cleaned);
|
|
688
|
-
}, "displayName");
|
|
689
|
-
var nameKey = /* @__PURE__ */ __name((name) => {
|
|
690
|
-
if (typeof name !== "string")
|
|
691
|
-
return null;
|
|
692
|
-
const unwrapped = unquoted(name);
|
|
693
|
-
if (PLACEHOLDERS.has(unwrapped.toLowerCase()))
|
|
694
|
-
return null;
|
|
695
|
-
const words = foldName(unwrapped).split(/[^\p{L}\p{N}]+/u).filter((word) => word !== "");
|
|
696
|
-
return words.length === 0 ? null : words.sort().join(" ");
|
|
697
|
-
}, "nameKey");
|
|
698
|
-
var isReadable = /* @__PURE__ */ __name((shown) => shown !== null && READABLE.test(shown), "isReadable");
|
|
699
|
-
|
|
700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
701
|
-
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
702
|
-
var AUTHOR_MEASURES = [
|
|
703
|
-
"messages",
|
|
704
|
-
"words",
|
|
705
|
-
"reactions",
|
|
706
|
-
"replies",
|
|
707
|
-
"answers",
|
|
708
|
-
"answer-time",
|
|
709
|
-
"threads",
|
|
710
|
-
"active-days"
|
|
711
|
-
];
|
|
712
|
-
var CONTEXT = /* @__PURE__ */ new Set([
|
|
713
|
-
"replies",
|
|
714
|
-
"replies-from-others",
|
|
715
|
-
"replies-from-others-per-message",
|
|
716
|
-
"thread-size",
|
|
717
|
-
"threads",
|
|
718
|
-
"answers",
|
|
719
|
-
"answer-time"
|
|
720
|
-
]);
|
|
721
|
-
var needsRankingContext = /* @__PURE__ */ __name((options) => options.components.some((name) => CONTEXT.has(name)), "needsRankingContext");
|
|
722
|
-
var presets = {
|
|
723
|
-
helpful: { answers: 0.5, "replies-from-others": 0.25, reactions: 0.25 },
|
|
724
|
-
active: { "active-days": 0.6, messages: 0.4 },
|
|
725
|
-
engaging: { "reactions-per-message": 0.5, "replies-from-others-per-message": 0.5 }
|
|
726
|
-
};
|
|
727
|
-
function invalid(message) {
|
|
728
|
-
throw new CliError("validation_error", message, { reason: "ranking.invalid" });
|
|
729
|
-
}
|
|
730
|
-
__name(invalid, "invalid");
|
|
731
|
-
var rankingOptions = /* @__PURE__ */ __name((target, input) => {
|
|
732
|
-
const measures = target === "messages" ? MESSAGE_MEASURES : AUTHOR_MEASURES;
|
|
733
|
-
const { measure, score, weights: given2, minMessages } = input;
|
|
734
|
-
const messageKind = input.messageKind ?? "all";
|
|
735
|
-
if (!["all", "posts", "comments"].includes(messageKind))
|
|
736
|
-
invalid("message_kind takes all, posts or comments");
|
|
737
|
-
if (target === "messages" && minMessages !== void 0)
|
|
738
|
-
invalid("min_messages applies to stats contacts top");
|
|
739
|
-
if (minMessages !== void 0 && (!Number.isSafeInteger(minMessages) || minMessages < 1))
|
|
740
|
-
invalid("min_messages takes a positive integer");
|
|
741
|
-
if (measure !== void 0 && !measures.includes(measure))
|
|
742
|
-
invalid(`--measure takes ${measures.join(", ")}`);
|
|
743
|
-
if (measure !== void 0 && (score !== void 0 || given2 !== void 0))
|
|
744
|
-
invalid("--measure cannot be combined with --score or --weights");
|
|
745
|
-
if (score !== void 0 && !["helpful", "active", "engaging"].includes(score))
|
|
746
|
-
invalid("--score takes helpful, active or engaging");
|
|
747
|
-
if (target === "messages" && score !== void 0 && score !== "engaging")
|
|
748
|
-
invalid("helpful and active scores apply to authors only");
|
|
749
|
-
const scoring = score !== void 0 || given2 !== void 0;
|
|
750
|
-
const preset = score;
|
|
751
|
-
let weights = null;
|
|
752
|
-
if (scoring) {
|
|
753
|
-
let raw = given2 !== void 0 ? given2 : target === "messages" ? { reactions: 0.5, "replies-from-others": 0.5 } : presets[preset];
|
|
754
|
-
if (typeof raw === "string") {
|
|
755
|
-
try {
|
|
756
|
-
raw = JSON.parse(raw);
|
|
757
|
-
} catch {
|
|
758
|
-
invalid("--weights takes a JSON object of component weights");
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
762
|
-
invalid("--weights takes a JSON object of component weights");
|
|
763
|
-
const allowed = target === "messages" ? [...MESSAGE_MEASURES, "replies-from-others"] : [
|
|
764
|
-
...AUTHOR_MEASURES.filter((name) => name !== "answer-time"),
|
|
765
|
-
"replies-from-others",
|
|
766
|
-
"reactions-per-message",
|
|
767
|
-
"replies-from-others-per-message"
|
|
768
|
-
];
|
|
769
|
-
const entries = Object.entries(raw);
|
|
770
|
-
for (const [name, weight] of entries) {
|
|
771
|
-
if (!allowed.includes(name))
|
|
772
|
-
invalid(`unknown ${target} score component: ${name}`);
|
|
773
|
-
if (typeof weight !== "number" || !Number.isFinite(weight) || weight < 0)
|
|
774
|
-
invalid(`weight for ${name} must be a finite nonnegative number`);
|
|
775
|
-
}
|
|
776
|
-
if (!entries.some(([, weight]) => weight > 0))
|
|
777
|
-
invalid("--weights needs at least one positive weight");
|
|
778
|
-
weights = Object.fromEntries(entries);
|
|
779
|
-
}
|
|
780
|
-
const selected = measure ?? (target === "messages" ? "reactions" : "messages");
|
|
781
|
-
return {
|
|
782
|
-
target,
|
|
783
|
-
messageKind,
|
|
784
|
-
minMessages: minMessages ?? (target === "contacts" && score === "engaging" ? 5 : 1),
|
|
785
|
-
measure: scoring ? "score" : selected,
|
|
786
|
-
order: !scoring && selected === "answer-time" ? "ascending" : "descending",
|
|
787
|
-
weights,
|
|
788
|
-
preset: scoring ? preset ?? "custom" : null,
|
|
789
|
-
components: weights === null ? [selected] : Object.entries(weights).filter(([, weight]) => weight > 0).map(([name]) => name)
|
|
790
|
-
};
|
|
791
|
-
}, "rankingOptions");
|
|
792
|
-
var rankingScore = /* @__PURE__ */ __name((raw, maxima, weights) => {
|
|
793
|
-
const entries = Object.entries(weights).filter(([, weight]) => weight > 0);
|
|
794
|
-
const scale = Math.max(...entries.map(([, weight]) => weight));
|
|
795
|
-
const denominator = entries.reduce((sum2, [, weight]) => sum2 + weight / scale, 0);
|
|
796
|
-
if (!Number.isFinite(scale) || scale <= 0 || !Number.isFinite(denominator) || denominator <= 0)
|
|
797
|
-
return null;
|
|
798
|
-
const normalized = {};
|
|
799
|
-
const contributions = {};
|
|
800
|
-
let sum = 0;
|
|
801
|
-
for (const [name, weight] of entries) {
|
|
802
|
-
const value = raw[name];
|
|
803
|
-
const maximum = maxima[name];
|
|
804
|
-
if (value == null || !Number.isFinite(value) || value < 0 || maximum === void 0 || !Number.isFinite(maximum) || maximum < value)
|
|
805
|
-
return null;
|
|
806
|
-
const part = maximum === 0 ? 0 : value / maximum;
|
|
807
|
-
normalized[name] = part;
|
|
808
|
-
contributions[name] = 100 * part * (weight / scale) / denominator;
|
|
809
|
-
sum += contributions[name];
|
|
810
|
-
}
|
|
811
|
-
return { score: Math.min(100, sum), normalized, contributions };
|
|
812
|
-
}, "rankingScore");
|
|
813
|
-
var RANKING_TOKENIZER_VERSION = 1;
|
|
814
|
-
var withoutUrls = /* @__PURE__ */ __name((text2) => text2.replace(/\S+/gu, (token) => {
|
|
815
|
-
for (let offset = 0; ; ) {
|
|
816
|
-
const marker = token.indexOf("://", offset);
|
|
817
|
-
if (marker < 0)
|
|
818
|
-
break;
|
|
819
|
-
let start = marker;
|
|
820
|
-
while (start > 0 && /[a-z0-9+.-]/iu.test(token[start - 1]))
|
|
821
|
-
start--;
|
|
822
|
-
if (/^[a-z][a-z0-9+.-]*$/iu.test(token.slice(start, marker)) && (start === 0 || !/\w/u.test(token[start - 1])))
|
|
823
|
-
return token.slice(0, start);
|
|
824
|
-
offset = marker + 3;
|
|
825
|
-
}
|
|
826
|
-
const folded = token.toLowerCase();
|
|
827
|
-
for (let offset = 0; ; ) {
|
|
828
|
-
const start = folded.indexOf("www.", offset);
|
|
829
|
-
if (start < 0)
|
|
830
|
-
break;
|
|
831
|
-
if (start === 0 || !/\w/u.test(token[start - 1]))
|
|
832
|
-
return token.slice(0, start);
|
|
833
|
-
offset = start + 4;
|
|
834
|
-
}
|
|
835
|
-
return token;
|
|
836
|
-
}), "withoutUrls");
|
|
837
|
-
var rankingWords = /* @__PURE__ */ __name((text2) => withoutUrls(text2).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
838
|
-
var rankingQuestion = /* @__PURE__ */ __name((text2) => withoutUrls(text2).includes("?"), "rankingQuestion");
|
|
839
|
-
|
|
840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_4dc2b7e09a64a37f199c7e635efe1b87/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
841
|
-
import { createHash } from "node:crypto";
|
|
1112
|
+
"notifications",
|
|
1113
|
+
"alerts"
|
|
1114
|
+
]
|
|
1115
|
+
};
|
|
1116
|
+
var bare = /* @__PURE__ */ __name((word) => word.replace(/[.\-_]/gu, ""), "bare");
|
|
1117
|
+
var NO_REPLY = new Set(ROLE_ADDRESS_WORDS.noReply.map(bare));
|
|
1118
|
+
var ROLE = new Set([...ROLE_ADDRESS_WORDS.shared, ...ROLE_ADDRESS_WORDS.noReply].map(bare));
|
|
1119
|
+
var localWord = /* @__PURE__ */ __name((address) => {
|
|
1120
|
+
const local = address.trim().toLowerCase().split("@")[0] ?? "";
|
|
1121
|
+
return bare(local.split("+")[0] ?? "");
|
|
1122
|
+
}, "localWord");
|
|
1123
|
+
var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)), "isRoleAddress");
|
|
1124
|
+
var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
1125
|
+
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
1126
|
+
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
842
1127
|
|
|
843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
844
1129
|
var PHONE_PLANS = [
|
|
845
1130
|
{
|
|
846
1131
|
country: "us",
|
|
@@ -1220,7 +1505,7 @@ var PHONE_PLANS = [
|
|
|
1220
1505
|
}
|
|
1221
1506
|
];
|
|
1222
1507
|
|
|
1223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1508
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
1224
1509
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
1225
1510
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
1226
1511
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -1284,6 +1569,7 @@ var e164Of = /* @__PURE__ */ __name((phone, region) => {
|
|
|
1284
1569
|
const digits = phone.replace(/\(0\)/, "").replace(/\D/g, "");
|
|
1285
1570
|
return nationalPhone(digits, [region], { anyType: true })?.value;
|
|
1286
1571
|
}, "e164Of");
|
|
1572
|
+
var isMobilePhone = /* @__PURE__ */ __name((e164) => /^\+\d+$/.test(e164) && PHONE_COUNTRIES.some((country) => nationalPhone(e164.slice(1), [country], { anyType: false })?.value === e164), "isMobilePhone");
|
|
1287
1573
|
var BARE_INTERNATIONAL_PROVIDERS = ["telegram", "max", "whatsapp"];
|
|
1288
1574
|
var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
1289
1575
|
if (/^\s*(\+|00)/.test(raw))
|
|
@@ -1294,7 +1580,243 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
1294
1580
|
return found ? `+${found[1]}` : void 0;
|
|
1295
1581
|
}, "storedPhone");
|
|
1296
1582
|
|
|
1297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1583
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
1584
|
+
var QUOTES = [
|
|
1585
|
+
['"', '"'],
|
|
1586
|
+
["'", "'"],
|
|
1587
|
+
["\xAB", "\xBB"],
|
|
1588
|
+
["\u201C", "\u201D"],
|
|
1589
|
+
["\u201E", "\u201C"],
|
|
1590
|
+
["\u2018", "\u2019"],
|
|
1591
|
+
["`", "`"]
|
|
1592
|
+
];
|
|
1593
|
+
var READABLE = /[\p{L}\p{N}]/u;
|
|
1594
|
+
var PLACEHOLDERS = /* @__PURE__ */ new Set(["null", "undefined", "none", "\u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0438", "deleted account", "\u0443\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442"]);
|
|
1595
|
+
var unquoted = /* @__PURE__ */ __name((text2) => {
|
|
1596
|
+
let at = text2.replace(/\s+/gu, " ").trim();
|
|
1597
|
+
for (; ; ) {
|
|
1598
|
+
const pair = QUOTES.find(([open, close]) => at.length >= 2 && at.startsWith(open) && at.endsWith(close));
|
|
1599
|
+
if (pair === void 0)
|
|
1600
|
+
return at;
|
|
1601
|
+
at = at.slice(pair[0].length, at.length - pair[1].length).trim();
|
|
1602
|
+
}
|
|
1603
|
+
}, "unquoted");
|
|
1604
|
+
var given = /* @__PURE__ */ __name((value) => {
|
|
1605
|
+
const text2 = typeof value === "string" ? value.trim() : "";
|
|
1606
|
+
return text2 === "" ? void 0 : text2;
|
|
1607
|
+
}, "given");
|
|
1608
|
+
var displayName = /* @__PURE__ */ __name((name, fallbacks = {}) => {
|
|
1609
|
+
const unwrapped = typeof name === "string" ? unquoted(name) : "";
|
|
1610
|
+
const cleaned = PLACEHOLDERS.has(unwrapped.toLowerCase()) ? "" : unwrapped;
|
|
1611
|
+
if (READABLE.test(cleaned))
|
|
1612
|
+
return cleaned;
|
|
1613
|
+
const borrowed = fallbacks.name === void 0 || fallbacks.name === null ? null : displayName(fallbacks.name);
|
|
1614
|
+
if (borrowed !== null && READABLE.test(borrowed) && !borrowed.startsWith("@"))
|
|
1615
|
+
return borrowed;
|
|
1616
|
+
const username = given(fallbacks.username);
|
|
1617
|
+
return (username === void 0 ? void 0 : username.startsWith("@") ? username : `@${username}`) ?? given(fallbacks.phone) ?? given(fallbacks.email) ?? (cleaned === "" ? null : cleaned);
|
|
1618
|
+
}, "displayName");
|
|
1619
|
+
var present = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "" ? value : null, "present");
|
|
1620
|
+
var takeFallbacks = /* @__PURE__ */ __name((into, identity) => {
|
|
1621
|
+
const named = displayName(identity.name);
|
|
1622
|
+
if (into.name === null && isReadable(named) && !named?.startsWith("@"))
|
|
1623
|
+
into.name = named;
|
|
1624
|
+
into.username ??= present(identity.username);
|
|
1625
|
+
into.phone ??= present(identity.phone) ?? (identity.provider === "phone" ? identity.id : null);
|
|
1626
|
+
into.email ??= present(identity.email) ?? (identity.provider === "email" ? identity.id : null);
|
|
1627
|
+
return into;
|
|
1628
|
+
}, "takeFallbacks");
|
|
1629
|
+
var noFallbacks = /* @__PURE__ */ __name(() => ({ name: null, username: null, phone: null, email: null }), "noFallbacks");
|
|
1630
|
+
var nameKey = /* @__PURE__ */ __name((name) => {
|
|
1631
|
+
if (typeof name !== "string")
|
|
1632
|
+
return null;
|
|
1633
|
+
const unwrapped = unquoted(name);
|
|
1634
|
+
if (PLACEHOLDERS.has(unwrapped.toLowerCase()))
|
|
1635
|
+
return null;
|
|
1636
|
+
const words = foldName(unwrapped).split(/[^\p{L}\p{N}]+/u).filter((word) => word !== "");
|
|
1637
|
+
return words.length === 0 ? null : words.sort().join(" ");
|
|
1638
|
+
}, "nameKey");
|
|
1639
|
+
var isReadable = /* @__PURE__ */ __name((shown) => shown !== null && READABLE.test(shown), "isReadable");
|
|
1640
|
+
|
|
1641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
1642
|
+
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
1643
|
+
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
1644
|
+
var counterValue = /* @__PURE__ */ __name((message, field) => {
|
|
1645
|
+
const value = field === "reactions" ? message.reactions?.total : message.providerMetadata?.[field];
|
|
1646
|
+
return validCounter(value) ? value : null;
|
|
1647
|
+
}, "counterValue");
|
|
1648
|
+
var counterObservationTime = /* @__PURE__ */ __name((observation, now) => {
|
|
1649
|
+
const at = Date.parse(observation.observedAt);
|
|
1650
|
+
if (!validCounter(observation.value) || !Number.isSafeInteger(at) || at < 0 || at > now || !["remote_fetch", "remote_update"].includes(observation.source))
|
|
1651
|
+
throw new CliError("validation_error", "counter observation needs a valid value, source and nonfuture observation time");
|
|
1652
|
+
if (observation.reactions && (!validCounter(observation.reactions.total) || observation.reactions.total !== observation.value))
|
|
1653
|
+
throw new CliError("validation_error", "reaction observation payload and total disagree");
|
|
1654
|
+
return at;
|
|
1655
|
+
}, "counterObservationTime");
|
|
1656
|
+
var observedCounters = /* @__PURE__ */ __name((message, observedAt, fields, source = "remote_fetch") => {
|
|
1657
|
+
const observations = {};
|
|
1658
|
+
for (const field of fields) {
|
|
1659
|
+
const value = counterValue(message, field);
|
|
1660
|
+
if (value !== null)
|
|
1661
|
+
observations[field] = {
|
|
1662
|
+
value,
|
|
1663
|
+
observedAt,
|
|
1664
|
+
source,
|
|
1665
|
+
...field === "reactions" && message.reactions ? { reactions: message.reactions } : {}
|
|
1666
|
+
};
|
|
1667
|
+
}
|
|
1668
|
+
return { ...message, counterObservations: observations };
|
|
1669
|
+
}, "observedCounters");
|
|
1670
|
+
var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
1671
|
+
if (!states.length || states.every((one) => one.freshness === "unknown"))
|
|
1672
|
+
return "unknown";
|
|
1673
|
+
if (states.some((one) => one.freshness === "unknown"))
|
|
1674
|
+
return "partial";
|
|
1675
|
+
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
1676
|
+
}, "counterFreshness");
|
|
1677
|
+
|
|
1678
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
1679
|
+
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
1680
|
+
var AUTHOR_MEASURES = [
|
|
1681
|
+
"messages",
|
|
1682
|
+
"words",
|
|
1683
|
+
"reactions",
|
|
1684
|
+
"replies",
|
|
1685
|
+
"answers",
|
|
1686
|
+
"answer-time",
|
|
1687
|
+
"threads",
|
|
1688
|
+
"active-days"
|
|
1689
|
+
];
|
|
1690
|
+
var CONTEXT = /* @__PURE__ */ new Set([
|
|
1691
|
+
"replies",
|
|
1692
|
+
"replies-from-others",
|
|
1693
|
+
"replies-from-others-per-message",
|
|
1694
|
+
"thread-size",
|
|
1695
|
+
"threads",
|
|
1696
|
+
"answers",
|
|
1697
|
+
"answer-time"
|
|
1698
|
+
]);
|
|
1699
|
+
var needsRankingContext = /* @__PURE__ */ __name((options) => options.components.some((name) => CONTEXT.has(name)), "needsRankingContext");
|
|
1700
|
+
var presets = {
|
|
1701
|
+
helpful: { answers: 0.5, "replies-from-others": 0.25, reactions: 0.25 },
|
|
1702
|
+
active: { "active-days": 0.6, messages: 0.4 },
|
|
1703
|
+
engaging: { "reactions-per-message": 0.5, "replies-from-others-per-message": 0.5 }
|
|
1704
|
+
};
|
|
1705
|
+
function invalid(message) {
|
|
1706
|
+
throw new CliError("validation_error", message, { reason: "ranking.invalid" });
|
|
1707
|
+
}
|
|
1708
|
+
__name(invalid, "invalid");
|
|
1709
|
+
var rankingOptions = /* @__PURE__ */ __name((target, input) => {
|
|
1710
|
+
const measures = target === "messages" ? MESSAGE_MEASURES : AUTHOR_MEASURES;
|
|
1711
|
+
const { measure, score, weights: given2, minMessages } = input;
|
|
1712
|
+
const messageKind = input.messageKind ?? "all";
|
|
1713
|
+
if (!["all", "posts", "comments"].includes(messageKind))
|
|
1714
|
+
invalid("message_kind takes all, posts or comments");
|
|
1715
|
+
if (target === "messages" && minMessages !== void 0)
|
|
1716
|
+
invalid("min_messages applies to stats contacts top");
|
|
1717
|
+
if (minMessages !== void 0 && (!Number.isSafeInteger(minMessages) || minMessages < 1))
|
|
1718
|
+
invalid("min_messages takes a positive integer");
|
|
1719
|
+
if (measure !== void 0 && !measures.includes(measure))
|
|
1720
|
+
invalid(`--measure takes ${measures.join(", ")}`);
|
|
1721
|
+
if (measure !== void 0 && (score !== void 0 || given2 !== void 0))
|
|
1722
|
+
invalid("--measure cannot be combined with --score or --weights");
|
|
1723
|
+
if (score !== void 0 && !["helpful", "active", "engaging"].includes(score))
|
|
1724
|
+
invalid("--score takes helpful, active or engaging");
|
|
1725
|
+
if (target === "messages" && score !== void 0 && score !== "engaging")
|
|
1726
|
+
invalid("helpful and active scores apply to authors only");
|
|
1727
|
+
const scoring = score !== void 0 || given2 !== void 0;
|
|
1728
|
+
const preset = score;
|
|
1729
|
+
let weights = null;
|
|
1730
|
+
if (scoring) {
|
|
1731
|
+
let raw = given2 !== void 0 ? given2 : target === "messages" ? { reactions: 0.5, "replies-from-others": 0.5 } : presets[preset];
|
|
1732
|
+
if (typeof raw === "string") {
|
|
1733
|
+
try {
|
|
1734
|
+
raw = JSON.parse(raw);
|
|
1735
|
+
} catch {
|
|
1736
|
+
invalid("--weights takes a JSON object of component weights");
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
1740
|
+
invalid("--weights takes a JSON object of component weights");
|
|
1741
|
+
const allowed = target === "messages" ? [...MESSAGE_MEASURES, "replies-from-others"] : [
|
|
1742
|
+
...AUTHOR_MEASURES.filter((name) => name !== "answer-time"),
|
|
1743
|
+
"replies-from-others",
|
|
1744
|
+
"reactions-per-message",
|
|
1745
|
+
"replies-from-others-per-message"
|
|
1746
|
+
];
|
|
1747
|
+
const entries = Object.entries(raw);
|
|
1748
|
+
for (const [name, weight] of entries) {
|
|
1749
|
+
if (!allowed.includes(name))
|
|
1750
|
+
invalid(`unknown ${target} score component: ${name}`);
|
|
1751
|
+
if (typeof weight !== "number" || !Number.isFinite(weight) || weight < 0)
|
|
1752
|
+
invalid(`weight for ${name} must be a finite nonnegative number`);
|
|
1753
|
+
}
|
|
1754
|
+
if (!entries.some(([, weight]) => weight > 0))
|
|
1755
|
+
invalid("--weights needs at least one positive weight");
|
|
1756
|
+
weights = Object.fromEntries(entries);
|
|
1757
|
+
}
|
|
1758
|
+
const selected = measure ?? (target === "messages" ? "reactions" : "messages");
|
|
1759
|
+
return {
|
|
1760
|
+
target,
|
|
1761
|
+
messageKind,
|
|
1762
|
+
minMessages: minMessages ?? (target === "contacts" && score === "engaging" ? 5 : 1),
|
|
1763
|
+
measure: scoring ? "score" : selected,
|
|
1764
|
+
order: !scoring && selected === "answer-time" ? "ascending" : "descending",
|
|
1765
|
+
weights,
|
|
1766
|
+
preset: scoring ? preset ?? "custom" : null,
|
|
1767
|
+
components: weights === null ? [selected] : Object.entries(weights).filter(([, weight]) => weight > 0).map(([name]) => name)
|
|
1768
|
+
};
|
|
1769
|
+
}, "rankingOptions");
|
|
1770
|
+
var rankingScore = /* @__PURE__ */ __name((raw, maxima, weights) => {
|
|
1771
|
+
const entries = Object.entries(weights).filter(([, weight]) => weight > 0);
|
|
1772
|
+
const scale = Math.max(...entries.map(([, weight]) => weight));
|
|
1773
|
+
const denominator = entries.reduce((sum2, [, weight]) => sum2 + weight / scale, 0);
|
|
1774
|
+
if (!Number.isFinite(scale) || scale <= 0 || !Number.isFinite(denominator) || denominator <= 0)
|
|
1775
|
+
return null;
|
|
1776
|
+
const normalized = {};
|
|
1777
|
+
const contributions = {};
|
|
1778
|
+
let sum = 0;
|
|
1779
|
+
for (const [name, weight] of entries) {
|
|
1780
|
+
const value = raw[name];
|
|
1781
|
+
const maximum = maxima[name];
|
|
1782
|
+
if (value == null || !Number.isFinite(value) || value < 0 || maximum === void 0 || !Number.isFinite(maximum) || maximum < value)
|
|
1783
|
+
return null;
|
|
1784
|
+
const part = maximum === 0 ? 0 : value / maximum;
|
|
1785
|
+
normalized[name] = part;
|
|
1786
|
+
contributions[name] = 100 * part * (weight / scale) / denominator;
|
|
1787
|
+
sum += contributions[name];
|
|
1788
|
+
}
|
|
1789
|
+
return { score: Math.min(100, sum), normalized, contributions };
|
|
1790
|
+
}, "rankingScore");
|
|
1791
|
+
var RANKING_TOKENIZER_VERSION = 1;
|
|
1792
|
+
var withoutUrls = /* @__PURE__ */ __name((text2) => text2.replace(/\S+/gu, (token) => {
|
|
1793
|
+
for (let offset = 0; ; ) {
|
|
1794
|
+
const marker = token.indexOf("://", offset);
|
|
1795
|
+
if (marker < 0)
|
|
1796
|
+
break;
|
|
1797
|
+
let start = marker;
|
|
1798
|
+
while (start > 0 && /[a-z0-9+.-]/iu.test(token[start - 1]))
|
|
1799
|
+
start--;
|
|
1800
|
+
if (/^[a-z][a-z0-9+.-]*$/iu.test(token.slice(start, marker)) && (start === 0 || !/\w/u.test(token[start - 1])))
|
|
1801
|
+
return token.slice(0, start);
|
|
1802
|
+
offset = marker + 3;
|
|
1803
|
+
}
|
|
1804
|
+
const folded = token.toLowerCase();
|
|
1805
|
+
for (let offset = 0; ; ) {
|
|
1806
|
+
const start = folded.indexOf("www.", offset);
|
|
1807
|
+
if (start < 0)
|
|
1808
|
+
break;
|
|
1809
|
+
if (start === 0 || !/\w/u.test(token[start - 1]))
|
|
1810
|
+
return token.slice(0, start);
|
|
1811
|
+
offset = start + 4;
|
|
1812
|
+
}
|
|
1813
|
+
return token;
|
|
1814
|
+
}), "withoutUrls");
|
|
1815
|
+
var rankingWords = /* @__PURE__ */ __name((text2) => withoutUrls(text2).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
1816
|
+
var rankingQuestion = /* @__PURE__ */ __name((text2) => withoutUrls(text2).includes("?"), "rankingQuestion");
|
|
1817
|
+
|
|
1818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
1819
|
+
import { createHash } from "node:crypto";
|
|
1298
1820
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
1299
1821
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
1300
1822
|
var LINE_OPTIONS = ["text", "products"];
|
|
@@ -1465,23 +1987,73 @@ var fieldReferences = /* @__PURE__ */ __name((record, options = {}) => {
|
|
|
1465
1987
|
return found;
|
|
1466
1988
|
}, "fieldReferences");
|
|
1467
1989
|
|
|
1468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1469
|
-
var
|
|
1470
|
-
var
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.653.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_65220cf269874adf69135700bd89254b/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
1991
|
+
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
1992
|
+
var ROLE_LABELS = {
|
|
1993
|
+
organization: {
|
|
1994
|
+
employee: label("Employee", "\u0421\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A", "Empleado"),
|
|
1995
|
+
contractor: label("Contractor", "\u041F\u043E\u0434\u0440\u044F\u0434\u0447\u0438\u043A", "Contratista"),
|
|
1996
|
+
founder: label("Founder", "\u041E\u0441\u043D\u043E\u0432\u0430\u0442\u0435\u043B\u044C", "Fundador"),
|
|
1997
|
+
owner: label("Owner", "\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446", "Propietario"),
|
|
1998
|
+
manager: label("Manager", "\u0420\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C", "Directivo"),
|
|
1999
|
+
adviser: label("Adviser", "\u0421\u043E\u0432\u0435\u0442\u043D\u0438\u043A", "Asesor"),
|
|
2000
|
+
contact: label("Contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442", "Contacto")
|
|
2001
|
+
},
|
|
2002
|
+
project: {
|
|
2003
|
+
owner: label("Owner", "\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446", "Propietario"),
|
|
2004
|
+
manager: label("Manager", "\u0420\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C", "Directivo"),
|
|
2005
|
+
contributor: label("Contributor", "\u0423\u0447\u0430\u0441\u0442\u043D\u0438\u043A", "Colaborador"),
|
|
2006
|
+
"client-contact": label("Client contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442 \u043A\u043B\u0438\u0435\u043D\u0442\u0430", "Contacto del cliente"),
|
|
2007
|
+
approver: label("Approver", "\u0421\u043E\u0433\u043B\u0430\u0441\u0443\u044E\u0449\u0438\u0439", "Aprobador")
|
|
2008
|
+
},
|
|
2009
|
+
deal: {
|
|
2010
|
+
owner: label("Responsible", "\u041E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439", "Responsable"),
|
|
2011
|
+
contact: label("Contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442", "Contacto"),
|
|
2012
|
+
"decision-maker": label("Decision-maker", "\u041F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043D\u0438\u0435", "Responsable de decidir"),
|
|
2013
|
+
influencer: label("Influencer", "\u0412\u043B\u0438\u044F\u0435\u0442 \u043D\u0430 \u0440\u0435\u0448\u0435\u043D\u0438\u0435", "Influye en la decisi\xF3n")
|
|
2014
|
+
},
|
|
2015
|
+
contract: {
|
|
2016
|
+
customer: label("Customer", "\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A", "Cliente"),
|
|
2017
|
+
supplier: label("Supplier", "\u041F\u043E\u0441\u0442\u0430\u0432\u0449\u0438\u043A", "Proveedor"),
|
|
2018
|
+
signatory: label("Signatory", "\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0442", "Firmante"),
|
|
2019
|
+
guarantor: label("Guarantor", "\u041F\u043E\u0440\u0443\u0447\u0438\u0442\u0435\u043B\u044C", "Garante")
|
|
2020
|
+
},
|
|
2021
|
+
related: {
|
|
2022
|
+
colleague: label("Colleague", "\u041A\u043E\u043B\u043B\u0435\u0433\u0430", "Colega"),
|
|
2023
|
+
adviser: label("Adviser", "\u0421\u043E\u0432\u0435\u0442\u043D\u0438\u043A", "Asesor"),
|
|
2024
|
+
investor: label("Investor", "\u0418\u043D\u0432\u0435\u0441\u0442\u043E\u0440", "Inversor"),
|
|
2025
|
+
mentor: label("Mentor", "\u041D\u0430\u0441\u0442\u0430\u0432\u043D\u0438\u043A", "Mentor"),
|
|
2026
|
+
family: label("Family", "\u0421\u0435\u043C\u044C\u044F", "Familia"),
|
|
2027
|
+
friend: label("Friend", "\u0414\u0440\u0443\u0433", "Amigo")
|
|
2028
|
+
}
|
|
2029
|
+
};
|
|
1476
2030
|
|
|
1477
2031
|
export {
|
|
1478
2032
|
chatReferenceOf,
|
|
1479
2033
|
wrongAccount,
|
|
1480
2034
|
ensureAccount,
|
|
2035
|
+
QUERY_VERSION,
|
|
2036
|
+
QUERY_LIMITS2 as QUERY_LIMITS,
|
|
2037
|
+
SEARCH_QUERY,
|
|
2038
|
+
MESSAGE_PARSING,
|
|
2039
|
+
MOST_WORDS_APART,
|
|
2040
|
+
searchError,
|
|
2041
|
+
searchTimeLimit,
|
|
2042
|
+
outOfTime,
|
|
2043
|
+
isQueryLimit,
|
|
2044
|
+
exhausted,
|
|
2045
|
+
tooWideTerm,
|
|
2046
|
+
compileAutomaton,
|
|
2047
|
+
wildcardPattern,
|
|
2048
|
+
foldRegex,
|
|
2049
|
+
trigrams,
|
|
1481
2050
|
isId,
|
|
1482
2051
|
foldName,
|
|
1483
2052
|
pickChat,
|
|
1484
2053
|
pickPerson,
|
|
2054
|
+
peopleMatching,
|
|
2055
|
+
chatsMatching,
|
|
2056
|
+
nearest,
|
|
1485
2057
|
isObject,
|
|
1486
2058
|
RECORD_TYPES,
|
|
1487
2059
|
isRecordType,
|
|
@@ -1499,26 +2071,31 @@ export {
|
|
|
1499
2071
|
hasV1Roles,
|
|
1500
2072
|
IDENTITY_TYPES,
|
|
1501
2073
|
article2 as article,
|
|
2074
|
+
isEmailAddress,
|
|
2075
|
+
ROLE_ADDRESS_WORDS,
|
|
2076
|
+
isRoleAddress,
|
|
2077
|
+
isPersonLikeRoleAddress,
|
|
2078
|
+
isNoReplyAddress,
|
|
2079
|
+
PHONE_COUNTRIES,
|
|
1502
2080
|
DEFAULT_PHONE_COUNTRIES,
|
|
1503
2081
|
parsePhoneCountries,
|
|
1504
2082
|
nationalPhone,
|
|
1505
2083
|
typedPhone,
|
|
1506
2084
|
e164Of,
|
|
2085
|
+
isMobilePhone,
|
|
1507
2086
|
BARE_INTERNATIONAL_PROVIDERS,
|
|
1508
2087
|
storedPhone,
|
|
2088
|
+
displayName,
|
|
2089
|
+
takeFallbacks,
|
|
2090
|
+
noFallbacks,
|
|
2091
|
+
nameKey,
|
|
2092
|
+
isReadable,
|
|
1509
2093
|
COUNTER_FIELDS,
|
|
1510
2094
|
validCounter,
|
|
1511
2095
|
counterValue,
|
|
1512
2096
|
counterObservationTime,
|
|
1513
2097
|
observedCounters,
|
|
1514
2098
|
counterFreshness,
|
|
1515
|
-
isEmailAddress,
|
|
1516
|
-
ROLE_ADDRESS_WORDS,
|
|
1517
|
-
isRoleAddress,
|
|
1518
|
-
isNoReplyAddress,
|
|
1519
|
-
displayName,
|
|
1520
|
-
nameKey,
|
|
1521
|
-
isReadable,
|
|
1522
2099
|
MESSAGE_MEASURES,
|
|
1523
2100
|
AUTHOR_MEASURES,
|
|
1524
2101
|
needsRankingContext,
|
|
@@ -1535,8 +2112,5 @@ export {
|
|
|
1535
2112
|
envelopeOfJsonl,
|
|
1536
2113
|
envelopeOfText,
|
|
1537
2114
|
fieldReferences,
|
|
1538
|
-
|
|
1539
|
-
isCrmUserId,
|
|
1540
|
-
normalCrmUserId,
|
|
1541
|
-
isItemKind
|
|
2115
|
+
ROLE_LABELS
|
|
1542
2116
|
};
|