@wirecat/cli-memo 0.131.47 → 0.131.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/memo.js +2 -2
- package/dist/bundle/{all-profiles-75EGCXK3.js → all-profiles-5YVSKBEV.js} +9 -9
- package/dist/bundle/{anthropic-PTAYBCPR.js → anthropic-BMK6F36V.js} +6 -6
- package/dist/bundle/{app-server-YSUBXGGB.js → app-server-PUBWKHUG.js} +42 -42
- package/dist/bundle/auto-FXCXORUF.js +86 -0
- package/dist/bundle/{bun-3AIG5ML4.js → bun-ZBM364I6.js} +2 -2
- package/dist/bundle/{bun-sqlite-5FCGI6EO.js → bun-sqlite-YLBILWBE.js} +5 -5
- package/dist/bundle/{chunk-GA3KFYEZ.js → chunk-2O32QNK3.js} +7 -7
- package/dist/bundle/{chunk-KWM7HLAI.js → chunk-3A3KPJHP.js} +4 -4
- package/dist/bundle/{chunk-N63KZFH4.js → chunk-3LA6OE35.js} +9 -9
- package/dist/bundle/{chunk-DWBTCOF2.js → chunk-4FDK7LVF.js} +7 -7
- package/dist/bundle/{chunk-25RDNYKZ.js → chunk-5BDWOMH6.js} +6 -6
- package/dist/bundle/{chunk-N5QQFDNV.js → chunk-66KZBRZN.js} +3 -3
- package/dist/bundle/{chunk-JY34MQW4.js → chunk-7RNHFNHX.js} +4 -4
- package/dist/bundle/{chunk-V3B5COFP.js → chunk-ADV7DNGM.js} +5 -5
- package/dist/bundle/{chunk-G4W42RGE.js → chunk-BRLVX4V6.js} +1 -1
- package/dist/bundle/{chunk-RZ54DSVU.js → chunk-BXTDAGM4.js} +2 -2
- package/dist/bundle/{chunk-ELKK5M66.js → chunk-C3I6L7JZ.js} +6 -6
- package/dist/bundle/{chunk-MCMEBL3C.js → chunk-C6UTJATA.js} +30 -14
- package/dist/bundle/{chunk-UFVGAFID.js → chunk-CSPAEYKK.js} +4 -4
- package/dist/bundle/{chunk-FSAMZHIM.js → chunk-DGLSE6XA.js} +6 -6
- package/dist/bundle/{chunk-32QM6X5H.js → chunk-DHO2JWF7.js} +3 -3
- package/dist/bundle/{chunk-SYTYLLYO.js → chunk-DMI3SFLF.js} +2 -2
- package/dist/bundle/{chunk-3HPFTKDH.js → chunk-DNZYXNMB.js} +4 -4
- package/dist/bundle/{chunk-Y4ZXDJQF.js → chunk-DPQL5JK6.js} +2 -2
- package/dist/bundle/{chunk-6TKWJKPS.js → chunk-E4YCKC3F.js} +12 -12
- package/dist/bundle/{chunk-SN63VOE6.js → chunk-EBNNONF5.js} +8 -8
- package/dist/bundle/{chunk-6QNPOBR5.js → chunk-EGVRMA2C.js} +198 -81
- package/dist/bundle/{chunk-GQLSVXS2.js → chunk-EQ237UYC.js} +22 -22
- package/dist/bundle/{chunk-ZKH6LC5P.js → chunk-F7S25YVA.js} +9 -9
- package/dist/bundle/{chunk-DMTLG2GD.js → chunk-FTRFN3MU.js} +8 -8
- package/dist/bundle/{chunk-W2JVP7GK.js → chunk-H4726KFZ.js} +1 -1
- package/dist/bundle/{chunk-UE4GMPBY.js → chunk-HE56X542.js} +1 -1
- package/dist/bundle/{chunk-IPMBB6W5.js → chunk-IGYOKYG7.js} +4 -4
- package/dist/bundle/{chunk-W3T45MMN.js → chunk-IHFK634F.js} +8 -8
- package/dist/bundle/{chunk-GOFPCOEI.js → chunk-IWEL7QCT.js} +11 -11
- package/dist/bundle/{chunk-V6OYLCCM.js → chunk-J737T3RM.js} +3 -3
- package/dist/bundle/{chunk-CODD5SXC.js → chunk-KNUUZW42.js} +29 -29
- package/dist/bundle/{chunk-HVTW2M6T.js → chunk-LDHFV34C.js} +2 -2
- package/dist/bundle/{chunk-LE7NROV6.js → chunk-LDXCFBIC.js} +34 -34
- package/dist/bundle/{chunk-YMK35KVV.js → chunk-MIMLBSUQ.js} +2 -2
- package/dist/bundle/{chunk-J324GKJM.js → chunk-MKLDUZ7N.js} +2 -2
- package/dist/bundle/{chunk-MMJDQQFX.js → chunk-MN3SFFTU.js} +287 -277
- package/dist/bundle/{chunk-U35N3EC7.js → chunk-NWRITJ7F.js} +2 -2
- package/dist/bundle/{chunk-2R2Z2VWL.js → chunk-O3ZOYXH3.js} +20 -20
- package/dist/bundle/{chunk-CID4MNRQ.js → chunk-P3ASN72F.js} +1 -1
- package/dist/bundle/{chunk-I2RDACUF.js → chunk-PUZ2G2KS.js} +8 -8
- package/dist/bundle/{chunk-Y5CAKD4X.js → chunk-QOGYHU3Q.js} +4 -4
- package/dist/bundle/{chunk-PGVADNDD.js → chunk-QTBFV5RL.js} +3 -3
- package/dist/bundle/{chunk-5N6HWFXN.js → chunk-QUQJZSRF.js} +320 -275
- package/dist/bundle/{chunk-R44PUK7G.js → chunk-RCEDN42Q.js} +1 -1
- package/dist/bundle/{chunk-ZLIARJU4.js → chunk-RSJJGXZP.js} +1 -1
- package/dist/bundle/{chunk-ILK5BCBB.js → chunk-SGDTAVMU.js} +2 -2
- package/dist/bundle/{chunk-KLBZJZD2.js → chunk-T56R3TF2.js} +216 -143
- package/dist/bundle/{chunk-EFQCDCLY.js → chunk-TW643BIA.js} +99 -74
- package/dist/bundle/{chunk-MSBRZ5QD.js → chunk-TYOZC3BU.js} +3 -3
- package/dist/bundle/{chunk-BNIWLVWG.js → chunk-TZROQCQ5.js} +18 -4
- package/dist/bundle/{chunk-F4HMPMET.js → chunk-U2EFWFDN.js} +10 -10
- package/dist/bundle/{chunk-EVZI54B5.js → chunk-U64G664E.js} +6 -6
- package/dist/bundle/{chunk-XRRPQCTS.js → chunk-UHWQ2YXW.js} +1 -1
- package/dist/bundle/{chunk-HCZV537M.js → chunk-UK2MMZFW.js} +2 -2
- package/dist/bundle/{chunk-HYEYRFWX.js → chunk-VICARVCN.js} +1 -1
- package/dist/bundle/{chunk-OSCRP52P.js → chunk-VJJCF52V.js} +640 -399
- package/dist/bundle/{chunk-G3YSCD77.js → chunk-VOJU5FVA.js} +173 -156
- package/dist/bundle/{chunk-LER7G4XY.js → chunk-VW6BF6M7.js} +1 -1
- package/dist/bundle/{chunk-DS4DOK75.js → chunk-X3KMQW2Z.js} +25 -24
- package/dist/bundle/{chunk-6IVHND3S.js → chunk-X7UITQ66.js} +5 -5
- package/dist/bundle/{chunk-DDADFHR7.js → chunk-XR4N2MYB.js} +13 -13
- package/dist/bundle/{chunk-U75ANK5K.js → chunk-YBN7UF2Y.js} +1 -1
- package/dist/bundle/{chunk-IPLPMD6H.js → chunk-YO7AUGUT.js} +2 -2
- package/dist/bundle/{chunk-4LWX2WOB.js → chunk-YZEIVLAG.js} +4 -4
- package/dist/bundle/command-contract-BRZAKY6L.js +32 -0
- package/dist/bundle/{decode-F2A2BLIA.js → decode-WW5ZMB5R.js} +5 -5
- package/dist/bundle/{dispatch-MLRETSNQ.js → dispatch-HCRXCPCF.js} +8 -8
- package/dist/bundle/{echarts-JL55HJCM.js → echarts-ODD3E2RQ.js} +2 -2
- package/dist/bundle/{embed-74KVORNN.js → embed-3ETM2WYU.js} +6 -6
- package/dist/bundle/{embedder-GACNPCZN.js → embedder-6YL3WFBR.js} +9 -9
- package/dist/bundle/{entry-7FI2H4RQ.js → entry-F2UGXKZ3.js} +7 -7
- package/dist/bundle/{failure-UJBGB2GP.js → failure-G4DCTWFD.js} +2 -2
- package/dist/bundle/failure-X7CYCJWD.js +66 -0
- package/dist/bundle/{first-run-D4VBIJ7H.js → first-run-OHQHOP5U.js} +11 -11
- package/dist/bundle/first-screen-ULF26GYG.js +30 -0
- package/dist/bundle/{instructions-QNPIVGKX.js → instructions-RS5VERM7.js} +1 -1
- package/dist/bundle/{mcp-YMXA6IH6.js → mcp-M4QN2E7R.js} +2 -2
- package/dist/bundle/mcp-TS2UAN5I.js +90 -0
- package/dist/bundle/memo.js +16 -16
- package/dist/bundle/{node-SPFML2D5.js → node-BU6NHYHF.js} +2 -2
- package/dist/bundle/{node-sqlite-T3KILRCP.js → node-sqlite-WAF44CWS.js} +6 -6
- package/dist/bundle/{oauth-ZOGSHZF3.js → oauth-T7RCNIYO.js} +7 -7
- package/dist/bundle/{open-XXFVCGCA.js → open-QLX2IVTC.js} +5 -5
- package/dist/bundle/{openai-JRHZLFKD.js → openai-O25HCJEY.js} +10 -10
- package/dist/bundle/{process-OGYYVVLG.js → process-SB2X3TKY.js} +1 -1
- package/dist/bundle/{program-EFCQACPD.js → program-SDLIDODQ.js} +62 -62
- package/dist/bundle/{prompt-53D5WVD3.js → prompt-OHVHUNV4.js} +5 -5
- package/dist/bundle/{recognize-7GYZKJCD.js → recognize-SESVG7O3.js} +4 -4
- package/dist/bundle/{remote-V5GUFZCG.js → remote-DNGLVDYJ.js} +7 -7
- package/dist/bundle/{rerank-FUNVBYFI.js → rerank-SF3OUPEB.js} +7 -7
- package/dist/bundle/{serve-ZLUYFAXC.js → serve-6RK7QFZ2.js} +9 -9
- package/dist/bundle/server-JKWE764O.js +61 -0
- package/dist/bundle/{server-HJRMD3XD.js → server-N6PCX7K7.js} +57 -57
- package/dist/bundle/server-RKGTOY4D.js +48 -0
- package/dist/bundle/{state-4P7H6KBM.js → state-J6WLL4TQ.js} +6 -6
- package/dist/bundle/{store-NILJK24C.js → store-R2PHK3FR.js} +13 -13
- package/dist/bundle/store-maintenance-command-LRZ5R3UM.js +48 -0
- package/dist/bundle/update-RV2WSULI.js +69 -0
- package/dist/doctor/command.d.ts +2 -0
- package/dist/doctor/command.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/bundle/auto-GB35FRTV.js +0 -86
- package/dist/bundle/command-contract-YYILWWYQ.js +0 -32
- package/dist/bundle/failure-AHPPXHAW.js +0 -66
- package/dist/bundle/first-screen-D7Q2U7VP.js +0 -30
- package/dist/bundle/mcp-AFXHH33V.js +0 -90
- package/dist/bundle/server-4OJC7ZWM.js +0 -61
- package/dist/bundle/server-CGUUZBLB.js +0 -48
- package/dist/bundle/store-maintenance-command-VP7CIBSS.js +0 -48
- package/dist/bundle/update-NPK4DT2E.js +0 -69
- /package/dist/bundle/{chunk-AT5Y62SD.js → chunk-IO44XLFM.js} +0 -0
- /package/dist/bundle/{chunk-JPGEFBRW.js → chunk-VOXIGICJ.js} +0 -0
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
INVOICE_STATUSES,
|
|
10
10
|
LINK_KINDS,
|
|
11
11
|
LINK_ORIGINS,
|
|
12
|
+
MEETING_FIELD_NAMES,
|
|
12
13
|
MEETING_FINDINGS_KIND,
|
|
13
14
|
MEMORY_KINDS,
|
|
14
15
|
MEMORY_SCOPES,
|
|
@@ -68,6 +69,7 @@ import {
|
|
|
68
69
|
orderTitle,
|
|
69
70
|
organization,
|
|
70
71
|
parseDecimal,
|
|
72
|
+
parseLucene,
|
|
71
73
|
parseMeetingQuery,
|
|
72
74
|
parseMeetingReference,
|
|
73
75
|
paymentEntryTitle,
|
|
@@ -100,11 +102,11 @@ import {
|
|
|
100
102
|
validateQuery,
|
|
101
103
|
walkQuery,
|
|
102
104
|
zonedMoment
|
|
103
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-TW643BIA.js";
|
|
104
106
|
import {
|
|
105
107
|
holdsCredential,
|
|
106
108
|
secretNamed
|
|
107
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-UHWQ2YXW.js";
|
|
108
110
|
import {
|
|
109
111
|
DEFAULT_STEMMERS,
|
|
110
112
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -117,27 +119,27 @@ import {
|
|
|
117
119
|
fold,
|
|
118
120
|
normalize,
|
|
119
121
|
parseStemmers
|
|
120
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-FTRFN3MU.js";
|
|
121
123
|
import {
|
|
122
124
|
DEFAULT_TASK_CATEGORIES,
|
|
123
125
|
sharedConfigPath,
|
|
124
126
|
storedTaskCategories,
|
|
125
127
|
taskCategoriesReader
|
|
126
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-U64G664E.js";
|
|
127
129
|
import {
|
|
128
130
|
refuseOwnerStoreInTests,
|
|
129
131
|
storePath
|
|
130
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-YO7AUGUT.js";
|
|
131
133
|
import {
|
|
132
134
|
quietSqliteWarning,
|
|
133
135
|
storeCapable
|
|
134
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-5BDWOMH6.js";
|
|
135
137
|
import {
|
|
136
138
|
PRAGMAS,
|
|
137
139
|
TIME_LIMIT_FUNCTION,
|
|
138
140
|
TimeLimitReached,
|
|
139
141
|
isQueryOnly
|
|
140
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-HE56X542.js";
|
|
141
143
|
import {
|
|
142
144
|
array,
|
|
143
145
|
boolean,
|
|
@@ -154,7 +156,7 @@ import {
|
|
|
154
156
|
safeParse,
|
|
155
157
|
strictObject,
|
|
156
158
|
string
|
|
157
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-EBNNONF5.js";
|
|
158
160
|
import {
|
|
159
161
|
resolveFrom
|
|
160
162
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -162,7 +164,7 @@ import {
|
|
|
162
164
|
CliError,
|
|
163
165
|
isCliError,
|
|
164
166
|
singleLine
|
|
165
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-BXTDAGM4.js";
|
|
166
168
|
import {
|
|
167
169
|
SQLiteTable,
|
|
168
170
|
TableAliasProxyHandler,
|
|
@@ -187,7 +189,7 @@ import {
|
|
|
187
189
|
sql,
|
|
188
190
|
sqliteTable,
|
|
189
191
|
text
|
|
190
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-RSJJGXZP.js";
|
|
191
193
|
import {
|
|
192
194
|
__commonJS,
|
|
193
195
|
__name,
|
|
@@ -9931,7 +9933,7 @@ var require_cjs = __commonJS({
|
|
|
9931
9933
|
}
|
|
9932
9934
|
});
|
|
9933
9935
|
|
|
9934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
9936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
9935
9937
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
9936
9938
|
const methods = whole;
|
|
9937
9939
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10059,7 +10061,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10059
10061
|
};
|
|
10060
10062
|
}, "bindAccount");
|
|
10061
10063
|
|
|
10062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10064
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
10063
10065
|
var SCHEME = "msg:";
|
|
10064
10066
|
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
|
|
10065
10067
|
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
@@ -10073,7 +10075,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
|
10073
10075
|
return { provider, account, chat: chat2, message: message2 };
|
|
10074
10076
|
}, "parseLocator");
|
|
10075
10077
|
|
|
10076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
10077
10079
|
var SIMPLE_REFERENCES = [
|
|
10078
10080
|
"note",
|
|
10079
10081
|
"document",
|
|
@@ -10224,7 +10226,7 @@ var looksLikeReference = /* @__PURE__ */ __name((text6) => {
|
|
|
10224
10226
|
return match !== null && byPrefix.has(match[1]);
|
|
10225
10227
|
}, "looksLikeReference");
|
|
10226
10228
|
|
|
10227
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
10228
10230
|
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events", "crm"];
|
|
10229
10231
|
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
10230
10232
|
var PROVIDERS = [
|
|
@@ -10340,7 +10342,7 @@ var providerNamed = /* @__PURE__ */ __name((word2) => {
|
|
|
10340
10342
|
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
10341
10343
|
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
10342
10344
|
|
|
10343
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
10344
10346
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
10345
10347
|
var inSource = /* @__PURE__ */ __name((source2, provider) => source2 === "all" || source2 === "bots" && isBotProvider(provider) || source2 === "personal" && !isBotProvider(provider) || source2 === provider || providerNamed(source2)?.name === provider || isKind(source2) && kindOf(provider) === source2, "inSource");
|
|
10346
10348
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -10363,7 +10365,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
10363
10365
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
10364
10366
|
}, "sourceOf");
|
|
10365
10367
|
|
|
10366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
10367
10369
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
10368
10370
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
10369
10371
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -10551,7 +10553,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf2 = (kind4)
|
|
|
10551
10553
|
return { accounts: [...chosen.values()], skipped };
|
|
10552
10554
|
}, "fitting");
|
|
10553
10555
|
|
|
10554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10556
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10555
10557
|
var IndexBuilderOn = class {
|
|
10556
10558
|
static {
|
|
10557
10559
|
__name(this, "IndexBuilderOn");
|
|
@@ -10746,7 +10748,7 @@ function alias(table, alias2) {
|
|
|
10746
10748
|
}
|
|
10747
10749
|
__name(alias, "alias");
|
|
10748
10750
|
|
|
10749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10751
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10750
10752
|
var ENTITY_TABLES = {
|
|
10751
10753
|
account: "accounts",
|
|
10752
10754
|
attachment: "attachments",
|
|
@@ -10792,7 +10794,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10792
10794
|
return { table, pointer, type, count, known: known2 };
|
|
10793
10795
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
10794
10796
|
|
|
10795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10797
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
10796
10798
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
10797
10799
|
id: integer("id").primaryKey(),
|
|
10798
10800
|
name: text("name").notNull().unique(),
|
|
@@ -10801,7 +10803,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
10801
10803
|
updatedAt: integer("updated_at").notNull()
|
|
10802
10804
|
});
|
|
10803
10805
|
|
|
10804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
10805
10807
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
10806
10808
|
sourceKey: text("source_key").notNull(),
|
|
10807
10809
|
collection: text("collection").notNull(),
|
|
@@ -10811,13 +10813,33 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
10811
10813
|
createdAt: integer("created_at").notNull()
|
|
10812
10814
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
10813
10815
|
|
|
10814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
10815
10817
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
10816
10818
|
id: integer("id").notNull(),
|
|
10817
10819
|
indexableType: text("indexable_type").notNull()
|
|
10818
10820
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
10819
10821
|
|
|
10820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10822
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
10823
|
+
var decisionRequests = sqliteTable("decision_requests", {
|
|
10824
|
+
id: integer("id").primaryKey(),
|
|
10825
|
+
tokenDigest: text("token_digest").notNull().unique(),
|
|
10826
|
+
proposalId: text("proposal_id").notNull(),
|
|
10827
|
+
action: text("action").notNull(),
|
|
10828
|
+
batchDigest: text("batch_digest").notNull(),
|
|
10829
|
+
channel: text("channel").notNull(),
|
|
10830
|
+
botProfile: text("bot_profile").notNull(),
|
|
10831
|
+
chatId: text("chat_id").notNull(),
|
|
10832
|
+
messageId: text("message_id").notNull(),
|
|
10833
|
+
ownerUserId: text("owner_user_id").notNull(),
|
|
10834
|
+
createdAt: integer("created_at").notNull(),
|
|
10835
|
+
expiresAt: integer("expires_at").notNull(),
|
|
10836
|
+
usedAt: integer("used_at"),
|
|
10837
|
+
cancelledAt: integer("cancelled_at")
|
|
10838
|
+
}, (table) => [
|
|
10839
|
+
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
10840
|
+
]);
|
|
10841
|
+
|
|
10842
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
10821
10843
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
10822
10844
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
10823
10845
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -10843,7 +10865,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
10843
10865
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
10844
10866
|
]);
|
|
10845
10867
|
|
|
10846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
10847
10869
|
var accounts = sqliteTable("accounts", {
|
|
10848
10870
|
id: integer("id").primaryKey(),
|
|
10849
10871
|
provider: text("provider").notNull(),
|
|
@@ -12629,7 +12651,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
12629
12651
|
at: integer("at").notNull()
|
|
12630
12652
|
});
|
|
12631
12653
|
|
|
12632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12654
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
12633
12655
|
var ARMS = [
|
|
12634
12656
|
[
|
|
12635
12657
|
"message",
|
|
@@ -12756,7 +12778,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
12756
12778
|
return recomputed;
|
|
12757
12779
|
}, "drainInvolvementQueue");
|
|
12758
12780
|
|
|
12759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
12760
12782
|
import { domainToUnicode } from "node:url";
|
|
12761
12783
|
|
|
12762
12784
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -22778,7 +22800,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
22778
22800
|
}, "oa");
|
|
22779
22801
|
var na = { parse: O, get: aa, isValid: oa };
|
|
22780
22802
|
|
|
22781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
22782
22804
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
22783
22805
|
var ID = /^[\w-]{10,}$/;
|
|
22784
22806
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -22819,7 +22841,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text6) => [...text6.matchAll(L
|
|
|
22819
22841
|
return { url, documentId: googleDocumentId(url) };
|
|
22820
22842
|
}), "googleDocumentLinks");
|
|
22821
22843
|
|
|
22822
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
22823
22845
|
var PHONE_PLANS = [
|
|
22824
22846
|
{
|
|
22825
22847
|
country: "us",
|
|
@@ -23199,7 +23221,7 @@ var PHONE_PLANS = [
|
|
|
23199
23221
|
}
|
|
23200
23222
|
];
|
|
23201
23223
|
|
|
23202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
23203
23225
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
23204
23226
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
23205
23227
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -23240,7 +23262,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
23240
23262
|
return void 0;
|
|
23241
23263
|
}, "nationalPhone");
|
|
23242
23264
|
|
|
23243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23265
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
23244
23266
|
var BEFORE = [
|
|
23245
23267
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
23246
23268
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -23500,7 +23522,7 @@ var findPlaces = /* @__PURE__ */ __name((text6) => {
|
|
|
23500
23522
|
return found2.sort((a, b) => a.start - b.start);
|
|
23501
23523
|
}, "findPlaces");
|
|
23502
23524
|
|
|
23503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
23504
23526
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
23505
23527
|
var MENTION_VERSIONS = {
|
|
23506
23528
|
phone: 1,
|
|
@@ -23690,7 +23712,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
23690
23712
|
};
|
|
23691
23713
|
}, "typedPhone");
|
|
23692
23714
|
|
|
23693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
23694
23716
|
var RUSSIAN = "\u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440 \u0410\u043B\u0435\u043A\u0441\u0435\u0439 \u0410\u043D\u0430\u0442\u043E\u043B\u0438\u0439 \u0410\u043D\u0434\u0440\u0435\u0439 \u0410\u043D\u0442\u043E\u043D \u0410\u0440\u043A\u0430\u0434\u0438\u0439 \u0410\u0440\u0441\u0435\u043D\u0438\u0439 \u0410\u0440\u0442\u0451\u043C \u0410\u0440\u0442\u0435\u043C \u0410\u0440\u0442\u0443\u0440 \u0411\u043E\u0440\u0438\u0441 \u0412\u0430\u0434\u0438\u043C \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D \u0412\u0430\u043B\u0435\u0440\u0438\u0439 \u0412\u0430\u0441\u0438\u043B\u0438\u0439 \u0412\u0438\u043A\u0442\u043E\u0440 \u0412\u0438\u0442\u0430\u043B\u0438\u0439 \u0412\u043B\u0430\u0434\u0438\u043C\u0438\u0440 \u0412\u043B\u0430\u0434\u0438\u0441\u043B\u0430\u0432 \u0412\u0441\u0435\u0432\u043E\u043B\u043E\u0434 \u0412\u044F\u0447\u0435\u0441\u043B\u0430\u0432 \u0413\u0435\u043D\u043D\u0430\u0434\u0438\u0439 \u0413\u0435\u043E\u0440\u0433\u0438\u0439 \u0413\u043B\u0435\u0431 \u0413\u0440\u0438\u0433\u043E\u0440\u0438\u0439 \u0414\u0430\u043D\u0438\u0438\u043B \u0414\u0430\u043D\u0438\u043B\u0430 \u0414\u0435\u043D\u0438\u0441 \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0415\u0432\u0433\u0435\u043D\u0438\u0439 \u0415\u0433\u043E\u0440 \u0418\u0432\u0430\u043D \u0418\u0433\u043E\u0440\u044C \u0418\u043B\u044C\u044F \u041A\u0438\u0440\u0438\u043B\u043B \u041A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u0438\u043D \u041B\u0435\u043E\u043D\u0438\u0434 \u041C\u0430\u043A\u0441\u0438\u043C \u041C\u0430\u0440\u0430\u0442 \u041C\u0430\u0442\u0432\u0435\u0439 \u041C\u0438\u0445\u0430\u0438\u043B \u041D\u0438\u043A\u0438\u0442\u0430 \u041D\u0438\u043A\u043E\u043B\u0430\u0439 \u041E\u043B\u0435\u0433 \u041F\u0430\u0432\u0435\u043B \u041F\u0451\u0442\u0440 \u041F\u0435\u0442\u0440 \u0420\u043E\u0434\u0438\u043E\u043D \u0420\u043E\u0441\u0442\u0438\u0441\u043B\u0430\u0432 \u0420\u0443\u0441\u043B\u0430\u043D \u0420\u0443\u0441\u0442\u0430\u043C \u0421\u0435\u043C\u0451\u043D \u0421\u0435\u043C\u0435\u043D \u0421\u0435\u0440\u0433\u0435\u0439 \u0421\u0442\u0430\u043D\u0438\u0441\u043B\u0430\u0432 \u0421\u0442\u0435\u043F\u0430\u043D \u0422\u0438\u043C\u043E\u0444\u0435\u0439 \u0422\u0438\u043C\u0443\u0440 \u0424\u0451\u0434\u043E\u0440 \u0424\u0435\u0434\u043E\u0440 \u0424\u0438\u043B\u0438\u043F\u043F \u042D\u0434\u0443\u0430\u0440\u0434 \u042E\u0440\u0438\u0439 \u042F\u0440\u043E\u0441\u043B\u0430\u0432 \u042F\u043A\u043E\u0432 \u042D\u043B\u044C\u0434\u0430\u0440 \u0414\u0430\u0432\u0438\u0434 \u0417\u0430\u0445\u0430\u0440 \u0421\u0430\u0432\u0435\u043B\u0438\u0439 \u041C\u0438\u0440\u043E\u043D \u041F\u043B\u0430\u0442\u043E\u043D \u0414\u0435\u043C\u0438\u0434 \u0410\u0440\u0441\u0435\u043D \u041D\u0443\u0440\u043B\u0430\u043D \u0410\u043D\u0437\u043E\u0440 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u0430 \u0410\u043B\u0438\u043D\u0430 \u0410\u043B\u0438\u0441\u0430 \u0410\u043B\u043B\u0430 \u0410\u043D\u0430\u0441\u0442\u0430\u0441\u0438\u044F \u0410\u043D\u0433\u0435\u043B\u0438\u043D\u0430 \u0410\u043D\u043D\u0430 \u0410\u043D\u0442\u043E\u043D\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u0440\u0438\u044F \u0412\u0430\u0440\u0432\u0430\u0440\u0430 \u0412\u0435\u0440\u043E\u043D\u0438\u043A\u0430 \u0412\u0438\u043A\u0442\u043E\u0440\u0438\u044F \u0413\u0430\u043B\u0438\u043D\u0430 \u0414\u0430\u0440\u044C\u044F \u0414\u0438\u0430\u043D\u0430 \u0415\u0432\u0433\u0435\u043D\u0438\u044F \u0415\u043A\u0430\u0442\u0435\u0440\u0438\u043D\u0430 \u0415\u043B\u0435\u043D\u0430 \u0415\u043B\u0438\u0437\u0430\u0432\u0435\u0442\u0430 \u0416\u0430\u043D\u043D\u0430 \u0417\u0438\u043D\u0430\u0438\u0434\u0430 \u041A\u0430\u0440\u0438\u043D\u0430 \u041A\u0438\u0440\u0430 \u041A\u043B\u0430\u0432\u0434\u0438\u044F \u041A\u0440\u0438\u0441\u0442\u0438\u043D\u0430 \u041A\u0441\u0435\u043D\u0438\u044F \u041B\u0430\u0440\u0438\u0441\u0430 \u041B\u0438\u0434\u0438\u044F \u041B\u044E\u0434\u043C\u0438\u043B\u0430 \u041C\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430 \u041C\u0430\u0440\u0438\u043D\u0430 \u041C\u0430\u0440\u0438\u044F \u041C\u0438\u043B\u0430\u043D\u0430 \u041D\u0430\u0442\u0430\u043B\u044C\u044F \u041D\u0430\u0442\u0430\u043B\u0438\u044F \u041D\u0438\u043D\u0430 \u041E\u043A\u0441\u0430\u043D\u0430 \u041E\u043B\u0435\u0441\u044F \u041E\u043B\u044C\u0433\u0430 \u041F\u043E\u043B\u0438\u043D\u0430 \u0420\u0430\u0438\u0441\u0430 \u0421\u0432\u0435\u0442\u043B\u0430\u043D\u0430 \u0421\u043E\u0444\u0438\u044F \u0421\u043E\u0444\u044C\u044F \u0422\u0430\u0438\u0441\u0438\u044F \u0422\u0430\u043C\u0430\u0440\u0430 \u0422\u0430\u0442\u044C\u044F\u043D\u0430 \u0423\u043B\u044C\u044F\u043D\u0430 \u042E\u043B\u0438\u044F \u042D\u043B\u044C\u0432\u0438\u0440\u0430 \u0420\u0435\u0433\u0438\u043D\u0430 \u0421\u043D\u0435\u0436\u0430\u043D\u0430 \u0410\u043B\u0451\u043D\u0430 \u0410\u043B\u0435\u043D\u0430 \u0412\u0430\u0441\u0438\u043B\u0438\u0441\u0430 \u0410\u0440\u0438\u043D\u0430 \u0415\u0441\u0435\u043D\u0438\u044F \u042D\u0432\u0435\u043B\u0438\u043D\u0430 \u0421\u0430\u0448\u0430 \u0416\u0435\u043D\u044F \u0412\u0430\u043B\u044F \u0414\u0438\u043C\u0430 \u041C\u0438\u0448\u0430 \u041A\u043E\u043B\u044F \u041F\u0435\u0442\u044F \u0412\u0430\u0441\u044F \u0421\u0435\u0440\u0451\u0436\u0430 \u0421\u0435\u0440\u0435\u0436\u0430 \u041F\u0430\u0448\u0430 \u041B\u0451\u0448\u0430 \u041B\u0435\u0448\u0430 \u0412\u0438\u0442\u044F \u041A\u043E\u0441\u0442\u044F \u0412\u043E\u0432\u0430 \u0412\u043E\u043B\u043E\u0434\u044F \u0412\u0430\u043D\u044F \u0413\u043E\u0448\u0430 \u0413\u0440\u0438\u0448\u0430 \u0422\u043E\u043B\u044F \u0411\u043E\u0440\u044F \u0421\u0442\u0430\u0441 \u0422\u0451\u043C\u0430 \u0422\u0430\u043D\u044F \u041A\u0430\u0442\u044F \u041B\u0435\u043D\u0430 \u041D\u0430\u0442\u0430\u0448\u0430 \u0421\u0432\u0435\u0442\u0430 \u042E\u043B\u044F \u041D\u0430\u0441\u0442\u044F \u0414\u0430\u0448\u0430 \u041C\u0430\u0448\u0430 \u041B\u044E\u0434\u0430 \u0413\u0430\u043B\u044F \u0412\u0438\u043A\u0430 \u041A\u0441\u044E\u0448\u0430 \u041B\u0438\u0437\u0430 \u0421\u043E\u043D\u044F \u041D\u0430\u0434\u044F \u041B\u0435\u0440\u0430 \u0410\u043B\u0451\u0448\u0430 \u0410\u043B\u0435\u0448\u0430 \u041C\u0438\u0442\u044F \u0421\u0435\u043D\u044F \u0424\u0435\u0434\u044F \u0416\u0435\u043D\u0435\u0447\u043A\u0430 \u041E\u043B\u0435\u043D\u044C\u043A\u0430 \u0422\u0430\u043D\u0435\u0447\u043A\u0430";
|
|
23695
23717
|
var EUROPEAN = "James John Robert Michael William David Richard Joseph Thomas Charles Christopher Daniel Matthew Anthony Donald Steven Paul Andrew Joshua Kenneth Kevin Brian George Timothy Ronald Edward Jason Jeffrey Ryan Jacob Gary Nicholas Eric Jonathan Stephen Larry Justin Scott Brandon Benjamin Samuel Gregory Alexander Patrick Raymond Dennis Jerry Tyler Aaron Nathan Henry Peter Zachary Douglas Harold Kyle Noah Ethan Oliver Harry Lucas Liam Mary Patricia Jennifer Linda Elizabeth Barbara Susan Jessica Sarah Karen Lisa Nancy Betty Margaret Sandra Ashley Kimberly Emily Donna Michelle Carol Amanda Dorothy Melissa Deborah Stephanie Rebecca Sharon Laura Cynthia Kathleen Angela Shirley Anna Brenda Pamela Emma Nicole Helen Samantha Katherine Christine Rachel Carolyn Janet Catherine Maria Heather Diane Ruth Julie Olivia Joyce Kelly Lauren Christina Joan Evelyn Judith Megan Andrea Cheryl Hannah Jacqueline Martha Teresa Sara Madison Frances Kathryn Janice Abigail Alice Julia Judy Sophia Denise Doris Marilyn Danielle Beverly Isabella Theresa Diana Natalie Charlotte Marie Kayla Alexis Javier Carlos Antonio Manuel Francisco Juan Pedro Alejandro Miguel Rafael Pablo Sergio Fernando Jorge Luis Alberto \xC1lvaro Diego Adri\xE1n Rub\xE9n Iv\xE1n \xD3scar Andr\xE9s Ra\xFAl Enrique Vicente Joaqu\xEDn Ignacio Gonzalo Marcos V\xEDctor Jaime Alfonso Guillermo Tom\xE1s Emilio Gabriel Nicol\xE1s Mart\xEDn Jordi Josep Xavier Luc\xEDa Carmen Isabel Cristina Marta Elena Raquel Silvia Beatriz Paula Nuria N\xFAria Sonia Alicia Irene Montserrat Inmaculada Noelia Lorena Sof\xEDa Valeria Claudia Natalia Sandra Ver\xF3nica Esther Yolanda Vanesa Laia Klaus J\xFCrgen Wolfgang Stefan Andreas Matthias Markus Tobias Florian Lukas Jonas Maximilian Sebastian Dirk Sabine Ursula Petra Monika Katrin Anja Pierre Michel Philippe Alain Fran\xE7ois Christophe Laurent Olivier Julien Mathieu S\xE9bastien Guillaume Antoine Camille Nathalie Isabelle Sylvie Sophie C\xE9line Aur\xE9lie Chlo\xE9 Manon Giuseppe Giovanni Marco Luca Francesco Alessandro Matteo Lorenzo Stefano Paolo Roberto Davide Simone Federico Giulia Francesca Chiara Valentina Alessia Martina Elisa Jo\xE3o Pedro Tiago Beatriz In\xEAs Mariana Piotr Krzysztof Tomasz Marcin Agnieszka Katarzyna Ma\u0142gorzata Magdalena";
|
|
23696
23718
|
var WORDS = "\u0412\u0435\u0440\u0430 \u041D\u0430\u0434\u0435\u0436\u0434\u0430 \u041B\u044E\u0431\u043E\u0432\u044C \u0421\u043B\u0430\u0432\u0430 \u0420\u043E\u043C\u0430\u043D \u0420\u043E\u0437\u0430 \u041C\u0430\u0439\u044F \u041B\u0438\u043B\u0438\u044F \u0417\u043B\u0430\u0442\u0430 \u041C\u0438\u043B\u0430 \u041D\u0438\u043A\u0430 \u041B\u0435\u0432 \u0413\u043B\u043E\u0440\u0438\u044F Will Mark Rose Grace Hope Faith Bill Frank Jack June April Summer Amber Ruby Lily Daisy Victoria Virginia Georgia Florence Sydney Chelsea Jordan Austin Dallas Mercedes Dolores Rosa Pilar Marina Esperanza Gloria Amparo Consuelo Roc\xEDo Salvador Santiago Jes\xFAs \xC1ngeles Hugo Ram\xF3n Christian Felix F\xE9lix Mario Martin Victor Pierre Paz Merc\xE8 Estrella Aurora Concepci\xF3n Remedios Soledad Milagros Angel \xC1ngel Dawn Joy Holly Ivy Iris Violet Pearl";
|
|
@@ -23698,7 +23720,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
23698
23720
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
23699
23721
|
var NAME_WORDS = WORDS.split(" ");
|
|
23700
23722
|
|
|
23701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
23702
23724
|
var LATIN_TO_CYRILLIC = {
|
|
23703
23725
|
shch: "\u0449",
|
|
23704
23726
|
sch: "\u0449",
|
|
@@ -23906,7 +23928,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text6, stem, taken) => {
|
|
|
23906
23928
|
return found2;
|
|
23907
23929
|
}, "findUnknownNames");
|
|
23908
23930
|
|
|
23909
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23931
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
23910
23932
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
23911
23933
|
"webpage",
|
|
23912
23934
|
"share",
|
|
@@ -23946,7 +23968,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
23946
23968
|
});
|
|
23947
23969
|
}, "matchDownloads");
|
|
23948
23970
|
|
|
23949
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23971
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
23950
23972
|
var QUERY_VERSION = 1;
|
|
23951
23973
|
var QUERY_LIMITS2 = {
|
|
23952
23974
|
...QUERY_LIMITS,
|
|
@@ -23982,7 +24004,7 @@ function exhausted(budget) {
|
|
|
23982
24004
|
}
|
|
23983
24005
|
__name(exhausted, "exhausted");
|
|
23984
24006
|
|
|
23985
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
23986
24008
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
23987
24009
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
23988
24010
|
kind: "char",
|
|
@@ -24283,7 +24305,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
24283
24305
|
const chars = [...pattern.normalize("NFC")];
|
|
24284
24306
|
let out = "";
|
|
24285
24307
|
let at = 0;
|
|
24286
|
-
const
|
|
24308
|
+
const literal5 = /* @__PURE__ */ __name((c) => {
|
|
24287
24309
|
if (!/[\p{L}\p{N}\p{M}]/u.test(c))
|
|
24288
24310
|
return c;
|
|
24289
24311
|
const folded5 = fold(c);
|
|
@@ -24362,7 +24384,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
24362
24384
|
if (next === void 0)
|
|
24363
24385
|
out += c;
|
|
24364
24386
|
else
|
|
24365
|
-
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` :
|
|
24387
|
+
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` : literal5(next);
|
|
24366
24388
|
} else if (c === '"') {
|
|
24367
24389
|
const end = chars.indexOf('"', at);
|
|
24368
24390
|
if (end < 0) {
|
|
@@ -24377,12 +24399,12 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
24377
24399
|
} else if (c === "[")
|
|
24378
24400
|
characterClass();
|
|
24379
24401
|
else
|
|
24380
|
-
out +=
|
|
24402
|
+
out += literal5(c);
|
|
24381
24403
|
}
|
|
24382
24404
|
return out;
|
|
24383
24405
|
}, "foldRegex");
|
|
24384
24406
|
|
|
24385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
24386
24408
|
var PRESET_VERSION = 1;
|
|
24387
24409
|
var PRESETS = {
|
|
24388
24410
|
password: {
|
|
@@ -24436,7 +24458,7 @@ var PRESETS = {
|
|
|
24436
24458
|
}
|
|
24437
24459
|
};
|
|
24438
24460
|
|
|
24439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
24440
24462
|
var FIELD_VERSION = 2;
|
|
24441
24463
|
var UNITS = {
|
|
24442
24464
|
"": 1,
|
|
@@ -24897,12 +24919,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
24897
24919
|
return validateFields(parsed3.output);
|
|
24898
24920
|
}, "validateAst");
|
|
24899
24921
|
|
|
24900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
24901
24923
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
24902
24924
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
24903
24925
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
24904
24926
|
|
|
24905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24927
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
24906
24928
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
24907
24929
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
24908
24930
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -24926,7 +24948,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
24926
24948
|
};
|
|
24927
24949
|
}, "linkMatch");
|
|
24928
24950
|
|
|
24929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
24930
24952
|
var SETTING = "phoneCountries";
|
|
24931
24953
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
24932
24954
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -24957,7 +24979,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
24957
24979
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
24958
24980
|
}, "valueMatch");
|
|
24959
24981
|
|
|
24960
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24982
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
24961
24983
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
24962
24984
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
24963
24985
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -24985,7 +25007,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
24985
25007
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
24986
25008
|
}, "vocabularySimilarity");
|
|
24987
25009
|
|
|
24988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
24989
25011
|
import { createHash } from "node:crypto";
|
|
24990
25012
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
24991
25013
|
try {
|
|
@@ -25051,7 +25073,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind4, by, options
|
|
|
25051
25073
|
});
|
|
25052
25074
|
}, "guardTagCreation");
|
|
25053
25075
|
|
|
25054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25076
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
25055
25077
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
25056
25078
|
throw new CliError("validation_error", message2);
|
|
25057
25079
|
}, "invalid");
|
|
@@ -25128,7 +25150,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
25128
25150
|
};
|
|
25129
25151
|
}, "createTagRedirectIndex");
|
|
25130
25152
|
|
|
25131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
25132
25154
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
25133
25155
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
25134
25156
|
if (!row2)
|
|
@@ -25156,7 +25178,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
25156
25178
|
return snapshot2;
|
|
25157
25179
|
}, "tagRedirectSnapshot");
|
|
25158
25180
|
|
|
25159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
25160
25182
|
import { createHash as createHash2 } from "node:crypto";
|
|
25161
25183
|
var TASK_KEY_PREFIXES = {
|
|
25162
25184
|
question: "Q",
|
|
@@ -25184,7 +25206,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
25184
25206
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
25185
25207
|
}, "taskAccountOf");
|
|
25186
25208
|
|
|
25187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
25188
25210
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
25189
25211
|
var REFERABLE = {
|
|
25190
25212
|
note: { tombstone: true },
|
|
@@ -25352,7 +25374,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
25352
25374
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
25353
25375
|
}, "taskIdOf");
|
|
25354
25376
|
|
|
25355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
25356
25378
|
var toMs = /* @__PURE__ */ __name((iso14) => {
|
|
25357
25379
|
if (iso14 === null || iso14 === void 0)
|
|
25358
25380
|
return null;
|
|
@@ -25366,7 +25388,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
25366
25388
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
25367
25389
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
25368
25390
|
|
|
25369
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
25370
25392
|
var TAG_KINDS = ["tag", "topic"];
|
|
25371
25393
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
25372
25394
|
var TAG_TYPE = {
|
|
@@ -25569,7 +25591,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
25569
25591
|
return result;
|
|
25570
25592
|
}, "tagsOf");
|
|
25571
25593
|
|
|
25572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
25573
25595
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
25574
25596
|
var SPEECH = speech("att");
|
|
25575
25597
|
var mentionText = /* @__PURE__ */ __name((alias2) => `CASE WHEN coalesce(json_extract(${alias2}.contact, '$.phone'), '') <> '' THEN 'phone: ' || json_extract(${alias2}.contact, '$.phone') ELSE ${alias2}.text END`, "mentionText");
|
|
@@ -25933,7 +25955,7 @@ var FIELD_COMPILERS = {
|
|
|
25933
25955
|
subject
|
|
25934
25956
|
};
|
|
25935
25957
|
|
|
25936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
25937
25959
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
25938
25960
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
25939
25961
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -25949,7 +25971,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
25949
25971
|
};
|
|
25950
25972
|
}, "placeOf");
|
|
25951
25973
|
|
|
25952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25974
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
25953
25975
|
var DRAIN_ON_WRITE = 500;
|
|
25954
25976
|
var METHOD = "rules";
|
|
25955
25977
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -26101,18 +26123,18 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
26101
26123
|
if (queued.length === 0)
|
|
26102
26124
|
return 0;
|
|
26103
26125
|
const write2 = writer(database, now2, void 0);
|
|
26104
|
-
const
|
|
26126
|
+
const read3 = Object.fromEntries(SOURCE_TYPES.map((type) => [type, database.prepare(SOURCES[type].one)]));
|
|
26105
26127
|
const dequeue = database.prepare("DELETE FROM mention_pending WHERE source_type = ? AND source_id = ?");
|
|
26106
26128
|
for (const { type, pk } of queued) {
|
|
26107
26129
|
const known2 = SOURCE_TYPES.find((one2) => one2 === type);
|
|
26108
26130
|
if (known2)
|
|
26109
|
-
write2(known2, pk, sourceOf2(
|
|
26131
|
+
write2(known2, pk, sourceOf2(read3[known2]?.get(pk)));
|
|
26110
26132
|
dequeue.run(type, pk);
|
|
26111
26133
|
}
|
|
26112
26134
|
return queued.length;
|
|
26113
26135
|
}, "drainMentions");
|
|
26114
26136
|
|
|
26115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
26116
26138
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
26117
26139
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
26118
26140
|
if (!exists2)
|
|
@@ -26120,7 +26142,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
26120
26142
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
26121
26143
|
}, "indexRow");
|
|
26122
26144
|
|
|
26123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
26124
26146
|
var INDEX = "message_stems";
|
|
26125
26147
|
var SETTING2 = "searchStemmers";
|
|
26126
26148
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -26193,7 +26215,7 @@ var claim = /* @__PURE__ */ __name((database, identity) => {
|
|
|
26193
26215
|
return built === identity;
|
|
26194
26216
|
}, "claim");
|
|
26195
26217
|
var stemWriter = /* @__PURE__ */ __name((database, stemmer) => {
|
|
26196
|
-
const
|
|
26218
|
+
const read3 = database.prepare(`SELECT id AS pk, text, 'c' || chat_id || coalesce(' s' || sender_identity_id, '') AS scope
|
|
26197
26219
|
FROM messages WHERE id > ? AND id <= ?`);
|
|
26198
26220
|
const one2 = database.prepare("SELECT text, 'c' || chat_id || coalesce(' s' || sender_identity_id, '') AS scope FROM messages WHERE id = ?");
|
|
26199
26221
|
const write2 = database.prepare("INSERT OR REPLACE INTO message_stems (rowid, stems, scope) VALUES (?, ?, ?)");
|
|
@@ -26208,7 +26230,7 @@ var stemWriter = /* @__PURE__ */ __name((database, stemmer) => {
|
|
|
26208
26230
|
}, "restem");
|
|
26209
26231
|
return {
|
|
26210
26232
|
range: /* @__PURE__ */ __name((from2, to) => {
|
|
26211
|
-
const rows =
|
|
26233
|
+
const rows = read3.all(from2, to);
|
|
26212
26234
|
for (const row2 of rows)
|
|
26213
26235
|
restem(Number(row2.pk), row2);
|
|
26214
26236
|
return rows.length;
|
|
@@ -26242,7 +26264,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
26242
26264
|
};
|
|
26243
26265
|
}, "stemmerCache");
|
|
26244
26266
|
|
|
26245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26267
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
26246
26268
|
var SQLITE_BUSY = 5;
|
|
26247
26269
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
26248
26270
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -26337,7 +26359,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
26337
26359
|
}
|
|
26338
26360
|
}, "read");
|
|
26339
26361
|
|
|
26340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
26341
26363
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
26342
26364
|
coalesce(CASE k.chunkable_type
|
|
26343
26365
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -26479,7 +26501,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
26479
26501
|
}, "dropUnusedVectors");
|
|
26480
26502
|
var dropAllUnusedVectors = /* @__PURE__ */ __name((database) => database.prepare("DELETE FROM embeddings WHERE NOT EXISTS (SELECT 1 FROM chunks k WHERE k.content_hash = embeddings.content_hash) RETURNING 1").all().length, "dropAllUnusedVectors");
|
|
26481
26503
|
|
|
26482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26504
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
26483
26505
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null) => Number(orm.insert(accounts).values({ provider, externalId: account, name, scope: scope3 ?? "personal", createdAt: now2(), updatedAt: now2() }).onConflictDoUpdate({
|
|
26484
26506
|
target: [accounts.provider, accounts.externalId],
|
|
26485
26507
|
set: {
|
|
@@ -26589,7 +26611,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
26589
26611
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
26590
26612
|
}, "dropOrphanPeople");
|
|
26591
26613
|
|
|
26592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
26593
26615
|
var FOLDED = [
|
|
26594
26616
|
{ table: "tasks", column: "title" },
|
|
26595
26617
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -26626,7 +26648,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
26626
26648
|
return filled2;
|
|
26627
26649
|
}, "fillFolded");
|
|
26628
26650
|
|
|
26629
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26651
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
26630
26652
|
var HISTORY_KEY = "$history";
|
|
26631
26653
|
var objectOf = /* @__PURE__ */ __name((text6) => {
|
|
26632
26654
|
if (typeof text6 !== "string")
|
|
@@ -26702,7 +26724,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
26702
26724
|
return rest;
|
|
26703
26725
|
}, "withoutHistory");
|
|
26704
26726
|
|
|
26705
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
26706
26728
|
import { createHash as createHash3 } from "node:crypto";
|
|
26707
26729
|
var CHUNK_CHARS = 1200;
|
|
26708
26730
|
var CHUNK_OVERLAP = 150;
|
|
@@ -26807,7 +26829,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
26807
26829
|
return chunks2;
|
|
26808
26830
|
}, "cutChunks");
|
|
26809
26831
|
|
|
26810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
26811
26833
|
var DAY = 864e5;
|
|
26812
26834
|
var CURRENCY = [
|
|
26813
26835
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -26933,7 +26955,7 @@ var dueDayOf = /* @__PURE__ */ __name((text6, createdMs) => {
|
|
|
26933
26955
|
return best?.day ?? null;
|
|
26934
26956
|
}, "dueDayOf");
|
|
26935
26957
|
|
|
26936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
26937
26959
|
var DAY2 = 864e5;
|
|
26938
26960
|
var STOP_WORDS = new Set([
|
|
26939
26961
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -27088,7 +27110,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
27088
27110
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
27089
27111
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
27090
27112
|
|
|
27091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
27092
27114
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
27093
27115
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
27094
27116
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -27359,7 +27381,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
27359
27381
|
};
|
|
27360
27382
|
}, "readiness");
|
|
27361
27383
|
|
|
27362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27384
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
27363
27385
|
var DOCUMENT_PICTURE = "document_picture";
|
|
27364
27386
|
var SCAN_PAGE2 = 5e3;
|
|
27365
27387
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -27422,10 +27444,10 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
27422
27444
|
}, "nearestPictures")
|
|
27423
27445
|
}), "documentPicturesOver");
|
|
27424
27446
|
|
|
27425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
27426
27448
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
27427
|
-
const
|
|
27428
|
-
return wildcard ?? (/[*?[]/u.test(
|
|
27449
|
+
const literal5 = escaped2 ?? plain2 ?? "";
|
|
27450
|
+
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
27429
27451
|
}).join(""), "glob");
|
|
27430
27452
|
var like = /* @__PURE__ */ __name((value) => value.toLowerCase().replace(/[\\%_]/gu, "\\$&").replaceAll("*", "%").replaceAll("?", "_"), "like");
|
|
27431
27453
|
var leaf = /* @__PURE__ */ __name((node, columns, options) => {
|
|
@@ -27487,7 +27509,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
27487
27509
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
27488
27510
|
var bound2 = /* @__PURE__ */ __name(({ sql: text6, params }) => sql.join(text6.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
|
|
27489
27511
|
|
|
27490
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27512
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
27491
27513
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
27492
27514
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
27493
27515
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -27577,7 +27599,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
27577
27599
|
});
|
|
27578
27600
|
}, "linkMeeting");
|
|
27579
27601
|
|
|
27580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27602
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
27581
27603
|
var EVENT_TEXT = "trim(coalesce(e.description, '') || ' ' || coalesce(e.location, '') || ' ' || coalesce((SELECT group_concat(p.name, ' ') FROM calendar_entries ce JOIN calendar_entry_participants p ON p.entry_id = ce.id WHERE ce.event_id = e.id AND ce.deleted_at IS NULL AND p.resource = 0 AND p.name IS NOT NULL), ''))";
|
|
27582
27604
|
var UNSEARCHED_EVENT_TYPES = [
|
|
27583
27605
|
"working-location",
|
|
@@ -27714,7 +27736,7 @@ var storedSections = /* @__PURE__ */ __name((metadata3) => {
|
|
|
27714
27736
|
}
|
|
27715
27737
|
}, "storedSections");
|
|
27716
27738
|
var writer2 = /* @__PURE__ */ __name((database, corpus, stemmer) => {
|
|
27717
|
-
const
|
|
27739
|
+
const read3 = database.prepare(corpus.read);
|
|
27718
27740
|
const oldHashes = database.prepare("SELECT content_hash AS hash FROM chunks WHERE chunkable_type = ? AND chunkable_id = ?");
|
|
27719
27741
|
const statements = {
|
|
27720
27742
|
dropWords: database.prepare(`DELETE FROM ${corpus.type}_words WHERE rowid = ?`),
|
|
@@ -27728,7 +27750,7 @@ var writer2 = /* @__PURE__ */ __name((database, corpus, stemmer) => {
|
|
|
27728
27750
|
dequeue: database.prepare(`DELETE FROM ${corpus.type}_index_pending WHERE indexable_type = ? AND id = ?`)
|
|
27729
27751
|
};
|
|
27730
27752
|
return (id2) => {
|
|
27731
|
-
const row2 =
|
|
27753
|
+
const row2 = read3.get(id2);
|
|
27732
27754
|
const before2 = oldHashes.all(corpus.type, id2).map((hash2) => String(hash2.hash));
|
|
27733
27755
|
statements.dropWords.run(id2);
|
|
27734
27756
|
statements.dropStems.run(id2);
|
|
@@ -27809,7 +27831,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
27809
27831
|
return true;
|
|
27810
27832
|
}, "resetNoteIndex");
|
|
27811
27833
|
|
|
27812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27834
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
27813
27835
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
27814
27836
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
27815
27837
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -27828,7 +27850,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
27828
27850
|
}
|
|
27829
27851
|
}, "resolvePersonLinks");
|
|
27830
27852
|
|
|
27831
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
27832
27854
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
27833
27855
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
27834
27856
|
find: orm.select({
|
|
@@ -28053,7 +28075,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
28053
28075
|
}, "meetingIdentityPk");
|
|
28054
28076
|
var phoneOf = /* @__PURE__ */ __name(({ orm }, provider, nativeId) => orm.select({ phone: identities.phone }).from(identities).where(and(eq(identities.provider, provider), eq(identities.externalId, nativeId))).get()?.phone ?? null, "phoneOf");
|
|
28055
28077
|
|
|
28056
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
28057
28079
|
var chatOf = /* @__PURE__ */ __name(({ orm }, accountKey, chatKey) => orm.select({ id: chats.externalId }).from(chats).where(and(eq(chats.id, chatKey), eq(chats.accountId, accountKey))).get()?.id, "chatOf");
|
|
28058
28080
|
var findChatPk = /* @__PURE__ */ __name(({ orm }, accountKey, chatId) => orm.select({ pk: chats.id }).from(chats).where(and(eq(chats.accountId, accountKey), eq(chats.externalId, chatId))).get()?.pk, "findChatPk");
|
|
28059
28081
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -28333,7 +28355,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
28333
28355
|
}
|
|
28334
28356
|
}, "replaceAutoTags");
|
|
28335
28357
|
|
|
28336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
28337
28359
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
28338
28360
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
28339
28361
|
var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
|
|
@@ -28352,7 +28374,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
28352
28374
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
28353
28375
|
}, "counterFreshness");
|
|
28354
28376
|
|
|
28355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
28356
28378
|
import { createHash as createHash4 } from "node:crypto";
|
|
28357
28379
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
28358
28380
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -28450,7 +28472,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
28450
28472
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
28451
28473
|
}, "contextEvidenceRequest");
|
|
28452
28474
|
|
|
28453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
28454
28476
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
28455
28477
|
var ACTIVITY = `
|
|
28456
28478
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -28580,7 +28602,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
28580
28602
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
28581
28603
|
}), "mailActivity");
|
|
28582
28604
|
|
|
28583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28605
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
28584
28606
|
var GREETING = new RegExp("^(hi|hello|hey|dear|greetings|good (morning|afternoon|evening)|\u043F\u0440\u0438\u0432\u0435\u0442|\u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439(\u0442\u0435)?|\u0434\u043E\u0431\u0440(\u044B\u0439|\u043E\u0435|\u043E\u0433\u043E) (\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440|\u0443\u0442\u0440\u043E|\u0443\u0442\u0440\u0430|\u0434\u043D\u044F)|hola|buen(os|as) (d\xEDas|dias|tardes|noches)|estimad[oa]s?|querid[oa]s?)(?![\\p{L}\\p{N}])([\\s,]+\\p{L}[\\p{L}.'\u2019-]*){0,3}\\s*[,!.:]?$", "iu");
|
|
28585
28607
|
var SIGN_OFF = /^(best|best regards|best wishes|kind regards|warm regards|regards|thanks|thanks again|thanks a lot|thank you|many thanks|cheers|sincerely|yours|yours truly|yours sincerely|br|с уважением|спасибо|заранее спасибо|всего доброго|всего хорошего|un saludo|saludos|saludos cordiales|atentamente|gracias|muchas gracias)[\s,.!]*$/iu;
|
|
28586
28608
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -28653,8 +28675,8 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
28653
28675
|
const lines = body2.replace(/\r\n?/g, "\n").split("\n");
|
|
28654
28676
|
const held = earlier.map(flat);
|
|
28655
28677
|
const drop = /* @__PURE__ */ new Set();
|
|
28656
|
-
for (const { start, end, quoted:
|
|
28657
|
-
if (alreadyHeld(
|
|
28678
|
+
for (const { start, end, quoted: quoted4 } of quoteBlocks(lines))
|
|
28679
|
+
if (alreadyHeld(quoted4, held))
|
|
28658
28680
|
for (let i = start; i < end; i++)
|
|
28659
28681
|
drop.add(i);
|
|
28660
28682
|
const kept = trimEdges(lines.filter((_, i) => !drop.has(i)));
|
|
@@ -28721,7 +28743,7 @@ var mailOwnText = /* @__PURE__ */ __name((body2) => {
|
|
|
28721
28743
|
return text6 || body2.trim();
|
|
28722
28744
|
}, "mailOwnText");
|
|
28723
28745
|
|
|
28724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28746
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
28725
28747
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
28726
28748
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
28727
28749
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -28831,7 +28853,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
28831
28853
|
return emails3 + threads;
|
|
28832
28854
|
}, "drainEmailIndex");
|
|
28833
28855
|
|
|
28834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
28835
28857
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
28836
28858
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
28837
28859
|
var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalidity) => database.prepare(`SELECT l.uid, e.external_id, coalesce(e.received_at, e.sent_at) AS at, e.read, e.flagged,
|
|
@@ -28929,7 +28951,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
28929
28951
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
28930
28952
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
28931
28953
|
|
|
28932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
28933
28955
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
28934
28956
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
28935
28957
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -28946,8 +28968,8 @@ var setEmailFlags = /* @__PURE__ */ __name((database, accountId, flags, now2) =>
|
|
|
28946
28968
|
WHERE account_id = ? AND external_id = ?
|
|
28947
28969
|
AND ((? IS NOT NULL AND read IS NOT ?) OR (? IS NOT NULL AND flagged IS NOT ?))`);
|
|
28948
28970
|
let changed = 0;
|
|
28949
|
-
for (const [externalId, { read:
|
|
28950
|
-
const readValue = flag(
|
|
28971
|
+
for (const [externalId, { read: read3, flagged }] of flags) {
|
|
28972
|
+
const readValue = flag(read3), flaggedValue = flag(flagged);
|
|
28951
28973
|
changed += update2.run(readValue, readValue, flaggedValue, flaggedValue, now2, accountId, externalId, readValue, readValue, flaggedValue, flaggedValue).changes;
|
|
28952
28974
|
}
|
|
28953
28975
|
return changed;
|
|
@@ -28979,7 +29001,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
28979
29001
|
return threads.length;
|
|
28980
29002
|
}, "markEmailsRestored");
|
|
28981
29003
|
|
|
28982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
28983
29005
|
var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
|
|
28984
29006
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
28985
29007
|
WHERE p.account_id = ?
|
|
@@ -29039,7 +29061,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
29039
29061
|
}, "indexedMailPieces");
|
|
29040
29062
|
var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
|
|
29041
29063
|
|
|
29042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29064
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
29043
29065
|
var sorted = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.map(sorted) : value !== null && typeof value === "object" ? Object.fromEntries(Object.keys(value).sort().map((key2) => [key2, sorted(value[key2])])) : value, "sorted");
|
|
29044
29066
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
29045
29067
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -29106,7 +29128,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
29106
29128
|
}
|
|
29107
29129
|
}), "mailRulesOver");
|
|
29108
29130
|
|
|
29109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
29110
29132
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
29111
29133
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
29112
29134
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -29114,7 +29136,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
29114
29136
|
reason = excluded.reason, updated_at = excluded.updated_at WHERE link_reviews.status = 'open'`).run(linkable.type, linkable.id, entity, JSON.stringify([...candidates].sort((a, b) => a - b)), reason, now2, now2);
|
|
29115
29137
|
}, "reviewLink");
|
|
29116
29138
|
|
|
29117
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
29118
29140
|
function checkMeetingCancelled(signal) {
|
|
29119
29141
|
if (!signal?.aborted)
|
|
29120
29142
|
return;
|
|
@@ -29125,7 +29147,7 @@ function checkMeetingCancelled(signal) {
|
|
|
29125
29147
|
}
|
|
29126
29148
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
29127
29149
|
|
|
29128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
29129
29151
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
29130
29152
|
id: Number(row2.id),
|
|
29131
29153
|
accountId: Number(row2.account_id),
|
|
@@ -29175,7 +29197,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
29175
29197
|
createdAt: Number(row2.created_at)
|
|
29176
29198
|
}), "transcriptRowOf");
|
|
29177
29199
|
|
|
29178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29200
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
29179
29201
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
29180
29202
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
29181
29203
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -29342,7 +29364,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29342
29364
|
}
|
|
29343
29365
|
}), "meetingReadsOver");
|
|
29344
29366
|
|
|
29345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
29346
29368
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
29347
29369
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
29348
29370
|
const params = [input.accountId];
|
|
@@ -29385,7 +29407,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
29385
29407
|
return { clauses, params };
|
|
29386
29408
|
}, "meetingSelectionSql");
|
|
29387
29409
|
|
|
29388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
29389
29411
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
29390
29412
|
async meetingChatLines(input) {
|
|
29391
29413
|
checkMeetingCancelled(input.signal);
|
|
@@ -29413,7 +29435,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29413
29435
|
}
|
|
29414
29436
|
}), "meetingChatLinesOver");
|
|
29415
29437
|
|
|
29416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29438
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
29417
29439
|
var MESSAGE_FIELDS = {
|
|
29418
29440
|
pk: messages.id,
|
|
29419
29441
|
nativeId: messages.externalId,
|
|
@@ -29584,7 +29606,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
29584
29606
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
29585
29607
|
}), "chatActivity");
|
|
29586
29608
|
|
|
29587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
29588
29610
|
var HIT_FIELDS = {
|
|
29589
29611
|
...MESSAGE_FIELDS,
|
|
29590
29612
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29683,7 +29705,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29683
29705
|
};
|
|
29684
29706
|
}, "directReplies");
|
|
29685
29707
|
|
|
29686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29687
29709
|
var identityRow = /* @__PURE__ */ __name(({ orm }, { provider, id: id2 }) => orm.select({ pk: identities.id, personPk: identityLinks.personId }).from(identities).innerJoin(identityLinks, eq(identityLinks.identityId, identities.id)).where(and(eq(identities.provider, provider), eq(identities.externalId, id2))).get(), "identityRow");
|
|
29688
29710
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29689
29711
|
const found2 = identityRow(context, ref3);
|
|
@@ -29814,7 +29836,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29814
29836
|
}, "mentioning");
|
|
29815
29837
|
var escaped = /* @__PURE__ */ __name((text6) => text6.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29816
29838
|
|
|
29817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
29818
29840
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
29819
29841
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
29820
29842
|
}, "missing");
|
|
@@ -29936,7 +29958,7 @@ function meetingContextLinksOver(context) {
|
|
|
29936
29958
|
}
|
|
29937
29959
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
29938
29960
|
|
|
29939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
29940
29962
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
29941
29963
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
29942
29964
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -29965,7 +29987,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
29965
29987
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
29966
29988
|
}, "indexedText");
|
|
29967
29989
|
|
|
29968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
29969
29991
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
29970
29992
|
var meetingCurrentIndexRows = `
|
|
29971
29993
|
SELECT 'meeting_transcript_row' AS indexable_type,r.id,r.id*4+1 AS rid,1 AS live,coalesce(length(CAST(r.text AS BLOB)),0) AS bytes FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id JOIN meetings m ON m.id=t.meeting_id WHERE m.account_id=? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL
|
|
@@ -29996,7 +30018,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
29996
30018
|
}, "invalidateMeetingStems");
|
|
29997
30019
|
var meetingStemmableText = /* @__PURE__ */ __name((text6) => text6.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
29998
30020
|
|
|
29999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30021
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
30000
30022
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
30001
30023
|
return {
|
|
30002
30024
|
async indexSearch(original) {
|
|
@@ -30064,10 +30086,105 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
30064
30086
|
}
|
|
30065
30087
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
30066
30088
|
|
|
30067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30089
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
30068
30090
|
import { createHash as createHash5 } from "node:crypto";
|
|
30069
30091
|
|
|
30070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/lucene/plain.js
|
|
30093
|
+
var REPAIRED = /* @__PURE__ */ new Set([
|
|
30094
|
+
"query.invalid-syntax",
|
|
30095
|
+
"query.unclosed-literal",
|
|
30096
|
+
"query.unsupported-operator",
|
|
30097
|
+
"query.invalid-escape"
|
|
30098
|
+
]);
|
|
30099
|
+
var SEARCH_FIELDS = /* @__PURE__ */ new Set([...QUERY_FIELDS.map(({ name }) => name), "after", "before"]);
|
|
30100
|
+
var FIELD_PREFIX = /^[+-]?([\p{L}\p{N}_.]+)(?:[:=]|[<>]=?)/u;
|
|
30101
|
+
var space = /* @__PURE__ */ __name((c) => c !== void 0 && /[ \t\n\r\u3000]/u.test(c), "space");
|
|
30102
|
+
var quoted2 = /* @__PURE__ */ __name((text6) => {
|
|
30103
|
+
let out = "";
|
|
30104
|
+
for (let at = 0; at < text6.length; at++) {
|
|
30105
|
+
const c = text6[at];
|
|
30106
|
+
if (c === "\\" && at + 1 < text6.length && (text6[at + 1] !== "u" || /^u[0-9a-fA-F]{4}/u.test(text6.slice(at + 1)))) {
|
|
30107
|
+
out += c + text6[at + 1];
|
|
30108
|
+
at++;
|
|
30109
|
+
} else
|
|
30110
|
+
out += c === '"' || c === "\\" ? `\\${c}` : c;
|
|
30111
|
+
}
|
|
30112
|
+
return `"${out}"`;
|
|
30113
|
+
}, "quoted");
|
|
30114
|
+
var literal4 = /* @__PURE__ */ __name((word2, keepParens, fields4) => {
|
|
30115
|
+
const prefix = FIELD_PREFIX.exec(word2);
|
|
30116
|
+
const field4 = prefix && fields4.has(prefix[1] ?? "") ? prefix[0] : "";
|
|
30117
|
+
const rest = word2.slice(field4.length);
|
|
30118
|
+
const opening = keepParens ? /^[(+-]*/u.exec(rest)?.[0] ?? "" : "";
|
|
30119
|
+
const closing = keepParens ? /\)*$/u.exec(rest.slice(opening.length))?.[0] ?? "" : "";
|
|
30120
|
+
const body2 = rest.slice(opening.length, rest.length - closing.length);
|
|
30121
|
+
if (!body2)
|
|
30122
|
+
return keepParens ? literal4(word2, false, fields4) : `${field4}${quoted2(rest)}`;
|
|
30123
|
+
return `${field4}${opening}${quoted2(body2)}${closing}`;
|
|
30124
|
+
}, "literal");
|
|
30125
|
+
var wordAround = /* @__PURE__ */ __name((text6, at) => {
|
|
30126
|
+
let start = at;
|
|
30127
|
+
while (start > 0 && !space(text6[start - 1]))
|
|
30128
|
+
start--;
|
|
30129
|
+
let end = at;
|
|
30130
|
+
while (end < text6.length && !space(text6[end]))
|
|
30131
|
+
end++;
|
|
30132
|
+
return { start, end };
|
|
30133
|
+
}, "wordAround");
|
|
30134
|
+
var everyWordLiteral = /* @__PURE__ */ __name((text6, fields4) => text6.replace(/[^ \t\n\r\u3000]+/gu, (word2) => literal4(word2, false, fields4)), "everyWordLiteral");
|
|
30135
|
+
var read2 = /* @__PURE__ */ __name((text6, fields4) => {
|
|
30136
|
+
try {
|
|
30137
|
+
const leaves = walkQuery(parseLucene(text6, MESSAGE_PARSING).root);
|
|
30138
|
+
const unknown2 = leaves.find(({ field: field4 }) => !fields4.has(field4));
|
|
30139
|
+
if (unknown2)
|
|
30140
|
+
return { at: text6.lastIndexOf(unknown2.field, unknown2.span.start) };
|
|
30141
|
+
const wordless = leaves.filter(({ implicit, operator, value }) => implicit && (operator === "term" || operator === "phrase") && !/[\p{L}\p{N}]/u.test(value));
|
|
30142
|
+
const words3 = wordless.length < leaves.length;
|
|
30143
|
+
return { wordless: words3 ? wordless : [], words: words3 };
|
|
30144
|
+
} catch (error) {
|
|
30145
|
+
const details2 = isCliError(error) ? error.details : void 0;
|
|
30146
|
+
if (!details2?.span || !REPAIRED.has(details2.reason ?? ""))
|
|
30147
|
+
throw error;
|
|
30148
|
+
if (/^~\d/u.test(text6.slice(details2.span.start)))
|
|
30149
|
+
throw error;
|
|
30150
|
+
return { at: details2.span.start };
|
|
30151
|
+
}
|
|
30152
|
+
}, "read");
|
|
30153
|
+
var without = /* @__PURE__ */ __name((text6, leaves) => [...leaves].sort((a, b) => b.span.start - a.span.start).reduce((left, { span }) => left.slice(0, span.start) + left.slice(span.end), text6).trim(), "without");
|
|
30154
|
+
var plainQuery = /* @__PURE__ */ __name((text6, fields4 = SEARCH_FIELDS) => {
|
|
30155
|
+
let current = text6;
|
|
30156
|
+
let whole = false;
|
|
30157
|
+
for (let tries = 0; tries <= 64; tries++) {
|
|
30158
|
+
let reading;
|
|
30159
|
+
try {
|
|
30160
|
+
reading = read2(current, fields4);
|
|
30161
|
+
} catch {
|
|
30162
|
+
return text6;
|
|
30163
|
+
}
|
|
30164
|
+
if ("wordless" in reading) {
|
|
30165
|
+
if (!reading.words && current !== text6)
|
|
30166
|
+
return text6;
|
|
30167
|
+
if (!reading.wordless.length)
|
|
30168
|
+
return current;
|
|
30169
|
+
current = without(current, reading.wordless);
|
|
30170
|
+
continue;
|
|
30171
|
+
}
|
|
30172
|
+
const word2 = reading.at < 0 || reading.at >= current.length ? void 0 : wordAround(current, reading.at);
|
|
30173
|
+
const paren = "()".includes(current[reading.at] ?? "");
|
|
30174
|
+
const repaired = word2 ? current.slice(0, word2.start) + literal4(current.slice(word2.start, word2.end), !paren, fields4) + current.slice(word2.end) : current;
|
|
30175
|
+
if (repaired !== current) {
|
|
30176
|
+
current = repaired;
|
|
30177
|
+
continue;
|
|
30178
|
+
}
|
|
30179
|
+
if (whole)
|
|
30180
|
+
return text6;
|
|
30181
|
+
whole = true;
|
|
30182
|
+
current = everyWordLiteral(text6, fields4);
|
|
30183
|
+
}
|
|
30184
|
+
return text6;
|
|
30185
|
+
}, "plainQuery");
|
|
30186
|
+
|
|
30187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
30071
30188
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
30072
30189
|
const padded = ` ${term} `;
|
|
30073
30190
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -30076,7 +30193,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
30076
30193
|
return [...pieces];
|
|
30077
30194
|
}, "trigrams");
|
|
30078
30195
|
|
|
30079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
30080
30197
|
var SHORTEST_CORRECTION = 3;
|
|
30081
30198
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
30082
30199
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -30123,7 +30240,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
30123
30240
|
return corrections;
|
|
30124
30241
|
}, "correctWords");
|
|
30125
30242
|
|
|
30126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
30127
30244
|
var SHORTEST_GARBLED = 4;
|
|
30128
30245
|
var MOST_WIDENED = 64;
|
|
30129
30246
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -30144,14 +30261,14 @@ var garbledDistance = /* @__PURE__ */ __name((probe, word2, stems) => {
|
|
|
30144
30261
|
return null;
|
|
30145
30262
|
if (isNumberWord(probe.literal) || isNumberWord(word2))
|
|
30146
30263
|
return null;
|
|
30147
|
-
const
|
|
30264
|
+
const literal5 = plain(probe.literal);
|
|
30148
30265
|
const stored3 = plain(word2);
|
|
30149
30266
|
let best = null;
|
|
30150
30267
|
for (const queryStem of probe.stems.map(plain))
|
|
30151
30268
|
for (const wordStem of stems.map(plain)) {
|
|
30152
30269
|
if (Math.min(queryStem.length, wordStem.length) < 3)
|
|
30153
30270
|
continue;
|
|
30154
|
-
if (wordStem.startsWith(queryStem) &&
|
|
30271
|
+
if (wordStem.startsWith(queryStem) && literal5.startsWith(wordStem) || queryStem.startsWith(wordStem) && stored3.startsWith(queryStem))
|
|
30155
30272
|
return 0;
|
|
30156
30273
|
if (queryStem.length < SHORTEST_GARBLED)
|
|
30157
30274
|
continue;
|
|
@@ -30161,7 +30278,7 @@ var garbledDistance = /* @__PURE__ */ __name((probe, word2, stems) => {
|
|
|
30161
30278
|
if (distance2 <= 1)
|
|
30162
30279
|
best = distance2;
|
|
30163
30280
|
}
|
|
30164
|
-
if (best === null && stored3.length >= SHORTEST_GARBLED &&
|
|
30281
|
+
if (best === null && stored3.length >= SHORTEST_GARBLED && literal5.startsWith(stored3))
|
|
30165
30282
|
return 1;
|
|
30166
30283
|
return best;
|
|
30167
30284
|
}, "garbledDistance");
|
|
@@ -30215,7 +30332,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
30215
30332
|
return found2.map((words3) => words3.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
|
|
30216
30333
|
}, "widenWords");
|
|
30217
30334
|
|
|
30218
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
30219
30336
|
import { readFileSync } from "node:fs";
|
|
30220
30337
|
var loaded;
|
|
30221
30338
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -30274,7 +30391,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
30274
30391
|
return false;
|
|
30275
30392
|
}, "knownRussianWord");
|
|
30276
30393
|
|
|
30277
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
30278
30395
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
30279
30396
|
var MOST_WORDS = 128;
|
|
30280
30397
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -30352,11 +30469,11 @@ var resolveMeetingQuery = /* @__PURE__ */ __name((database, accountId, ast, stat
|
|
|
30352
30469
|
const all2 = [];
|
|
30353
30470
|
const wordsOf3 = /* @__PURE__ */ __name((value, exact) => {
|
|
30354
30471
|
const words3 = (value.match(WORD3) ?? []).filter((raw) => normalize(raw)).map((raw) => {
|
|
30355
|
-
const
|
|
30472
|
+
const literal5 = normalize(raw);
|
|
30356
30473
|
return {
|
|
30357
30474
|
raw,
|
|
30358
|
-
literal:
|
|
30359
|
-
whole: exact || isNumberWord(
|
|
30475
|
+
literal: literal5,
|
|
30476
|
+
whole: exact || isNumberWord(literal5),
|
|
30360
30477
|
stems: state.stemmer && raw.length <= 1024 && !exact ? [...new Set(state.stemmer.explain(raw).map((word2) => word2.stem))] : [],
|
|
30361
30478
|
widened: []
|
|
30362
30479
|
};
|
|
@@ -30501,7 +30618,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text6, stemmer) => {
|
|
|
30501
30618
|
return check3(tree);
|
|
30502
30619
|
}, "matchMeetingText");
|
|
30503
30620
|
|
|
30504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
30505
30622
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
30506
30623
|
throw new CliError("validation_error", message2);
|
|
30507
30624
|
}, "fail");
|
|
@@ -30570,7 +30687,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
30570
30687
|
fail3("Meeting search byte limit must be from 1 through 67108864");
|
|
30571
30688
|
if (typeof rawQuery === "string" && Buffer.byteLength(rawQuery) > 65536)
|
|
30572
30689
|
fail3("Meeting search query must be a bounded string");
|
|
30573
|
-
const ast = typeof rawQuery === "string" ? parseMeetingQuery(rawQuery) : rawQuery;
|
|
30690
|
+
const ast = typeof rawQuery === "string" ? parseMeetingQuery(plainQuery(rawQuery, MEETING_FIELD_NAMES)) : rawQuery;
|
|
30574
30691
|
return read(database, () => {
|
|
30575
30692
|
checkMeetingCancelled(input.signal);
|
|
30576
30693
|
const state = meetingStemState(database, input.accountId);
|
|
@@ -30683,7 +30800,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
30683
30800
|
}
|
|
30684
30801
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
30685
30802
|
|
|
30686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
30687
30804
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30688
30805
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
30689
30806
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -30715,7 +30832,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30715
30832
|
}
|
|
30716
30833
|
}), "meetingLanguagesOver");
|
|
30717
30834
|
|
|
30718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
30719
30836
|
import { createHash as createHash6 } from "node:crypto";
|
|
30720
30837
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
30721
30838
|
if (value === void 0)
|
|
@@ -30749,7 +30866,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30749
30866
|
FROM meeting_participants p JOIN meetings m ON m.id = p.meeting_id
|
|
30750
30867
|
WHERE m.account_id = ? AND m.deleted_at IS NULL AND p.id > ? AND p.id <= ?
|
|
30751
30868
|
ORDER BY p.id LIMIT ?`).all(limits.accountId, previous?.after ?? 0, until, limits.scanLimit + 1);
|
|
30752
|
-
const
|
|
30869
|
+
const read3 = database.prepare("SELECT id, meeting_id, identity_id, display_name, email FROM meeting_participants WHERE id = ?");
|
|
30753
30870
|
const result = {
|
|
30754
30871
|
schema_version: 1,
|
|
30755
30872
|
kind: "meeting_participants",
|
|
@@ -30776,7 +30893,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30776
30893
|
}
|
|
30777
30894
|
if (result.coverage.truncated_by)
|
|
30778
30895
|
break;
|
|
30779
|
-
const found2 =
|
|
30896
|
+
const found2 = read3.get(Number(row2.id));
|
|
30780
30897
|
if (!found2)
|
|
30781
30898
|
throw new CliError("invalid_response", "participant observation disappeared within its snapshot");
|
|
30782
30899
|
const name = found2.display_name === null ? null : String(found2.display_name);
|
|
@@ -30805,7 +30922,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30805
30922
|
}
|
|
30806
30923
|
}), "meetingParticipantSearchOver");
|
|
30807
30924
|
|
|
30808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
30809
30926
|
var preparationQueries = {
|
|
30810
30927
|
participants: {
|
|
30811
30928
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -30855,7 +30972,7 @@ var preparationQueries = {
|
|
|
30855
30972
|
}
|
|
30856
30973
|
};
|
|
30857
30974
|
|
|
30858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
30859
30976
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30860
30977
|
async preparationContext(original) {
|
|
30861
30978
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -30876,7 +30993,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30876
30993
|
throw new CliError("validation_error", "Preparation context exceeds the stored text byte budget");
|
|
30877
30994
|
}
|
|
30878
30995
|
signal?.throwIfAborted();
|
|
30879
|
-
const
|
|
30996
|
+
const read3 = /* @__PURE__ */ __name((key2) => {
|
|
30880
30997
|
const query = preparationQueries[key2];
|
|
30881
30998
|
const rows = database.prepare(`SELECT ${query.fields} ${query.from}`).all(...params(key2));
|
|
30882
30999
|
return {
|
|
@@ -30885,10 +31002,10 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30885
31002
|
};
|
|
30886
31003
|
}, "read");
|
|
30887
31004
|
const result = {
|
|
30888
|
-
participants:
|
|
30889
|
-
projects:
|
|
30890
|
-
facts:
|
|
30891
|
-
tasks:
|
|
31005
|
+
participants: read3("participants"),
|
|
31006
|
+
projects: read3("projects"),
|
|
31007
|
+
facts: read3("facts"),
|
|
31008
|
+
tasks: read3("tasks")
|
|
30892
31009
|
};
|
|
30893
31010
|
signal?.throwIfAborted();
|
|
30894
31011
|
return result;
|
|
@@ -30896,7 +31013,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30896
31013
|
}
|
|
30897
31014
|
}), "meetingPreparationContextOver");
|
|
30898
31015
|
|
|
30899
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
30900
31017
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
30901
31018
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
30902
31019
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -30910,7 +31027,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
30910
31027
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
30911
31028
|
)`, "preparationSubjects");
|
|
30912
31029
|
|
|
30913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31030
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
30914
31031
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30915
31032
|
async preparationKnowledge(original) {
|
|
30916
31033
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -30955,7 +31072,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
30955
31072
|
}
|
|
30956
31073
|
}), "meetingPreparationKnowledgeOver");
|
|
30957
31074
|
|
|
30958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31075
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
30959
31076
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30960
31077
|
async preparationNotes(original) {
|
|
30961
31078
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -31008,7 +31125,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31008
31125
|
}
|
|
31009
31126
|
}), "meetingPreparationNotesOver");
|
|
31010
31127
|
|
|
31011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
31012
31129
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
31013
31130
|
async relatedHistory(original) {
|
|
31014
31131
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -31079,7 +31196,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31079
31196
|
}
|
|
31080
31197
|
}), "meetingRelatedHistoryOver");
|
|
31081
31198
|
|
|
31082
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
31083
31200
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
31084
31201
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
31085
31202
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -31160,7 +31277,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31160
31277
|
}
|
|
31161
31278
|
}), "meetingReviewOver");
|
|
31162
31279
|
|
|
31163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
31164
31281
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
31165
31282
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
31166
31283
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -31214,7 +31331,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31214
31331
|
}
|
|
31215
31332
|
}), "meetingSeriesHistoryOver");
|
|
31216
31333
|
|
|
31217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
31218
31335
|
var MOST_ROWS = 5e5;
|
|
31219
31336
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
31220
31337
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -31283,7 +31400,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31283
31400
|
}
|
|
31284
31401
|
}), "meetingStatsOver");
|
|
31285
31402
|
|
|
31286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31403
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
31287
31404
|
var CURSOR_KEY = "meetings";
|
|
31288
31405
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
31289
31406
|
id: Number(row2.id),
|
|
@@ -31852,7 +31969,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31852
31969
|
};
|
|
31853
31970
|
}, "meetingStoreOver");
|
|
31854
31971
|
|
|
31855
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31972
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
31856
31973
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
31857
31974
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
31858
31975
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -31878,7 +31995,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
31878
31995
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
31879
31996
|
}, "release");
|
|
31880
31997
|
|
|
31881
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31998
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
31882
31999
|
var THREAD_COLUMNS = {
|
|
31883
32000
|
subject: {
|
|
31884
32001
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -31895,7 +32012,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
31895
32012
|
AND (${filter.where?.sql ?? "1"}) ORDER BY coalesce(last_email_at, 0) DESC, id DESC LIMIT ? OFFSET ?`).all(filter.accountId ?? null, filter.accountId ?? null, filter.includeDeleted ? 1 : 0, ...filter.where?.params ?? [], limit, offset);
|
|
31896
32013
|
}, "threadRows");
|
|
31897
32014
|
|
|
31898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32015
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
31899
32016
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
31900
32017
|
id: `email:${place.emailId}`,
|
|
31901
32018
|
chatId: place.threadExternalId,
|
|
@@ -32206,11 +32323,11 @@ var mailFieldsOf = /* @__PURE__ */ __name((database, email, thread, key2) => {
|
|
|
32206
32323
|
};
|
|
32207
32324
|
}, "mailFieldsOf");
|
|
32208
32325
|
var emailHitsByPk = /* @__PURE__ */ __name((database, pks) => {
|
|
32209
|
-
const
|
|
32326
|
+
const read3 = database.prepare(`SELECT e.*, t.external_id AS thread, t.subject AS thread_subject, a.provider, a.external_id AS account
|
|
32210
32327
|
FROM emails e JOIN email_threads t ON t.id = e.email_thread_id JOIN accounts a ON a.id = e.account_id
|
|
32211
32328
|
WHERE e.id = ?`);
|
|
32212
32329
|
return pks.flatMap((pk) => {
|
|
32213
|
-
const row2 =
|
|
32330
|
+
const row2 = read3.get(pk);
|
|
32214
32331
|
if (!row2)
|
|
32215
32332
|
return [];
|
|
32216
32333
|
const thread = String(row2.thread);
|
|
@@ -32433,7 +32550,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
32433
32550
|
}
|
|
32434
32551
|
}), "mailStoreOver");
|
|
32435
32552
|
|
|
32436
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
32437
32554
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
32438
32555
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
32439
32556
|
var folded4 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -32523,7 +32640,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
32523
32640
|
}, "knownWord");
|
|
32524
32641
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
32525
32642
|
|
|
32526
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
32527
32644
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
32528
32645
|
var readsTranscripts = /* @__PURE__ */ __name((node) => (node.operator === "term" || node.operator === "phrase") && /[\p{L}\p{N}]/u.test(normalize(node.value)) && (node.field === "transcript" || node.implicit === true && (node.field === "text" || node.field === "exact")), "readsTranscripts");
|
|
32529
32646
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -32609,7 +32726,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
32609
32726
|
return found2;
|
|
32610
32727
|
}, "spokenTranscripts");
|
|
32611
32728
|
|
|
32612
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
32613
32730
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
32614
32731
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
32615
32732
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -32656,7 +32773,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
32656
32773
|
});
|
|
32657
32774
|
}, "placeHits");
|
|
32658
32775
|
|
|
32659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32776
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
32660
32777
|
var GROUPS = {
|
|
32661
32778
|
chat: {
|
|
32662
32779
|
key: "m.chat_id",
|
|
@@ -32678,7 +32795,7 @@ var GROUPS = {
|
|
|
32678
32795
|
}
|
|
32679
32796
|
};
|
|
32680
32797
|
|
|
32681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
32682
32799
|
var MESSAGES2 = {
|
|
32683
32800
|
rows: "messages",
|
|
32684
32801
|
threads: "chats",
|
|
@@ -33161,7 +33278,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
33161
33278
|
};
|
|
33162
33279
|
}, "runCompiled");
|
|
33163
33280
|
|
|
33164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
33165
33282
|
function invalidMetadata() {
|
|
33166
33283
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
33167
33284
|
}
|
|
@@ -33263,7 +33380,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
33263
33380
|
};
|
|
33264
33381
|
}), "counterTargets");
|
|
33265
33382
|
|
|
33266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33383
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
33267
33384
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind4) => `'${kind4}'`).join(",");
|
|
33268
33385
|
var fileAttachments = /* @__PURE__ */ __name(({ database }, accountKey, { chatKey, messageId, beforePk, limit }) => database.prepare(`SELECT att.id AS pk, c.external_id AS chat_id, m.external_id AS message_id, att.position, att.kind, att.name, att.mime,
|
|
33269
33386
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -33382,7 +33499,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
33382
33499
|
}));
|
|
33383
33500
|
}, "attachmentViews");
|
|
33384
33501
|
|
|
33385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33502
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
33386
33503
|
var transcript = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => orm.select({ text: messageTranscripts.text, source: messageTranscripts.source }).from(messageTranscripts).where(and(eq(messageTranscripts.chatId, chatKey), eq(messageTranscripts.messageExternalId, messageId))).get(), "transcript");
|
|
33387
33504
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text6, source2) => {
|
|
33388
33505
|
const { orm, database, now: now2 } = context;
|
|
@@ -33420,7 +33537,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
33420
33537
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
33421
33538
|
}, "intoVoiceAttachment");
|
|
33422
33539
|
|
|
33423
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33540
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
33424
33541
|
var FIELDS = [
|
|
33425
33542
|
"threadExternalId",
|
|
33426
33543
|
"senderIdentityId",
|
|
@@ -33737,7 +33854,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
33737
33854
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
33738
33855
|
}, "writeDerivedReactions");
|
|
33739
33856
|
|
|
33740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
33741
33858
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
33742
33859
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
33743
33860
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -33758,7 +33875,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
33758
33875
|
};
|
|
33759
33876
|
}, "keysOver");
|
|
33760
33877
|
|
|
33761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33878
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
33762
33879
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
33763
33880
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
33764
33881
|
if (!row2)
|
|
@@ -33793,7 +33910,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
33793
33910
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
33794
33911
|
}, "saveProfile");
|
|
33795
33912
|
|
|
33796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
33797
33914
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
33798
33915
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
33799
33916
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -33850,7 +33967,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
33850
33967
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
33851
33968
|
}, "proposedBySql");
|
|
33852
33969
|
|
|
33853
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
33854
33971
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
33855
33972
|
const owner = ownerPerson(context.database).id;
|
|
33856
33973
|
const strays = context.database.prepare("SELECT DISTINCT l.person_id AS person FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN accounts a ON a.provider = i.provider AND a.external_id = i.external_id WHERE l.person_id <> ?").all(owner);
|
|
@@ -33871,7 +33988,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
33871
33988
|
return personOf(context, ref3);
|
|
33872
33989
|
}, "linkToOwner");
|
|
33873
33990
|
|
|
33874
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
33875
33992
|
var PROVIDERS_SETTING = "providers";
|
|
33876
33993
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
33877
33994
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -33906,7 +34023,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
33906
34023
|
});
|
|
33907
34024
|
}, "registerProvider");
|
|
33908
34025
|
|
|
33909
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
33910
34027
|
var DAY3 = 864e5;
|
|
33911
34028
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
33912
34029
|
var TEXT_LIMIT = 20;
|
|
@@ -34105,7 +34222,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
34105
34222
|
};
|
|
34106
34223
|
}, "taskSimilarityOver");
|
|
34107
34224
|
|
|
34108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
34109
34226
|
var SETTING3 = "taskCategories";
|
|
34110
34227
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
34111
34228
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -34124,7 +34241,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
34124
34241
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(SETTING3, JSON.stringify(categories), now2);
|
|
34125
34242
|
}, "saveTaskCategories");
|
|
34126
34243
|
|
|
34127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
34128
34245
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
34129
34246
|
var ALLOWED = "taskAgentClose";
|
|
34130
34247
|
var MIN = "taskAgentCloseMin";
|
|
@@ -34180,10 +34297,10 @@ var SUGGESTION_COLUMNS = [
|
|
|
34180
34297
|
];
|
|
34181
34298
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
34182
34299
|
|
|
34183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
34184
34301
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
34185
34302
|
|
|
34186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34303
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
34187
34304
|
var TASK_CLOSE_KIND = "task_close";
|
|
34188
34305
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
34189
34306
|
var isOwnerOnlyKind = /* @__PURE__ */ __name((kind4) => kind4 === MAIL_FINDINGS_KIND || kind4 === MEETING_FINDINGS_KIND || kind4 === TASK_CLOSE_KIND, "isOwnerOnlyKind");
|
|
@@ -34231,7 +34348,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
34231
34348
|
}, "assertMayDecide");
|
|
34232
34349
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
34233
34350
|
|
|
34234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/deals.js
|
|
34235
34352
|
var DEAL_KINDS = ["deal", "lead"];
|
|
34236
34353
|
var DEAL_STATUSES = ["open", "won", "lost"];
|
|
34237
34354
|
var STAGE_OUTCOMES = DEAL_STATUSES;
|
|
@@ -34241,7 +34358,7 @@ var dealLine = /* @__PURE__ */ __name((deal) => {
|
|
|
34241
34358
|
return `${deal.title} \xB7 ${deal.stage}${money}${deal.status === "open" ? "" : ` (${deal.status})`}`;
|
|
34242
34359
|
}, "dealLine");
|
|
34243
34360
|
|
|
34244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
34245
34362
|
var PROFILE_PLACEHOLDER = "<profile>";
|
|
34246
34363
|
var oneLine = /* @__PURE__ */ __name((text6) => singleLine(text6.replace(/\s+/g, " ").trim()), "oneLine");
|
|
34247
34364
|
var openKind = /* @__PURE__ */ __name((kind4) => kind4 === "email" ? "message" : kind4 === "email_thread" ? "chat" : kind4 === "unknown" ? void 0 : kind4, "openKind");
|
|
@@ -34297,7 +34414,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
|
34297
34414
|
return `${WORDS2[summary.kind]} ${named3}${notes2 === "" ? "" : ` (${notes2})`}`;
|
|
34298
34415
|
}, "refLabel");
|
|
34299
34416
|
|
|
34300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34417
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
34301
34418
|
var EXCERPT_CHARS = 280;
|
|
34302
34419
|
var TITLE_CHARS = 120;
|
|
34303
34420
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -34668,20 +34785,20 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
|
|
|
34668
34785
|
return reads;
|
|
34669
34786
|
}, "refReadsOf");
|
|
34670
34787
|
var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
|
|
34671
|
-
var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6,
|
|
34788
|
+
var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6, read3]) => [text6, summaryOf2(read3, options.excerpt === true)])), "refSummariesOf");
|
|
34672
34789
|
|
|
34673
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34674
|
-
var sourceOf3 = /* @__PURE__ */ __name((
|
|
34790
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
34791
|
+
var sourceOf3 = /* @__PURE__ */ __name((read3, ref3) => ({
|
|
34675
34792
|
ref: ref3,
|
|
34676
|
-
kind:
|
|
34677
|
-
title:
|
|
34678
|
-
sender:
|
|
34679
|
-
at:
|
|
34680
|
-
excerpt:
|
|
34681
|
-
tool:
|
|
34682
|
-
missing:
|
|
34793
|
+
kind: read3.kind,
|
|
34794
|
+
title: read3.kind === "message" ? read3.in : read3.title,
|
|
34795
|
+
sender: read3.sender,
|
|
34796
|
+
at: read3.at,
|
|
34797
|
+
excerpt: read3.excerpt,
|
|
34798
|
+
tool: read3.provider,
|
|
34799
|
+
missing: read3.state !== "available"
|
|
34683
34800
|
}), "sourceOf");
|
|
34684
|
-
var sourcesOfReferences = /* @__PURE__ */ __name((database, references) => [...refReadsOf(database, references, { excerpt: true })].map(([ref3,
|
|
34801
|
+
var sourcesOfReferences = /* @__PURE__ */ __name((database, references) => [...refReadsOf(database, references, { excerpt: true })].map(([ref3, read3]) => sourceOf3(read3, ref3)), "sourcesOfReferences");
|
|
34685
34802
|
var GONE_KIND = { meeting_transcript: "meeting", meeting_transcript_row: "meeting" };
|
|
34686
34803
|
var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
34687
34804
|
const cited = database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).map((link3) => {
|
|
@@ -34690,9 +34807,9 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
34690
34807
|
});
|
|
34691
34808
|
const reads = refReadsOf(database, cited.flatMap(({ ref: ref3 }) => ref3 ?? []), { excerpt: true });
|
|
34692
34809
|
return cited.map(({ type, ref: ref3 }) => {
|
|
34693
|
-
const
|
|
34694
|
-
if (ref3 !== void 0 &&
|
|
34695
|
-
return sourceOf3(
|
|
34810
|
+
const read3 = ref3 === void 0 ? void 0 : reads.get(ref3);
|
|
34811
|
+
if (ref3 !== void 0 && read3 !== void 0)
|
|
34812
|
+
return sourceOf3(read3, ref3);
|
|
34696
34813
|
return {
|
|
34697
34814
|
ref: null,
|
|
34698
34815
|
kind: GONE_KIND[type] ?? type,
|
|
@@ -34706,7 +34823,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
34706
34823
|
});
|
|
34707
34824
|
}, "evidenceSourcesOf");
|
|
34708
34825
|
|
|
34709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
34710
34827
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
34711
34828
|
var MAX_TEXT_CHARS = 2e6;
|
|
34712
34829
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -34732,7 +34849,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
34732
34849
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
34733
34850
|
}, "pdfPreviewLimits");
|
|
34734
34851
|
|
|
34735
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
34736
34853
|
import { randomBytes } from "node:crypto";
|
|
34737
34854
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
34738
34855
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -34745,7 +34862,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
34745
34862
|
return time3 + random;
|
|
34746
34863
|
}, "ulid");
|
|
34747
34864
|
|
|
34748
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
34749
34866
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
34750
34867
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
34751
34868
|
if (!meta && !sections?.length)
|
|
@@ -34766,7 +34883,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
34766
34883
|
return typeof language === "string" && language !== "" ? language : null;
|
|
34767
34884
|
}, "languageOf");
|
|
34768
34885
|
|
|
34769
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
34770
34887
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
34771
34888
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
34772
34889
|
if (isObject(value))
|
|
@@ -35009,7 +35126,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
35009
35126
|
};
|
|
35010
35127
|
}, "filesStoreOver");
|
|
35011
35128
|
|
|
35012
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
35013
35130
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
35014
35131
|
entity: "document",
|
|
35015
35132
|
backend: "sql",
|
|
@@ -35055,7 +35172,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
35055
35172
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
35056
35173
|
}, "importedDocumentWhere");
|
|
35057
35174
|
|
|
35058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35175
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
35059
35176
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
35060
35177
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
35061
35178
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
@@ -35581,7 +35698,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35581
35698
|
};
|
|
35582
35699
|
}, "notesStoreOver");
|
|
35583
35700
|
|
|
35584
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
35585
35702
|
var NAMED = "SELECT m.*, b.name AS author_name, b.kind AS author_kind FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
|
|
35586
35703
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
35587
35704
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -35621,8 +35738,8 @@ var subjectOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
35621
35738
|
if (row2.subject_type == null)
|
|
35622
35739
|
return { subject: null, subjectName: null, subjectIsOwner: false };
|
|
35623
35740
|
const thing = storedThing(row2.subject_type, row2.subject_id);
|
|
35624
|
-
const
|
|
35625
|
-
const named3 =
|
|
35741
|
+
const read3 = SUBJECT_NAMES[thing.type];
|
|
35742
|
+
const named3 = read3 === void 0 ? void 0 : database.prepare(read3).get(thing.id);
|
|
35626
35743
|
return {
|
|
35627
35744
|
subject: referenceOfThing(database, thing) ?? null,
|
|
35628
35745
|
subjectName: named3?.name == null ? null : String(named3.name),
|
|
@@ -35803,7 +35920,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35803
35920
|
};
|
|
35804
35921
|
}, "memoriesStoreOver");
|
|
35805
35922
|
|
|
35806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
35807
35924
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
35808
35925
|
var KEY = "taskFirstPassPerChat";
|
|
35809
35926
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -35823,7 +35940,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
35823
35940
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY, String(value), now2);
|
|
35824
35941
|
}, "saveFirstPassPerChat");
|
|
35825
35942
|
|
|
35826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
35827
35944
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
35828
35945
|
var EXTERNAL_ID_CHARS = 200;
|
|
35829
35946
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -35850,7 +35967,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
35850
35967
|
return text6;
|
|
35851
35968
|
}, "sourceUrlOf");
|
|
35852
35969
|
|
|
35853
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
35854
35971
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
35855
35972
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
35856
35973
|
name,
|
|
@@ -35895,8 +36012,8 @@ var wordsMatch = /* @__PURE__ */ __name((node) => {
|
|
|
35895
36012
|
const words3 = taskWordsOf(node.value.replaceAll("*", " ")).split(/\s+/).filter((word2) => /[\p{L}\p{N}]/u.test(word2));
|
|
35896
36013
|
if (words3.length === 0)
|
|
35897
36014
|
return void 0;
|
|
35898
|
-
const
|
|
35899
|
-
return `normalized_text : (${node.operator === "phrase" ?
|
|
36015
|
+
const quoted4 = /* @__PURE__ */ __name((text6) => `"${text6.replaceAll('"', '""')}"`, "quoted");
|
|
36016
|
+
return `normalized_text : (${node.operator === "phrase" ? quoted4(words3.join(" ")) : words3.map((word2) => `${quoted4(word2)}*`).join(" AND ")})`;
|
|
35900
36017
|
}, "wordsMatch");
|
|
35901
36018
|
var projectWhere = /* @__PURE__ */ __name((node) => {
|
|
35902
36019
|
if (node.operator === "wildcard" && node.value === "*")
|
|
@@ -36073,7 +36190,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
36073
36190
|
return root === void 0 ? void 0 : { ...query, root };
|
|
36074
36191
|
}, "withoutField");
|
|
36075
36192
|
|
|
36076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36193
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
36077
36194
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
36078
36195
|
if (row2.author_type == null)
|
|
36079
36196
|
return null;
|
|
@@ -36101,7 +36218,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
36101
36218
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
36102
36219
|
}, "addComment");
|
|
36103
36220
|
|
|
36104
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
36105
36222
|
var TASK_RELATION_KINDS = [
|
|
36106
36223
|
"blocked-by",
|
|
36107
36224
|
"follow-up-of",
|
|
@@ -36231,7 +36348,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
36231
36348
|
};
|
|
36232
36349
|
}, "taskRelationsStoreOver");
|
|
36233
36350
|
|
|
36234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
36235
36352
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
36236
36353
|
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
36237
36354
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind4, changes, at) => {
|
|
@@ -36688,9 +36805,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36688
36805
|
boardCounts: /* @__PURE__ */ __name(async (query, { zone } = {}) => {
|
|
36689
36806
|
drainCorpus(database, CORPORA.task, stemmerFor2);
|
|
36690
36807
|
const at = now2();
|
|
36691
|
-
const
|
|
36808
|
+
const without2 = /* @__PURE__ */ __name((name) => boardWhere(withoutField(query, name), zone, at), "without");
|
|
36692
36809
|
const grouped = /* @__PURE__ */ __name((name, select3, from2, group) => {
|
|
36693
|
-
const where =
|
|
36810
|
+
const where = without2(name);
|
|
36694
36811
|
return database.prepare(`SELECT ${select3}, count(*) AS n FROM tasks t ${from2} WHERE ${where.sql} GROUP BY ${group}`).all(...where.params);
|
|
36695
36812
|
}, "grouped");
|
|
36696
36813
|
const project2 = grouped("project", "p.id, p.key, p.name", "JOIN projects p ON p.id = t.project_id", "p.id").map((row2) => ({
|
|
@@ -36760,7 +36877,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
36760
36877
|
};
|
|
36761
36878
|
}, "workTasksOver");
|
|
36762
36879
|
|
|
36763
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36880
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
36764
36881
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
36765
36882
|
const { database, now: now2 } = context;
|
|
36766
36883
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -36809,7 +36926,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
36809
36926
|
};
|
|
36810
36927
|
}, "taskCloseOver");
|
|
36811
36928
|
|
|
36812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36929
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
36813
36930
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
36814
36931
|
const { database, now: now2 } = context;
|
|
36815
36932
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -37027,7 +37144,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
37027
37144
|
};
|
|
37028
37145
|
}, "taskPairsOver");
|
|
37029
37146
|
|
|
37030
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
37031
37148
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
37032
37149
|
var TASK_STATS_SQL = {
|
|
37033
37150
|
rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? BOARD_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
|
|
@@ -37066,7 +37183,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
37066
37183
|
}, "statNames")
|
|
37067
37184
|
}), "taskStatsOver");
|
|
37068
37185
|
|
|
37069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
37070
37187
|
var COLUMNS3 = "t.id AS row_id, t.package_id, t.source_locator, t.source_kind, t.source_group, t.type, t.status, t.close_reason, t.source, t.created_at, t.due_at, t.closed_at, t.closed_by_type, t.closed_by_id, t.key, t.category, t.claimed_by, t.claimed_until, p.name AS account";
|
|
37071
37188
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
37072
37189
|
const key2 = inboxKey(account);
|
|
@@ -37273,7 +37390,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
37273
37390
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
37274
37391
|
}, "oneOf");
|
|
37275
37392
|
|
|
37276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
37277
37394
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
37278
37395
|
const { database } = context;
|
|
37279
37396
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -37318,7 +37435,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
37318
37435
|
};
|
|
37319
37436
|
}, "accountsStoreOver");
|
|
37320
37437
|
|
|
37321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37438
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
37322
37439
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
37323
37440
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
37324
37441
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -37342,7 +37459,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
37342
37459
|
})), "keepDownloads");
|
|
37343
37460
|
var keepProviderRefs = /* @__PURE__ */ __name((context, chatKey, messageId, files2) => updatePlaced(context, chatKey, messageId, files2.filter((file) => Object.keys(file.providerRef).length > 0), (file) => refColumn(file.providerRef)), "keepProviderRefs");
|
|
37344
37461
|
|
|
37345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37462
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
37346
37463
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
37347
37464
|
const { database } = context;
|
|
37348
37465
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -37399,7 +37516,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
37399
37516
|
}, "keepAttachmentText")
|
|
37400
37517
|
}), "attachmentsStoreOver");
|
|
37401
37518
|
|
|
37402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37519
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
37403
37520
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
37404
37521
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
37405
37522
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -37579,7 +37696,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
37579
37696
|
return done;
|
|
37580
37697
|
}, "rekeyChats");
|
|
37581
37698
|
|
|
37582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
37583
37700
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
37584
37701
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
37585
37702
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -37637,7 +37754,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
37637
37754
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
37638
37755
|
}, "chatCoverage");
|
|
37639
37756
|
|
|
37640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
37641
37758
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
37642
37759
|
const { database } = context;
|
|
37643
37760
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -37772,7 +37889,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37772
37889
|
};
|
|
37773
37890
|
}, "chatsStoreOver");
|
|
37774
37891
|
|
|
37775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
37776
37893
|
import { createHash as createHash7 } from "node:crypto";
|
|
37777
37894
|
var BATCH_CONTEXT = 50;
|
|
37778
37895
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -37910,7 +38027,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
37910
38027
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
37911
38028
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
37912
38029
|
|
|
37913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38030
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
37914
38031
|
import { setTimeout } from "node:timers/promises";
|
|
37915
38032
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
37916
38033
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -38222,7 +38339,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
38222
38339
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
38223
38340
|
WHERE d.id IN (l.message_id, l.parent_id) AND d.deleted_at > l.created_at)`).map(({ id: id2, parent: parent2 }) => [id2, parent2])), "agentAnswers");
|
|
38224
38341
|
|
|
38225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
38226
38343
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
38227
38344
|
const { database } = context;
|
|
38228
38345
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -38329,7 +38446,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
38329
38446
|
};
|
|
38330
38447
|
}, "conversationsStoreOver");
|
|
38331
38448
|
|
|
38332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
38333
38450
|
var LIVE_MESSAGE = "SELECT m.id AS pk FROM messages m JOIN chats c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id WHERE ac.provider=? AND ac.external_id=? AND c.external_id=? AND m.external_id=? AND m.deleted_at IS NULL";
|
|
38334
38451
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
38335
38452
|
const { database } = context;
|
|
@@ -38354,7 +38471,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
38354
38471
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
38355
38472
|
}), "countersStoreOver");
|
|
38356
38473
|
|
|
38357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38474
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
38358
38475
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
38359
38476
|
var MENTION_QUERY = defineQuery({
|
|
38360
38477
|
entity: "mention",
|
|
@@ -38388,7 +38505,7 @@ var REBUILD_BATCH = 1e3;
|
|
|
38388
38505
|
var REBUILT_AT = "mentionsRebuiltAt";
|
|
38389
38506
|
var rebuildMentions = /* @__PURE__ */ __name((database, { now: now2, kinds: kinds2, onBatch }) => {
|
|
38390
38507
|
const total = SOURCE_TYPES.reduce((sum, type) => sum + Number(database.prepare(SOURCES[type].count).get()?.n), 0);
|
|
38391
|
-
const
|
|
38508
|
+
const read3 = { message: 0, attachment: 0, document: 0, note: 0, email: 0 };
|
|
38392
38509
|
let mentions3 = 0;
|
|
38393
38510
|
for (const type of SOURCE_TYPES) {
|
|
38394
38511
|
const batch = database.prepare(SOURCES[type].page);
|
|
@@ -38406,20 +38523,20 @@ var rebuildMentions = /* @__PURE__ */ __name((database, { now: now2, kinds: kind
|
|
|
38406
38523
|
dequeue.run(type, Number(row2.id));
|
|
38407
38524
|
}
|
|
38408
38525
|
});
|
|
38409
|
-
|
|
38526
|
+
read3[type] += rows.length;
|
|
38410
38527
|
after2 = Number(rows.at(-1)?.id);
|
|
38411
|
-
onBatch?.(Object.values(
|
|
38528
|
+
onBatch?.(Object.values(read3).reduce((sum, one2) => sum + one2, 0), total);
|
|
38412
38529
|
}
|
|
38413
38530
|
}
|
|
38414
38531
|
if (!kinds2) {
|
|
38415
38532
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(REBUILT_AT, JSON.stringify(new Date(now2).toISOString()), now2);
|
|
38416
38533
|
}
|
|
38417
38534
|
return {
|
|
38418
|
-
messages:
|
|
38419
|
-
attachments:
|
|
38420
|
-
documents:
|
|
38421
|
-
notes:
|
|
38422
|
-
emails:
|
|
38535
|
+
messages: read3.message,
|
|
38536
|
+
attachments: read3.attachment,
|
|
38537
|
+
documents: read3.document,
|
|
38538
|
+
notes: read3.note,
|
|
38539
|
+
emails: read3.email,
|
|
38423
38540
|
mentions: mentions3
|
|
38424
38541
|
};
|
|
38425
38542
|
}, "rebuildMentions");
|
|
@@ -38570,7 +38687,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
38570
38687
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
38571
38688
|
}, "listPlaces");
|
|
38572
38689
|
|
|
38573
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38690
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
38574
38691
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
38575
38692
|
const { database } = context;
|
|
38576
38693
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -38605,10 +38722,10 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
38605
38722
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
38606
38723
|
}), "mentionsStoreOver");
|
|
38607
38724
|
|
|
38608
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
38609
38726
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
38610
|
-
const
|
|
38611
|
-
const rows = messageId === void 0 ?
|
|
38727
|
+
const read3 = database.prepare("SELECT m.id, m.external_id, m.text, m.sent_at, m.sender_name, coalesce(m.sender_chat_external_id, i.external_id) AS sender_id FROM messages m LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.chat_id = ? AND m.deleted_at IS NULL AND (m.text LIKE '%google.com%' OR m.text LIKE '%forms.gle%') " + (messageId === void 0 ? "" : "AND m.external_id = ? ") + "ORDER BY m.sent_at DESC, m.id DESC");
|
|
38728
|
+
const rows = messageId === void 0 ? read3.all(chatKey) : read3.all(chatKey, messageId);
|
|
38612
38729
|
const linked = database.prepare(`SELECT json_extract(d.front_matter, '$.fileId') AS file_id, d.title FROM links l JOIN documents d ON d.id = l.to_id AND d.deleted_at IS NULL WHERE l.from_type = 'message' AND l.from_id = ? AND l.to_type = 'document' AND l.kind = ${linkKind("links-to")}`);
|
|
38613
38730
|
return rows.map((row2) => ({
|
|
38614
38731
|
messageId: String(row2.external_id),
|
|
@@ -38620,7 +38737,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
38620
38737
|
}));
|
|
38621
38738
|
}, "documentLinkMessages");
|
|
38622
38739
|
|
|
38623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38740
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
38624
38741
|
var stemmerFor = stemmerCache();
|
|
38625
38742
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
38626
38743
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -38664,7 +38781,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
38664
38781
|
});
|
|
38665
38782
|
}, "laterSharingRare");
|
|
38666
38783
|
|
|
38667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38784
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
38668
38785
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
38669
38786
|
const { database } = context;
|
|
38670
38787
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -38799,7 +38916,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
38799
38916
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
38800
38917
|
}), "messagesStoreOver");
|
|
38801
38918
|
|
|
38802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
38803
38920
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
38804
38921
|
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
38805
38922
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -38856,7 +38973,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
38856
38973
|
});
|
|
38857
38974
|
}, "personPreparation");
|
|
38858
38975
|
|
|
38859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
38860
38977
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
38861
38978
|
const id2 = Number(uid);
|
|
38862
38979
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -38864,7 +38981,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
38864
38981
|
return Boolean(database.prepare("SELECT 1 FROM persons p JOIN identity_links l ON l.person_id=p.id JOIN account_identities a ON a.identity_id=l.identity_id WHERE p.id=? AND a.account_id IN (SELECT value FROM json_each(?)) LIMIT 1").get(id2, JSON.stringify(accountIds)));
|
|
38865
38982
|
}, "personSeenInAccounts");
|
|
38866
38983
|
|
|
38867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
38868
38985
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
38869
38986
|
const row2 = database.prepare("SELECT a.id AS account_id, i.id AS identity_id FROM accounts a JOIN account_identities ai ON ai.account_id=a.id JOIN identities i ON i.id=ai.identity_id WHERE a.provider=? AND a.external_id=? AND i.provider=? AND i.external_id=?").get(key2.provider, key2.account, key2.provider, personId);
|
|
38870
38987
|
if (!row2)
|
|
@@ -38930,7 +39047,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
38930
39047
|
return { id: id2, personId, removed: true };
|
|
38931
39048
|
}, "removeNote");
|
|
38932
39049
|
|
|
38933
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
38934
39051
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
38935
39052
|
const { database } = context;
|
|
38936
39053
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -39015,13 +39132,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
39015
39132
|
};
|
|
39016
39133
|
}, "peopleStoreOver");
|
|
39017
39134
|
|
|
39018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39135
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
39019
39136
|
import { createHash as createHash9 } from "node:crypto";
|
|
39020
39137
|
|
|
39021
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
39022
39139
|
import { createHash as createHash8 } from "node:crypto";
|
|
39023
39140
|
|
|
39024
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
39025
39142
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
39026
39143
|
var AUTHOR_MEASURES = [
|
|
39027
39144
|
"messages",
|
|
@@ -39161,7 +39278,7 @@ var withoutUrls = /* @__PURE__ */ __name((text6) => text6.replace(/\S+/gu, (toke
|
|
|
39161
39278
|
var rankingWords = /* @__PURE__ */ __name((text6) => withoutUrls(text6).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
39162
39279
|
var rankingQuestion = /* @__PURE__ */ __name((text6) => withoutUrls(text6).includes("?"), "rankingQuestion");
|
|
39163
39280
|
|
|
39164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
39165
39282
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
39166
39283
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
39167
39284
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -39383,7 +39500,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
39383
39500
|
};
|
|
39384
39501
|
}, "rankReplyGraph");
|
|
39385
39502
|
|
|
39386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
39387
39504
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
39388
39505
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
39389
39506
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -39557,7 +39674,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
39557
39674
|
return { items, evidence, summary, graph: graph.quality };
|
|
39558
39675
|
}, "calculateAdminStatistics");
|
|
39559
39676
|
|
|
39560
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
39561
39678
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
39562
39679
|
const dates = [];
|
|
39563
39680
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -39579,7 +39696,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
39579
39696
|
return dates[0].node.resolution.date;
|
|
39580
39697
|
}, "rankingContextRange");
|
|
39581
39698
|
|
|
39582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
39583
39700
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
39584
39701
|
let counts;
|
|
39585
39702
|
try {
|
|
@@ -39874,7 +39991,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
39874
39991
|
});
|
|
39875
39992
|
}, "rankQuery");
|
|
39876
39993
|
|
|
39877
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39994
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
39878
39995
|
function fail4(message2, reason = "query.too-large") {
|
|
39879
39996
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
39880
39997
|
}
|
|
@@ -40051,7 +40168,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
40051
40168
|
return result;
|
|
40052
40169
|
}), "adminStatisticsQuery");
|
|
40053
40170
|
|
|
40054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40171
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
40055
40172
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
40056
40173
|
if (!execution.accounts.length)
|
|
40057
40174
|
return { conversations: [], chats: [] };
|
|
@@ -40069,7 +40186,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
40069
40186
|
return { conversations: conversations2, chats: chats2 };
|
|
40070
40187
|
}, "conversationEligibility");
|
|
40071
40188
|
|
|
40072
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
40073
40190
|
import { createHash as createHash10 } from "node:crypto";
|
|
40074
40191
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
40075
40192
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -40219,7 +40336,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
40219
40336
|
return result;
|
|
40220
40337
|
}, "rankingEvidence");
|
|
40221
40338
|
|
|
40222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40339
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
40223
40340
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
40224
40341
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
|
|
40225
40342
|
const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
|
|
@@ -40313,7 +40430,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
40313
40430
|
});
|
|
40314
40431
|
}, "waitingChats");
|
|
40315
40432
|
|
|
40316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40433
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
40317
40434
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
40318
40435
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
40319
40436
|
if (execution.corpus === "mail")
|
|
@@ -40334,7 +40451,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
40334
40451
|
};
|
|
40335
40452
|
}, "queriesStoreOver");
|
|
40336
40453
|
|
|
40337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
40338
40455
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
40339
40456
|
const { database, now: now2 } = context;
|
|
40340
40457
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -40373,10 +40490,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
40373
40490
|
}));
|
|
40374
40491
|
}, "chatEventsOf");
|
|
40375
40492
|
|
|
40376
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40493
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
40377
40494
|
import { createHash as createHash11 } from "node:crypto";
|
|
40378
40495
|
|
|
40379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
40380
40497
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
40381
40498
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
40382
40499
|
timeZone: zone,
|
|
@@ -40396,7 +40513,7 @@ var weekKey = /* @__PURE__ */ __name((day2) => {
|
|
|
40396
40513
|
return date3.toISOString().slice(0, 10);
|
|
40397
40514
|
}, "weekKey");
|
|
40398
40515
|
|
|
40399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40516
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
40400
40517
|
var RETENTION_TOLERANCE = 864e5;
|
|
40401
40518
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
40402
40519
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -40450,7 +40567,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
40450
40567
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
40451
40568
|
}, "retentionCohorts");
|
|
40452
40569
|
|
|
40453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40570
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
40454
40571
|
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
40455
40572
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
40456
40573
|
validateRetentionOptions(options);
|
|
@@ -40496,14 +40613,14 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
40496
40613
|
lagMilliseconds: null,
|
|
40497
40614
|
complete: null
|
|
40498
40615
|
};
|
|
40499
|
-
const
|
|
40616
|
+
const read3 = observationStatement.get(pk, chatPk, target, Math.min(target + RETENTION_TOLERANCE, options.cutoff));
|
|
40500
40617
|
return {
|
|
40501
40618
|
checkpoint,
|
|
40502
40619
|
targetAt: iso6(target),
|
|
40503
|
-
state: !
|
|
40504
|
-
observedAt:
|
|
40505
|
-
lagMilliseconds:
|
|
40506
|
-
complete:
|
|
40620
|
+
state: !read3 ? "unknown" : Number(read3.present) === 1 ? "present" : Number(read3.complete) === 1 ? "absent" : "unknown",
|
|
40621
|
+
observedAt: read3 ? iso6(Number(read3.observed_at)) : null,
|
|
40622
|
+
lagMilliseconds: read3 ? Number(read3.observed_at) - target : null,
|
|
40623
|
+
complete: read3 ? Number(read3.complete) === 1 : null
|
|
40507
40624
|
};
|
|
40508
40625
|
}),
|
|
40509
40626
|
activity: {
|
|
@@ -40581,7 +40698,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
40581
40698
|
};
|
|
40582
40699
|
}, "retentionQuery");
|
|
40583
40700
|
|
|
40584
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
40585
40702
|
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
40586
40703
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
40587
40704
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -40712,7 +40829,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
40712
40829
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
40713
40830
|
})), "trackedChats");
|
|
40714
40831
|
|
|
40715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
40716
40833
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
40717
40834
|
const { database } = context;
|
|
40718
40835
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -40722,11 +40839,11 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40722
40839
|
const chatKey = chatKeyOf(key2, chatId);
|
|
40723
40840
|
return chatKey === void 0 ? [] : members(context, chatKey);
|
|
40724
40841
|
}, "members"),
|
|
40725
|
-
saveRoster: /* @__PURE__ */ __name(async (key2, chatId,
|
|
40842
|
+
saveRoster: /* @__PURE__ */ __name(async (key2, chatId, read3) => {
|
|
40726
40843
|
let change = { joined: [], gone: [], changed: [] };
|
|
40727
40844
|
write(database, () => {
|
|
40728
40845
|
const accountKey = accountPk2(key2);
|
|
40729
|
-
change = saveRoster(context, accountKey, key2.provider, chatPkFor2(accountKey, chatId),
|
|
40846
|
+
change = saveRoster(context, accountKey, key2.provider, chatPkFor2(accountKey, chatId), read3);
|
|
40730
40847
|
});
|
|
40731
40848
|
return change;
|
|
40732
40849
|
}, "saveRoster"),
|
|
@@ -40768,7 +40885,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40768
40885
|
};
|
|
40769
40886
|
}, "rosterStoreOver");
|
|
40770
40887
|
|
|
40771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40888
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
40772
40889
|
var pendingNormalization = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL").get()?.n), "pendingNormalization");
|
|
40773
40890
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
40774
40891
|
const next = database.prepare(`SELECT id AS pk, text FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL AND id > ? ORDER BY id LIMIT ?`);
|
|
@@ -40792,7 +40909,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
40792
40909
|
}
|
|
40793
40910
|
}, "backfillNormalized");
|
|
40794
40911
|
|
|
40795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40912
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
40796
40913
|
var INDEX2 = "message_words";
|
|
40797
40914
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
40798
40915
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -40919,7 +41036,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
40919
41036
|
});
|
|
40920
41037
|
}, "resetSearchIndex");
|
|
40921
41038
|
|
|
40922
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
40923
41040
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
40924
41041
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
40925
41042
|
const before2 = stemsState(database);
|
|
@@ -41014,7 +41131,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
41014
41131
|
return resetStems(database, { now: now2 });
|
|
41015
41132
|
}, "followDefaultStemmers");
|
|
41016
41133
|
|
|
41017
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
41018
41135
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
41019
41136
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
41020
41137
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -41036,7 +41153,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
41036
41153
|
});
|
|
41037
41154
|
}, "termCandidates");
|
|
41038
41155
|
|
|
41039
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41156
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
41040
41157
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41041
41158
|
const { database } = context;
|
|
41042
41159
|
const stemmerFor2 = stemmerCache();
|
|
@@ -41060,7 +41177,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41060
41177
|
};
|
|
41061
41178
|
}, "searchIndexStoreOver");
|
|
41062
41179
|
|
|
41063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41180
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
41064
41181
|
var HISTORY_KEPT = 1e3;
|
|
41065
41182
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
41066
41183
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -41129,7 +41246,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
41129
41246
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
41130
41247
|
}, "clearHistory");
|
|
41131
41248
|
|
|
41132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
41133
41250
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41134
41251
|
const { database } = context;
|
|
41135
41252
|
return {
|
|
@@ -41153,7 +41270,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41153
41270
|
};
|
|
41154
41271
|
}, "searchesStoreOver");
|
|
41155
41272
|
|
|
41156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41273
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
41157
41274
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
41158
41275
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
41159
41276
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -41196,7 +41313,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
41196
41313
|
};
|
|
41197
41314
|
}, "agentActionsStoreOver");
|
|
41198
41315
|
|
|
41199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
41200
41317
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
41201
41318
|
}) => {
|
|
41202
41319
|
const { database, now: now2 } = context;
|
|
@@ -41255,7 +41372,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
41255
41372
|
};
|
|
41256
41373
|
}, "botUpdateStoreOver");
|
|
41257
41374
|
|
|
41258
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
41259
41376
|
var DAY4 = 864e5;
|
|
41260
41377
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
41261
41378
|
if (filter.accountIds !== void 0 && filter.accountId !== void 0)
|
|
@@ -41364,7 +41481,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
41364
41481
|
return database.prepare(`SELECT e.* FROM events e WHERE ${clauses.join(" AND ")} ORDER BY ${filter.newest ? "e.starts_at DESC, e.id DESC" : "e.starts_at, e.id"} LIMIT ? OFFSET ?`).all(...params, limit, offset).map(eventOf);
|
|
41365
41482
|
}, "listEvents");
|
|
41366
41483
|
|
|
41367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41484
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
41368
41485
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
41369
41486
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
41370
41487
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -41419,7 +41536,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
41419
41536
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
41420
41537
|
}, "forgetCalendarRows");
|
|
41421
41538
|
|
|
41422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
41423
41540
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
41424
41541
|
id: Number(row2.id),
|
|
41425
41542
|
accountId: Number(row2.account_id),
|
|
@@ -42006,7 +42123,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42006
42123
|
};
|
|
42007
42124
|
}, "eventStoreOver");
|
|
42008
42125
|
|
|
42009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
42010
42127
|
var CATALOG_QUERY = defineQuery({
|
|
42011
42128
|
entity: "document",
|
|
42012
42129
|
backend: "sql",
|
|
@@ -42248,7 +42365,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
42248
42365
|
};
|
|
42249
42366
|
}, "catalogStoreOver");
|
|
42250
42367
|
|
|
42251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
42252
42369
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
42253
42370
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
42254
42371
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -42261,7 +42378,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
42261
42378
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
42262
42379
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
42263
42380
|
|
|
42264
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
42265
42382
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
42266
42383
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
42267
42384
|
signal?.throwIfAborted();
|
|
@@ -42360,7 +42477,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
42360
42477
|
});
|
|
42361
42478
|
}, "readMeetingContextEvidence");
|
|
42362
42479
|
|
|
42363
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
42364
42481
|
var corpora = {
|
|
42365
42482
|
message: {
|
|
42366
42483
|
table: "messages",
|
|
@@ -42599,7 +42716,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
42599
42716
|
}
|
|
42600
42717
|
}), "contextRecordsOver");
|
|
42601
42718
|
|
|
42602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
42603
42720
|
import { createHash as createHash12 } from "node:crypto";
|
|
42604
42721
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
42605
42722
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -42831,7 +42948,7 @@ var envelopeOfJsonl = /* @__PURE__ */ __name((text6) => {
|
|
|
42831
42948
|
return isObject2(header) ? { ...header, records: records2 } : header;
|
|
42832
42949
|
}, "envelopeOfJsonl");
|
|
42833
42950
|
|
|
42834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
42835
42952
|
var TABLES = { deal: "deals", lead: "leads" };
|
|
42836
42953
|
var SOURCE = "crm";
|
|
42837
42954
|
var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${key2.account}/${type}/${externalId}`, "crmIdentityId");
|
|
@@ -43106,7 +43223,7 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
43106
43223
|
};
|
|
43107
43224
|
}, "crmCopiesOver");
|
|
43108
43225
|
|
|
43109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
43110
43227
|
var refuse = /* @__PURE__ */ __name((message2, reason, code = "validation_error") => {
|
|
43111
43228
|
throw new CliError(code, message2, { reason });
|
|
43112
43229
|
}, "refuse");
|
|
@@ -43567,7 +43684,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43567
43684
|
};
|
|
43568
43685
|
}, "financeStoreOver");
|
|
43569
43686
|
|
|
43570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
43571
43688
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
43572
43689
|
var itemsSql = /* @__PURE__ */ __name((kind4) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id FROM ${TABLES2[kind4]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id`, "itemsSql");
|
|
43573
43690
|
var MAX_STAGES = 30;
|
|
@@ -43649,7 +43766,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43649
43766
|
return refuse(`${reference2} is not a deal or a lead`, "deal.ref");
|
|
43650
43767
|
return { kind: thing.type, row: database.prepare(`${itemsSql(thing.type)} WHERE d.id = ?`).get(thing.id) };
|
|
43651
43768
|
}, "rowOf");
|
|
43652
|
-
const
|
|
43769
|
+
const read3 = /* @__PURE__ */ __name((reference2) => {
|
|
43653
43770
|
const { kind: kind4, row: row2 } = rowOf2(reference2);
|
|
43654
43771
|
return itemOf(kind4)(row2);
|
|
43655
43772
|
}, "read");
|
|
@@ -43837,9 +43954,9 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43837
43954
|
linkEvidence(context, { type: kind4, id: made }, evidence, owner ? "owner" : "agent");
|
|
43838
43955
|
return made;
|
|
43839
43956
|
});
|
|
43840
|
-
return
|
|
43957
|
+
return read3(`${kind4}:${id2}`);
|
|
43841
43958
|
}, "add"),
|
|
43842
|
-
get: /* @__PURE__ */ __name((reference2) =>
|
|
43959
|
+
get: /* @__PURE__ */ __name((reference2) => read3(reference2), "get"),
|
|
43843
43960
|
list: /* @__PURE__ */ __name((filter = {}) => {
|
|
43844
43961
|
const kind4 = kindOf4(filter.kind);
|
|
43845
43962
|
const project2 = filter.project === void 0 ? null : projectId(database, filter.project);
|
|
@@ -43855,17 +43972,17 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43855
43972
|
const limit = Math.min(Math.max(filter.limit ?? 100, 1), 500);
|
|
43856
43973
|
return database.prepare(`${itemsSql(kind4)} WHERE d.deleted_at IS NULL AND (? IS NULL OR d.status = ?) AND (? IS NULL OR d.project_id = ?) AND (? IS NULL OR s.name_folded = ?) AND (? IS NULL OR p.id = ?) AND (? IS NULL OR d.organization_id = ?) AND (? = 0 OR d.account_id IS NULL) AND (? IS NULL OR (a.provider = ? AND a.external_id = ?)) AND ${by.sql} ORDER BY d.created_at DESC, d.id DESC LIMIT ? OFFSET ?`).all(status, status, project2, project2, stage, stage, pipeline, pipeline, organization2?.id ?? null, organization2?.id ?? null, own, provider, provider, account, ...by.params, limit, Math.max(0, Math.trunc(filter.offset ?? 0))).map(itemOf(kind4));
|
|
43857
43974
|
}, "list"),
|
|
43858
|
-
find: /* @__PURE__ */ __name(({ words: words3, anyWord, accounts: accounts2, limit }) => {
|
|
43975
|
+
find: /* @__PURE__ */ __name(({ words: words3, anyWord, accounts: accounts2, kinds: kinds2 = DEAL_KINDS, limit }) => {
|
|
43859
43976
|
const wanted = [...new Set(words3.map((word2) => fold(word2).trim()).filter(Boolean))];
|
|
43860
43977
|
if (!wanted.length)
|
|
43861
43978
|
return [];
|
|
43862
43979
|
const most2 = Math.min(Math.max(limit ?? 100, 1), 500);
|
|
43863
43980
|
const within = accounts2?.map(({ provider, account }) => `${provider}\0${account}`);
|
|
43864
|
-
const found2 =
|
|
43981
|
+
const found2 = kinds2.flatMap((kind4) => database.prepare(`SELECT d.id, d.title, d.updated_at, a.provider, a.external_id AS account FROM ${TABLES2[kind4]} d LEFT JOIN accounts a ON a.id = d.account_id WHERE d.deleted_at IS NULL`).all().filter((row2) => within === void 0 || within.includes(`${row2.provider}\0${row2.account}`)).map((row2) => {
|
|
43865
43982
|
const title = fold(String(row2.title));
|
|
43866
43983
|
return { kind: kind4, row: row2, score: wanted.filter((word2) => title.includes(word2)).length };
|
|
43867
43984
|
}).filter(({ score }) => anyWord ? score > 0 : score === wanted.length));
|
|
43868
|
-
return found2.sort((a, b) => b.score - a.score || Number(b.row.updated_at) - Number(a.row.updated_at) || Number(b.row.id) - Number(a.row.id)).slice(0, most2).map(({ kind: kind4, row: row2 }) =>
|
|
43985
|
+
return found2.sort((a, b) => b.score - a.score || Number(b.row.updated_at) - Number(a.row.updated_at) || Number(b.row.id) - Number(a.row.id)).slice(0, most2).map(({ kind: kind4, row: row2 }) => read3(`${kind4}:${row2.id}`));
|
|
43869
43986
|
}, "find"),
|
|
43870
43987
|
move: /* @__PURE__ */ __name((reference2, { stage, by }) => {
|
|
43871
43988
|
authorActor(context, by);
|
|
@@ -43873,7 +43990,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43873
43990
|
notDeleted(row2, kind4, "moves");
|
|
43874
43991
|
const next = stageRow(text3(stage, "a stage's name", 80) ?? "", kind4, Number(row2.pipeline_id));
|
|
43875
43992
|
write(database, () => setStage(kind4, Number(row2.id), next, next.outcome, today()));
|
|
43876
|
-
return
|
|
43993
|
+
return read3(`${kind4}:${row2.id}`);
|
|
43877
43994
|
}, "move"),
|
|
43878
43995
|
close: /* @__PURE__ */ __name((reference2, { status, date: date3, reason, by }) => {
|
|
43879
43996
|
authorActor(context, by);
|
|
@@ -43888,7 +44005,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43888
44005
|
if (why !== null)
|
|
43889
44006
|
database.prepare(`UPDATE ${TABLES2[kind4]} SET metadata = json_set(coalesce(metadata, '{}'), '$.closed_reason', ?) WHERE id = ?`).run(why, Number(row2.id));
|
|
43890
44007
|
});
|
|
43891
|
-
return
|
|
44008
|
+
return read3(`${kind4}:${row2.id}`);
|
|
43892
44009
|
}, "close")
|
|
43893
44010
|
};
|
|
43894
44011
|
}, "dealOperationsOver");
|
|
@@ -43907,7 +44024,112 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43907
44024
|
};
|
|
43908
44025
|
}, "dealsStoreOver");
|
|
43909
44026
|
|
|
43910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
44028
|
+
import { createHash as createHash13, randomBytes as randomBytes2 } from "node:crypto";
|
|
44029
|
+
|
|
44030
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
44031
|
+
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
44032
|
+
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
44033
|
+
var TOKEN2 = /^[A-Za-z0-9_-]{21}[AQgw]$/;
|
|
44034
|
+
var isDecisionToken = /* @__PURE__ */ __name((value) => typeof value === "string" && TOKEN2.test(value), "isDecisionToken");
|
|
44035
|
+
|
|
44036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
44037
|
+
var digestOf = /* @__PURE__ */ __name((token) => createHash13("sha256").update(token).digest("hex"), "digestOf");
|
|
44038
|
+
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
44039
|
+
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
44040
|
+
proposalId: row2.proposal_id,
|
|
44041
|
+
action: row2.action,
|
|
44042
|
+
batchDigest: row2.batch_digest,
|
|
44043
|
+
channel: row2.channel,
|
|
44044
|
+
botProfile: row2.bot_profile,
|
|
44045
|
+
chatId: row2.chat_id,
|
|
44046
|
+
messageId: row2.message_id,
|
|
44047
|
+
ownerUserId: row2.owner_user_id,
|
|
44048
|
+
createdAt: row2.created_at,
|
|
44049
|
+
expiresAt: row2.expires_at
|
|
44050
|
+
}), "requestOf");
|
|
44051
|
+
var PRUNE_AFTER_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
44052
|
+
var SAME_MESSAGE = "channel=? AND bot_profile=? AND chat_id=? AND message_id=?";
|
|
44053
|
+
var OPEN2 = "used_at IS NULL AND cancelled_at IS NULL";
|
|
44054
|
+
var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
44055
|
+
const refusal2 = /* @__PURE__ */ __name((row2, at) => {
|
|
44056
|
+
if (!row2)
|
|
44057
|
+
return "decision.token-unknown";
|
|
44058
|
+
if (row2.used_at !== null)
|
|
44059
|
+
return "decision.token-used";
|
|
44060
|
+
if (row2.cancelled_at !== null)
|
|
44061
|
+
return "decision.token-cancelled";
|
|
44062
|
+
if (row2.expires_at <= at)
|
|
44063
|
+
return "decision.token-expired";
|
|
44064
|
+
return void 0;
|
|
44065
|
+
}, "refusal");
|
|
44066
|
+
return {
|
|
44067
|
+
create: /* @__PURE__ */ __name((input) => {
|
|
44068
|
+
const { actions, ...fields4 } = input;
|
|
44069
|
+
const text6 = [
|
|
44070
|
+
fields4.proposalId,
|
|
44071
|
+
fields4.batchDigest,
|
|
44072
|
+
fields4.channel,
|
|
44073
|
+
fields4.botProfile,
|
|
44074
|
+
fields4.chatId,
|
|
44075
|
+
fields4.messageId,
|
|
44076
|
+
fields4.ownerUserId
|
|
44077
|
+
];
|
|
44078
|
+
if (text6.some((value) => typeof value !== "string" || value === ""))
|
|
44079
|
+
throw new CliError("validation_error", "a decision request needs its batch, message and owner", {
|
|
44080
|
+
reason: "decision.request-invalid"
|
|
44081
|
+
});
|
|
44082
|
+
if (actions.length === 0 || new Set(actions).size !== actions.length || actions.some((action) => !DECISION_ACTIONS.includes(action)))
|
|
44083
|
+
throw new CliError("validation_error", "a decision request needs distinct, known actions", {
|
|
44084
|
+
reason: "decision.request-invalid"
|
|
44085
|
+
});
|
|
44086
|
+
const at = now2();
|
|
44087
|
+
return write(database, () => actions.map((action) => {
|
|
44088
|
+
const token = newToken();
|
|
44089
|
+
database.prepare(`INSERT INTO decision_requests (token_digest, proposal_id, action, batch_digest, channel, bot_profile,
|
|
44090
|
+
chat_id, message_id, owner_user_id, created_at, expires_at) VALUES (?,?,?,?,?,?,?,?,?,?,?)`).run(digestOf(token), fields4.proposalId, action, fields4.batchDigest, fields4.channel, fields4.botProfile, fields4.chatId, fields4.messageId, fields4.ownerUserId, at, at + DECISION_TTL_MS);
|
|
44091
|
+
return { action, token };
|
|
44092
|
+
}));
|
|
44093
|
+
}, "create"),
|
|
44094
|
+
take: /* @__PURE__ */ __name((token, expect) => {
|
|
44095
|
+
if (!isDecisionToken(token))
|
|
44096
|
+
return { ok: false, reason: "decision.token-unknown" };
|
|
44097
|
+
const digest = digestOf(token);
|
|
44098
|
+
return write(database, () => {
|
|
44099
|
+
const at = now2();
|
|
44100
|
+
const row2 = database.prepare("SELECT * FROM decision_requests WHERE token_digest=?").get(digest);
|
|
44101
|
+
if (!row2)
|
|
44102
|
+
return { ok: false, reason: "decision.token-unknown" };
|
|
44103
|
+
if (expect.botProfile !== row2.bot_profile || expect.chatId !== row2.chat_id || expect.messageId !== row2.message_id || expect.ownerUserId !== row2.owner_user_id)
|
|
44104
|
+
return { ok: false, reason: "decision.token-mismatch" };
|
|
44105
|
+
const reason = refusal2(row2, at);
|
|
44106
|
+
if (reason)
|
|
44107
|
+
return { ok: false, reason };
|
|
44108
|
+
database.prepare("UPDATE decision_requests SET used_at=? WHERE id=?").run(at, row2.id);
|
|
44109
|
+
const { changes } = database.prepare(`UPDATE decision_requests SET cancelled_at=? WHERE ${SAME_MESSAGE} AND id<>? AND ${OPEN2}`).run(at, row2.channel, row2.bot_profile, row2.chat_id, row2.message_id, row2.id);
|
|
44110
|
+
return { ok: true, request: requestOf(row2), cancelled: Number(changes) };
|
|
44111
|
+
});
|
|
44112
|
+
}, "take"),
|
|
44113
|
+
cancelOpen: /* @__PURE__ */ __name((scope3 = {}) => {
|
|
44114
|
+
const filters = [];
|
|
44115
|
+
const values = [];
|
|
44116
|
+
if (scope3.channel !== void 0) {
|
|
44117
|
+
filters.push("channel=?");
|
|
44118
|
+
values.push(scope3.channel);
|
|
44119
|
+
}
|
|
44120
|
+
if (scope3.botProfile !== void 0) {
|
|
44121
|
+
filters.push("bot_profile=?");
|
|
44122
|
+
values.push(scope3.botProfile);
|
|
44123
|
+
}
|
|
44124
|
+
const where = [OPEN2, ...filters].join(" AND ");
|
|
44125
|
+
return write(database, () => Number(database.prepare(`UPDATE decision_requests SET cancelled_at=? WHERE ${where}`).run(now2(), ...values).changes));
|
|
44126
|
+
}, "cancelOpen"),
|
|
44127
|
+
prune: /* @__PURE__ */ __name((at = now2()) => write(database, () => Number(database.prepare(`DELETE FROM decision_requests WHERE expires_at < ?1 OR used_at < ?1 OR cancelled_at < ?1`).run(at - PRUNE_AFTER_MS).changes)), "prune"),
|
|
44128
|
+
open: /* @__PURE__ */ __name((message2) => database.prepare(`SELECT * FROM decision_requests WHERE ${SAME_MESSAGE} AND ${OPEN2} AND expires_at>? ORDER BY id`).all(message2.channel, message2.botProfile, message2.chatId, message2.messageId, now2()).map(requestOf), "open")
|
|
44129
|
+
};
|
|
44130
|
+
}, "decisionRequestStoreOver");
|
|
44131
|
+
|
|
44132
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
43911
44133
|
var NOTE_FIELDS = [
|
|
43912
44134
|
"text",
|
|
43913
44135
|
"exact",
|
|
@@ -43923,7 +44145,7 @@ var NOTE_FIELDS = [
|
|
|
43923
44145
|
"keyword",
|
|
43924
44146
|
"source"
|
|
43925
44147
|
];
|
|
43926
|
-
var
|
|
44148
|
+
var quoted3 = /* @__PURE__ */ __name((value) => `"${value.replaceAll('"', '""')}"`, "quoted");
|
|
43927
44149
|
var bound4 = /* @__PURE__ */ __name((sql2, ...params) => ({ sql: sql2, params, exact: true }), "bound");
|
|
43928
44150
|
var combine2 = /* @__PURE__ */ __name((parts2, operator) => ({
|
|
43929
44151
|
sql: parts2.length ? `(${parts2.map(({ sql: sql2 }) => sql2).join(` ${operator} `)})` : operator === "AND" ? "1" : "0",
|
|
@@ -43968,13 +44190,13 @@ var matchedRows = /* @__PURE__ */ __name((context, query) => {
|
|
|
43968
44190
|
var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
43969
44191
|
const offset = query.offset ?? 0;
|
|
43970
44192
|
const rows = matchedRows(context, query);
|
|
43971
|
-
const
|
|
44193
|
+
const read3 = {
|
|
43972
44194
|
document: context.database.prepare("SELECT * FROM documents WHERE id = ?"),
|
|
43973
44195
|
note: context.database.prepare("SELECT * FROM notes WHERE id = ?")
|
|
43974
44196
|
};
|
|
43975
44197
|
return {
|
|
43976
44198
|
items: rows.slice(offset, offset + query.limit).map((row2) => {
|
|
43977
|
-
const found2 =
|
|
44199
|
+
const found2 = read3[row2.type === "document" ? "document" : "note"].get(row2.id);
|
|
43978
44200
|
const note2 = row2.type === "document" ? documentOf(found2) : noteOf(found2);
|
|
43979
44201
|
return {
|
|
43980
44202
|
ref: note2.ref,
|
|
@@ -44028,9 +44250,9 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
44028
44250
|
const stems = query.stemmer.phrases(value);
|
|
44029
44251
|
return {
|
|
44030
44252
|
sql: `n.id IN (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)${stems ? ` OR n.id IN (SELECT rowid FROM ${corpus.stems} WHERE ${corpus.stems} MATCH ?)` : ""}`,
|
|
44031
|
-
params: [`normalized_text : (${
|
|
44253
|
+
params: [`normalized_text : (${quoted3(text6)})`, ...stems ? [`stems : (${stems})`] : []],
|
|
44032
44254
|
exact: true,
|
|
44033
|
-
fts:
|
|
44255
|
+
fts: quoted3(text6),
|
|
44034
44256
|
...stems ? { stems } : {}
|
|
44035
44257
|
};
|
|
44036
44258
|
}
|
|
@@ -44038,7 +44260,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
44038
44260
|
if (operator === "term" || operator === "phrase") {
|
|
44039
44261
|
const text6 = normalize(value);
|
|
44040
44262
|
const stems = query.stemmer?.phrases(value);
|
|
44041
|
-
return /[\p{L}\p{N}]/u.test(text6) ? { ...wordMatch2(
|
|
44263
|
+
return /[\p{L}\p{N}]/u.test(text6) ? { ...wordMatch2(quoted3(text6)), ...stems ? { stems } : {} } : bound4("0");
|
|
44042
44264
|
}
|
|
44043
44265
|
const pattern = operator === "wildcard" ? wildcardPattern(normalize(value)) : foldRegex(value, node.span);
|
|
44044
44266
|
const matcher = automaton(pattern, node);
|
|
@@ -44049,7 +44271,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
44049
44271
|
exhausted("term expansions");
|
|
44050
44272
|
const matches2 = terms2.flatMap(({ term }) => {
|
|
44051
44273
|
check3();
|
|
44052
|
-
return matcher.test(String(term), budget) ? [
|
|
44274
|
+
return matcher.test(String(term), budget) ? [quoted3(String(term))] : [];
|
|
44053
44275
|
});
|
|
44054
44276
|
return matches2.length ? wordMatch2(matches2.join(" OR ")) : bound4("0");
|
|
44055
44277
|
}
|
|
@@ -44190,7 +44412,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
44190
44412
|
const { database } = context;
|
|
44191
44413
|
const stemmerFor2 = stemmerCache();
|
|
44192
44414
|
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database, stemmerFor2), "drain");
|
|
44193
|
-
const
|
|
44415
|
+
const read3 = /* @__PURE__ */ __name((type, id2) => {
|
|
44194
44416
|
const row2 = database.prepare(`SELECT * FROM ${type === "document" ? "documents" : "notes"} WHERE id = ?`).get(id2);
|
|
44195
44417
|
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2) : void 0;
|
|
44196
44418
|
}, "read");
|
|
@@ -44220,7 +44442,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
44220
44442
|
const textOf6 = /* @__PURE__ */ __name((owner) => {
|
|
44221
44443
|
if (!texts2.has(owner)) {
|
|
44222
44444
|
const [type, id2] = owner.split(":");
|
|
44223
|
-
const note2 =
|
|
44445
|
+
const note2 = read3(String(type), Number(id2));
|
|
44224
44446
|
texts2.set(owner, note2 ? noteIndexText(note2.title, note2.text) : void 0);
|
|
44225
44447
|
}
|
|
44226
44448
|
return texts2.get(owner);
|
|
@@ -44309,7 +44531,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
44309
44531
|
}, "scanned");
|
|
44310
44532
|
return (indexed() ?? scanned()).flatMap(([key2, { score, start, end }]) => {
|
|
44311
44533
|
const [type, id2] = key2.split(":");
|
|
44312
|
-
const note2 =
|
|
44534
|
+
const note2 = read3(String(type), Number(id2));
|
|
44313
44535
|
return note2 ? [{ ref: note2.ref, note: note2, score, range: { start, end } }] : [];
|
|
44314
44536
|
});
|
|
44315
44537
|
}, "nearest"),
|
|
@@ -44337,7 +44559,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
44337
44559
|
};
|
|
44338
44560
|
}, "noteSearchOver");
|
|
44339
44561
|
|
|
44340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
44341
44563
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
44342
44564
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
44343
44565
|
var EVENT_CORPUS = {
|
|
@@ -44469,7 +44691,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
44469
44691
|
};
|
|
44470
44692
|
}, "eventSearchOver");
|
|
44471
44693
|
|
|
44472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
44473
44695
|
var refuse2 = /* @__PURE__ */ __name((message2, reason) => {
|
|
44474
44696
|
throw new CliError("validation_error", message2, { reason });
|
|
44475
44697
|
}, "refuse");
|
|
@@ -44547,7 +44769,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
44547
44769
|
};
|
|
44548
44770
|
}, "paymentEntriesOver");
|
|
44549
44771
|
|
|
44550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
44551
44773
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
44552
44774
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
44553
44775
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -44573,7 +44795,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
44573
44795
|
return valid;
|
|
44574
44796
|
}, "validateEvidenceFindings");
|
|
44575
44797
|
|
|
44576
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
44577
44799
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
44578
44800
|
try {
|
|
44579
44801
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -44585,7 +44807,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
44585
44807
|
}
|
|
44586
44808
|
}, "calendarMoment");
|
|
44587
44809
|
|
|
44588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
44589
44811
|
var NAMED3 = "SELECT f.*, b.name AS author_name, b.kind AS author_kind FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
|
|
44590
44812
|
var iso10 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
44591
44813
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -44794,7 +45016,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
44794
45016
|
};
|
|
44795
45017
|
}, "factsStoreOver");
|
|
44796
45018
|
|
|
44797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
44798
45020
|
var invalid5 = /* @__PURE__ */ __name((message2) => {
|
|
44799
45021
|
throw new CliError("validation_error", message2);
|
|
44800
45022
|
}, "invalid");
|
|
@@ -44898,7 +45120,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
|
|
|
44898
45120
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
|
|
44899
45121
|
}, "findingsCoreOver");
|
|
44900
45122
|
|
|
44901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
44902
45124
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
44903
45125
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
44904
45126
|
var iso11 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -45063,7 +45285,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45063
45285
|
};
|
|
45064
45286
|
}, "proposedActionsStoreOver");
|
|
45065
45287
|
|
|
45066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
45067
45289
|
var stale = /* @__PURE__ */ __name(() => {
|
|
45068
45290
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
45069
45291
|
reason: "evidence-findings.stale"
|
|
@@ -45244,7 +45466,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45244
45466
|
};
|
|
45245
45467
|
}, "evidenceFindingsStoreOver");
|
|
45246
45468
|
|
|
45247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45469
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
45248
45470
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
45249
45471
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
45250
45472
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -45297,8 +45519,8 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
45297
45519
|
}, "forPerson")
|
|
45298
45520
|
}), "involvementStoreOver");
|
|
45299
45521
|
|
|
45300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45301
|
-
import { createHash as
|
|
45522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
45523
|
+
import { createHash as createHash14 } from "node:crypto";
|
|
45302
45524
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
45303
45525
|
var id = /* @__PURE__ */ __name((value) => {
|
|
45304
45526
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
@@ -45327,7 +45549,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
45327
45549
|
project: `project:${row2.to_id}`,
|
|
45328
45550
|
confirmed: Number(row2.confirmed) === 1,
|
|
45329
45551
|
provenance: row2.evidence == null ? null : String(row2.evidence),
|
|
45330
|
-
fingerprint:
|
|
45552
|
+
fingerprint: createHash14("sha256").update(JSON.stringify([row2.id, row2.from_id, row2.to_id, row2.source, row2.confirmed, row2.evidence, row2.updated_at])).digest("hex")
|
|
45331
45553
|
};
|
|
45332
45554
|
}, "linkOf");
|
|
45333
45555
|
return {
|
|
@@ -45383,7 +45605,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
45383
45605
|
};
|
|
45384
45606
|
}, "meetingProjectsStoreOver");
|
|
45385
45607
|
|
|
45386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
45387
45609
|
var ORGANIZATIONS_QUERY = {
|
|
45388
45610
|
entity: "organization",
|
|
45389
45611
|
backend: "sql",
|
|
@@ -45424,7 +45646,7 @@ var REMINDERS_QUERY = {
|
|
|
45424
45646
|
})
|
|
45425
45647
|
};
|
|
45426
45648
|
|
|
45427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
45428
45650
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
45429
45651
|
id: String(row2.id),
|
|
45430
45652
|
ref: `organization:${row2.id}`,
|
|
@@ -45457,7 +45679,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
45457
45679
|
}), "updateOrganization")
|
|
45458
45680
|
}), "organizationsStoreOver");
|
|
45459
45681
|
|
|
45460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
45461
45683
|
var relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
45462
45684
|
id: link3.id,
|
|
45463
45685
|
from: link3.from,
|
|
@@ -45683,16 +45905,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
45683
45905
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
45684
45906
|
}, "decidedOrigin");
|
|
45685
45907
|
|
|
45686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
45909
|
+
import { createHash as createHash17 } from "node:crypto";
|
|
45910
|
+
|
|
45911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
45687
45912
|
import { createHash as createHash16 } from "node:crypto";
|
|
45688
45913
|
|
|
45689
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
45690
45915
|
import { createHash as createHash15 } from "node:crypto";
|
|
45691
45916
|
|
|
45692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45693
|
-
import { createHash as createHash14 } from "node:crypto";
|
|
45694
|
-
|
|
45695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.599.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_9abdd607bcc42461f37eac6c77838a67/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
45917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
45696
45918
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
45697
45919
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
45698
45920
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -45743,7 +45965,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
45743
45965
|
return input;
|
|
45744
45966
|
}, "consolidationApplyInput");
|
|
45745
45967
|
|
|
45746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
45747
45969
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
45748
45970
|
id: String(row2.id),
|
|
45749
45971
|
sourceId: String(row2.source_id),
|
|
@@ -45767,7 +45989,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
45767
45989
|
check3();
|
|
45768
45990
|
return write(database, () => {
|
|
45769
45991
|
const owner = ownerPerson(database);
|
|
45770
|
-
const request =
|
|
45992
|
+
const request = createHash15("sha256").update(JSON.stringify([
|
|
45771
45993
|
source2,
|
|
45772
45994
|
survivor,
|
|
45773
45995
|
owner.type,
|
|
@@ -45818,7 +46040,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
45818
46040
|
}, { beforeCommit: check3 });
|
|
45819
46041
|
}, "applyTagConsolidation");
|
|
45820
46042
|
|
|
45821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46043
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
45822
46044
|
var selections = [
|
|
45823
46045
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
45824
46046
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -45864,7 +46086,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
45864
46086
|
const memberIds = JSON.stringify([...sourceMemberIds, ...survivorMemberIds].map(Number));
|
|
45865
46087
|
const captured = JSON.stringify(graph);
|
|
45866
46088
|
let readBytes = Buffer.byteLength(captured);
|
|
45867
|
-
const hash2 =
|
|
46089
|
+
const hash2 = createHash16("sha256").update(JSON.stringify([source2, survivor, catalog.fingerprint, graph]));
|
|
45868
46090
|
for (const [table, where] of selections) {
|
|
45869
46091
|
cancelled(options);
|
|
45870
46092
|
const parameters = table === "links" ? [memberIds, memberIds] : [memberIds];
|
|
@@ -45962,7 +46184,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
45962
46184
|
};
|
|
45963
46185
|
}, "previewRows");
|
|
45964
46186
|
|
|
45965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
45966
46188
|
var kinds = ["project", "tag", "topic"];
|
|
45967
46189
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
45968
46190
|
if (signal?.aborted)
|
|
@@ -46054,7 +46276,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46054
46276
|
cancelled2(options.signal);
|
|
46055
46277
|
return {
|
|
46056
46278
|
entries,
|
|
46057
|
-
fingerprint: `v1:${options.kind ?? "all"}:${options.scope ?? "all"}:${
|
|
46279
|
+
fingerprint: `v1:${options.kind ?? "all"}:${options.scope ?? "all"}:${createHash17("sha256").update(JSON.stringify(entries)).digest("hex")}`,
|
|
46058
46280
|
coverage: { complete: true, maxEntries, maxReadBytes }
|
|
46059
46281
|
};
|
|
46060
46282
|
}), "catalog");
|
|
@@ -46226,7 +46448,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46226
46448
|
};
|
|
46227
46449
|
}, "vocabularyStoreOver");
|
|
46228
46450
|
|
|
46229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
46230
46452
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
46231
46453
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
46232
46454
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -46767,7 +46989,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
46767
46989
|
return key2.padEnd(3, "X");
|
|
46768
46990
|
}, "projectKey");
|
|
46769
46991
|
|
|
46770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
46771
46993
|
var DAY5 = 864e5;
|
|
46772
46994
|
var SETTING4 = "logs_pruned_at";
|
|
46773
46995
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -46794,7 +47016,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
46794
47016
|
};
|
|
46795
47017
|
}, "logPruner");
|
|
46796
47018
|
|
|
46797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
46798
47020
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
46799
47021
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
46800
47022
|
var invalid7 = /* @__PURE__ */ __name((message2) => {
|
|
@@ -46917,7 +47139,7 @@ var oneOf7 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
46917
47139
|
return value;
|
|
46918
47140
|
}, "oneOf");
|
|
46919
47141
|
var word = /* @__PURE__ */ __name((value, limit) => findingText(value, limit), "word");
|
|
46920
|
-
var optional = /* @__PURE__ */ __name((key2, value,
|
|
47142
|
+
var optional = /* @__PURE__ */ __name((key2, value, read3) => value === void 0 ? {} : { [key2]: read3(value) }, "optional");
|
|
46921
47143
|
var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
46922
47144
|
if (!raw || typeof raw !== "object")
|
|
46923
47145
|
return invalid7("a finding is an object");
|
|
@@ -47170,7 +47392,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
47170
47392
|
}, "checkMailFindings");
|
|
47171
47393
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
47172
47394
|
|
|
47173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
47174
47396
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
47175
47397
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
47176
47398
|
var WEIGHTS = {
|
|
@@ -47303,7 +47525,7 @@ var scoreGroup = /* @__PURE__ */ __name((items, context) => {
|
|
|
47303
47525
|
return { score: kept.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept };
|
|
47304
47526
|
}, "scoreGroup");
|
|
47305
47527
|
|
|
47306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47528
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
47307
47529
|
var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
|
|
47308
47530
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
47309
47531
|
const { database, now: now2 } = context;
|
|
@@ -47455,7 +47677,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47455
47677
|
};
|
|
47456
47678
|
}, "ordersStoreOver");
|
|
47457
47679
|
|
|
47458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47680
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
47459
47681
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
47460
47682
|
throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
|
|
47461
47683
|
reason: "mail-findings.stale"
|
|
@@ -47518,14 +47740,14 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47518
47740
|
};
|
|
47519
47741
|
}, "view");
|
|
47520
47742
|
const cite = /* @__PURE__ */ __name((findings, account, deciding = false) => {
|
|
47521
|
-
const
|
|
47743
|
+
const read3 = /* @__PURE__ */ new Map();
|
|
47522
47744
|
const perSender = /* @__PURE__ */ new Map();
|
|
47523
47745
|
let bytes3 = 0;
|
|
47524
47746
|
for (const finding of findings) {
|
|
47525
47747
|
const senders = /* @__PURE__ */ new Set();
|
|
47526
47748
|
let own = false;
|
|
47527
47749
|
for (const { reference: reference2, fingerprint: fingerprint2 } of finding.evidence) {
|
|
47528
|
-
let row2 =
|
|
47750
|
+
let row2 = read3.get(reference2);
|
|
47529
47751
|
if (!row2) {
|
|
47530
47752
|
const at = parseLocator(reference2);
|
|
47531
47753
|
row2 = database.prepare(EMAIL2).get(at.account, at.chat, at.message);
|
|
@@ -47547,7 +47769,7 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47547
47769
|
text: String(row2.body),
|
|
47548
47770
|
revision: null
|
|
47549
47771
|
});
|
|
47550
|
-
|
|
47772
|
+
read3.set(reference2, row2);
|
|
47551
47773
|
}
|
|
47552
47774
|
if (row2.fingerprint !== fingerprint2)
|
|
47553
47775
|
return stale2();
|
|
@@ -47565,7 +47787,7 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47565
47787
|
perSender.set(sender, count);
|
|
47566
47788
|
}
|
|
47567
47789
|
}
|
|
47568
|
-
return
|
|
47790
|
+
return read3;
|
|
47569
47791
|
}, "cite");
|
|
47570
47792
|
const organizationsOf = /* @__PURE__ */ __name((sql2, ...params) => [
|
|
47571
47793
|
...new Set(database.prepare(sql2).all(...params).map((row2) => Number(row2.id)))
|
|
@@ -47648,8 +47870,8 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47648
47870
|
}
|
|
47649
47871
|
}, "wouldWrite");
|
|
47650
47872
|
const identityOfAddress = /* @__PURE__ */ __name((address) => database.prepare("SELECT i.id, l.person_id FROM identities i LEFT JOIN identity_links l ON l.identity_id = i.id WHERE i.provider = 'email' AND lower(i.external_id) = ?").get(address.toLowerCase()), "identityOfAddress");
|
|
47651
|
-
const inCitedMail = /* @__PURE__ */ __name((address, finding,
|
|
47652
|
-
const ids = finding.evidence.map(({ reference: reference2 }) => Number(
|
|
47873
|
+
const inCitedMail = /* @__PURE__ */ __name((address, finding, read3) => {
|
|
47874
|
+
const ids = finding.evidence.map(({ reference: reference2 }) => Number(read3.get(reference2)?.id));
|
|
47653
47875
|
const marks = ids.map(() => "?").join(",");
|
|
47654
47876
|
return Boolean(database.prepare(`SELECT 1 FROM emails WHERE id IN (${marks}) AND lower(from_address) = ? UNION ALL SELECT 1 FROM email_recipients WHERE email_id IN (${marks}) AND lower(address) = ? LIMIT 1`).get(...ids, address, ...ids, address));
|
|
47655
47877
|
}, "inCitedMail");
|
|
@@ -47657,7 +47879,7 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47657
47879
|
const shop = fold(supplierName).trim();
|
|
47658
47880
|
return database.prepare("SELECT p.id, json_extract(f.value, '$.supplierName') AS shop FROM proposed_actions p, json_each(p.payload, '$.findings') f WHERE p.kind = ? AND p.status = 'proposed' AND json_extract(f.value, '$.kind') = 'order' AND trim(json_extract(f.value, '$.number')) = ?").all(MAIL_FINDINGS_KIND, number3.trim()).filter((row2) => fold(String(row2.shop)).trim() === shop).map((row2) => String(row2.id))[0];
|
|
47659
47881
|
}, "proposedOrder");
|
|
47660
|
-
const targets = /* @__PURE__ */ __name((finding,
|
|
47882
|
+
const targets = /* @__PURE__ */ __name((finding, read3) => {
|
|
47661
47883
|
const thing = /* @__PURE__ */ __name((reference2, what) => {
|
|
47662
47884
|
if (reference2 !== void 0)
|
|
47663
47885
|
requiredThing(database, reference2, what);
|
|
@@ -47689,7 +47911,7 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47689
47911
|
"payeeEmail" in finding ? finding.payeeEmail : void 0,
|
|
47690
47912
|
"customerEmail" in finding ? finding.customerEmail : void 0
|
|
47691
47913
|
])
|
|
47692
|
-
if (address !== void 0 && !inCitedMail(address, finding,
|
|
47914
|
+
if (address !== void 0 && !inCitedMail(address, finding, read3))
|
|
47693
47915
|
return invalid8(`${address} neither sent nor received the mail finding ${finding.id} cites`);
|
|
47694
47916
|
if (finding.kind === "order" && finding.number !== void 0) {
|
|
47695
47917
|
const waiting = proposedOrder(finding.supplierName, finding.number);
|
|
@@ -47702,7 +47924,7 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47702
47924
|
orderOfShop(context, finding.supplierName, finding.number);
|
|
47703
47925
|
return;
|
|
47704
47926
|
case "new_contact": {
|
|
47705
|
-
if (!inCitedMail(finding.address, finding,
|
|
47927
|
+
if (!inCitedMail(finding.address, finding, read3))
|
|
47706
47928
|
return invalid8(`${finding.address} neither sent nor received the mail finding ${finding.id} cites`);
|
|
47707
47929
|
if (!identityOfAddress(finding.address))
|
|
47708
47930
|
throw new CliError("not_found", `no stored contact ${finding.address}`);
|
|
@@ -47804,9 +48026,9 @@ ${evidence.join("\n")}`, agent);
|
|
|
47804
48026
|
const held = heldBatch(account, input, by);
|
|
47805
48027
|
if (held)
|
|
47806
48028
|
return view(held);
|
|
47807
|
-
const
|
|
48029
|
+
const read3 = cite(input.findings, account);
|
|
47808
48030
|
for (const finding of input.findings)
|
|
47809
|
-
targets(finding,
|
|
48031
|
+
targets(finding, read3);
|
|
47810
48032
|
const fingerprints = input.findings.map(mailFindingFingerprint);
|
|
47811
48033
|
if (new Set(fingerprints).size !== fingerprints.length)
|
|
47812
48034
|
return invalid8("the batch contains duplicate findings");
|
|
@@ -47912,7 +48134,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
47912
48134
|
};
|
|
47913
48135
|
}, "mailFindingsStoreOver");
|
|
47914
48136
|
|
|
47915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
47916
48138
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
47917
48139
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
47918
48140
|
reason: "meeting-findings.stale"
|
|
@@ -48080,7 +48302,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48080
48302
|
};
|
|
48081
48303
|
}, "meetingFindingsStoreOver");
|
|
48082
48304
|
|
|
48083
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48305
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
48084
48306
|
var RANK_BATCH = 512;
|
|
48085
48307
|
var LIVE3 = "FROM chunks k JOIN meeting_transcripts t ON k.chunkable_type = 'meeting_transcript' AND t.id = k.chunkable_id JOIN meetings m ON m.id = t.meeting_id WHERE m.account_id = ? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL";
|
|
48086
48308
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -48351,7 +48573,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
48351
48573
|
}
|
|
48352
48574
|
}), "meetingVectorsOver");
|
|
48353
48575
|
|
|
48354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48576
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
48355
48577
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
48356
48578
|
var TEXTS = {
|
|
48357
48579
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -48452,11 +48674,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48452
48674
|
};
|
|
48453
48675
|
}, "sourceMentionStoreOver");
|
|
48454
48676
|
|
|
48455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
48456
48678
|
import { accessSync, constants, existsSync, mkdirSync as mkdirSync2, statSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
48457
48679
|
import { dirname as dirname2 } from "node:path";
|
|
48458
48680
|
|
|
48459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48681
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
48460
48682
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
48461
48683
|
var CLIENTS_SETTING = "clients";
|
|
48462
48684
|
var coreVersion = (() => {
|
|
@@ -48514,7 +48736,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
48514
48736
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
48515
48737
|
}, "refusalAdvice");
|
|
48516
48738
|
|
|
48517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48739
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
48518
48740
|
var GENERATED = [
|
|
48519
48741
|
{
|
|
48520
48742
|
"name": "20261010184427_initial",
|
|
@@ -49578,10 +49800,22 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
49578
49800
|
"statements": [
|
|
49579
49801
|
"CREATE TABLE `crm_fields` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `kind` text NOT NULL,\n `code` text NOT NULL,\n `label` text,\n `type` text NOT NULL,\n `multiple` integer NOT NULL,\n `filterable` integer NOT NULL,\n `options` text,\n `position` integer NOT NULL,\n `created_at` integer NOT NULL,\n `updated_at` integer NOT NULL,\n `deleted_at` integer,\n CONSTRAINT `fk_crm_fields_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `crm_fields_account_id_kind_code_unique` UNIQUE(`account_id`,`kind`,`code`)\n);"
|
|
49580
49802
|
]
|
|
49803
|
+
},
|
|
49804
|
+
{
|
|
49805
|
+
"name": "20261107032742_version-55-decision-requests",
|
|
49806
|
+
"statements": [
|
|
49807
|
+
"CREATE TABLE `decision_requests` (\n `id` integer PRIMARY KEY,\n `token_digest` text NOT NULL UNIQUE,\n `proposal_id` text NOT NULL,\n `action` text NOT NULL,\n `batch_digest` text NOT NULL,\n `channel` text NOT NULL,\n `bot_profile` text NOT NULL,\n `chat_id` text NOT NULL,\n `message_id` text NOT NULL,\n `owner_user_id` text NOT NULL,\n `created_at` integer NOT NULL,\n `expires_at` integer NOT NULL,\n `used_at` integer,\n `cancelled_at` integer\n);"
|
|
49808
|
+
]
|
|
49809
|
+
},
|
|
49810
|
+
{
|
|
49811
|
+
"name": "20261107043407_version-55-decision-requests-index",
|
|
49812
|
+
"statements": [
|
|
49813
|
+
"CREATE INDEX `decision_requests_by_channel_bot_profile_chat_id_message_id` ON `decision_requests` (`channel`,`bot_profile`,`chat_id`,`message_id`);"
|
|
49814
|
+
]
|
|
49581
49815
|
}
|
|
49582
49816
|
];
|
|
49583
49817
|
|
|
49584
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
49585
49819
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
49586
49820
|
import { basename, dirname, join as join2, parse } from "node:path";
|
|
49587
49821
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -49814,7 +50048,7 @@ var rollBack = /* @__PURE__ */ __name((database, path) => {
|
|
|
49814
50048
|
return { ...result, foreignKeyViolations };
|
|
49815
50049
|
}, "rollBack");
|
|
49816
50050
|
|
|
49817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
49818
50052
|
var V31_TABLES = [
|
|
49819
50053
|
"accounts",
|
|
49820
50054
|
"account_identities",
|
|
@@ -49924,7 +50158,9 @@ var MANIFEST = [
|
|
|
49924
50158
|
{ name: "20261106010504_version-52-deals", version: 52, minCompatible: 34 },
|
|
49925
50159
|
{ name: "20261106010507_version-52-deals-rules", version: 52, minCompatible: 34 },
|
|
49926
50160
|
{ name: "20261106165009_version-53-crm-pipelines", version: 53, minCompatible: 34 },
|
|
49927
|
-
{ name: "20261106225547_version-54-crm-fields", version: 54, minCompatible: 34 }
|
|
50161
|
+
{ name: "20261106225547_version-54-crm-fields", version: 54, minCompatible: 34 },
|
|
50162
|
+
{ name: "20261107032742_version-55-decision-requests", version: 55, minCompatible: 34 },
|
|
50163
|
+
{ name: "20261107043407_version-55-decision-requests-index", version: 55, minCompatible: 34 }
|
|
49928
50164
|
];
|
|
49929
50165
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
49930
50166
|
const migrations = [];
|
|
@@ -49960,7 +50196,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
49960
50196
|
return migrations;
|
|
49961
50197
|
}, "generatedMigrations");
|
|
49962
50198
|
|
|
49963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
49964
50200
|
var MIGRATIONS = generatedMigrations();
|
|
49965
50201
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
49966
50202
|
version INTEGER PRIMARY KEY,
|
|
@@ -50039,7 +50275,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
50039
50275
|
}
|
|
50040
50276
|
}, "migrate");
|
|
50041
50277
|
|
|
50042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
50043
50279
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
50044
50280
|
const pending = database.prepare("SELECT id, join_url FROM meetings WHERE join_url IS NOT NULL AND join_key IS NULL AND id > ? ORDER BY id LIMIT ?");
|
|
50045
50281
|
if (pending.get(0, 1) === void 0)
|
|
@@ -50061,7 +50297,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
50061
50297
|
}
|
|
50062
50298
|
}, "fillJoinKeys");
|
|
50063
50299
|
|
|
50064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
50065
50301
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
50066
50302
|
refuseOwnerStoreInTests(path);
|
|
50067
50303
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -50075,8 +50311,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
50075
50311
|
}, "openSqlite");
|
|
50076
50312
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
50077
50313
|
quietSqliteWarning();
|
|
50078
|
-
const { drizzle } = await import("./node-
|
|
50079
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
50314
|
+
const { drizzle } = await import("./node-BU6NHYHF.js");
|
|
50315
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-WAF44CWS.js");
|
|
50080
50316
|
const client = await nodeClient(path, { readOnly });
|
|
50081
50317
|
try {
|
|
50082
50318
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -50086,8 +50322,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
50086
50322
|
}
|
|
50087
50323
|
}, "openUnderNode");
|
|
50088
50324
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
50089
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
50090
|
-
const { drizzle } = await import("./bun-
|
|
50325
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-YLBILWBE.js");
|
|
50326
|
+
const { drizzle } = await import("./bun-ZBM364I6.js");
|
|
50091
50327
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
50092
50328
|
try {
|
|
50093
50329
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -50097,7 +50333,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
50097
50333
|
}
|
|
50098
50334
|
}, "openUnderBun");
|
|
50099
50335
|
|
|
50100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50336
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
50101
50337
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
50102
50338
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
50103
50339
|
try {
|
|
@@ -50165,7 +50401,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
50165
50401
|
});
|
|
50166
50402
|
}, "movePaymentFacts");
|
|
50167
50403
|
|
|
50168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50404
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
50169
50405
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
50170
50406
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
50171
50407
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -50183,7 +50419,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
50183
50419
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
50184
50420
|
}, "assertReadCompatible");
|
|
50185
50421
|
|
|
50186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
50187
50423
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
50188
50424
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
50189
50425
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -50229,7 +50465,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
50229
50465
|
});
|
|
50230
50466
|
}, "moveSuggestedLinks");
|
|
50231
50467
|
|
|
50232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
50233
50469
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
50234
50470
|
var TEST_PROVIDER = "chat";
|
|
50235
50471
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -50250,7 +50486,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
50250
50486
|
}
|
|
50251
50487
|
}, "purgeTestAccounts");
|
|
50252
50488
|
|
|
50253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50489
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
50254
50490
|
var BACKFILL_ON_OPEN = 5e3;
|
|
50255
50491
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
50256
50492
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -50346,10 +50582,10 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
50346
50582
|
}
|
|
50347
50583
|
}, "openStoreContext");
|
|
50348
50584
|
|
|
50349
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50350
|
-
import { createHash as
|
|
50585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
50586
|
+
import { createHash as createHash18 } from "node:crypto";
|
|
50351
50587
|
|
|
50352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50588
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
50353
50589
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
50354
50590
|
var ref = text4(2048);
|
|
50355
50591
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -50415,7 +50651,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
50415
50651
|
}))
|
|
50416
50652
|
});
|
|
50417
50653
|
|
|
50418
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50654
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
50419
50655
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
50420
50656
|
var invalid10 = /* @__PURE__ */ __name((field4) => {
|
|
50421
50657
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -50519,7 +50755,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
50519
50755
|
invalid10("external.unused");
|
|
50520
50756
|
}, "validateProjectAnnotationsGraph");
|
|
50521
50757
|
|
|
50522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
50523
50759
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
50524
50760
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
50525
50761
|
var targetSchema = strictObject({
|
|
@@ -50607,7 +50843,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
50607
50843
|
}
|
|
50608
50844
|
if (target.annotation_count > 0)
|
|
50609
50845
|
conflicts.push({ reference: target.project, reason: "populated" });
|
|
50610
|
-
const fingerprint2 =
|
|
50846
|
+
const fingerprint2 = createHash18("sha256").update(JSON.stringify({
|
|
50611
50847
|
manifest_fingerprint,
|
|
50612
50848
|
target: {
|
|
50613
50849
|
...checked.output,
|
|
@@ -50625,8 +50861,8 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
50625
50861
|
};
|
|
50626
50862
|
}, "planBoundProjectAnnotations");
|
|
50627
50863
|
|
|
50628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50629
|
-
import { createHash as
|
|
50864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
50865
|
+
import { createHash as createHash19 } from "node:crypto";
|
|
50630
50866
|
var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
50631
50867
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
50632
50868
|
var projectAnnotationSnapshotSchema = strictObject({
|
|
@@ -50710,7 +50946,7 @@ var decodeProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3) => {
|
|
|
50710
50946
|
var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
50711
50947
|
const snapshot2 = decodeProjectAnnotationSnapshot(json3);
|
|
50712
50948
|
const order = /* @__PURE__ */ __name((a, b) => a.ref < b.ref ? -1 : a.ref > b.ref ? 1 : 0, "order");
|
|
50713
|
-
return
|
|
50949
|
+
return createHash19("sha256").update(JSON.stringify({
|
|
50714
50950
|
...snapshot2,
|
|
50715
50951
|
aliases: snapshot2.aliases.toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0),
|
|
50716
50952
|
facts: snapshot2.facts.toSorted(order),
|
|
@@ -50719,7 +50955,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
50719
50955
|
})).digest("hex");
|
|
50720
50956
|
}, "projectAnnotationSnapshotFingerprint");
|
|
50721
50957
|
|
|
50722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
50723
50959
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
50724
50960
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
50725
50961
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -50736,7 +50972,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
50736
50972
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
50737
50973
|
}, "projectAnnotationRequest");
|
|
50738
50974
|
|
|
50739
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
50740
50976
|
var SnapshotBudget = class {
|
|
50741
50977
|
static {
|
|
50742
50978
|
__name(this, "SnapshotBudget");
|
|
@@ -50762,14 +50998,14 @@ var SnapshotBudget = class {
|
|
|
50762
50998
|
}
|
|
50763
50999
|
};
|
|
50764
51000
|
|
|
50765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50766
|
-
import { createHash as
|
|
51001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
51002
|
+
import { createHash as createHash21 } from "node:crypto";
|
|
50767
51003
|
|
|
50768
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
50769
51005
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
50770
51006
|
|
|
50771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50772
|
-
import { createHash as
|
|
51007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
51008
|
+
import { createHash as createHash20 } from "node:crypto";
|
|
50773
51009
|
var invalid12 = /* @__PURE__ */ __name(() => {
|
|
50774
51010
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
50775
51011
|
}, "invalid");
|
|
@@ -50907,11 +51143,11 @@ var ProjectSnapshotSources = class {
|
|
|
50907
51143
|
return this.digest("meeting_transcript", [header, cues]);
|
|
50908
51144
|
}
|
|
50909
51145
|
digest(kind4, content) {
|
|
50910
|
-
return
|
|
51146
|
+
return createHash20("sha256").update(JSON.stringify(["wirecat.project-source", 1, kind4, content])).digest("hex");
|
|
50911
51147
|
}
|
|
50912
51148
|
};
|
|
50913
51149
|
|
|
50914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
50915
51151
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
50916
51152
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
50917
51153
|
}, "unsupported");
|
|
@@ -51082,7 +51318,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
51082
51318
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
51083
51319
|
}), "projectAnnotationSnapshot");
|
|
51084
51320
|
|
|
51085
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51321
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
51086
51322
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
51087
51323
|
const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
51088
51324
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -51123,7 +51359,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
51123
51359
|
const target = {
|
|
51124
51360
|
project: current.project.ref,
|
|
51125
51361
|
annotation_count: current.aliases.length + current.facts.length + current.links.length,
|
|
51126
|
-
revision_sha256:
|
|
51362
|
+
revision_sha256: createHash21("sha256").update(JSON.stringify({
|
|
51127
51363
|
snapshot: projectAnnotationSnapshotFingerprint(JSON.stringify(current)),
|
|
51128
51364
|
projects: projects2,
|
|
51129
51365
|
aliases: aliases2,
|
|
@@ -51138,13 +51374,13 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
51138
51374
|
descriptor_conflicts,
|
|
51139
51375
|
namespace_conflicts,
|
|
51140
51376
|
ready: plan.ready && descriptor_conflicts.length === 0 && namespace_conflicts.length === 0,
|
|
51141
|
-
fingerprint:
|
|
51377
|
+
fingerprint: createHash21("sha256").update(JSON.stringify({ plan: plan.fingerprint, descriptor_conflicts, namespace_conflicts })).digest("hex"),
|
|
51142
51378
|
read_bytes: budget.bytes,
|
|
51143
51379
|
records: budget.records
|
|
51144
51380
|
};
|
|
51145
51381
|
}), "previewAnnotationSnapshot");
|
|
51146
51382
|
|
|
51147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51383
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
51148
51384
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
|
|
51149
51385
|
const mappings = { ...bindings };
|
|
51150
51386
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -51186,7 +51422,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
51186
51422
|
return mappings;
|
|
51187
51423
|
}, "restoreAnnotationRecords");
|
|
51188
51424
|
|
|
51189
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51425
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
51190
51426
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
51191
51427
|
async preview(request) {
|
|
51192
51428
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -51216,7 +51452,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
51216
51452
|
}
|
|
51217
51453
|
}), "projectAnnotationStoreOver");
|
|
51218
51454
|
|
|
51219
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
51220
51456
|
var PROJECTED = {
|
|
51221
51457
|
invoice: { roles: ["issuer", "counterparty", "project"], many: [] },
|
|
51222
51458
|
payment: { roles: ["payer", "payee", "project", "settles"], many: ["settles"] }
|
|
@@ -51629,7 +51865,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51629
51865
|
};
|
|
51630
51866
|
}, "recordStoreOver");
|
|
51631
51867
|
|
|
51632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
51633
51869
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
51634
51870
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
51635
51871
|
let merged = { from: from2, to };
|
|
@@ -51642,7 +51878,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
51642
51878
|
}, "markRange");
|
|
51643
51879
|
var ranges = /* @__PURE__ */ __name(({ orm }, chatKey) => orm.select({ from: syncRanges.fromKey, to: syncRanges.toKey }).from(syncRanges).where(eq(syncRanges.chatId, chatKey)).orderBy(syncRanges.fromKey).all(), "ranges");
|
|
51644
51880
|
|
|
51645
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51881
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
51646
51882
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
51647
51883
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
51648
51884
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -51663,7 +51899,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
51663
51899
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(prefixOf2(account) + chatId, JSON.stringify({ ...saved, checkedAt: checkedAt ?? new Date(now2).toISOString() }), now2);
|
|
51664
51900
|
}, "setTaskAnalysisMark");
|
|
51665
51901
|
|
|
51666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
51667
51903
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
51668
51904
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
51669
51905
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -51673,7 +51909,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
51673
51909
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf4(account), JSON.stringify(until), now2);
|
|
51674
51910
|
}, "setTaskRulesStop");
|
|
51675
51911
|
|
|
51676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51912
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
51677
51913
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
51678
51914
|
const { database } = context;
|
|
51679
51915
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -51732,7 +51968,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51732
51968
|
};
|
|
51733
51969
|
}, "syncStoreOver");
|
|
51734
51970
|
|
|
51735
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51971
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
51736
51972
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
51737
51973
|
const { database } = context;
|
|
51738
51974
|
return {
|
|
@@ -51754,7 +51990,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51754
51990
|
};
|
|
51755
51991
|
}, "tagsStoreOver");
|
|
51756
51992
|
|
|
51757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51993
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
51758
51994
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
51759
51995
|
var neighbours = /* @__PURE__ */ __name(({ orm }, chatKey, messagePk, sentAt, { messages: messages2, withinMs }, side) => orm.all(sql`SELECT sender_name AS sender, text, sent_at AS sentAt FROM messages
|
|
51760
51996
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -51881,7 +52117,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
51881
52117
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
51882
52118
|
}, "savePictureChunks");
|
|
51883
52119
|
|
|
51884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52120
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
51885
52121
|
var messagesToEmbed = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, after: after2, limit }) => orm.all(sql`SELECT m.id AS messagePk, m.text, m.sent_at AS sentAt, k.content_hash AS hash,
|
|
51886
52122
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
51887
52123
|
FROM messages m
|
|
@@ -51970,7 +52206,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
51970
52206
|
return plain2(best(found2));
|
|
51971
52207
|
}, "nearestMessages");
|
|
51972
52208
|
|
|
51973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
51974
52210
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
51975
52211
|
const { database } = context;
|
|
51976
52212
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -52228,7 +52464,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
52228
52464
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
52229
52465
|
}), "vectorsStoreOver");
|
|
52230
52466
|
|
|
52231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52467
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
52232
52468
|
import { existsSync as existsSync2, readFileSync as readFileSync4 } from "node:fs";
|
|
52233
52469
|
import { dirname as dirname3, join as join3 } from "node:path";
|
|
52234
52470
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -52316,10 +52552,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
52316
52552
|
}
|
|
52317
52553
|
}, "lastBackup");
|
|
52318
52554
|
|
|
52319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
52320
52556
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
52321
52557
|
|
|
52322
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52558
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
52323
52559
|
var COUNTED_TABLES = [
|
|
52324
52560
|
"accounts",
|
|
52325
52561
|
"chats",
|
|
@@ -52404,7 +52640,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
52404
52640
|
};
|
|
52405
52641
|
}, "storeContents");
|
|
52406
52642
|
|
|
52407
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.602.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_87bcf484fc0706f541e30693101b5a29/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
52408
52644
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
52409
52645
|
const context = await openStoreContext(options);
|
|
52410
52646
|
try {
|
|
@@ -52472,6 +52708,7 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
52472
52708
|
const orders2 = once3(() => ordersStoreOver(context));
|
|
52473
52709
|
const deals2 = once3(() => dealsStoreOver(context));
|
|
52474
52710
|
const crm = once3(() => crmCopiesOver(context, accountPeopleOver(context)));
|
|
52711
|
+
const decisionRequests2 = once3(() => decisionRequestStoreOver(context));
|
|
52475
52712
|
const records2 = once3(() => recordStoreOver(context));
|
|
52476
52713
|
const memories2 = once3(() => memoriesStoreOver(context));
|
|
52477
52714
|
const proposedActions2 = once3(() => proposedActionsStoreOver(context));
|
|
@@ -52588,6 +52825,9 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
52588
52825
|
get crm() {
|
|
52589
52826
|
return crm();
|
|
52590
52827
|
},
|
|
52828
|
+
get decisionRequests() {
|
|
52829
|
+
return decisionRequests2();
|
|
52830
|
+
},
|
|
52591
52831
|
get records() {
|
|
52592
52832
|
return records2();
|
|
52593
52833
|
},
|
|
@@ -52702,6 +52942,7 @@ export {
|
|
|
52702
52942
|
MAIL_AGENDA_COLUMNS,
|
|
52703
52943
|
mailOwnText,
|
|
52704
52944
|
AGENDA_COLUMNS,
|
|
52945
|
+
plainQuery,
|
|
52705
52946
|
correctWords,
|
|
52706
52947
|
drainMeetingIndex,
|
|
52707
52948
|
THREAD_COLUMNS,
|