@wirecat/cli-memo 0.131.38 → 0.131.40
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-W26PFZ2J.js → all-profiles-QFW2NKJY.js} +5 -5
- package/dist/bundle/{anthropic-SY6QPTQW.js → anthropic-IARLHPYJ.js} +3 -3
- package/dist/bundle/{app-server-WUXDTYU4.js → app-server-L4N5IWJF.js} +35 -35
- package/dist/bundle/auto-24I3FBUW.js +86 -0
- package/dist/bundle/{bun-O3KE32D7.js → bun-NWKIEX53.js} +2 -2
- package/dist/bundle/{bun-sqlite-5X2NBSLA.js → bun-sqlite-HORFVNNY.js} +2 -2
- package/dist/bundle/{chunk-5EBYGKZB.js → chunk-2SZEKYBN.js} +1 -1
- package/dist/bundle/{chunk-5J5RTJUJ.js → chunk-2YJBI3NK.js} +1 -1
- package/dist/bundle/{chunk-32WLB6I3.js → chunk-4EZK5PGX.js} +1 -1
- package/dist/bundle/{chunk-SDIKN2OR.js → chunk-5G3NNIJQ.js} +10 -10
- package/dist/bundle/{chunk-ZP7F76D3.js → chunk-5HSR6U4Z.js} +1 -1
- package/dist/bundle/{chunk-TJNW4L7P.js → chunk-5HXLRQ4Q.js} +43 -43
- package/dist/bundle/{chunk-UUD4QHAN.js → chunk-6E4DCMJ5.js} +4 -4
- package/dist/bundle/{chunk-LV6FBPUQ.js → chunk-6RAU7FD2.js} +11 -11
- package/dist/bundle/{chunk-2Q4DYGNU.js → chunk-756VKGKO.js} +2 -2
- package/dist/bundle/{chunk-XCAGVFRC.js → chunk-A7M74RZH.js} +560 -500
- package/dist/bundle/{chunk-UWJ3RJF4.js → chunk-A7MXWBIX.js} +2 -2
- package/dist/bundle/{chunk-GSVNF5TX.js → chunk-ADMB7OK5.js} +4 -4
- package/dist/bundle/{chunk-2EDP7PDR.js → chunk-AKSNCK5L.js} +279 -303
- package/dist/bundle/{chunk-QTLYWZXB.js → chunk-ASVVDNAS.js} +3 -3
- package/dist/bundle/{chunk-75QQ7MLH.js → chunk-ATR65D7K.js} +8 -8
- package/dist/bundle/{chunk-3G63U4VK.js → chunk-B4XRE67Q.js} +10 -9
- package/dist/bundle/{chunk-L2M3LTQQ.js → chunk-BWNNUEHG.js} +1 -1
- package/dist/bundle/{chunk-WRZP6DJT.js → chunk-CB34NXQP.js} +309 -225
- package/dist/bundle/{chunk-RS5WAI7D.js → chunk-DNZH53VQ.js} +3 -3
- package/dist/bundle/{chunk-K3GMQLFM.js → chunk-EGQCBZVM.js} +2 -2
- package/dist/bundle/{chunk-DVHDIQBI.js → chunk-EGRI2NUT.js} +4 -4
- package/dist/bundle/{chunk-4AXSD77N.js → chunk-EIFPQD57.js} +1 -1
- package/dist/bundle/{chunk-374FSLTB.js → chunk-EQQWJM6B.js} +5 -5
- package/dist/bundle/{chunk-O762IE2F.js → chunk-FBREYLY5.js} +1 -1
- package/dist/bundle/{chunk-S5KSC4B3.js → chunk-FTX3OPWV.js} +27 -27
- package/dist/bundle/{chunk-M3TUIVRK.js → chunk-G3IO2TLK.js} +5 -5
- package/dist/bundle/{chunk-CXWKBOKQ.js → chunk-JGDZ3G4P.js} +3 -3
- package/dist/bundle/{chunk-J7FP7PRV.js → chunk-KAU67PDK.js} +580 -599
- package/dist/bundle/{chunk-4CD37FZU.js → chunk-KGXVJO2V.js} +5 -5
- package/dist/bundle/{chunk-7P3PM3OL.js → chunk-KWGNPUIV.js} +7 -7
- package/dist/bundle/{chunk-JT36R23P.js → chunk-LL5HPYW5.js} +7 -7
- package/dist/bundle/{chunk-2IST54UV.js → chunk-LXQQ7Q34.js} +9 -9
- package/dist/bundle/{chunk-43CMY3YD.js → chunk-M7UHHXSH.js} +1 -1
- package/dist/bundle/{chunk-ZMZVRVCK.js → chunk-MLHRER2H.js} +2 -2
- package/dist/bundle/{chunk-XLUOKHFN.js → chunk-NCC3RXUX.js} +3 -3
- package/dist/bundle/{chunk-TXJYVD5U.js → chunk-OGHWLR5E.js} +1 -1
- package/dist/bundle/{chunk-AJ4SVCBD.js → chunk-OSDA5EZW.js} +286 -274
- package/dist/bundle/{chunk-AOFYLQK2.js → chunk-OZF7QBTS.js} +2 -2
- package/dist/bundle/{chunk-QM5CNTGT.js → chunk-PAE2NZ7S.js} +20 -20
- package/dist/bundle/{chunk-SSQDA7X6.js → chunk-QR5KWOZ2.js} +4 -4
- package/dist/bundle/{chunk-L2CXODLV.js → chunk-RZ3UQFLE.js} +1 -1
- package/dist/bundle/{chunk-FOQBIEL5.js → chunk-SRYOICSG.js} +1 -1
- package/dist/bundle/{chunk-QP7BTVMT.js → chunk-THIXDXP3.js} +2 -2
- package/dist/bundle/{chunk-S2K3FWLA.js → chunk-TWC6UJD2.js} +12 -12
- package/dist/bundle/{chunk-CEENCS5P.js → chunk-U5WIWLWM.js} +6 -6
- package/dist/bundle/{chunk-B4LT2DHH.js → chunk-UEG3BDCX.js} +4 -4
- package/dist/bundle/{chunk-4NJQJZRO.js → chunk-UGHYNVWQ.js} +1 -1
- package/dist/bundle/{chunk-4OF64T67.js → chunk-W3SMUCMB.js} +1 -1
- package/dist/bundle/{chunk-GXCXOITM.js → chunk-WAZWM4KZ.js} +20 -20
- package/dist/bundle/{chunk-F4BXYTIW.js → chunk-WHWACGZX.js} +7 -7
- package/dist/bundle/{chunk-HJTDA7AE.js → chunk-WU6PDHXY.js} +5 -5
- package/dist/bundle/{chunk-4CADISNA.js → chunk-XAWB4WEC.js} +1 -1
- package/dist/bundle/{chunk-5ZKNRR6O.js → chunk-XF7TG5VK.js} +43 -40
- package/dist/bundle/{chunk-CVCL77DZ.js → chunk-XV7M6VWX.js} +4 -4
- package/dist/bundle/{chunk-TJXVMLK4.js → chunk-YWWTEWX3.js} +1 -1
- package/dist/bundle/{chunk-WVXTZWH3.js → chunk-Z6OKSDP3.js} +1 -1
- package/dist/bundle/{chunk-CEOXSWU3.js → chunk-ZH43Q2JO.js} +2 -2
- package/dist/bundle/{command-contract-FRRW2Z4S.js → command-contract-ZRJPMWWI.js} +11 -11
- package/dist/bundle/{decode-RVPTVZ3W.js → decode-MDCEP64X.js} +2 -2
- package/dist/bundle/{echarts-CW6DTALT.js → echarts-RFIQAWMT.js} +2 -2
- package/dist/bundle/{embed-VXWYSZ7X.js → embed-443F7XR4.js} +3 -3
- package/dist/bundle/{embedder-QX3GSPBN.js → embedder-VRDPZFWC.js} +6 -6
- package/dist/bundle/{entry-LBDVYMDG.js → entry-36KBOBA4.js} +4 -4
- package/dist/bundle/failure-QKFNHYKC.js +66 -0
- package/dist/bundle/{first-run-VPR5YFMD.js → first-run-CYZSGJTG.js} +5 -5
- package/dist/bundle/{first-screen-WRKQ4GAM.js → first-screen-UY54KNVU.js} +12 -12
- package/dist/bundle/{instructions-2XLUHPQH.js → instructions-RI2WFMBA.js} +1 -1
- package/dist/bundle/{mcp-RD54TNKO.js → mcp-DHX4GF3A.js} +35 -35
- package/dist/bundle/memo.js +6 -6
- package/dist/bundle/{node-AQ7O3PGH.js → node-H7LWGE5H.js} +2 -2
- package/dist/bundle/{node-sqlite-RKDBK624.js → node-sqlite-N4POELFM.js} +3 -3
- package/dist/bundle/{oauth-ZQCL2HPA.js → oauth-OOUASPSL.js} +4 -4
- package/dist/bundle/{open-ME6M3BWL.js → open-2T52CQDG.js} +2 -2
- package/dist/bundle/{openai-PHW5QKNC.js → openai-76CJYDRJ.js} +7 -7
- package/dist/bundle/{process-4HJLMEHS.js → process-7YATIAKW.js} +1 -1
- package/dist/bundle/{program-EVPU3PMC.js → program-O4I2BGM2.js} +81 -60
- package/dist/bundle/{prompt-U5JMQJPC.js → prompt-MHD5EI75.js} +2 -2
- package/dist/bundle/{recognize-OYKFXOLL.js → recognize-ARCD7XPJ.js} +1 -1
- package/dist/bundle/{remote-IXABNXVH.js → remote-OQ7TUXN3.js} +4 -4
- package/dist/bundle/{rerank-6ASLHI5I.js → rerank-422D4DZR.js} +4 -4
- package/dist/bundle/{serve-ZYQO2Z23.js → serve-ZOT62JRM.js} +6 -6
- package/dist/bundle/server-EISBI6O6.js +61 -0
- package/dist/bundle/{server-5XHYKDVY.js → server-HAZC3T7X.js} +50 -50
- package/dist/bundle/server-NNQ3YRBV.js +48 -0
- package/dist/bundle/{state-5W7BQVQO.js → state-KBW7BI2G.js} +3 -3
- package/dist/bundle/{store-6WW7XV2O.js → store-KZY5FZPD.js} +9 -9
- package/dist/bundle/store-maintenance-command-ZFQOMCLZ.js +48 -0
- package/dist/bundle/update-SAX5XN2C.js +69 -0
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +5 -1
- package/dist/examples.js.map +1 -1
- package/dist/knowledge/command.d.ts.map +1 -1
- package/dist/knowledge/command.js +23 -1
- package/dist/knowledge/command.js.map +1 -1
- package/dist/knowledge/project-status-command.js +1 -1
- package/dist/knowledge/project-status-command.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/skills/mail-triage/SKILL.md +2 -2
- package/dist/bundle/auto-2TNLCAEM.js +0 -86
- package/dist/bundle/failure-NBJBRA6G.js +0 -66
- package/dist/bundle/server-BMXFJO2T.js +0 -61
- package/dist/bundle/server-V7JU6YLA.js +0 -48
- package/dist/bundle/store-maintenance-command-YPNP663U.js +0 -48
- package/dist/bundle/update-CVHXLX72.js +0 -69
- /package/dist/bundle/{chunk-FEJOKQPV.js → chunk-5VKETWNU.js} +0 -0
|
@@ -38,10 +38,12 @@ import {
|
|
|
38
38
|
defineQuery,
|
|
39
39
|
entryInWindow,
|
|
40
40
|
entryMetadata,
|
|
41
|
+
evaluate,
|
|
41
42
|
findingFields,
|
|
42
43
|
findingFingerprint,
|
|
43
44
|
findingHash,
|
|
44
45
|
findingId,
|
|
46
|
+
findingNeeds,
|
|
45
47
|
findingText,
|
|
46
48
|
formatDecimal,
|
|
47
49
|
formatMeetingReference,
|
|
@@ -64,6 +66,7 @@ import {
|
|
|
64
66
|
normalizeTag,
|
|
65
67
|
orderLine,
|
|
66
68
|
orderTitle,
|
|
69
|
+
organization,
|
|
67
70
|
parseDecimal,
|
|
68
71
|
parseMeetingQuery,
|
|
69
72
|
parseMeetingReference,
|
|
@@ -72,9 +75,12 @@ import {
|
|
|
72
75
|
paymentTitle,
|
|
73
76
|
priorityBand,
|
|
74
77
|
priorityLabel,
|
|
78
|
+
project,
|
|
75
79
|
quantityOf,
|
|
76
80
|
queryAstSchema,
|
|
77
81
|
queryError,
|
|
82
|
+
queryFieldsOf,
|
|
83
|
+
reminder,
|
|
78
84
|
scaleOf,
|
|
79
85
|
settledStatus,
|
|
80
86
|
tagOf,
|
|
@@ -93,11 +99,11 @@ import {
|
|
|
93
99
|
validateQuery,
|
|
94
100
|
walkQuery,
|
|
95
101
|
zonedMoment
|
|
96
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-CB34NXQP.js";
|
|
97
103
|
import {
|
|
98
104
|
holdsCredential,
|
|
99
105
|
secretNamed
|
|
100
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-4EZK5PGX.js";
|
|
101
107
|
import {
|
|
102
108
|
DEFAULT_STEMMERS,
|
|
103
109
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -110,26 +116,26 @@ import {
|
|
|
110
116
|
fold,
|
|
111
117
|
normalize,
|
|
112
118
|
parseStemmers
|
|
113
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-KWGNPUIV.js";
|
|
114
120
|
import {
|
|
115
121
|
DEFAULT_TASK_CATEGORIES,
|
|
116
122
|
sharedConfigPath,
|
|
117
123
|
storedTaskCategories,
|
|
118
124
|
taskCategoriesReader
|
|
119
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-UEG3BDCX.js";
|
|
120
126
|
import {
|
|
121
127
|
refuseOwnerStoreInTests,
|
|
122
128
|
storePath
|
|
123
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-XAWB4WEC.js";
|
|
124
130
|
import {
|
|
125
131
|
quietSqliteWarning,
|
|
126
132
|
storeCapable
|
|
127
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-EQQWJM6B.js";
|
|
128
134
|
import {
|
|
129
135
|
PRAGMAS,
|
|
130
136
|
TIME_LIMIT_FUNCTION,
|
|
131
137
|
TimeLimitReached
|
|
132
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-BWNNUEHG.js";
|
|
133
139
|
import {
|
|
134
140
|
array,
|
|
135
141
|
boolean,
|
|
@@ -179,7 +185,7 @@ import {
|
|
|
179
185
|
sql,
|
|
180
186
|
sqliteTable,
|
|
181
187
|
text
|
|
182
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-EIFPQD57.js";
|
|
183
189
|
import {
|
|
184
190
|
__commonJS,
|
|
185
191
|
__name,
|
|
@@ -9923,7 +9929,7 @@ var require_cjs = __commonJS({
|
|
|
9923
9929
|
}
|
|
9924
9930
|
});
|
|
9925
9931
|
|
|
9926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
9932
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
9927
9933
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
9928
9934
|
const methods = whole;
|
|
9929
9935
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10051,7 +10057,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10051
10057
|
};
|
|
10052
10058
|
}, "bindAccount");
|
|
10053
10059
|
|
|
10054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10060
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
10055
10061
|
var SCHEME = "msg:";
|
|
10056
10062
|
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
|
|
10057
10063
|
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
@@ -10065,7 +10071,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
|
10065
10071
|
return { provider, account, chat: chat2, message: message2 };
|
|
10066
10072
|
}, "parseLocator");
|
|
10067
10073
|
|
|
10068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
10069
10075
|
var SIMPLE_REFERENCES = [
|
|
10070
10076
|
"note",
|
|
10071
10077
|
"document",
|
|
@@ -10213,7 +10219,7 @@ var looksLikeReference = /* @__PURE__ */ __name((text6) => {
|
|
|
10213
10219
|
return match !== null && byPrefix.has(match[1]);
|
|
10214
10220
|
}, "looksLikeReference");
|
|
10215
10221
|
|
|
10216
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10222
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
10217
10223
|
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
10218
10224
|
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
10219
10225
|
var PROVIDERS = [
|
|
@@ -10329,7 +10335,7 @@ var providerNamed = /* @__PURE__ */ __name((word2) => {
|
|
|
10329
10335
|
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
10330
10336
|
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
10331
10337
|
|
|
10332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
10333
10339
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
10334
10340
|
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");
|
|
10335
10341
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -10352,7 +10358,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
10352
10358
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
10353
10359
|
}, "sourceOf");
|
|
10354
10360
|
|
|
10355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
10356
10362
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
10357
10363
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
10358
10364
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -10539,7 +10545,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf2 = (kind4)
|
|
|
10539
10545
|
return { accounts: [...chosen.values()], skipped };
|
|
10540
10546
|
}, "fitting");
|
|
10541
10547
|
|
|
10542
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10543
10549
|
var IndexBuilderOn = class {
|
|
10544
10550
|
static {
|
|
10545
10551
|
__name(this, "IndexBuilderOn");
|
|
@@ -10734,7 +10740,7 @@ function alias(table, alias2) {
|
|
|
10734
10740
|
}
|
|
10735
10741
|
__name(alias, "alias");
|
|
10736
10742
|
|
|
10737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10738
10744
|
var ENTITY_TABLES = {
|
|
10739
10745
|
account: "accounts",
|
|
10740
10746
|
attachment: "attachments",
|
|
@@ -10777,7 +10783,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10777
10783
|
return { table, pointer, type, count, known: known2 };
|
|
10778
10784
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
10779
10785
|
|
|
10780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
10781
10787
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
10782
10788
|
id: integer("id").primaryKey(),
|
|
10783
10789
|
name: text("name").notNull().unique(),
|
|
@@ -10786,7 +10792,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
10786
10792
|
updatedAt: integer("updated_at").notNull()
|
|
10787
10793
|
});
|
|
10788
10794
|
|
|
10789
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
10790
10796
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
10791
10797
|
sourceKey: text("source_key").notNull(),
|
|
10792
10798
|
collection: text("collection").notNull(),
|
|
@@ -10796,13 +10802,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
10796
10802
|
createdAt: integer("created_at").notNull()
|
|
10797
10803
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
10798
10804
|
|
|
10799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10805
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
10800
10806
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
10801
10807
|
id: integer("id").notNull(),
|
|
10802
10808
|
indexableType: text("indexable_type").notNull()
|
|
10803
10809
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
10804
10810
|
|
|
10805
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
10806
10812
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
10807
10813
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
10808
10814
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -10828,7 +10834,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
10828
10834
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
10829
10835
|
]);
|
|
10830
10836
|
|
|
10831
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
10832
10838
|
var accounts = sqliteTable("accounts", {
|
|
10833
10839
|
id: integer("id").primaryKey(),
|
|
10834
10840
|
provider: text("provider").notNull(),
|
|
@@ -12495,7 +12501,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
12495
12501
|
at: integer("at").notNull()
|
|
12496
12502
|
});
|
|
12497
12503
|
|
|
12498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12504
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
12499
12505
|
var ARMS = [
|
|
12500
12506
|
[
|
|
12501
12507
|
"message",
|
|
@@ -12622,7 +12628,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
12622
12628
|
return recomputed;
|
|
12623
12629
|
}, "drainInvolvementQueue");
|
|
12624
12630
|
|
|
12625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
12626
12632
|
import { domainToUnicode } from "node:url";
|
|
12627
12633
|
|
|
12628
12634
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -22644,7 +22650,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
22644
22650
|
}, "oa");
|
|
22645
22651
|
var na = { parse: O, get: aa, isValid: oa };
|
|
22646
22652
|
|
|
22647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
22648
22654
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
22649
22655
|
var ID = /^[\w-]{10,}$/;
|
|
22650
22656
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -22685,7 +22691,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text6) => [...text6.matchAll(L
|
|
|
22685
22691
|
return { url, documentId: googleDocumentId(url) };
|
|
22686
22692
|
}), "googleDocumentLinks");
|
|
22687
22693
|
|
|
22688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
22689
22695
|
var PHONE_PLANS = [
|
|
22690
22696
|
{
|
|
22691
22697
|
country: "us",
|
|
@@ -23065,7 +23071,7 @@ var PHONE_PLANS = [
|
|
|
23065
23071
|
}
|
|
23066
23072
|
];
|
|
23067
23073
|
|
|
23068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
23069
23075
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
23070
23076
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
23071
23077
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -23106,7 +23112,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
23106
23112
|
return void 0;
|
|
23107
23113
|
}, "nationalPhone");
|
|
23108
23114
|
|
|
23109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
23110
23116
|
var BEFORE = [
|
|
23111
23117
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
23112
23118
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -23366,7 +23372,7 @@ var findPlaces = /* @__PURE__ */ __name((text6) => {
|
|
|
23366
23372
|
return found2.sort((a, b) => a.start - b.start);
|
|
23367
23373
|
}, "findPlaces");
|
|
23368
23374
|
|
|
23369
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
23370
23376
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
23371
23377
|
var MENTION_VERSIONS = {
|
|
23372
23378
|
phone: 1,
|
|
@@ -23556,7 +23562,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
23556
23562
|
};
|
|
23557
23563
|
}, "typedPhone");
|
|
23558
23564
|
|
|
23559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
23560
23566
|
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";
|
|
23561
23567
|
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";
|
|
23562
23568
|
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";
|
|
@@ -23564,7 +23570,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
23564
23570
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
23565
23571
|
var NAME_WORDS = WORDS.split(" ");
|
|
23566
23572
|
|
|
23567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
23568
23574
|
var LATIN_TO_CYRILLIC = {
|
|
23569
23575
|
shch: "\u0449",
|
|
23570
23576
|
sch: "\u0449",
|
|
@@ -23772,7 +23778,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text6, stem, taken) => {
|
|
|
23772
23778
|
return found2;
|
|
23773
23779
|
}, "findUnknownNames");
|
|
23774
23780
|
|
|
23775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
23776
23782
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
23777
23783
|
"webpage",
|
|
23778
23784
|
"share",
|
|
@@ -23812,7 +23818,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
23812
23818
|
});
|
|
23813
23819
|
}, "matchDownloads");
|
|
23814
23820
|
|
|
23815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23821
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
23816
23822
|
var QUERY_VERSION = 1;
|
|
23817
23823
|
var QUERY_LIMITS2 = {
|
|
23818
23824
|
...QUERY_LIMITS,
|
|
@@ -23848,7 +23854,7 @@ function exhausted(budget) {
|
|
|
23848
23854
|
}
|
|
23849
23855
|
__name(exhausted, "exhausted");
|
|
23850
23856
|
|
|
23851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
23852
23858
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
23853
23859
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
23854
23860
|
kind: "char",
|
|
@@ -24248,7 +24254,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
24248
24254
|
return out;
|
|
24249
24255
|
}, "foldRegex");
|
|
24250
24256
|
|
|
24251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
24252
24258
|
var PRESET_VERSION = 1;
|
|
24253
24259
|
var PRESETS = {
|
|
24254
24260
|
password: {
|
|
@@ -24302,7 +24308,7 @@ var PRESETS = {
|
|
|
24302
24308
|
}
|
|
24303
24309
|
};
|
|
24304
24310
|
|
|
24305
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24311
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
24306
24312
|
var FIELD_VERSION = 2;
|
|
24307
24313
|
var UNITS = {
|
|
24308
24314
|
"": 1,
|
|
@@ -24763,12 +24769,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
24763
24769
|
return validateFields(parsed3.output);
|
|
24764
24770
|
}, "validateAst");
|
|
24765
24771
|
|
|
24766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
24767
24773
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
24768
24774
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
24769
24775
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
24770
24776
|
|
|
24771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24777
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
24772
24778
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
24773
24779
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
24774
24780
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -24792,7 +24798,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
24792
24798
|
};
|
|
24793
24799
|
}, "linkMatch");
|
|
24794
24800
|
|
|
24795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
24796
24802
|
var SETTING = "phoneCountries";
|
|
24797
24803
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
24798
24804
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -24823,7 +24829,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
24823
24829
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
24824
24830
|
}, "valueMatch");
|
|
24825
24831
|
|
|
24826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
24827
24833
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
24828
24834
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
24829
24835
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -24851,7 +24857,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
24851
24857
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
24852
24858
|
}, "vocabularySimilarity");
|
|
24853
24859
|
|
|
24854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
24855
24861
|
import { createHash } from "node:crypto";
|
|
24856
24862
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
24857
24863
|
try {
|
|
@@ -24917,7 +24923,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind4, by, options
|
|
|
24917
24923
|
});
|
|
24918
24924
|
}, "guardTagCreation");
|
|
24919
24925
|
|
|
24920
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
24921
24927
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
24922
24928
|
throw new CliError("validation_error", message2);
|
|
24923
24929
|
}, "invalid");
|
|
@@ -24994,7 +25000,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
24994
25000
|
};
|
|
24995
25001
|
}, "createTagRedirectIndex");
|
|
24996
25002
|
|
|
24997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
24998
25004
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
24999
25005
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
25000
25006
|
if (!row2)
|
|
@@ -25022,7 +25028,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
25022
25028
|
return snapshot2;
|
|
25023
25029
|
}, "tagRedirectSnapshot");
|
|
25024
25030
|
|
|
25025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
25026
25032
|
import { createHash as createHash2 } from "node:crypto";
|
|
25027
25033
|
var TASK_KEY_PREFIXES = {
|
|
25028
25034
|
question: "Q",
|
|
@@ -25050,7 +25056,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
25050
25056
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
25051
25057
|
}, "taskAccountOf");
|
|
25052
25058
|
|
|
25053
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
25054
25060
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
25055
25061
|
var REFERABLE = {
|
|
25056
25062
|
note: { tombstone: true },
|
|
@@ -25215,7 +25221,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
25215
25221
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
25216
25222
|
}, "taskIdOf");
|
|
25217
25223
|
|
|
25218
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
25219
25225
|
var toMs = /* @__PURE__ */ __name((iso13) => {
|
|
25220
25226
|
if (iso13 === null || iso13 === void 0)
|
|
25221
25227
|
return null;
|
|
@@ -25229,7 +25235,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
25229
25235
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
25230
25236
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
25231
25237
|
|
|
25232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25238
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
25233
25239
|
var TAG_KINDS = ["tag", "topic"];
|
|
25234
25240
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
25235
25241
|
var TAG_TYPE = {
|
|
@@ -25432,7 +25438,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
25432
25438
|
return result;
|
|
25433
25439
|
}, "tagsOf");
|
|
25434
25440
|
|
|
25435
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
25436
25442
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
25437
25443
|
var SPEECH = speech("att");
|
|
25438
25444
|
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");
|
|
@@ -25796,7 +25802,7 @@ var FIELD_COMPILERS = {
|
|
|
25796
25802
|
subject
|
|
25797
25803
|
};
|
|
25798
25804
|
|
|
25799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25805
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
25800
25806
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
25801
25807
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
25802
25808
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -25812,7 +25818,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
25812
25818
|
};
|
|
25813
25819
|
}, "placeOf");
|
|
25814
25820
|
|
|
25815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25821
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
25816
25822
|
var DRAIN_ON_WRITE = 500;
|
|
25817
25823
|
var METHOD = "rules";
|
|
25818
25824
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -25975,7 +25981,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
25975
25981
|
return queued.length;
|
|
25976
25982
|
}, "drainMentions");
|
|
25977
25983
|
|
|
25978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
25979
25985
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
25980
25986
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
25981
25987
|
if (!exists2)
|
|
@@ -25983,7 +25989,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
25983
25989
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
25984
25990
|
}, "indexRow");
|
|
25985
25991
|
|
|
25986
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
25987
25993
|
var INDEX = "message_stems";
|
|
25988
25994
|
var SETTING2 = "searchStemmers";
|
|
25989
25995
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -26105,7 +26111,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
26105
26111
|
};
|
|
26106
26112
|
}, "stemmerCache");
|
|
26107
26113
|
|
|
26108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
26109
26115
|
var SQLITE_BUSY = 5;
|
|
26110
26116
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
26111
26117
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -26200,7 +26206,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
26200
26206
|
}
|
|
26201
26207
|
}, "read");
|
|
26202
26208
|
|
|
26203
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
26204
26210
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
26205
26211
|
coalesce(CASE k.chunkable_type
|
|
26206
26212
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -26342,7 +26348,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
26342
26348
|
}, "dropUnusedVectors");
|
|
26343
26349
|
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");
|
|
26344
26350
|
|
|
26345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
26346
26352
|
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({
|
|
26347
26353
|
target: [accounts.provider, accounts.externalId],
|
|
26348
26354
|
set: {
|
|
@@ -26451,7 +26457,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
26451
26457
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
26452
26458
|
}, "dropOrphanPeople");
|
|
26453
26459
|
|
|
26454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
26455
26461
|
var FOLDED = [
|
|
26456
26462
|
{ table: "tasks", column: "title" },
|
|
26457
26463
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -26488,7 +26494,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
26488
26494
|
return filled2;
|
|
26489
26495
|
}, "fillFolded");
|
|
26490
26496
|
|
|
26491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26497
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
26492
26498
|
var HISTORY_KEY = "$history";
|
|
26493
26499
|
var objectOf = /* @__PURE__ */ __name((text6) => {
|
|
26494
26500
|
if (typeof text6 !== "string")
|
|
@@ -26564,7 +26570,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
26564
26570
|
return rest;
|
|
26565
26571
|
}, "withoutHistory");
|
|
26566
26572
|
|
|
26567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
26568
26574
|
import { createHash as createHash3 } from "node:crypto";
|
|
26569
26575
|
var CHUNK_CHARS = 1200;
|
|
26570
26576
|
var CHUNK_OVERLAP = 150;
|
|
@@ -26669,7 +26675,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
26669
26675
|
return chunks2;
|
|
26670
26676
|
}, "cutChunks");
|
|
26671
26677
|
|
|
26672
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26678
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
26673
26679
|
var DAY = 864e5;
|
|
26674
26680
|
var CURRENCY = [
|
|
26675
26681
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -26795,7 +26801,7 @@ var dueDayOf = /* @__PURE__ */ __name((text6, createdMs) => {
|
|
|
26795
26801
|
return best?.day ?? null;
|
|
26796
26802
|
}, "dueDayOf");
|
|
26797
26803
|
|
|
26798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26804
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
26799
26805
|
var DAY2 = 864e5;
|
|
26800
26806
|
var STOP_WORDS = new Set([
|
|
26801
26807
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -26950,7 +26956,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
26950
26956
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
26951
26957
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
26952
26958
|
|
|
26953
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
26954
26960
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
26955
26961
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
26956
26962
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -27221,7 +27227,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
27221
27227
|
};
|
|
27222
27228
|
}, "readiness");
|
|
27223
27229
|
|
|
27224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
27225
27231
|
var DOCUMENT_PICTURE = "document_picture";
|
|
27226
27232
|
var SCAN_PAGE2 = 5e3;
|
|
27227
27233
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -27284,7 +27290,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
27284
27290
|
}, "nearestPictures")
|
|
27285
27291
|
}), "documentPicturesOver");
|
|
27286
27292
|
|
|
27287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
27288
27294
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
27289
27295
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
27290
27296
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -27349,7 +27355,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
27349
27355
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
27350
27356
|
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");
|
|
27351
27357
|
|
|
27352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
27353
27359
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
27354
27360
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
27355
27361
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -27439,7 +27445,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
27439
27445
|
});
|
|
27440
27446
|
}, "linkMeeting");
|
|
27441
27447
|
|
|
27442
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
27443
27449
|
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), ''))";
|
|
27444
27450
|
var UNSEARCHED_EVENT_TYPES = [
|
|
27445
27451
|
"working-location",
|
|
@@ -27669,7 +27675,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
27669
27675
|
return true;
|
|
27670
27676
|
}, "resetNoteIndex");
|
|
27671
27677
|
|
|
27672
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27678
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
27673
27679
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
27674
27680
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
27675
27681
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -27688,7 +27694,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
27688
27694
|
}
|
|
27689
27695
|
}, "resolvePersonLinks");
|
|
27690
27696
|
|
|
27691
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27697
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
27692
27698
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
27693
27699
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
27694
27700
|
find: orm.select({
|
|
@@ -27913,7 +27919,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
27913
27919
|
}, "meetingIdentityPk");
|
|
27914
27920
|
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");
|
|
27915
27921
|
|
|
27916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
27917
27923
|
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");
|
|
27918
27924
|
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");
|
|
27919
27925
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -28193,7 +28199,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
28193
28199
|
}
|
|
28194
28200
|
}, "replaceAutoTags");
|
|
28195
28201
|
|
|
28196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
28197
28203
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
28198
28204
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
28199
28205
|
var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
|
|
@@ -28212,7 +28218,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
28212
28218
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
28213
28219
|
}, "counterFreshness");
|
|
28214
28220
|
|
|
28215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
28216
28222
|
import { createHash as createHash4 } from "node:crypto";
|
|
28217
28223
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
28218
28224
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -28310,7 +28316,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
28310
28316
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
28311
28317
|
}, "contextEvidenceRequest");
|
|
28312
28318
|
|
|
28313
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
28314
28320
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
28315
28321
|
var ACTIVITY = `
|
|
28316
28322
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -28427,7 +28433,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
28427
28433
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
28428
28434
|
}), "mailActivity");
|
|
28429
28435
|
|
|
28430
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
28431
28437
|
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");
|
|
28432
28438
|
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;
|
|
28433
28439
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -28568,7 +28574,7 @@ var mailOwnText = /* @__PURE__ */ __name((body2) => {
|
|
|
28568
28574
|
return text6 || body2.trim();
|
|
28569
28575
|
}, "mailOwnText");
|
|
28570
28576
|
|
|
28571
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
28572
28578
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
28573
28579
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
28574
28580
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -28678,7 +28684,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
28678
28684
|
return emails3 + threads;
|
|
28679
28685
|
}, "drainEmailIndex");
|
|
28680
28686
|
|
|
28681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
28682
28688
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
28683
28689
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
28684
28690
|
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,
|
|
@@ -28776,7 +28782,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
28776
28782
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
28777
28783
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
28778
28784
|
|
|
28779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28785
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
28780
28786
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
28781
28787
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
28782
28788
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -28826,7 +28832,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
28826
28832
|
return threads.length;
|
|
28827
28833
|
}, "markEmailsRestored");
|
|
28828
28834
|
|
|
28829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
28830
28836
|
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");
|
|
28831
28837
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
28832
28838
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -28893,7 +28899,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
28893
28899
|
}
|
|
28894
28900
|
}), "mailRulesOver");
|
|
28895
28901
|
|
|
28896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
28897
28903
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
28898
28904
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
28899
28905
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -28901,7 +28907,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
28901
28907
|
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);
|
|
28902
28908
|
}, "reviewLink");
|
|
28903
28909
|
|
|
28904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28910
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
28905
28911
|
function checkMeetingCancelled(signal) {
|
|
28906
28912
|
if (!signal?.aborted)
|
|
28907
28913
|
return;
|
|
@@ -28912,7 +28918,7 @@ function checkMeetingCancelled(signal) {
|
|
|
28912
28918
|
}
|
|
28913
28919
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
28914
28920
|
|
|
28915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
28916
28922
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
28917
28923
|
id: Number(row2.id),
|
|
28918
28924
|
accountId: Number(row2.account_id),
|
|
@@ -28962,7 +28968,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
28962
28968
|
createdAt: Number(row2.created_at)
|
|
28963
28969
|
}), "transcriptRowOf");
|
|
28964
28970
|
|
|
28965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28971
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
28966
28972
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
28967
28973
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
28968
28974
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -29129,7 +29135,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29129
29135
|
}
|
|
29130
29136
|
}), "meetingReadsOver");
|
|
29131
29137
|
|
|
29132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
29133
29139
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
29134
29140
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
29135
29141
|
const params = [input.accountId];
|
|
@@ -29172,7 +29178,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
29172
29178
|
return { clauses, params };
|
|
29173
29179
|
}, "meetingSelectionSql");
|
|
29174
29180
|
|
|
29175
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
29176
29182
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
29177
29183
|
async meetingChatLines(input) {
|
|
29178
29184
|
checkMeetingCancelled(input.signal);
|
|
@@ -29200,7 +29206,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29200
29206
|
}
|
|
29201
29207
|
}), "meetingChatLinesOver");
|
|
29202
29208
|
|
|
29203
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
29204
29210
|
var MESSAGE_FIELDS = {
|
|
29205
29211
|
pk: messages.id,
|
|
29206
29212
|
nativeId: messages.externalId,
|
|
@@ -29371,7 +29377,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
29371
29377
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
29372
29378
|
}), "chatActivity");
|
|
29373
29379
|
|
|
29374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
29375
29381
|
var HIT_FIELDS = {
|
|
29376
29382
|
...MESSAGE_FIELDS,
|
|
29377
29383
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29470,7 +29476,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29470
29476
|
};
|
|
29471
29477
|
}, "directReplies");
|
|
29472
29478
|
|
|
29473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29479
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29474
29480
|
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");
|
|
29475
29481
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29476
29482
|
const found2 = identityRow(context, ref3);
|
|
@@ -29601,7 +29607,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29601
29607
|
}, "mentioning");
|
|
29602
29608
|
var escaped = /* @__PURE__ */ __name((text6) => text6.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29603
29609
|
|
|
29604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29610
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
29605
29611
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
29606
29612
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
29607
29613
|
}, "missing");
|
|
@@ -29723,7 +29729,7 @@ function meetingContextLinksOver(context) {
|
|
|
29723
29729
|
}
|
|
29724
29730
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
29725
29731
|
|
|
29726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29732
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
29727
29733
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
29728
29734
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
29729
29735
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -29752,7 +29758,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
29752
29758
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
29753
29759
|
}, "indexedText");
|
|
29754
29760
|
|
|
29755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29761
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
29756
29762
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
29757
29763
|
var meetingCurrentIndexRows = `
|
|
29758
29764
|
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
|
|
@@ -29783,7 +29789,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
29783
29789
|
}, "invalidateMeetingStems");
|
|
29784
29790
|
var meetingStemmableText = /* @__PURE__ */ __name((text6) => text6.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
29785
29791
|
|
|
29786
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29792
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
29787
29793
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
29788
29794
|
return {
|
|
29789
29795
|
async indexSearch(original) {
|
|
@@ -29851,10 +29857,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
29851
29857
|
}
|
|
29852
29858
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
29853
29859
|
|
|
29854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
29855
29861
|
import { createHash as createHash5 } from "node:crypto";
|
|
29856
29862
|
|
|
29857
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29863
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
29858
29864
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
29859
29865
|
const padded = ` ${term} `;
|
|
29860
29866
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -29863,7 +29869,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
29863
29869
|
return [...pieces];
|
|
29864
29870
|
}, "trigrams");
|
|
29865
29871
|
|
|
29866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29872
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
29867
29873
|
var SHORTEST_CORRECTION = 3;
|
|
29868
29874
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
29869
29875
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -29910,7 +29916,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
29910
29916
|
return corrections;
|
|
29911
29917
|
}, "correctWords");
|
|
29912
29918
|
|
|
29913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
29914
29920
|
var SHORTEST_GARBLED = 4;
|
|
29915
29921
|
var MOST_WIDENED = 64;
|
|
29916
29922
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -30002,7 +30008,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
30002
30008
|
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));
|
|
30003
30009
|
}, "widenWords");
|
|
30004
30010
|
|
|
30005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
30006
30012
|
import { readFileSync } from "node:fs";
|
|
30007
30013
|
var loaded;
|
|
30008
30014
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -30061,7 +30067,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
30061
30067
|
return false;
|
|
30062
30068
|
}, "knownRussianWord");
|
|
30063
30069
|
|
|
30064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
30065
30071
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
30066
30072
|
var MOST_WORDS = 128;
|
|
30067
30073
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -30288,7 +30294,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text6, stemmer) => {
|
|
|
30288
30294
|
return check3(tree);
|
|
30289
30295
|
}, "matchMeetingText");
|
|
30290
30296
|
|
|
30291
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
30292
30298
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
30293
30299
|
throw new CliError("validation_error", message2);
|
|
30294
30300
|
}, "fail");
|
|
@@ -30470,7 +30476,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
30470
30476
|
}
|
|
30471
30477
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
30472
30478
|
|
|
30473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30479
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
30474
30480
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30475
30481
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
30476
30482
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -30502,7 +30508,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30502
30508
|
}
|
|
30503
30509
|
}), "meetingLanguagesOver");
|
|
30504
30510
|
|
|
30505
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30511
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
30506
30512
|
import { createHash as createHash6 } from "node:crypto";
|
|
30507
30513
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
30508
30514
|
if (value === void 0)
|
|
@@ -30592,7 +30598,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30592
30598
|
}
|
|
30593
30599
|
}), "meetingParticipantSearchOver");
|
|
30594
30600
|
|
|
30595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30601
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
30596
30602
|
var preparationQueries = {
|
|
30597
30603
|
participants: {
|
|
30598
30604
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -30642,7 +30648,7 @@ var preparationQueries = {
|
|
|
30642
30648
|
}
|
|
30643
30649
|
};
|
|
30644
30650
|
|
|
30645
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30651
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
30646
30652
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30647
30653
|
async preparationContext(original) {
|
|
30648
30654
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -30683,7 +30689,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30683
30689
|
}
|
|
30684
30690
|
}), "meetingPreparationContextOver");
|
|
30685
30691
|
|
|
30686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
30687
30693
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
30688
30694
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
30689
30695
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -30697,7 +30703,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
30697
30703
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
30698
30704
|
)`, "preparationSubjects");
|
|
30699
30705
|
|
|
30700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30706
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
30701
30707
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30702
30708
|
async preparationKnowledge(original) {
|
|
30703
30709
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -30742,7 +30748,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
30742
30748
|
}
|
|
30743
30749
|
}), "meetingPreparationKnowledgeOver");
|
|
30744
30750
|
|
|
30745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30751
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
30746
30752
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30747
30753
|
async preparationNotes(original) {
|
|
30748
30754
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -30795,7 +30801,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30795
30801
|
}
|
|
30796
30802
|
}), "meetingPreparationNotesOver");
|
|
30797
30803
|
|
|
30798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30804
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
30799
30805
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30800
30806
|
async relatedHistory(original) {
|
|
30801
30807
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -30811,7 +30817,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30811
30817
|
JOIN identity_links al ON al.person_id=cl.person_id
|
|
30812
30818
|
JOIN meeting_participants ap ON ap.identity_id=al.identity_id
|
|
30813
30819
|
JOIN anchors a ON a.id=ap.meeting_id WHERE cp.meeting_id=m.id)`;
|
|
30814
|
-
const
|
|
30820
|
+
const project2 = `EXISTS(SELECT 1 FROM links c JOIN projects p ON p.id=c.to_id
|
|
30815
30821
|
JOIN links a ON a.to_type='project' AND a.to_id=p.id AND a.from_type='meeting'
|
|
30816
30822
|
AND a.kind=${linkKind("member-of")} AND a.confirmed=1
|
|
30817
30823
|
JOIN anchors seed ON seed.id=a.from_id
|
|
@@ -30819,7 +30825,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30819
30825
|
AND c.kind=${linkKind("member-of")} AND c.confirmed=1 AND p.account_id IS NULL AND p.deleted_at IS NULL)`;
|
|
30820
30826
|
const selection = `WITH anchors AS (${anchors}), candidates AS (
|
|
30821
30827
|
SELECT m.id,m.external_id,m.title,m.event_id,m.started_at,m.ended_at,m.updated_at,
|
|
30822
|
-
${person2} AS shared_person, ${
|
|
30828
|
+
${person2} AS shared_person, ${project2} AS shared_project
|
|
30823
30829
|
FROM meetings m LEFT JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
30824
30830
|
WHERE m.account_id=? AND (m.meeting_series_id IS NULL OR m.meeting_series_id<>?)
|
|
30825
30831
|
AND (m.meeting_series_id IS NULL OR (s.deleted_at IS NULL AND s.account_id=m.account_id))
|
|
@@ -30866,7 +30872,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30866
30872
|
}
|
|
30867
30873
|
}), "meetingRelatedHistoryOver");
|
|
30868
30874
|
|
|
30869
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
30870
30876
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
30871
30877
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
30872
30878
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -30947,7 +30953,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30947
30953
|
}
|
|
30948
30954
|
}), "meetingReviewOver");
|
|
30949
30955
|
|
|
30950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
30951
30957
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
30952
30958
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
30953
30959
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -31001,7 +31007,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31001
31007
|
}
|
|
31002
31008
|
}), "meetingSeriesHistoryOver");
|
|
31003
31009
|
|
|
31004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
31005
31011
|
var MOST_ROWS = 5e5;
|
|
31006
31012
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
31007
31013
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -31070,7 +31076,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31070
31076
|
}
|
|
31071
31077
|
}), "meetingStatsOver");
|
|
31072
31078
|
|
|
31073
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
31074
31080
|
var CURSOR_KEY = "meetings";
|
|
31075
31081
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
31076
31082
|
id: Number(row2.id),
|
|
@@ -31639,7 +31645,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31639
31645
|
};
|
|
31640
31646
|
}, "meetingStoreOver");
|
|
31641
31647
|
|
|
31642
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
31643
31649
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
31644
31650
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
31645
31651
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -31665,7 +31671,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
31665
31671
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
31666
31672
|
}, "release");
|
|
31667
31673
|
|
|
31668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
31669
31675
|
var THREAD_COLUMNS = {
|
|
31670
31676
|
subject: {
|
|
31671
31677
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -31682,7 +31688,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
31682
31688
|
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);
|
|
31683
31689
|
}, "threadRows");
|
|
31684
31690
|
|
|
31685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
31686
31692
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
31687
31693
|
id: `email:${place.emailId}`,
|
|
31688
31694
|
chatId: place.threadExternalId,
|
|
@@ -32238,7 +32244,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
32238
32244
|
}
|
|
32239
32245
|
}), "mailStoreOver");
|
|
32240
32246
|
|
|
32241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
32242
32248
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
32243
32249
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
32244
32250
|
var folded4 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -32328,7 +32334,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
32328
32334
|
}, "knownWord");
|
|
32329
32335
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
32330
32336
|
|
|
32331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
32332
32338
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
32333
32339
|
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");
|
|
32334
32340
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -32414,7 +32420,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
32414
32420
|
return found2;
|
|
32415
32421
|
}, "spokenTranscripts");
|
|
32416
32422
|
|
|
32417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
32418
32424
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
32419
32425
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
32420
32426
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -32461,7 +32467,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
32461
32467
|
});
|
|
32462
32468
|
}, "placeHits");
|
|
32463
32469
|
|
|
32464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32470
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
32465
32471
|
var GROUPS = {
|
|
32466
32472
|
chat: {
|
|
32467
32473
|
key: "m.chat_id",
|
|
@@ -32483,7 +32489,7 @@ var GROUPS = {
|
|
|
32483
32489
|
}
|
|
32484
32490
|
};
|
|
32485
32491
|
|
|
32486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
32487
32493
|
var MESSAGES2 = {
|
|
32488
32494
|
rows: "messages",
|
|
32489
32495
|
threads: "chats",
|
|
@@ -32781,7 +32787,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
32781
32787
|
const exact = leaves.filter(({ test }) => test === void 0);
|
|
32782
32788
|
const projection = exact.map(({ fragment }, index2) => `coalesce(${fragment.sql},0) AS q${index2}`).join(",");
|
|
32783
32789
|
const projectionParams = exact.flatMap(({ fragment }) => fragment.params);
|
|
32784
|
-
const
|
|
32790
|
+
const evaluate2 = /* @__PURE__ */ __name((node, row2, text6, attachments2) => {
|
|
32785
32791
|
if (node.kind === "predicate") {
|
|
32786
32792
|
const leaf2 = fragments.get(node);
|
|
32787
32793
|
return leaf2.test ? leaf2.test(text6, attachments2) : Number(row2[`q${exact.indexOf(leaf2)}`]) === 1;
|
|
@@ -32789,7 +32795,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
32789
32795
|
const must = node.clauses.filter(({ occur }) => occur === "must");
|
|
32790
32796
|
const should = node.clauses.filter(({ occur }) => occur === "should");
|
|
32791
32797
|
const not = node.clauses.filter(({ occur }) => occur === "must_not");
|
|
32792
|
-
return (must.length ? must.every(({ node: node2 }) =>
|
|
32798
|
+
return (must.length ? must.every(({ node: node2 }) => evaluate2(node2, row2, text6, attachments2)) : should.length > 0 && should.some(({ node: node2 }) => evaluate2(node2, row2, text6, attachments2))) && not.every(({ node: node2 }) => !evaluate2(node2, row2, text6, attachments2));
|
|
32793
32799
|
}, "evaluate");
|
|
32794
32800
|
const grouped = /* @__PURE__ */ __name((by, sql2, params, source2, prefix = "") => {
|
|
32795
32801
|
const group = GROUPS[by];
|
|
@@ -32829,7 +32835,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
32829
32835
|
projection,
|
|
32830
32836
|
projectionParams,
|
|
32831
32837
|
joinedFrom,
|
|
32832
|
-
evaluate
|
|
32838
|
+
evaluate: evaluate2
|
|
32833
32839
|
};
|
|
32834
32840
|
}, "compileQuery");
|
|
32835
32841
|
var withQuerySelection = /* @__PURE__ */ __name((context, execution, consume) => {
|
|
@@ -32880,7 +32886,7 @@ var runQuery = /* @__PURE__ */ __name((context, execution, by) => {
|
|
|
32880
32886
|
}
|
|
32881
32887
|
}, "runQuery");
|
|
32882
32888
|
var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
32883
|
-
const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, placeTier, projection, projectionParams, joinedFrom, evaluate } = compileQuery(context, execution);
|
|
32889
|
+
const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, placeTier, projection, projectionParams, joinedFrom, evaluate: evaluate2 } = compileQuery(context, execution);
|
|
32884
32890
|
if (by === "pks" && leaves.every(({ test }) => !test)) {
|
|
32885
32891
|
const rows = database.prepare(`${withRanking}SELECT m.id AS id ${from2} WHERE ${where.sql}`).all(...ranked.params, ...where.params);
|
|
32886
32892
|
await new Promise((resolve) => setImmediate(resolve));
|
|
@@ -32944,7 +32950,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
32944
32950
|
check3();
|
|
32945
32951
|
const row2 = byPk.get(id2);
|
|
32946
32952
|
const attachments2 = JSON.parse(String(row2.attachment_kinds));
|
|
32947
|
-
if (
|
|
32953
|
+
if (evaluate2(execution.root, row2, String(row2.body), Array.isArray(attachments2) ? attachments2.map(String) : []))
|
|
32948
32954
|
found2.push(id2);
|
|
32949
32955
|
if (!by && found2.length > execution.limit)
|
|
32950
32956
|
break;
|
|
@@ -32966,7 +32972,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
32966
32972
|
};
|
|
32967
32973
|
}, "runCompiled");
|
|
32968
32974
|
|
|
32969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
32970
32976
|
function invalidMetadata() {
|
|
32971
32977
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
32972
32978
|
}
|
|
@@ -33068,7 +33074,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
33068
33074
|
};
|
|
33069
33075
|
}), "counterTargets");
|
|
33070
33076
|
|
|
33071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33077
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
33072
33078
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind4) => `'${kind4}'`).join(",");
|
|
33073
33079
|
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,
|
|
33074
33080
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -33187,7 +33193,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
33187
33193
|
}));
|
|
33188
33194
|
}, "attachmentViews");
|
|
33189
33195
|
|
|
33190
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
33191
33197
|
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");
|
|
33192
33198
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text6, source2) => {
|
|
33193
33199
|
const { orm, database, now: now2 } = context;
|
|
@@ -33225,7 +33231,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
33225
33231
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
33226
33232
|
}, "intoVoiceAttachment");
|
|
33227
33233
|
|
|
33228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
33229
33235
|
var FIELDS = [
|
|
33230
33236
|
"threadExternalId",
|
|
33231
33237
|
"senderIdentityId",
|
|
@@ -33542,7 +33548,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
33542
33548
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
33543
33549
|
}, "writeDerivedReactions");
|
|
33544
33550
|
|
|
33545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
33546
33552
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
33547
33553
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
33548
33554
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -33563,7 +33569,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
33563
33569
|
};
|
|
33564
33570
|
}, "keysOver");
|
|
33565
33571
|
|
|
33566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
33567
33573
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
33568
33574
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
33569
33575
|
if (!row2)
|
|
@@ -33598,7 +33604,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
33598
33604
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
33599
33605
|
}, "saveProfile");
|
|
33600
33606
|
|
|
33601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
33602
33608
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
33603
33609
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
33604
33610
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -33655,7 +33661,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
33655
33661
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
33656
33662
|
}, "proposedBySql");
|
|
33657
33663
|
|
|
33658
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
33659
33665
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
33660
33666
|
const owner = ownerPerson(context.database).id;
|
|
33661
33667
|
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);
|
|
@@ -33676,7 +33682,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
33676
33682
|
return personOf(context, ref3);
|
|
33677
33683
|
}, "linkToOwner");
|
|
33678
33684
|
|
|
33679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
33680
33686
|
var PROVIDERS_SETTING = "providers";
|
|
33681
33687
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
33682
33688
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -33711,7 +33717,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
33711
33717
|
});
|
|
33712
33718
|
}, "registerProvider");
|
|
33713
33719
|
|
|
33714
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
33715
33721
|
var DAY3 = 864e5;
|
|
33716
33722
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
33717
33723
|
var TEXT_LIMIT = 20;
|
|
@@ -33807,14 +33813,14 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
33807
33813
|
throw new CliError("not_found", `no task ${subject2.task}`);
|
|
33808
33814
|
return sideOf(row2);
|
|
33809
33815
|
}
|
|
33810
|
-
const
|
|
33811
|
-
if (!
|
|
33816
|
+
const project2 = database.prepare("SELECT id FROM projects WHERE key = ?").get(inboxKey(subject2.account));
|
|
33817
|
+
if (!project2)
|
|
33812
33818
|
return void 0;
|
|
33813
33819
|
const { draft } = subject2;
|
|
33814
33820
|
const source2 = draft.source === void 0 ? void 0 : sourceOf4(draft.source);
|
|
33815
33821
|
const person2 = draft.person ?? source2?.person;
|
|
33816
33822
|
return {
|
|
33817
|
-
project: Number(
|
|
33823
|
+
project: Number(project2.id),
|
|
33818
33824
|
title: draft.title,
|
|
33819
33825
|
description: draft.description ?? "",
|
|
33820
33826
|
...draft.category === void 0 ? {} : { category: draft.category },
|
|
@@ -33910,7 +33916,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
33910
33916
|
};
|
|
33911
33917
|
}, "taskSimilarityOver");
|
|
33912
33918
|
|
|
33913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
33914
33920
|
var SETTING3 = "taskCategories";
|
|
33915
33921
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
33916
33922
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -33929,7 +33935,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
33929
33935
|
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);
|
|
33930
33936
|
}, "saveTaskCategories");
|
|
33931
33937
|
|
|
33932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
33933
33939
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
33934
33940
|
var ALLOWED = "taskAgentClose";
|
|
33935
33941
|
var MIN = "taskAgentCloseMin";
|
|
@@ -33985,10 +33991,10 @@ var SUGGESTION_COLUMNS = [
|
|
|
33985
33991
|
];
|
|
33986
33992
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
33987
33993
|
|
|
33988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33994
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
33989
33995
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
33990
33996
|
|
|
33991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33997
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
33992
33998
|
var TASK_CLOSE_KIND = "task_close";
|
|
33993
33999
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
33994
34000
|
var isOwnerOnlyKind = /* @__PURE__ */ __name((kind4) => kind4 === MAIL_FINDINGS_KIND || kind4 === MEETING_FINDINGS_KIND || kind4 === TASK_CLOSE_KIND, "isOwnerOnlyKind");
|
|
@@ -34036,7 +34042,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
34036
34042
|
}, "assertMayDecide");
|
|
34037
34043
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
34038
34044
|
|
|
34039
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
34040
34046
|
var PROFILE_PLACEHOLDER = "<profile>";
|
|
34041
34047
|
var oneLine = /* @__PURE__ */ __name((text6) => singleLine(text6.replace(/\s+/g, " ").trim()), "oneLine");
|
|
34042
34048
|
var openKind = /* @__PURE__ */ __name((kind4) => kind4 === "email" ? "message" : kind4 === "email_thread" ? "chat" : kind4 === "unknown" ? void 0 : kind4, "openKind");
|
|
@@ -34089,7 +34095,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
|
34089
34095
|
return `${WORDS2[summary.kind]} ${named3}${notes2 === "" ? "" : ` (${notes2})`}`;
|
|
34090
34096
|
}, "refLabel");
|
|
34091
34097
|
|
|
34092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
34093
34099
|
var EXCERPT_CHARS = 280;
|
|
34094
34100
|
var TITLE_CHARS = 120;
|
|
34095
34101
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -34450,7 +34456,7 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
|
|
|
34450
34456
|
var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
|
|
34451
34457
|
var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6, read2]) => [text6, summaryOf2(read2, options.excerpt === true)])), "refSummariesOf");
|
|
34452
34458
|
|
|
34453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
34454
34460
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
34455
34461
|
ref: ref3,
|
|
34456
34462
|
kind: read2.kind,
|
|
@@ -34486,7 +34492,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
34486
34492
|
});
|
|
34487
34493
|
}, "evidenceSourcesOf");
|
|
34488
34494
|
|
|
34489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
34490
34496
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
34491
34497
|
var MAX_TEXT_CHARS = 2e6;
|
|
34492
34498
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -34512,7 +34518,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
34512
34518
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
34513
34519
|
}, "pdfPreviewLimits");
|
|
34514
34520
|
|
|
34515
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34521
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
34516
34522
|
import { randomBytes } from "node:crypto";
|
|
34517
34523
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
34518
34524
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -34525,7 +34531,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
34525
34531
|
return time3 + random;
|
|
34526
34532
|
}, "ulid");
|
|
34527
34533
|
|
|
34528
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
34529
34535
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
34530
34536
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
34531
34537
|
if (!meta && !sections?.length)
|
|
@@ -34546,7 +34552,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
34546
34552
|
return typeof language === "string" && language !== "" ? language : null;
|
|
34547
34553
|
}, "languageOf");
|
|
34548
34554
|
|
|
34549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
34550
34556
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
34551
34557
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
34552
34558
|
if (isObject(value))
|
|
@@ -34789,7 +34795,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
34789
34795
|
};
|
|
34790
34796
|
}, "filesStoreOver");
|
|
34791
34797
|
|
|
34792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
34793
34799
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
34794
34800
|
entity: "document",
|
|
34795
34801
|
backend: "sql",
|
|
@@ -34835,7 +34841,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
34835
34841
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
34836
34842
|
}, "importedDocumentWhere");
|
|
34837
34843
|
|
|
34838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
34839
34845
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
34840
34846
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
34841
34847
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
@@ -35361,7 +35367,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35361
35367
|
};
|
|
35362
35368
|
}, "notesStoreOver");
|
|
35363
35369
|
|
|
35364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
35365
35371
|
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";
|
|
35366
35372
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
35367
35373
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -35416,10 +35422,10 @@ var projectOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
35416
35422
|
return { project: `project:${row2.project_id}`, projectName: named3?.name == null ? null : String(named3.name) };
|
|
35417
35423
|
}, "projectOf");
|
|
35418
35424
|
var projectId = /* @__PURE__ */ __name((database, reference2) => {
|
|
35419
|
-
const
|
|
35420
|
-
if (
|
|
35425
|
+
const project2 = requiredThing(database, reference2, "the project");
|
|
35426
|
+
if (project2.type !== "project")
|
|
35421
35427
|
throw new CliError("validation_error", `${reference2} is not a project`);
|
|
35422
|
-
return
|
|
35428
|
+
return project2.id;
|
|
35423
35429
|
}, "projectId");
|
|
35424
35430
|
var highestKey = /* @__PURE__ */ __name((table) => `ids.${table}.highest`, "highestKey");
|
|
35425
35431
|
var nextId = /* @__PURE__ */ __name((database, table) => {
|
|
@@ -35515,10 +35521,10 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35515
35521
|
const id2 = write(database, () => {
|
|
35516
35522
|
const { actor, model } = authorActor(context, input.author);
|
|
35517
35523
|
const subject2 = input.subject === void 0 ? void 0 : requiredThing(database, input.subject, "the subject");
|
|
35518
|
-
const
|
|
35524
|
+
const project2 = input.project === void 0 ? null : projectId(database, input.project);
|
|
35519
35525
|
const replaced = input.supersedes === void 0 ? void 0 : Number(rowOf2(input.supersedes).id);
|
|
35520
35526
|
const at = now2();
|
|
35521
|
-
const made = Number(database.prepare("INSERT INTO memories (id, kind, body, subject_type, subject_id, author_type, author_id, model, confidence, status, last_verified_at, supersedes_id, scope, project_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "memories"), kind4, body2, subject2?.type ?? null, subject2?.id ?? null, actor.type, actor.id, model, input.confidence ?? null, status, status === "confirmed" ? at : null, replaced ?? null, scope3,
|
|
35527
|
+
const made = Number(database.prepare("INSERT INTO memories (id, kind, body, subject_type, subject_id, author_type, author_id, model, confidence, status, last_verified_at, supersedes_id, scope, project_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "memories"), kind4, body2, subject2?.type ?? null, subject2?.id ?? null, actor.type, actor.id, model, input.confidence ?? null, status, status === "confirmed" ? at : null, replaced ?? null, scope3, project2, at, at)?.id);
|
|
35522
35528
|
linkEvidence(context, { type: "memory", id: made }, input.evidence, input.author === "owner" ? "owner" : "agent");
|
|
35523
35529
|
if (replaced !== void 0)
|
|
35524
35530
|
database.prepare("UPDATE memories SET status = 'superseded', updated_at = ? WHERE id = ?").run(at, replaced);
|
|
@@ -35537,14 +35543,14 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35537
35543
|
get: /* @__PURE__ */ __name(async (reference2) => memoryOf(rowOf2(reference2)), "get"),
|
|
35538
35544
|
list: /* @__PURE__ */ __name(async (options = {}) => {
|
|
35539
35545
|
const subject2 = options.subject === void 0 ? void 0 : requiredThing(database, options.subject);
|
|
35540
|
-
const
|
|
35546
|
+
const project2 = options.project === void 0 ? null : projectId(database, options.project);
|
|
35541
35547
|
const by = proposedBySql("m.author_type", "m.author_id", options.proposedBy);
|
|
35542
|
-
return database.prepare(`${NAMED} WHERE m.deleted_at IS NULL AND (? IS NULL OR (m.subject_type = ? AND m.subject_id = ?)) AND (? IS NULL OR m.project_id = ?) AND (? IS NULL OR m.kind = ?) AND (? IS NULL OR m.status = ?) AND (? IS NULL OR m.scope = ?) AND ${by.sql} ORDER BY m.created_at DESC, m.id DESC LIMIT ?`).all(subject2?.type ?? null, subject2?.type ?? null, subject2?.id ?? null,
|
|
35548
|
+
return database.prepare(`${NAMED} WHERE m.deleted_at IS NULL AND (? IS NULL OR (m.subject_type = ? AND m.subject_id = ?)) AND (? IS NULL OR m.project_id = ?) AND (? IS NULL OR m.kind = ?) AND (? IS NULL OR m.status = ?) AND (? IS NULL OR m.scope = ?) AND ${by.sql} ORDER BY m.created_at DESC, m.id DESC LIMIT ?`).all(subject2?.type ?? null, subject2?.type ?? null, subject2?.id ?? null, project2, project2, options.kind ?? null, options.kind ?? null, options.status ?? null, options.status ?? null, options.scope ?? null, options.scope ?? null, ...by.params, Math.min(Math.max(options.limit ?? 100, 1), 500)).map(memoryOf);
|
|
35543
35549
|
}, "list"),
|
|
35544
35550
|
update: /* @__PURE__ */ __name(async (reference2, change) => write(database, () => {
|
|
35545
35551
|
const id2 = Number(rowOf2(reference2).id);
|
|
35546
|
-
const
|
|
35547
|
-
database.prepare("UPDATE memories SET project_id = ?, updated_at = ? WHERE id = ?").run(
|
|
35552
|
+
const project2 = change.project === null ? null : projectId(database, change.project);
|
|
35553
|
+
database.prepare("UPDATE memories SET project_id = ?, updated_at = ? WHERE id = ?").run(project2, now2(), id2);
|
|
35548
35554
|
return memoryOf(rowOf2(`memory:${id2}`));
|
|
35549
35555
|
}), "update"),
|
|
35550
35556
|
confirm: /* @__PURE__ */ __name(async (reference2, by) => confirmNow(reference2, by), "confirm"),
|
|
@@ -35583,7 +35589,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35583
35589
|
};
|
|
35584
35590
|
}, "memoriesStoreOver");
|
|
35585
35591
|
|
|
35586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35592
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
35587
35593
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
35588
35594
|
var KEY = "taskFirstPassPerChat";
|
|
35589
35595
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -35603,7 +35609,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
35603
35609
|
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);
|
|
35604
35610
|
}, "saveFirstPassPerChat");
|
|
35605
35611
|
|
|
35606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35612
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
35607
35613
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
35608
35614
|
var EXTERNAL_ID_CHARS = 200;
|
|
35609
35615
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -35630,7 +35636,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
35630
35636
|
return text6;
|
|
35631
35637
|
}, "sourceUrlOf");
|
|
35632
35638
|
|
|
35633
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35639
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
35634
35640
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
35635
35641
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
35636
35642
|
name,
|
|
@@ -35853,7 +35859,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
35853
35859
|
return root === void 0 ? void 0 : { ...query, root };
|
|
35854
35860
|
}, "withoutField");
|
|
35855
35861
|
|
|
35856
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
35857
35863
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
35858
35864
|
if (row2.author_type == null)
|
|
35859
35865
|
return null;
|
|
@@ -35881,7 +35887,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
35881
35887
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
35882
35888
|
}, "addComment");
|
|
35883
35889
|
|
|
35884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
35885
35891
|
var TASK_RELATION_KINDS = [
|
|
35886
35892
|
"blocked-by",
|
|
35887
35893
|
"follow-up-of",
|
|
@@ -35995,11 +36001,11 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
35995
36001
|
}));
|
|
35996
36002
|
return { ready: !isClosedState(String(liveTask(database, rowId).status)) && blockers.length === 0, blockers };
|
|
35997
36003
|
}), "taskReadiness"),
|
|
35998
|
-
readyTasks: /* @__PURE__ */ __name(async (
|
|
36004
|
+
readyTasks: /* @__PURE__ */ __name(async (project2, options = {}) => read(database, () => {
|
|
35999
36005
|
const limit = options.limit ?? 50;
|
|
36000
36006
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 500)
|
|
36001
36007
|
throw new CliError("validation_error", "ready tasks take 1\u2013500 rows");
|
|
36002
|
-
const row2 =
|
|
36008
|
+
const row2 = project2.startsWith("project:") ? database.prepare("SELECT id FROM projects WHERE id=? AND account_id IS NULL AND deleted_at IS NULL").get(project2.slice(8)) : database.prepare("SELECT id FROM projects WHERE key=? AND account_id IS NULL AND deleted_at IS NULL").get(project2.trim().toUpperCase());
|
|
36003
36009
|
if (!row2)
|
|
36004
36010
|
throw new CliError("not_found", "the owner project is unavailable");
|
|
36005
36011
|
const rows = database.prepare("SELECT coalesce(t.package_id,t.key) AS id,t.key,substr(t.title,1,300) AS title FROM tasks t WHERE t.project_id=? AND t.status NOT IN ('done','dismissed') AND t.deleted_at IS NULL AND NOT EXISTS (SELECT 1 FROM links l LEFT JOIN tasks b ON b.id=l.to_id LEFT JOIN projects p ON p.id=b.project_id WHERE l.from_type='task' AND l.to_type='task' AND l.kind='blocked-by' AND l.from_id=t.id AND l.confirmed=1 AND l.anchor IS NULL AND (b.id IS NULL OR b.deleted_at IS NOT NULL OR p.deleted_at IS NOT NULL OR b.status!='done')) ORDER BY t.priority_score IS NULL,t.priority_score DESC,t.number,t.id LIMIT ?").all(Number(row2.id), limit + 1);
|
|
@@ -36011,7 +36017,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
36011
36017
|
};
|
|
36012
36018
|
}, "taskRelationsStoreOver");
|
|
36013
36019
|
|
|
36014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
36015
36021
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
36016
36022
|
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
36017
36023
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind4, changes, at) => {
|
|
@@ -36060,10 +36066,10 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36060
36066
|
throw new CliError("validation_error", `${reference2} is not a person`);
|
|
36061
36067
|
return thing.id;
|
|
36062
36068
|
}, "personOf");
|
|
36063
|
-
const parentOf = /* @__PURE__ */ __name((task,
|
|
36069
|
+
const parentOf = /* @__PURE__ */ __name((task, project2, reference2) => {
|
|
36064
36070
|
const parent2 = required3(reference2);
|
|
36065
36071
|
const row2 = database.prepare("SELECT project_id FROM tasks WHERE id = ?").get(parent2);
|
|
36066
|
-
if (Number(row2.project_id) !==
|
|
36072
|
+
if (Number(row2.project_id) !== project2)
|
|
36067
36073
|
throw new CliError("validation_error", "a subtask's parent is in the same project");
|
|
36068
36074
|
for (let at = parent2; at !== null; ) {
|
|
36069
36075
|
if (at === task)
|
|
@@ -36074,8 +36080,8 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36074
36080
|
return parent2;
|
|
36075
36081
|
}, "parentOf");
|
|
36076
36082
|
const projectNamed = /* @__PURE__ */ __name((id2) => {
|
|
36077
|
-
const
|
|
36078
|
-
return { projectKey: String(
|
|
36083
|
+
const project2 = database.prepare("SELECT key, name FROM projects WHERE id = ?").get(id2);
|
|
36084
|
+
return { projectKey: String(project2.key), projectName: String(project2.name) };
|
|
36079
36085
|
}, "projectNamed");
|
|
36080
36086
|
const detailsOf = /* @__PURE__ */ __name((row2) => {
|
|
36081
36087
|
const id2 = Number(row2.id);
|
|
@@ -36322,14 +36328,14 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36322
36328
|
if (!WORK_TASK_TYPES.includes(input.type))
|
|
36323
36329
|
throw new CliError("validation_error", `a task made here is one of ${WORK_TASK_TYPES.join(", ")}`);
|
|
36324
36330
|
const made = write(database, () => {
|
|
36325
|
-
const
|
|
36331
|
+
const project2 = projectOf2(input.project);
|
|
36326
36332
|
const { actor } = authorActor(context, by);
|
|
36327
36333
|
const at = now2();
|
|
36328
|
-
const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at,
|
|
36334
|
+
const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, project2);
|
|
36329
36335
|
const number3 = Number(counted.tasks_count);
|
|
36330
36336
|
if (!Number.isSafeInteger(number3) || number3 < 1)
|
|
36331
36337
|
throw new CliError("configuration_error", "the project task counter exceeds the safe numbering range");
|
|
36332
|
-
const id2 = Number(database.prepare("INSERT INTO tasks (project_id, number, key, title, title_folded, type, status, author_type, author_id, source, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 'open', ?, ?, ?, ?, ?) RETURNING id").get(
|
|
36338
|
+
const id2 = Number(database.prepare("INSERT INTO tasks (project_id, number, key, title, title_folded, type, status, author_type, author_id, source, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 'open', ?, ?, ?, ?, ?) RETURNING id").get(project2, number3, `${String(counted.key)}-${number3}`, textOf2(input.title, "a task's title", 300), folded3(textOf2(input.title, "a task's title", 300)), input.type, actor.type, actor.id, by === "owner" ? "owner" : "agent", at, at)?.id);
|
|
36333
36339
|
recordTaskEvent(database, id2, actor, "created", null, at);
|
|
36334
36340
|
const { title: _title, project: _project, type: _type, ...fields4 } = input;
|
|
36335
36341
|
edit(id2, fields4, actor, true);
|
|
@@ -36413,13 +36419,13 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36413
36419
|
const row2 = taskRowOf(database, id2.startsWith("task:") ? id2.slice("task:".length) : id2);
|
|
36414
36420
|
if (row2 === void 0)
|
|
36415
36421
|
return false;
|
|
36416
|
-
const
|
|
36417
|
-
return
|
|
36422
|
+
const project2 = database.prepare("SELECT p.key, p.name FROM tasks t JOIN projects p ON p.id = t.project_id WHERE t.id = ? AND t.deleted_at IS NULL AND p.deleted_at IS NULL").get(row2);
|
|
36423
|
+
return project2 !== void 0 && String(project2.key) !== inboxKey(String(project2.name));
|
|
36418
36424
|
}, "projectTask"),
|
|
36419
|
-
find: /* @__PURE__ */ __name(async ({ project, type, status, assignee, where, limit = 100 }) => {
|
|
36425
|
+
find: /* @__PURE__ */ __name(async ({ project: project2, type, status, assignee, where, limit = 100 }) => {
|
|
36420
36426
|
if (type !== void 0 && !TASK_TYPES.includes(type))
|
|
36421
36427
|
throw new CliError("validation_error", `a task's type is one of ${TASK_TYPES.join(", ")}`);
|
|
36422
|
-
const projectId2 =
|
|
36428
|
+
const projectId2 = project2 === void 0 ? null : projectOf2(project2);
|
|
36423
36429
|
const person2 = assignee === void 0 ? null : personOf2(assignee);
|
|
36424
36430
|
return database.prepare(`SELECT * FROM tasks t WHERE deleted_at IS NULL AND (? IS NULL OR project_id = ?) AND (? IS NULL OR type = ?) AND (? IS NULL OR status = ?) AND (? IS NULL OR EXISTS (SELECT 1 FROM task_assignments a WHERE a.task_id = t.id AND a.assignee_type = 'person' AND a.assignee_id = ?)) AND (${where?.sql || "1"}) ORDER BY priority_score IS NULL, priority_score DESC, created_at, id LIMIT ?`).all(projectId2, projectId2, type ?? null, type ?? null, status ?? null, status ?? null, person2, person2, ...where?.params ?? [], Math.min(Math.max(limit, 1), 500)).map(detailsOf);
|
|
36425
36431
|
}, "find"),
|
|
@@ -36473,7 +36479,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36473
36479
|
const where = without(name);
|
|
36474
36480
|
return database.prepare(`SELECT ${select3}, count(*) AS n FROM tasks t ${from2} WHERE ${where.sql} GROUP BY ${group}`).all(...where.params);
|
|
36475
36481
|
}, "grouped");
|
|
36476
|
-
const
|
|
36482
|
+
const project2 = grouped("project", "p.id, p.key, p.name", "JOIN projects p ON p.id = t.project_id", "p.id").map((row2) => ({
|
|
36477
36483
|
value: String(row2.key),
|
|
36478
36484
|
ref: `project:${row2.id}`,
|
|
36479
36485
|
name: String(row2.name),
|
|
@@ -36500,7 +36506,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
36500
36506
|
const agent = grouped("agent", "t.agent", "", "t.agent").map((row2) => ({ value: row2.agent == null ? "none" : String(row2.agent), count: Number(row2.n) })).sort((a, b) => b.count - a.count || a.value.localeCompare(b.value));
|
|
36501
36507
|
return {
|
|
36502
36508
|
total: countOf(boardWhere(query, zone, at)),
|
|
36503
|
-
project,
|
|
36509
|
+
project: project2,
|
|
36504
36510
|
assignee,
|
|
36505
36511
|
priority: [...[...PRIORITY_LABELS].reverse(), "none"].map((value) => ({
|
|
36506
36512
|
value,
|
|
@@ -36540,7 +36546,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
36540
36546
|
};
|
|
36541
36547
|
}, "workTasksOver");
|
|
36542
36548
|
|
|
36543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36549
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
36544
36550
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
36545
36551
|
const { database, now: now2 } = context;
|
|
36546
36552
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -36589,7 +36595,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
36589
36595
|
};
|
|
36590
36596
|
}, "taskCloseOver");
|
|
36591
36597
|
|
|
36592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36598
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
36593
36599
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
36594
36600
|
const { database, now: now2 } = context;
|
|
36595
36601
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -36714,10 +36720,10 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
36714
36720
|
}, "reviewDuplicates"),
|
|
36715
36721
|
followUp: /* @__PURE__ */ __name(async (task, candidates, by) => followUp(required3(task), candidates, by), "followUp"),
|
|
36716
36722
|
pairs: /* @__PURE__ */ __name(async (account, { decision, limit, offset }) => read(database, () => {
|
|
36717
|
-
const
|
|
36718
|
-
if (!
|
|
36723
|
+
const project2 = database.prepare("SELECT id FROM projects WHERE key = ?").get(inboxKey(account));
|
|
36724
|
+
if (!project2)
|
|
36719
36725
|
return [];
|
|
36720
|
-
return database.prepare("SELECT p.* FROM task_pairs p JOIN tasks a ON a.id = p.task_id JOIN tasks b ON b.id = p.other_id WHERE p.decision = ? AND a.project_id = ? AND b.project_id = ? AND a.deleted_at IS NULL AND b.deleted_at IS NULL ORDER BY p.created_at DESC, p.id DESC LIMIT ? OFFSET ?").all(decision, Number(
|
|
36726
|
+
return database.prepare("SELECT p.* FROM task_pairs p JOIN tasks a ON a.id = p.task_id JOIN tasks b ON b.id = p.other_id WHERE p.decision = ? AND a.project_id = ? AND b.project_id = ? AND a.deleted_at IS NULL AND b.deleted_at IS NULL ORDER BY p.created_at DESC, p.id DESC LIMIT ? OFFSET ?").all(decision, Number(project2.id), Number(project2.id), limit, offset).map(pairOf);
|
|
36721
36727
|
}), "pairs"),
|
|
36722
36728
|
recordPair: /* @__PURE__ */ __name(async ({ task, source: source2, other, decision, similarity: scored, by }) => {
|
|
36723
36729
|
const otherRow = required3(other);
|
|
@@ -36807,7 +36813,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
36807
36813
|
};
|
|
36808
36814
|
}, "taskPairsOver");
|
|
36809
36815
|
|
|
36810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
36811
36817
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
36812
36818
|
var TASK_STATS_SQL = {
|
|
36813
36819
|
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"),
|
|
@@ -36819,10 +36825,10 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
36819
36825
|
statRows: /* @__PURE__ */ __name(async (scope3, where) => {
|
|
36820
36826
|
const filter = where === void 0 ? "" : ` AND (${where.sql})`;
|
|
36821
36827
|
const board = !("account" in scope3);
|
|
36822
|
-
const
|
|
36823
|
-
if (!board &&
|
|
36828
|
+
const project2 = board ? void 0 : inbox(scope3.account);
|
|
36829
|
+
if (!board && project2 === void 0)
|
|
36824
36830
|
return [];
|
|
36825
|
-
return database.prepare(TASK_STATS_SQL.rows(board, filter)).all(...
|
|
36831
|
+
return database.prepare(TASK_STATS_SQL.rows(board, filter)).all(...project2 === void 0 ? [] : [project2], ...where?.params ?? []).map((row2) => ({
|
|
36826
36832
|
group: row2.source_group == null ? null : String(row2.source_group),
|
|
36827
36833
|
sourceKind: row2.source_kind == null ? null : String(row2.source_kind),
|
|
36828
36834
|
projectId: Number(row2.project_id),
|
|
@@ -36846,7 +36852,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
36846
36852
|
}, "statNames")
|
|
36847
36853
|
}), "taskStatsOver");
|
|
36848
36854
|
|
|
36849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
36850
36856
|
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";
|
|
36851
36857
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
36852
36858
|
const key2 = inboxKey(account);
|
|
@@ -36924,10 +36930,10 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36924
36930
|
params: [canonicalTagNamed(database, name)?.id ?? -1]
|
|
36925
36931
|
})), "tagWhere"),
|
|
36926
36932
|
query: /* @__PURE__ */ __name(async (account, where, { limit, offset }) => {
|
|
36927
|
-
const
|
|
36928
|
-
if (
|
|
36933
|
+
const project2 = inbox(account, false);
|
|
36934
|
+
if (project2 === void 0)
|
|
36929
36935
|
return [];
|
|
36930
|
-
return database.prepare(`SELECT ${COLUMNS3}, t.title, t.updated_at, ${SUGGESTION_COLUMNS.map((column2) => `t.${column2}`).join(", ")} FROM tasks t JOIN projects p ON p.id = t.project_id WHERE t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ? AND ${where?.sql ?? "1"} ORDER BY t.created_at, t.id LIMIT ? OFFSET ?`).all(
|
|
36936
|
+
return database.prepare(`SELECT ${COLUMNS3}, t.title, t.updated_at, ${SUGGESTION_COLUMNS.map((column2) => `t.${column2}`).join(", ")} FROM tasks t JOIN projects p ON p.id = t.project_id WHERE t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ? AND ${where?.sql ?? "1"} ORDER BY t.created_at, t.id LIMIT ? OFFSET ?`).all(project2, ...where?.params ?? [], limit, offset).map((row2) => ({
|
|
36931
36937
|
task: toTask(row2),
|
|
36932
36938
|
title: String(row2.title),
|
|
36933
36939
|
updatedAt: new Date(Number(row2.updated_at)),
|
|
@@ -36942,10 +36948,10 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36942
36948
|
return found2 && toTask(found2);
|
|
36943
36949
|
}, "get"),
|
|
36944
36950
|
findBySource: /* @__PURE__ */ __name(async (account, source2, { linked = false } = {}) => {
|
|
36945
|
-
const
|
|
36946
|
-
if (
|
|
36951
|
+
const project2 = inbox(account, false);
|
|
36952
|
+
if (project2 === void 0)
|
|
36947
36953
|
return [];
|
|
36948
|
-
const own = select3("t.project_id = ? AND t.source_locator = ? ORDER BY t.created_at, t.id").all(
|
|
36954
|
+
const own = select3("t.project_id = ? AND t.source_locator = ? ORDER BY t.created_at, t.id").all(project2, source2).map(toTask);
|
|
36949
36955
|
if (!linked || own.length > 0)
|
|
36950
36956
|
return own;
|
|
36951
36957
|
let message2;
|
|
@@ -36954,17 +36960,17 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36954
36960
|
} catch {
|
|
36955
36961
|
message2 = void 0;
|
|
36956
36962
|
}
|
|
36957
|
-
return select3(`t.project_id = ? AND t.deleted_at IS NULL AND EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'task' AND l.from_id = t.id AND l.kind = ${linkKind("evidence")} AND ((l.to_type = ? AND l.to_id = ?) OR (l.to_id IS NULL AND l.target_text = ?))) ORDER BY t.created_at, t.id`).all(
|
|
36963
|
+
return select3(`t.project_id = ? AND t.deleted_at IS NULL AND EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'task' AND l.from_id = t.id AND l.kind = ${linkKind("evidence")} AND ((l.to_type = ? AND l.to_id = ?) OR (l.to_id IS NULL AND l.target_text = ?))) ORDER BY t.created_at, t.id`).all(project2, message2?.type ?? null, message2?.id ?? null, source2).map(toTask);
|
|
36958
36964
|
}, "findBySource"),
|
|
36959
36965
|
insert: /* @__PURE__ */ __name(async (task) => {
|
|
36960
36966
|
write(database, () => {
|
|
36961
|
-
const
|
|
36962
|
-
const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING tasks_count").get(now2(),
|
|
36967
|
+
const project2 = inbox(task.account, true);
|
|
36968
|
+
const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING tasks_count").get(now2(), project2);
|
|
36963
36969
|
const number3 = Number(counted?.tasks_count);
|
|
36964
36970
|
const key2 = typedKey(database, task.kind);
|
|
36965
36971
|
const author = actorOfOrigin(database, task.origin);
|
|
36966
36972
|
const closedBy = task.closedBy ? actorOfOrigin(database, task.closedBy) : void 0;
|
|
36967
|
-
const made = database.prepare("INSERT INTO tasks (project_id, number, key, title, type, status, due_at, closed_at, closed_by_type, closed_by_id, close_reason, author_type, author_id, source, package_id, source_locator, source_kind, source_group, created_at, updated_at, title_folded, close_reason_folded, category) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(
|
|
36973
|
+
const made = database.prepare("INSERT INTO tasks (project_id, number, key, title, type, status, due_at, closed_at, closed_by_type, closed_by_id, close_reason, author_type, author_id, source, package_id, source_locator, source_kind, source_group, created_at, updated_at, title_folded, close_reason_folded, category) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(project2, number3, key2, `${task.kind} \u2014 ${task.source}`, task.kind, task.state, time(task.dueAt), time(task.closedAt), closedBy?.type ?? null, closedBy?.id ?? null, task.reason ?? null, author.type, author.id, task.origin, task.id, task.source, task.sourceKind, task.group, task.createdAt.getTime(), now2(), folded3(`${task.kind} \u2014 ${task.source}`), folded3(task.reason), task.category ?? null);
|
|
36968
36974
|
recordTaskEvent(database, Number(made?.id), author, "created", null, task.createdAt.getTime());
|
|
36969
36975
|
});
|
|
36970
36976
|
}, "insert"),
|
|
@@ -37022,11 +37028,11 @@ var listTasks = /* @__PURE__ */ __name((filter, select3, toTask, inbox) => {
|
|
|
37022
37028
|
const where = ["t.deleted_at IS NULL"];
|
|
37023
37029
|
const values = [];
|
|
37024
37030
|
if (filter.account !== void 0) {
|
|
37025
|
-
const
|
|
37026
|
-
if (
|
|
37031
|
+
const project2 = inbox(filter.account, false);
|
|
37032
|
+
if (project2 === void 0)
|
|
37027
37033
|
return [];
|
|
37028
37034
|
where.push("t.project_id = ?");
|
|
37029
|
-
values.push(
|
|
37035
|
+
values.push(project2);
|
|
37030
37036
|
}
|
|
37031
37037
|
if (filter.state !== void 0) {
|
|
37032
37038
|
where.push("t.status = ?");
|
|
@@ -37053,7 +37059,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
37053
37059
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
37054
37060
|
}, "oneOf");
|
|
37055
37061
|
|
|
37056
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
37057
37063
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
37058
37064
|
const { database } = context;
|
|
37059
37065
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -37098,7 +37104,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
37098
37104
|
};
|
|
37099
37105
|
}, "accountsStoreOver");
|
|
37100
37106
|
|
|
37101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37107
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
37102
37108
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
37103
37109
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
37104
37110
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -37122,7 +37128,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
37122
37128
|
})), "keepDownloads");
|
|
37123
37129
|
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");
|
|
37124
37130
|
|
|
37125
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
37126
37132
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
37127
37133
|
const { database } = context;
|
|
37128
37134
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -37179,7 +37185,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
37179
37185
|
}, "keepAttachmentText")
|
|
37180
37186
|
}), "attachmentsStoreOver");
|
|
37181
37187
|
|
|
37182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
37183
37189
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
37184
37190
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
37185
37191
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -37359,7 +37365,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
37359
37365
|
return done;
|
|
37360
37366
|
}, "rekeyChats");
|
|
37361
37367
|
|
|
37362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
37363
37369
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
37364
37370
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
37365
37371
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -37417,7 +37423,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
37417
37423
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
37418
37424
|
}, "chatCoverage");
|
|
37419
37425
|
|
|
37420
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
37421
37427
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
37422
37428
|
const { database } = context;
|
|
37423
37429
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -37552,7 +37558,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37552
37558
|
};
|
|
37553
37559
|
}, "chatsStoreOver");
|
|
37554
37560
|
|
|
37555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
37556
37562
|
import { createHash as createHash7 } from "node:crypto";
|
|
37557
37563
|
var BATCH_CONTEXT = 50;
|
|
37558
37564
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -37690,7 +37696,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
37690
37696
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
37691
37697
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
37692
37698
|
|
|
37693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
37694
37700
|
import { setTimeout } from "node:timers/promises";
|
|
37695
37701
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
37696
37702
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -37765,7 +37771,7 @@ var replaceConversations = /* @__PURE__ */ __name(async (context, chatKey, { sta
|
|
|
37765
37771
|
orm.insert(conversationState).values({ chatId: chatKey, enabledAt: startedAt }).onConflictDoNothing().run();
|
|
37766
37772
|
}));
|
|
37767
37773
|
const chunkScope = orm.select({ accountId: chats.accountId, scope: sql`coalesce(${chats.scope}, ${accounts.scope})` }).from(chats).innerJoin(accounts, eq(accounts.id, chats.accountId)).where(eq(chats.id, chatKey)).get();
|
|
37768
|
-
const
|
|
37774
|
+
const project2 = context.database.prepare(`SELECT to_id FROM links WHERE from_type='chat' AND from_id=? AND to_type='project' AND kind=${linkKind("member-of")} AND confirmed=1 ORDER BY id LIMIT 1`).get(chatKey);
|
|
37769
37775
|
const insertLink2 = orm.insert(messageLinks).values({
|
|
37770
37776
|
chatId: chatKey,
|
|
37771
37777
|
messageId: sql.placeholder("messageId"),
|
|
@@ -37786,7 +37792,7 @@ var replaceConversations = /* @__PURE__ */ __name(async (context, chatKey, { sta
|
|
|
37786
37792
|
startOffset: sql.placeholder("startOffset"),
|
|
37787
37793
|
endOffset: sql.placeholder("endOffset"),
|
|
37788
37794
|
contentHash: sql.placeholder("contentHash"),
|
|
37789
|
-
projectId:
|
|
37795
|
+
projectId: project2 ? Number(project2.to_id) : null,
|
|
37790
37796
|
accountId: chunkScope?.accountId ?? null,
|
|
37791
37797
|
scope: chunkScope?.scope ?? null,
|
|
37792
37798
|
occurredAt: sql.placeholder("occurredAt"),
|
|
@@ -38002,7 +38008,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
38002
38008
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
38003
38009
|
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");
|
|
38004
38010
|
|
|
38005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
38006
38012
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
38007
38013
|
const { database } = context;
|
|
38008
38014
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -38109,7 +38115,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
38109
38115
|
};
|
|
38110
38116
|
}, "conversationsStoreOver");
|
|
38111
38117
|
|
|
38112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
38113
38119
|
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";
|
|
38114
38120
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
38115
38121
|
const { database } = context;
|
|
@@ -38134,7 +38140,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
38134
38140
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
38135
38141
|
}), "countersStoreOver");
|
|
38136
38142
|
|
|
38137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
38138
38144
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
38139
38145
|
var MENTION_QUERY = defineQuery({
|
|
38140
38146
|
entity: "mention",
|
|
@@ -38350,7 +38356,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
38350
38356
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
38351
38357
|
}, "listPlaces");
|
|
38352
38358
|
|
|
38353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
38354
38360
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
38355
38361
|
const { database } = context;
|
|
38356
38362
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -38385,7 +38391,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
38385
38391
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
38386
38392
|
}), "mentionsStoreOver");
|
|
38387
38393
|
|
|
38388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
38389
38395
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
38390
38396
|
const read2 = 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");
|
|
38391
38397
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -38400,7 +38406,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
38400
38406
|
}));
|
|
38401
38407
|
}, "documentLinkMessages");
|
|
38402
38408
|
|
|
38403
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
38404
38410
|
var stemmerFor = stemmerCache();
|
|
38405
38411
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
38406
38412
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -38444,7 +38450,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
38444
38450
|
});
|
|
38445
38451
|
}, "laterSharingRare");
|
|
38446
38452
|
|
|
38447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
38448
38454
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
38449
38455
|
const { database } = context;
|
|
38450
38456
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -38579,7 +38585,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
38579
38585
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
38580
38586
|
}), "messagesStoreOver");
|
|
38581
38587
|
|
|
38582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38588
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
38583
38589
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
38584
38590
|
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
38585
38591
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -38636,7 +38642,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
38636
38642
|
});
|
|
38637
38643
|
}, "personPreparation");
|
|
38638
38644
|
|
|
38639
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38645
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
38640
38646
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
38641
38647
|
const id2 = Number(uid);
|
|
38642
38648
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -38644,7 +38650,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
38644
38650
|
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)));
|
|
38645
38651
|
}, "personSeenInAccounts");
|
|
38646
38652
|
|
|
38647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
38648
38654
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
38649
38655
|
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);
|
|
38650
38656
|
if (!row2)
|
|
@@ -38710,7 +38716,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
38710
38716
|
return { id: id2, personId, removed: true };
|
|
38711
38717
|
}, "removeNote");
|
|
38712
38718
|
|
|
38713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
38714
38720
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
38715
38721
|
const { database } = context;
|
|
38716
38722
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -38795,13 +38801,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
38795
38801
|
};
|
|
38796
38802
|
}, "peopleStoreOver");
|
|
38797
38803
|
|
|
38798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38804
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
38799
38805
|
import { createHash as createHash9 } from "node:crypto";
|
|
38800
38806
|
|
|
38801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38807
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
38802
38808
|
import { createHash as createHash8 } from "node:crypto";
|
|
38803
38809
|
|
|
38804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
38805
38811
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
38806
38812
|
var AUTHOR_MEASURES = [
|
|
38807
38813
|
"messages",
|
|
@@ -38941,7 +38947,7 @@ var withoutUrls = /* @__PURE__ */ __name((text6) => text6.replace(/\S+/gu, (toke
|
|
|
38941
38947
|
var rankingWords = /* @__PURE__ */ __name((text6) => withoutUrls(text6).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
38942
38948
|
var rankingQuestion = /* @__PURE__ */ __name((text6) => withoutUrls(text6).includes("?"), "rankingQuestion");
|
|
38943
38949
|
|
|
38944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
38945
38951
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
38946
38952
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
38947
38953
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -39163,7 +39169,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
39163
39169
|
};
|
|
39164
39170
|
}, "rankReplyGraph");
|
|
39165
39171
|
|
|
39166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
39167
39173
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
39168
39174
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
39169
39175
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -39337,7 +39343,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
39337
39343
|
return { items, evidence, summary, graph: graph.quality };
|
|
39338
39344
|
}, "calculateAdminStatistics");
|
|
39339
39345
|
|
|
39340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
39341
39347
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
39342
39348
|
const dates = [];
|
|
39343
39349
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -39359,7 +39365,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
39359
39365
|
return dates[0].node.resolution.date;
|
|
39360
39366
|
}, "rankingContextRange");
|
|
39361
39367
|
|
|
39362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
39363
39369
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
39364
39370
|
let counts;
|
|
39365
39371
|
try {
|
|
@@ -39654,7 +39660,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
39654
39660
|
});
|
|
39655
39661
|
}, "rankQuery");
|
|
39656
39662
|
|
|
39657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
39658
39664
|
function fail4(message2, reason = "query.too-large") {
|
|
39659
39665
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
39660
39666
|
}
|
|
@@ -39831,7 +39837,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
39831
39837
|
return result;
|
|
39832
39838
|
}), "adminStatisticsQuery");
|
|
39833
39839
|
|
|
39834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39840
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
39835
39841
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
39836
39842
|
if (!execution.accounts.length)
|
|
39837
39843
|
return { conversations: [], chats: [] };
|
|
@@ -39849,7 +39855,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
39849
39855
|
return { conversations: conversations2, chats: chats2 };
|
|
39850
39856
|
}, "conversationEligibility");
|
|
39851
39857
|
|
|
39852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39858
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
39853
39859
|
import { createHash as createHash10 } from "node:crypto";
|
|
39854
39860
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
39855
39861
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -39999,7 +40005,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
39999
40005
|
return result;
|
|
40000
40006
|
}, "rankingEvidence");
|
|
40001
40007
|
|
|
40002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
40003
40009
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
40004
40010
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
|
|
40005
40011
|
const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
|
|
@@ -40093,7 +40099,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
40093
40099
|
});
|
|
40094
40100
|
}, "waitingChats");
|
|
40095
40101
|
|
|
40096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
40097
40103
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
40098
40104
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
40099
40105
|
if (execution.corpus === "mail")
|
|
@@ -40114,7 +40120,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
40114
40120
|
};
|
|
40115
40121
|
}, "queriesStoreOver");
|
|
40116
40122
|
|
|
40117
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
40118
40124
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
40119
40125
|
const { database, now: now2 } = context;
|
|
40120
40126
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -40153,10 +40159,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
40153
40159
|
}));
|
|
40154
40160
|
}, "chatEventsOf");
|
|
40155
40161
|
|
|
40156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40162
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
40157
40163
|
import { createHash as createHash11 } from "node:crypto";
|
|
40158
40164
|
|
|
40159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
40160
40166
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
40161
40167
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
40162
40168
|
timeZone: zone,
|
|
@@ -40176,7 +40182,7 @@ var weekKey = /* @__PURE__ */ __name((day) => {
|
|
|
40176
40182
|
return date3.toISOString().slice(0, 10);
|
|
40177
40183
|
}, "weekKey");
|
|
40178
40184
|
|
|
40179
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40185
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
40180
40186
|
var RETENTION_TOLERANCE = 864e5;
|
|
40181
40187
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
40182
40188
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -40230,7 +40236,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
40230
40236
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
40231
40237
|
}, "retentionCohorts");
|
|
40232
40238
|
|
|
40233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
40234
40240
|
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
40235
40241
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
40236
40242
|
validateRetentionOptions(options);
|
|
@@ -40361,7 +40367,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
40361
40367
|
};
|
|
40362
40368
|
}, "retentionQuery");
|
|
40363
40369
|
|
|
40364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
40365
40371
|
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
40366
40372
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
40367
40373
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -40492,7 +40498,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
40492
40498
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
40493
40499
|
})), "trackedChats");
|
|
40494
40500
|
|
|
40495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40501
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
40496
40502
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
40497
40503
|
const { database } = context;
|
|
40498
40504
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -40548,7 +40554,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40548
40554
|
};
|
|
40549
40555
|
}, "rosterStoreOver");
|
|
40550
40556
|
|
|
40551
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
40552
40558
|
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");
|
|
40553
40559
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
40554
40560
|
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 ?`);
|
|
@@ -40572,7 +40578,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
40572
40578
|
}
|
|
40573
40579
|
}, "backfillNormalized");
|
|
40574
40580
|
|
|
40575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
40576
40582
|
var INDEX2 = "message_words";
|
|
40577
40583
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
40578
40584
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -40699,7 +40705,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
40699
40705
|
});
|
|
40700
40706
|
}, "resetSearchIndex");
|
|
40701
40707
|
|
|
40702
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
40703
40709
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
40704
40710
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
40705
40711
|
const before2 = stemsState(database);
|
|
@@ -40794,7 +40800,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
40794
40800
|
return resetStems(database, { now: now2 });
|
|
40795
40801
|
}, "followDefaultStemmers");
|
|
40796
40802
|
|
|
40797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
40798
40804
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
40799
40805
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
40800
40806
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -40816,7 +40822,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
40816
40822
|
});
|
|
40817
40823
|
}, "termCandidates");
|
|
40818
40824
|
|
|
40819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
40820
40826
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
40821
40827
|
const { database } = context;
|
|
40822
40828
|
const stemmerFor2 = stemmerCache();
|
|
@@ -40838,7 +40844,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40838
40844
|
};
|
|
40839
40845
|
}, "searchIndexStoreOver");
|
|
40840
40846
|
|
|
40841
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40847
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
40842
40848
|
var HISTORY_KEPT = 1e3;
|
|
40843
40849
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
40844
40850
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -40907,7 +40913,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
40907
40913
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
40908
40914
|
}, "clearHistory");
|
|
40909
40915
|
|
|
40910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
40911
40917
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
40912
40918
|
const { database } = context;
|
|
40913
40919
|
return {
|
|
@@ -40931,7 +40937,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40931
40937
|
};
|
|
40932
40938
|
}, "searchesStoreOver");
|
|
40933
40939
|
|
|
40934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40940
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
40935
40941
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
40936
40942
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
40937
40943
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -40974,7 +40980,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
40974
40980
|
};
|
|
40975
40981
|
}, "agentActionsStoreOver");
|
|
40976
40982
|
|
|
40977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40983
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
40978
40984
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
40979
40985
|
}) => {
|
|
40980
40986
|
const { database, now: now2 } = context;
|
|
@@ -41033,7 +41039,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
41033
41039
|
};
|
|
41034
41040
|
}, "botUpdateStoreOver");
|
|
41035
41041
|
|
|
41036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41042
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
41037
41043
|
var DAY4 = 864e5;
|
|
41038
41044
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
41039
41045
|
if (filter.accountIds !== void 0 && filter.accountId !== void 0)
|
|
@@ -41142,7 +41148,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
41142
41148
|
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);
|
|
41143
41149
|
}, "listEvents");
|
|
41144
41150
|
|
|
41145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
41146
41152
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
41147
41153
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
41148
41154
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -41197,7 +41203,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
41197
41203
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
41198
41204
|
}, "forgetCalendarRows");
|
|
41199
41205
|
|
|
41200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41206
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
41201
41207
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
41202
41208
|
id: Number(row2.id),
|
|
41203
41209
|
accountId: Number(row2.account_id),
|
|
@@ -41784,7 +41790,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41784
41790
|
};
|
|
41785
41791
|
}, "eventStoreOver");
|
|
41786
41792
|
|
|
41787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
41788
41794
|
var CATALOG_QUERY = defineQuery({
|
|
41789
41795
|
entity: "document",
|
|
41790
41796
|
backend: "sql",
|
|
@@ -42026,7 +42032,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
42026
42032
|
};
|
|
42027
42033
|
}, "catalogStoreOver");
|
|
42028
42034
|
|
|
42029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
42030
42036
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
42031
42037
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
42032
42038
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -42039,7 +42045,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
42039
42045
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
42040
42046
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
42041
42047
|
|
|
42042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
42043
42049
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
42044
42050
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
42045
42051
|
signal?.throwIfAborted();
|
|
@@ -42138,7 +42144,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
42138
42144
|
});
|
|
42139
42145
|
}, "readMeetingContextEvidence");
|
|
42140
42146
|
|
|
42141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
42142
42148
|
var corpora = {
|
|
42143
42149
|
message: {
|
|
42144
42150
|
table: "messages",
|
|
@@ -42377,7 +42383,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
42377
42383
|
}
|
|
42378
42384
|
}), "contextRecordsOver");
|
|
42379
42385
|
|
|
42380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
42381
42387
|
var NOTE_FIELDS = [
|
|
42382
42388
|
"text",
|
|
42383
42389
|
"exact",
|
|
@@ -42627,7 +42633,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
42627
42633
|
FROM ${corpus.view} n${ranking ? " LEFT JOIN f ON f.id = n.id" : ""} WHERE ${where.sql} ORDER BY ${order} LIMIT ?`).all(...cteParams, ...leaves.flatMap(([, fragment]) => tests.size ? fragment.params : []), ...where.params, window);
|
|
42628
42634
|
if (tests.size && rows.length > QUERY_LIMITS2.candidates)
|
|
42629
42635
|
exhausted("candidates");
|
|
42630
|
-
const
|
|
42636
|
+
const evaluate2 = /* @__PURE__ */ __name((node, row2, text6) => {
|
|
42631
42637
|
if (node.kind === "predicate") {
|
|
42632
42638
|
const test = tests.get(node);
|
|
42633
42639
|
return test ? test(text6) : Number(row2[`q${leaves.findIndex(([leaf3]) => leaf3 === node)}`]) === 1;
|
|
@@ -42635,7 +42641,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
42635
42641
|
const must = node.clauses.filter(({ occur }) => occur === "must");
|
|
42636
42642
|
const should = node.clauses.filter(({ occur }) => occur === "should");
|
|
42637
42643
|
const not = node.clauses.filter(({ occur }) => occur === "must_not");
|
|
42638
|
-
return (must.length ? must.every(({ node: node2 }) =>
|
|
42644
|
+
return (must.length ? must.every(({ node: node2 }) => evaluate2(node2, row2, text6)) : should.length > 0 && should.some(({ node: node2 }) => evaluate2(node2, row2, text6))) && not.every(({ node: node2 }) => !evaluate2(node2, row2, text6));
|
|
42639
42645
|
}, "evaluate");
|
|
42640
42646
|
const matched = tests.size ? rows.filter((row2) => {
|
|
42641
42647
|
check3();
|
|
@@ -42643,7 +42649,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
42643
42649
|
budget.work += text6.length;
|
|
42644
42650
|
if (budget.work > QUERY_LIMITS2.work)
|
|
42645
42651
|
exhausted("detector work");
|
|
42646
|
-
return
|
|
42652
|
+
return evaluate2(query.root, row2, text6);
|
|
42647
42653
|
}) : rows;
|
|
42648
42654
|
return matched.map((row2) => ({
|
|
42649
42655
|
type: corpus.type,
|
|
@@ -42807,7 +42813,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
42807
42813
|
};
|
|
42808
42814
|
}, "noteSearchOver");
|
|
42809
42815
|
|
|
42810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
42811
42817
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
42812
42818
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
42813
42819
|
var EVENT_CORPUS = {
|
|
@@ -42939,7 +42945,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
42939
42945
|
};
|
|
42940
42946
|
}, "eventSearchOver");
|
|
42941
42947
|
|
|
42942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42948
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
42943
42949
|
var refuse = /* @__PURE__ */ __name((message2, reason, code = "validation_error") => {
|
|
42944
42950
|
throw new CliError(code, message2, { reason });
|
|
42945
42951
|
}, "refuse");
|
|
@@ -43269,12 +43275,12 @@ var financeOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43269
43275
|
}, "addInvoice"),
|
|
43270
43276
|
invoice: /* @__PURE__ */ __name((reference2) => invoiceDetail(reference2), "invoice"),
|
|
43271
43277
|
invoices: /* @__PURE__ */ __name((filter = {}) => {
|
|
43272
|
-
const
|
|
43278
|
+
const project2 = filter.project === void 0 ? null : projectId(database, filter.project);
|
|
43273
43279
|
const counterparty = partyThing(filter.counterparty, "the counterparty");
|
|
43274
43280
|
const by = proposedBySql("i.author_type", "i.author_id", filter.proposedBy);
|
|
43275
43281
|
const status = filter.status === void 0 ? null : oneOf4(filter.status, INVOICE_STATUSES, "a status");
|
|
43276
43282
|
const review = filter.review === void 0 ? null : oneOf4(filter.review, FINANCE_REVIEWS, "a review");
|
|
43277
|
-
return database.prepare(`${INVOICES} WHERE i.deleted_at IS NULL AND (? IS NULL OR i.direction = ?) AND (? IS NULL OR i.status = ?) AND (? IS NULL OR i.review = ?) AND (? IS NULL OR i.project_id = ?) AND (? IS NULL OR (i.counterparty_type = ? AND i.counterparty_id = ?)) ${filter.open ? "AND i.status IN ('issued', 'partly_paid') " : ""}AND ${by.sql} ORDER BY i.created_at DESC, i.id DESC LIMIT ?`).all(filter.direction ?? null, filter.direction ?? null, status, status, review, review,
|
|
43283
|
+
return database.prepare(`${INVOICES} WHERE i.deleted_at IS NULL AND (? IS NULL OR i.direction = ?) AND (? IS NULL OR i.status = ?) AND (? IS NULL OR i.review = ?) AND (? IS NULL OR i.project_id = ?) AND (? IS NULL OR (i.counterparty_type = ? AND i.counterparty_id = ?)) AND (? IS NULL OR i.number = ?) ${filter.open ? "AND i.status IN ('issued', 'partly_paid') " : ""}AND ${by.sql} ORDER BY i.created_at DESC, i.id DESC LIMIT ?`).all(filter.direction ?? null, filter.direction ?? null, status, status, review, review, project2, project2, counterparty?.type ?? null, counterparty?.type ?? null, counterparty?.id ?? null, filter.number ?? null, filter.number ?? null, ...by.params, limitOf2(filter.limit)).map(invoiceOf2);
|
|
43278
43284
|
}, "invoices"),
|
|
43279
43285
|
issueInvoice: /* @__PURE__ */ __name((reference2, by) => {
|
|
43280
43286
|
ownerOnly(by, "issues an invoice");
|
|
@@ -43329,11 +43335,11 @@ var financeOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43329
43335
|
}, "addPayment"),
|
|
43330
43336
|
payment: /* @__PURE__ */ __name((reference2) => paymentDetail(reference2), "payment"),
|
|
43331
43337
|
payments: /* @__PURE__ */ __name((filter = {}) => {
|
|
43332
|
-
const
|
|
43338
|
+
const project2 = filter.project === void 0 ? null : projectId(database, filter.project);
|
|
43333
43339
|
const party2 = partyThing(filter.party, "the party");
|
|
43334
43340
|
const by = proposedBySql("p.author_type", "p.author_id", filter.proposedBy);
|
|
43335
43341
|
const review = filter.review === void 0 ? null : oneOf4(filter.review, FINANCE_REVIEWS, "a review");
|
|
43336
|
-
return database.prepare(`${PAYMENTS} WHERE p.deleted_at IS NULL AND (? IS NULL OR p.direction = ?) AND (? IS NULL OR p.review = ?) AND (? IS NULL OR p.project_id = ?) AND (? IS NULL OR (p.payer_type = ? AND p.payer_id = ?) OR (p.payee_type = ? AND p.payee_id = ?)) AND ${by.sql} ORDER BY p.created_at DESC, p.id DESC LIMIT ?`).all(filter.direction ?? null, filter.direction ?? null, review, review,
|
|
43342
|
+
return database.prepare(`${PAYMENTS} WHERE p.deleted_at IS NULL AND (? IS NULL OR p.direction = ?) AND (? IS NULL OR p.review = ?) AND (? IS NULL OR p.project_id = ?) AND (? IS NULL OR (p.payer_type = ? AND p.payer_id = ?) OR (p.payee_type = ? AND p.payee_id = ?)) AND ${by.sql} ORDER BY p.created_at DESC, p.id DESC LIMIT ?`).all(filter.direction ?? null, filter.direction ?? null, review, review, project2, project2, party2?.type ?? null, party2?.type ?? null, party2?.id ?? null, party2?.type ?? null, party2?.id ?? null, ...by.params, limitOf2(filter.limit)).map(paymentOf3);
|
|
43337
43343
|
}, "payments"),
|
|
43338
43344
|
allocate: /* @__PURE__ */ __name(({ payment, invoice, amount, by }) => {
|
|
43339
43345
|
const row2 = rowOf2(payment, "payment");
|
|
@@ -43374,8 +43380,8 @@ var financeOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43374
43380
|
confirm: /* @__PURE__ */ __name((reference2, by, reason) => decide2(reference2, by, reason, true), "confirm"),
|
|
43375
43381
|
reject: /* @__PURE__ */ __name((reference2, by, reason) => decide2(reference2, by, reason, false), "reject"),
|
|
43376
43382
|
openTotals: /* @__PURE__ */ __name((filter = {}) => {
|
|
43377
|
-
const
|
|
43378
|
-
const rows = database.prepare(`SELECT i.direction, i.currency, sum(i.total - ${PAID}) AS open, count(*) AS n FROM invoices i WHERE i.review = 'confirmed' AND i.deleted_at IS NULL AND i.status IN ('issued', 'partly_paid') AND (? IS NULL OR i.project_id = ?) GROUP BY i.direction, i.currency ORDER BY i.currency`).all(
|
|
43383
|
+
const project2 = filter.project === void 0 ? null : projectId(database, filter.project);
|
|
43384
|
+
const rows = database.prepare(`SELECT i.direction, i.currency, sum(i.total - ${PAID}) AS open, count(*) AS n FROM invoices i WHERE i.review = 'confirmed' AND i.deleted_at IS NULL AND i.status IN ('issued', 'partly_paid') AND (? IS NULL OR i.project_id = ?) GROUP BY i.direction, i.currency ORDER BY i.currency`).all(project2, project2);
|
|
43379
43385
|
const totals = /* @__PURE__ */ __name((direction) => rows.filter((row2) => row2.direction === direction).map((row2) => ({ ...moneyOf(Number(row2.open), String(row2.currency)), invoices: Number(row2.n) })), "totals");
|
|
43380
43386
|
return { receivable: totals("receivable"), payable: totals("payable") };
|
|
43381
43387
|
}, "openTotals")
|
|
@@ -43400,7 +43406,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43400
43406
|
};
|
|
43401
43407
|
}, "financeStoreOver");
|
|
43402
43408
|
|
|
43403
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
43404
43410
|
var refuse2 = /* @__PURE__ */ __name((message2, reason) => {
|
|
43405
43411
|
throw new CliError("validation_error", message2, { reason });
|
|
43406
43412
|
}, "refuse");
|
|
@@ -43433,10 +43439,10 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
43433
43439
|
return (entry2, by, outcome) => {
|
|
43434
43440
|
const { payment } = entry2;
|
|
43435
43441
|
const amount = entryAmount(payment);
|
|
43436
|
-
const
|
|
43442
|
+
const project2 = entry2.project ?? (payment.counterparty?.startsWith("project:") ? payment.counterparty : void 0);
|
|
43437
43443
|
const written2 = {
|
|
43438
43444
|
by,
|
|
43439
|
-
...
|
|
43445
|
+
...project2 === void 0 ? {} : { project: project2 },
|
|
43440
43446
|
...by === "owner" ? {} : { source: "agent", reason: entry2.statement ?? paymentTitle(entry2) },
|
|
43441
43447
|
evidence: entry2.evidence
|
|
43442
43448
|
};
|
|
@@ -43478,7 +43484,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
43478
43484
|
};
|
|
43479
43485
|
}, "paymentEntriesOver");
|
|
43480
43486
|
|
|
43481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43487
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
43482
43488
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
43483
43489
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
43484
43490
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -43504,7 +43510,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
43504
43510
|
return valid;
|
|
43505
43511
|
}, "validateEvidenceFindings");
|
|
43506
43512
|
|
|
43507
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43513
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
43508
43514
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
43509
43515
|
try {
|
|
43510
43516
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -43516,7 +43522,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
43516
43522
|
}
|
|
43517
43523
|
}, "calendarMoment");
|
|
43518
43524
|
|
|
43519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
43520
43526
|
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";
|
|
43521
43527
|
var iso9 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
43522
43528
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -43591,8 +43597,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43591
43597
|
if (occurredAt !== null && !Number.isFinite(occurredAt))
|
|
43592
43598
|
throw new CliError("validation_error", "occurredAt takes an ISO timestamp");
|
|
43593
43599
|
const id2 = write(database, () => {
|
|
43594
|
-
const
|
|
43595
|
-
if (
|
|
43600
|
+
const project2 = input.project === void 0 ? void 0 : requiredThing(database, input.project, "the project");
|
|
43601
|
+
if (project2 && project2.type !== "project")
|
|
43596
43602
|
throw new CliError("validation_error", `${input.project} is not a project`);
|
|
43597
43603
|
const subject2 = input.subject === void 0 ? void 0 : requiredThing(database, input.subject, "the subject");
|
|
43598
43604
|
const replaced = input.supersedes === void 0 ? void 0 : rowOf2(input.supersedes);
|
|
@@ -43601,7 +43607,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43601
43607
|
const owner = input.by === "owner";
|
|
43602
43608
|
const { actor, model } = authorActor(context, input.by);
|
|
43603
43609
|
const at = now2();
|
|
43604
|
-
const made = Number(database.prepare("INSERT INTO facts (id, type, statement, status, project_id, subject_type, subject_id, occurred_at, supersedes_id, author_type, author_id, model, scope, source, metadata, created_at, updated_at) VALUES (?, ?, ?, 'proposed', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "facts"), type, statement,
|
|
43610
|
+
const made = Number(database.prepare("INSERT INTO facts (id, type, statement, status, project_id, subject_type, subject_id, occurred_at, supersedes_id, author_type, author_id, model, scope, source, metadata, created_at, updated_at) VALUES (?, ?, ?, 'proposed', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "facts"), type, statement, project2?.id ?? null, subject2?.type ?? null, subject2?.id ?? null, occurredAt, replaced === void 0 ? null : Number(replaced.id), actor.type, actor.id, model, scope3, owner ? "owner" : "agent", null, at, at)?.id);
|
|
43605
43611
|
linkEvidence(context, { type: "fact", id: made }, input.evidence ?? [], owner ? "owner" : "agent");
|
|
43606
43612
|
if (input.createdFrom !== void 0) {
|
|
43607
43613
|
const from2 = requiredThing(database, input.createdFrom, "the source");
|
|
@@ -43615,11 +43621,11 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43615
43621
|
}, "add"),
|
|
43616
43622
|
get: /* @__PURE__ */ __name((reference2) => factOf(rowOf2(reference2)), "get"),
|
|
43617
43623
|
list: /* @__PURE__ */ __name((options = {}) => {
|
|
43618
|
-
const
|
|
43624
|
+
const project2 = options.project === void 0 ? void 0 : requiredThing(database, options.project, "the project");
|
|
43619
43625
|
const subject2 = options.subject === void 0 ? void 0 : requiredThing(database, options.subject);
|
|
43620
43626
|
const by = proposedBySql("f.author_type", "f.author_id", options.proposedBy);
|
|
43621
43627
|
const order = options.order === "created" ? "f.created_at" : "coalesce(f.occurred_at, f.created_at)";
|
|
43622
|
-
return database.prepare(`${NAMED3} WHERE f.deleted_at IS NULL AND (? IS NULL OR f.type = ?) AND (? IS NULL OR f.project_id = ?) AND (? IS NULL OR (f.subject_type = ? AND f.subject_id = ?)) AND (? IS NULL OR f.status = ?) AND ${by.sql} ORDER BY ${order} DESC, f.id DESC LIMIT ?`).all(options.type ?? null, options.type ?? null,
|
|
43628
|
+
return database.prepare(`${NAMED3} WHERE f.deleted_at IS NULL AND (? IS NULL OR f.type = ?) AND (? IS NULL OR f.project_id = ?) AND (? IS NULL OR (f.subject_type = ? AND f.subject_id = ?)) AND (? IS NULL OR f.status = ?) AND ${by.sql} ORDER BY ${order} DESC, f.id DESC LIMIT ?`).all(options.type ?? null, options.type ?? null, project2?.id ?? null, project2?.id ?? null, subject2?.type ?? null, subject2?.type ?? null, subject2?.id ?? null, options.status ?? null, options.status ?? null, ...by.params, Math.min(Math.max(options.limit ?? 100, 1), 500)).map(factOf);
|
|
43623
43629
|
}, "list"),
|
|
43624
43630
|
accept: /* @__PURE__ */ __name((reference2, by, reason) => {
|
|
43625
43631
|
const row2 = rowOf2(reference2);
|
|
@@ -43725,7 +43731,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43725
43731
|
};
|
|
43726
43732
|
}, "factsStoreOver");
|
|
43727
43733
|
|
|
43728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
43729
43735
|
var invalid4 = /* @__PURE__ */ __name((message2) => {
|
|
43730
43736
|
throw new CliError("validation_error", message2);
|
|
43731
43737
|
}, "invalid");
|
|
@@ -43744,14 +43750,14 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
|
|
|
43744
43750
|
for (const finding of input.findings) {
|
|
43745
43751
|
let projectId2 = null;
|
|
43746
43752
|
if (finding.project !== void 0) {
|
|
43747
|
-
const
|
|
43748
|
-
if (
|
|
43753
|
+
const project2 = requiredThing(database, finding.project, "the project");
|
|
43754
|
+
if (project2.type !== "project")
|
|
43749
43755
|
return invalid4("a finding needs an owner project");
|
|
43750
|
-
const projectRow = database.prepare("SELECT id,key,name,description,type,scope,updated_at FROM projects WHERE id=? AND account_id IS NULL AND deleted_at IS NULL").get(
|
|
43756
|
+
const projectRow = database.prepare("SELECT id,key,name,description,type,scope,updated_at FROM projects WHERE id=? AND account_id IS NULL AND deleted_at IS NULL").get(project2.id);
|
|
43751
43757
|
if (!projectRow)
|
|
43752
43758
|
throw new CliError("not_found", "the owner project is unavailable");
|
|
43753
43759
|
seen.set(finding.project, projectRow);
|
|
43754
|
-
projectId2 = String(
|
|
43760
|
+
projectId2 = String(project2.id);
|
|
43755
43761
|
}
|
|
43756
43762
|
if (finding.subject !== void 0)
|
|
43757
43763
|
seen.set(finding.subject, requiredThing(database, finding.subject, "the subject"));
|
|
@@ -43829,7 +43835,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
|
|
|
43829
43835
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
|
|
43830
43836
|
}, "findingsCoreOver");
|
|
43831
43837
|
|
|
43832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43838
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
43833
43839
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
43834
43840
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
43835
43841
|
var iso10 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -43917,11 +43923,11 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
43917
43923
|
}, "propose"),
|
|
43918
43924
|
get: /* @__PURE__ */ __name((id2) => actionOf(rowOf2(id2)), "get"),
|
|
43919
43925
|
pending: /* @__PURE__ */ __name(({ limit = 100 } = {}) => database.prepare(`${NAMED4} WHERE p.status = 'proposed' ORDER BY p.created_at, p.id LIMIT ?`).all(Math.min(Math.max(limit, 1), 500)).map(actionOf), "pending"),
|
|
43920
|
-
list: /* @__PURE__ */ __name(({ status, limit = 100, kinds: kinds2, except, proposedBy, project } = {}) => {
|
|
43926
|
+
list: /* @__PURE__ */ __name(({ status, limit = 100, kinds: kinds2, except, proposedBy, project: project2 } = {}) => {
|
|
43921
43927
|
if (status !== void 0 && !PROPOSAL_STATUSES.includes(status))
|
|
43922
43928
|
throw new CliError("validation_error", `a status is one of ${PROPOSAL_STATUSES.join(", ")}`);
|
|
43923
43929
|
const by = proposedBySql("p.proposed_by_type", "p.proposed_by_id", proposedBy);
|
|
43924
|
-
return database.prepare(`${NAMED4} WHERE (? IS NULL OR ${STATUS} = ?) AND (? IS NULL OR p.kind IN (SELECT value FROM json_each(?))) AND p.kind NOT IN (SELECT value FROM json_each(?)) AND (? IS NULL OR (p.target_type = 'project' AND 'project:' || p.target_id = ?) OR json_extract(p.payload, '$.to') = ? OR json_extract(p.payload, '$.from') = ? OR json_extract(p.payload, '$.project') = ?) AND ${by.sql} ORDER BY p.created_at DESC, p.id DESC LIMIT ?`).all(status ?? null, status ?? null, kinds2 === void 0 ? null : 1, JSON.stringify(kinds2 ?? []), JSON.stringify(except ?? []), ...Array(5).fill(
|
|
43930
|
+
return database.prepare(`${NAMED4} WHERE (? IS NULL OR ${STATUS} = ?) AND (? IS NULL OR p.kind IN (SELECT value FROM json_each(?))) AND p.kind NOT IN (SELECT value FROM json_each(?)) AND (? IS NULL OR (p.target_type = 'project' AND 'project:' || p.target_id = ?) OR json_extract(p.payload, '$.to') = ? OR json_extract(p.payload, '$.from') = ? OR json_extract(p.payload, '$.project') = ?) AND ${by.sql} ORDER BY p.created_at DESC, p.id DESC LIMIT ?`).all(status ?? null, status ?? null, kinds2 === void 0 ? null : 1, JSON.stringify(kinds2 ?? []), JSON.stringify(except ?? []), ...Array(5).fill(project2 ?? null), ...by.params, Math.min(Math.max(limit, 1), 500)).map(actionOf);
|
|
43925
43931
|
}, "list"),
|
|
43926
43932
|
approve: /* @__PURE__ */ __name((id2, result, by) => decide2(id2, "approved", result, by), "approve"),
|
|
43927
43933
|
reject: /* @__PURE__ */ __name((id2, by, result) => decide2(id2, "rejected", result, by), "reject"),
|
|
@@ -43994,7 +44000,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43994
44000
|
};
|
|
43995
44001
|
}, "proposedActionsStoreOver");
|
|
43996
44002
|
|
|
43997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
43998
44004
|
var stale = /* @__PURE__ */ __name(() => {
|
|
43999
44005
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
44000
44006
|
reason: "evidence-findings.stale"
|
|
@@ -44113,12 +44119,12 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
44113
44119
|
}, "stage"),
|
|
44114
44120
|
get: /* @__PURE__ */ __name(async (id2) => view(load(id2)), "get"),
|
|
44115
44121
|
sources: /* @__PURE__ */ __name(async (id2) => sourcesOfReferences(database, view(load(id2)).input.findings.flatMap((finding) => finding.evidence.map((one2) => one2.reference))), "sources"),
|
|
44116
|
-
list: /* @__PURE__ */ __name(async ({ project, limit = 20, offset = 0, status } = {}) => {
|
|
44122
|
+
list: /* @__PURE__ */ __name(async ({ project: project2, limit = 20, offset = 0, status } = {}) => {
|
|
44117
44123
|
if (status !== void 0 && status !== "proposed" && status !== "reviewed")
|
|
44118
44124
|
return invalid5("finding status is proposed or reviewed");
|
|
44119
44125
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 50 || !Number.isSafeInteger(offset) || offset < 0)
|
|
44120
44126
|
return invalid5("findings lists take 1\u201350 items and a nonnegative offset");
|
|
44121
|
-
const projectId2 =
|
|
44127
|
+
const projectId2 = project2 === void 0 ? null : /^project:([1-9]\d*)$/.exec(project2)?.[1];
|
|
44122
44128
|
if (projectId2 === void 0)
|
|
44123
44129
|
return invalid5("a findings list filters by a project reference");
|
|
44124
44130
|
const ids = database.prepare("SELECT id FROM proposed_actions WHERE account_id IS NULL AND kind=? AND (? IS NULL OR (target_type='project' AND target_id=?) OR EXISTS (SELECT 1 FROM json_each(payload,'$.findings') f WHERE json_extract(f.value,'$.project')=?)) AND (? IS NULL OR status=?) ORDER BY id DESC LIMIT ? OFFSET ?").all(EVIDENCE_FINDINGS_KIND, projectId2, projectId2 === null ? null : Number(projectId2), projectId2 === null ? null : `project:${projectId2}`, status ?? null, status === "reviewed" ? "approved" : status ?? null, limit + 1, offset);
|
|
@@ -44175,7 +44181,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
44175
44181
|
};
|
|
44176
44182
|
}, "evidenceFindingsStoreOver");
|
|
44177
44183
|
|
|
44178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44184
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
44179
44185
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
44180
44186
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
44181
44187
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -44228,7 +44234,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
44228
44234
|
}, "forPerson")
|
|
44229
44235
|
}), "involvementStoreOver");
|
|
44230
44236
|
|
|
44231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
44232
44238
|
import { createHash as createHash12 } from "node:crypto";
|
|
44233
44239
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
44234
44240
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -44265,7 +44271,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
44265
44271
|
linkMeetingProject: /* @__PURE__ */ __name(async (key2, meetingId, projectId2, options = {}) => {
|
|
44266
44272
|
check2(options.signal);
|
|
44267
44273
|
const meeting = id(meetingId);
|
|
44268
|
-
const
|
|
44274
|
+
const project2 = id(projectId2);
|
|
44269
44275
|
const by = options.by ?? "owner";
|
|
44270
44276
|
if (by !== "owner" && by !== "agent")
|
|
44271
44277
|
throw new CliError("validation_error", "choose owner or agent provenance");
|
|
@@ -44275,9 +44281,9 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
44275
44281
|
const accountId = account(key2);
|
|
44276
44282
|
if (!database.prepare("SELECT 1 FROM meetings WHERE id=? AND account_id=? AND deleted_at IS NULL").get(meeting, accountId))
|
|
44277
44283
|
throw new CliError("not_found", "the meeting is unavailable in this account");
|
|
44278
|
-
if (!database.prepare("SELECT 1 FROM projects WHERE id=? AND account_id IS NULL AND deleted_at IS NULL").get(
|
|
44284
|
+
if (!database.prepare("SELECT 1 FROM projects WHERE id=? AND account_id IS NULL AND deleted_at IS NULL").get(project2))
|
|
44279
44285
|
throw new CliError("not_found", "the owner project is unavailable");
|
|
44280
|
-
const held = database.prepare(`SELECT ${fields3} FROM links WHERE from_type='meeting' AND from_id=? AND to_type='project' AND to_id=? AND kind='member-of' AND anchor IS NULL`).get(meeting,
|
|
44286
|
+
const held = database.prepare(`SELECT ${fields3} FROM links WHERE from_type='meeting' AND from_id=? AND to_type='project' AND to_id=? AND kind='member-of' AND anchor IS NULL`).get(meeting, project2);
|
|
44281
44287
|
if (options.expectedFingerprint !== void 0 && (!held || linkOf2(held, accountId).fingerprint !== options.expectedFingerprint))
|
|
44282
44288
|
throw new CliError("configuration_error", "meeting membership changed since review", {
|
|
44283
44289
|
reason: "meeting-project.stale"
|
|
@@ -44290,8 +44296,8 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
44290
44296
|
if (held)
|
|
44291
44297
|
database.prepare("UPDATE links SET confirmed=1,source='owner',author='owner',updated_at=? WHERE id=?").run(at, Number(held.id));
|
|
44292
44298
|
else
|
|
44293
|
-
database.prepare("INSERT INTO links (from_type,from_id,to_type,to_id,kind,source,confirmed,evidence,author,created_at,updated_at) VALUES ('meeting',?,'project',?,'member-of',?,?,?,?,?,?)").run(meeting,
|
|
44294
|
-
const row2 = database.prepare(`SELECT ${fields3} FROM links WHERE from_type='meeting' AND from_id=? AND to_type='project' AND to_id=? AND kind='member-of' AND anchor IS NULL`).get(meeting,
|
|
44299
|
+
database.prepare("INSERT INTO links (from_type,from_id,to_type,to_id,kind,source,confirmed,evidence,author,created_at,updated_at) VALUES ('meeting',?,'project',?,'member-of',?,?,?,?,?,?)").run(meeting, project2, by === "owner" ? "owner" : "suggested", by === "owner" ? 1 : 0, options.provenance ?? null, by === "owner" ? "owner" : null, at, at);
|
|
44300
|
+
const row2 = database.prepare(`SELECT ${fields3} FROM links WHERE from_type='meeting' AND from_id=? AND to_type='project' AND to_id=? AND kind='member-of' AND anchor IS NULL`).get(meeting, project2);
|
|
44295
44301
|
check2(options.signal);
|
|
44296
44302
|
return { link: linkOf2(row2, accountId), changed: true };
|
|
44297
44303
|
});
|
|
@@ -44306,15 +44312,89 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
44306
44312
|
if (options.confirmed !== void 0 && typeof options.confirmed !== "boolean")
|
|
44307
44313
|
throw new CliError("validation_error", "confirmed must be boolean");
|
|
44308
44314
|
const meeting = options.meetingId === void 0 ? null : id(options.meetingId);
|
|
44309
|
-
const
|
|
44310
|
-
const rows = database.prepare("SELECT l.id,l.from_id,l.to_id,l.source,l.confirmed,l.updated_at,length(l.evidence) AS evidenceLength,substr(l.evidence,1,2000) AS evidence FROM links l JOIN meetings m ON m.id=l.from_id JOIN projects p ON p.id=l.to_id WHERE l.from_type='meeting' AND l.to_type='project' AND l.kind='member-of' AND l.anchor IS NULL AND m.account_id=? AND m.deleted_at IS NULL AND p.account_id IS NULL AND p.deleted_at IS NULL AND (? IS NULL OR m.id=?) AND (? IS NULL OR p.id=?) AND (? IS NULL OR l.confirmed=?) ORDER BY l.id LIMIT ? OFFSET ?").all(accountId, meeting, meeting,
|
|
44315
|
+
const project2 = options.projectId === void 0 ? null : id(options.projectId);
|
|
44316
|
+
const rows = database.prepare("SELECT l.id,l.from_id,l.to_id,l.source,l.confirmed,l.updated_at,length(l.evidence) AS evidenceLength,substr(l.evidence,1,2000) AS evidence FROM links l JOIN meetings m ON m.id=l.from_id JOIN projects p ON p.id=l.to_id WHERE l.from_type='meeting' AND l.to_type='project' AND l.kind='member-of' AND l.anchor IS NULL AND m.account_id=? AND m.deleted_at IS NULL AND p.account_id IS NULL AND p.deleted_at IS NULL AND (? IS NULL OR m.id=?) AND (? IS NULL OR p.id=?) AND (? IS NULL OR l.confirmed=?) ORDER BY l.id LIMIT ? OFFSET ?").all(accountId, meeting, meeting, project2, project2, options.confirmed === void 0 ? null : Number(options.confirmed), options.confirmed === void 0 ? null : Number(options.confirmed), limit + 1, offset);
|
|
44311
44317
|
check2(options.signal);
|
|
44312
44318
|
return { items: rows.slice(0, limit).map((row2) => linkOf2(row2, accountId)), hasMore: rows.length > limit };
|
|
44313
44319
|
}, "meetingProjects")
|
|
44314
44320
|
};
|
|
44315
44321
|
}, "meetingProjectsStoreOver");
|
|
44316
44322
|
|
|
44317
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
44324
|
+
var ORGANIZATIONS_QUERY = {
|
|
44325
|
+
entity: "organization",
|
|
44326
|
+
backend: "sql",
|
|
44327
|
+
fields: queryFieldsOf(organization, {
|
|
44328
|
+
native: ["id", "kind", "scope", "created_at"],
|
|
44329
|
+
examples: {
|
|
44330
|
+
id: "id:1",
|
|
44331
|
+
kind: "kind:company",
|
|
44332
|
+
name: "name:*acme*",
|
|
44333
|
+
scope: "scope:work",
|
|
44334
|
+
created_at: "created_at>=2026-01-01"
|
|
44335
|
+
}
|
|
44336
|
+
})
|
|
44337
|
+
};
|
|
44338
|
+
var PROJECTS_QUERY = {
|
|
44339
|
+
entity: "project",
|
|
44340
|
+
backend: "sql",
|
|
44341
|
+
fields: queryFieldsOf(project, {
|
|
44342
|
+
native: ["id", "key", "name", "kind", "type", "organization_id", "scope", "created_at"],
|
|
44343
|
+
examples: {
|
|
44344
|
+
id: "id:1",
|
|
44345
|
+
key: "key:SMP",
|
|
44346
|
+
name: "name:*tart*",
|
|
44347
|
+
kind: "kind:inbox",
|
|
44348
|
+
type: "type:work",
|
|
44349
|
+
organization_id: "organization_id:1",
|
|
44350
|
+
scope: "scope:work",
|
|
44351
|
+
created_at: "created_at>=2026-01-01"
|
|
44352
|
+
}
|
|
44353
|
+
})
|
|
44354
|
+
};
|
|
44355
|
+
var REMINDERS_QUERY = {
|
|
44356
|
+
entity: "reminder",
|
|
44357
|
+
backend: "sql",
|
|
44358
|
+
fields: queryFieldsOf(reminder, {
|
|
44359
|
+
native: ["id", "state", "due_at", "revision"],
|
|
44360
|
+
examples: { id: "id:1", state: "state:pending", due_at: "due_at>=2026-01-01", revision: "revision>1" }
|
|
44361
|
+
})
|
|
44362
|
+
};
|
|
44363
|
+
|
|
44364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
44365
|
+
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
44366
|
+
id: String(row2.id),
|
|
44367
|
+
ref: `organization:${row2.id}`,
|
|
44368
|
+
kind: row2.kind,
|
|
44369
|
+
name: String(row2.name),
|
|
44370
|
+
scope: row2.scope,
|
|
44371
|
+
createdAt: new Date(Number(row2.created_at)).toISOString()
|
|
44372
|
+
}), "organizationOf");
|
|
44373
|
+
var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
44374
|
+
organizations: /* @__PURE__ */ __name(async (query) => {
|
|
44375
|
+
if (query && walkQuery(query.root).some((node) => node.field === "name"))
|
|
44376
|
+
return database.prepare("SELECT * FROM organizations WHERE deleted_at IS NULL ORDER BY name, id").all().map(organizationOf).filter((one2) => evaluate(query, ORGANIZATIONS_QUERY.fields, { ...one2, created_at: one2.createdAt })).slice(0, 500);
|
|
44377
|
+
const where = query && queryFilter(query, {
|
|
44378
|
+
id: { type: "kw", sql: "CAST(id AS TEXT)" },
|
|
44379
|
+
kind: { type: "enum", sql: "kind" },
|
|
44380
|
+
scope: { type: "enum", sql: "scope" },
|
|
44381
|
+
created_at: { type: "time", sql: "created_at" }
|
|
44382
|
+
});
|
|
44383
|
+
return database.prepare(`SELECT * FROM organizations WHERE deleted_at IS NULL${where ? ` AND (${where.sql})` : ""} ORDER BY name, id LIMIT 500`).all(...where?.params ?? []).map(organizationOf);
|
|
44384
|
+
}, "organizations"),
|
|
44385
|
+
updateOrganization: /* @__PURE__ */ __name(async (organization2, { name }) => write(database, () => {
|
|
44386
|
+
const title = name.trim();
|
|
44387
|
+
if (!title || title.length > 200)
|
|
44388
|
+
throw new CliError("validation_error", "text takes 1\u2013200 characters");
|
|
44389
|
+
const thing = thingOf(database, organization2.includes(":") ? organization2 : `organization:${organization2}`);
|
|
44390
|
+
const row2 = thing?.type === "organization" && database.prepare("UPDATE organizations SET name = ?, updated_at = ? WHERE id = ? AND deleted_at IS NULL RETURNING *").get(title, now2(), thing.id);
|
|
44391
|
+
if (!row2)
|
|
44392
|
+
throw new CliError("not_found", `no organization ${organization2}`);
|
|
44393
|
+
return organizationOf(row2);
|
|
44394
|
+
}), "updateOrganization")
|
|
44395
|
+
}), "organizationsStoreOver");
|
|
44396
|
+
|
|
44397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
44318
44398
|
var relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
44319
44399
|
id: link3.id,
|
|
44320
44400
|
from: link3.from,
|
|
@@ -44540,16 +44620,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
44540
44620
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
44541
44621
|
}, "decidedOrigin");
|
|
44542
44622
|
|
|
44543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44623
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
44544
44624
|
import { createHash as createHash15 } from "node:crypto";
|
|
44545
44625
|
|
|
44546
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44626
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
44547
44627
|
import { createHash as createHash14 } from "node:crypto";
|
|
44548
44628
|
|
|
44549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44629
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
44550
44630
|
import { createHash as createHash13 } from "node:crypto";
|
|
44551
44631
|
|
|
44552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
44553
44633
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
44554
44634
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
44555
44635
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -44600,7 +44680,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
44600
44680
|
return input;
|
|
44601
44681
|
}, "consolidationApplyInput");
|
|
44602
44682
|
|
|
44603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44683
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
44604
44684
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
44605
44685
|
id: String(row2.id),
|
|
44606
44686
|
sourceId: String(row2.source_id),
|
|
@@ -44675,7 +44755,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
44675
44755
|
}, { beforeCommit: check3 });
|
|
44676
44756
|
}, "applyTagConsolidation");
|
|
44677
44757
|
|
|
44678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
44679
44759
|
var selections = [
|
|
44680
44760
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
44681
44761
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -44819,7 +44899,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
44819
44899
|
};
|
|
44820
44900
|
}, "previewRows");
|
|
44821
44901
|
|
|
44822
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
44823
44903
|
var kinds = ["project", "tag", "topic"];
|
|
44824
44904
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
44825
44905
|
if (signal?.aborted)
|
|
@@ -45083,7 +45163,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45083
45163
|
};
|
|
45084
45164
|
}, "vocabularyStoreOver");
|
|
45085
45165
|
|
|
45086
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
45087
45167
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
45088
45168
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
45089
45169
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -45235,14 +45315,6 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45235
45315
|
throw new CliError("not_found", "no annotation with that id");
|
|
45236
45316
|
return found2;
|
|
45237
45317
|
}, "annotation");
|
|
45238
|
-
const organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
45239
|
-
id: String(row2.id),
|
|
45240
|
-
ref: `organization:${row2.id}`,
|
|
45241
|
-
kind: row2.kind,
|
|
45242
|
-
name: String(row2.name),
|
|
45243
|
-
scope: row2.scope,
|
|
45244
|
-
createdAt: iso11(row2.created_at)
|
|
45245
|
-
}), "organizationOf");
|
|
45246
45318
|
const projectOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
45247
45319
|
id: String(row2.id),
|
|
45248
45320
|
ref: `project:${row2.id}`,
|
|
@@ -45294,7 +45366,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45294
45366
|
revision: Number(row2.revision),
|
|
45295
45367
|
receipt: row2.receipt == null ? null : String(row2.receipt)
|
|
45296
45368
|
}), "reminderOf");
|
|
45297
|
-
const
|
|
45369
|
+
const reminder2 = /* @__PURE__ */ __name((key2, id2) => {
|
|
45298
45370
|
const row2 = /^\d+$/.test(id2) ? database.prepare("SELECT * FROM reminders WHERE account_id=? AND id=?").get(account(key2), Number(id2)) : void 0;
|
|
45299
45371
|
if (!row2)
|
|
45300
45372
|
throw new CliError("not_found", "no reminder with that id in this account");
|
|
@@ -45316,6 +45388,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45316
45388
|
const tagsOf2 = /* @__PURE__ */ __name((list2) => [...new Set(list2.map(canonicalTagName))], "tagsOf");
|
|
45317
45389
|
return {
|
|
45318
45390
|
...vocabularyStoreOver(context),
|
|
45391
|
+
...organizationsStoreOver(context),
|
|
45319
45392
|
...meetingProjectsStoreOver(context),
|
|
45320
45393
|
taskIds: /* @__PURE__ */ __name(async (key2, options = {}) => {
|
|
45321
45394
|
const { limit, offset } = bounded2(options.limit, options.offset);
|
|
@@ -45431,21 +45504,12 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45431
45504
|
const row2 = database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?) RETURNING *").get(oneOf6(kind4, ORGANIZATION_KINDS, "an organization's kind"), textOf3(name, 200), oneOf6(scope3, SCOPES, "a scope"), at, at);
|
|
45432
45505
|
return organizationOf(row2);
|
|
45433
45506
|
}, "addOrganization"),
|
|
45434
|
-
|
|
45435
|
-
const where = query && queryFilter(query, {
|
|
45436
|
-
id: { type: "kw", sql: "CAST(id AS TEXT)" },
|
|
45437
|
-
kind: { type: "enum", sql: "kind" },
|
|
45438
|
-
scope: { type: "enum", sql: "scope" },
|
|
45439
|
-
created_at: { type: "time", sql: "created_at" }
|
|
45440
|
-
});
|
|
45441
|
-
return database.prepare(`SELECT * FROM organizations WHERE deleted_at IS NULL${where ? ` AND (${where.sql})` : ""} ORDER BY name, id LIMIT 500`).all(...where?.params ?? []).map(organizationOf);
|
|
45442
|
-
}, "organizations"),
|
|
45443
|
-
addProject: /* @__PURE__ */ __name(async ({ name, key: key2, type = "other", organization, scope: scope3 = "personal", description }) => write(database, () => {
|
|
45507
|
+
addProject: /* @__PURE__ */ __name(async ({ name, key: key2, type = "other", organization: organization2, scope: scope3 = "personal", description }) => write(database, () => {
|
|
45444
45508
|
const title = textOf3(name, 200);
|
|
45445
|
-
const organizationId =
|
|
45446
|
-
const thing = thingOf(database,
|
|
45509
|
+
const organizationId = organization2 === void 0 ? null : (() => {
|
|
45510
|
+
const thing = thingOf(database, organization2);
|
|
45447
45511
|
if (thing?.type !== "organization")
|
|
45448
|
-
throw new CliError("not_found", `no organization ${
|
|
45512
|
+
throw new CliError("not_found", `no organization ${organization2}`);
|
|
45449
45513
|
return thing.id;
|
|
45450
45514
|
})();
|
|
45451
45515
|
const wanted = key2 === void 0 ? projectKey(title) : key2.trim().toUpperCase();
|
|
@@ -45586,7 +45650,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45586
45650
|
return reminderOf(existing);
|
|
45587
45651
|
const at = now2();
|
|
45588
45652
|
const made = database.prepare("INSERT INTO reminders (task_id, account_id, due_at, timezone, state, revision, created_at, updated_at) VALUES (?, ?, ?, ?, 'pending', 1, ?, ?) RETURNING id").get(row2, accountId, timestamp4, timezone, at, at);
|
|
45589
|
-
return
|
|
45653
|
+
return reminder2(key2, String(made?.id));
|
|
45590
45654
|
}, "schedule"),
|
|
45591
45655
|
reminders: /* @__PURE__ */ __name(async (key2, query) => {
|
|
45592
45656
|
const where = query && queryFilter(query, {
|
|
@@ -45598,16 +45662,16 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45598
45662
|
return database.prepare(`SELECT * FROM reminders WHERE account_id=?${where ? ` AND (${where.sql})` : ""} ORDER BY due_at, id LIMIT 500`).all(account(key2), ...where?.params ?? []).map(reminderOf);
|
|
45599
45663
|
}, "reminders"),
|
|
45600
45664
|
cancelReminder: /* @__PURE__ */ __name(async (key2, id2) => {
|
|
45601
|
-
|
|
45665
|
+
reminder2(key2, id2);
|
|
45602
45666
|
database.prepare("UPDATE reminders SET state='cancelled', revision=revision+1, receipt=NULL, lease_until=NULL, updated_at=? WHERE account_id=? AND id=? AND state IN ('pending','leased')").run(now2(), account(key2), Number(id2));
|
|
45603
|
-
return
|
|
45667
|
+
return reminder2(key2, id2);
|
|
45604
45668
|
}, "cancelReminder"),
|
|
45605
45669
|
snoozeReminder: /* @__PURE__ */ __name(async (key2, id2, dueAt, revision2) => {
|
|
45606
|
-
const held =
|
|
45670
|
+
const held = reminder2(key2, id2);
|
|
45607
45671
|
openTask(key2, held.task);
|
|
45608
45672
|
if (!database.prepare("UPDATE reminders SET due_at=?, state='pending', revision=revision+1, receipt=NULL, lease_until=NULL, updated_at=? WHERE account_id=? AND id=? AND revision=? AND state<>'cancelled'").run(due(dueAt), now2(), account(key2), Number(id2), revision2).changes)
|
|
45609
45673
|
throw new CliError("validation_error", "reminder changed or was cancelled");
|
|
45610
|
-
return
|
|
45674
|
+
return reminder2(key2, id2);
|
|
45611
45675
|
}, "snoozeReminder"),
|
|
45612
45676
|
claimReminders: /* @__PURE__ */ __name(async (key2, options = {}) => {
|
|
45613
45677
|
const { limit } = bounded2(options.limit), lease = options.leaseMs ?? 6e4;
|
|
@@ -45619,18 +45683,18 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45619
45683
|
for (const row2 of rows) {
|
|
45620
45684
|
const receipt = ulid(at);
|
|
45621
45685
|
if (database.prepare("UPDATE reminders SET state='leased', receipt=?, lease_until=?, updated_at=? WHERE account_id=? AND id=? AND (state='pending' OR (state='leased' AND lease_until<=?))").run(receipt, at + lease, at, accountId, Number(row2.id), at).changes)
|
|
45622
|
-
claimed.push(
|
|
45686
|
+
claimed.push(reminder2(key2, String(row2.id)));
|
|
45623
45687
|
}
|
|
45624
45688
|
return claimed;
|
|
45625
45689
|
}, "claimReminders"),
|
|
45626
45690
|
acknowledgeReminder: /* @__PURE__ */ __name(async (key2, id2, receipt) => {
|
|
45627
|
-
const held =
|
|
45691
|
+
const held = reminder2(key2, id2);
|
|
45628
45692
|
if (held.state === "delivered" && held.receipt === receipt)
|
|
45629
45693
|
return held;
|
|
45630
45694
|
openTask(key2, held.task);
|
|
45631
45695
|
if (!database.prepare("UPDATE reminders SET state='delivered', lease_until=NULL, updated_at=? WHERE account_id=? AND id=? AND state='leased' AND receipt=? AND lease_until>?").run(now2(), account(key2), Number(id2), receipt, now2()).changes)
|
|
45632
45696
|
throw new CliError("validation_error", "receipt is stale or the delivery lease expired");
|
|
45633
|
-
return
|
|
45697
|
+
return reminder2(key2, id2);
|
|
45634
45698
|
}, "acknowledgeReminder")
|
|
45635
45699
|
};
|
|
45636
45700
|
}, "knowledgeStoreOver");
|
|
@@ -45640,7 +45704,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
45640
45704
|
return key2.padEnd(3, "X");
|
|
45641
45705
|
}, "projectKey");
|
|
45642
45706
|
|
|
45643
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
45644
45708
|
var DAY5 = 864e5;
|
|
45645
45709
|
var SETTING4 = "logs_pruned_at";
|
|
45646
45710
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -45667,7 +45731,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
45667
45731
|
};
|
|
45668
45732
|
}, "logPruner");
|
|
45669
45733
|
|
|
45670
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
45671
45735
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
45672
45736
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
45673
45737
|
var invalid6 = /* @__PURE__ */ __name((message2) => {
|
|
@@ -45690,6 +45754,65 @@ var RULES = {
|
|
|
45690
45754
|
anySubject: true,
|
|
45691
45755
|
inboxTasks: true
|
|
45692
45756
|
};
|
|
45757
|
+
var MAIL_FINDING_FIELDS = {
|
|
45758
|
+
task: {
|
|
45759
|
+
needs: ["type", "title", "reason", "commitment"],
|
|
45760
|
+
may: ["project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence", "externalId", "sourceUrl"]
|
|
45761
|
+
},
|
|
45762
|
+
task_update: { needs: ["task", "change", "reason"], may: ["dueAt", "detail"] },
|
|
45763
|
+
fact: { needs: ["type", "statement", "reason"], may: ["subject", "project"] },
|
|
45764
|
+
memory: { needs: ["memoryKind", "scope", "body", "reason"], may: ["subject", "project"] },
|
|
45765
|
+
link: { needs: ["from", "to", "reason"], may: [] },
|
|
45766
|
+
new_contact: { needs: ["address", "name", "reason"], may: [] },
|
|
45767
|
+
invoice: {
|
|
45768
|
+
needs: ["direction", "currency", "lines", "reason"],
|
|
45769
|
+
may: [
|
|
45770
|
+
"counterparty",
|
|
45771
|
+
"counterpartyName",
|
|
45772
|
+
"counterpartyEmail",
|
|
45773
|
+
"total",
|
|
45774
|
+
"number",
|
|
45775
|
+
"issueDate",
|
|
45776
|
+
"dueDate",
|
|
45777
|
+
"project"
|
|
45778
|
+
]
|
|
45779
|
+
},
|
|
45780
|
+
payment: {
|
|
45781
|
+
needs: ["direction", "amount", "currency", "date", "reason"],
|
|
45782
|
+
may: [
|
|
45783
|
+
"payer",
|
|
45784
|
+
"payerName",
|
|
45785
|
+
"payerEmail",
|
|
45786
|
+
"payee",
|
|
45787
|
+
"payeeName",
|
|
45788
|
+
"payeeEmail",
|
|
45789
|
+
"reference",
|
|
45790
|
+
"allocations",
|
|
45791
|
+
"project"
|
|
45792
|
+
]
|
|
45793
|
+
},
|
|
45794
|
+
order: {
|
|
45795
|
+
needs: ["purpose", "supplierName", "reason"],
|
|
45796
|
+
may: [
|
|
45797
|
+
"customer",
|
|
45798
|
+
"customerName",
|
|
45799
|
+
"customerEmail",
|
|
45800
|
+
"supplier",
|
|
45801
|
+
"number",
|
|
45802
|
+
"total",
|
|
45803
|
+
"currency",
|
|
45804
|
+
"status",
|
|
45805
|
+
"orderDate",
|
|
45806
|
+
"fulfilledDate",
|
|
45807
|
+
"invoice",
|
|
45808
|
+
"payment",
|
|
45809
|
+
"project",
|
|
45810
|
+
"sourceUrl"
|
|
45811
|
+
]
|
|
45812
|
+
},
|
|
45813
|
+
order_update: { needs: ["supplierName", "number", "status", "reason"], may: ["date"] }
|
|
45814
|
+
};
|
|
45815
|
+
var MAIL_FINDING_KINDS = Object.keys(MAIL_FINDING_FIELDS);
|
|
45693
45816
|
var typeOf2 = /* @__PURE__ */ __name((reference2) => {
|
|
45694
45817
|
try {
|
|
45695
45818
|
const parsed3 = parseReference(reference2);
|
|
@@ -45718,22 +45841,18 @@ var optional = /* @__PURE__ */ __name((key2, value, read2) => value === void 0 ?
|
|
|
45718
45841
|
var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
45719
45842
|
if (!raw || typeof raw !== "object")
|
|
45720
45843
|
return invalid6("a finding is an object");
|
|
45721
|
-
if (raw.kind
|
|
45722
|
-
return
|
|
45844
|
+
if (!MAIL_FINDING_KINDS.includes(raw.kind))
|
|
45845
|
+
return invalid6(`a mail finding is a ${MAIL_FINDING_KINDS.join(", ")}`);
|
|
45846
|
+
const { needs, may } = MAIL_FINDING_FIELDS[raw.kind];
|
|
45847
|
+
findingFields(raw, ["id", "kind", ...needs, ...may, "evidence"], RULES.singular);
|
|
45848
|
+
findingNeeds(raw, needs, RULES.singular);
|
|
45849
|
+
if (raw.kind === "fact") {
|
|
45850
|
+
const { reason, ...fact } = raw;
|
|
45851
|
+
return { ...validateFinding(fact, RULES, ids), reason: findingText(reason, 2e3) };
|
|
45852
|
+
}
|
|
45723
45853
|
if (raw.kind === "task") {
|
|
45724
45854
|
const { externalId, sourceUrl, ...task } = raw;
|
|
45725
|
-
|
|
45726
|
-
try {
|
|
45727
|
-
checked = validateFinding(task, RULES, ids);
|
|
45728
|
-
} catch (error) {
|
|
45729
|
-
if (!isCliError(error) || error.details.reason !== "finding.unknown-field")
|
|
45730
|
-
throw error;
|
|
45731
|
-
const allowed = [...error.details.allowed, "external_id", "source_url"];
|
|
45732
|
-
throw new CliError("validation_error", error.message.replace(/; it takes .*$/, `; it takes ${allowed.join(", ")}`), {
|
|
45733
|
-
...error.details,
|
|
45734
|
-
allowed
|
|
45735
|
-
});
|
|
45736
|
-
}
|
|
45855
|
+
const checked = validateFinding(task, RULES, ids);
|
|
45737
45856
|
return {
|
|
45738
45857
|
...checked,
|
|
45739
45858
|
...optional("externalId", externalId, (value) => {
|
|
@@ -45768,7 +45887,6 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45768
45887
|
}, "party");
|
|
45769
45888
|
switch (raw.kind) {
|
|
45770
45889
|
case "task_update": {
|
|
45771
|
-
findingFields(raw, ["id", "kind", "task", "change", "dueAt", "detail", "reason", "evidence"], RULES.singular);
|
|
45772
45890
|
const task = reference2(raw.task, /^task:[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/, "a task update's task");
|
|
45773
45891
|
const change = raw.change;
|
|
45774
45892
|
if (change !== "close" && change !== "due" && change !== "detail")
|
|
@@ -45789,7 +45907,6 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45789
45907
|
};
|
|
45790
45908
|
}
|
|
45791
45909
|
case "memory": {
|
|
45792
|
-
findingFields(raw, ["id", "kind", "memoryKind", "scope", "body", "subject", "project", "evidence"], RULES.singular);
|
|
45793
45910
|
if (!MEMORY_KINDS.includes(raw.memoryKind))
|
|
45794
45911
|
return invalid6(`a memory's memory_kind is ${MEMORY_KINDS.join(", ")}`);
|
|
45795
45912
|
if (!MEMORY_SCOPES.includes(raw.scope))
|
|
@@ -45804,11 +45921,11 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45804
45921
|
body: findingText(raw.body, 2e4),
|
|
45805
45922
|
...raw.subject === void 0 ? {} : { subject: reference2(raw.subject, /^(person|organization|project):[1-9]\d*$/, "a memory's subject") },
|
|
45806
45923
|
...raw.project === void 0 ? {} : { project: reference2(raw.project, /^project:[1-9]\d*$/, "a project") },
|
|
45924
|
+
reason: findingText(raw.reason, 2e3),
|
|
45807
45925
|
evidence
|
|
45808
45926
|
};
|
|
45809
45927
|
}
|
|
45810
45928
|
case "link": {
|
|
45811
|
-
findingFields(raw, ["id", "kind", "from", "to", "reason", "evidence"], RULES.singular);
|
|
45812
45929
|
const from2 = findingText(raw.from, 400);
|
|
45813
45930
|
const to = findingText(raw.to, 80);
|
|
45814
45931
|
const wanted = LINKS[typeOf2(from2) ?? ""];
|
|
@@ -45817,7 +45934,6 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45817
45934
|
return { id: id2, kind: "link", from: from2, to, reason: findingText(raw.reason, 2e3), evidence };
|
|
45818
45935
|
}
|
|
45819
45936
|
case "new_contact": {
|
|
45820
|
-
findingFields(raw, ["id", "kind", "address", "name", "reason", "evidence"], RULES.singular);
|
|
45821
45937
|
const address = findingText(raw.address, 320).toLowerCase();
|
|
45822
45938
|
if (!ADDRESS.test(address))
|
|
45823
45939
|
return invalid6("a new contact's address is an email address");
|
|
@@ -45826,28 +45942,11 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45826
45942
|
kind: "new_contact",
|
|
45827
45943
|
address,
|
|
45828
45944
|
name: findingText(raw.name, 200),
|
|
45829
|
-
|
|
45945
|
+
reason: findingText(raw.reason, 2e3),
|
|
45830
45946
|
evidence
|
|
45831
45947
|
};
|
|
45832
45948
|
}
|
|
45833
45949
|
case "invoice": {
|
|
45834
|
-
findingFields(raw, [
|
|
45835
|
-
"id",
|
|
45836
|
-
"kind",
|
|
45837
|
-
"direction",
|
|
45838
|
-
"counterparty",
|
|
45839
|
-
"counterpartyName",
|
|
45840
|
-
"counterpartyEmail",
|
|
45841
|
-
"currency",
|
|
45842
|
-
"lines",
|
|
45843
|
-
"total",
|
|
45844
|
-
"number",
|
|
45845
|
-
"issueDate",
|
|
45846
|
-
"dueDate",
|
|
45847
|
-
"project",
|
|
45848
|
-
"reason",
|
|
45849
|
-
"evidence"
|
|
45850
|
-
], RULES.singular);
|
|
45851
45950
|
if (!Array.isArray(raw.lines) || raw.lines.length < 1 || raw.lines.length > 50)
|
|
45852
45951
|
return invalid6("an invoice finding has 1\u201350 lines");
|
|
45853
45952
|
const lines = raw.lines.map((line) => {
|
|
@@ -45879,25 +45978,6 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45879
45978
|
};
|
|
45880
45979
|
}
|
|
45881
45980
|
case "payment": {
|
|
45882
|
-
findingFields(raw, [
|
|
45883
|
-
"id",
|
|
45884
|
-
"kind",
|
|
45885
|
-
"direction",
|
|
45886
|
-
"payer",
|
|
45887
|
-
"payerName",
|
|
45888
|
-
"payerEmail",
|
|
45889
|
-
"payee",
|
|
45890
|
-
"payeeName",
|
|
45891
|
-
"payeeEmail",
|
|
45892
|
-
"amount",
|
|
45893
|
-
"currency",
|
|
45894
|
-
"date",
|
|
45895
|
-
"reference",
|
|
45896
|
-
"allocations",
|
|
45897
|
-
"project",
|
|
45898
|
-
"reason",
|
|
45899
|
-
"evidence"
|
|
45900
|
-
], RULES.singular);
|
|
45901
45981
|
let allocations;
|
|
45902
45982
|
if (raw.allocations !== void 0) {
|
|
45903
45983
|
if (!Array.isArray(raw.allocations) || raw.allocations.length < 1 || raw.allocations.length > 8)
|
|
@@ -45930,28 +46010,6 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45930
46010
|
};
|
|
45931
46011
|
}
|
|
45932
46012
|
case "order": {
|
|
45933
|
-
findingFields(raw, [
|
|
45934
|
-
"id",
|
|
45935
|
-
"kind",
|
|
45936
|
-
"purpose",
|
|
45937
|
-
"customer",
|
|
45938
|
-
"customerName",
|
|
45939
|
-
"customerEmail",
|
|
45940
|
-
"supplier",
|
|
45941
|
-
"supplierName",
|
|
45942
|
-
"number",
|
|
45943
|
-
"total",
|
|
45944
|
-
"currency",
|
|
45945
|
-
"status",
|
|
45946
|
-
"orderDate",
|
|
45947
|
-
"fulfilledDate",
|
|
45948
|
-
"invoice",
|
|
45949
|
-
"payment",
|
|
45950
|
-
"project",
|
|
45951
|
-
"sourceUrl",
|
|
45952
|
-
"reason",
|
|
45953
|
-
"evidence"
|
|
45954
|
-
], RULES.singular);
|
|
45955
46013
|
return {
|
|
45956
46014
|
id: id2,
|
|
45957
46015
|
kind: "order",
|
|
@@ -45974,7 +46032,6 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45974
46032
|
};
|
|
45975
46033
|
}
|
|
45976
46034
|
case "order_update": {
|
|
45977
|
-
findingFields(raw, ["id", "kind", "supplierName", "number", "status", "date", "reason", "evidence"], RULES.singular);
|
|
45978
46035
|
const status = oneOf7(raw.status, ORDER_STATUSES, "an order update's status");
|
|
45979
46036
|
if (raw.date !== void 0 && status !== "delivered")
|
|
45980
46037
|
return invalid6("only a delivered order update gives date");
|
|
@@ -45990,7 +46047,7 @@ var one = /* @__PURE__ */ __name((raw, ids) => {
|
|
|
45990
46047
|
};
|
|
45991
46048
|
}
|
|
45992
46049
|
default:
|
|
45993
|
-
return invalid6(
|
|
46050
|
+
return invalid6(`a mail finding is a ${MAIL_FINDING_KINDS.join(", ")}`);
|
|
45994
46051
|
}
|
|
45995
46052
|
}, "one");
|
|
45996
46053
|
var KEY2 = /^[a-z0-9][a-z0-9-]{0,39}:[1-9]\d*(-r[1-9]\d*)?$/;
|
|
@@ -46033,7 +46090,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
46033
46090
|
}, "checkMailFindings");
|
|
46034
46091
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
46035
46092
|
|
|
46036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46093
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
46037
46094
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
46038
46095
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
46039
46096
|
var WEIGHTS = {
|
|
@@ -46166,7 +46223,7 @@ var scoreGroup = /* @__PURE__ */ __name((items, context) => {
|
|
|
46166
46223
|
return { score: kept.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept };
|
|
46167
46224
|
}, "scoreGroup");
|
|
46168
46225
|
|
|
46169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
46170
46227
|
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";
|
|
46171
46228
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
46172
46229
|
const { database, now: now2 } = context;
|
|
@@ -46266,7 +46323,7 @@ var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46266
46323
|
}, "add"),
|
|
46267
46324
|
get: /* @__PURE__ */ __name((reference2) => orderOf(rowOf2(reference2)), "get"),
|
|
46268
46325
|
list: /* @__PURE__ */ __name((filter = {}) => {
|
|
46269
|
-
const
|
|
46326
|
+
const project2 = filter.project === void 0 ? null : projectId(database, filter.project);
|
|
46270
46327
|
const customer = partyThing(filter.customer, "the customer");
|
|
46271
46328
|
const by = proposedBySql("o.author_type", "o.author_id", filter.proposedBy);
|
|
46272
46329
|
const status = filter.status === void 0 ? null : statusOf(filter.status);
|
|
@@ -46275,7 +46332,7 @@ var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46275
46332
|
const number3 = filter.number === void 0 ? null : filter.number.trim();
|
|
46276
46333
|
const shop = filter.supplierName === void 0 ? null : fold(filter.supplierName);
|
|
46277
46334
|
const limit = Math.min(Math.max(filter.limit ?? 100, 1), 500);
|
|
46278
|
-
const rows = database.prepare(`${ORDERS} WHERE o.deleted_at IS NULL AND (? IS NULL OR o.status = ?) AND (? IS NULL OR o.purpose = ?) AND (? IS NULL OR o.review = ?) AND (? IS NULL OR o.project_id = ?) AND (? IS NULL OR o.number = ?) AND (? IS NULL OR (o.customer_type = ? AND o.customer_id = ?)) AND ${by.sql} ORDER BY o.created_at DESC, o.id DESC`).all(status, status, purpose, purpose, review, review,
|
|
46335
|
+
const rows = database.prepare(`${ORDERS} WHERE o.deleted_at IS NULL AND (? IS NULL OR o.status = ?) AND (? IS NULL OR o.purpose = ?) AND (? IS NULL OR o.review = ?) AND (? IS NULL OR o.project_id = ?) AND (? IS NULL OR o.number = ?) AND (? IS NULL OR (o.customer_type = ? AND o.customer_id = ?)) AND ${by.sql} ORDER BY o.created_at DESC, o.id DESC`).all(status, status, purpose, purpose, review, review, project2, project2, number3, number3, customer?.type ?? null, customer?.type ?? null, customer?.id ?? null, ...by.params);
|
|
46279
46336
|
return rows.filter((row2) => shop === null || fold(String(row2.supplier_name)) === shop).slice(0, limit).map(orderOf);
|
|
46280
46337
|
}, "list"),
|
|
46281
46338
|
setStatus: /* @__PURE__ */ __name((reference2, { status, date: date3, by }) => {
|
|
@@ -46318,7 +46375,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46318
46375
|
};
|
|
46319
46376
|
}, "ordersStoreOver");
|
|
46320
46377
|
|
|
46321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
46322
46379
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
46323
46380
|
throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
|
|
46324
46381
|
reason: "mail-findings.stale"
|
|
@@ -46579,8 +46636,8 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46579
46636
|
case "fact":
|
|
46580
46637
|
return core.create(finding, agent, "owner");
|
|
46581
46638
|
case "task": {
|
|
46582
|
-
const
|
|
46583
|
-
return core.create({ ...finding, project }, agent, "owner");
|
|
46639
|
+
const project2 = finding.project ?? `project:${inboxProject(context, `email:${account.account}`, true)}`;
|
|
46640
|
+
return core.create({ ...finding, project: project2 }, agent, "owner");
|
|
46584
46641
|
}
|
|
46585
46642
|
case "task_update": {
|
|
46586
46643
|
if (finding.change === "close")
|
|
@@ -46775,7 +46832,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
46775
46832
|
};
|
|
46776
46833
|
}, "mailFindingsStoreOver");
|
|
46777
46834
|
|
|
46778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
46779
46836
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
46780
46837
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
46781
46838
|
reason: "meeting-findings.stale"
|
|
@@ -46943,7 +47000,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46943
47000
|
};
|
|
46944
47001
|
}, "meetingFindingsStoreOver");
|
|
46945
47002
|
|
|
46946
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
46947
47004
|
var RANK_BATCH = 512;
|
|
46948
47005
|
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";
|
|
46949
47006
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -47214,7 +47271,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
47214
47271
|
}
|
|
47215
47272
|
}), "meetingVectorsOver");
|
|
47216
47273
|
|
|
47217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
47218
47275
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
47219
47276
|
var TEXTS = {
|
|
47220
47277
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -47315,11 +47372,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47315
47372
|
};
|
|
47316
47373
|
}, "sourceMentionStoreOver");
|
|
47317
47374
|
|
|
47318
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
47319
47376
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
47320
47377
|
import { dirname } from "node:path";
|
|
47321
47378
|
|
|
47322
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47379
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
47323
47380
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
47324
47381
|
var CLIENTS_SETTING = "clients";
|
|
47325
47382
|
var coreVersion = (() => {
|
|
@@ -47377,7 +47434,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
47377
47434
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
47378
47435
|
}, "refusalAdvice");
|
|
47379
47436
|
|
|
47380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47437
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
47381
47438
|
var GENERATED = [
|
|
47382
47439
|
{
|
|
47383
47440
|
"name": "20261010184427_initial",
|
|
@@ -48380,7 +48437,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
48380
48437
|
}
|
|
48381
48438
|
];
|
|
48382
48439
|
|
|
48383
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48440
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
48384
48441
|
var MANIFEST = [
|
|
48385
48442
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
48386
48443
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -48472,7 +48529,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
48472
48529
|
return migrations;
|
|
48473
48530
|
}, "generatedMigrations");
|
|
48474
48531
|
|
|
48475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48532
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
48476
48533
|
var MIGRATIONS = generatedMigrations();
|
|
48477
48534
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
48478
48535
|
version INTEGER PRIMARY KEY,
|
|
@@ -48525,7 +48582,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
48525
48582
|
}
|
|
48526
48583
|
}, "migrate");
|
|
48527
48584
|
|
|
48528
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
48529
48586
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
48530
48587
|
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 ?");
|
|
48531
48588
|
if (pending.get(0, 1) === void 0)
|
|
@@ -48547,7 +48604,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
48547
48604
|
}
|
|
48548
48605
|
}, "fillJoinKeys");
|
|
48549
48606
|
|
|
48550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
48551
48608
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
48552
48609
|
refuseOwnerStoreInTests(path);
|
|
48553
48610
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -48561,8 +48618,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
48561
48618
|
}, "openSqlite");
|
|
48562
48619
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
48563
48620
|
quietSqliteWarning();
|
|
48564
|
-
const { drizzle } = await import("./node-
|
|
48565
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
48621
|
+
const { drizzle } = await import("./node-H7LWGE5H.js");
|
|
48622
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-N4POELFM.js");
|
|
48566
48623
|
const client = await nodeClient(path, { readOnly });
|
|
48567
48624
|
try {
|
|
48568
48625
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -48572,8 +48629,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
48572
48629
|
}
|
|
48573
48630
|
}, "openUnderNode");
|
|
48574
48631
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
48575
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
48576
|
-
const { drizzle } = await import("./bun-
|
|
48632
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-HORFVNNY.js");
|
|
48633
|
+
const { drizzle } = await import("./bun-NWKIEX53.js");
|
|
48577
48634
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
48578
48635
|
try {
|
|
48579
48636
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -48583,7 +48640,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
48583
48640
|
}
|
|
48584
48641
|
}, "openUnderBun");
|
|
48585
48642
|
|
|
48586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
48587
48644
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
48588
48645
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
48589
48646
|
try {
|
|
@@ -48651,7 +48708,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
48651
48708
|
});
|
|
48652
48709
|
}, "movePaymentFacts");
|
|
48653
48710
|
|
|
48654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
48655
48712
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
48656
48713
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
48657
48714
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -48666,7 +48723,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
48666
48723
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
48667
48724
|
}, "assertReadCompatible");
|
|
48668
48725
|
|
|
48669
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48726
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
48670
48727
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
48671
48728
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
48672
48729
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -48712,7 +48769,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
48712
48769
|
});
|
|
48713
48770
|
}, "moveSuggestedLinks");
|
|
48714
48771
|
|
|
48715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
48716
48773
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
48717
48774
|
var TEST_PROVIDER = "chat";
|
|
48718
48775
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -48733,7 +48790,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
48733
48790
|
}
|
|
48734
48791
|
}, "purgeTestAccounts");
|
|
48735
48792
|
|
|
48736
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
48737
48794
|
var BACKFILL_ON_OPEN = 5e3;
|
|
48738
48795
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
48739
48796
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -48798,10 +48855,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
48798
48855
|
}
|
|
48799
48856
|
}, "openStoreContext");
|
|
48800
48857
|
|
|
48801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48858
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
48802
48859
|
import { createHash as createHash16 } from "node:crypto";
|
|
48803
48860
|
|
|
48804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
48805
48862
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
48806
48863
|
var ref = text4(2048);
|
|
48807
48864
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -48867,7 +48924,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
48867
48924
|
}))
|
|
48868
48925
|
});
|
|
48869
48926
|
|
|
48870
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48927
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
48871
48928
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
48872
48929
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
48873
48930
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -48971,7 +49028,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
48971
49028
|
invalid9("external.unused");
|
|
48972
49029
|
}, "validateProjectAnnotationsGraph");
|
|
48973
49030
|
|
|
48974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
48975
49032
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
48976
49033
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
48977
49034
|
var targetSchema = strictObject({
|
|
@@ -49077,7 +49134,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
49077
49134
|
};
|
|
49078
49135
|
}, "planBoundProjectAnnotations");
|
|
49079
49136
|
|
|
49080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
49081
49138
|
import { createHash as createHash17 } from "node:crypto";
|
|
49082
49139
|
var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
49083
49140
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -49171,7 +49228,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
49171
49228
|
})).digest("hex");
|
|
49172
49229
|
}, "projectAnnotationSnapshotFingerprint");
|
|
49173
49230
|
|
|
49174
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49231
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
49175
49232
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
49176
49233
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
49177
49234
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -49188,7 +49245,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
49188
49245
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
49189
49246
|
}, "projectAnnotationRequest");
|
|
49190
49247
|
|
|
49191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
49192
49249
|
var SnapshotBudget = class {
|
|
49193
49250
|
static {
|
|
49194
49251
|
__name(this, "SnapshotBudget");
|
|
@@ -49214,13 +49271,13 @@ var SnapshotBudget = class {
|
|
|
49214
49271
|
}
|
|
49215
49272
|
};
|
|
49216
49273
|
|
|
49217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
49218
49275
|
import { createHash as createHash19 } from "node:crypto";
|
|
49219
49276
|
|
|
49220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
49221
49278
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
49222
49279
|
|
|
49223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
49224
49281
|
import { createHash as createHash18 } from "node:crypto";
|
|
49225
49282
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
49226
49283
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -49363,7 +49420,7 @@ var ProjectSnapshotSources = class {
|
|
|
49363
49420
|
}
|
|
49364
49421
|
};
|
|
49365
49422
|
|
|
49366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
49367
49424
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
49368
49425
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
49369
49426
|
}, "unsupported");
|
|
@@ -49402,7 +49459,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
49402
49459
|
throw new CliError("not_found", "the source project does not exist");
|
|
49403
49460
|
if (descriptor.account_id !== null || descriptor.deleted_at !== null)
|
|
49404
49461
|
return unsupported();
|
|
49405
|
-
const
|
|
49462
|
+
const project2 = rows("FROM projects WHERE id=?", [
|
|
49406
49463
|
"id",
|
|
49407
49464
|
"key",
|
|
49408
49465
|
"name",
|
|
@@ -49416,7 +49473,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
49416
49473
|
"created_at",
|
|
49417
49474
|
"updated_at"
|
|
49418
49475
|
], [projectId2])[0];
|
|
49419
|
-
if (!
|
|
49476
|
+
if (!project2)
|
|
49420
49477
|
throw new CliError("not_found", "the source project does not exist");
|
|
49421
49478
|
const aliases2 = rows("FROM aliases WHERE aliasable_type='project' AND aliasable_id=? ORDER BY id", ["name", "source", "display", "account_id", "created_at", "updated_at"], [projectId2]);
|
|
49422
49479
|
if (aliases2.some((alias2) => alias2.account_id !== null))
|
|
@@ -49467,16 +49524,16 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
49467
49524
|
version: 2,
|
|
49468
49525
|
project: {
|
|
49469
49526
|
ref: projectRef,
|
|
49470
|
-
key:
|
|
49471
|
-
name:
|
|
49472
|
-
type:
|
|
49473
|
-
scope:
|
|
49474
|
-
organization:
|
|
49475
|
-
created_at:
|
|
49476
|
-
description:
|
|
49477
|
-
status:
|
|
49478
|
-
owner: sources.ref(
|
|
49479
|
-
updated_at:
|
|
49527
|
+
key: project2.key,
|
|
49528
|
+
name: project2.name,
|
|
49529
|
+
type: project2.type,
|
|
49530
|
+
scope: project2.scope,
|
|
49531
|
+
organization: project2.organization_id === null ? null : sources.ref("organization", project2.organization_id),
|
|
49532
|
+
created_at: project2.created_at,
|
|
49533
|
+
description: project2.description,
|
|
49534
|
+
status: project2.status,
|
|
49535
|
+
owner: sources.ref(project2.owner_type, project2.owner_id),
|
|
49536
|
+
updated_at: project2.updated_at,
|
|
49480
49537
|
account_scope: "owner"
|
|
49481
49538
|
},
|
|
49482
49539
|
coverage: {
|
|
@@ -49534,7 +49591,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
49534
49591
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
49535
49592
|
}), "projectAnnotationSnapshot");
|
|
49536
49593
|
|
|
49537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
49538
49595
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
49539
49596
|
const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
49540
49597
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -49556,20 +49613,20 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
49556
49613
|
const aliases2 = database.prepare(`SELECT ${aliasFields.join(",")} ${aliasFrom} LIMIT 1001`).all();
|
|
49557
49614
|
const names = new Set([manifest.project.key, manifest.project.name, ...manifest.aliases.map((a) => a.name)].map(normalizeVocabularyName));
|
|
49558
49615
|
const namespace = /* @__PURE__ */ new Set();
|
|
49559
|
-
for (const
|
|
49560
|
-
if (
|
|
49616
|
+
for (const project2 of projects2) {
|
|
49617
|
+
if (project2.id === projectId2)
|
|
49561
49618
|
continue;
|
|
49562
|
-
const keyMatches = names.has(normalizeVocabularyName(String(
|
|
49563
|
-
const nameMatches =
|
|
49619
|
+
const keyMatches = names.has(normalizeVocabularyName(String(project2.key)));
|
|
49620
|
+
const nameMatches = project2.account_id === null && project2.deleted_at === null && names.has(normalizeVocabularyName(String(project2.name)));
|
|
49564
49621
|
if (keyMatches || nameMatches)
|
|
49565
|
-
namespace.add(`project:${
|
|
49622
|
+
namespace.add(`project:${project2.id}`);
|
|
49566
49623
|
}
|
|
49567
49624
|
for (const alias2 of aliases2) {
|
|
49568
49625
|
if (alias2.aliasable_id === projectId2 || alias2.account_id !== null)
|
|
49569
49626
|
continue;
|
|
49570
|
-
const
|
|
49571
|
-
if (
|
|
49572
|
-
namespace.add(`project:${
|
|
49627
|
+
const project2 = projects2.find((p) => p.id === alias2.aliasable_id && p.account_id === null && p.deleted_at === null);
|
|
49628
|
+
if (project2 && names.has(normalizeVocabularyName(String(alias2.name))))
|
|
49629
|
+
namespace.add(`project:${project2.id}`);
|
|
49573
49630
|
}
|
|
49574
49631
|
const descriptor_conflicts = ["key", "name"].filter((field4) => current.project[field4] !== manifest.project[field4]);
|
|
49575
49632
|
const target = {
|
|
@@ -49596,7 +49653,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
49596
49653
|
};
|
|
49597
49654
|
}), "previewAnnotationSnapshot");
|
|
49598
49655
|
|
|
49599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
49600
49657
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
|
|
49601
49658
|
const mappings = { ...bindings };
|
|
49602
49659
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -49607,8 +49664,8 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
49607
49664
|
throw new CliError("validation_error", "project annotation binding became unavailable");
|
|
49608
49665
|
return thing;
|
|
49609
49666
|
}, "resolve");
|
|
49610
|
-
const
|
|
49611
|
-
database.prepare("UPDATE projects SET description=?,type=?,scope=?,organization_id=?,owner_type=?,owner_id=?,status=?,created_at=?,updated_at=? WHERE id=?").run(snapshot2.project.description, snapshot2.project.type, snapshot2.project.scope,
|
|
49667
|
+
const organization2 = resolve(snapshot2.project.organization), owner = resolve(snapshot2.project.owner);
|
|
49668
|
+
database.prepare("UPDATE projects SET description=?,type=?,scope=?,organization_id=?,owner_type=?,owner_id=?,status=?,created_at=?,updated_at=? WHERE id=?").run(snapshot2.project.description, snapshot2.project.type, snapshot2.project.scope, organization2?.id ?? null, owner?.type ?? null, owner?.id ?? null, snapshot2.project.status, snapshot2.project.created_at, snapshot2.project.updated_at, projectId2);
|
|
49612
49669
|
for (const alias2 of snapshot2.aliases)
|
|
49613
49670
|
database.prepare("INSERT INTO aliases(aliasable_type,aliasable_id,account_id,name,name_folded,display,source,created_at,updated_at) VALUES('project',?,NULL,?,?,?,?,?,?)").run(projectId2, alias2.name, fold(alias2.name), Number(alias2.display), alias2.source, alias2.created_at, alias2.updated_at);
|
|
49614
49671
|
for (const fact of snapshot2.facts) {
|
|
@@ -49638,7 +49695,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
49638
49695
|
return mappings;
|
|
49639
49696
|
}, "restoreAnnotationRecords");
|
|
49640
49697
|
|
|
49641
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
49642
49699
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
49643
49700
|
async preview(request) {
|
|
49644
49701
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -49668,7 +49725,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
49668
49725
|
}
|
|
49669
49726
|
}), "projectAnnotationStoreOver");
|
|
49670
49727
|
|
|
49671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49728
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
49672
49729
|
import { createHash as createHash20 } from "node:crypto";
|
|
49673
49730
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
49674
49731
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -49900,7 +49957,7 @@ var envelopeOfJsonl = /* @__PURE__ */ __name((text6) => {
|
|
|
49900
49957
|
return isObject2(header) ? { ...header, records: records2 } : header;
|
|
49901
49958
|
}, "envelopeOfJsonl");
|
|
49902
49959
|
|
|
49903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49960
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
49904
49961
|
var PROJECTED = {
|
|
49905
49962
|
invoice: { roles: ["issuer", "counterparty", "project"], many: [] },
|
|
49906
49963
|
payment: { roles: ["payer", "payee", "project", "settles"], many: ["settles"] }
|
|
@@ -50005,7 +50062,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50005
50062
|
refusal(`a record has one ${role}`, "record.relation-ambiguous");
|
|
50006
50063
|
return { related, shares, missing: [...missing4] };
|
|
50007
50064
|
}, "relatedOf");
|
|
50008
|
-
const
|
|
50065
|
+
const project2 = /* @__PURE__ */ __name((row2, source2) => {
|
|
50009
50066
|
const type = row2.type;
|
|
50010
50067
|
const { related, shares, missing: missing4 } = relatedOf(Number(row2.id), type);
|
|
50011
50068
|
if (missing4.length > 0)
|
|
@@ -50089,7 +50146,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50089
50146
|
const rows = sql2("SELECT DISTINCT r.* FROM record_relations rr JOIN records r ON r.id = rr.record_id WHERE rr.target_id = ? AND r.entity_id IS NULL AND r.deleted_at IS NULL AND r.type IN ('invoice', 'payment')").all(queue.shift());
|
|
50090
50147
|
for (const row2 of rows) {
|
|
50091
50148
|
try {
|
|
50092
|
-
const done = write(database, () =>
|
|
50149
|
+
const done = write(database, () => project2(row2, source2));
|
|
50093
50150
|
if (done.proposed) {
|
|
50094
50151
|
proposed.push(done.proposed);
|
|
50095
50152
|
queue.push(Number(row2.id));
|
|
@@ -50154,7 +50211,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50154
50211
|
let projected = false;
|
|
50155
50212
|
let flagged = stored3?.entity_id != null && stored3.projected_fingerprint !== fingerprint2;
|
|
50156
50213
|
if (isProjected(record4.type) && stored3?.entity_id == null) {
|
|
50157
|
-
const done =
|
|
50214
|
+
const done = project2({ id: id2, type: record4.type, fields: fields4, account_id: accountId }, source2);
|
|
50158
50215
|
if (done.proposed)
|
|
50159
50216
|
proposed.push(done.proposed);
|
|
50160
50217
|
projected = done.proposed !== void 0;
|
|
@@ -50313,7 +50370,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50313
50370
|
};
|
|
50314
50371
|
}, "recordStoreOver");
|
|
50315
50372
|
|
|
50316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
50317
50374
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
50318
50375
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
50319
50376
|
let merged = { from: from2, to };
|
|
@@ -50326,7 +50383,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
50326
50383
|
}, "markRange");
|
|
50327
50384
|
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");
|
|
50328
50385
|
|
|
50329
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
50330
50387
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
50331
50388
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
50332
50389
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -50347,7 +50404,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
50347
50404
|
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);
|
|
50348
50405
|
}, "setTaskAnalysisMark");
|
|
50349
50406
|
|
|
50350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
50351
50408
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
50352
50409
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
50353
50410
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -50357,7 +50414,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
50357
50414
|
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);
|
|
50358
50415
|
}, "setTaskRulesStop");
|
|
50359
50416
|
|
|
50360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50417
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
50361
50418
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
50362
50419
|
const { database } = context;
|
|
50363
50420
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -50416,7 +50473,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50416
50473
|
};
|
|
50417
50474
|
}, "syncStoreOver");
|
|
50418
50475
|
|
|
50419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50476
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
50420
50477
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
50421
50478
|
const { database } = context;
|
|
50422
50479
|
return {
|
|
@@ -50438,7 +50495,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50438
50495
|
};
|
|
50439
50496
|
}, "tagsStoreOver");
|
|
50440
50497
|
|
|
50441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50498
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
50442
50499
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
50443
50500
|
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
|
|
50444
50501
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -50565,7 +50622,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
50565
50622
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
50566
50623
|
}, "savePictureChunks");
|
|
50567
50624
|
|
|
50568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
50569
50626
|
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,
|
|
50570
50627
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
50571
50628
|
FROM messages m
|
|
@@ -50654,7 +50711,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
50654
50711
|
return plain2(best(found2));
|
|
50655
50712
|
}, "nearestMessages");
|
|
50656
50713
|
|
|
50657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
50658
50715
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
50659
50716
|
const { database } = context;
|
|
50660
50717
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -50912,7 +50969,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
50912
50969
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
50913
50970
|
}), "vectorsStoreOver");
|
|
50914
50971
|
|
|
50915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50972
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
50916
50973
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
50917
50974
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
50918
50975
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -51000,10 +51057,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
51000
51057
|
}
|
|
51001
51058
|
}, "lastBackup");
|
|
51002
51059
|
|
|
51003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51060
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
51004
51061
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
51005
51062
|
|
|
51006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
51007
51064
|
var COUNTED_TABLES = [
|
|
51008
51065
|
"accounts",
|
|
51009
51066
|
"chats",
|
|
@@ -51088,7 +51145,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
51088
51145
|
};
|
|
51089
51146
|
}, "storeContents");
|
|
51090
51147
|
|
|
51091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.583.0_@wirecat+cli-base@0.78.0_commander@15.0.0_esbuild@0.28.2_type_8615f98b0983d1fbb51a11cdebd6e805/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
51092
51149
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
51093
51150
|
const context = await openStoreContext(options);
|
|
51094
51151
|
try {
|
|
@@ -51434,6 +51491,9 @@ export {
|
|
|
51434
51491
|
proposerOfAction,
|
|
51435
51492
|
assertGenericAction,
|
|
51436
51493
|
involvementStoreOver,
|
|
51494
|
+
ORGANIZATIONS_QUERY,
|
|
51495
|
+
PROJECTS_QUERY,
|
|
51496
|
+
REMINDERS_QUERY,
|
|
51437
51497
|
ORGANIZATION_KINDS,
|
|
51438
51498
|
PROJECT_TYPES,
|
|
51439
51499
|
SCOPES,
|