@wirecat/tg-cli 0.118.0 → 0.120.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 +7623 -0
- package/dist/bin/tg.js +2 -2
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +15 -8
- package/dist/bot/transport.js.map +1 -1
- package/dist/bundle/{adapter-4YNP6VCO.js → adapter-OJKHXGBC.js} +49 -50
- package/dist/bundle/{all-profiles-MIQDYAGO.js → all-profiles-URIWNL23.js} +10 -10
- package/dist/bundle/{anthropic-NTASPJYE.js → anthropic-YUKNB63B.js} +10 -8
- package/dist/bundle/{app-server-UJZBJ2SK.js → app-server-H5QNHGH4.js} +43 -43
- package/dist/bundle/{bot-api-JZAD4L3N.js → bot-api-27GN4Y3D.js} +49 -49
- package/dist/bundle/{bot-history-OUDHH3NU.js → bot-history-VVSWLVZM.js} +18 -18
- package/dist/bundle/{bun-EC4HDIRD.js → bun-PAAJX3GU.js} +2 -2
- package/dist/bundle/{bun-sqlite-A4HJR6KO.js → bun-sqlite-TPEBWFZH.js} +5 -5
- package/dist/bundle/{chunk-KEDHX6XG.js → chunk-34DSPJNN.js} +2 -2
- package/dist/bundle/{chunk-JZETEZHC.js → chunk-3FPFRDG2.js} +10 -8
- package/dist/bundle/{chunk-2KQHUBTV.js → chunk-3GLLWDM6.js} +12 -12
- package/dist/bundle/{chunk-NMT2VGEI.js → chunk-3SANNNWS.js} +3 -3
- package/dist/bundle/{chunk-65XV5PPI.js → chunk-4JATS2J5.js} +3 -3
- package/dist/bundle/{chunk-OTQDJUES.js → chunk-4OWY7QBE.js} +6 -6
- package/dist/bundle/{chunk-QOGYHU3Q.js → chunk-4W4EVVL4.js} +61 -21
- package/dist/bundle/{chunk-BNEP5EOV.js → chunk-6XHZV7AQ.js} +4 -4
- package/dist/bundle/{chunk-3MQOLYAN.js → chunk-7DPWVKYS.js} +4 -4
- package/dist/bundle/{chunk-NUCDEOFC.js → chunk-7I6YVQHW.js} +2 -2
- package/dist/bundle/{chunk-HJNRIK5X.js → chunk-7N4IUEX3.js} +9 -8
- package/dist/bundle/{chunk-RG2E7ZQZ.js → chunk-7VNV426X.js} +85 -17
- package/dist/bundle/{chunk-DSZJREEO.js → chunk-7WS3ULOO.js} +2205 -911
- package/dist/bundle/{chunk-TMTEWOQS.js → chunk-B7B65ZLU.js} +5 -3
- package/dist/bundle/{chunk-EPXVRJAX.js → chunk-CGUDXNJE.js} +2 -2
- package/dist/bundle/{chunk-EQJ6NLF5.js → chunk-CLTMVPGT.js} +13 -13
- package/dist/bundle/{chunk-6ZMTEUVU.js → chunk-CLURRDNU.js} +6 -6
- package/dist/bundle/{chunk-ZXXTJF4Z.js → chunk-CYWV2RLN.js} +4 -4
- package/dist/bundle/{chunk-5IIU7X4S.js → chunk-D2WNQJUQ.js} +1 -1
- package/dist/bundle/{chunk-PB252TT3.js → chunk-DDKFAUQD.js} +2 -2
- package/dist/bundle/{chunk-5LDWBEWU.js → chunk-DE7QIEUP.js} +53 -35
- package/dist/bundle/{chunk-JPVFYMSQ.js → chunk-DH7VKHTZ.js} +4 -4
- package/dist/bundle/{chunk-GXCJ47SJ.js → chunk-DQTQO6PB.js} +3265 -1034
- package/dist/bundle/{chunk-JWIUK3SK.js → chunk-FATTEYZH.js} +2 -2
- package/dist/bundle/{chunk-I4TI5HDJ.js → chunk-FPWXG53C.js} +11 -11
- package/dist/bundle/{chunk-PO74BDER.js → chunk-H5XC2WYO.js} +35 -589
- package/dist/bundle/{chunk-ZMUC3UQO.js → chunk-HDSKBXAF.js} +3 -3
- package/dist/bundle/{chunk-PWCQC56A.js → chunk-HIBYYKGO.js} +1 -1
- package/dist/bundle/{chunk-GLRRCKP6.js → chunk-JJY3TQTM.js} +23 -5
- package/dist/bundle/{chunk-YPRUWRKE.js → chunk-JQLGS3SG.js} +1 -1
- package/dist/bundle/{chunk-MBH7IKLT.js → chunk-JSEIT2WO.js} +1 -1
- package/dist/bundle/{chunk-57LKX6N2.js → chunk-KLHOQ6XQ.js} +1 -1
- package/dist/bundle/{chunk-4BV4UMBB.js → chunk-KP26Y5OA.js} +1628 -367
- package/dist/bundle/{chunk-MZNOASAW.js → chunk-KRCMKFUV.js} +16 -3
- package/dist/bundle/{chunk-6AXUEJGL.js → chunk-KTV5Y5EX.js} +2 -2
- package/dist/bundle/{chunk-YEOSV6JC.js → chunk-KW6JZGG3.js} +1 -1
- package/dist/bundle/{chunk-H6S3C3MH.js → chunk-LLCGOZ44.js} +4 -4
- package/dist/bundle/{chunk-CEY43D3A.js → chunk-LS72R7DN.js} +34 -34
- package/dist/bundle/chunk-LVGX7VTD.js +138 -0
- package/dist/bundle/{chunk-VW6BF6M7.js → chunk-MCPOZNWG.js} +1 -1
- package/dist/bundle/{chunk-G3RT2EQI.js → chunk-MMPISXSU.js} +2 -2
- package/dist/bundle/{chunk-6RI4TEIC.js → chunk-MTD6WZKV.js} +2 -2
- package/dist/bundle/{chunk-JLJKGKU2.js → chunk-PDYTNTQI.js} +6 -6
- package/dist/bundle/{chunk-P3ASN72F.js → chunk-RX5CJ55S.js} +1 -1
- package/dist/bundle/{chunk-76EKXFX2.js → chunk-S6OC367D.js} +24 -2
- package/dist/bundle/{chunk-PW3HFIJA.js → chunk-THJHYMFR.js} +1489 -1548
- package/dist/bundle/{chunk-5QYU7B27.js → chunk-U2TPRUWK.js} +689 -482
- package/dist/bundle/{chunk-YHZFGUAP.js → chunk-U6HEZPCR.js} +19 -19
- package/dist/bundle/{chunk-BXTDAGM4.js → chunk-VUBZFMGP.js} +2 -2
- package/dist/bundle/{chunk-2NA5KVP6.js → chunk-VUUR2SRS.js} +264 -45
- package/dist/bundle/{chunk-EPCFXKTX.js → chunk-WGGSFGNZ.js} +34 -8
- package/dist/bundle/{chunk-Y64SI2RO.js → chunk-WLBPNLDF.js} +3 -3
- package/dist/bundle/{chunk-GI4MTNA2.js → chunk-WQ55F4Y3.js} +8 -8
- package/dist/bundle/{chunk-FHMK6OK4.js → chunk-YBOVL25O.js} +96 -30
- package/dist/bundle/{chunk-DKFC5ZZ3.js → chunk-YDROJG2Y.js} +86 -29
- package/dist/bundle/{chunk-NKFTZVQU.js → chunk-YQKEPT22.js} +1 -1
- package/dist/bundle/{chunk-GIM37COQ.js → chunk-ZON7K5QE.js} +3 -3
- package/dist/bundle/{chunk-JWPSVS6C.js → chunk-ZRRZTPSB.js} +19059 -17055
- package/dist/bundle/command-contract-KW6FNOJO.js +33 -0
- package/dist/bundle/{decode-NMNPLKNR.js → decode-RVWSCZW4.js} +5 -5
- package/dist/bundle/{dispatch-OP27MWX5.js → dispatch-U2DW6UI7.js} +10 -10
- package/dist/bundle/{echarts-S46LEIPS.js → echarts-6VNUD3JF.js} +2 -2
- package/dist/bundle/{embed-I5ZYHGYC.js → embed-LWLCQKIK.js} +6 -6
- package/dist/bundle/{embedder-LTJI67N2.js → embedder-CXKHLRJT.js} +9 -9
- package/dist/bundle/{entry-O6BUPXF7.js → entry-HV4NSX3Z.js} +7 -7
- package/dist/bundle/{failure-4JUQFXJT.js → failure-HJD7S5UA.js} +2 -2
- package/dist/bundle/{first-run-PMZNCDGD.js → first-run-OPI6NIWQ.js} +11 -11
- package/dist/bundle/first-screen-BVQLF4LN.js +31 -0
- package/dist/bundle/{instructions-AUEGY3VO.js → instructions-TK4HXL3A.js} +1 -1
- package/dist/bundle/{mcp-M4QN2E7R.js → mcp-7KQUJNFN.js} +2 -2
- package/dist/bundle/{node-XRA7RBCQ.js → node-WFPNBUCU.js} +2 -2
- package/dist/bundle/{node-sqlite-DEZO6LRS.js → node-sqlite-L5BRGJLK.js} +6 -6
- package/dist/bundle/{oauth-DAVC7WCD.js → oauth-CGVWL35B.js} +7 -7
- package/dist/bundle/{open-DE2YO4T7.js → open-HLL55C5S.js} +5 -5
- package/dist/bundle/{openai-5BKGAULH.js → openai-YFCNXIJ4.js} +16 -37
- package/dist/bundle/{process-4ZHPNUIQ.js → process-4A5JP5LO.js} +1 -1
- package/dist/bundle/{program-EGTKSNB4.js → program-IFGQGSUF.js} +56 -53
- package/dist/bundle/{prompt-HWCWHHPE.js → prompt-B5FYE2DQ.js} +7 -5
- package/dist/bundle/{proxy-transport-4DPZB2W2.js → proxy-transport-ENU2SJYT.js} +5 -5
- package/dist/bundle/{recognize-NG6RXNGF.js → recognize-ZHMHGIV3.js} +4 -4
- package/dist/bundle/{remote-ZKXIIGYH.js → remote-A3W5HE52.js} +7 -7
- package/dist/bundle/{rerank-TX5QFURV.js → rerank-HWJAQOZM.js} +7 -7
- package/dist/bundle/{serve-XAS6DECW.js → serve-PP326Q2F.js} +9 -9
- package/dist/bundle/{server-CNPIWBYU.js → server-MV6CL63L.js} +35 -35
- package/dist/bundle/server-TZGGOJ26.js +60 -0
- package/dist/bundle/{state-3HTUETTS.js → state-Y3RJ7ZXB.js} +6 -6
- package/dist/bundle/{store-B5VZWJHN.js → store-EVNI2MHZ.js} +36 -13
- package/dist/bundle/store-maintenance-command-XPQE47RE.js +49 -0
- package/dist/bundle/tg.js +38 -14
- package/dist/commands/account-removal.d.ts +3 -0
- package/dist/commands/account-removal.d.ts.map +1 -0
- package/dist/commands/account-removal.js +57 -0
- package/dist/commands/account-removal.js.map +1 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +2 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/http.d.ts +6 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +8 -0
- package/dist/http.js.map +1 -0
- package/dist/identity.d.ts +4 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +14 -0
- package/dist/identity.js.map +1 -1
- package/dist/telegram/map.d.ts.map +1 -1
- package/dist/telegram/map.js +3 -0
- package/dist/telegram/map.js.map +1 -1
- package/dist/telegram/registration.d.ts +1 -1
- package/dist/telegram/registration.d.ts.map +1 -1
- package/dist/telegram/registration.js +4 -1
- package/dist/telegram/registration.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 +7 -6
- package/dist/bundle/chunk-TSTEZNSX.js +0 -33
- package/dist/bundle/command-contract-7GZ6HAA6.js +0 -33
- package/dist/bundle/first-screen-BGML5DSO.js +0 -31
- package/dist/bundle/server-FRTKLHZF.js +0 -60
- package/dist/bundle/store-maintenance-command-VG3CLELA.js +0 -50
- /package/dist/bundle/{chunk-VOXIGICJ.js → chunk-YVNHQFLC.js} +0 -0
|
@@ -3,10 +3,16 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
isCliFailure,
|
|
5
5
|
isStoreDamage
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WLBPNLDF.js";
|
|
7
7
|
import {
|
|
8
8
|
refuseOwnerStoreInTests
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MMPISXSU.js";
|
|
10
|
+
import {
|
|
11
|
+
createRecordLog,
|
|
12
|
+
resolvePaths,
|
|
13
|
+
traceIdOf,
|
|
14
|
+
writeSecurely
|
|
15
|
+
} from "./chunk-U6HEZPCR.js";
|
|
10
16
|
import {
|
|
11
17
|
RegistryError,
|
|
12
18
|
SNAKE_CASE,
|
|
@@ -40,21 +46,173 @@ import {
|
|
|
40
46
|
union,
|
|
41
47
|
unknown,
|
|
42
48
|
variant
|
|
43
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WGGSFGNZ.js";
|
|
44
50
|
import {
|
|
45
51
|
CliError,
|
|
46
52
|
isCliError,
|
|
47
53
|
singleLine,
|
|
48
54
|
visibleControls
|
|
49
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-VUBZFMGP.js";
|
|
50
56
|
import {
|
|
51
57
|
__name
|
|
52
58
|
} from "./chunk-ZVVMGPBJ.js";
|
|
53
59
|
|
|
54
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
61
|
+
var CURRENCY_SCALES = {
|
|
62
|
+
AED: 2,
|
|
63
|
+
AMD: 2,
|
|
64
|
+
AUD: 2,
|
|
65
|
+
BHD: 3,
|
|
66
|
+
BYN: 2,
|
|
67
|
+
CAD: 2,
|
|
68
|
+
CHF: 2,
|
|
69
|
+
CLP: 0,
|
|
70
|
+
CNY: 2,
|
|
71
|
+
CZK: 2,
|
|
72
|
+
DKK: 2,
|
|
73
|
+
EUR: 2,
|
|
74
|
+
GBP: 2,
|
|
75
|
+
GEL: 2,
|
|
76
|
+
HUF: 2,
|
|
77
|
+
ILS: 2,
|
|
78
|
+
INR: 2,
|
|
79
|
+
ISK: 0,
|
|
80
|
+
JPY: 0,
|
|
81
|
+
KGS: 2,
|
|
82
|
+
KRW: 0,
|
|
83
|
+
KWD: 3,
|
|
84
|
+
KZT: 2,
|
|
85
|
+
NOK: 2,
|
|
86
|
+
PLN: 2,
|
|
87
|
+
RSD: 2,
|
|
88
|
+
RUB: 2,
|
|
89
|
+
SEK: 2,
|
|
90
|
+
THB: 2,
|
|
91
|
+
TRY: 2,
|
|
92
|
+
UAH: 2,
|
|
93
|
+
USD: 2,
|
|
94
|
+
UZS: 2,
|
|
95
|
+
VND: 0
|
|
96
|
+
};
|
|
97
|
+
var refuse = /* @__PURE__ */ __name((message, reason) => {
|
|
98
|
+
throw new CliError("validation_error", message, { reason });
|
|
99
|
+
}, "refuse");
|
|
100
|
+
var DECIMAL = /^(\d{1,15})(?:\.(\d+))?$/;
|
|
101
|
+
var parseDecimal = /* @__PURE__ */ __name((text6, scale) => {
|
|
102
|
+
const match = DECIMAL.exec(text6.trim());
|
|
103
|
+
if (!match || (match[2] ?? "").length > scale)
|
|
104
|
+
return void 0;
|
|
105
|
+
return BigInt(`${match[1]}${(match[2] ?? "").padEnd(scale, "0")}`);
|
|
106
|
+
}, "parseDecimal");
|
|
107
|
+
var formatDecimal = /* @__PURE__ */ __name((units, scale) => {
|
|
108
|
+
const value = BigInt(units);
|
|
109
|
+
if (value < 0n)
|
|
110
|
+
return `-${formatDecimal(-value, scale)}`;
|
|
111
|
+
const digits = value.toString().padStart(scale + 1, "0");
|
|
112
|
+
return scale === 0 ? digits : `${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
|
|
113
|
+
}, "formatDecimal");
|
|
114
|
+
var groupDigits = /* @__PURE__ */ __name((decimal) => {
|
|
115
|
+
const [whole = "0", fraction] = decimal.split(".");
|
|
116
|
+
const grouped2 = whole.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
117
|
+
return fraction === void 0 ? grouped2 : `${grouped2}.${fraction}`;
|
|
118
|
+
}, "groupDigits");
|
|
119
|
+
var currencyOf = /* @__PURE__ */ __name((text6) => {
|
|
120
|
+
const code = typeof text6 === "string" ? text6.trim().toUpperCase() : "";
|
|
121
|
+
if (CURRENCY_SCALES[code] === void 0)
|
|
122
|
+
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");
|
|
123
|
+
return code;
|
|
124
|
+
}, "currencyOf");
|
|
125
|
+
var scaleOf = /* @__PURE__ */ __name((currency) => CURRENCY_SCALES[currencyOf(currency)], "scaleOf");
|
|
126
|
+
var minorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
127
|
+
const scale = scaleOf(currency);
|
|
128
|
+
const units = typeof amount === "string" ? parseDecimal(amount, scale) : void 0;
|
|
129
|
+
if (units === void 0 || units > BigInt(Number.MAX_SAFE_INTEGER))
|
|
130
|
+
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");
|
|
131
|
+
return Number(units);
|
|
132
|
+
}, "minorUnits");
|
|
133
|
+
var signedMinorUnits = /* @__PURE__ */ __name((amount, currency, what = "an amount") => {
|
|
134
|
+
if (typeof amount !== "string" || !amount.trim().startsWith("-"))
|
|
135
|
+
return minorUnits(amount, currency, what);
|
|
136
|
+
const units = minorUnits(amount.trim().slice(1), currency, what);
|
|
137
|
+
return units === 0 ? 0 : -units;
|
|
138
|
+
}, "signedMinorUnits");
|
|
139
|
+
var moneyOf = /* @__PURE__ */ __name((units, currency) => ({
|
|
140
|
+
amount: formatDecimal(units, scaleOf(currency)),
|
|
141
|
+
currency
|
|
142
|
+
}), "moneyOf");
|
|
143
|
+
var moneyLabel = /* @__PURE__ */ __name((units, currency) => `${groupDigits(formatDecimal(units, scaleOf(currency)))} ${currency}`, "moneyLabel");
|
|
144
|
+
var QUANTITY_SCALE = 3;
|
|
145
|
+
var quantityOf = /* @__PURE__ */ __name((text6) => {
|
|
146
|
+
const thousandths = typeof text6 === "string" ? parseDecimal(text6, QUANTITY_SCALE) : void 0;
|
|
147
|
+
if (thousandths === void 0 || thousandths === 0n)
|
|
148
|
+
return refuse('a quantity is a decimal string above 0 with at most 3 decimals, such as "1.5"', "money.quantity");
|
|
149
|
+
const plain = formatDecimal(thousandths, QUANTITY_SCALE).replace(/\.?0+$/, "");
|
|
150
|
+
return { text: plain, thousandths };
|
|
151
|
+
}, "quantityOf");
|
|
152
|
+
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
153
|
+
|
|
154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
155
|
+
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
156
|
+
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
157
|
+
var MONEY_DIRECTIONS = ["in", "out"];
|
|
158
|
+
var FINANCE_REVIEWS = ["proposed", "confirmed", "rejected"];
|
|
159
|
+
var settledStatus = /* @__PURE__ */ __name((current, total, paid) => {
|
|
160
|
+
if (current === "draft" || current === "void")
|
|
161
|
+
return current;
|
|
162
|
+
if (paid <= 0)
|
|
163
|
+
return "issued";
|
|
164
|
+
return paid < total ? "partly_paid" : "paid";
|
|
165
|
+
}, "settledStatus");
|
|
166
|
+
var dayMonth = /* @__PURE__ */ __name((date) => date === null ? null : `${date.slice(8, 10)}.${date.slice(5, 7)}`, "dayMonth");
|
|
167
|
+
var notes = /* @__PURE__ */ __name((...words2) => {
|
|
168
|
+
const kept = words2.filter((word) => word !== null);
|
|
169
|
+
return kept.length === 0 ? "" : ` (${kept.join(", ")})`;
|
|
170
|
+
}, "notes");
|
|
171
|
+
var invoiceLine = /* @__PURE__ */ __name((invoice) => {
|
|
172
|
+
const party = invoice.counterpartyName === null ? "" : `${invoice.direction === "receivable" ? " to" : " from"} ${invoice.counterpartyName}`;
|
|
173
|
+
const due = invoice.dueDate === null ? "" : `, due ${dayMonth(invoice.dueDate)}`;
|
|
174
|
+
return `${invoice.number ?? `#${invoice.id}`} \xB7 ${moneyLabel(invoice.total, invoice.currency)}${party}${due}` + notes(invoice.status.replace("_", " "), invoice.review === "confirmed" ? null : invoice.review);
|
|
175
|
+
}, "invoiceLine");
|
|
176
|
+
var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
177
|
+
const party = payment.partyName === null ? "" : `${payment.direction === "in" ? " from" : " to"} ${payment.partyName}`;
|
|
178
|
+
return `${moneyLabel(payment.amount, payment.currency)}${party}, ${dayMonth(payment.date)}` + notes(payment.review === "confirmed" ? null : payment.review);
|
|
179
|
+
}, "paymentLine");
|
|
180
|
+
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
181
|
+
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
182
|
+
|
|
183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/business.js
|
|
184
|
+
var CATALOG_KINDS = ["product", "service"];
|
|
185
|
+
var BUSINESS_KINDS = ["invoice", "payment", "order", "contract", "subscription", "product", "wallet"];
|
|
186
|
+
var CONTRACT_KINDS = ["sale", "purchase", "service", "lease", "employment", "nda", "license", "other"];
|
|
187
|
+
var CONTRACT_STATUSES = ["draft", "active", "ended", "terminated"];
|
|
188
|
+
var SUBSCRIPTION_STATUSES = ["trial", "active", "paused", "cancelled", "ended"];
|
|
189
|
+
var WALLET_KINDS = ["bank", "card", "cash", "wallet", "other"];
|
|
190
|
+
var TRANSACTION_STATUSES = ["pending", "booked"];
|
|
191
|
+
var ORDER_DIRECTIONS = ["purchase", "sale"];
|
|
192
|
+
var intervalOf = /* @__PURE__ */ __name((text6, reason = "subscription.interval") => {
|
|
193
|
+
const match = typeof text6 === "string" ? /^(?:([1-9]\d{0,2})-)?(day|week|month|year)$/.exec(text6.trim()) : null;
|
|
194
|
+
if (!match)
|
|
195
|
+
throw new CliError("validation_error", "an interval is a count and a unit, such as 1-month or 2-week", { reason });
|
|
196
|
+
return { count: match[1] === void 0 ? 1 : Number(match[1]), unit: match[2] };
|
|
197
|
+
}, "intervalOf");
|
|
198
|
+
var intervalText = /* @__PURE__ */ __name(({ count: count7, unit }) => `${count7}-${unit}`, "intervalText");
|
|
199
|
+
var priced = /* @__PURE__ */ __name((units, currency) => units === null || currency === null ? "" : `, ${moneyLabel(units, currency)}`, "priced");
|
|
200
|
+
var pending = /* @__PURE__ */ __name((review) => review === "confirmed" ? null : review, "pending");
|
|
201
|
+
var productLine = /* @__PURE__ */ __name((product) => {
|
|
202
|
+
const price = product.unitPrice === null || product.currency === null ? "" : moneyLabel(product.unitPrice, product.currency);
|
|
203
|
+
const per = price && product.unit !== null ? ` per ${product.unit}` : "";
|
|
204
|
+
return `${product.name}${price ? ` \xB7 ${price}${per}` : ""}${notes(product.kind, product.archived ? "archived" : null)}`;
|
|
205
|
+
}, "productLine");
|
|
206
|
+
var contractLine = /* @__PURE__ */ __name((contract) => `${contract.number ?? `#${contract.id}`} \xB7 ${contract.name}${priced(contract.value, contract.currency)}` + notes(contract.status, pending(contract.review)), "contractLine");
|
|
207
|
+
var subscriptionLine = /* @__PURE__ */ __name((subscription) => `${subscription.name}${priced(subscription.price, subscription.currency)} every ${intervalText(subscription.interval)}` + notes(subscription.status, pending(subscription.review)), "subscriptionLine");
|
|
208
|
+
var walletLine = /* @__PURE__ */ __name((wallet) => `${wallet.name} \xB7 ${wallet.kind}, ${wallet.currency}${wallet.numberHint === null ? "" : `, \u2026${wallet.numberHint}`}` + notes(wallet.closed ? "closed" : null), "walletLine");
|
|
209
|
+
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");
|
|
210
|
+
|
|
211
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/store/marks.js
|
|
55
212
|
import { readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
56
213
|
var damageMarkPath = /* @__PURE__ */ __name((store) => `${store}.damaged.json`, "damageMarkPath");
|
|
57
214
|
var healthMarkPath = /* @__PURE__ */ __name((store) => `${store}.health.json`, "healthMarkPath");
|
|
215
|
+
var journalMarkPath = /* @__PURE__ */ __name((store) => `${store}.journal.json`, "journalMarkPath");
|
|
58
216
|
var inodeOf = /* @__PURE__ */ __name((store) => statSync(store, { throwIfNoEntry: false })?.ino, "inodeOf");
|
|
59
217
|
var readJson = /* @__PURE__ */ __name((path) => {
|
|
60
218
|
try {
|
|
@@ -120,6 +278,23 @@ var refuseDamagedStore = /* @__PURE__ */ __name((store, cli) => {
|
|
|
120
278
|
return;
|
|
121
279
|
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" });
|
|
122
280
|
}, "refuseDamagedStore");
|
|
281
|
+
var markJournalLost = /* @__PURE__ */ __name((store, { seen, command, now = Date.now }) => {
|
|
282
|
+
if (ownerStoreInTests(store))
|
|
283
|
+
return;
|
|
284
|
+
const mark = { at: new Date(now()).toISOString(), command, seen };
|
|
285
|
+
try {
|
|
286
|
+
writeFileSync(journalMarkPath(store), `${JSON.stringify(mark, null, 2)}
|
|
287
|
+
`, { flag: "wx", mode: 384 });
|
|
288
|
+
} catch {
|
|
289
|
+
}
|
|
290
|
+
}, "markJournalLost");
|
|
291
|
+
var readJournalMark = /* @__PURE__ */ __name((store) => {
|
|
292
|
+
try {
|
|
293
|
+
return readJson(journalMarkPath(store));
|
|
294
|
+
} catch {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
}, "readJournalMark");
|
|
123
298
|
var readHealthMark = /* @__PURE__ */ __name((store) => {
|
|
124
299
|
try {
|
|
125
300
|
return readJson(healthMarkPath(store));
|
|
@@ -149,10 +324,12 @@ var recordDeepCheck = /* @__PURE__ */ __name((store, health, { cli, version, sch
|
|
|
149
324
|
}
|
|
150
325
|
if (cleared)
|
|
151
326
|
clearDamageMark(store);
|
|
327
|
+
if (health.ok)
|
|
328
|
+
rmSync(journalMarkPath(store), { force: true });
|
|
152
329
|
return { previous, cleared };
|
|
153
330
|
}, "recordDeepCheck");
|
|
154
331
|
|
|
155
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
332
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
156
333
|
var QUERY_LIMITS = {
|
|
157
334
|
bytes: 8192,
|
|
158
335
|
depth: 32,
|
|
@@ -196,7 +373,7 @@ function queryError(reason, span, alternative, context3 = {}, details = {}) {
|
|
|
196
373
|
__name(queryError, "queryError");
|
|
197
374
|
var walkQuery = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => walkQuery(node2)), "walkQuery");
|
|
198
375
|
|
|
199
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
376
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
200
377
|
var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
201
378
|
const zone = given ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? "UTC";
|
|
202
379
|
try {
|
|
@@ -209,11 +386,11 @@ var timezoneOf = /* @__PURE__ */ __name((given) => {
|
|
|
209
386
|
var calendar = /* @__PURE__ */ __name((value, span) => {
|
|
210
387
|
if (!/^\d{4}-\d{2}-\d{2}$/u.test(value))
|
|
211
388
|
queryError("query.invalid-date", span, "use an ISO date or a quoted timestamp with offset");
|
|
212
|
-
const year = Number(value.slice(0, 4)), month = Number(value.slice(5, 7)),
|
|
389
|
+
const year = Number(value.slice(0, 4)), month = Number(value.slice(5, 7)), day2 = Number(value.slice(8, 10));
|
|
213
390
|
const date = /* @__PURE__ */ new Date(0);
|
|
214
|
-
date.setUTCFullYear(year, month - 1,
|
|
391
|
+
date.setUTCFullYear(year, month - 1, day2);
|
|
215
392
|
date.setUTCHours(0, 0, 0, 0);
|
|
216
|
-
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !==
|
|
393
|
+
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month - 1 || date.getUTCDate() !== day2)
|
|
217
394
|
queryError("query.invalid-date", span);
|
|
218
395
|
return date;
|
|
219
396
|
}, "calendar");
|
|
@@ -230,9 +407,9 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
|
|
|
230
407
|
era: "short"
|
|
231
408
|
});
|
|
232
409
|
const dayAt = /* @__PURE__ */ __name((time2) => {
|
|
233
|
-
const
|
|
234
|
-
const value2 = /* @__PURE__ */ __name((name) => Number(
|
|
235
|
-
const year =
|
|
410
|
+
const parts2 = formatter.formatToParts(time2);
|
|
411
|
+
const value2 = /* @__PURE__ */ __name((name) => Number(parts2.find((p) => p.type === name)?.value), "value");
|
|
412
|
+
const year = parts2.find((p) => p.type === "era")?.value === "BC" ? 1 - value2("year") : value2("year");
|
|
236
413
|
return year * 1e4 + value2("month") * 100 + value2("day");
|
|
237
414
|
}, "dayAt");
|
|
238
415
|
let lo = date.getTime() - 2 * 864e5, hi = date.getTime() + 2 * 864e5;
|
|
@@ -249,12 +426,12 @@ var dayBoundary = /* @__PURE__ */ __name((value, zone, next, span) => {
|
|
|
249
426
|
}, "dayBoundary");
|
|
250
427
|
var WALL = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/u;
|
|
251
428
|
var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
|
|
252
|
-
const [, year, month,
|
|
429
|
+
const [, year, month, day2, hour, minute, second = "0", fraction = "0"] = WALL.exec(value) ?? [];
|
|
253
430
|
if (year === void 0)
|
|
254
431
|
queryError("query.invalid-date", span, "use YYYY-MM-DDTHH:mm, with optional seconds");
|
|
255
|
-
const wanted = Date.UTC(Number(year), Number(month) - 1, Number(
|
|
432
|
+
const wanted = Date.UTC(Number(year), Number(month) - 1, Number(day2), Number(hour), Number(minute), Number(second), Number(fraction.padEnd(3, "0")));
|
|
256
433
|
const check = new Date(wanted);
|
|
257
|
-
if (check.getUTCDate() !== Number(
|
|
434
|
+
if (check.getUTCDate() !== Number(day2) || check.getUTCHours() !== Number(hour) || check.getUTCMinutes() !== Number(minute) || check.getUTCSeconds() !== Number(second))
|
|
258
435
|
queryError("query.invalid-date", span);
|
|
259
436
|
const formatter = new Intl.DateTimeFormat("en-CA", {
|
|
260
437
|
timeZone: zone,
|
|
@@ -267,8 +444,8 @@ var wallTime = /* @__PURE__ */ __name((value, zone, span) => {
|
|
|
267
444
|
hourCycle: "h23"
|
|
268
445
|
});
|
|
269
446
|
const shown = /* @__PURE__ */ __name((instant) => {
|
|
270
|
-
const
|
|
271
|
-
return Date.UTC(
|
|
447
|
+
const parts2 = Object.fromEntries(formatter.formatToParts(instant).map((part) => [part.type, Number(part.value)]));
|
|
448
|
+
return Date.UTC(parts2.year ?? 0, (parts2.month ?? 1) - 1, parts2.day, parts2.hour, parts2.minute, parts2.second) + (instant % 1e3 + 1e3) % 1e3;
|
|
272
449
|
}, "shown");
|
|
273
450
|
const found = /* @__PURE__ */ new Set();
|
|
274
451
|
for (const probe of [wanted - 864e5, wanted, wanted + 864e5]) {
|
|
@@ -341,7 +518,7 @@ var dateRange = /* @__PURE__ */ __name((lower, upper, lowerInclusive, upperInclu
|
|
|
341
518
|
};
|
|
342
519
|
}, "dateRange");
|
|
343
520
|
|
|
344
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
521
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
345
522
|
var FIELD_TYPES = ["kw", "txt", "enum", "num", "time", "bool", "ref"];
|
|
346
523
|
var OPERATORS_BY_TYPE = {
|
|
347
524
|
kw: ["term", "phrase", "wildcard"],
|
|
@@ -420,8 +597,8 @@ var queryFieldsOf = /* @__PURE__ */ __name((schema, annotations = {}) => {
|
|
|
420
597
|
return [...own, ...relations, ...states];
|
|
421
598
|
}, "queryFieldsOf");
|
|
422
599
|
|
|
423
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
424
|
-
var shownOf = /* @__PURE__ */ __name((
|
|
600
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
601
|
+
var shownOf = /* @__PURE__ */ __name((registry3) => registry3.backend === "native" ? registry3.fields.filter((field) => field.native) : registry3.fields, "shownOf");
|
|
425
602
|
var leftOut = /* @__PURE__ */ __name((fields) => fields.filter((field) => field.negatable).map((field) => field.name), "leftOut");
|
|
426
603
|
var has = /* @__PURE__ */ __name((fields, operator) => fields.some((field) => field.operators.includes(operator)), "has");
|
|
427
604
|
var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
@@ -432,32 +609,32 @@ var syntaxOf = /* @__PURE__ */ __name((shown, backend) => [
|
|
|
432
609
|
...has(shown, "range") ? ["[a TO b] \xB7 > >= < <="] : []
|
|
433
610
|
].join(" \xB7 "), "syntaxOf");
|
|
434
611
|
var kindOf = /* @__PURE__ */ __name((field) => field.values ? `${field.type}: ${field.values.join("|")}` : `${field.type}: ${field.operators.join(", ")}`, "kindOf");
|
|
435
|
-
var fieldsHelp = /* @__PURE__ */ __name((
|
|
436
|
-
const shown = shownOf(
|
|
612
|
+
var fieldsHelp = /* @__PURE__ */ __name((registry3, guide) => {
|
|
613
|
+
const shown = shownOf(registry3);
|
|
437
614
|
const negatable = leftOut(shown);
|
|
438
615
|
const rows = shown.map((field) => [field.name, kindOf(field), field.example]);
|
|
439
616
|
const widths = [0, 1].map((at) => Math.max(...rows.map((row) => (row[at] ?? "").length)));
|
|
440
617
|
return [
|
|
441
618
|
"Fields:",
|
|
442
|
-
...rows.map(([name = "",
|
|
443
|
-
...
|
|
619
|
+
...rows.map(([name = "", kind2 = "", example = ""]) => ` ${name.padEnd(widths[0] ?? 0)} ${kind2.padEnd(widths[1] ?? 0)} ${example}`.trimEnd()),
|
|
620
|
+
...registry3.defaults && registry3.defaults.length > 0 ? [`Defaults: ${registry3.defaults.join(" ")} \u2014 name the field to change it`] : [],
|
|
444
621
|
...negatable.length > 0 ? [`Leave out: -${negatable[0]}:value or NOT ${negatable[0]}:value, for ${negatable.join(", ")}`] : [],
|
|
445
|
-
`Syntax: ${syntaxOf(shown,
|
|
622
|
+
`Syntax: ${syntaxOf(shown, registry3.backend)}`,
|
|
446
623
|
...guide ? [`Guide: ${guide}`] : []
|
|
447
624
|
].join("\n");
|
|
448
625
|
}, "fieldsHelp");
|
|
449
|
-
var queryDescription = /* @__PURE__ */ __name((
|
|
450
|
-
const shown = shownOf(
|
|
626
|
+
var queryDescription = /* @__PURE__ */ __name((registry3) => {
|
|
627
|
+
const shown = shownOf(registry3);
|
|
451
628
|
if (shown.length === 0)
|
|
452
629
|
return "field:value terms; this list filters by none yet, so any term is refused";
|
|
453
630
|
const negatable = leftOut(shown);
|
|
454
|
-
const terms =
|
|
631
|
+
const terms = registry3.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], > <" : ""})`;
|
|
455
632
|
const fields = shown.map((field) => field.values ? `${field.name} (${field.values.join("|")})` : field.name);
|
|
456
|
-
const defaults =
|
|
633
|
+
const defaults = registry3.defaults?.length ? `; unless named: ${registry3.defaults.join(" ")}` : "";
|
|
457
634
|
return `${terms}; fields: ${fields.join(", ")}; e.g. ${shown[0]?.example ?? ""}${defaults}`;
|
|
458
635
|
}, "queryDescription");
|
|
459
636
|
|
|
460
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
637
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
461
638
|
var inContext = /* @__PURE__ */ __name((context3, run2) => {
|
|
462
639
|
try {
|
|
463
640
|
run2();
|
|
@@ -470,24 +647,24 @@ var inContext = /* @__PURE__ */ __name((context3, run2) => {
|
|
|
470
647
|
}, "inContext");
|
|
471
648
|
var bounds = /* @__PURE__ */ __name((node) => node.operator === "range" ? [node.value, node.upper ?? "*"].filter((bound) => bound !== "*") : [node.value], "bounds");
|
|
472
649
|
var checkValue = /* @__PURE__ */ __name((field, node, options) => {
|
|
473
|
-
const
|
|
650
|
+
const fail3 = /* @__PURE__ */ __name((reason, alternative) => queryError(reason, node.span, alternative, options), "fail");
|
|
474
651
|
if (node.value === "" && field.type !== "txt")
|
|
475
|
-
|
|
652
|
+
fail3("query.missing-value");
|
|
476
653
|
if (node.operator === "wildcard")
|
|
477
654
|
return;
|
|
478
655
|
switch (field.type) {
|
|
479
656
|
case "enum":
|
|
480
657
|
if (!field.values?.includes(node.value.toLowerCase()))
|
|
481
|
-
|
|
658
|
+
fail3("query.unknown-value", `${field.name} takes ${field.values?.join(", ")}`);
|
|
482
659
|
return;
|
|
483
660
|
case "bool":
|
|
484
661
|
if (!["true", "false"].includes(node.value.toLowerCase()))
|
|
485
|
-
|
|
662
|
+
fail3("query.unknown-value", `${field.name} takes true, false`);
|
|
486
663
|
return;
|
|
487
664
|
case "num":
|
|
488
665
|
for (const bound of bounds(node))
|
|
489
666
|
if (!Number.isFinite(Number(bound)) || bound.trim() === "")
|
|
490
|
-
|
|
667
|
+
fail3("query.invalid-number", `${field.name} takes a number`);
|
|
491
668
|
return;
|
|
492
669
|
case "time":
|
|
493
670
|
inContext(options, () => {
|
|
@@ -499,8 +676,8 @@ var checkValue = /* @__PURE__ */ __name((field, node, options) => {
|
|
|
499
676
|
return;
|
|
500
677
|
}
|
|
501
678
|
}, "checkValue");
|
|
502
|
-
var validateQuery = /* @__PURE__ */ __name((ast,
|
|
503
|
-
const byName = new Map(
|
|
679
|
+
var validateQuery = /* @__PURE__ */ __name((ast, registry3, options = {}) => {
|
|
680
|
+
const byName = new Map(registry3.fields.map((field) => [field.name, field]));
|
|
504
681
|
const visit = /* @__PURE__ */ __name((node, required) => {
|
|
505
682
|
if (node.kind === "boolean") {
|
|
506
683
|
for (const clause of node.clauses)
|
|
@@ -510,11 +687,11 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
|
|
|
510
687
|
const field = byName.get(node.field);
|
|
511
688
|
if (!field)
|
|
512
689
|
queryError("query.unknown-field", node.span, `no field "${node.field}"`, options, {
|
|
513
|
-
fields:
|
|
690
|
+
fields: registry3.fields.map((one) => one.name)
|
|
514
691
|
});
|
|
515
|
-
if (
|
|
692
|
+
if (registry3.backend === "native" && !field.native)
|
|
516
693
|
queryError("query.unsupported-field", node.span, `the source cannot filter by ${field.name}`, options, {
|
|
517
|
-
supported:
|
|
694
|
+
supported: registry3.fields.filter((one) => one.native).map((one) => one.name)
|
|
518
695
|
});
|
|
519
696
|
const presence = node.operator === "wildcard" && node.value === "*";
|
|
520
697
|
if (!presence && !field.operators.includes(node.operator))
|
|
@@ -532,7 +709,7 @@ var validateQuery = /* @__PURE__ */ __name((ast, registry, options = {}) => {
|
|
|
532
709
|
}, "validateQuery");
|
|
533
710
|
var fieldsNamed = /* @__PURE__ */ __name((ast) => new Set(walkQuery(ast.root).map((node) => node.field)), "fieldsNamed");
|
|
534
711
|
|
|
535
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
712
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
536
713
|
var whitespace = /* @__PURE__ */ __name((c) => /[ \t\n\r\u3000]/u.test(c), "whitespace");
|
|
537
714
|
var reserved = /* @__PURE__ */ new Set([
|
|
538
715
|
"+",
|
|
@@ -555,7 +732,7 @@ var reserved = /* @__PURE__ */ new Set([
|
|
|
555
732
|
"\\",
|
|
556
733
|
"/"
|
|
557
734
|
]);
|
|
558
|
-
var decodeEscapes = /* @__PURE__ */ __name((raw, span,
|
|
735
|
+
var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail3) => {
|
|
559
736
|
let out = "";
|
|
560
737
|
for (let at = 0; at < raw.length; at++) {
|
|
561
738
|
if (raw[at] !== "\\") {
|
|
@@ -563,11 +740,11 @@ var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail) => {
|
|
|
563
740
|
continue;
|
|
564
741
|
}
|
|
565
742
|
if (++at >= raw.length)
|
|
566
|
-
|
|
743
|
+
fail3("query.invalid-escape", span);
|
|
567
744
|
if (raw[at] === "u") {
|
|
568
745
|
const hex = raw.slice(at + 1, at + 5);
|
|
569
746
|
if (!/^[0-9a-fA-F]{4}$/.test(hex))
|
|
570
|
-
|
|
747
|
+
fail3("query.invalid-escape", span);
|
|
571
748
|
out += String.fromCharCode(Number.parseInt(hex, 16));
|
|
572
749
|
at += 4;
|
|
573
750
|
} else
|
|
@@ -575,7 +752,7 @@ var decodeEscapes = /* @__PURE__ */ __name((raw, span, fail) => {
|
|
|
575
752
|
}
|
|
576
753
|
return out;
|
|
577
754
|
}, "decodeEscapes");
|
|
578
|
-
var tokensOf = /* @__PURE__ */ __name((text6,
|
|
755
|
+
var tokensOf = /* @__PURE__ */ __name((text6, fail3 = queryError) => {
|
|
579
756
|
const tokens = [];
|
|
580
757
|
let at = 0;
|
|
581
758
|
let range = false;
|
|
@@ -586,7 +763,7 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
|
586
763
|
at++;
|
|
587
764
|
continue;
|
|
588
765
|
}
|
|
589
|
-
let
|
|
766
|
+
let kind2 = c;
|
|
590
767
|
if (c === '"' || !range && c === "/") {
|
|
591
768
|
at++;
|
|
592
769
|
while (at < text6.length && text6[at] !== c) {
|
|
@@ -595,26 +772,26 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
|
595
772
|
at++;
|
|
596
773
|
}
|
|
597
774
|
if (at >= text6.length)
|
|
598
|
-
|
|
775
|
+
fail3("query.unclosed-literal", { start, end: at }, c === "/" ? regexHint(text6, start) : void 0);
|
|
599
776
|
at++;
|
|
600
777
|
if (c === "/" && /^[dgimsuvy]+(?:$|[ \t\n\r)])/.test(text6.slice(at)))
|
|
601
|
-
|
|
602
|
-
|
|
778
|
+
fail3("query.unsupported-regex-flags", { start: at, end: at + 1 }, "Lucene regex does not take JavaScript flags");
|
|
779
|
+
kind2 = c === '"' ? "quoted" : "regex";
|
|
603
780
|
} else if (range && c !== "]" && c !== "}") {
|
|
604
781
|
while (at < text6.length && !whitespace(text6[at] ?? "") && !["]", "}"].includes(text6[at] ?? ""))
|
|
605
782
|
at++;
|
|
606
|
-
|
|
783
|
+
kind2 = "rangeValue";
|
|
607
784
|
} else if (reserved.has(c)) {
|
|
608
785
|
if (c === "\\") {
|
|
609
786
|
at += 2;
|
|
610
787
|
while (at < text6.length && !whitespace(text6[at] ?? "") && (!reserved.has(text6[at] ?? "") || ["+", "-"].includes(text6[at] ?? "")))
|
|
611
788
|
at++;
|
|
612
|
-
|
|
789
|
+
kind2 = "term";
|
|
613
790
|
} else {
|
|
614
791
|
at++;
|
|
615
792
|
if ((c === "<" || c === ">") && text6[at] === "=") {
|
|
616
793
|
at++;
|
|
617
|
-
|
|
794
|
+
kind2 += "=";
|
|
618
795
|
}
|
|
619
796
|
if (c === "[" || c === "{")
|
|
620
797
|
range = true;
|
|
@@ -627,7 +804,7 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
|
627
804
|
const next = text6[at] ?? "";
|
|
628
805
|
if (next === "\\") {
|
|
629
806
|
if (at + 1 >= text6.length)
|
|
630
|
-
|
|
807
|
+
fail3("query.invalid-escape", { start: at, end: at + 1 });
|
|
631
808
|
at += 2;
|
|
632
809
|
continue;
|
|
633
810
|
}
|
|
@@ -644,9 +821,9 @@ var tokensOf = /* @__PURE__ */ __name((text6, fail = queryError) => {
|
|
|
644
821
|
while (at < text6.length && !whitespace(text6[at] ?? "") && !["(", ")", '"'].includes(text6[at] ?? ""))
|
|
645
822
|
at++;
|
|
646
823
|
const raw = text6.slice(start, at);
|
|
647
|
-
|
|
824
|
+
kind2 = { AND: "AND", OR: "OR", NOT: "NOT", "&&": "AND", "||": "OR" }[raw] ?? (/^\d+(?:\.\d+)?$/u.test(raw) ? "number" : "term");
|
|
648
825
|
}
|
|
649
|
-
tokens.push({ kind, raw: text6.slice(start, at), span: { start, end: at } });
|
|
826
|
+
tokens.push({ kind: kind2, raw: text6.slice(start, at), span: { start, end: at } });
|
|
650
827
|
}
|
|
651
828
|
tokens.push({ kind: "EOF", raw: "", span: { start: at, end: at } });
|
|
652
829
|
return tokens;
|
|
@@ -665,30 +842,30 @@ var regexHint = /* @__PURE__ */ __name((text6, at) => {
|
|
|
665
842
|
return quoteHint(text6, at) ?? `/ starts a regular expression; put the value in quotes: "${word}"`;
|
|
666
843
|
}, "regexHint");
|
|
667
844
|
var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proximity = false, ...context3 } = {}) => {
|
|
668
|
-
const
|
|
845
|
+
const fail3 = /* @__PURE__ */ __name((reason, span, alternative) => queryError(reason, span, alternative ?? quoteHint(text6, span.start), context3), "fail");
|
|
669
846
|
if (text6.length > QUERY_LIMITS.bytes || new TextEncoder().encode(text6).length > QUERY_LIMITS.bytes)
|
|
670
|
-
|
|
671
|
-
const tokens = tokensOf(text6,
|
|
847
|
+
fail3("query.too-large", { start: 0, end: text6.length });
|
|
848
|
+
const tokens = tokensOf(text6, fail3);
|
|
672
849
|
let at = 0;
|
|
673
850
|
let count7 = 0;
|
|
674
851
|
let depth = 0;
|
|
675
852
|
const peek = /* @__PURE__ */ __name(() => tokens[at], "peek");
|
|
676
853
|
const take = /* @__PURE__ */ __name(() => tokens[at++], "take");
|
|
677
|
-
const expect = /* @__PURE__ */ __name((
|
|
678
|
-
if (peek().kind !==
|
|
679
|
-
|
|
854
|
+
const expect = /* @__PURE__ */ __name((kind2) => {
|
|
855
|
+
if (peek().kind !== kind2)
|
|
856
|
+
fail3("query.invalid-syntax", peek().span);
|
|
680
857
|
return take();
|
|
681
858
|
}, "expect");
|
|
682
859
|
const built = /* @__PURE__ */ __name((node) => {
|
|
683
860
|
if (++count7 > QUERY_LIMITS.nodes)
|
|
684
|
-
|
|
861
|
+
fail3("query.too-large", node.span);
|
|
685
862
|
return node;
|
|
686
863
|
}, "built");
|
|
687
864
|
const combine = /* @__PURE__ */ __name((clauses, occur) => {
|
|
688
865
|
const first = clauses[0];
|
|
689
866
|
const last = clauses.at(-1);
|
|
690
867
|
if (!first || !last)
|
|
691
|
-
|
|
868
|
+
fail3("query.invalid-syntax", peek().span);
|
|
692
869
|
if (clauses.length === 1)
|
|
693
870
|
return first;
|
|
694
871
|
return {
|
|
@@ -701,7 +878,7 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
701
878
|
}, "combine");
|
|
702
879
|
const query = /* @__PURE__ */ __name((field, implicit = false) => {
|
|
703
880
|
if (++depth > QUERY_LIMITS.depth)
|
|
704
|
-
|
|
881
|
+
fail3("query.too-large", peek().span);
|
|
705
882
|
const clauses = [];
|
|
706
883
|
do {
|
|
707
884
|
clauses.push(disjunction(field, implicit));
|
|
@@ -737,7 +914,7 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
737
914
|
let implicit = inheritedImplicit;
|
|
738
915
|
if (peek().kind === "term" && [":", "=", "<", ">", "<=", ">="].includes(tokens[at + 1]?.kind ?? "")) {
|
|
739
916
|
const token = take();
|
|
740
|
-
field = decodeEscapes(token.raw, token.span,
|
|
917
|
+
field = decodeEscapes(token.raw, token.span, fail3);
|
|
741
918
|
start = token.span.start;
|
|
742
919
|
implicit = false;
|
|
743
920
|
let operator = take();
|
|
@@ -746,8 +923,8 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
746
923
|
if (["<", ">", "<=", ">="].includes(operator.kind)) {
|
|
747
924
|
const value = take();
|
|
748
925
|
if (!["term", "number", "quoted"].includes(value.kind))
|
|
749
|
-
|
|
750
|
-
const decoded = decodeEscapes(value.kind === "quoted" ? value.raw.slice(1, -1) : value.raw, value.span,
|
|
926
|
+
fail3("query.invalid-syntax", value.span);
|
|
927
|
+
const decoded = decodeEscapes(value.kind === "quoted" ? value.raw.slice(1, -1) : value.raw, value.span, fail3);
|
|
751
928
|
const lower = operator.kind.startsWith(">");
|
|
752
929
|
const node2 = built({
|
|
753
930
|
kind: "predicate",
|
|
@@ -772,17 +949,17 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
772
949
|
const opening = take();
|
|
773
950
|
const lower = take();
|
|
774
951
|
if (!["rangeValue", "quoted"].includes(lower.kind))
|
|
775
|
-
|
|
952
|
+
fail3("query.invalid-syntax", lower.span);
|
|
776
953
|
const separator = take();
|
|
777
954
|
if (separator.raw !== "TO")
|
|
778
|
-
|
|
955
|
+
fail3("query.invalid-syntax", separator.span);
|
|
779
956
|
const upper = take();
|
|
780
957
|
if (!["rangeValue", "quoted"].includes(upper.kind))
|
|
781
|
-
|
|
958
|
+
fail3("query.invalid-syntax", upper.span);
|
|
782
959
|
const closing = take();
|
|
783
960
|
if (!["]", "}"].includes(closing.kind))
|
|
784
|
-
|
|
785
|
-
const decode = /* @__PURE__ */ __name((t) => decodeEscapes(t.kind === "quoted" ? t.raw.slice(1, -1) : t.raw, t.span,
|
|
961
|
+
fail3("query.invalid-syntax", closing.span);
|
|
962
|
+
const decode = /* @__PURE__ */ __name((t) => decodeEscapes(t.kind === "quoted" ? t.raw.slice(1, -1) : t.raw, t.span, fail3), "decode");
|
|
786
963
|
node = built({
|
|
787
964
|
kind: "predicate",
|
|
788
965
|
field,
|
|
@@ -796,31 +973,31 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
796
973
|
} else {
|
|
797
974
|
const token = take();
|
|
798
975
|
if (!["term", "number", "quoted", "regex"].includes(token.kind))
|
|
799
|
-
|
|
976
|
+
fail3("query.invalid-syntax", token.span);
|
|
800
977
|
const raw = ["term", "number"].includes(token.kind) ? token.raw : token.raw.slice(1, -1);
|
|
801
978
|
if (field === "fn")
|
|
802
|
-
|
|
979
|
+
fail3("query.unsupported-operator", token.span, "interval functions are not supported");
|
|
803
980
|
const wildcard = ["term", "number"].includes(token.kind) && /(?<!\\)[*?]/u.test(raw);
|
|
804
981
|
node = built({
|
|
805
982
|
kind: "predicate",
|
|
806
983
|
field,
|
|
807
984
|
operator: token.kind === "regex" ? "regex" : token.kind === "quoted" ? "phrase" : wildcard ? "wildcard" : "term",
|
|
808
|
-
value: token.kind === "regex" || wildcard ? raw : decodeEscapes(raw, token.span,
|
|
985
|
+
value: token.kind === "regex" || wildcard ? raw : decodeEscapes(raw, token.span, fail3),
|
|
809
986
|
span: { start: start ?? token.span.start, end: token.span.end },
|
|
810
987
|
...implicit ? { implicit: true } : {}
|
|
811
988
|
});
|
|
812
989
|
}
|
|
813
990
|
if (proximity && peek().kind === "~" && node.kind === "predicate" && node.operator === "phrase") {
|
|
814
991
|
take();
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
|
|
818
|
-
node = { ...node, slop: Number(
|
|
992
|
+
const distance2 = take();
|
|
993
|
+
if (distance2.kind !== "number" || !/^\d+$/u.test(distance2.raw))
|
|
994
|
+
fail3("query.invalid-syntax", distance2.span, 'write the distance as a whole number: "a b"~3');
|
|
995
|
+
node = { ...node, slop: Number(distance2.raw), span: { start: node.span.start, end: distance2.span.end } };
|
|
819
996
|
}
|
|
820
997
|
if (peek().kind === "~")
|
|
821
|
-
|
|
998
|
+
fail3("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");
|
|
822
999
|
if (["^", "@"].includes(peek().kind))
|
|
823
|
-
|
|
1000
|
+
fail3("query.unsupported-operator", peek().span, "boost and minimum-should-match are not supported");
|
|
824
1001
|
return { node, ...modifier ? { modifier } : {} };
|
|
825
1002
|
}, "clause");
|
|
826
1003
|
const root = query(defaultField, true);
|
|
@@ -836,20 +1013,20 @@ var parseLucene = /* @__PURE__ */ __name((text6, { defaultField = "text", proxim
|
|
|
836
1013
|
}, "parseLucene");
|
|
837
1014
|
var implicitTextTerms = /* @__PURE__ */ __name((text6) => {
|
|
838
1015
|
const tokens = tokensOf(text6);
|
|
839
|
-
if (tokens.some(({ kind }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(
|
|
1016
|
+
if (tokens.some(({ kind: kind2 }) => ["AND", "OR", "NOT", "+", "-", "!", "(", ")"].includes(kind2)))
|
|
840
1017
|
return /* @__PURE__ */ new Set();
|
|
841
1018
|
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] : []));
|
|
842
1019
|
}, "implicitTextTerms");
|
|
843
1020
|
|
|
844
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
845
|
-
var describeQuery = /* @__PURE__ */ __name((
|
|
846
|
-
entity:
|
|
847
|
-
backend:
|
|
848
|
-
fields:
|
|
849
|
-
...
|
|
1021
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
1022
|
+
var describeQuery = /* @__PURE__ */ __name((registry3) => ({
|
|
1023
|
+
entity: registry3.entity,
|
|
1024
|
+
backend: registry3.backend,
|
|
1025
|
+
fields: registry3.fields.map(({ validate: _, ...field }) => field),
|
|
1026
|
+
...registry3.defaults && registry3.defaults.length > 0 ? { defaults: [...registry3.defaults] } : {}
|
|
850
1027
|
}), "describeQuery");
|
|
851
|
-
var exampleProblems = /* @__PURE__ */ __name((
|
|
852
|
-
const syntaxOnly = { ...
|
|
1028
|
+
var exampleProblems = /* @__PURE__ */ __name((registry3) => {
|
|
1029
|
+
const syntaxOnly = { ...registry3, backend: "sql" };
|
|
853
1030
|
const problem = /* @__PURE__ */ __name((text6, field) => {
|
|
854
1031
|
try {
|
|
855
1032
|
const named = walkQuery(validateQuery(parseLucene(text6, { defaultField: "none" }), syntaxOnly).root);
|
|
@@ -860,29 +1037,29 @@ var exampleProblems = /* @__PURE__ */ __name((registry) => {
|
|
|
860
1037
|
return `"${text6}": ${failure.message}`;
|
|
861
1038
|
}
|
|
862
1039
|
}, "problem");
|
|
863
|
-
const defaults = (
|
|
1040
|
+
const defaults = (registry3.defaults ?? []).map((term) => {
|
|
864
1041
|
const field = term.replace(/^-/, "").split(/[:<>=]/)[0] ?? "";
|
|
865
1042
|
return { field, problem: problem(term.replace(/^-/, ""), field) };
|
|
866
1043
|
});
|
|
867
1044
|
return [
|
|
868
|
-
...
|
|
1045
|
+
...registry3.fields.map((field) => ({ field: field.name, problem: problem(field.example, field.name) })),
|
|
869
1046
|
...defaults
|
|
870
1047
|
].filter((entry) => entry.problem !== void 0);
|
|
871
1048
|
}, "exampleProblems");
|
|
872
1049
|
var checked = /* @__PURE__ */ new WeakSet();
|
|
873
|
-
var defineQuery = /* @__PURE__ */ __name((
|
|
874
|
-
if (checked.has(
|
|
875
|
-
return
|
|
876
|
-
const names =
|
|
1050
|
+
var defineQuery = /* @__PURE__ */ __name((registry3) => {
|
|
1051
|
+
if (checked.has(registry3))
|
|
1052
|
+
return registry3;
|
|
1053
|
+
const names = registry3.fields.map((field) => field.name);
|
|
877
1054
|
const problems = [
|
|
878
1055
|
...duplicates(names).map((name) => `"${name}" is listed twice`),
|
|
879
1056
|
...names.filter((name) => !SNAKE_CASE.test(name)).map((name) => `"${name}" is not snake_case`),
|
|
880
|
-
...exampleProblems(
|
|
1057
|
+
...exampleProblems(registry3).map(({ field, problem }) => `${field}: ${problem}`)
|
|
881
1058
|
];
|
|
882
1059
|
if (problems.length > 0)
|
|
883
|
-
throw new RegistryError(`${
|
|
884
|
-
checked.add(
|
|
885
|
-
return
|
|
1060
|
+
throw new RegistryError(`${registry3.entity} query`, problems);
|
|
1061
|
+
checked.add(registry3);
|
|
1062
|
+
return registry3;
|
|
886
1063
|
}, "defineQuery");
|
|
887
1064
|
var SPAN = ["span", "alternative", "guide"];
|
|
888
1065
|
var QUERY_REASONS = defineReasons([
|
|
@@ -912,7 +1089,7 @@ var QUERY_REASONS = defineReasons([
|
|
|
912
1089
|
details: [...SPAN, ...details]
|
|
913
1090
|
})));
|
|
914
1091
|
|
|
915
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1092
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.93.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
|
|
916
1093
|
var wordsOf = /* @__PURE__ */ __name((text6) => text6.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [], "wordsOf");
|
|
917
1094
|
var pattern = /* @__PURE__ */ __name((value) => new RegExp(`^${[...value].map((char) => char === "*" ? ".*" : char === "?" ? "." : char.replace(/[.+^${}()|[\]\\]/, "\\$&")).join("")}$`, "iu"), "pattern");
|
|
918
1095
|
var present = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "", "present");
|
|
@@ -967,7 +1144,7 @@ var matches = /* @__PURE__ */ __name((node, item, byName, options) => {
|
|
|
967
1144
|
}, "matches");
|
|
968
1145
|
var evaluate = /* @__PURE__ */ __name((ast, fields, item, options = {}) => matches(ast.root, item, new Map(fields.map((field) => [field.name, field])), options), "evaluate");
|
|
969
1146
|
|
|
970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/reference.js
|
|
971
1148
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "expected meeting:<accountId>/<meetingId>[/<transcriptId>[/<cuePosition>]] with safe integer IDs"), "invalid");
|
|
972
1149
|
var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
973
1150
|
if (!Number.isSafeInteger(value) || value < minimum)
|
|
@@ -975,24 +1152,24 @@ var integer2 = /* @__PURE__ */ __name((value, minimum = 1) => {
|
|
|
975
1152
|
return value;
|
|
976
1153
|
}, "integer");
|
|
977
1154
|
var formatMeetingReference = /* @__PURE__ */ __name((reference2) => {
|
|
978
|
-
const
|
|
1155
|
+
const parts2 = [integer2(reference2.accountId), integer2(reference2.meetingId)];
|
|
979
1156
|
if (reference2.transcriptId !== void 0)
|
|
980
|
-
|
|
1157
|
+
parts2.push(integer2(reference2.transcriptId));
|
|
981
1158
|
if (reference2.cuePosition !== void 0) {
|
|
982
1159
|
if (reference2.transcriptId === void 0)
|
|
983
1160
|
throw invalid();
|
|
984
|
-
|
|
1161
|
+
parts2.push(integer2(reference2.cuePosition, 0));
|
|
985
1162
|
}
|
|
986
|
-
return `meeting:${
|
|
1163
|
+
return `meeting:${parts2.join("/")}`;
|
|
987
1164
|
}, "formatMeetingReference");
|
|
988
1165
|
var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
|
|
989
1166
|
const value = text6.trim();
|
|
990
1167
|
if (!value.startsWith("meeting:"))
|
|
991
1168
|
throw invalid();
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
1169
|
+
const parts2 = value.slice(8).split("/");
|
|
1170
|
+
if (parts2.length < 2 || parts2.length > 4 || parts2.some((part) => !/^\d+$/.test(part)))
|
|
994
1171
|
throw invalid();
|
|
995
|
-
const ids2 =
|
|
1172
|
+
const ids2 = parts2.map(Number);
|
|
996
1173
|
const reference2 = {
|
|
997
1174
|
type: "meeting",
|
|
998
1175
|
accountId: integer2(ids2[0]),
|
|
@@ -1004,7 +1181,7 @@ var parseMeetingReference = /* @__PURE__ */ __name((text6) => {
|
|
|
1004
1181
|
}, "parseMeetingReference");
|
|
1005
1182
|
var canonicalMeetingReference = /* @__PURE__ */ __name((text6) => formatMeetingReference(parseMeetingReference(text6)), "canonicalMeetingReference");
|
|
1006
1183
|
|
|
1007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1184
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/item.js
|
|
1008
1185
|
var text = string();
|
|
1009
1186
|
var count = pipe(number(), integer(), minValue(0));
|
|
1010
1187
|
var MEETING_ISSUES = ["time_without_zone"];
|
|
@@ -1069,7 +1246,7 @@ var MEETING_QUERY = {
|
|
|
1069
1246
|
})
|
|
1070
1247
|
};
|
|
1071
1248
|
|
|
1072
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/join-key.js
|
|
1073
1250
|
var joinKeyOf = /* @__PURE__ */ __name((url) => {
|
|
1074
1251
|
const parsed = urlOf(url);
|
|
1075
1252
|
if (!parsed)
|
|
@@ -1103,7 +1280,7 @@ var urlOf = /* @__PURE__ */ __name((url) => {
|
|
|
1103
1280
|
}
|
|
1104
1281
|
}, "urlOf");
|
|
1105
1282
|
|
|
1106
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/calendar-text.js
|
|
1107
1284
|
var ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", apos: "'", nbsp: " " };
|
|
1108
1285
|
var SECRET_LINE = /(?<![\p{L}\p{N}])(pass ?codes?|passwords?|pwd|pins?|access ?codes?|meeting ?codes?|kennwort|пароль|пин-?код|код доступа)(?![\p{L}\p{N}])|pwd=/iu;
|
|
1109
1286
|
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");
|
|
@@ -1112,8 +1289,8 @@ var calendarText = /* @__PURE__ */ __name((text6, { dropSecretLines = true } = {
|
|
|
1112
1289
|
if (!text6)
|
|
1113
1290
|
return null;
|
|
1114
1291
|
const kept = htmlToText(text6).split(/\r?\n/u).map((line2) => withoutLinkQueries(line2).replace(/[ \t]+/gu, " ").trim()).filter((line2) => !dropSecretLines || !SECRET_LINE.test(line2));
|
|
1115
|
-
const
|
|
1116
|
-
return
|
|
1292
|
+
const joined2 = kept.join("\n").replace(/\n{3,}/gu, "\n\n").trim();
|
|
1293
|
+
return joined2 || null;
|
|
1117
1294
|
}, "calendarText");
|
|
1118
1295
|
var ENTRY_METADATA_KEYS = [
|
|
1119
1296
|
"colorId",
|
|
@@ -1140,7 +1317,7 @@ var entryMetadata = /* @__PURE__ */ __name((metadata) => {
|
|
|
1140
1317
|
return kept;
|
|
1141
1318
|
}, "entryMetadata");
|
|
1142
1319
|
|
|
1143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1320
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/cue-fingerprint.js
|
|
1144
1321
|
import { createHash } from "node:crypto";
|
|
1145
1322
|
var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256").update(JSON.stringify({
|
|
1146
1323
|
reference: cue2.reference,
|
|
@@ -1154,7 +1331,7 @@ var meetingCueFingerprint = /* @__PURE__ */ __name((cue2) => createHash("sha256"
|
|
|
1154
1331
|
text: cue2.text
|
|
1155
1332
|
})).digest("hex"), "meetingCueFingerprint");
|
|
1156
1333
|
|
|
1157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/event-store.js
|
|
1158
1335
|
var UNTIL = /(?:^|;)UNTIL=(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2})Z?)?(?:;|$)/iu;
|
|
1159
1336
|
var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
1160
1337
|
if (entry.recurrenceEndsAt !== null)
|
|
@@ -1163,8 +1340,8 @@ var seriesEnd = /* @__PURE__ */ __name((entry) => {
|
|
|
1163
1340
|
const until = rule === void 0 ? null : UNTIL.exec(rule.slice("RRULE:".length));
|
|
1164
1341
|
if (!until)
|
|
1165
1342
|
return Number.POSITIVE_INFINITY;
|
|
1166
|
-
const [, year, month,
|
|
1167
|
-
return Date.UTC(Number(year), Number(month) - 1, Number(
|
|
1343
|
+
const [, year, month, day2, hour = "23", minute = "59", second = "59"] = until;
|
|
1344
|
+
return Date.UTC(Number(year), Number(month) - 1, Number(day2), Number(hour), Number(minute), Number(second)) + 864e5;
|
|
1168
1345
|
}, "seriesEnd");
|
|
1169
1346
|
var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
1170
1347
|
if (entry.kind === "occurrence" && !entry.exception)
|
|
@@ -1177,7 +1354,7 @@ var entryInWindow = /* @__PURE__ */ __name((entry, window) => {
|
|
|
1177
1354
|
return Math.max(entry.endsAt ?? start, start + 1) > window.from;
|
|
1178
1355
|
}, "entryInWindow");
|
|
1179
1356
|
|
|
1180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/answers.js
|
|
1181
1358
|
var text2 = string();
|
|
1182
1359
|
var count2 = pipe(number(), integer(), minValue(0));
|
|
1183
1360
|
var iso2 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
@@ -1380,10 +1557,10 @@ var meetingHitItem = /* @__PURE__ */ __name((hit) => ({
|
|
|
1380
1557
|
var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search meetings", args = {}, meta = {}) => {
|
|
1381
1558
|
const items = found.items.map(meetingHitItem);
|
|
1382
1559
|
const cursor = found.hasMore && found.nextCursor !== null ? found.nextCursor : void 0;
|
|
1383
|
-
const
|
|
1560
|
+
const pending2 = found.coverage.indexing === "pending";
|
|
1384
1561
|
const next = [
|
|
1385
1562
|
...cursor === void 0 ? [] : [stepOf(PAGE_NEXT, { command, args: { ...args, cursor, limit }, values: { shown: items.length } })],
|
|
1386
|
-
...
|
|
1563
|
+
...pending2 ? [
|
|
1387
1564
|
stepOf(SEARCH_AGAIN, {
|
|
1388
1565
|
command,
|
|
1389
1566
|
args: Object.fromEntries(Object.entries(args).filter(([key]) => key !== "cursor"))
|
|
@@ -1399,7 +1576,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1399
1576
|
...cursor === void 0 ? {} : { next_cursor: cursor }
|
|
1400
1577
|
},
|
|
1401
1578
|
...next.length > 0 ? { next } : {},
|
|
1402
|
-
...
|
|
1579
|
+
...pending2 ? {
|
|
1403
1580
|
missing: [
|
|
1404
1581
|
{
|
|
1405
1582
|
field: "excerpt",
|
|
@@ -1412,7 +1589,7 @@ var meetingHitsList = /* @__PURE__ */ __name((found, limit, command = "search me
|
|
|
1412
1589
|
};
|
|
1413
1590
|
}, "meetingHitsList");
|
|
1414
1591
|
|
|
1415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1592
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/participant-search.js
|
|
1416
1593
|
var normalizeMeetingParticipantQuery = /* @__PURE__ */ __name((text6) => text6.normalize("NFKC").toLowerCase(), "normalizeMeetingParticipantQuery");
|
|
1417
1594
|
var validateMeetingParticipantQuery = /* @__PURE__ */ __name((query) => {
|
|
1418
1595
|
if (typeof query !== "string" || !query.trim() || query.length > 500 || query.includes("\0"))
|
|
@@ -1436,7 +1613,7 @@ var validateMeetingParticipantSearch = /* @__PURE__ */ __name((query, input) =>
|
|
|
1436
1613
|
};
|
|
1437
1614
|
}, "validateMeetingParticipantSearch");
|
|
1438
1615
|
|
|
1439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1616
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/reads.js
|
|
1440
1617
|
var MeetingError = class extends CliError {
|
|
1441
1618
|
static {
|
|
1442
1619
|
__name(this, "MeetingError");
|
|
@@ -1568,7 +1745,7 @@ var meetingSummaryAnswer = /* @__PURE__ */ __name(async (store, id4, accountId)
|
|
|
1568
1745
|
return wholeList(details.summaries.map((one) => meetingSummaryItem(details.meeting.accountId, one)));
|
|
1569
1746
|
}, "meetingSummaryAnswer");
|
|
1570
1747
|
|
|
1571
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/export.js
|
|
1572
1749
|
var timestamp = /* @__PURE__ */ __name((milliseconds) => {
|
|
1573
1750
|
if (!Number.isSafeInteger(milliseconds) || milliseconds < 0)
|
|
1574
1751
|
throw new MeetingError("validation_error", "transcript times must be nonnegative integer milliseconds");
|
|
@@ -1630,30 +1807,30 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
|
1630
1807
|
text: row.text
|
|
1631
1808
|
})));
|
|
1632
1809
|
} else {
|
|
1633
|
-
const
|
|
1810
|
+
const parts2 = [`# ${heading(details.meeting.title ?? "Untitled meeting")}`, `Meeting ID: ${details.meeting.id}`];
|
|
1634
1811
|
if (details.meeting.description !== null)
|
|
1635
|
-
|
|
1812
|
+
parts2.push("## Description", quote(details.meeting.description));
|
|
1636
1813
|
for (const summary of details.summaries) {
|
|
1637
|
-
|
|
1814
|
+
parts2.push(`## ${heading(summary.title ?? "Summary")}`);
|
|
1638
1815
|
if (summary.content !== null)
|
|
1639
|
-
|
|
1816
|
+
parts2.push(quote(summary.content));
|
|
1640
1817
|
else {
|
|
1641
1818
|
if (summary.overview !== null)
|
|
1642
|
-
|
|
1819
|
+
parts2.push(quote(summary.overview));
|
|
1643
1820
|
for (const section of summary.sections)
|
|
1644
|
-
|
|
1821
|
+
parts2.push(`### ${heading(section.label)}`, quote(section.text));
|
|
1645
1822
|
if (summary.nextSteps.length > 0)
|
|
1646
|
-
|
|
1823
|
+
parts2.push("### Next steps", summary.nextSteps.map((step) => `- ${markdown(step)}`).join("\n"));
|
|
1647
1824
|
}
|
|
1648
1825
|
}
|
|
1649
1826
|
for (const part of transcripts) {
|
|
1650
|
-
|
|
1827
|
+
parts2.push(`## Transcript ${part.transcript.id}`, `Source: ${heading(part.transcript.source)}`);
|
|
1651
1828
|
if (part.transcript.supersededAt !== null)
|
|
1652
|
-
|
|
1829
|
+
parts2.push("Version: superseded");
|
|
1653
1830
|
for (const row of [...part.rows].sort((a, b) => a.position - b.position))
|
|
1654
|
-
|
|
1831
|
+
parts2.push(`[${timestamp(row.startMs)} \u2013 ${timestamp(row.endMs)}]${row.speakerName === null ? "" : ` ${heading(row.speakerName)}`}`, quote(row.text));
|
|
1655
1832
|
}
|
|
1656
|
-
content = `${
|
|
1833
|
+
content = `${parts2.join("\n\n")}
|
|
1657
1834
|
`;
|
|
1658
1835
|
}
|
|
1659
1836
|
return {
|
|
@@ -1664,7 +1841,7 @@ var exportMeeting = /* @__PURE__ */ __name(async (store, id4, options) => {
|
|
|
1664
1841
|
};
|
|
1665
1842
|
}, "exportMeeting");
|
|
1666
1843
|
|
|
1667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/payment.js
|
|
1668
1845
|
var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
|
|
1669
1846
|
var PAYMENT_DIRECTIONS = ["to_us", "from_us"];
|
|
1670
1847
|
var PAYMENT_STATES = ["expected", "paid", "cancelled"];
|
|
@@ -1758,10 +1935,10 @@ var paymentTitle = /* @__PURE__ */ __name((fact) => {
|
|
|
1758
1935
|
return `${grouped(payment.amount)} ${payment.currency} ${way}${party}${item}${due} (${payment.state})`;
|
|
1759
1936
|
}, "paymentTitle");
|
|
1760
1937
|
|
|
1761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
1762
1939
|
import { createHash as createHash2 } from "node:crypto";
|
|
1763
1940
|
|
|
1764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/timestamp.js
|
|
1765
1942
|
var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
1766
1943
|
if (typeof value !== "string" || !/^\d{4}-\d{2}-\d{2}T.+(?:Z|[+-]\d{2}:\d{2})$/i.test(value) || !Number.isFinite(Date.parse(value)))
|
|
1767
1944
|
throw new CliError("validation_error", `${name} must be an ISO timestamp with a timezone, such as 2026-11-09T09:00:00Z`);
|
|
@@ -1772,7 +1949,7 @@ var meetingTimestamp = /* @__PURE__ */ __name((value, name) => {
|
|
|
1772
1949
|
return new Date(value).toISOString();
|
|
1773
1950
|
}, "meetingTimestamp");
|
|
1774
1951
|
|
|
1775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/findings-rules.js
|
|
1776
1953
|
var TASK_TYPES = ["bug", "feature", "chore"];
|
|
1777
1954
|
var invalid3 = /* @__PURE__ */ __name((message) => {
|
|
1778
1955
|
throw new CliError("validation_error", message);
|
|
@@ -1786,10 +1963,10 @@ var findingHash = /* @__PURE__ */ __name((value) => createHash2("sha256").update
|
|
|
1786
1963
|
var snakeCase = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snakeCase");
|
|
1787
1964
|
var findingWhere = /* @__PURE__ */ __name((of) => {
|
|
1788
1965
|
const id4 = typeof of.id === "string" ? of.id : null;
|
|
1789
|
-
const
|
|
1966
|
+
const kind2 = typeof of.kind === "string" ? of.kind : null;
|
|
1790
1967
|
return {
|
|
1791
|
-
where: id4 ||
|
|
1792
|
-
named: { ...id4 ? { finding: id4 } : {}, ...
|
|
1968
|
+
where: id4 || kind2 ? ` in ${[id4, kind2 && `(${kind2})`].filter(Boolean).join(" ")}` : "",
|
|
1969
|
+
named: { ...id4 ? { finding: id4 } : {}, ...kind2 ? { kind: kind2 } : {} }
|
|
1793
1970
|
};
|
|
1794
1971
|
}, "findingWhere");
|
|
1795
1972
|
var findingFields = /* @__PURE__ */ __name((value, allowed, noun, of = value) => {
|
|
@@ -1817,13 +1994,15 @@ var validEvidence = /* @__PURE__ */ __name((raw, rules) => {
|
|
|
1817
1994
|
const evidence = raw.map((item) => {
|
|
1818
1995
|
if (!item || typeof item !== "object")
|
|
1819
1996
|
return invalid3("finding evidence is a reference and fingerprint");
|
|
1820
|
-
findingFields(item, ["reference", "fingerprint"], rules.singular);
|
|
1997
|
+
findingFields(item, rules.quotes ? ["reference", "fingerprint", "quote"] : ["reference", "fingerprint"], rules.singular);
|
|
1821
1998
|
if (typeof item.reference !== "string" || typeof item.fingerprint !== "string")
|
|
1822
1999
|
return invalid3("evidence requires a reference and fingerprint");
|
|
1823
2000
|
const reference2 = rules.reference(item.reference);
|
|
1824
2001
|
if (!/^[a-f0-9]{64}$/.test(item.fingerprint))
|
|
1825
2002
|
return invalid3(`finding evidence requires exact ${rules.cited} references and fingerprints`);
|
|
1826
|
-
|
|
2003
|
+
if (item.quote === void 0)
|
|
2004
|
+
return { reference: reference2, fingerprint: item.fingerprint };
|
|
2005
|
+
return { reference: reference2, fingerprint: item.fingerprint, quote: findingText(item.quote, rules.quotes ?? 0) };
|
|
1827
2006
|
}).sort((a, b) => a.reference.localeCompare(b.reference));
|
|
1828
2007
|
if (new Set(evidence.map((item) => item.reference)).size !== evidence.length)
|
|
1829
2008
|
return invalid3(`duplicate evidence ${rules.cited}`);
|
|
@@ -1945,7 +2124,7 @@ var validateBatch = /* @__PURE__ */ __name((input, rules, most, one) => {
|
|
|
1945
2124
|
var validateFindings = /* @__PURE__ */ __name((input, rules) => validateBatch(input, rules, 16, (finding, ids2) => validateFinding(finding, rules, ids2)), "validateFindings");
|
|
1946
2125
|
var findingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "findingFingerprint");
|
|
1947
2126
|
|
|
1948
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2127
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/findings.js
|
|
1949
2128
|
var MEETING_FINDINGS_KIND = "meeting_findings";
|
|
1950
2129
|
var cue = /* @__PURE__ */ __name((raw) => {
|
|
1951
2130
|
const reference2 = canonicalMeetingReference(raw);
|
|
@@ -1956,7 +2135,7 @@ var cue = /* @__PURE__ */ __name((raw) => {
|
|
|
1956
2135
|
var validateMeetingFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "meeting findings", singular: "meeting finding", cited: "cue", reference: cue }), "validateMeetingFindings");
|
|
1957
2136
|
var meetingFindingFingerprint = findingFingerprint;
|
|
1958
2137
|
|
|
1959
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/result-items.js
|
|
1960
2139
|
var text3 = string();
|
|
1961
2140
|
var identifier = pipe(text3, minLength(1));
|
|
1962
2141
|
var nullableText = nullable(text3);
|
|
@@ -1998,7 +2177,8 @@ var personResult = strictObject({
|
|
|
1998
2177
|
participant_id: identifier,
|
|
1999
2178
|
person_uid: text3,
|
|
2000
2179
|
previous_person_uid: nullableText,
|
|
2001
|
-
changed: flag
|
|
2180
|
+
changed: flag,
|
|
2181
|
+
proposal: optional(text3)
|
|
2002
2182
|
});
|
|
2003
2183
|
var meetingChange = strictObject({
|
|
2004
2184
|
scope,
|
|
@@ -2089,7 +2269,7 @@ var MEETING_RESULT_ENTITIES = {
|
|
|
2089
2269
|
meeting_repair: repair
|
|
2090
2270
|
};
|
|
2091
2271
|
|
|
2092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2272
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/event-query.js
|
|
2093
2273
|
var EVENT_QUERY = defineQuery({
|
|
2094
2274
|
entity: "event",
|
|
2095
2275
|
backend: "sql",
|
|
@@ -2105,7 +2285,7 @@ var EVENT_QUERY = defineQuery({
|
|
|
2105
2285
|
]
|
|
2106
2286
|
});
|
|
2107
2287
|
|
|
2108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/events.js
|
|
2109
2289
|
var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now()) => {
|
|
2110
2290
|
const current = await store.meeting(details.meeting.id);
|
|
2111
2291
|
if (!current)
|
|
@@ -2148,7 +2328,7 @@ var linkEvent = /* @__PURE__ */ __name(async (store, details, now = Date.now())
|
|
|
2148
2328
|
return (await store.events()).find((e) => e.id === linked?.meeting.eventId) ?? null;
|
|
2149
2329
|
}, "linkEvent");
|
|
2150
2330
|
|
|
2151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/hit-query.js
|
|
2152
2332
|
var context = {
|
|
2153
2333
|
command: "search meetings",
|
|
2154
2334
|
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md#\u0432\u0441\u0442\u0440\u0435\u0447\u0438"
|
|
@@ -2212,7 +2392,7 @@ var MEETING_FIELDS = defineQuery({
|
|
|
2212
2392
|
var MEETING_FIELD_NAMES = new Set(MEETING_FIELDS.fields.map(({ name }) => name));
|
|
2213
2393
|
var parseMeetingQuery = /* @__PURE__ */ __name((query) => validateQuery(parseLucene(query, { defaultField: "text", proximity: true, ...context }), MEETING_HIT_QUERY, context), "parseMeetingQuery");
|
|
2214
2394
|
|
|
2215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/language.js
|
|
2216
2396
|
var LATIN_WORDS = {
|
|
2217
2397
|
en: ["the", "and", "is", "that", "you", "this", "what", "have", "with", "are"],
|
|
2218
2398
|
es: ["el", "los", "las", "por", "pero", "para", "est\xE1", "muy", "tambi\xE9n", "hay"],
|
|
@@ -2261,7 +2441,7 @@ var transcriptLanguage = /* @__PURE__ */ __name((texts) => {
|
|
|
2261
2441
|
return null;
|
|
2262
2442
|
}, "transcriptLanguage");
|
|
2263
2443
|
|
|
2264
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/ingest.js
|
|
2265
2445
|
var contentHash = /* @__PURE__ */ __name(async (text6) => {
|
|
2266
2446
|
const bytes = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(text6));
|
|
2267
2447
|
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -2298,7 +2478,7 @@ var timestamp2 = /* @__PURE__ */ __name((value) => {
|
|
|
2298
2478
|
return time2;
|
|
2299
2479
|
}, "timestamp");
|
|
2300
2480
|
|
|
2301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/transcript-text.js
|
|
2302
2482
|
var TranscriptTextError = class extends Error {
|
|
2303
2483
|
static {
|
|
2304
2484
|
__name(this, "TranscriptTextError");
|
|
@@ -2353,7 +2533,7 @@ var parseTranscriptText = /* @__PURE__ */ __name((input) => {
|
|
|
2353
2533
|
return { header, lines };
|
|
2354
2534
|
}, "parseTranscriptText");
|
|
2355
2535
|
|
|
2356
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/vtt.js
|
|
2357
2537
|
var VttError = class extends Error {
|
|
2358
2538
|
static {
|
|
2359
2539
|
__name(this, "VttError");
|
|
@@ -2405,7 +2585,7 @@ var parseVtt = /* @__PURE__ */ __name((input) => {
|
|
|
2405
2585
|
return cues;
|
|
2406
2586
|
}, "parseVtt");
|
|
2407
2587
|
|
|
2408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2588
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/import.js
|
|
2409
2589
|
var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now()) => {
|
|
2410
2590
|
const report = { meetings: 0, participants: 0, transcriptRows: 0, summaries: 0, warnings: [] };
|
|
2411
2591
|
for (const file of files) {
|
|
@@ -2438,10 +2618,10 @@ var importFiles = /* @__PURE__ */ __name(async (files, store, now = Date.now())
|
|
|
2438
2618
|
return report;
|
|
2439
2619
|
}, "importFiles");
|
|
2440
2620
|
|
|
2441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/links.js
|
|
2442
2622
|
var CHAT_MESSAGES_READ = 1e5;
|
|
2443
2623
|
|
|
2444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/meeting-management.js
|
|
2445
2625
|
var nonempty = /* @__PURE__ */ __name((value, name) => {
|
|
2446
2626
|
if (typeof value !== "string" || !value.trim())
|
|
2447
2627
|
throw new CliError("validation_error", `${name} must be nonempty`);
|
|
@@ -2492,7 +2672,7 @@ var validateMeetingChange = /* @__PURE__ */ __name((change, create) => {
|
|
|
2492
2672
|
return Object.freeze(result);
|
|
2493
2673
|
}, "validateMeetingChange");
|
|
2494
2674
|
|
|
2495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2675
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/passage.js
|
|
2496
2676
|
var meetingHitContextLimits = /* @__PURE__ */ __name((options = {}) => {
|
|
2497
2677
|
const { before = 3, after = 3, bytes = 65536, max_read_bytes = 4194304, expected_fingerprint } = options;
|
|
2498
2678
|
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)))
|
|
@@ -2505,7 +2685,7 @@ var validateMeetingPassage = /* @__PURE__ */ __name((reference2, options) => {
|
|
|
2505
2685
|
throw new CliError("validation_error", "choose a cue reference and json, text or markdown output");
|
|
2506
2686
|
}, "validateMeetingPassage");
|
|
2507
2687
|
|
|
2508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/preparation-context.js
|
|
2509
2689
|
var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
2510
2690
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
2511
2691
|
throw new CliError("validation_error", "meeting preparation context is required");
|
|
@@ -2530,7 +2710,7 @@ var validateMeetingPreparationContext = /* @__PURE__ */ __name((original) => {
|
|
|
2530
2710
|
return { ...input, limit, maxReadBytes };
|
|
2531
2711
|
}, "validateMeetingPreparationContext");
|
|
2532
2712
|
|
|
2533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-answer.js
|
|
2534
2714
|
var count4 = pipe(number(), integer(), minValue(0));
|
|
2535
2715
|
var id = pipe(string(), minLength(1));
|
|
2536
2716
|
var meetingProjectEvidence = strictObject({
|
|
@@ -2651,7 +2831,7 @@ var meetingProjectEvidenceAnswer = /* @__PURE__ */ __name((page, prepared, comma
|
|
|
2651
2831
|
};
|
|
2652
2832
|
}, "meetingProjectEvidenceAnswer");
|
|
2653
2833
|
|
|
2654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2834
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/search-validation.js
|
|
2655
2835
|
var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
2656
2836
|
const integer3 = /* @__PURE__ */ __name((value, low, high) => Number.isSafeInteger(value) && value >= low && value <= high, "integer");
|
|
2657
2837
|
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) || [
|
|
@@ -2671,7 +2851,7 @@ var validateMeetingHitSearch = /* @__PURE__ */ __name((query, options = {}) => {
|
|
|
2671
2851
|
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
2672
2852
|
}, "validateMeetingHitSearch");
|
|
2673
2853
|
|
|
2674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/project-evidence-query.js
|
|
2675
2855
|
var ids = {
|
|
2676
2856
|
meeting_id: "meetingId",
|
|
2677
2857
|
identity_id: "participantIdentityId",
|
|
@@ -2762,7 +2942,7 @@ var prepareMeetingProjectEvidence = /* @__PURE__ */ __name((project2, request =
|
|
|
2762
2942
|
return { project: project2.trim(), options, query: frozen.join(" AND ") };
|
|
2763
2943
|
}, "prepareMeetingProjectEvidence");
|
|
2764
2944
|
|
|
2765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2945
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/project-evidence.js
|
|
2766
2946
|
var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, request = {}, now = Date.now()) => {
|
|
2767
2947
|
const prepared = prepareMeetingProjectEvidence(project2, request, now);
|
|
2768
2948
|
const page = await read(prepared.project, prepared.options);
|
|
@@ -2770,7 +2950,7 @@ var readMeetingProjectEvidence = /* @__PURE__ */ __name(async (read, project2, r
|
|
|
2770
2950
|
return meetingProjectEvidenceAnswer(page, prepared);
|
|
2771
2951
|
}, "readMeetingProjectEvidence");
|
|
2772
2952
|
|
|
2773
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/pull.js
|
|
2774
2954
|
var participantInput = /* @__PURE__ */ __name((p, provider, occurrenceId2, position, accountId) => {
|
|
2775
2955
|
const { identityExternalId, ...fields } = p;
|
|
2776
2956
|
const externalId = identityExternalId ?? (p.email ? `email:${p.email.toLowerCase()}` : p.externalId) ?? `name:${p.displayName ?? "unknown"}@${accountId}/${occurrenceId2}:${position}`;
|
|
@@ -2932,7 +3112,7 @@ unlinked`, format)],
|
|
|
2932
3112
|
return report;
|
|
2933
3113
|
}, "pull");
|
|
2934
3114
|
|
|
2935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/read-answers.js
|
|
2936
3116
|
var text4 = string();
|
|
2937
3117
|
var count5 = pipe(number(), integer(), minValue(0));
|
|
2938
3118
|
var id2 = pipe(number(), integer(), minValue(1));
|
|
@@ -3126,10 +3306,10 @@ var eventItem = /* @__PURE__ */ __name((one) => ({
|
|
|
3126
3306
|
updated_at: new Date(one.updatedAt).toISOString()
|
|
3127
3307
|
}), "eventItem");
|
|
3128
3308
|
|
|
3129
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/recording-transfer.js
|
|
3130
3310
|
var strongRecordingValidator = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length <= 1024 && /^"[\x21\x23-\x7e\x80-\xff]*"$/.test(value), "strongRecordingValidator");
|
|
3131
3311
|
|
|
3132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/related-history.js
|
|
3133
3313
|
var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
3134
3314
|
if (!original || typeof original !== "object" || Array.isArray(original))
|
|
3135
3315
|
throw new CliError("validation_error", "related history request is required");
|
|
@@ -3159,14 +3339,14 @@ var validateMeetingRelatedHistory = /* @__PURE__ */ __name((original) => {
|
|
|
3159
3339
|
return { ...input, anchorIds: [...new Set(input.anchorIds)], limit, maxReadBytes };
|
|
3160
3340
|
}, "validateMeetingRelatedHistory");
|
|
3161
3341
|
|
|
3162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/review.js
|
|
3163
3343
|
var REVIEW_LIMIT = { default: 50, most: 200 };
|
|
3164
3344
|
|
|
3165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/save-hints.js
|
|
3166
3346
|
var SAVE_HELP = `Worth keeping \u2014 a decision, a promise, a preference? Record it with \`memo facts add\` or
|
|
3167
3347
|
\`memo memories add\`, citing the msg: locator or meeting: reference as --evidence.`;
|
|
3168
3348
|
|
|
3169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/series-history.js
|
|
3170
3350
|
var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
3171
3351
|
input.signal?.throwIfAborted();
|
|
3172
3352
|
if (!Number.isSafeInteger(input.accountId) || input.accountId <= 0)
|
|
@@ -3187,10 +3367,10 @@ var validateMeetingSeriesHistory = /* @__PURE__ */ __name((input) => {
|
|
|
3187
3367
|
return { ...input, limit, maxReadBytes };
|
|
3188
3368
|
}, "validateMeetingSeriesHistory");
|
|
3189
3369
|
|
|
3190
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/upcoming-validation.js
|
|
3191
3371
|
var occurrenceId = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim().length > 0 && value.length <= 1e3 && !/[\0\r\n]/.test(value), "occurrenceId");
|
|
3192
3372
|
|
|
3193
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/series-inventory-validation.js
|
|
3194
3374
|
function invalid4(field, response = false) {
|
|
3195
3375
|
throw new CliError(response ? "invalid_response" : "validation_error", `invalid meeting inventory ${field}`);
|
|
3196
3376
|
}
|
|
@@ -3219,7 +3399,7 @@ var validateMeetingSeriesInventoryCursor = /* @__PURE__ */ __name((value) => {
|
|
|
3219
3399
|
cursorDetails(value);
|
|
3220
3400
|
}, "validateMeetingSeriesInventoryCursor");
|
|
3221
3401
|
|
|
3222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/meetings/stats.js
|
|
3223
3403
|
var MEETING_COUNTS_GROUPINGS = ["day", "week", "series"];
|
|
3224
3404
|
var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
3225
3405
|
const zone = timeZone ?? "UTC";
|
|
@@ -3232,13 +3412,13 @@ var zoneOf = /* @__PURE__ */ __name((timeZone) => {
|
|
|
3232
3412
|
}, "zoneOf");
|
|
3233
3413
|
var DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
3234
3414
|
var weekStart = /* @__PURE__ */ __name((at, format) => {
|
|
3235
|
-
const
|
|
3236
|
-
const
|
|
3237
|
-
return new Date(
|
|
3415
|
+
const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
3416
|
+
const day2 = Date.UTC(Number(parts2.year), Number(parts2.month) - 1, Number(parts2.day));
|
|
3417
|
+
return new Date(day2 - DAYS.indexOf(parts2.weekday ?? "Mon") * 864e5).toISOString().slice(0, 10);
|
|
3238
3418
|
}, "weekStart");
|
|
3239
3419
|
var dayKey = /* @__PURE__ */ __name((at, format) => {
|
|
3240
|
-
const
|
|
3241
|
-
return `${
|
|
3420
|
+
const parts2 = Object.fromEntries(format.formatToParts(new Date(at)).map((part) => [part.type, part.value]));
|
|
3421
|
+
return `${parts2.year}-${parts2.month}-${parts2.day}`;
|
|
3242
3422
|
}, "dayKey");
|
|
3243
3423
|
var zoneFormat = /* @__PURE__ */ __name((zone) => new Intl.DateTimeFormat("en-US", {
|
|
3244
3424
|
timeZone: zone,
|
|
@@ -3354,130 +3534,573 @@ var aggregateMeetingStats = /* @__PURE__ */ __name((rows, timeZone) => {
|
|
|
3354
3534
|
};
|
|
3355
3535
|
}, "aggregateMeetingStats");
|
|
3356
3536
|
|
|
3357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3358
|
-
var
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
3538
|
+
var SCHEME = "msg:";
|
|
3539
|
+
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat, message }) => SCHEME + [provider, account, chat, message].map(encodeURIComponent).join("/"), "formatLocator");
|
|
3540
|
+
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
3541
|
+
var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
3542
|
+
const trimmed = reference2.trim();
|
|
3543
|
+
const parts2 = trimmed.startsWith(SCHEME) ? trimmed.slice(SCHEME.length).split("/") : [];
|
|
3544
|
+
if (parts2.length !== 4 || parts2.some((part) => part === "")) {
|
|
3545
|
+
throw new CliError("validation_error", `"${singleLine(reference2)}" is not a message locator \u2014 expected msg:<provider>/<account>/<chat>/<message>`);
|
|
3546
|
+
}
|
|
3547
|
+
const [provider, account, chat, message] = parts2.map(decodeURIComponent);
|
|
3548
|
+
return { provider, account, chat, message };
|
|
3549
|
+
}, "parseLocator");
|
|
3550
|
+
|
|
3551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
3552
|
+
var SIMPLE_REFERENCES = [
|
|
3553
|
+
"note",
|
|
3554
|
+
"document",
|
|
3555
|
+
"person",
|
|
3556
|
+
"organization",
|
|
3557
|
+
"project",
|
|
3558
|
+
"task",
|
|
3559
|
+
"memory",
|
|
3560
|
+
"fact",
|
|
3561
|
+
"bot",
|
|
3562
|
+
"event",
|
|
3563
|
+
"invoice",
|
|
3564
|
+
"payment",
|
|
3565
|
+
"order",
|
|
3566
|
+
"deal",
|
|
3567
|
+
"lead",
|
|
3568
|
+
"pipeline",
|
|
3569
|
+
"product",
|
|
3570
|
+
"contract",
|
|
3571
|
+
"subscription",
|
|
3572
|
+
"wallet",
|
|
3573
|
+
"transaction",
|
|
3574
|
+
"entity"
|
|
3575
|
+
];
|
|
3576
|
+
var malformed = /* @__PURE__ */ __name((text6, shape) => new CliError("validation_error", `"${singleLine(text6)}" is not a reference \u2014 expected ${shape}`, {
|
|
3577
|
+
reason: "ref.malformed"
|
|
3578
|
+
}), "malformed");
|
|
3579
|
+
var parts = /* @__PURE__ */ __name((rest, count7, text6, shape) => {
|
|
3580
|
+
const split = rest.split("/");
|
|
3581
|
+
if (split.length !== count7 || split.some((part) => part === ""))
|
|
3582
|
+
throw malformed(text6, shape);
|
|
3583
|
+
return split.map(decodeURIComponent);
|
|
3584
|
+
}, "parts");
|
|
3585
|
+
var encoded = /* @__PURE__ */ __name((...values) => values.map(encodeURIComponent).join("/"), "encoded");
|
|
3586
|
+
var folderPath = /* @__PURE__ */ __name((path) => {
|
|
3587
|
+
const clean = path.split("/").filter((part) => part !== "" && part !== ".").join("/");
|
|
3588
|
+
return clean === "" ? path.trim() === "" ? "" : null : clean;
|
|
3589
|
+
}, "folderPath");
|
|
3590
|
+
var MEETING_SHAPE = "meeting:<account>/<meeting>[/<transcript>[/<cue>]] with safe integer ids";
|
|
3591
|
+
var kind = /* @__PURE__ */ __name((spec) => spec, "kind");
|
|
3592
|
+
var simple = /* @__PURE__ */ __name((prefix) => kind({
|
|
3593
|
+
prefix,
|
|
3594
|
+
type: prefix,
|
|
3595
|
+
shape: `${prefix}:<id>`,
|
|
3596
|
+
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
3597
|
+
if (!rest.trim())
|
|
3598
|
+
throw new CliError("validation_error", `"${singleLine(text6)}" names no ${prefix}`, {
|
|
3599
|
+
reason: "ref.malformed"
|
|
3600
|
+
});
|
|
3601
|
+
return { type: prefix, id: rest };
|
|
3602
|
+
}, "parse"),
|
|
3603
|
+
format: /* @__PURE__ */ __name((reference2) => `${reference2.type}:${reference2.id}`, "format")
|
|
3604
|
+
}), "simple");
|
|
3605
|
+
var REF_KINDS = [
|
|
3606
|
+
kind({
|
|
3607
|
+
prefix: "msg",
|
|
3608
|
+
type: "message",
|
|
3609
|
+
shape: "msg:<provider>/<account>/<chat>/<message>",
|
|
3610
|
+
parse: /* @__PURE__ */ __name((_, text6) => {
|
|
3611
|
+
try {
|
|
3612
|
+
return { type: "message", ...parseLocator(text6) };
|
|
3613
|
+
} catch {
|
|
3614
|
+
throw malformed(text6, "msg:<provider>/<account>/<chat>/<message>");
|
|
3615
|
+
}
|
|
3616
|
+
}, "parse"),
|
|
3617
|
+
format: formatLocator
|
|
3618
|
+
}),
|
|
3619
|
+
kind({
|
|
3620
|
+
prefix: "chat",
|
|
3621
|
+
type: "chat",
|
|
3622
|
+
shape: "chat:<provider>/<account>/<chat>",
|
|
3623
|
+
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
3624
|
+
const [provider, account, chat] = parts(rest, 3, text6, "chat:<provider>/<account>/<chat>");
|
|
3625
|
+
return { type: "chat", provider, account, chat };
|
|
3626
|
+
}, "parse"),
|
|
3627
|
+
format: /* @__PURE__ */ __name(({ provider, account, chat }) => `chat:${encoded(provider, account, chat)}`, "format")
|
|
3628
|
+
}),
|
|
3629
|
+
kind({
|
|
3630
|
+
prefix: "contact",
|
|
3631
|
+
type: "contact",
|
|
3632
|
+
shape: "contact:<provider>/<id>",
|
|
3633
|
+
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
3634
|
+
const [provider, id4] = parts(rest, 2, text6, "contact:<provider>/<id>");
|
|
3635
|
+
return { type: "contact", provider, id: id4 };
|
|
3636
|
+
}, "parse"),
|
|
3637
|
+
format: /* @__PURE__ */ __name(({ provider, id: id4 }) => `contact:${encoded(provider, id4)}`, "format")
|
|
3638
|
+
}),
|
|
3639
|
+
kind({
|
|
3640
|
+
prefix: "folder",
|
|
3641
|
+
type: "folder",
|
|
3642
|
+
shape: "folder:<id>[/<path>]",
|
|
3643
|
+
parse: /* @__PURE__ */ __name((rest, text6) => {
|
|
3644
|
+
const slash = rest.indexOf("/");
|
|
3645
|
+
const id4 = decodeURIComponent(slash < 0 ? rest : rest.slice(0, slash));
|
|
3646
|
+
const path = slash < 0 ? null : folderPath(decodeURIComponent(rest.slice(slash + 1)));
|
|
3647
|
+
if (!id4.trim() || path === "")
|
|
3648
|
+
throw malformed(text6, "folder:<id>[/<path>]");
|
|
3649
|
+
return { type: "folder", id: id4, path };
|
|
3650
|
+
}, "parse"),
|
|
3651
|
+
format: /* @__PURE__ */ __name(({ id: id4, path }) => path === null ? `folder:${encodeURIComponent(id4)}` : `folder:${encoded(id4, path)}`, "format")
|
|
3652
|
+
}),
|
|
3653
|
+
kind({
|
|
3654
|
+
prefix: "meeting",
|
|
3655
|
+
type: "meeting",
|
|
3656
|
+
shape: MEETING_SHAPE,
|
|
3657
|
+
parse: /* @__PURE__ */ __name((_, text6) => {
|
|
3658
|
+
try {
|
|
3659
|
+
return parseMeetingReference(text6);
|
|
3660
|
+
} catch {
|
|
3661
|
+
throw malformed(text6, MEETING_SHAPE);
|
|
3662
|
+
}
|
|
3663
|
+
}, "parse"),
|
|
3664
|
+
format: formatMeetingReference
|
|
3665
|
+
}),
|
|
3666
|
+
...SIMPLE_REFERENCES.map(simple)
|
|
3667
|
+
];
|
|
3668
|
+
var byPrefix = new Map(REF_KINDS.map((spec) => [spec.prefix, spec]));
|
|
3669
|
+
var byType = new Map(REF_KINDS.map((spec) => [spec.type, spec]));
|
|
3670
|
+
var offered = REF_KINDS.map(({ prefix }) => prefix).filter((prefix) => prefix !== "entity");
|
|
3671
|
+
var distance = /* @__PURE__ */ __name((a, b) => {
|
|
3672
|
+
let row = Array.from({ length: b.length + 1 }, (_, at) => at);
|
|
3673
|
+
for (const [i, x] of [...a].entries()) {
|
|
3674
|
+
const next = [i + 1];
|
|
3675
|
+
for (const [j, y] of [...b].entries())
|
|
3676
|
+
next.push(Math.min(row[j + 1] + 1, next[j] + 1, row[j] + (x === y ? 0 : 1)));
|
|
3677
|
+
row = next;
|
|
3678
|
+
}
|
|
3679
|
+
return row[b.length];
|
|
3680
|
+
}, "distance");
|
|
3681
|
+
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");
|
|
3682
|
+
var unknownKind = /* @__PURE__ */ __name((text6, prefix, rest) => {
|
|
3683
|
+
const near2 = prefix === "" ? void 0 : nearest(prefix);
|
|
3684
|
+
const kinds = offered.map((one) => `${one}:`).join(", ");
|
|
3685
|
+
const hint = near2 === void 0 ? `; kinds: ${kinds}` : `; did you mean ${near2}:${singleLine(rest)}? Kinds: ${kinds}`;
|
|
3686
|
+
return new CliError("validation_error", `"${singleLine(text6)}" is no kind of reference${hint}`, {
|
|
3687
|
+
reason: "ref.unknown-kind"
|
|
3688
|
+
});
|
|
3689
|
+
}, "unknownKind");
|
|
3690
|
+
var formatReference = /* @__PURE__ */ __name((reference2) => byType.get(reference2.type).format(reference2), "formatReference");
|
|
3691
|
+
var parseReference = /* @__PURE__ */ __name((text6) => {
|
|
3692
|
+
const reference2 = text6.trim();
|
|
3693
|
+
const colon = reference2.indexOf(":");
|
|
3694
|
+
const prefix = colon < 0 ? "" : reference2.slice(0, colon);
|
|
3695
|
+
const rest = reference2.slice(colon + 1);
|
|
3696
|
+
const spec = byPrefix.get(prefix);
|
|
3697
|
+
if (!spec)
|
|
3698
|
+
throw unknownKind(reference2, prefix, rest);
|
|
3699
|
+
return spec.parse(rest, reference2);
|
|
3700
|
+
}, "parseReference");
|
|
3701
|
+
var canonicalReference = /* @__PURE__ */ __name((text6) => formatReference(parseReference(text6)), "canonicalReference");
|
|
3702
|
+
var looksLikeReference = /* @__PURE__ */ __name((text6) => {
|
|
3703
|
+
const match = /^([a-z]+):\S+$/.exec(text6.trim());
|
|
3704
|
+
return match !== null && byPrefix.has(match[1]);
|
|
3705
|
+
}, "looksLikeReference");
|
|
3706
|
+
|
|
3707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
3708
|
+
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
|
|
3709
|
+
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
3710
|
+
var PROVIDERS = [
|
|
3711
|
+
{ name: "telegram", kind: "messages", aliases: ["tg"], command: "tg", opens: MESSENGER_OPENS },
|
|
3712
|
+
{ name: "telegram-bot", kind: "messages", aliases: ["tg-bot"] },
|
|
3713
|
+
{ name: "max", kind: "messages", aliases: [], command: "max", opens: MESSENGER_OPENS },
|
|
3714
|
+
{ name: "max-bot", kind: "messages", aliases: [] },
|
|
3715
|
+
{ name: "whatsapp", kind: "messages", aliases: ["wa"], command: "wa", opens: MESSENGER_OPENS },
|
|
3716
|
+
{ name: "whatsapp-bot", kind: "messages", aliases: ["wa-bot"] },
|
|
3717
|
+
{ name: "email", kind: "mail", aliases: [] },
|
|
3718
|
+
{ name: "notes", kind: "notes", aliases: [] },
|
|
3719
|
+
{ name: "local", kind: "notes", aliases: [] },
|
|
3720
|
+
{ name: "obsidian", kind: "notes", aliases: [] },
|
|
3721
|
+
{ name: "added", kind: "notes", aliases: [] },
|
|
3722
|
+
{ name: "zoom", kind: "meetings", aliases: [] },
|
|
3723
|
+
// A phone export's records: its SMS and its calls in the one account the import names.
|
|
3724
|
+
{ name: "phone", kind: "messages", kinds: ["messages", "events"], aliases: [], imported: true }
|
|
3725
|
+
];
|
|
3726
|
+
var LABELS = {
|
|
3727
|
+
telegram: "Telegram",
|
|
3728
|
+
"telegram-bot": "Telegram bot",
|
|
3729
|
+
max: "MAX",
|
|
3730
|
+
"max-bot": "MAX bot",
|
|
3731
|
+
whatsapp: "WhatsApp",
|
|
3732
|
+
"whatsapp-bot": "WhatsApp bot",
|
|
3733
|
+
"google-drive": "Google Drive",
|
|
3734
|
+
added: "added by hand",
|
|
3735
|
+
email: "mail"
|
|
3393
3736
|
};
|
|
3394
|
-
var
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
var
|
|
3398
|
-
var
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
}
|
|
3404
|
-
var
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
}, "
|
|
3411
|
-
var
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
const
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
var
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
const
|
|
3434
|
-
|
|
3435
|
-
}
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
}
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
}
|
|
3449
|
-
|
|
3737
|
+
var providerLabel = /* @__PURE__ */ __name((provider) => LABELS[provider] ?? provider, "providerLabel");
|
|
3738
|
+
var FOLDER_PROVIDERS = ["local", "obsidian", "folder"];
|
|
3739
|
+
var isFolderProvider = /* @__PURE__ */ __name((provider) => FOLDER_PROVIDERS.includes(provider), "isFolderProvider");
|
|
3740
|
+
var folderProviderSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${FOLDER_PROVIDERS.map((name) => `'${name}'`).join(", ")})`, "folderProviderSql");
|
|
3741
|
+
var folderProviderOf = /* @__PURE__ */ __name((format) => format === "markdown" ? "local" : "obsidian", "folderProviderOf");
|
|
3742
|
+
var DOCUMENT_ACCOUNT_PROVIDERS = ["google-drive"];
|
|
3743
|
+
var isDocumentAccountProvider = /* @__PURE__ */ __name((provider) => DOCUMENT_ACCOUNT_PROVIDERS.includes(provider), "isDocumentAccountProvider");
|
|
3744
|
+
var ADDED_PROVIDER = "added";
|
|
3745
|
+
var ADDED_ACCOUNT = "owner";
|
|
3746
|
+
var notAdded = `d.account_id NOT IN (SELECT id FROM accounts WHERE provider = '${ADDED_PROVIDER}')`;
|
|
3747
|
+
var filesAccountSql = /* @__PURE__ */ __name((column = "provider") => `${column} IN (${[...FOLDER_PROVIDERS, ...DOCUMENT_ACCOUNT_PROVIDERS, ADDED_PROVIDER].map((name) => `'${name}'`).join(", ")})`, "filesAccountSql");
|
|
3748
|
+
var INTERNAL_NOTES = "internal";
|
|
3749
|
+
var UNKNOWN_PROVIDER = "unknown provider \u2014 run its CLI once";
|
|
3750
|
+
var WORD = /^[a-z0-9][a-z0-9_-]*$/;
|
|
3751
|
+
var invalid5 = /* @__PURE__ */ __name((message) => {
|
|
3752
|
+
throw new CliError("validation_error", message);
|
|
3753
|
+
}, "invalid");
|
|
3754
|
+
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");
|
|
3755
|
+
var OPEN_KINDS = new Set(REF_KINDS.map(({ type }) => type).filter((type) => type !== "entity"));
|
|
3756
|
+
var COMMAND_WORDS = /^[a-z0-9][a-z0-9_-]*( [a-z0-9][a-z0-9_-]*)*$/;
|
|
3757
|
+
var opensOf = /* @__PURE__ */ __name((value, named) => {
|
|
3758
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
3759
|
+
return invalid5(`provider ${named}'s opens maps a kind of reference to a command`);
|
|
3760
|
+
const known = Object.entries(value).filter(([kind2]) => OPEN_KINDS.has(kind2));
|
|
3761
|
+
for (const [kind2, command] of known)
|
|
3762
|
+
if (typeof command !== "string" || !COMMAND_WORDS.test(command))
|
|
3763
|
+
invalid5(`provider ${named} opens a ${kind2} with command words, not ${JSON.stringify(command)}`);
|
|
3764
|
+
return Object.fromEntries(known);
|
|
3765
|
+
}, "opensOf");
|
|
3766
|
+
var providerEntryOf = /* @__PURE__ */ __name((value) => {
|
|
3767
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
3768
|
+
return invalid5("a provider entry is an object");
|
|
3769
|
+
const { name, kind: kind2, kinds, aliases = [], command, opens, imported } = value;
|
|
3770
|
+
const named = wordOf(name, "a provider's name");
|
|
3771
|
+
const isKindWord = /* @__PURE__ */ __name((one) => typeof one === "string" && KINDS.includes(one), "isKindWord");
|
|
3772
|
+
const given = kinds === void 0 ? [kind2] : Array.isArray(kinds) && kinds.length > 0 ? kinds : [void 0];
|
|
3773
|
+
for (const one of given)
|
|
3774
|
+
if (!isKindWord(one))
|
|
3775
|
+
invalid5(`provider ${named}'s kind is one of ${KINDS.join(", ")} \u2014 not ${JSON.stringify(one)}`);
|
|
3776
|
+
const list = [...new Set(given)];
|
|
3777
|
+
if (kind2 !== void 0 && kind2 !== list[0])
|
|
3778
|
+
invalid5(`provider ${named}'s kind is the first of its kinds`);
|
|
3779
|
+
if (!Array.isArray(aliases))
|
|
3780
|
+
invalid5(`provider ${named}'s aliases are a list`);
|
|
3781
|
+
if (imported !== void 0 && typeof imported !== "boolean")
|
|
3782
|
+
invalid5(`provider ${named}'s imported is true or false`);
|
|
3783
|
+
return {
|
|
3784
|
+
name: named,
|
|
3785
|
+
kind: list[0],
|
|
3786
|
+
...list.length > 1 ? { kinds: list } : {},
|
|
3787
|
+
...imported === true ? { imported: true } : {},
|
|
3788
|
+
aliases: [...new Set(aliases.map((alias) => wordOf(alias, `an alias of ${named}`)))],
|
|
3789
|
+
...command === void 0 ? {} : { command: wordOf(command, `the command of ${named}`) },
|
|
3790
|
+
...opens === void 0 ? {} : { opens: opensOf(opens, named) }
|
|
3791
|
+
};
|
|
3792
|
+
}, "providerEntryOf");
|
|
3793
|
+
var kindsOfEntry = /* @__PURE__ */ __name((entry) => entry.kinds ?? [entry.kind], "kindsOfEntry");
|
|
3794
|
+
var describe = /* @__PURE__ */ __name((entry) => `${entry.name} (${kindsOfEntry(entry).join(", ")}${entry.command ? `, from ${entry.command}` : ""})`, "describe");
|
|
3795
|
+
var unitedKinds = /* @__PURE__ */ __name((known, entry) => [
|
|
3796
|
+
.../* @__PURE__ */ new Set([...known, ...entry])
|
|
3797
|
+
], "unitedKinds");
|
|
3798
|
+
var wordsOf2 = /* @__PURE__ */ __name(({ name, aliases }) => [name, ...aliases], "wordsOf");
|
|
3799
|
+
var joined = /* @__PURE__ */ __name((known, entry) => {
|
|
3800
|
+
const same = known.find(({ name }) => name === entry.name);
|
|
3801
|
+
const kinds = same ? unitedKinds(kindsOfEntry(same), kindsOfEntry(entry)) : kindsOfEntry(entry);
|
|
3802
|
+
if (same && same.kind !== entry.kind)
|
|
3803
|
+
invalid5(`two provider entries disagree on the kind: ${describe(same)} and ${describe(entry)}`);
|
|
3804
|
+
if (same && entry.imported === true && same.imported !== true)
|
|
3805
|
+
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
3806
|
+
const merged = same ? {
|
|
3807
|
+
...same,
|
|
3808
|
+
...kinds.length > 1 ? { kinds } : {},
|
|
3809
|
+
aliases: [.../* @__PURE__ */ new Set([...same.aliases, ...entry.aliases])],
|
|
3810
|
+
...entry.command ? { command: entry.command } : {},
|
|
3811
|
+
...entry.opens ? { opens: { ...same.opens, ...entry.opens } } : {}
|
|
3812
|
+
} : entry;
|
|
3813
|
+
const others = known.filter((one) => one !== same);
|
|
3814
|
+
for (const word of wordsOf2(merged)) {
|
|
3815
|
+
const owner = others.find((one) => wordsOf2(one).includes(word));
|
|
3816
|
+
if (owner)
|
|
3817
|
+
invalid5(`"${word}" names two providers: ${describe(owner)} and ${describe(merged)}`);
|
|
3818
|
+
}
|
|
3819
|
+
return same ? known.map((one) => one === same ? merged : one) : [...known, merged];
|
|
3820
|
+
}, "joined");
|
|
3821
|
+
var registry = PROVIDERS;
|
|
3822
|
+
var providers = /* @__PURE__ */ __name(() => registry, "providers");
|
|
3823
|
+
var useStoredProviders = /* @__PURE__ */ __name((entries) => {
|
|
3824
|
+
const left = [];
|
|
3825
|
+
registry = entries.reduce((known, entry) => {
|
|
3826
|
+
try {
|
|
3827
|
+
return joined(known, providerEntryOf(entry));
|
|
3828
|
+
} catch (error) {
|
|
3829
|
+
if (!(error instanceof CliError))
|
|
3830
|
+
throw error;
|
|
3831
|
+
left.push(entry);
|
|
3832
|
+
return known;
|
|
3833
|
+
}
|
|
3834
|
+
}, PROVIDERS);
|
|
3835
|
+
return left;
|
|
3836
|
+
}, "useStoredProviders");
|
|
3837
|
+
var addProvider = /* @__PURE__ */ __name((entry) => {
|
|
3838
|
+
registry = joined(registry, providerEntryOf(entry));
|
|
3839
|
+
}, "addProvider");
|
|
3840
|
+
var isKind = /* @__PURE__ */ __name((word) => KINDS.includes(word.toLowerCase()), "isKind");
|
|
3841
|
+
var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
3842
|
+
const wanted = word.toLowerCase();
|
|
3843
|
+
return registry.find((entry) => wordsOf2(entry).includes(wanted));
|
|
3844
|
+
}, "providerNamed");
|
|
3845
|
+
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
3846
|
+
var kindsIn = /* @__PURE__ */ __name((provider) => {
|
|
3847
|
+
if (isFolderProvider(provider))
|
|
3848
|
+
return ["notes"];
|
|
3849
|
+
const entry = registry.find(({ name }) => name === provider);
|
|
3850
|
+
return entry ? kindsOfEntry(entry) : [];
|
|
3851
|
+
}, "kindsIn");
|
|
3852
|
+
var importedOf = /* @__PURE__ */ __name((entry, held) => {
|
|
3853
|
+
const builtIn = PROVIDERS.find(({ name }) => name === entry.name);
|
|
3854
|
+
if (builtIn) {
|
|
3855
|
+
if (entry.imported === true && builtIn.imported !== true)
|
|
3856
|
+
invalid5(`provider ${entry.name} is synced, so an entry cannot make it import-only`);
|
|
3857
|
+
return builtIn.imported === true;
|
|
3858
|
+
}
|
|
3859
|
+
if (held === void 0)
|
|
3860
|
+
return entry.imported === true;
|
|
3861
|
+
if (entry.imported === true && held.imported !== true)
|
|
3862
|
+
invalid5(`provider ${entry.name} was registered without imported: an entry cannot make it import-only later`);
|
|
3863
|
+
return held.imported === true;
|
|
3864
|
+
}, "importedOf");
|
|
3865
|
+
var isImportedProvider = /* @__PURE__ */ __name((provider) => registry.find(({ name }) => name === provider)?.imported === true, "isImportedProvider");
|
|
3866
|
+
var holdsKind = /* @__PURE__ */ __name((provider, kind2) => kindsIn(provider).includes(kind2), "holdsKind");
|
|
3867
|
+
var holdsKindOf = /* @__PURE__ */ __name((provider, kind2) => kindIn(provider) === void 0 ? kind2 === "messages" : holdsKind(provider, kind2), "holdsKindOf");
|
|
3868
|
+
var kindOf2 = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
3450
3869
|
|
|
3451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3452
|
-
var
|
|
3453
|
-
var
|
|
3454
|
-
var
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
}, "notes");
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
return `${
|
|
3472
|
-
}, "
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
var
|
|
3478
|
-
var
|
|
3870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
3871
|
+
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
3872
|
+
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");
|
|
3873
|
+
var fail = /* @__PURE__ */ __name((message) => {
|
|
3874
|
+
throw new CliError("validation_error", message);
|
|
3875
|
+
}, "fail");
|
|
3876
|
+
var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
3877
|
+
const sources = [...providers2, "personal", "bots", "all"];
|
|
3878
|
+
const source = value.toLowerCase();
|
|
3879
|
+
if (sources.includes(source))
|
|
3880
|
+
return source;
|
|
3881
|
+
if (source === "mail")
|
|
3882
|
+
return "email";
|
|
3883
|
+
if (source === "messages")
|
|
3884
|
+
return source;
|
|
3885
|
+
if (isKind(source))
|
|
3886
|
+
fail(`${name}${source} names ${source}, which a message search does not read \u2014 search ${source === "meetings" || source === "events" ? `all --source ${source}` : "notes"} does`);
|
|
3887
|
+
const named = providerNamed(source);
|
|
3888
|
+
if (named && providers2.includes(named.name))
|
|
3889
|
+
return named.name;
|
|
3890
|
+
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
3891
|
+
}, "sourceOf");
|
|
3892
|
+
|
|
3893
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
3894
|
+
var ACCOUNT_GROUPS = "accountGroups";
|
|
3895
|
+
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
3896
|
+
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
3897
|
+
var fail2 = /* @__PURE__ */ __name((message) => {
|
|
3898
|
+
throw new CliError("validation_error", message);
|
|
3899
|
+
}, "fail");
|
|
3900
|
+
var isAccountList = /* @__PURE__ */ __name((value) => value.includes(",") || value.includes(":"), "isAccountList");
|
|
3901
|
+
var itemsOf = /* @__PURE__ */ __name((value) => {
|
|
3902
|
+
const items = value.split(",").map((item) => item.trim());
|
|
3903
|
+
if (items.some((item) => item === ""))
|
|
3904
|
+
fail2(`"${value}" has an empty entry \u2014 separate accounts with one comma`);
|
|
3905
|
+
return items;
|
|
3906
|
+
}, "itemsOf");
|
|
3907
|
+
var isGroupName = /* @__PURE__ */ __name((name) => GROUP_NAME.test(name), "isGroupName");
|
|
3908
|
+
var groupName = /* @__PURE__ */ __name((name) => isGroupName(name) ? name : fail2(`a group name is letters, digits, - and _ \u2014 not "${name}"`), "groupName");
|
|
3909
|
+
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");
|
|
3910
|
+
var describe2 = /* @__PURE__ */ __name((accounts) => accounts.map(({ provider, account, name }) => `${provider}:${account}${name ? ` (${name})` : ""}`).join(", "), "describe");
|
|
3911
|
+
var listedHolds = /* @__PURE__ */ __name((account, kind2) => (account.kinds ?? (account.kind === void 0 ? [] : [account.kind])).includes(kind2), "listedHolds");
|
|
3912
|
+
var kindHere = /* @__PURE__ */ __name((provider, running) => provider === running.provider ? kindOf2(provider) : kindIn(provider), "kindHere");
|
|
3913
|
+
var kindsOfHere = /* @__PURE__ */ __name((provider, running) => {
|
|
3914
|
+
const kinds = kindsIn(provider);
|
|
3915
|
+
return { kind: kindHere(provider, running), ...kinds.length > 1 ? { kinds } : {} };
|
|
3916
|
+
}, "kindsOfHere");
|
|
3917
|
+
var heldOf = /* @__PURE__ */ __name((stored, running) => [
|
|
3918
|
+
...stored.filter(({ provider }) => kindIn(provider) !== "notes" && !isDocumentAccountProvider(provider)).map(({ provider, account, name }) => ({ provider, account, name, ...kindsOfHere(provider, running) })),
|
|
3919
|
+
{ provider: "notes", account: INTERNAL_NOTES, name: null, kind: "notes" },
|
|
3920
|
+
...stored.filter(({ provider }) => isFolderProvider(provider)).map(({ id: id4, name, provider, account }) => ({
|
|
3921
|
+
provider: "notes",
|
|
3922
|
+
account: String(id4),
|
|
3923
|
+
name,
|
|
3924
|
+
kind: "notes",
|
|
3925
|
+
stored: { provider, account }
|
|
3926
|
+
})),
|
|
3927
|
+
...stored.filter(({ provider }) => isDocumentAccountProvider(provider) || provider === ADDED_PROVIDER).map(({ id: id4, provider, account, name }) => ({
|
|
3928
|
+
provider: "notes",
|
|
3929
|
+
account: String(id4),
|
|
3930
|
+
name,
|
|
3931
|
+
kind: "notes",
|
|
3932
|
+
stored: { provider, account }
|
|
3933
|
+
}))
|
|
3934
|
+
], "heldOf");
|
|
3935
|
+
var storedAs = /* @__PURE__ */ __name((held, key) => held.filter(({ stored }) => stored?.provider === key.provider && (key.account === "" || stored.account === key.account)), "storedAs");
|
|
3936
|
+
var registry2 = /* @__PURE__ */ __name(() => providers().map(({ name, aliases }) => aliases.length ? `${name} (${aliases.join(", ")})` : name).join(", "), "registry");
|
|
3937
|
+
var providerOf = /* @__PURE__ */ __name((prefix, held, { running, profiles }) => {
|
|
3938
|
+
const wanted = prefix.toLowerCase();
|
|
3939
|
+
if (wanted === running.command?.toLowerCase())
|
|
3940
|
+
return running.provider;
|
|
3941
|
+
const providers2 = [...new Set(held.map(({ provider }) => provider))];
|
|
3942
|
+
if (providers2.includes(wanted) || isDocumentAccountProvider(wanted))
|
|
3943
|
+
return wanted;
|
|
3944
|
+
const named = providerNamed(wanted);
|
|
3945
|
+
if (named)
|
|
3946
|
+
return named.name;
|
|
3947
|
+
const recorded = Object.values(profiles[wanted] ?? {})[0];
|
|
3948
|
+
if (recorded)
|
|
3949
|
+
return recorded.provider;
|
|
3950
|
+
return fail2(`${prefix} is not a provider \u2014 they are ${registry2()}; the store holds ${providers2.join(", ")}`);
|
|
3951
|
+
}, "providerOf");
|
|
3952
|
+
var profilesOf = /* @__PURE__ */ __name((provider, profiles) => Object.values(profiles).flatMap((named) => Object.entries(named).filter(([, key]) => key.provider === provider)), "profilesOf");
|
|
3953
|
+
var accountOf = /* @__PURE__ */ __name((prefix, ref, held, context3) => {
|
|
3954
|
+
const provider = providerOf(prefix, held, context3);
|
|
3955
|
+
if (isDocumentAccountProvider(provider) && !context3.profiles[prefix.toLowerCase()]?.[ref]) {
|
|
3956
|
+
const stored = storedAs(held, { provider, account: ref })[0];
|
|
3957
|
+
if (stored)
|
|
3958
|
+
return stored;
|
|
3959
|
+
}
|
|
3960
|
+
const folder = isFolderProvider(provider);
|
|
3961
|
+
const ofProvider = folder ? storedAs(held, { provider, account: "" }) : held.filter((one) => one.provider === provider);
|
|
3962
|
+
const byId = ofProvider.find(({ account, stored }) => account === ref || account === ref.toLowerCase() || folder && stored?.account === ref.toUpperCase());
|
|
3963
|
+
if (byId)
|
|
3964
|
+
return byId;
|
|
3965
|
+
const keyed = /* @__PURE__ */ __name((key) => ofProvider.find(({ account }) => account === key.account) ?? {
|
|
3966
|
+
...key,
|
|
3967
|
+
name: null,
|
|
3968
|
+
...kindsOfHere(key.provider, context3.running)
|
|
3969
|
+
}, "keyed");
|
|
3970
|
+
const recorded = context3.profiles[prefix.toLowerCase()]?.[ref];
|
|
3971
|
+
if (recorded && isFolderProvider(recorded.provider)) {
|
|
3972
|
+
const folder2 = held.find((one) => one.provider === "notes" && one.name === recorded.account);
|
|
3973
|
+
if (folder2)
|
|
3974
|
+
return folder2;
|
|
3975
|
+
return fail2(`no stored folder for ${prefix}:${ref}; sync that profile first`);
|
|
3976
|
+
}
|
|
3977
|
+
if (recorded && isDocumentAccountProvider(recorded.provider)) {
|
|
3978
|
+
const account = storedAs(held, recorded)[0];
|
|
3979
|
+
if (account)
|
|
3980
|
+
return account;
|
|
3981
|
+
return fail2(`no stored documents for ${prefix}:${ref}; sync that profile first`);
|
|
3982
|
+
}
|
|
3983
|
+
if (recorded)
|
|
3984
|
+
return keyed(recorded);
|
|
3985
|
+
const byProfile = [
|
|
3986
|
+
...new Map(profilesOf(provider, context3.profiles).filter(([name]) => name === ref).map(([, key]) => [key.account, key])).values()
|
|
3987
|
+
];
|
|
3988
|
+
if (byProfile.length === 1)
|
|
3989
|
+
return keyed(byProfile[0]);
|
|
3990
|
+
const byName = ofProvider.filter(({ name }) => name?.toLowerCase() === ref.toLowerCase());
|
|
3991
|
+
if (byName.length === 1)
|
|
3992
|
+
return byName[0];
|
|
3993
|
+
if (byName.length > 1 || byProfile.length > 1)
|
|
3994
|
+
fail2(`${provider}:${ref} names more than one account \u2014 use the id: ${describe2(ofProvider)}`);
|
|
3995
|
+
const names = profilesOf(provider, context3.profiles).map(([name]) => name);
|
|
3996
|
+
return fail2(`no ${provider} account "${ref}" \u2014 the store holds ${describe2(ofProvider) || "none"}` + (names.length ? `; profiles: ${[...new Set(names)].join(", ")}` : ""));
|
|
3997
|
+
}, "accountOf");
|
|
3998
|
+
var accountsOfWord = /* @__PURE__ */ __name((word, held, context3) => {
|
|
3999
|
+
const wanted = word.toLowerCase();
|
|
4000
|
+
if (wanted === "all")
|
|
4001
|
+
return [...held];
|
|
4002
|
+
if (wanted === "personal" || wanted === "bots")
|
|
4003
|
+
return held.filter((one) => listedHolds(one, "messages") && isBotProvider(one.provider) === (wanted === "bots"));
|
|
4004
|
+
if (isKind(wanted))
|
|
4005
|
+
return held.filter((one) => listedHolds(one, wanted));
|
|
4006
|
+
const recorded = context3.profiles[wanted];
|
|
4007
|
+
if (recorded && Object.values(recorded).every((key) => isFolderProvider(key.provider) || isDocumentAccountProvider(key.provider)))
|
|
4008
|
+
return Object.keys(recorded).map((profile) => accountOf(word, profile, held, context3));
|
|
4009
|
+
const provider = providerOf(word, held, context3);
|
|
4010
|
+
if (isDocumentAccountProvider(provider) || isFolderProvider(provider))
|
|
4011
|
+
return storedAs(held, { provider, account: "" });
|
|
4012
|
+
return held.filter((one) => one.provider === provider);
|
|
4013
|
+
}, "accountsOfWord");
|
|
4014
|
+
var keyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "keyOf");
|
|
4015
|
+
var sourceOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "sourceOf");
|
|
4016
|
+
var sameAs = /* @__PURE__ */ __name((key) => (one) => one.provider === key.provider && one.account === key.account, "sameAs");
|
|
4017
|
+
var entriesOfList = /* @__PURE__ */ __name((value, context3) => {
|
|
4018
|
+
const held = heldOf(context3.held, context3.running);
|
|
4019
|
+
const entries = [];
|
|
4020
|
+
const entry = /* @__PURE__ */ __name((item, group) => {
|
|
4021
|
+
const colon = item.indexOf(":");
|
|
4022
|
+
if (colon === -1) {
|
|
4023
|
+
try {
|
|
4024
|
+
entries.push({ entry: item, accounts: accountsOfWord(item, held, context3) });
|
|
4025
|
+
} catch (error) {
|
|
4026
|
+
if (!group || !(error instanceof CliError))
|
|
4027
|
+
throw error;
|
|
4028
|
+
fail2(`"${item}" in group ${group}: ${error.message}`);
|
|
4029
|
+
}
|
|
4030
|
+
return;
|
|
4031
|
+
}
|
|
4032
|
+
const prefix = item.slice(0, colon);
|
|
4033
|
+
const ref = item.slice(colon + 1).trim();
|
|
4034
|
+
if (ref === "")
|
|
4035
|
+
fail2(`"${item}" names no account after the colon`);
|
|
4036
|
+
if (prefix.toLowerCase() === "group") {
|
|
4037
|
+
if (group)
|
|
4038
|
+
fail2(`group ${group} lists another group \u2014 a group lists accounts`);
|
|
4039
|
+
const members = context3.groups[ref];
|
|
4040
|
+
if (!members) {
|
|
4041
|
+
const known = Object.keys(context3.groups);
|
|
4042
|
+
fail2(`no account group "${ref}" \u2014 ${known.length ? `there are ${known.join(", ")}` : "none saved yet"}; \`config set ${ACCOUNT_GROUPS_SETTING}.${ref} <accounts>\` saves one`);
|
|
4043
|
+
}
|
|
4044
|
+
for (const member of members)
|
|
4045
|
+
entry(member, ref);
|
|
4046
|
+
return;
|
|
4047
|
+
}
|
|
4048
|
+
entries.push({ entry: item, accounts: [accountOf(prefix, ref, held, context3)] });
|
|
4049
|
+
}, "entry");
|
|
4050
|
+
for (const item of itemsOf(value))
|
|
4051
|
+
entry(item);
|
|
4052
|
+
const { only } = context3;
|
|
4053
|
+
return entries.map(({ entry: entry2, accounts }) => ({
|
|
4054
|
+
entry: entry2,
|
|
4055
|
+
accounts: accounts.filter((one) => only === void 0 || only.has(keyOf(one))).map(({ provider, account, kind: kind2, kinds }) => ({
|
|
4056
|
+
provider,
|
|
4057
|
+
account,
|
|
4058
|
+
kind: kind2,
|
|
4059
|
+
...kinds === void 0 ? {} : { kinds }
|
|
4060
|
+
}))
|
|
4061
|
+
}));
|
|
4062
|
+
}, "entriesOfList");
|
|
4063
|
+
var accountsOfList = /* @__PURE__ */ __name((value, context3) => {
|
|
4064
|
+
const chosen = /* @__PURE__ */ new Map();
|
|
4065
|
+
for (const { accounts } of entriesOfList(value, context3))
|
|
4066
|
+
for (const one of accounts)
|
|
4067
|
+
if (!chosen.has(keyOf(one)))
|
|
4068
|
+
chosen.set(keyOf(one), one);
|
|
4069
|
+
return [...chosen.values()];
|
|
4070
|
+
}, "accountsOfList");
|
|
4071
|
+
var READS = {
|
|
4072
|
+
messages: "messenger messages \u2014 search messages reads them",
|
|
4073
|
+
mail: "a mailbox \u2014 memo search mail reads it",
|
|
4074
|
+
notes: "notes \u2014 search notes reads them",
|
|
4075
|
+
documents: "documents \u2014 search notes reads them",
|
|
4076
|
+
meetings: "meetings \u2014 search all reads them",
|
|
4077
|
+
events: "calendar events \u2014 no search reads them yet",
|
|
4078
|
+
crm: "CRM deals and leads \u2014 search all reads them"
|
|
4079
|
+
};
|
|
4080
|
+
var fitting = /* @__PURE__ */ __name((entries, kinds, what, reasonOf = (kind2) => READS[kind2], alsoFits = () => false) => {
|
|
4081
|
+
const chosen = /* @__PURE__ */ new Map();
|
|
4082
|
+
const skipped = [];
|
|
4083
|
+
for (const { entry, accounts } of entries) {
|
|
4084
|
+
const fits = accounts.filter((one) => kinds.some((kind2) => listedHolds(one, kind2)) || alsoFits(one));
|
|
4085
|
+
for (const { provider, account } of fits)
|
|
4086
|
+
if (!chosen.has(keyOf({ provider, account })))
|
|
4087
|
+
chosen.set(keyOf({ provider, account }), { provider, account });
|
|
4088
|
+
const known = accounts.filter(({ kind: kind2 }) => kind2 !== void 0);
|
|
4089
|
+
const unknown2 = accounts.filter((one) => one.kind === void 0 && !alsoFits(one));
|
|
4090
|
+
if (known.length)
|
|
4091
|
+
for (const { provider, account } of unknown2)
|
|
4092
|
+
skipped.push({ source: `${provider}:${account}`, code: "not_found", reason: UNKNOWN_PROVIDER });
|
|
4093
|
+
if (fits.length)
|
|
4094
|
+
continue;
|
|
4095
|
+
const other = known[0];
|
|
4096
|
+
skipped.push(other?.kind ? { source: entry, code: "validation_error", reason: reasonOf(other.kind) } : unknown2.length ? { source: entry, code: "not_found", reason: UNKNOWN_PROVIDER } : { source: entry, code: "not_found", reason: "no account in the store" });
|
|
4097
|
+
}
|
|
4098
|
+
if (chosen.size === 0)
|
|
4099
|
+
fail2(`--source names nothing ${what} reads: ${skipped.map(({ source, reason }) => `${source} (${reason})`).join(", ")}`);
|
|
4100
|
+
return { accounts: [...chosen.values()], skipped };
|
|
4101
|
+
}, "fitting");
|
|
3479
4102
|
|
|
3480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4103
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/deals.js
|
|
3481
4104
|
var DEAL_KINDS = ["deal", "lead"];
|
|
3482
4105
|
var DEAL_STATUSES = ["open", "won", "lost"];
|
|
3483
4106
|
var STAGE_OUTCOMES = DEAL_STATUSES;
|
|
@@ -3487,17 +4110,521 @@ var dealLine = /* @__PURE__ */ __name((deal) => {
|
|
|
3487
4110
|
return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
|
|
3488
4111
|
}, "dealLine");
|
|
3489
4112
|
|
|
3490
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/orders.js
|
|
3491
4114
|
var ORDER_STATUSES = ["placed", "shipped", "delivered", "cancelled", "returned"];
|
|
3492
4115
|
var ORDER_PURPOSES = ["personal", "business", "client", "other"];
|
|
3493
4116
|
var orderLine = /* @__PURE__ */ __name((order) => {
|
|
4117
|
+
const party = order.direction === "sale" && order.customerName !== null ? `to ${order.customerName}` : order.supplierName;
|
|
3494
4118
|
const money = order.total === null || order.currency === null ? "" : `, ${moneyLabel(order.total, order.currency)}`;
|
|
3495
4119
|
const notes2 = [order.status, order.review === "confirmed" ? null : order.review].filter(Boolean).join(", ");
|
|
3496
|
-
return `${order.number ?? `#${order.id}`} \xB7 ${
|
|
4120
|
+
return `${order.number ?? `#${order.id}`} \xB7 ${party}${money} (${notes2})`;
|
|
3497
4121
|
}, "orderLine");
|
|
3498
4122
|
var orderTitle = /* @__PURE__ */ __name((order) => `Order ${orderLine(order)}`, "orderTitle");
|
|
3499
4123
|
|
|
3500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4124
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/store/source-review.js
|
|
4125
|
+
var SOURCE_REVIEW_KIND = "memory_source_review";
|
|
4126
|
+
var SOURCE_REVIEW_CAUSES = ["changed", "outdated", "deleted", "contradicted"];
|
|
4127
|
+
var ERASED_TEXT = "[source erased]";
|
|
4128
|
+
var severity = /* @__PURE__ */ __name((cause) => SOURCE_REVIEW_CAUSES.indexOf(cause), "severity");
|
|
4129
|
+
var graver = /* @__PURE__ */ __name((a, b) => severity(b) > severity(a) ? b : a, "graver");
|
|
4130
|
+
|
|
4131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/runs/log-keys.js
|
|
4132
|
+
var snake = /* @__PURE__ */ __name((key) => key.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`), "snake");
|
|
4133
|
+
var camel = /* @__PURE__ */ __name((key) => key.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "camel");
|
|
4134
|
+
var renamed = /* @__PURE__ */ __name((record2, name) => Object.fromEntries(Object.entries(record2).map(([key, value]) => [name(key), value])), "renamed");
|
|
4135
|
+
var logAttributes = /* @__PURE__ */ __name((event2) => renamed(event2, snake), "logAttributes");
|
|
4136
|
+
var fromLogAttributes = /* @__PURE__ */ __name((attributes) => renamed(attributes, camel), "fromLogAttributes");
|
|
4137
|
+
var snakeLogger = /* @__PURE__ */ __name((logger) => ({
|
|
4138
|
+
debug: /* @__PURE__ */ __name((event2, message) => logger.debug(logAttributes(event2), message), "debug"),
|
|
4139
|
+
info: /* @__PURE__ */ __name((event2, message) => logger.info(logAttributes(event2), message), "info"),
|
|
4140
|
+
warn: /* @__PURE__ */ __name((event2, message) => logger.warn(logAttributes(event2), message), "warn"),
|
|
4141
|
+
error: /* @__PURE__ */ __name((event2, message) => logger.error(logAttributes(event2), message), "error")
|
|
4142
|
+
}), "snakeLogger");
|
|
4143
|
+
|
|
4144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/runs/log-attributes.js
|
|
4145
|
+
var diagnostic = {
|
|
4146
|
+
event: true,
|
|
4147
|
+
operation: true,
|
|
4148
|
+
opcode: true,
|
|
4149
|
+
seq: true,
|
|
4150
|
+
status: true,
|
|
4151
|
+
method: true,
|
|
4152
|
+
endpointTemplate: true,
|
|
4153
|
+
bytes: true,
|
|
4154
|
+
ids: true,
|
|
4155
|
+
counts: true,
|
|
4156
|
+
durationMs: true,
|
|
4157
|
+
outcome: true,
|
|
4158
|
+
errorCode: true,
|
|
4159
|
+
providerError: true,
|
|
4160
|
+
level: true,
|
|
4161
|
+
transport: true,
|
|
4162
|
+
attempt: true,
|
|
4163
|
+
waitMs: true,
|
|
4164
|
+
code: true,
|
|
4165
|
+
detail: true,
|
|
4166
|
+
reason: true,
|
|
4167
|
+
ageMs: true,
|
|
4168
|
+
kind: true,
|
|
4169
|
+
table: true,
|
|
4170
|
+
op: true,
|
|
4171
|
+
n: true
|
|
4172
|
+
};
|
|
4173
|
+
var send = {
|
|
4174
|
+
profile: true,
|
|
4175
|
+
chatId: true,
|
|
4176
|
+
outcome: true,
|
|
4177
|
+
kind: true,
|
|
4178
|
+
action: true,
|
|
4179
|
+
people: true,
|
|
4180
|
+
messageId: true,
|
|
4181
|
+
key: true,
|
|
4182
|
+
count: true,
|
|
4183
|
+
forEveryone: true,
|
|
4184
|
+
sendId: true,
|
|
4185
|
+
operationId: true,
|
|
4186
|
+
parentOperationId: true,
|
|
4187
|
+
replyTo: true,
|
|
4188
|
+
threadId: true,
|
|
4189
|
+
sendAs: true,
|
|
4190
|
+
resultChatId: true,
|
|
4191
|
+
length: true,
|
|
4192
|
+
attachments: true,
|
|
4193
|
+
scheduledFor: true,
|
|
4194
|
+
notify: true,
|
|
4195
|
+
origin: true,
|
|
4196
|
+
reservation: true,
|
|
4197
|
+
errorCode: true
|
|
4198
|
+
};
|
|
4199
|
+
var background = [
|
|
4200
|
+
"job",
|
|
4201
|
+
"pid",
|
|
4202
|
+
"schedule",
|
|
4203
|
+
"exitCode",
|
|
4204
|
+
"tool",
|
|
4205
|
+
"tier",
|
|
4206
|
+
"actorType",
|
|
4207
|
+
"actorId",
|
|
4208
|
+
"agent",
|
|
4209
|
+
"targetType",
|
|
4210
|
+
"targetId"
|
|
4211
|
+
];
|
|
4212
|
+
var crash = ["errorClass", "frames"];
|
|
4213
|
+
var dropped = ["dropped"];
|
|
4214
|
+
var LOG_ATTRIBUTES = [
|
|
4215
|
+
...new Set([...Object.keys(diagnostic), ...Object.keys(send), ...background, ...crash, ...dropped].map((key) => Object.keys(logAttributes({ [key]: true }))[0]))
|
|
4216
|
+
].sort();
|
|
4217
|
+
|
|
4218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/runs/run.js
|
|
4219
|
+
import { randomUUID } from "node:crypto";
|
|
4220
|
+
import { appendFileSync, mkdirSync, readdirSync, readFileSync as readFileSync2, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
4221
|
+
import { userInfo } from "node:os";
|
|
4222
|
+
import { join, sep } from "node:path";
|
|
4223
|
+
var KEEP_RUNS_FOR_DAYS = 30;
|
|
4224
|
+
var KEEP_SUCCESSFUL_RUNS_FOR_DAYS = 7;
|
|
4225
|
+
var KEEP_STORE_RUNS_FOR_DAYS = 3;
|
|
4226
|
+
var RUNS_SIZE_LIMIT_MB = 200;
|
|
4227
|
+
var runsDirFor = /* @__PURE__ */ __name((app, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "runs"), "runsDirFor");
|
|
4228
|
+
var startRun = /* @__PURE__ */ __name((options) => {
|
|
4229
|
+
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
4230
|
+
const startedAt = options.startedAt ?? now();
|
|
4231
|
+
const id4 = options.runId ?? newRunId(startedAt, options.command);
|
|
4232
|
+
const dir = join(options.runsDir, day(startedAt), id4);
|
|
4233
|
+
pruneRuns(options.runsDir, {
|
|
4234
|
+
keepDays: options.keepDays ?? KEEP_RUNS_FOR_DAYS,
|
|
4235
|
+
keepSuccessDays: options.keepSuccessDays ?? KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
4236
|
+
keepStoreDays: options.keepStoreDays ?? KEEP_STORE_RUNS_FOR_DAYS,
|
|
4237
|
+
maxBytes: options.maxBytes ?? RUNS_SIZE_LIMIT_MB * 1024 * 1024,
|
|
4238
|
+
now: startedAt
|
|
4239
|
+
});
|
|
4240
|
+
refuseRealStateInTests(dir);
|
|
4241
|
+
const metadata = {
|
|
4242
|
+
runId: id4,
|
|
4243
|
+
command: options.command,
|
|
4244
|
+
...options.profile === void 0 ? {} : { profile: options.profile },
|
|
4245
|
+
startedAt: startedAt.toISOString(),
|
|
4246
|
+
status: "running",
|
|
4247
|
+
cliVersion: options.cliVersion,
|
|
4248
|
+
runtime: runtime(),
|
|
4249
|
+
platform: process.platform,
|
|
4250
|
+
arch: process.arch,
|
|
4251
|
+
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
4252
|
+
...options.context
|
|
4253
|
+
};
|
|
4254
|
+
let file;
|
|
4255
|
+
const opened = /* @__PURE__ */ __name(() => {
|
|
4256
|
+
if (file)
|
|
4257
|
+
return file;
|
|
4258
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
4259
|
+
const events = join(dir, "events.jsonl");
|
|
4260
|
+
writeFileSync2(events, "", { flag: "a", mode: 384 });
|
|
4261
|
+
file = snakeLogger(createRecordLog({
|
|
4262
|
+
to: events,
|
|
4263
|
+
runId: id4,
|
|
4264
|
+
command: options.command,
|
|
4265
|
+
resource: { service: options.service, version: options.cliVersion },
|
|
4266
|
+
allow: LOG_ATTRIBUTES,
|
|
4267
|
+
...options.traceId === void 0 ? {} : { traceId: options.traceId },
|
|
4268
|
+
...options.onError === void 0 ? {} : { onError: options.onError }
|
|
4269
|
+
}));
|
|
4270
|
+
writeRunFile(dir, metadata);
|
|
4271
|
+
return file;
|
|
4272
|
+
}, "opened");
|
|
4273
|
+
if (!options.lazy)
|
|
4274
|
+
opened();
|
|
4275
|
+
let finished = false;
|
|
4276
|
+
const operations = /* @__PURE__ */ new Set();
|
|
4277
|
+
const codes = /* @__PURE__ */ new Set();
|
|
4278
|
+
const tables = /* @__PURE__ */ new Set();
|
|
4279
|
+
const noted = /* @__PURE__ */ __name((level) => (event2, message) => {
|
|
4280
|
+
const { operation, errorCode, error_code, code, kind: kind2, table } = event2;
|
|
4281
|
+
if (typeof operation === "string")
|
|
4282
|
+
operations.add(operation);
|
|
4283
|
+
if (kind2 === "store" && typeof table === "string")
|
|
4284
|
+
tables.add(table);
|
|
4285
|
+
for (const value of [errorCode, error_code, code])
|
|
4286
|
+
if (typeof value === "string")
|
|
4287
|
+
codes.add(value);
|
|
4288
|
+
if (finished)
|
|
4289
|
+
return;
|
|
4290
|
+
opened()[level](event2, message);
|
|
4291
|
+
}, "noted");
|
|
4292
|
+
const logger = { debug: noted("debug"), info: noted("info"), warn: noted("warn"), error: noted("error") };
|
|
4293
|
+
return {
|
|
4294
|
+
id: id4,
|
|
4295
|
+
dir,
|
|
4296
|
+
logger,
|
|
4297
|
+
finish: /* @__PURE__ */ __name(async (status, extra = {}) => {
|
|
4298
|
+
if (finished)
|
|
4299
|
+
return;
|
|
4300
|
+
finished = true;
|
|
4301
|
+
const completedAt = now();
|
|
4302
|
+
const final = {
|
|
4303
|
+
...metadata,
|
|
4304
|
+
...extra,
|
|
4305
|
+
status,
|
|
4306
|
+
completedAt: completedAt.toISOString(),
|
|
4307
|
+
durationMs: completedAt.getTime() - startedAt.getTime(),
|
|
4308
|
+
operations: [...operations].sort(),
|
|
4309
|
+
codes: [...codes].sort(),
|
|
4310
|
+
...tables.size > 0 ? { tables: [...tables].sort() } : {}
|
|
4311
|
+
};
|
|
4312
|
+
if (file || status !== "success") {
|
|
4313
|
+
opened();
|
|
4314
|
+
writeRunFile(dir, final);
|
|
4315
|
+
return;
|
|
4316
|
+
}
|
|
4317
|
+
try {
|
|
4318
|
+
mkdirSync(join(dir, ".."), { recursive: true, mode: 448 });
|
|
4319
|
+
appendIndex(join(dir, ".."), runFileOf(final));
|
|
4320
|
+
} catch (error) {
|
|
4321
|
+
options.onError?.(error);
|
|
4322
|
+
}
|
|
4323
|
+
}, "finish")
|
|
4324
|
+
};
|
|
4325
|
+
}, "startRun");
|
|
4326
|
+
var refuseRealStateInTests = /* @__PURE__ */ __name((dir, env = process.env) => {
|
|
4327
|
+
if (env.VITEST === void 0)
|
|
4328
|
+
return;
|
|
4329
|
+
let home;
|
|
4330
|
+
try {
|
|
4331
|
+
home = userInfo().homedir;
|
|
4332
|
+
} catch {
|
|
4333
|
+
return;
|
|
4334
|
+
}
|
|
4335
|
+
if (dir.startsWith(join(home, ".local", "share") + sep))
|
|
4336
|
+
throw new Error(`a test opened a run in the real data folder: ${dir}`);
|
|
4337
|
+
}, "refuseRealStateInTests");
|
|
4338
|
+
var runtime = /* @__PURE__ */ __name(() => {
|
|
4339
|
+
const bun = process.versions.bun;
|
|
4340
|
+
return bun ? `bun ${bun}` : `node ${process.versions.node}`;
|
|
4341
|
+
}, "runtime");
|
|
4342
|
+
var newRunId = /* @__PURE__ */ __name((startedAt, command) => {
|
|
4343
|
+
const stamp = startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "Z");
|
|
4344
|
+
const slug = command.replace(/[^a-z0-9]+/gi, "-").toLowerCase();
|
|
4345
|
+
return `${stamp}-${slug}-${randomUUID().slice(0, 6)}`;
|
|
4346
|
+
}, "newRunId");
|
|
4347
|
+
var INDEX = "index.jsonl";
|
|
4348
|
+
var appendIndex = /* @__PURE__ */ __name((dayDir, written) => {
|
|
4349
|
+
appendFileSync(join(dayDir, INDEX), `${JSON.stringify(written)}
|
|
4350
|
+
`, { mode: 384 });
|
|
4351
|
+
}, "appendIndex");
|
|
4352
|
+
var writeRunFile = /* @__PURE__ */ __name((dir, metadata) => {
|
|
4353
|
+
const written = runFileOf(metadata);
|
|
4354
|
+
writeSecurely(join(dir, "run.json"), `${JSON.stringify(written, null, 2)}
|
|
4355
|
+
`, 384);
|
|
4356
|
+
try {
|
|
4357
|
+
appendIndex(join(dir, ".."), written);
|
|
4358
|
+
} catch {
|
|
4359
|
+
}
|
|
4360
|
+
}, "writeRunFile");
|
|
4361
|
+
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");
|
|
4362
|
+
var listRuns = /* @__PURE__ */ __name((runsDir, { since, atLeast = Number.POSITIVE_INFINITY, filter = {} } = {}) => {
|
|
4363
|
+
const first = since === void 0 ? void 0 : day(new Date(since));
|
|
4364
|
+
const runs = [];
|
|
4365
|
+
for (const date of days(runsDir).sort().reverse()) {
|
|
4366
|
+
if (first !== void 0 && date < first || runs.length >= atLeast)
|
|
4367
|
+
break;
|
|
4368
|
+
for (const metadata of runsOfDay(join(runsDir, date))) {
|
|
4369
|
+
if (matchesListFilter(metadata, filter))
|
|
4370
|
+
runs.push(metadata);
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
return runs;
|
|
4374
|
+
}, "listRuns");
|
|
4375
|
+
var indexedRuns = /* @__PURE__ */ __name((dayDir) => {
|
|
4376
|
+
const latest = /* @__PURE__ */ new Map();
|
|
4377
|
+
let raw = "";
|
|
4378
|
+
try {
|
|
4379
|
+
raw = readFileSync2(join(dayDir, INDEX), "utf8");
|
|
4380
|
+
} catch {
|
|
4381
|
+
}
|
|
4382
|
+
for (const line2 of raw.split("\n")) {
|
|
4383
|
+
if (line2.trim() === "")
|
|
4384
|
+
continue;
|
|
4385
|
+
try {
|
|
4386
|
+
const metadata = metadataOf(JSON.parse(line2));
|
|
4387
|
+
if (typeof metadata.runId === "string")
|
|
4388
|
+
latest.set(metadata.runId, metadata);
|
|
4389
|
+
} catch {
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
return latest;
|
|
4393
|
+
}, "indexedRuns");
|
|
4394
|
+
var runsOfDay = /* @__PURE__ */ __name((dayDir) => {
|
|
4395
|
+
const latest = indexedRuns(dayDir);
|
|
4396
|
+
for (const entry of safeReaddir(dayDir)) {
|
|
4397
|
+
if (entry === INDEX || entry.startsWith(".") || latest.has(entry))
|
|
4398
|
+
continue;
|
|
4399
|
+
const metadata = readRun(join(dayDir, entry));
|
|
4400
|
+
if (metadata)
|
|
4401
|
+
latest.set(metadata.runId, metadata);
|
|
4402
|
+
}
|
|
4403
|
+
return [...latest.values()].sort((a, b) => a.runId < b.runId ? 1 : a.runId > b.runId ? -1 : 0);
|
|
4404
|
+
}, "runsOfDay");
|
|
4405
|
+
var findRun = /* @__PURE__ */ __name((runsDir, id4) => {
|
|
4406
|
+
const stamped = /^(\d{4})(\d{2})(\d{2})T/.exec(id4);
|
|
4407
|
+
const likely = stamped ? [`${stamped[1]}-${stamped[2]}-${stamped[3]}`] : [];
|
|
4408
|
+
const dates = [.../* @__PURE__ */ new Set([...likely, ...days(runsDir)])];
|
|
4409
|
+
for (const date of dates) {
|
|
4410
|
+
const dir = join(runsDir, date, id4);
|
|
4411
|
+
const metadata = readRun(dir);
|
|
4412
|
+
if (metadata)
|
|
4413
|
+
return { dir, metadata };
|
|
4414
|
+
}
|
|
4415
|
+
for (const date of dates) {
|
|
4416
|
+
const metadata = indexedRuns(join(runsDir, date)).get(id4);
|
|
4417
|
+
if (metadata)
|
|
4418
|
+
return { dir: join(runsDir, date, id4), metadata };
|
|
4419
|
+
}
|
|
4420
|
+
return void 0;
|
|
4421
|
+
}, "findRun");
|
|
4422
|
+
var readEvents = /* @__PURE__ */ __name((dir) => {
|
|
4423
|
+
let raw;
|
|
4424
|
+
try {
|
|
4425
|
+
raw = readFileSync2(join(dir, "events.jsonl"), "utf8");
|
|
4426
|
+
} catch {
|
|
4427
|
+
return [];
|
|
4428
|
+
}
|
|
4429
|
+
const events = [];
|
|
4430
|
+
for (const line2 of raw.split("\n")) {
|
|
4431
|
+
if (line2.trim() === "")
|
|
4432
|
+
continue;
|
|
4433
|
+
try {
|
|
4434
|
+
const parsed = JSON.parse(line2);
|
|
4435
|
+
if (parsed !== null && typeof parsed === "object")
|
|
4436
|
+
events.push(eventOf(parsed));
|
|
4437
|
+
} catch {
|
|
4438
|
+
}
|
|
4439
|
+
}
|
|
4440
|
+
return events;
|
|
4441
|
+
}, "readEvents");
|
|
4442
|
+
var eventOf = /* @__PURE__ */ __name((line2) => {
|
|
4443
|
+
const { attributes, time: time2, severity: severity2 } = line2;
|
|
4444
|
+
if (attributes === null || typeof attributes !== "object")
|
|
4445
|
+
return logAttributes(line2);
|
|
4446
|
+
return { time: time2, severity: severity2, ...logAttributes(attributes) };
|
|
4447
|
+
}, "eventOf");
|
|
4448
|
+
var pruneRuns = /* @__PURE__ */ __name((runsDir, { keepDays, keepSuccessDays = keepDays, keepStoreDays = KEEP_STORE_RUNS_FOR_DAYS, maxBytes, now }) => {
|
|
4449
|
+
const cutoff = day(new Date(now.getTime() - keepDays * DAY_MS));
|
|
4450
|
+
const before = /* @__PURE__ */ __name((days2) => day(new Date(now.getTime() - Math.min(days2, keepDays) * DAY_MS)), "before");
|
|
4451
|
+
const successCutoff = before(keepSuccessDays);
|
|
4452
|
+
const storeCutoff = before(keepStoreDays);
|
|
4453
|
+
const keptFor = /* @__PURE__ */ __name((metadata) => metadata.keptBecauseStore ? keepStoreDays : metadata.operations?.includes(STORE_WRITE) ? Math.max(keepSuccessDays, keepStoreDays) : keepSuccessDays, "keptFor");
|
|
4454
|
+
let removed = 0;
|
|
4455
|
+
for (const date of days(runsDir)) {
|
|
4456
|
+
if (date >= cutoff) {
|
|
4457
|
+
if (date < storeCutoff)
|
|
4458
|
+
dropSuccesses(join(runsDir, date), STORE_RUNS_DROPPED, (metadata) => keptFor(metadata) <= keepStoreDays);
|
|
4459
|
+
if (date < successCutoff)
|
|
4460
|
+
dropSuccesses(join(runsDir, date), SUCCESSES_DROPPED, (metadata) => keptFor(metadata) <= keepSuccessDays);
|
|
4461
|
+
continue;
|
|
4462
|
+
}
|
|
4463
|
+
try {
|
|
4464
|
+
rmSync2(join(runsDir, date), { recursive: true, force: true });
|
|
4465
|
+
removed += 1;
|
|
4466
|
+
} catch {
|
|
4467
|
+
}
|
|
4468
|
+
}
|
|
4469
|
+
if (maxBytes !== void 0)
|
|
4470
|
+
removed += fitSize(runsDir, maxBytes, now);
|
|
4471
|
+
return removed;
|
|
4472
|
+
}, "pruneRuns");
|
|
4473
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
4474
|
+
var STORE_WRITE = "store.write";
|
|
4475
|
+
var SUCCESSES_DROPPED = ".successes-dropped";
|
|
4476
|
+
var STORE_RUNS_DROPPED = ".store-runs-dropped";
|
|
4477
|
+
var SIZE_CHECKED = ".size-checked";
|
|
4478
|
+
var dropSuccesses = /* @__PURE__ */ __name((dayDir, marker = SUCCESSES_DROPPED, drops = () => true) => {
|
|
4479
|
+
const done = join(dayDir, marker);
|
|
4480
|
+
try {
|
|
4481
|
+
statSync2(done);
|
|
4482
|
+
return;
|
|
4483
|
+
} catch {
|
|
4484
|
+
}
|
|
4485
|
+
const dropped2 = /* @__PURE__ */ __name((metadata) => metadata?.status === "success" && drops(metadata), "dropped");
|
|
4486
|
+
try {
|
|
4487
|
+
const kept = [];
|
|
4488
|
+
for (const [id4, metadata] of indexedRuns(dayDir)) {
|
|
4489
|
+
if (dropped2(metadata))
|
|
4490
|
+
rmSync2(join(dayDir, id4), { recursive: true, force: true });
|
|
4491
|
+
else
|
|
4492
|
+
kept.push(JSON.stringify(runFileOf(metadata)));
|
|
4493
|
+
}
|
|
4494
|
+
for (const entry of safeReaddir(dayDir)) {
|
|
4495
|
+
if (entry === INDEX || entry.startsWith("."))
|
|
4496
|
+
continue;
|
|
4497
|
+
if (dropped2(readRun(join(dayDir, entry))))
|
|
4498
|
+
rmSync2(join(dayDir, entry), { recursive: true, force: true });
|
|
4499
|
+
}
|
|
4500
|
+
writeSecurely(join(dayDir, INDEX), kept.map((line2) => `${line2}
|
|
4501
|
+
`).join(""), 384);
|
|
4502
|
+
writeFileSync2(done, "", { mode: 384 });
|
|
4503
|
+
} catch {
|
|
4504
|
+
}
|
|
4505
|
+
}, "dropSuccesses");
|
|
4506
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
4507
|
+
let total = 0;
|
|
4508
|
+
for (const entry of safeReaddir(path)) {
|
|
4509
|
+
const full = join(path, entry);
|
|
4510
|
+
try {
|
|
4511
|
+
const stat = statSync2(full);
|
|
4512
|
+
total += stat.isDirectory() ? sizeOf(full) : stat.size;
|
|
4513
|
+
} catch {
|
|
4514
|
+
}
|
|
4515
|
+
}
|
|
4516
|
+
return total;
|
|
4517
|
+
}, "sizeOf");
|
|
4518
|
+
var fitSize = /* @__PURE__ */ __name((runsDir, maxBytes, now) => {
|
|
4519
|
+
const stamp = join(runsDir, SIZE_CHECKED);
|
|
4520
|
+
const today = day(now);
|
|
4521
|
+
try {
|
|
4522
|
+
if (readFileSync2(stamp, "utf8").trim() === today)
|
|
4523
|
+
return 0;
|
|
4524
|
+
} catch {
|
|
4525
|
+
}
|
|
4526
|
+
const dates = days(runsDir).sort();
|
|
4527
|
+
const sizes = new Map(dates.map((date) => [date, sizeOf(join(runsDir, date))]));
|
|
4528
|
+
let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
|
|
4529
|
+
let removed = 0;
|
|
4530
|
+
for (const date of dates) {
|
|
4531
|
+
if (total <= maxBytes || date === today)
|
|
4532
|
+
break;
|
|
4533
|
+
dropSuccesses(join(runsDir, date));
|
|
4534
|
+
const after = sizeOf(join(runsDir, date));
|
|
4535
|
+
total -= (sizes.get(date) ?? 0) - after;
|
|
4536
|
+
sizes.set(date, after);
|
|
4537
|
+
}
|
|
4538
|
+
for (const date of dates) {
|
|
4539
|
+
if (total <= maxBytes || date === today)
|
|
4540
|
+
break;
|
|
4541
|
+
try {
|
|
4542
|
+
rmSync2(join(runsDir, date), { recursive: true, force: true });
|
|
4543
|
+
total -= sizes.get(date) ?? 0;
|
|
4544
|
+
removed += 1;
|
|
4545
|
+
} catch {
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
try {
|
|
4549
|
+
mkdirSync(runsDir, { recursive: true, mode: 448 });
|
|
4550
|
+
writeFileSync2(stamp, today, { mode: 384 });
|
|
4551
|
+
} catch {
|
|
4552
|
+
}
|
|
4553
|
+
return removed;
|
|
4554
|
+
}, "fitSize");
|
|
4555
|
+
var day = /* @__PURE__ */ __name((date) => date.toISOString().slice(0, 10), "day");
|
|
4556
|
+
var days = /* @__PURE__ */ __name((runsDir) => safeReaddir(runsDir).filter((entry) => /^\d{4}-\d{2}-\d{2}$/.test(entry)), "days");
|
|
4557
|
+
var readRun = /* @__PURE__ */ __name((dir) => {
|
|
4558
|
+
try {
|
|
4559
|
+
return metadataOf(JSON.parse(readFileSync2(join(dir, "run.json"), "utf8")));
|
|
4560
|
+
} catch {
|
|
4561
|
+
return void 0;
|
|
4562
|
+
}
|
|
4563
|
+
}, "readRun");
|
|
4564
|
+
var safeReaddir = /* @__PURE__ */ __name((dir) => {
|
|
4565
|
+
try {
|
|
4566
|
+
return readdirSync(dir);
|
|
4567
|
+
} catch {
|
|
4568
|
+
return [];
|
|
4569
|
+
}
|
|
4570
|
+
}, "safeReaddir");
|
|
4571
|
+
var runFileOf = /* @__PURE__ */ __name(({ partial, ...metadata }) => ({
|
|
4572
|
+
...logAttributes(metadata),
|
|
4573
|
+
...partial ? { partial: { ...logAttributes(partial), failures: partial.failures.map((failure) => logAttributes(failure)) } } : {}
|
|
4574
|
+
}), "runFileOf");
|
|
4575
|
+
var metadataOf = /* @__PURE__ */ __name((parsed) => {
|
|
4576
|
+
const { partial, ...metadata } = fromLogAttributes(parsed);
|
|
4577
|
+
if (partial === null || typeof partial !== "object")
|
|
4578
|
+
return metadata;
|
|
4579
|
+
const { failures, ...rest } = fromLogAttributes(partial);
|
|
4580
|
+
return {
|
|
4581
|
+
...metadata,
|
|
4582
|
+
partial: {
|
|
4583
|
+
...rest,
|
|
4584
|
+
failures: Array.isArray(failures) ? failures.map((failure) => fromLogAttributes(failure)) : []
|
|
4585
|
+
}
|
|
4586
|
+
};
|
|
4587
|
+
}, "metadataOf");
|
|
4588
|
+
|
|
4589
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/runs/scope.js
|
|
4590
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4591
|
+
import { randomBytes } from "node:crypto";
|
|
4592
|
+
var scopes = new AsyncLocalStorage();
|
|
4593
|
+
var processScope;
|
|
4594
|
+
var currentRun = /* @__PURE__ */ __name(() => {
|
|
4595
|
+
const scope2 = scopes.getStore();
|
|
4596
|
+
if (scope2)
|
|
4597
|
+
return scope2;
|
|
4598
|
+
processScope ??= {
|
|
4599
|
+
runId: newRunId(/* @__PURE__ */ new Date(), "process"),
|
|
4600
|
+
command: "",
|
|
4601
|
+
startedAt: Date.now(),
|
|
4602
|
+
...traceOf(process.env)
|
|
4603
|
+
};
|
|
4604
|
+
return processScope;
|
|
4605
|
+
}, "currentRun");
|
|
4606
|
+
var inRun = /* @__PURE__ */ __name((scope2, body) => scopes.run(scope2, body), "inRun");
|
|
4607
|
+
var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
|
|
4608
|
+
var typedCommand = /* @__PURE__ */ __name((tool, words2, profile = currentRun().profile) => [tool, profile, words2].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
|
|
4609
|
+
var useAsProcessRun = /* @__PURE__ */ __name((scope2) => {
|
|
4610
|
+
processScope = scope2;
|
|
4611
|
+
}, "useAsProcessRun");
|
|
4612
|
+
var processRun = /* @__PURE__ */ __name(() => processScope, "processRun");
|
|
4613
|
+
var enclosingTraceId = /* @__PURE__ */ __name(() => scopes.getStore()?.traceId, "enclosingTraceId");
|
|
4614
|
+
var traceOf = /* @__PURE__ */ __name((env) => {
|
|
4615
|
+
const traceId = traceIdOf(env.TRACEPARENT);
|
|
4616
|
+
return traceId === void 0 ? {} : { traceId };
|
|
4617
|
+
}, "traceOf");
|
|
4618
|
+
var childTrace = /* @__PURE__ */ __name(() => {
|
|
4619
|
+
const hex = /* @__PURE__ */ __name((bytes) => randomBytes(bytes).toString("hex"), "hex");
|
|
4620
|
+
const traceId = hex(16);
|
|
4621
|
+
return { traceId, traceparent: `00-${traceId}-${hex(8)}-01` };
|
|
4622
|
+
}, "childTrace");
|
|
4623
|
+
var attempts = new AsyncLocalStorage();
|
|
4624
|
+
var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
|
|
4625
|
+
var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
|
|
4626
|
+
|
|
4627
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/relations.js
|
|
3501
4628
|
var ORGANIZATION_ROLES = [
|
|
3502
4629
|
"employee",
|
|
3503
4630
|
"contractor",
|
|
@@ -3508,6 +4635,20 @@ var ORGANIZATION_ROLES = [
|
|
|
3508
4635
|
"contact"
|
|
3509
4636
|
];
|
|
3510
4637
|
var PROJECT_ROLES = ["owner", "manager", "contributor", "client-contact", "approver"];
|
|
4638
|
+
var CONTRACT_ROLES = ["customer", "supplier", "signatory", "guarantor"];
|
|
4639
|
+
var ENGAGEMENT_LEVELS = ["none", "low", "medium", "high"];
|
|
4640
|
+
var isEngagement = /* @__PURE__ */ __name((value) => typeof value === "string" && ENGAGEMENT_LEVELS.includes(value), "isEngagement");
|
|
4641
|
+
var checkEngagement = /* @__PURE__ */ __name((kind2, from, to, level) => {
|
|
4642
|
+
if (kind2 !== "member-of" || from !== "person" || to !== "project")
|
|
4643
|
+
throw new CliError("validation_error", "an engagement level is set only on a person's member-of a project", {
|
|
4644
|
+
reason: "relationship.engagement-ends"
|
|
4645
|
+
});
|
|
4646
|
+
if (!isEngagement(level))
|
|
4647
|
+
throw new CliError("validation_error", `an engagement level is one of ${ENGAGEMENT_LEVELS.join(", ")}`, {
|
|
4648
|
+
reason: "relationship.engagement-unknown"
|
|
4649
|
+
});
|
|
4650
|
+
return level;
|
|
4651
|
+
}, "checkEngagement");
|
|
3511
4652
|
var RELATIONS = {
|
|
3512
4653
|
"member-of": {
|
|
3513
4654
|
from: ["person", "organization", "project", "chat", "email_thread"],
|
|
@@ -3518,46 +4659,54 @@ var RELATIONS = {
|
|
|
3518
4659
|
"customer-of": { from: ["person", "organization"], to: ["organization"], inverse: "supplier of" },
|
|
3519
4660
|
"partner-of": { from: ["organization"], to: ["organization"], symmetric: true },
|
|
3520
4661
|
"related-to": {
|
|
3521
|
-
from: ["person", "organization", "project", "task", "deal", "lead"],
|
|
4662
|
+
from: ["person", "organization", "project", "task", "deal", "lead", "contract"],
|
|
3522
4663
|
to: ["person", "organization", "project", "task"],
|
|
3523
|
-
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES } }
|
|
4664
|
+
roles: { from: { deal: DEAL_ROLES, lead: DEAL_ROLES, contract: CONTRACT_ROLES } }
|
|
3524
4665
|
}
|
|
3525
4666
|
};
|
|
3526
4667
|
var RELATION_KINDS = Object.keys(RELATIONS);
|
|
3527
|
-
var specOf = /* @__PURE__ */ __name((
|
|
3528
|
-
var isRelationKind = /* @__PURE__ */ __name((
|
|
4668
|
+
var specOf = /* @__PURE__ */ __name((kind2) => Object.hasOwn(RELATIONS, kind2) ? RELATIONS[kind2] : void 0, "specOf");
|
|
4669
|
+
var isRelationKind = /* @__PURE__ */ __name((kind2) => specOf(kind2) !== void 0, "isRelationKind");
|
|
3529
4670
|
var memberOnly = /* @__PURE__ */ __name((type) => type === "chat" || type === "email_thread", "memberOnly");
|
|
3530
|
-
var
|
|
3531
|
-
|
|
4671
|
+
var partyOnly = /* @__PURE__ */ __name((from, to) => from === "contract" && to !== "person" && to !== "organization", "partyOnly");
|
|
4672
|
+
var checkEnds = /* @__PURE__ */ __name((kind2, from, to) => {
|
|
4673
|
+
const spec = specOf(kind2);
|
|
3532
4674
|
if (!spec)
|
|
3533
4675
|
throw new CliError("validation_error", `a relationship's kind is one of ${RELATION_KINDS.join(", ")}`);
|
|
3534
|
-
if (memberOnly(from) && (
|
|
4676
|
+
if (memberOnly(from) && (kind2 !== "member-of" || to !== "project"))
|
|
3535
4677
|
throw new CliError("validation_error", `a ${from === "chat" ? "chat" : "mail thread"} is related only as member-of a project`);
|
|
4678
|
+
if (partyOnly(from, to))
|
|
4679
|
+
throw new CliError("validation_error", "a contract is related only to a person or an organization");
|
|
3536
4680
|
if (!spec.from.includes(from) || !spec.to.includes(to))
|
|
3537
|
-
throw new CliError("validation_error", `${
|
|
4681
|
+
throw new CliError("validation_error", `${kind2} joins ${spec.from.join(", ")} to ${spec.to.join(", ")}, not ${from} to ${to}`);
|
|
3538
4682
|
return spec;
|
|
3539
4683
|
}, "checkEnds");
|
|
3540
|
-
var rolesOf = /* @__PURE__ */ __name((
|
|
3541
|
-
const spec = specOf(
|
|
3542
|
-
if (
|
|
4684
|
+
var rolesOf = /* @__PURE__ */ __name((kind2, from, to) => {
|
|
4685
|
+
const spec = specOf(kind2);
|
|
4686
|
+
if (kind2 === "member-of" && from !== "person")
|
|
3543
4687
|
return void 0;
|
|
3544
4688
|
return spec?.roles?.from?.[from] ?? spec?.roles?.to?.[to];
|
|
3545
4689
|
}, "rolesOf");
|
|
3546
|
-
var ROLE_LISTS = {
|
|
3547
|
-
|
|
3548
|
-
|
|
4690
|
+
var ROLE_LISTS = {
|
|
4691
|
+
organization: ORGANIZATION_ROLES,
|
|
4692
|
+
project: PROJECT_ROLES,
|
|
4693
|
+
deal: DEAL_ROLES,
|
|
4694
|
+
contract: CONTRACT_ROLES
|
|
4695
|
+
};
|
|
4696
|
+
var roleListOf = /* @__PURE__ */ __name((kind2, from, to) => {
|
|
4697
|
+
const roles = rolesOf(kind2, from, to);
|
|
3549
4698
|
return Object.keys(ROLE_LISTS).find((list) => ROLE_LISTS[list] === roles);
|
|
3550
4699
|
}, "roleListOf");
|
|
3551
|
-
var checkRole = /* @__PURE__ */ __name((
|
|
3552
|
-
const roles = rolesOf(
|
|
4700
|
+
var checkRole = /* @__PURE__ */ __name((kind2, from, to, role, extra = []) => {
|
|
4701
|
+
const roles = rolesOf(kind2, from, to)?.concat(extra);
|
|
3553
4702
|
if (roles && !roles.includes(role))
|
|
3554
|
-
throw new CliError("validation_error", `a ${from}'s role on ${
|
|
4703
|
+
throw new CliError("validation_error", `a ${from}'s role on ${kind2} ${to} is one of ${roles.join(", ")}`, {
|
|
3555
4704
|
reason: "relationship.role-unknown"
|
|
3556
4705
|
});
|
|
3557
4706
|
return role;
|
|
3558
4707
|
}, "checkRole");
|
|
3559
|
-
var isSymmetric = /* @__PURE__ */ __name((
|
|
3560
|
-
var inverseOf = /* @__PURE__ */ __name((
|
|
4708
|
+
var isSymmetric = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric === true, "isSymmetric");
|
|
4709
|
+
var inverseOf = /* @__PURE__ */ __name((kind2) => specOf(kind2)?.symmetric ? kind2 : specOf(kind2)?.inverse ?? null, "inverseOf");
|
|
3561
4710
|
var STANDINGS = ["confirmed", "reported", "proposed", "ended"];
|
|
3562
4711
|
var standingOf = /* @__PURE__ */ __name((link, now) => {
|
|
3563
4712
|
if (link.endsAt != null && link.endsAt <= now)
|
|
@@ -3572,7 +4721,7 @@ var isUsable = /* @__PURE__ */ __name((standing) => standing === "confirmed" ||
|
|
|
3572
4721
|
var notOverriddenSql = /* @__PURE__ */ __name((alias) => `NOT EXISTS (SELECT 1 FROM links override WHERE 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");
|
|
3573
4722
|
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");
|
|
3574
4723
|
|
|
3575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
3576
4725
|
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
3577
4726
|
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
3578
4727
|
var tagOf = /* @__PURE__ */ __name((value) => {
|
|
@@ -3586,31 +4735,7 @@ var normalizeTag = /* @__PURE__ */ __name((value) => {
|
|
|
3586
4735
|
return tag;
|
|
3587
4736
|
}, "normalizeTag");
|
|
3588
4737
|
|
|
3589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3590
|
-
var LINK_KINDS = [
|
|
3591
|
-
"links-to",
|
|
3592
|
-
"blocked-by",
|
|
3593
|
-
"follow-up-of",
|
|
3594
|
-
"about",
|
|
3595
|
-
"member-of",
|
|
3596
|
-
"labelled",
|
|
3597
|
-
"answered-by",
|
|
3598
|
-
"evidence",
|
|
3599
|
-
"created-from",
|
|
3600
|
-
"duplicate-of",
|
|
3601
|
-
"related-to",
|
|
3602
|
-
"reports-to",
|
|
3603
|
-
"customer-of",
|
|
3604
|
-
"partner-of",
|
|
3605
|
-
"assigned-to",
|
|
3606
|
-
"attached"
|
|
3607
|
-
];
|
|
3608
|
-
var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
|
|
3609
|
-
var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
|
|
3610
|
-
var linkKind = /* @__PURE__ */ __name((kind) => `'${kind}'`, "linkKind");
|
|
3611
|
-
var COUNTERPART_ROLE = "counterpart";
|
|
3612
|
-
|
|
3613
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._981e87e6afb3f510e9b2b59ded3c7286/node_modules/@wirecat/cli-core/dist/tasks/model.js
|
|
4738
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/tasks/model.js
|
|
3614
4739
|
var TASK_KINDS = ["question", "request", "mention", "promise"];
|
|
3615
4740
|
var TASK_STATES = ["open", "todo", "in_progress", "done", "dismissed"];
|
|
3616
4741
|
var CLOSED_STATES = ["done", "dismissed"];
|
|
@@ -3625,13 +4750,13 @@ function closeTask(task, state, by, at, reason) {
|
|
|
3625
4750
|
}
|
|
3626
4751
|
__name(closeTask, "closeTask");
|
|
3627
4752
|
|
|
3628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4753
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/tasks/store.js
|
|
3629
4754
|
function matches2(task, filter) {
|
|
3630
4755
|
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);
|
|
3631
4756
|
}
|
|
3632
4757
|
__name(matches2, "matches");
|
|
3633
4758
|
|
|
3634
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4759
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/tasks/priority.js
|
|
3635
4760
|
var PRIORITY_LABELS = ["low", "medium", "high", "critical"];
|
|
3636
4761
|
var MIDDLE = { low: 0.125, medium: 0.375, high: 0.625, critical: 0.875 };
|
|
3637
4762
|
var LEGACY_PRIORITY_SCORES = [0.875, 0.625, 0.375, 0.1875, 0.0625];
|
|
@@ -3660,7 +4785,7 @@ var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
|
3660
4785
|
}, "priorityOf");
|
|
3661
4786
|
var priorityOption = /* @__PURE__ */ __name((value) => priorityOf(value) ?? "none", "priorityOption");
|
|
3662
4787
|
|
|
3663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/tasks/service.js
|
|
3664
4789
|
function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
|
|
3665
4790
|
async function find(id4) {
|
|
3666
4791
|
const task = await store.get(id4);
|
|
@@ -3720,7 +4845,7 @@ function median(values) {
|
|
|
3720
4845
|
}
|
|
3721
4846
|
__name(median, "median");
|
|
3722
4847
|
|
|
3723
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
|
|
3724
4849
|
var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed", "rejected"];
|
|
3725
4850
|
var MEMORY_KINDS = ["summary", "digest", "preference"];
|
|
3726
4851
|
var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
|
|
@@ -3728,7 +4853,41 @@ var MEMORY_SCOPES = ["personal", "work"];
|
|
|
3728
4853
|
var WORK_TASK_TYPES = ["bug", "feature", "chore"];
|
|
3729
4854
|
var TASK_TYPES2 = [...WORK_TASK_TYPES, ...TASK_KINDS];
|
|
3730
4855
|
|
|
3731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/store/sqlite/link-source.js
|
|
4857
|
+
var REPORTER_SQL = "(SELECT provider || ':' || external_id FROM accounts r WHERE r.id = links.account_id) AS reporter";
|
|
4858
|
+
var sourceOf3 = /* @__PURE__ */ __name((database, row, metadata) => {
|
|
4859
|
+
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;
|
|
4860
|
+
return {
|
|
4861
|
+
...typeof reporter === "string" ? { account: reporter } : {},
|
|
4862
|
+
...typeof metadata.derived === "string" ? { derived: metadata.derived } : {}
|
|
4863
|
+
};
|
|
4864
|
+
}, "sourceOf");
|
|
4865
|
+
|
|
4866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
|
|
4867
|
+
var LINK_KINDS = [
|
|
4868
|
+
"links-to",
|
|
4869
|
+
"blocked-by",
|
|
4870
|
+
"follow-up-of",
|
|
4871
|
+
"about",
|
|
4872
|
+
"member-of",
|
|
4873
|
+
"labelled",
|
|
4874
|
+
"answered-by",
|
|
4875
|
+
"evidence",
|
|
4876
|
+
"created-from",
|
|
4877
|
+
"duplicate-of",
|
|
4878
|
+
"related-to",
|
|
4879
|
+
"reports-to",
|
|
4880
|
+
"customer-of",
|
|
4881
|
+
"partner-of",
|
|
4882
|
+
"assigned-to",
|
|
4883
|
+
"attached"
|
|
4884
|
+
];
|
|
4885
|
+
var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
|
|
4886
|
+
var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
|
|
4887
|
+
var linkKind = /* @__PURE__ */ __name((kind2) => `'${kind2}'`, "linkKind");
|
|
4888
|
+
var COUNTERPART_ROLE = "counterpart";
|
|
4889
|
+
|
|
4890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/entities/fields.js
|
|
3732
4891
|
var text5 = string();
|
|
3733
4892
|
var id3 = pipe(string(), minLength(1));
|
|
3734
4893
|
var time = isoTime;
|
|
@@ -3746,13 +4905,14 @@ var evidenceSource = strictObject({
|
|
|
3746
4905
|
tool: nullable(text5),
|
|
3747
4906
|
missing: boolean()
|
|
3748
4907
|
});
|
|
4908
|
+
var sourceReview = nullable(strictObject({ id: id3, cause: picklist(SOURCE_REVIEW_CAUSES) }));
|
|
3749
4909
|
var author = strictObject({
|
|
3750
4910
|
type: picklist(["person", "bot"]),
|
|
3751
4911
|
id: id3,
|
|
3752
4912
|
name: nullable(text5)
|
|
3753
4913
|
});
|
|
3754
4914
|
|
|
3755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
|
|
3756
4916
|
var organization = strictObject({
|
|
3757
4917
|
id: id3,
|
|
3758
4918
|
ref: reference,
|
|
@@ -3782,6 +4942,9 @@ var reminder = strictObject({
|
|
|
3782
4942
|
receipt: nullable(text5)
|
|
3783
4943
|
});
|
|
3784
4944
|
|
|
4945
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/categories.js
|
|
4946
|
+
var CATEGORIES = ["client", "supplier", "partner", "employer"];
|
|
4947
|
+
|
|
3785
4948
|
export {
|
|
3786
4949
|
QUERY_LIMITS,
|
|
3787
4950
|
queryAstSchema,
|
|
@@ -3884,6 +5047,54 @@ export {
|
|
|
3884
5047
|
validateMeetingSeriesInventoryCursor,
|
|
3885
5048
|
aggregateMeetingCounts,
|
|
3886
5049
|
aggregateMeetingStats,
|
|
5050
|
+
formatLocator,
|
|
5051
|
+
isLocator,
|
|
5052
|
+
parseLocator,
|
|
5053
|
+
SIMPLE_REFERENCES,
|
|
5054
|
+
formatReference,
|
|
5055
|
+
parseReference,
|
|
5056
|
+
canonicalReference,
|
|
5057
|
+
looksLikeReference,
|
|
5058
|
+
providerLabel,
|
|
5059
|
+
isFolderProvider,
|
|
5060
|
+
folderProviderSql,
|
|
5061
|
+
folderProviderOf,
|
|
5062
|
+
DOCUMENT_ACCOUNT_PROVIDERS,
|
|
5063
|
+
isDocumentAccountProvider,
|
|
5064
|
+
ADDED_PROVIDER,
|
|
5065
|
+
ADDED_ACCOUNT,
|
|
5066
|
+
notAdded,
|
|
5067
|
+
filesAccountSql,
|
|
5068
|
+
INTERNAL_NOTES,
|
|
5069
|
+
UNKNOWN_PROVIDER,
|
|
5070
|
+
providerEntryOf,
|
|
5071
|
+
kindsOfEntry,
|
|
5072
|
+
unitedKinds,
|
|
5073
|
+
useStoredProviders,
|
|
5074
|
+
addProvider,
|
|
5075
|
+
isKind,
|
|
5076
|
+
providerNamed,
|
|
5077
|
+
kindIn,
|
|
5078
|
+
importedOf,
|
|
5079
|
+
isImportedProvider,
|
|
5080
|
+
holdsKind,
|
|
5081
|
+
holdsKindOf,
|
|
5082
|
+
isBotProvider,
|
|
5083
|
+
inSource,
|
|
5084
|
+
sourceOf,
|
|
5085
|
+
ACCOUNT_GROUPS,
|
|
5086
|
+
ACCOUNT_GROUPS_SETTING,
|
|
5087
|
+
isAccountList,
|
|
5088
|
+
isGroupName,
|
|
5089
|
+
groupName,
|
|
5090
|
+
groupMembers,
|
|
5091
|
+
listedHolds,
|
|
5092
|
+
keyOf,
|
|
5093
|
+
sourceOf2,
|
|
5094
|
+
sameAs,
|
|
5095
|
+
entriesOfList,
|
|
5096
|
+
accountsOfList,
|
|
5097
|
+
fitting,
|
|
3887
5098
|
parseDecimal,
|
|
3888
5099
|
formatDecimal,
|
|
3889
5100
|
currencyOf,
|
|
@@ -3899,12 +5110,24 @@ export {
|
|
|
3899
5110
|
MONEY_DIRECTIONS,
|
|
3900
5111
|
FINANCE_REVIEWS,
|
|
3901
5112
|
settledStatus,
|
|
3902
|
-
dayMonth,
|
|
3903
|
-
notes,
|
|
3904
5113
|
invoiceLine,
|
|
3905
5114
|
paymentLine,
|
|
3906
5115
|
invoiceTitle,
|
|
3907
5116
|
paymentEntryTitle,
|
|
5117
|
+
CATALOG_KINDS,
|
|
5118
|
+
BUSINESS_KINDS,
|
|
5119
|
+
CONTRACT_KINDS,
|
|
5120
|
+
CONTRACT_STATUSES,
|
|
5121
|
+
SUBSCRIPTION_STATUSES,
|
|
5122
|
+
WALLET_KINDS,
|
|
5123
|
+
TRANSACTION_STATUSES,
|
|
5124
|
+
ORDER_DIRECTIONS,
|
|
5125
|
+
intervalOf,
|
|
5126
|
+
productLine,
|
|
5127
|
+
contractLine,
|
|
5128
|
+
subscriptionLine,
|
|
5129
|
+
walletLine,
|
|
5130
|
+
transactionLine,
|
|
3908
5131
|
DEAL_KINDS,
|
|
3909
5132
|
DEAL_STATUSES,
|
|
3910
5133
|
STAGE_OUTCOMES,
|
|
@@ -3914,6 +5137,45 @@ export {
|
|
|
3914
5137
|
ORDER_PURPOSES,
|
|
3915
5138
|
orderLine,
|
|
3916
5139
|
orderTitle,
|
|
5140
|
+
SOURCE_REVIEW_KIND,
|
|
5141
|
+
SOURCE_REVIEW_CAUSES,
|
|
5142
|
+
ERASED_TEXT,
|
|
5143
|
+
severity,
|
|
5144
|
+
graver,
|
|
5145
|
+
markStoreDamaged,
|
|
5146
|
+
readDamageMark,
|
|
5147
|
+
refuseDamagedStore,
|
|
5148
|
+
markJournalLost,
|
|
5149
|
+
readJournalMark,
|
|
5150
|
+
readHealthMark,
|
|
5151
|
+
recordDeepCheck,
|
|
5152
|
+
logAttributes,
|
|
5153
|
+
fromLogAttributes,
|
|
5154
|
+
snakeLogger,
|
|
5155
|
+
LOG_ATTRIBUTES,
|
|
5156
|
+
KEEP_SUCCESSFUL_RUNS_FOR_DAYS,
|
|
5157
|
+
KEEP_STORE_RUNS_FOR_DAYS,
|
|
5158
|
+
RUNS_SIZE_LIMIT_MB,
|
|
5159
|
+
runsDirFor,
|
|
5160
|
+
startRun,
|
|
5161
|
+
runtime,
|
|
5162
|
+
newRunId,
|
|
5163
|
+
listRuns,
|
|
5164
|
+
findRun,
|
|
5165
|
+
readEvents,
|
|
5166
|
+
currentRun,
|
|
5167
|
+
inRun,
|
|
5168
|
+
runEvent,
|
|
5169
|
+
typedCommand,
|
|
5170
|
+
useAsProcessRun,
|
|
5171
|
+
processRun,
|
|
5172
|
+
enclosingTraceId,
|
|
5173
|
+
traceOf,
|
|
5174
|
+
childTrace,
|
|
5175
|
+
withAttempt,
|
|
5176
|
+
currentAttempt,
|
|
5177
|
+
isEngagement,
|
|
5178
|
+
checkEngagement,
|
|
3917
5179
|
RELATION_KINDS,
|
|
3918
5180
|
isRelationKind,
|
|
3919
5181
|
checkEnds,
|
|
@@ -3931,11 +5193,6 @@ export {
|
|
|
3931
5193
|
TAG_TYPES,
|
|
3932
5194
|
tagOf,
|
|
3933
5195
|
normalizeTag,
|
|
3934
|
-
LINK_KINDS,
|
|
3935
|
-
LINK_ORIGINS,
|
|
3936
|
-
LINK_SOURCES,
|
|
3937
|
-
linkKind,
|
|
3938
|
-
COUNTERPART_ROLE,
|
|
3939
5196
|
TASK_KINDS,
|
|
3940
5197
|
TASK_STATES,
|
|
3941
5198
|
TASK_ORIGINS,
|
|
@@ -3955,6 +5212,13 @@ export {
|
|
|
3955
5212
|
MEMORY_SCOPES,
|
|
3956
5213
|
WORK_TASK_TYPES,
|
|
3957
5214
|
TASK_TYPES2 as TASK_TYPES,
|
|
5215
|
+
REPORTER_SQL,
|
|
5216
|
+
sourceOf3,
|
|
5217
|
+
LINK_KINDS,
|
|
5218
|
+
LINK_ORIGINS,
|
|
5219
|
+
LINK_SOURCES,
|
|
5220
|
+
linkKind,
|
|
5221
|
+
COUNTERPART_ROLE,
|
|
3958
5222
|
text5 as text,
|
|
3959
5223
|
id3 as id,
|
|
3960
5224
|
time,
|
|
@@ -3963,13 +5227,10 @@ export {
|
|
|
3963
5227
|
untrusted,
|
|
3964
5228
|
providerMetadata,
|
|
3965
5229
|
evidenceSource,
|
|
5230
|
+
sourceReview,
|
|
3966
5231
|
author,
|
|
3967
5232
|
organization,
|
|
3968
5233
|
project,
|
|
3969
5234
|
reminder,
|
|
3970
|
-
|
|
3971
|
-
readDamageMark,
|
|
3972
|
-
refuseDamagedStore,
|
|
3973
|
-
readHealthMark,
|
|
3974
|
-
recordDeepCheck
|
|
5235
|
+
CATEGORIES
|
|
3975
5236
|
};
|