@wirecat/mail-cli 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/bin/mail.js +6 -2
- package/dist/bundle/{all-profiles-OJPRIFKU.js → all-profiles-EEOMFTKE.js} +9 -9
- package/dist/bundle/{anthropic-3AXHD4WH.js → anthropic-FPSVNB3F.js} +6 -6
- package/dist/bundle/{app-server-V4KHCUGE.js → app-server-3T6UVR7B.js} +47 -45
- package/dist/bundle/{bun-ISYNUTQJ.js → bun-MSNAKMDK.js} +2 -2
- package/dist/bundle/{bun-sqlite-FH3D4AXL.js → bun-sqlite-GIBBI5DV.js} +5 -5
- package/dist/bundle/{chunk-TTKNBUMT.js → chunk-2Y3RKROM.js} +13 -3
- package/dist/bundle/{chunk-UDJIC6YL.js → chunk-3BC2XSNX.js} +33 -28
- package/dist/bundle/{chunk-OHC4GVWV.js → chunk-3CBK26T2.js} +2 -2
- package/dist/bundle/{chunk-QB54TE52.js → chunk-3QEYHTCQ.js} +1 -1
- package/dist/bundle/{chunk-T3AGR4TI.js → chunk-5XTJUQZ5.js} +667 -160
- package/dist/bundle/{chunk-IG2WXKIT.js → chunk-6KDFUPBT.js} +8 -8
- package/dist/bundle/{chunk-GUFWLTOW.js → chunk-6O6CM2ML.js} +2 -2
- package/dist/bundle/{chunk-MDIRW3AT.js → chunk-72CGQMAZ.js} +2 -2
- package/dist/bundle/{chunk-FYMQPAE5.js → chunk-7CSK47S2.js} +4 -4
- package/dist/bundle/{chunk-IWHXM2S7.js → chunk-7D7AKYQ2.js} +625 -298
- package/dist/bundle/{chunk-XTIQFMZH.js → chunk-7FCPLSSM.js} +4 -4
- package/dist/bundle/{chunk-V6K2GX2Y.js → chunk-7L26RKOS.js} +17 -17
- package/dist/bundle/{chunk-G2WDY5XB.js → chunk-AXWTELO4.js} +2 -2
- package/dist/bundle/{chunk-N6P55LDU.js → chunk-BZBNBPCR.js} +10 -10
- package/dist/bundle/{chunk-4DPICEPQ.js → chunk-CCHHEMPM.js} +2 -2
- package/dist/bundle/{chunk-F3QDSQ7V.js → chunk-CJPEL2N5.js} +27 -26
- package/dist/bundle/{chunk-AO32MFDY.js → chunk-CSJYZEFR.js} +2 -2
- package/dist/bundle/{chunk-6UT3MXOB.js → chunk-EFA7FRFJ.js} +3 -3
- package/dist/bundle/{chunk-JIIEJLAX.js → chunk-EW3XTUPB.js} +4 -4
- package/dist/bundle/{chunk-SW5NVASW.js → chunk-FVZST7ZH.js} +9 -9
- package/dist/bundle/{chunk-X37KLD23.js → chunk-GIZILLRJ.js} +12 -12
- package/dist/bundle/{chunk-GFCNSU3B.js → chunk-GQGJV53E.js} +176 -47
- package/dist/bundle/{chunk-KJP2B65C.js → chunk-H3XWM2VA.js} +29 -28
- package/dist/bundle/{chunk-VEXXVLBM.js → chunk-H5XCD6OG.js} +3 -3
- package/dist/bundle/{chunk-L3PVAY3M.js → chunk-H6Y2A4JA.js} +2 -2
- package/dist/bundle/{chunk-K2F7YMMM.js → chunk-HANGU5HI.js} +8 -13
- package/dist/bundle/{chunk-HVVLSCFB.js → chunk-IGSHWMWC.js} +1 -1
- package/dist/bundle/{chunk-JNUKTAMZ.js → chunk-ILHTNOIV.js} +1 -1
- package/dist/bundle/{chunk-6LNRNQHJ.js → chunk-JBLZ5XQG.js} +6 -4
- package/dist/bundle/{chunk-IXYKM7OJ.js → chunk-JYZCISN7.js} +13 -13
- package/dist/bundle/{chunk-44LVUMS2.js → chunk-LO66SLGD.js} +1 -1
- package/dist/bundle/{chunk-NSDOYHIS.js → chunk-M7JREJFC.js} +8 -8
- package/dist/bundle/{chunk-2TTCKOQ7.js → chunk-MBWVZINS.js} +2 -2
- package/dist/bundle/{chunk-LXHLQ6RK.js → chunk-NHVOJHHD.js} +7 -9
- package/dist/bundle/{chunk-QPQSMJBW.js → chunk-OHDDGTCH.js} +10 -10
- package/dist/bundle/{chunk-GYNHU56E.js → chunk-OHFSAYZG.js} +4 -4
- package/dist/bundle/{chunk-TZGQPTZ2.js → chunk-PQLBPYJR.js} +1 -1
- package/dist/bundle/{chunk-PLPSFJO6.js → chunk-SOCALLW5.js} +6 -6
- package/dist/bundle/{chunk-LIQ5LICB.js → chunk-TBG3FRS6.js} +3 -3
- package/dist/bundle/{chunk-AJ4JS2ZR.js → chunk-UFWCJUGA.js} +8 -7
- package/dist/bundle/{chunk-4D52FA34.js → chunk-UGXTDYUY.js} +1 -1
- package/dist/bundle/{chunk-YDUES6ET.js → chunk-URC4ATBD.js} +4 -4
- package/dist/bundle/{chunk-SYBMOE6F.js → chunk-UUBAWUUI.js} +5526 -4503
- package/dist/bundle/chunk-V25TCQ3Z.js +34 -0
- package/dist/bundle/{chunk-PSXAC6OO.js → chunk-VD5UJUNR.js} +1 -1
- package/dist/bundle/{chunk-KVN4RY7E.js → chunk-VMLGER4M.js} +311 -139
- package/dist/bundle/{chunk-6QNPJSRM.js → chunk-VNBQHV5H.js} +6 -6
- package/dist/bundle/{chunk-YRZ23RCS.js → chunk-VNXCWZDW.js} +7 -7
- package/dist/bundle/{chunk-DN54W657.js → chunk-VSHQITKC.js} +4 -4
- package/dist/bundle/{chunk-4GPPRLIG.js → chunk-WBI7J5B7.js} +5 -5
- package/dist/bundle/{chunk-NBQQ2ZTF.js → chunk-XLCFCOT4.js} +14 -14
- package/dist/bundle/{chunk-WL7CYT7O.js → chunk-XPBRNJ2V.js} +1 -1
- package/dist/bundle/{chunk-S64N24ON.js → chunk-XV66LQXV.js} +3 -3
- package/dist/bundle/{chunk-JAWJZTFL.js → chunk-Y2O3DACO.js} +18 -18
- package/dist/bundle/{chunk-BYQ3Z6UL.js → chunk-YHSXNUFQ.js} +3 -3
- package/dist/bundle/{chunk-GAIVTJ3E.js → chunk-YMNF4QLY.js} +24 -23
- package/dist/bundle/{chunk-35Y3INBK.js → chunk-ZSS22YHM.js} +2 -2
- package/dist/bundle/{chunk-5TACUBRJ.js → chunk-ZXLJ5EKZ.js} +8 -8
- package/dist/bundle/command-contract-6QSZ5QHQ.js +33 -0
- package/dist/bundle/{decode-FM4C2WWG.js → decode-YRTMNHC6.js} +5 -5
- package/dist/bundle/{dispatch-K3HG4RYT.js → dispatch-BCS2RDF4.js} +8 -8
- package/dist/bundle/{dist-7LNVI7VB.js → dist-NOBSXRL2.js} +13 -13
- package/dist/bundle/{echarts-5C2A72XM.js → echarts-5UKZVIF6.js} +2 -2
- package/dist/bundle/{embed-N56P6YVY.js → embed-G62XY6BJ.js} +6 -6
- package/dist/bundle/{embedder-QLYKFLOL.js → embedder-SCHGLA74.js} +9 -9
- package/dist/bundle/{failure-5ZLVZTRU.js → failure-N5S6ZS62.js} +2 -2
- package/dist/bundle/{first-run-VMF4PJ7Q.js → first-run-DPF2BBQN.js} +11 -11
- package/dist/bundle/first-screen-4MRKF6RQ.js +31 -0
- package/dist/bundle/{instructions-QA5FHDOJ.js → instructions-7RP5OKLE.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-LO2XDBBC.js → mcp-MNI62HHE.js} +2 -2
- package/dist/bundle/{node-OXJZWUYZ.js → node-ENCKD6SS.js} +2 -2
- package/dist/bundle/{node-sqlite-7GCEI67B.js → node-sqlite-4ICXMPYY.js} +11 -5
- package/dist/bundle/{oauth-VTPIYBTP.js → oauth-CX2WYMGN.js} +7 -7
- package/dist/bundle/{open-7XX3YF2X.js → open-HQZYHMVE.js} +5 -4
- package/dist/bundle/{openai-D3KRCXSY.js → openai-3ONJIA3F.js} +14 -14
- package/dist/bundle/{process-KFI7SXQD.js → process-OK3HRPMD.js} +1 -1
- package/dist/bundle/{program-4B25STRN.js → program-FLKUE6LL.js} +2125 -866
- package/dist/bundle/{prompt-TBZT3APW.js → prompt-ZWKUQ42Y.js} +5 -5
- package/dist/bundle/{recognize-WQSE5ZPL.js → recognize-PHDYO6DC.js} +4 -4
- package/dist/bundle/{remote-J5HHRNVQ.js → remote-4CX7GFMU.js} +7 -7
- package/dist/bundle/{rerank-DP2Y3WDT.js → rerank-ZCZTGXDQ.js} +7 -7
- package/dist/bundle/{serve-VXPOQDQO.js → serve-3LBS7CPR.js} +11 -10
- package/dist/bundle/{server-OSBNGA2F.js → server-2BKI2OQP.js} +38 -37
- package/dist/bundle/server-X5F7VD2E.js +63 -0
- package/dist/bundle/{sqlite-runtime-XY32WOIT.js → sqlite-runtime-J5T7SR5W.js} +6 -5
- package/dist/bundle/{state-KPOPMR6O.js → state-TIRNYVEL.js} +6 -6
- package/dist/bundle/{store-FWRGNGP3.js → store-F7ZXMIAP.js} +29 -18
- package/dist/bundle/{store-UBI2YCRC.js → store-NGE2E7KZ.js} +16 -13
- package/dist/bundle/store-maintenance-command-QZV76KAH.js +53 -0
- package/dist/commands/session.js +1 -1
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +12 -7
- package/dist/commands/status.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-TW44FY47.js +0 -33
- package/dist/bundle/first-screen-ZN7ODW5K.js +0 -31
- package/dist/bundle/server-XHWSCXVX.js +0 -62
- package/dist/bundle/store-maintenance-command-3ZXPEIGF.js +0 -52
- /package/dist/bundle/{chunk-MRLSUCHT.js → chunk-NUN6OGOV.js} +0 -0
|
@@ -32,10 +32,9 @@ import {
|
|
|
32
32
|
rankingWords,
|
|
33
33
|
useStoredProviders,
|
|
34
34
|
validCounter
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-VNXCWZDW.js";
|
|
36
36
|
import {
|
|
37
37
|
FACT_STATUSES,
|
|
38
|
-
FACT_TYPES,
|
|
39
38
|
LINK_KINDS,
|
|
40
39
|
LINK_ORIGINS,
|
|
41
40
|
MEMORY_KINDS,
|
|
@@ -55,9 +54,10 @@ import {
|
|
|
55
54
|
matches,
|
|
56
55
|
priorityBand,
|
|
57
56
|
priorityLabel
|
|
58
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-NHVOJHHD.js";
|
|
59
58
|
import {
|
|
60
59
|
CHAT_MESSAGES_READ,
|
|
60
|
+
FACT_TYPES,
|
|
61
61
|
MEETING_FINDINGS_KIND,
|
|
62
62
|
MeetingError,
|
|
63
63
|
OPERATORS_BY_TYPE,
|
|
@@ -82,20 +82,23 @@ import {
|
|
|
82
82
|
normalizeTag,
|
|
83
83
|
parseMeetingQuery,
|
|
84
84
|
parseMeetingReference,
|
|
85
|
+
paymentTitle,
|
|
85
86
|
queryAstSchema,
|
|
86
87
|
queryError,
|
|
87
88
|
tagOf,
|
|
88
89
|
timezoneOf,
|
|
90
|
+
transcriptLanguage,
|
|
89
91
|
validateFindings,
|
|
90
92
|
validateMeetingFindings,
|
|
91
93
|
validateMeetingParticipantSearch,
|
|
92
94
|
validateMeetingPreparationContext,
|
|
93
95
|
validateMeetingRelatedHistory,
|
|
94
96
|
validateMeetingSeriesHistory,
|
|
97
|
+
validatePayment,
|
|
95
98
|
validateQuery,
|
|
96
99
|
walkQuery,
|
|
97
100
|
zonedMoment
|
|
98
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-VMLGER4M.js";
|
|
99
102
|
import {
|
|
100
103
|
DEFAULT_STEMMERS,
|
|
101
104
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -108,21 +111,25 @@ import {
|
|
|
108
111
|
fold,
|
|
109
112
|
normalize,
|
|
110
113
|
parseStemmers
|
|
111
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-6KDFUPBT.js";
|
|
112
115
|
import {
|
|
113
116
|
DEFAULT_TASK_CATEGORIES,
|
|
114
117
|
sharedConfigPath,
|
|
115
118
|
storedTaskCategories,
|
|
116
119
|
taskCategoriesReader
|
|
117
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-SOCALLW5.js";
|
|
118
121
|
import {
|
|
119
122
|
storePath
|
|
120
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-72CGQMAZ.js";
|
|
121
124
|
import {
|
|
122
|
-
PRAGMAS,
|
|
123
125
|
quietSqliteWarning,
|
|
124
126
|
storeCapable
|
|
125
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-HANGU5HI.js";
|
|
128
|
+
import {
|
|
129
|
+
PRAGMAS,
|
|
130
|
+
TIME_LIMIT_FUNCTION,
|
|
131
|
+
TimeLimitReached
|
|
132
|
+
} from "./chunk-V25TCQ3Z.js";
|
|
126
133
|
import {
|
|
127
134
|
array,
|
|
128
135
|
boolean,
|
|
@@ -139,14 +146,15 @@ import {
|
|
|
139
146
|
safeParse,
|
|
140
147
|
strictObject,
|
|
141
148
|
string
|
|
142
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-M7JREJFC.js";
|
|
143
150
|
import {
|
|
144
151
|
resolveFrom
|
|
145
152
|
} from "./chunk-Y5E2WNWB.js";
|
|
146
153
|
import {
|
|
147
154
|
CliError,
|
|
155
|
+
isCliError,
|
|
148
156
|
singleLine
|
|
149
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-CCHHEMPM.js";
|
|
150
158
|
import {
|
|
151
159
|
SQLiteTable,
|
|
152
160
|
TableAliasProxyHandler,
|
|
@@ -171,12 +179,12 @@ import {
|
|
|
171
179
|
sql,
|
|
172
180
|
sqliteTable,
|
|
173
181
|
text
|
|
174
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-VD5UJUNR.js";
|
|
175
183
|
import {
|
|
176
184
|
__name
|
|
177
185
|
} from "./chunk-ZVVMGPBJ.js";
|
|
178
186
|
|
|
179
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
180
188
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
181
189
|
const methods = whole;
|
|
182
190
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -304,7 +312,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
304
312
|
};
|
|
305
313
|
}, "bindAccount");
|
|
306
314
|
|
|
307
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
308
316
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
309
317
|
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");
|
|
310
318
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -327,7 +335,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
327
335
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
328
336
|
}, "sourceOf");
|
|
329
337
|
|
|
330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
331
339
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
332
340
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
333
341
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -514,7 +522,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf = (kind3)
|
|
|
514
522
|
return { accounts: [...chosen.values()], skipped };
|
|
515
523
|
}, "fitting");
|
|
516
524
|
|
|
517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
518
526
|
var IndexBuilderOn = class {
|
|
519
527
|
static {
|
|
520
528
|
__name(this, "IndexBuilderOn");
|
|
@@ -709,7 +717,7 @@ function alias(table, alias2) {
|
|
|
709
717
|
}
|
|
710
718
|
__name(alias, "alias");
|
|
711
719
|
|
|
712
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
713
721
|
var ENTITY_TABLES = {
|
|
714
722
|
account: "accounts",
|
|
715
723
|
attachment: "attachments",
|
|
@@ -749,7 +757,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
749
757
|
return { table, pointer, type, count, known: known2 };
|
|
750
758
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
751
759
|
|
|
752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
753
761
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
754
762
|
id: integer("id").primaryKey(),
|
|
755
763
|
name: text("name").notNull().unique(),
|
|
@@ -758,7 +766,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
758
766
|
updatedAt: integer("updated_at").notNull()
|
|
759
767
|
});
|
|
760
768
|
|
|
761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
769
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
762
770
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
763
771
|
sourceKey: text("source_key").notNull(),
|
|
764
772
|
collection: text("collection").notNull(),
|
|
@@ -768,13 +776,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
768
776
|
createdAt: integer("created_at").notNull()
|
|
769
777
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
770
778
|
|
|
771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
779
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
772
780
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
773
781
|
id: integer("id").notNull(),
|
|
774
782
|
indexableType: text("indexable_type").notNull()
|
|
775
783
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
776
784
|
|
|
777
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
785
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
778
786
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
779
787
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
780
788
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -800,7 +808,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
800
808
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
801
809
|
]);
|
|
802
810
|
|
|
803
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
804
812
|
var accounts = sqliteTable("accounts", {
|
|
805
813
|
id: integer("id").primaryKey(),
|
|
806
814
|
provider: text("provider").notNull(),
|
|
@@ -2302,7 +2310,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2302
2310
|
at: integer("at").notNull()
|
|
2303
2311
|
});
|
|
2304
2312
|
|
|
2305
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2313
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
2306
2314
|
var ARMS = [
|
|
2307
2315
|
[
|
|
2308
2316
|
"message",
|
|
@@ -2429,7 +2437,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2429
2437
|
return recomputed;
|
|
2430
2438
|
}, "drainInvolvementQueue");
|
|
2431
2439
|
|
|
2432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2440
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
2433
2441
|
import { domainToUnicode } from "node:url";
|
|
2434
2442
|
|
|
2435
2443
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12451,7 +12459,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12451
12459
|
}, "oa");
|
|
12452
12460
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12453
12461
|
|
|
12454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12462
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
12455
12463
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12456
12464
|
var ID = /^[\w-]{10,}$/;
|
|
12457
12465
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12492,7 +12500,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
|
|
|
12492
12500
|
return { url, documentId: googleDocumentId(url) };
|
|
12493
12501
|
}), "googleDocumentLinks");
|
|
12494
12502
|
|
|
12495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
12496
12504
|
var PHONE_PLANS = [
|
|
12497
12505
|
{
|
|
12498
12506
|
country: "us",
|
|
@@ -12872,7 +12880,7 @@ var PHONE_PLANS = [
|
|
|
12872
12880
|
}
|
|
12873
12881
|
];
|
|
12874
12882
|
|
|
12875
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12883
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
12876
12884
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
12877
12885
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
12878
12886
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -12913,7 +12921,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
12913
12921
|
return void 0;
|
|
12914
12922
|
}, "nationalPhone");
|
|
12915
12923
|
|
|
12916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12924
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
12917
12925
|
var BEFORE = [
|
|
12918
12926
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
12919
12927
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13173,7 +13181,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
|
|
|
13173
13181
|
return found2.sort((a, b) => a.start - b.start);
|
|
13174
13182
|
}, "findPlaces");
|
|
13175
13183
|
|
|
13176
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13184
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13177
13185
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13178
13186
|
var MENTION_VERSIONS = {
|
|
13179
13187
|
phone: 1,
|
|
@@ -13363,7 +13371,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13363
13371
|
};
|
|
13364
13372
|
}, "typedPhone");
|
|
13365
13373
|
|
|
13366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
13367
13375
|
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";
|
|
13368
13376
|
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";
|
|
13369
13377
|
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";
|
|
@@ -13371,7 +13379,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13371
13379
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13372
13380
|
var NAME_WORDS = WORDS.split(" ");
|
|
13373
13381
|
|
|
13374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
13375
13383
|
var LATIN_TO_CYRILLIC = {
|
|
13376
13384
|
shch: "\u0449",
|
|
13377
13385
|
sch: "\u0449",
|
|
@@ -13579,7 +13587,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
|
|
|
13579
13587
|
return found2;
|
|
13580
13588
|
}, "findUnknownNames");
|
|
13581
13589
|
|
|
13582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13590
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
13583
13591
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13584
13592
|
"webpage",
|
|
13585
13593
|
"share",
|
|
@@ -13619,7 +13627,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
13619
13627
|
});
|
|
13620
13628
|
}, "matchDownloads");
|
|
13621
13629
|
|
|
13622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
13623
13631
|
var QUERY_VERSION = 1;
|
|
13624
13632
|
var QUERY_LIMITS2 = {
|
|
13625
13633
|
...QUERY_LIMITS,
|
|
@@ -13641,6 +13649,11 @@ function searchError(reason, span, alternative) {
|
|
|
13641
13649
|
queryError(reason, span, alternative, SEARCH_QUERY);
|
|
13642
13650
|
}
|
|
13643
13651
|
__name(searchError, "searchError");
|
|
13652
|
+
function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
|
|
13653
|
+
throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
|
|
13654
|
+
}
|
|
13655
|
+
__name(outOfTime, "outOfTime");
|
|
13656
|
+
var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
|
|
13644
13657
|
function exhausted(budget) {
|
|
13645
13658
|
throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
|
|
13646
13659
|
reason: "query.too-large",
|
|
@@ -13650,7 +13663,7 @@ function exhausted(budget) {
|
|
|
13650
13663
|
}
|
|
13651
13664
|
__name(exhausted, "exhausted");
|
|
13652
13665
|
|
|
13653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13666
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
13654
13667
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
13655
13668
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
13656
13669
|
kind: "char",
|
|
@@ -14050,7 +14063,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14050
14063
|
return out;
|
|
14051
14064
|
}, "foldRegex");
|
|
14052
14065
|
|
|
14053
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
14054
14067
|
var PRESET_VERSION = 1;
|
|
14055
14068
|
var PRESETS = {
|
|
14056
14069
|
password: {
|
|
@@ -14104,7 +14117,7 @@ var PRESETS = {
|
|
|
14104
14117
|
}
|
|
14105
14118
|
};
|
|
14106
14119
|
|
|
14107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14120
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
14108
14121
|
var FIELD_VERSION = 2;
|
|
14109
14122
|
var UNITS = {
|
|
14110
14123
|
"": 1,
|
|
@@ -14564,12 +14577,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
14564
14577
|
return validateFields(parsed3.output);
|
|
14565
14578
|
}, "validateAst");
|
|
14566
14579
|
|
|
14567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
14568
14581
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14569
14582
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14570
14583
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14571
14584
|
|
|
14572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
14573
14586
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14574
14587
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14575
14588
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -14593,7 +14606,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
14593
14606
|
};
|
|
14594
14607
|
}, "linkMatch");
|
|
14595
14608
|
|
|
14596
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
14597
14610
|
var SETTING = "phoneCountries";
|
|
14598
14611
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14599
14612
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -14624,7 +14637,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
14624
14637
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
14625
14638
|
}, "valueMatch");
|
|
14626
14639
|
|
|
14627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
14628
14641
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
14629
14642
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
14630
14643
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -14652,7 +14665,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
14652
14665
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
14653
14666
|
}, "vocabularySimilarity");
|
|
14654
14667
|
|
|
14655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14668
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
14656
14669
|
import { createHash } from "node:crypto";
|
|
14657
14670
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
14658
14671
|
try {
|
|
@@ -14718,7 +14731,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
14718
14731
|
});
|
|
14719
14732
|
}, "guardTagCreation");
|
|
14720
14733
|
|
|
14721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
14722
14735
|
var invalid = /* @__PURE__ */ __name((message2) => {
|
|
14723
14736
|
throw new CliError("validation_error", message2);
|
|
14724
14737
|
}, "invalid");
|
|
@@ -14795,7 +14808,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
14795
14808
|
};
|
|
14796
14809
|
}, "createTagRedirectIndex");
|
|
14797
14810
|
|
|
14798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
14799
14812
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
14800
14813
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
14801
14814
|
if (!row2)
|
|
@@ -14823,7 +14836,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
14823
14836
|
return snapshot2;
|
|
14824
14837
|
}, "tagRedirectSnapshot");
|
|
14825
14838
|
|
|
14826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
14827
14840
|
import { createHash as createHash2 } from "node:crypto";
|
|
14828
14841
|
var TASK_KEY_PREFIXES = {
|
|
14829
14842
|
question: "Q",
|
|
@@ -14851,7 +14864,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
14851
14864
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
14852
14865
|
}, "taskAccountOf");
|
|
14853
14866
|
|
|
14854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
14855
14868
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
14856
14869
|
var REFERABLE = {
|
|
14857
14870
|
note: { tombstone: true },
|
|
@@ -15013,7 +15026,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15013
15026
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
15014
15027
|
}, "taskIdOf");
|
|
15015
15028
|
|
|
15016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
15017
15030
|
var toMs = /* @__PURE__ */ __name((iso11) => {
|
|
15018
15031
|
if (iso11 === null || iso11 === void 0)
|
|
15019
15032
|
return null;
|
|
@@ -15027,7 +15040,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15027
15040
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15028
15041
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15029
15042
|
|
|
15030
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15043
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
15031
15044
|
var TAG_KINDS = ["tag", "topic"];
|
|
15032
15045
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15033
15046
|
var TAG_TYPE = {
|
|
@@ -15230,7 +15243,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15230
15243
|
return result;
|
|
15231
15244
|
}, "tagsOf");
|
|
15232
15245
|
|
|
15233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
15234
15247
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
15235
15248
|
var SPEECH = speech("att");
|
|
15236
15249
|
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");
|
|
@@ -15591,7 +15604,7 @@ var FIELD_COMPILERS = {
|
|
|
15591
15604
|
subject
|
|
15592
15605
|
};
|
|
15593
15606
|
|
|
15594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
15595
15608
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15596
15609
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15597
15610
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15607,7 +15620,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15607
15620
|
};
|
|
15608
15621
|
}, "placeOf");
|
|
15609
15622
|
|
|
15610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15623
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
15611
15624
|
var DRAIN_ON_WRITE = 500;
|
|
15612
15625
|
var METHOD = "rules";
|
|
15613
15626
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -15770,7 +15783,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
15770
15783
|
return queued.length;
|
|
15771
15784
|
}, "drainMentions");
|
|
15772
15785
|
|
|
15773
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
15774
15787
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
15775
15788
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
15776
15789
|
if (!exists2)
|
|
@@ -15778,7 +15791,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
15778
15791
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
15779
15792
|
}, "indexRow");
|
|
15780
15793
|
|
|
15781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15794
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
15782
15795
|
var INDEX = "message_stems";
|
|
15783
15796
|
var SETTING2 = "searchStemmers";
|
|
15784
15797
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -15900,7 +15913,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
15900
15913
|
};
|
|
15901
15914
|
}, "stemmerCache");
|
|
15902
15915
|
|
|
15903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
15904
15917
|
var SQLITE_BUSY = 5;
|
|
15905
15918
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
15906
15919
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -15995,7 +16008,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
15995
16008
|
}
|
|
15996
16009
|
}, "read");
|
|
15997
16010
|
|
|
15998
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
15999
16012
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
16000
16013
|
coalesce(CASE k.chunkable_type
|
|
16001
16014
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16137,7 +16150,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16137
16150
|
}, "dropUnusedVectors");
|
|
16138
16151
|
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");
|
|
16139
16152
|
|
|
16140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
16141
16154
|
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({
|
|
16142
16155
|
target: [accounts.provider, accounts.externalId],
|
|
16143
16156
|
set: {
|
|
@@ -16243,7 +16256,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16243
16256
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
16244
16257
|
}, "dropOrphanPeople");
|
|
16245
16258
|
|
|
16246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
16247
16260
|
var FOLDED = [
|
|
16248
16261
|
{ table: "tasks", column: "title" },
|
|
16249
16262
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -16280,7 +16293,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
16280
16293
|
return filled2;
|
|
16281
16294
|
}, "fillFolded");
|
|
16282
16295
|
|
|
16283
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16296
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
16284
16297
|
var HISTORY_KEY = "$history";
|
|
16285
16298
|
var objectOf = /* @__PURE__ */ __name((text5) => {
|
|
16286
16299
|
if (typeof text5 !== "string")
|
|
@@ -16356,7 +16369,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
16356
16369
|
return rest;
|
|
16357
16370
|
}, "withoutHistory");
|
|
16358
16371
|
|
|
16359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
16360
16373
|
import { createHash as createHash3 } from "node:crypto";
|
|
16361
16374
|
var CHUNK_CHARS = 1200;
|
|
16362
16375
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16461,7 +16474,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16461
16474
|
return chunks2;
|
|
16462
16475
|
}, "cutChunks");
|
|
16463
16476
|
|
|
16464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16477
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
16465
16478
|
var DAY = 864e5;
|
|
16466
16479
|
var CURRENCY = [
|
|
16467
16480
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -16587,7 +16600,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
16587
16600
|
return best?.day ?? null;
|
|
16588
16601
|
}, "dueDayOf");
|
|
16589
16602
|
|
|
16590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
16591
16604
|
var DAY2 = 864e5;
|
|
16592
16605
|
var STOP_WORDS = new Set([
|
|
16593
16606
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -16742,7 +16755,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
16742
16755
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
16743
16756
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
16744
16757
|
|
|
16745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
16746
16759
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
16747
16760
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
16748
16761
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -17013,7 +17026,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
17013
17026
|
};
|
|
17014
17027
|
}, "readiness");
|
|
17015
17028
|
|
|
17016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
17017
17030
|
var DOCUMENT_PICTURE = "document_picture";
|
|
17018
17031
|
var SCAN_PAGE2 = 5e3;
|
|
17019
17032
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -17076,7 +17089,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
17076
17089
|
}, "nearestPictures")
|
|
17077
17090
|
}), "documentPicturesOver");
|
|
17078
17091
|
|
|
17079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
17080
17093
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
17081
17094
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
17082
17095
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -17141,7 +17154,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
17141
17154
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
17142
17155
|
var bound2 = /* @__PURE__ */ __name(({ sql: text5, params }) => sql.join(text5.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
|
|
17143
17156
|
|
|
17144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
17145
17158
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17146
17159
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17147
17160
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17231,7 +17244,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17231
17244
|
});
|
|
17232
17245
|
}, "linkMeeting");
|
|
17233
17246
|
|
|
17234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
17235
17248
|
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), ''))";
|
|
17236
17249
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17237
17250
|
"working-location",
|
|
@@ -17461,7 +17474,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17461
17474
|
return true;
|
|
17462
17475
|
}, "resetNoteIndex");
|
|
17463
17476
|
|
|
17464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17477
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
17465
17478
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
17466
17479
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
17467
17480
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -17480,7 +17493,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
17480
17493
|
}
|
|
17481
17494
|
}, "resolvePersonLinks");
|
|
17482
17495
|
|
|
17483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
17484
17497
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
17485
17498
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
17486
17499
|
find: orm.select({
|
|
@@ -17705,7 +17718,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
17705
17718
|
}, "meetingIdentityPk");
|
|
17706
17719
|
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");
|
|
17707
17720
|
|
|
17708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
17709
17722
|
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");
|
|
17710
17723
|
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");
|
|
17711
17724
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -17985,7 +17998,100 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
17985
17998
|
}
|
|
17986
17999
|
}, "replaceAutoTags");
|
|
17987
18000
|
|
|
17988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
18002
|
+
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
18003
|
+
var ACTIVITY = `
|
|
18004
|
+
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
18005
|
+
e.external_id, coalesce(e.received_at, e.sent_at) AS at,
|
|
18006
|
+
coalesce(e.outgoing, lower(e.from_address) = lower(a.external_id)) AS outgoing,
|
|
18007
|
+
EXISTS (SELECT 1 FROM email_recipients r WHERE r.email_id = e.id AND r.role IN ('to', 'cc')
|
|
18008
|
+
AND lower(r.address) = lower(a.external_id)) AS addressed,
|
|
18009
|
+
EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id
|
|
18010
|
+
WHERE m.email_id = e.id AND b.kind = 'bulk') AS bulk,
|
|
18011
|
+
coalesce(json_extract(e.headers, '$."list-id"'), json_extract(e.metadata, '$.listId')) IS NOT NULL AS list,
|
|
18012
|
+
EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id
|
|
18013
|
+
WHERE m.email_id = e.id AND b.kind = 'envelope') AS envelope,
|
|
18014
|
+
EXISTS (SELECT 1 FROM account_identities ai WHERE ai.account_id = t.account_id
|
|
18015
|
+
AND ai.identity_id = e.from_identity_id AND ai.mail_demoted = 1) AS demoted
|
|
18016
|
+
FROM email_threads t JOIN accounts a ON a.id = t.account_id
|
|
18017
|
+
LEFT JOIN emails e ON e.id = (SELECT f.id FROM emails f WHERE f.email_thread_id = t.id AND f.deleted_at IS NULL
|
|
18018
|
+
AND coalesce(f.draft, 0) = 0 ORDER BY coalesce(f.received_at, f.sent_at) DESC, f.id DESC LIMIT 1)
|
|
18019
|
+
WHERE t.account_id = ? AND t.deleted_at IS NULL AND t.last_email_at > ?`;
|
|
18020
|
+
var threadActivity = /* @__PURE__ */ __name((database, accountId, since, where) => database.prepare(`${ACTIVITY}${where ? ` AND (${where.sql})` : ""} ORDER BY t.last_email_at DESC, t.id DESC`).all(accountId, since, ...where?.params ?? []).map((row2) => ({
|
|
18021
|
+
threadId: String(row2.thread),
|
|
18022
|
+
subject: str(row2.subject),
|
|
18023
|
+
lastEmailAt: Number(row2.last_email_at),
|
|
18024
|
+
emails: Number(row2.emails_count),
|
|
18025
|
+
newest: row2.external_id == null ? null : {
|
|
18026
|
+
externalId: String(row2.external_id),
|
|
18027
|
+
at: int(row2.at) ?? Number(row2.last_email_at),
|
|
18028
|
+
outgoing: Boolean(row2.outgoing),
|
|
18029
|
+
addressed: Boolean(row2.addressed),
|
|
18030
|
+
bulk: Boolean(row2.bulk),
|
|
18031
|
+
list: Boolean(row2.list),
|
|
18032
|
+
envelope: Boolean(row2.envelope),
|
|
18033
|
+
demoted: Boolean(row2.demoted)
|
|
18034
|
+
}
|
|
18035
|
+
})), "threadActivity");
|
|
18036
|
+
var threadEmailIds = /* @__PURE__ */ __name((database, accountId, thread, { after: after2, until } = {}) => database.prepare(`SELECT e.id FROM emails e JOIN email_threads t ON t.id = e.email_thread_id
|
|
18037
|
+
WHERE t.account_id = ? AND t.external_id = ? AND e.deleted_at IS NULL
|
|
18038
|
+
AND coalesce(e.received_at, e.sent_at, 0) > coalesce(?, -1)
|
|
18039
|
+
AND coalesce(e.received_at, e.sent_at, 0) <= coalesce(?, 9e15)
|
|
18040
|
+
ORDER BY coalesce(e.sent_at, e.received_at), e.id`).all(accountId, thread, after2 ?? null, until ?? null).map(({ id: id2 }) => Number(id2)), "threadEmailIds");
|
|
18041
|
+
var MARKS = `
|
|
18042
|
+
SELECT e.mail_rule_id, coalesce(json_extract(e.headers, '$."list-id"'), json_extract(e.metadata, '$.listId')) AS list_id,
|
|
18043
|
+
EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id
|
|
18044
|
+
WHERE m.email_id = e.id AND b.kind = 'bulk') AS bulk
|
|
18045
|
+
FROM emails e WHERE e.account_id = ? AND e.external_id = ? AND e.deleted_at IS NULL`;
|
|
18046
|
+
var emailMarks = /* @__PURE__ */ __name((database, accountId, externalIds) => {
|
|
18047
|
+
const one = database.prepare(MARKS);
|
|
18048
|
+
const marks = /* @__PURE__ */ new Map();
|
|
18049
|
+
for (const id2 of externalIds) {
|
|
18050
|
+
const row2 = one.get(accountId, id2);
|
|
18051
|
+
if (row2)
|
|
18052
|
+
marks.set(id2, { bulk: Boolean(row2.bulk), listId: str(row2.list_id), ruleId: int(row2.mail_rule_id) });
|
|
18053
|
+
}
|
|
18054
|
+
return marks;
|
|
18055
|
+
}, "emailMarks");
|
|
18056
|
+
var MARKED = `
|
|
18057
|
+
SELECT e.id, e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.created_at,
|
|
18058
|
+
e.updated_at, coalesce(e.draft, 0) AS draft, json_extract(e.metadata, '$.partial') IS NOT NULL AS partial,
|
|
18059
|
+
coalesce(json_extract(e.headers, '$."list-id"'), json_extract(e.metadata, '$.listId')) IS NOT NULL
|
|
18060
|
+
OR EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id
|
|
18061
|
+
WHERE m.email_id = e.id AND b.kind = 'bulk') AS bulk,
|
|
18062
|
+
EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id
|
|
18063
|
+
WHERE m.email_id = e.id AND b.kind = 'envelope') AS envelope
|
|
18064
|
+
FROM emails e JOIN email_threads t ON t.id = e.email_thread_id`;
|
|
18065
|
+
var markedOf = /* @__PURE__ */ __name((row2) => ({
|
|
18066
|
+
id: Number(row2.id),
|
|
18067
|
+
externalId: String(row2.external_id),
|
|
18068
|
+
thread: String(row2.thread),
|
|
18069
|
+
at: int(row2.at),
|
|
18070
|
+
storedAt: Number(row2.created_at),
|
|
18071
|
+
changedAt: Number(row2.updated_at),
|
|
18072
|
+
bulk: Boolean(row2.bulk),
|
|
18073
|
+
envelope: Boolean(row2.envelope),
|
|
18074
|
+
partial: Boolean(row2.partial),
|
|
18075
|
+
draft: Boolean(row2.draft)
|
|
18076
|
+
}), "markedOf");
|
|
18077
|
+
var emailsAfter = /* @__PURE__ */ __name((database, accountId, afterId, limit, ids = []) => {
|
|
18078
|
+
const next = database.prepare(`${MARKED} WHERE e.id > ? AND e.account_id = ? AND e.deleted_at IS NULL ORDER BY e.id LIMIT ?`).all(afterId, accountId, limit);
|
|
18079
|
+
const one = database.prepare(`${MARKED} WHERE e.id = ? AND e.account_id = ? AND e.deleted_at IS NULL`);
|
|
18080
|
+
const named2 = ids.flatMap((id2) => {
|
|
18081
|
+
const row2 = one.get(id2, accountId);
|
|
18082
|
+
return row2 ? [row2] : [];
|
|
18083
|
+
});
|
|
18084
|
+
return [...named2, ...next].map(markedOf);
|
|
18085
|
+
}, "emailsAfter");
|
|
18086
|
+
var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
18087
|
+
emailsAfter: /* @__PURE__ */ __name(async (accountId, afterId, limit, ids) => emailsAfter(database, accountId, afterId, limit, ids), "emailsAfter"),
|
|
18088
|
+
newestEmailId: /* @__PURE__ */ __name(async (accountId) => Number(database.prepare("SELECT max(id) AS id FROM emails WHERE account_id = ?").get(accountId)?.id ?? 0), "newestEmailId"),
|
|
18089
|
+
statesLike: /* @__PURE__ */ __name(async (accountId, prefix) => database.prepare("SELECT key, value, updated_at FROM sync_cursors WHERE account_id = ? AND substr(key, 1, ?) = ?").all(accountId, prefix.length, prefix).map((row2) => ({ key: String(row2.key), value: String(row2.value), at: Number(row2.updated_at) })), "statesLike"),
|
|
18090
|
+
emailMarks: /* @__PURE__ */ __name(async (accountId, externalIds) => emailMarks(database, accountId, externalIds), "emailMarks"),
|
|
18091
|
+
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
18092
|
+
}), "mailActivity");
|
|
18093
|
+
|
|
18094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
17989
18095
|
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");
|
|
17990
18096
|
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;
|
|
17991
18097
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -18066,7 +18172,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
18066
18172
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
18067
18173
|
}, "mailCore");
|
|
18068
18174
|
|
|
18069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18175
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
18070
18176
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
18071
18177
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
18072
18178
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18176,7 +18282,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
18176
18282
|
return emails3 + threads;
|
|
18177
18283
|
}, "drainEmailIndex");
|
|
18178
18284
|
|
|
18179
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18285
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
18180
18286
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
18181
18287
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
18182
18288
|
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,
|
|
@@ -18259,8 +18365,10 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
18259
18365
|
for (const emailId of new Set(emails3))
|
|
18260
18366
|
leave.run(emailId, Number(box.id), emailId, Number(box.id));
|
|
18261
18367
|
}, "forgetLocations");
|
|
18368
|
+
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
18369
|
+
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
18262
18370
|
|
|
18263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18371
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
18264
18372
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18265
18373
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18266
18374
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18310,7 +18418,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
18310
18418
|
return threads.length;
|
|
18311
18419
|
}, "markEmailsRestored");
|
|
18312
18420
|
|
|
18313
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
18314
18422
|
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");
|
|
18315
18423
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18316
18424
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18377,7 +18485,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18377
18485
|
}
|
|
18378
18486
|
}), "mailRulesOver");
|
|
18379
18487
|
|
|
18380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18488
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
18381
18489
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18382
18490
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18383
18491
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18385,7 +18493,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18385
18493
|
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);
|
|
18386
18494
|
}, "reviewLink");
|
|
18387
18495
|
|
|
18388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
18389
18497
|
function checkMeetingCancelled(signal) {
|
|
18390
18498
|
if (!signal?.aborted)
|
|
18391
18499
|
return;
|
|
@@ -18396,7 +18504,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18396
18504
|
}
|
|
18397
18505
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18398
18506
|
|
|
18399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18507
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
18400
18508
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18401
18509
|
id: Number(row2.id),
|
|
18402
18510
|
accountId: Number(row2.account_id),
|
|
@@ -18446,7 +18554,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18446
18554
|
createdAt: Number(row2.created_at)
|
|
18447
18555
|
}), "transcriptRowOf");
|
|
18448
18556
|
|
|
18449
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
18450
18558
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18451
18559
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18452
18560
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18613,7 +18721,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18613
18721
|
}
|
|
18614
18722
|
}), "meetingReadsOver");
|
|
18615
18723
|
|
|
18616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
18617
18725
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18618
18726
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18619
18727
|
const params = [input.accountId];
|
|
@@ -18656,7 +18764,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18656
18764
|
return { clauses, params };
|
|
18657
18765
|
}, "meetingSelectionSql");
|
|
18658
18766
|
|
|
18659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
18660
18768
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18661
18769
|
async meetingChatLines(input) {
|
|
18662
18770
|
checkMeetingCancelled(input.signal);
|
|
@@ -18684,7 +18792,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18684
18792
|
}
|
|
18685
18793
|
}), "meetingChatLinesOver");
|
|
18686
18794
|
|
|
18687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
18688
18796
|
var MESSAGE_FIELDS = {
|
|
18689
18797
|
pk: messages.id,
|
|
18690
18798
|
nativeId: messages.externalId,
|
|
@@ -18721,7 +18829,7 @@ var toMessages = /* @__PURE__ */ __name(({ orm }, rows) => {
|
|
|
18721
18829
|
}
|
|
18722
18830
|
return rows.map((row2) => toMessage(row2, byMessage.get(row2.pk) ?? []));
|
|
18723
18831
|
}, "toMessages");
|
|
18724
|
-
var countMessages = /* @__PURE__ */ __name(({ orm }, chatKey, since) => Number(orm.select({ n: sql`count(*)` }).from(messages).where(live(chatKey, since === void 0 ? void 0 : gte(messages.sentAt, toMs(since)))).get()?.n), "countMessages");
|
|
18832
|
+
var countMessages = /* @__PURE__ */ __name(({ orm }, chatKey, since, until) => Number(orm.select({ n: sql`count(*)` }).from(messages).where(live(chatKey, since === void 0 ? void 0 : gte(messages.sentAt, toMs(since)), until === void 0 ? void 0 : lte(messages.sentAt, toMs(until)))).get()?.n), "countMessages");
|
|
18725
18833
|
var changesSince = /* @__PURE__ */ __name((context, chatKey, at) => {
|
|
18726
18834
|
const edited = context.orm.select({ pk: messageRevisions.messageId }).from(messageRevisions).where(gt(messageRevisions.createdAt, at));
|
|
18727
18835
|
const rows = selectMessages(context).where(live(chatKey, or(gt(messages.createdAt, at), inArray(messages.id, edited)))).orderBy(asc(messages.sentAt), asc(messages.id)).all();
|
|
@@ -18855,7 +18963,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18855
18963
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18856
18964
|
}), "chatActivity");
|
|
18857
18965
|
|
|
18858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18966
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
18859
18967
|
var HIT_FIELDS = {
|
|
18860
18968
|
...MESSAGE_FIELDS,
|
|
18861
18969
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18954,7 +19062,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18954
19062
|
};
|
|
18955
19063
|
}, "directReplies");
|
|
18956
19064
|
|
|
18957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19065
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
18958
19066
|
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");
|
|
18959
19067
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18960
19068
|
const found2 = identityRow(context, ref3);
|
|
@@ -19085,7 +19193,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
19085
19193
|
}, "mentioning");
|
|
19086
19194
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
19087
19195
|
|
|
19088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
19089
19197
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
19090
19198
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
19091
19199
|
}, "missing");
|
|
@@ -19207,7 +19315,7 @@ function meetingContextLinksOver(context) {
|
|
|
19207
19315
|
}
|
|
19208
19316
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19209
19317
|
|
|
19210
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19318
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
19211
19319
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19212
19320
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19213
19321
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19236,7 +19344,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19236
19344
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19237
19345
|
}, "indexedText");
|
|
19238
19346
|
|
|
19239
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
19240
19348
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19241
19349
|
var meetingCurrentIndexRows = `
|
|
19242
19350
|
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
|
|
@@ -19267,7 +19375,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19267
19375
|
}, "invalidateMeetingStems");
|
|
19268
19376
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19269
19377
|
|
|
19270
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
19271
19379
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19272
19380
|
return {
|
|
19273
19381
|
async indexSearch(original) {
|
|
@@ -19335,10 +19443,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19335
19443
|
}
|
|
19336
19444
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19337
19445
|
|
|
19338
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19339
19447
|
import { createHash as createHash4 } from "node:crypto";
|
|
19340
19448
|
|
|
19341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
19342
19450
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19343
19451
|
const padded = ` ${term} `;
|
|
19344
19452
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19347,7 +19455,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19347
19455
|
return [...pieces];
|
|
19348
19456
|
}, "trigrams");
|
|
19349
19457
|
|
|
19350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
19351
19459
|
var SHORTEST_CORRECTION = 3;
|
|
19352
19460
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19353
19461
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19394,7 +19502,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19394
19502
|
return corrections;
|
|
19395
19503
|
}, "correctWords");
|
|
19396
19504
|
|
|
19397
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19505
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
19398
19506
|
var SHORTEST_GARBLED = 4;
|
|
19399
19507
|
var MOST_WIDENED = 64;
|
|
19400
19508
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19486,7 +19594,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19486
19594
|
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((word) => word.term));
|
|
19487
19595
|
}, "widenWords");
|
|
19488
19596
|
|
|
19489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
19490
19598
|
import { readFileSync } from "node:fs";
|
|
19491
19599
|
var loaded;
|
|
19492
19600
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19545,7 +19653,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19545
19653
|
return false;
|
|
19546
19654
|
}, "knownRussianWord");
|
|
19547
19655
|
|
|
19548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
19549
19657
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19550
19658
|
var MOST_WORDS = 128;
|
|
19551
19659
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19772,7 +19880,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19772
19880
|
return check3(tree);
|
|
19773
19881
|
}, "matchMeetingText");
|
|
19774
19882
|
|
|
19775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19883
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19776
19884
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19777
19885
|
throw new CliError("validation_error", message2);
|
|
19778
19886
|
}, "fail");
|
|
@@ -19868,9 +19976,9 @@ function meetingHitSearchOver({ database }) {
|
|
|
19868
19976
|
if (after2)
|
|
19869
19977
|
params.push(after2.tier, after2.tier, after2.started, after2.started, after2.meeting, after2.meeting, after2.kind, after2.kind, after2.id);
|
|
19870
19978
|
const sql2 = `WITH matches AS (${matching2}), matching AS (SELECT rid,tier FROM matches h WHERE NOT EXISTS(SELECT 1 FROM meeting_index_pending p WHERE p.id=h.rid/4 AND p.indexable_type=CASE h.rid%4 WHEN 1 THEN 'meeting_transcript_row' WHEN 2 THEN 'meeting_chat_message' ELSE 'meeting_summary' END)), selected AS (SELECT m.id,coalesce(m.started_at,0) AS started FROM meetings m WHERE ${clauses.join(" AND ")}), hits AS (
|
|
19871
|
-
SELECT h.tier,m.started,m.id AS meeting_id,0 AS kind,r.id,r.start_ms,${bytes("r", ["text"])} AS bytes,t.id AS transcript_id,r.position FROM matching h JOIN meeting_transcript_rows r ON h.rid%4=1 AND r.id=h.rid/4 JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id AND t.superseded_at IS NULL AND t.deleted_at IS NULL JOIN selected m ON m.id=t.meeting_id
|
|
19872
|
-
UNION ALL SELECT h.tier,m.started,m.id,1,c.id,NULL,${bytes("c", ["text"])},NULL,NULL FROM matching h JOIN meeting_chat_messages c ON h.rid%4=2 AND c.id=h.rid/4 JOIN selected m ON m.id=c.meeting_id
|
|
19873
|
-
UNION ALL SELECT h.tier,m.started,m.id,2,s.id,NULL,${bytes("s", fields)},NULL,NULL FROM matching h JOIN meeting_summaries s ON h.rid%4=3 AND s.id=h.rid/4 JOIN selected m ON m.id=s.meeting_id)
|
|
19979
|
+
SELECT h.tier,m.started,m.id AS meeting_id,0 AS kind,r.id,r.start_ms,${bytes("r", ["text"])} AS bytes,t.id AS transcript_id,r.position,t.language,(SELECT count(*) FROM meeting_transcript_rows n WHERE n.meeting_transcript_id=t.id) AS lines_total FROM matching h JOIN meeting_transcript_rows r ON h.rid%4=1 AND r.id=h.rid/4 JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id AND t.superseded_at IS NULL AND t.deleted_at IS NULL JOIN selected m ON m.id=t.meeting_id
|
|
19980
|
+
UNION ALL SELECT h.tier,m.started,m.id,1,c.id,NULL,${bytes("c", ["text"])},NULL,NULL,NULL,NULL FROM matching h JOIN meeting_chat_messages c ON h.rid%4=2 AND c.id=h.rid/4 JOIN selected m ON m.id=c.meeting_id
|
|
19981
|
+
UNION ALL SELECT h.tier,m.started,m.id,2,s.id,NULL,${bytes("s", fields)},NULL,NULL,NULL,NULL FROM matching h JOIN meeting_summaries s ON h.rid%4=3 AND s.id=h.rid/4 JOIN selected m ON m.id=s.meeting_id)
|
|
19874
19982
|
SELECT h.*,${bytes("m", ["title"])}+${bytes("s", ["doc_url"])} AS context_bytes FROM hits h
|
|
19875
19983
|
JOIN meetings m ON m.id=h.meeting_id LEFT JOIN meeting_summaries s ON h.kind=2 AND s.id=h.id
|
|
19876
19984
|
${seek} ORDER BY h.tier,h.started DESC,h.meeting_id,h.kind,h.id LIMIT ?`;
|
|
@@ -19918,7 +20026,12 @@ function meetingHitSearchOver({ database }) {
|
|
|
19918
20026
|
scope: kind3 === 0 ? "transcript" : kind3 === 1 ? "chat" : "summary",
|
|
19919
20027
|
id: Number(row2.id),
|
|
19920
20028
|
text: text5,
|
|
19921
|
-
startMs: row2.start_ms === null ? null : Number(row2.start_ms)
|
|
20029
|
+
startMs: row2.start_ms === null ? null : Number(row2.start_ms),
|
|
20030
|
+
...kind3 === 0 ? {
|
|
20031
|
+
language: row2.language === null ? null : String(row2.language),
|
|
20032
|
+
line: Number(row2.position) + 1,
|
|
20033
|
+
linesTotal: Number(row2.lines_total)
|
|
20034
|
+
} : {}
|
|
19922
20035
|
};
|
|
19923
20036
|
});
|
|
19924
20037
|
const fresh = items.flatMap((item) => {
|
|
@@ -19949,7 +20062,39 @@ function meetingHitSearchOver({ database }) {
|
|
|
19949
20062
|
}
|
|
19950
20063
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19951
20064
|
|
|
19952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20065
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
20066
|
+
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20067
|
+
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
20068
|
+
positiveReadInteger(accountId, "accountId");
|
|
20069
|
+
const found2 = read(database, () => {
|
|
20070
|
+
const rows = database.prepare("SELECT text FROM meeting_transcript_rows WHERE meeting_transcript_id = ?");
|
|
20071
|
+
return database.prepare(`SELECT t.id FROM meeting_transcripts t JOIN meetings m ON m.id = t.meeting_id
|
|
20072
|
+
WHERE m.account_id = ? AND t.language IS NULL AND t.deleted_at IS NULL ORDER BY t.id`).all(accountId).map(({ id: id2 }) => ({
|
|
20073
|
+
id: Number(id2),
|
|
20074
|
+
language: transcriptLanguage(rows.all(Number(id2)).map((row2) => String(row2.text)))
|
|
20075
|
+
}));
|
|
20076
|
+
});
|
|
20077
|
+
if (apply) {
|
|
20078
|
+
const update2 = database.prepare("UPDATE meeting_transcripts SET language = ?, updated_at = ? WHERE id = ? AND language IS NULL");
|
|
20079
|
+
writeBatch(database, () => {
|
|
20080
|
+
for (const { id: id2, language } of found2)
|
|
20081
|
+
if (language !== null)
|
|
20082
|
+
update2.run(language, now2, id2);
|
|
20083
|
+
});
|
|
20084
|
+
}
|
|
20085
|
+
const counts = /* @__PURE__ */ new Map();
|
|
20086
|
+
for (const { language } of found2)
|
|
20087
|
+
counts.set(language, (counts.get(language) ?? 0) + 1);
|
|
20088
|
+
return {
|
|
20089
|
+
accountId,
|
|
20090
|
+
applied: apply,
|
|
20091
|
+
transcripts: found2.length,
|
|
20092
|
+
languages: [...counts].map(([language, transcripts]) => ({ language, transcripts }))
|
|
20093
|
+
};
|
|
20094
|
+
}
|
|
20095
|
+
}), "meetingLanguagesOver");
|
|
20096
|
+
|
|
20097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
19953
20098
|
import { createHash as createHash5 } from "node:crypto";
|
|
19954
20099
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19955
20100
|
if (value === void 0)
|
|
@@ -20039,7 +20184,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
20039
20184
|
}
|
|
20040
20185
|
}), "meetingParticipantSearchOver");
|
|
20041
20186
|
|
|
20042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
20043
20188
|
var preparationQueries = {
|
|
20044
20189
|
participants: {
|
|
20045
20190
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -20089,7 +20234,7 @@ var preparationQueries = {
|
|
|
20089
20234
|
}
|
|
20090
20235
|
};
|
|
20091
20236
|
|
|
20092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
20093
20238
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20094
20239
|
async preparationContext(original) {
|
|
20095
20240
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -20130,7 +20275,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20130
20275
|
}
|
|
20131
20276
|
}), "meetingPreparationContextOver");
|
|
20132
20277
|
|
|
20133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
20134
20279
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
20135
20280
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
20136
20281
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -20144,7 +20289,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
20144
20289
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
20145
20290
|
)`, "preparationSubjects");
|
|
20146
20291
|
|
|
20147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20292
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
20148
20293
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20149
20294
|
async preparationKnowledge(original) {
|
|
20150
20295
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20189,7 +20334,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
20189
20334
|
}
|
|
20190
20335
|
}), "meetingPreparationKnowledgeOver");
|
|
20191
20336
|
|
|
20192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
20193
20338
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20194
20339
|
async preparationNotes(original) {
|
|
20195
20340
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20242,7 +20387,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20242
20387
|
}
|
|
20243
20388
|
}), "meetingPreparationNotesOver");
|
|
20244
20389
|
|
|
20245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
20246
20391
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20247
20392
|
async relatedHistory(original) {
|
|
20248
20393
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20313,7 +20458,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20313
20458
|
}
|
|
20314
20459
|
}), "meetingRelatedHistoryOver");
|
|
20315
20460
|
|
|
20316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
20317
20462
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20318
20463
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20319
20464
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20394,7 +20539,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20394
20539
|
}
|
|
20395
20540
|
}), "meetingReviewOver");
|
|
20396
20541
|
|
|
20397
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
20398
20543
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20399
20544
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20400
20545
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20448,7 +20593,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20448
20593
|
}
|
|
20449
20594
|
}), "meetingSeriesHistoryOver");
|
|
20450
20595
|
|
|
20451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20596
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
20452
20597
|
var MOST_ROWS = 5e5;
|
|
20453
20598
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20454
20599
|
async meetingStats(input) {
|
|
@@ -20495,7 +20640,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20495
20640
|
}
|
|
20496
20641
|
}), "meetingStatsOver");
|
|
20497
20642
|
|
|
20498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
20499
20644
|
var CURSOR_KEY = "meetings";
|
|
20500
20645
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20501
20646
|
id: Number(row2.id),
|
|
@@ -20925,17 +21070,18 @@ var search = /* @__PURE__ */ __name((database, query, filter) => {
|
|
|
20925
21070
|
const rows = database.prepare(`WITH hit AS (SELECT rowid AS r FROM meeting_words WHERE meeting_words MATCH ?),
|
|
20926
21071
|
picked AS (SELECT id, row_number() OVER (ORDER BY coalesce(started_at, 0) DESC, id) AS n FROM (${picked.sql}))
|
|
20927
21072
|
SELECT p.n, 0 AS kind, t.id AS a, r.position AS b, r.id, t.meeting_id, r.start_ms, coalesce(length(CAST(r.text AS BLOB)),0) AS bytes,
|
|
20928
|
-
r.speaker_name AS speaker, m.account_id
|
|
21073
|
+
r.speaker_name AS speaker, m.account_id, t.language,
|
|
21074
|
+
(SELECT count(*) FROM meeting_transcript_rows n WHERE n.meeting_transcript_id = t.id) AS lines_total
|
|
20929
21075
|
FROM hit h JOIN meeting_transcript_rows r ON h.r % 4 = 1 AND r.id = h.r / 4
|
|
20930
21076
|
JOIN meeting_transcripts t ON t.id = r.meeting_transcript_id
|
|
20931
21077
|
AND t.superseded_at IS NULL AND t.deleted_at IS NULL
|
|
20932
21078
|
JOIN picked p ON p.id = t.meeting_id JOIN meetings m ON m.id = t.meeting_id
|
|
20933
21079
|
UNION ALL
|
|
20934
|
-
SELECT p.n, 1, c.id, 0, c.id, c.meeting_id, NULL, coalesce(length(CAST(c.text AS BLOB)),0), NULL, NULL
|
|
21080
|
+
SELECT p.n, 1, c.id, 0, c.id, c.meeting_id, NULL, coalesce(length(CAST(c.text AS BLOB)),0), NULL, NULL, NULL, NULL
|
|
20935
21081
|
FROM hit h JOIN meeting_chat_messages c ON h.r % 4 = 2 AND c.id = h.r / 4
|
|
20936
21082
|
JOIN picked p ON p.id = c.meeting_id
|
|
20937
21083
|
UNION ALL
|
|
20938
|
-
SELECT p.n, 2, s.id, 0, s.id, s.meeting_id, NULL, coalesce(length(CAST(s.title AS BLOB)),0)+coalesce(length(CAST(s.overview AS BLOB)),0)+coalesce(length(CAST(s.sections AS BLOB)),0)+coalesce(length(CAST(s.next_steps AS BLOB)),0)+coalesce(length(CAST(s.content AS BLOB)),0), NULL, NULL
|
|
21084
|
+
SELECT p.n, 2, s.id, 0, s.id, s.meeting_id, NULL, coalesce(length(CAST(s.title AS BLOB)),0)+coalesce(length(CAST(s.overview AS BLOB)),0)+coalesce(length(CAST(s.sections AS BLOB)),0)+coalesce(length(CAST(s.next_steps AS BLOB)),0)+coalesce(length(CAST(s.content AS BLOB)),0), NULL, NULL, NULL, NULL
|
|
20939
21085
|
FROM hit h JOIN meeting_summaries s ON h.r % 4 = 3 AND s.id = h.r / 4
|
|
20940
21086
|
JOIN picked p ON p.id = s.meeting_id
|
|
20941
21087
|
ORDER BY 1, 2, 3, 4 LIMIT 10001`).all(`normalized_text : (${match})`, ...picked.params);
|
|
@@ -20957,7 +21103,10 @@ var search = /* @__PURE__ */ __name((database, query, filter) => {
|
|
|
20957
21103
|
transcriptId: Number(row2.a),
|
|
20958
21104
|
cuePosition: Number(row2.b)
|
|
20959
21105
|
}),
|
|
20960
|
-
speakerName: row2.speaker === null ? null : String(row2.speaker)
|
|
21106
|
+
speakerName: row2.speaker === null ? null : String(row2.speaker),
|
|
21107
|
+
language: row2.language === null ? null : String(row2.language),
|
|
21108
|
+
line: Number(row2.b) + 1,
|
|
21109
|
+
linesTotal: Number(row2.lines_total)
|
|
20961
21110
|
} : {};
|
|
20962
21111
|
return {
|
|
20963
21112
|
...cue,
|
|
@@ -20992,6 +21141,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
20992
21141
|
...meetingParticipantSearchOver(context),
|
|
20993
21142
|
...meetingHitIndexOver(context),
|
|
20994
21143
|
...meetingContextLinksOver(context),
|
|
21144
|
+
...meetingLanguagesOver(context),
|
|
20995
21145
|
async appendTranscriptsWithReceipt(input) {
|
|
20996
21146
|
try {
|
|
20997
21147
|
return append(context, input);
|
|
@@ -21059,7 +21209,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
21059
21209
|
};
|
|
21060
21210
|
}, "meetingStoreOver");
|
|
21061
21211
|
|
|
21062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
21063
21213
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
21064
21214
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
21065
21215
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -21085,7 +21235,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
21085
21235
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
21086
21236
|
}, "release");
|
|
21087
21237
|
|
|
21088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21238
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
21089
21239
|
var THREAD_COLUMNS = {
|
|
21090
21240
|
subject: {
|
|
21091
21241
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -21102,7 +21252,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
21102
21252
|
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);
|
|
21103
21253
|
}, "threadRows");
|
|
21104
21254
|
|
|
21105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
21106
21256
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
21107
21257
|
id: `email:${place.emailId}`,
|
|
21108
21258
|
chatId: place.threadExternalId,
|
|
@@ -21482,6 +21632,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
21482
21632
|
}));
|
|
21483
21633
|
},
|
|
21484
21634
|
...partialMail(database),
|
|
21635
|
+
...mailActivity(database),
|
|
21485
21636
|
async emailFacts(filter = {}) {
|
|
21486
21637
|
const [where, params] = emailWhere(filter);
|
|
21487
21638
|
return database.prepare(`SELECT e.external_id, e.from_address, e.from_name, e.subject, coalesce(e.received_at, e.sent_at) AS at, e.size,
|
|
@@ -21558,11 +21709,8 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
21558
21709
|
return count;
|
|
21559
21710
|
});
|
|
21560
21711
|
},
|
|
21561
|
-
async
|
|
21562
|
-
|
|
21563
|
-
return setEmailFlags(database, accountId, flags, now3);
|
|
21564
|
-
});
|
|
21565
|
-
},
|
|
21712
|
+
setFlags: /* @__PURE__ */ __name(async (accountId, flags, now3) => write(database, () => setEmailFlags(database, accountId, flags, now3)), "setFlags"),
|
|
21713
|
+
backfillSentAt: /* @__PURE__ */ __name(async (accountId, limit) => write(database, () => backfillSentAt(database, accountId, limit)), "backfillSentAt"),
|
|
21566
21714
|
folderEmails: /* @__PURE__ */ __name(async (accountId, folder, uidvalidity) => folderEmails(database, accountId, folder, uidvalidity), "folderEmails"),
|
|
21567
21715
|
setLocations: /* @__PURE__ */ __name(async (accountId, folder, uidvalidity, found2) => write(database, () => setLocations(database, accountId, folder, uidvalidity, found2)), "setLocations"),
|
|
21568
21716
|
forgetLocations: /* @__PURE__ */ __name(async (accountId, folder, uidvalidity, uids) => write(database, () => forgetLocations(database, accountId, folder, uidvalidity, uids)), "forgetLocations"),
|
|
@@ -21635,11 +21783,9 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
21635
21783
|
return place ? [{ ...place, score }] : [];
|
|
21636
21784
|
});
|
|
21637
21785
|
},
|
|
21638
|
-
async
|
|
21639
|
-
|
|
21640
|
-
|
|
21641
|
-
ORDER BY coalesce(e.sent_at, e.received_at), e.id`).all(accountId, threadExternalId).map(({ id: id2 }) => Number(id2));
|
|
21642
|
-
return emailHitsByPk(database, ids);
|
|
21786
|
+
emailHits: /* @__PURE__ */ __name(async (ids) => emailHitsByPk(database, [...ids]), "emailHits"),
|
|
21787
|
+
async threadHits(accountId, thread, window) {
|
|
21788
|
+
return emailHitsByPk(database, threadEmailIds(database, accountId, thread, window));
|
|
21643
21789
|
},
|
|
21644
21790
|
async inThreads(accountId, externalIds) {
|
|
21645
21791
|
const id2 = database.prepare("SELECT id FROM emails WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -21662,7 +21808,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
21662
21808
|
}
|
|
21663
21809
|
}), "mailStoreOver");
|
|
21664
21810
|
|
|
21665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
21666
21812
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21667
21813
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21668
21814
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21752,7 +21898,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21752
21898
|
}, "knownWord");
|
|
21753
21899
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21754
21900
|
|
|
21755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21901
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
21756
21902
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21757
21903
|
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");
|
|
21758
21904
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -21838,7 +21984,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21838
21984
|
return found2;
|
|
21839
21985
|
}, "spokenTranscripts");
|
|
21840
21986
|
|
|
21841
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
21842
21988
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21843
21989
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21844
21990
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21885,7 +22031,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21885
22031
|
});
|
|
21886
22032
|
}, "placeHits");
|
|
21887
22033
|
|
|
21888
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22034
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
21889
22035
|
var MESSAGES2 = {
|
|
21890
22036
|
rows: "messages",
|
|
21891
22037
|
threads: "chats",
|
|
@@ -21922,7 +22068,7 @@ var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context
|
|
|
21922
22068
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
21923
22069
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
21924
22070
|
var countMatches = /* @__PURE__ */ __name((context, execution, cap) => matchingPks(context, execution, cap)?.length, "countMatches");
|
|
21925
|
-
var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => {
|
|
22071
|
+
var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => inTime(() => {
|
|
21926
22072
|
const { database, check: check3, where, from: from2, withRanking, ranked, leaves } = compileQuery(context, {
|
|
21927
22073
|
...execution,
|
|
21928
22074
|
newest: true
|
|
@@ -21932,7 +22078,19 @@ var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => {
|
|
|
21932
22078
|
const rows = database.prepare(`${withRanking}SELECT m.id ${from2} WHERE ${where.sql} LIMIT ?`).all(...ranked.params, ...where.params, cap + 1);
|
|
21933
22079
|
check3();
|
|
21934
22080
|
return rows.map(({ id: id2 }) => Number(id2));
|
|
21935
|
-
}, "matchingPks");
|
|
22081
|
+
}), "matchingPks");
|
|
22082
|
+
var timeLimited = /* @__PURE__ */ __name((error) => {
|
|
22083
|
+
if (error instanceof TimeLimitReached)
|
|
22084
|
+
outOfTime();
|
|
22085
|
+
throw error;
|
|
22086
|
+
}, "timeLimited");
|
|
22087
|
+
var inTime = /* @__PURE__ */ __name((work) => {
|
|
22088
|
+
try {
|
|
22089
|
+
return work();
|
|
22090
|
+
} catch (error) {
|
|
22091
|
+
return timeLimited(error);
|
|
22092
|
+
}
|
|
22093
|
+
}, "inTime");
|
|
21936
22094
|
var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachments = false) => {
|
|
21937
22095
|
const { database } = context;
|
|
21938
22096
|
const corpus = execution.corpus === "mail" ? MAIL : MESSAGES2;
|
|
@@ -21940,6 +22098,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
21940
22098
|
if (mail && (execution.conversationIds || execution.conversationSince !== void 0))
|
|
21941
22099
|
throw new CliError("validation_error", "mail has no conversations to search within");
|
|
21942
22100
|
const started = context.now();
|
|
22101
|
+
const until = Date.now() + QUERY_LIMITS2.milliseconds;
|
|
21943
22102
|
const budget = { work: 0 };
|
|
21944
22103
|
let states = 0, expansions = 0;
|
|
21945
22104
|
const patterns = /* @__PURE__ */ new Map();
|
|
@@ -21948,7 +22107,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
21948
22107
|
if (execution.signal?.aborted)
|
|
21949
22108
|
throw new CliError("validation_error", "search was aborted", { reason: "query.aborted", complete: false });
|
|
21950
22109
|
if (context.now() - started > QUERY_LIMITS2.milliseconds)
|
|
21951
|
-
|
|
22110
|
+
outOfTime();
|
|
21952
22111
|
}, "check");
|
|
21953
22112
|
const patternOf = /* @__PURE__ */ __name((pattern, node) => {
|
|
21954
22113
|
check3();
|
|
@@ -22060,7 +22219,8 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
22060
22219
|
exact: true
|
|
22061
22220
|
})), "OR")
|
|
22062
22221
|
], "AND");
|
|
22063
|
-
|
|
22222
|
+
const timeLimit = database.timeLimit ? [{ sql: `${TIME_LIMIT_FUNCTION}(?)`, params: [until], exact: true }] : [];
|
|
22223
|
+
let where = combine([{ sql: "m.deleted_at IS NULL", params: [], exact: true }, scope3, expression, ...timeLimit], "AND");
|
|
22064
22224
|
if (execution.conversationIds !== void 0 || execution.conversationSince !== void 0) {
|
|
22065
22225
|
const ids = execution.conversationIds;
|
|
22066
22226
|
where = combine([
|
|
@@ -22234,7 +22394,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
22234
22394
|
}, "compileQuery");
|
|
22235
22395
|
var withQuerySelection = /* @__PURE__ */ __name((context, execution, consume) => {
|
|
22236
22396
|
const { database } = context;
|
|
22237
|
-
return read(database, () => {
|
|
22397
|
+
return inTime(() => read(database, () => {
|
|
22238
22398
|
const query = compileQuery(context, execution, true);
|
|
22239
22399
|
const { check: check3, leaves, where, from: from2, withRanking, ranked } = query;
|
|
22240
22400
|
check3();
|
|
@@ -22270,9 +22430,16 @@ var withQuerySelection = /* @__PURE__ */ __name((context, execution, consume) =>
|
|
|
22270
22430
|
throw new Error("query selection consumers must run synchronously");
|
|
22271
22431
|
check3();
|
|
22272
22432
|
return result;
|
|
22273
|
-
});
|
|
22433
|
+
}));
|
|
22274
22434
|
}, "withQuerySelection");
|
|
22275
|
-
var runQuery = /* @__PURE__ */ __name(
|
|
22435
|
+
var runQuery = /* @__PURE__ */ __name((context, execution, by) => {
|
|
22436
|
+
try {
|
|
22437
|
+
return runCompiled(context, execution, by).catch(timeLimited);
|
|
22438
|
+
} catch (error) {
|
|
22439
|
+
return timeLimited(error);
|
|
22440
|
+
}
|
|
22441
|
+
}, "runQuery");
|
|
22442
|
+
var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
22276
22443
|
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);
|
|
22277
22444
|
if (by === "pks" && leaves.every(({ test }) => !test)) {
|
|
22278
22445
|
const rows = database.prepare(`${withRanking}SELECT m.id AS id ${from2} WHERE ${where.sql}`).all(...ranked.params, ...where.params);
|
|
@@ -22357,9 +22524,9 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22357
22524
|
})),
|
|
22358
22525
|
hasMore: found2.length > execution.limit
|
|
22359
22526
|
};
|
|
22360
|
-
}, "
|
|
22527
|
+
}, "runCompiled");
|
|
22361
22528
|
|
|
22362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
22363
22530
|
function invalidMetadata() {
|
|
22364
22531
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22365
22532
|
}
|
|
@@ -22461,7 +22628,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22461
22628
|
};
|
|
22462
22629
|
}), "counterTargets");
|
|
22463
22630
|
|
|
22464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
22465
22632
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22466
22633
|
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,
|
|
22467
22634
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -22580,7 +22747,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22580
22747
|
}));
|
|
22581
22748
|
}, "attachmentViews");
|
|
22582
22749
|
|
|
22583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
22584
22751
|
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");
|
|
22585
22752
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22586
22753
|
const { orm, database, now: now2 } = context;
|
|
@@ -22618,7 +22785,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
22618
22785
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22619
22786
|
}, "intoVoiceAttachment");
|
|
22620
22787
|
|
|
22621
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
22622
22789
|
var FIELDS = [
|
|
22623
22790
|
"threadExternalId",
|
|
22624
22791
|
"senderIdentityId",
|
|
@@ -22935,7 +23102,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22935
23102
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22936
23103
|
}, "writeDerivedReactions");
|
|
22937
23104
|
|
|
22938
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
22939
23106
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22940
23107
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22941
23108
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22956,7 +23123,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22956
23123
|
};
|
|
22957
23124
|
}, "keysOver");
|
|
22958
23125
|
|
|
22959
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
22960
23127
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22961
23128
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22962
23129
|
if (!row2)
|
|
@@ -22991,7 +23158,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22991
23158
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22992
23159
|
}, "saveProfile");
|
|
22993
23160
|
|
|
22994
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
22995
23162
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
22996
23163
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22997
23164
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -23048,7 +23215,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
23048
23215
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
23049
23216
|
}, "proposedBySql");
|
|
23050
23217
|
|
|
23051
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
23052
23219
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
23053
23220
|
const owner = ownerPerson(context.database).id;
|
|
23054
23221
|
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);
|
|
@@ -23069,7 +23236,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
23069
23236
|
return personOf(context, ref3);
|
|
23070
23237
|
}, "linkToOwner");
|
|
23071
23238
|
|
|
23072
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
23073
23240
|
var PROVIDERS_SETTING = "providers";
|
|
23074
23241
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
23075
23242
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -23104,7 +23271,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
23104
23271
|
});
|
|
23105
23272
|
}, "registerProvider");
|
|
23106
23273
|
|
|
23107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
23108
23275
|
var DAY3 = 864e5;
|
|
23109
23276
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
23110
23277
|
var TEXT_LIMIT = 20;
|
|
@@ -23303,7 +23470,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23303
23470
|
};
|
|
23304
23471
|
}, "taskSimilarityOver");
|
|
23305
23472
|
|
|
23306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23473
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
23307
23474
|
var SETTING3 = "taskCategories";
|
|
23308
23475
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23309
23476
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23322,7 +23489,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23322
23489
|
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);
|
|
23323
23490
|
}, "saveTaskCategories");
|
|
23324
23491
|
|
|
23325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
23326
23493
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23327
23494
|
var ALLOWED = "taskAgentClose";
|
|
23328
23495
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23378,7 +23545,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
23378
23545
|
];
|
|
23379
23546
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23380
23547
|
|
|
23381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
23382
23549
|
var DEFAULT_DECISION_POLICY = { agentDecisions: true, ruleProposalsOwnerOnly: true };
|
|
23383
23550
|
var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLICY) => {
|
|
23384
23551
|
if (by === "owner")
|
|
@@ -23389,6 +23556,8 @@ var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLI
|
|
|
23389
23556
|
reason,
|
|
23390
23557
|
message: message2
|
|
23391
23558
|
}), "refuse");
|
|
23559
|
+
if (row2.ownerOnly)
|
|
23560
|
+
return refuse("permission_error", "proposal.owner-only", `only the owner decides ${row2.id}`);
|
|
23392
23561
|
if (!policy.agentDecisions)
|
|
23393
23562
|
return refuse("permission_error", "proposals.agent-decisions-off", "agent decisions are turned off; the owner decides");
|
|
23394
23563
|
if (typeof by.reason !== "string" || !by.reason.trim() || by.reason.length > 2e3)
|
|
@@ -23422,10 +23591,10 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
23422
23591
|
}, "assertMayDecide");
|
|
23423
23592
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
23424
23593
|
|
|
23425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
23426
23595
|
var oneLine = /* @__PURE__ */ __name((text5) => singleLine(text5.replace(/\s+/g, " ").trim()), "oneLine");
|
|
23427
23596
|
|
|
23428
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
23429
23598
|
var EXCERPT_CHARS = 280;
|
|
23430
23599
|
var TITLE_CHARS = 120;
|
|
23431
23600
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -23752,7 +23921,7 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
|
|
|
23752
23921
|
var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
|
|
23753
23922
|
var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text5, read2]) => [text5, summaryOf2(read2, options.excerpt === true)])), "refSummariesOf");
|
|
23754
23923
|
|
|
23755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23924
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
23756
23925
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
23757
23926
|
ref: ref3,
|
|
23758
23927
|
kind: read2.kind,
|
|
@@ -23788,7 +23957,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
23788
23957
|
});
|
|
23789
23958
|
}, "evidenceSourcesOf");
|
|
23790
23959
|
|
|
23791
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23960
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
23792
23961
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
23793
23962
|
var MAX_TEXT_CHARS = 2e6;
|
|
23794
23963
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -23814,7 +23983,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
23814
23983
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
23815
23984
|
}, "pdfPreviewLimits");
|
|
23816
23985
|
|
|
23817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
23818
23987
|
import { randomBytes } from "node:crypto";
|
|
23819
23988
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23820
23989
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23827,7 +23996,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23827
23996
|
return time3 + random;
|
|
23828
23997
|
}, "ulid");
|
|
23829
23998
|
|
|
23830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
23831
24000
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23832
24001
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23833
24002
|
if (!meta && !sections?.length)
|
|
@@ -23848,7 +24017,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23848
24017
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23849
24018
|
}, "languageOf");
|
|
23850
24019
|
|
|
23851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
23852
24021
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23853
24022
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
23854
24023
|
if (isObject(value))
|
|
@@ -24091,7 +24260,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
24091
24260
|
};
|
|
24092
24261
|
}, "filesStoreOver");
|
|
24093
24262
|
|
|
24094
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
24095
24264
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
24096
24265
|
entity: "document",
|
|
24097
24266
|
backend: "sql",
|
|
@@ -24137,7 +24306,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
24137
24306
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
24138
24307
|
}, "importedDocumentWhere");
|
|
24139
24308
|
|
|
24140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
24141
24310
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
24142
24311
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
24143
24312
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
@@ -24663,7 +24832,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24663
24832
|
};
|
|
24664
24833
|
}, "notesStoreOver");
|
|
24665
24834
|
|
|
24666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
24667
24836
|
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";
|
|
24668
24837
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
24669
24838
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -24881,7 +25050,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24881
25050
|
};
|
|
24882
25051
|
}, "memoriesStoreOver");
|
|
24883
25052
|
|
|
24884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
24885
25054
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24886
25055
|
var KEY = "taskFirstPassPerChat";
|
|
24887
25056
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24901,7 +25070,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24901
25070
|
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);
|
|
24902
25071
|
}, "saveFirstPassPerChat");
|
|
24903
25072
|
|
|
24904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
24905
25074
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
24906
25075
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
24907
25076
|
name,
|
|
@@ -25122,7 +25291,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
25122
25291
|
return root === void 0 ? void 0 : { ...query, root };
|
|
25123
25292
|
}, "withoutField");
|
|
25124
25293
|
|
|
25125
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
25126
25295
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
25127
25296
|
if (row2.author_type == null)
|
|
25128
25297
|
return null;
|
|
@@ -25150,7 +25319,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
25150
25319
|
return commentsOf(database, task).find((one) => one.ref === `note:${made}`);
|
|
25151
25320
|
}, "addComment");
|
|
25152
25321
|
|
|
25153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25322
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
25154
25323
|
var TASK_RELATION_KINDS = [
|
|
25155
25324
|
"blocked-by",
|
|
25156
25325
|
"follow-up-of",
|
|
@@ -25280,7 +25449,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
25280
25449
|
};
|
|
25281
25450
|
}, "taskRelationsStoreOver");
|
|
25282
25451
|
|
|
25283
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
25284
25453
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
25285
25454
|
var TASK_EVENT_KINDS = [
|
|
25286
25455
|
"created",
|
|
@@ -25809,7 +25978,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
25809
25978
|
};
|
|
25810
25979
|
}, "workTasksOver");
|
|
25811
25980
|
|
|
25812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25981
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
25813
25982
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
25814
25983
|
const { database, now: now2 } = context;
|
|
25815
25984
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -25858,7 +26027,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
25858
26027
|
};
|
|
25859
26028
|
}, "taskCloseOver");
|
|
25860
26029
|
|
|
25861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26030
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
25862
26031
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
25863
26032
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
25864
26033
|
const { database, now: now2 } = context;
|
|
@@ -26077,7 +26246,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
26077
26246
|
};
|
|
26078
26247
|
}, "taskPairsOver");
|
|
26079
26248
|
|
|
26080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
26081
26250
|
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";
|
|
26082
26251
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
26083
26252
|
const { database, now: now2 } = context;
|
|
@@ -26282,7 +26451,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
26282
26451
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
26283
26452
|
}, "oneOf");
|
|
26284
26453
|
|
|
26285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
26286
26455
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
26287
26456
|
const { database } = context;
|
|
26288
26457
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26327,7 +26496,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26327
26496
|
};
|
|
26328
26497
|
}, "accountsStoreOver");
|
|
26329
26498
|
|
|
26330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
26331
26500
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
26332
26501
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
26333
26502
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -26351,7 +26520,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
26351
26520
|
})), "keepDownloads");
|
|
26352
26521
|
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");
|
|
26353
26522
|
|
|
26354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26523
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
26355
26524
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
26356
26525
|
const { database } = context;
|
|
26357
26526
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -26408,7 +26577,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26408
26577
|
}, "keepAttachmentText")
|
|
26409
26578
|
}), "attachmentsStoreOver");
|
|
26410
26579
|
|
|
26411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
26412
26581
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
26413
26582
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
26414
26583
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -26588,7 +26757,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
26588
26757
|
return done;
|
|
26589
26758
|
}, "rekeyChats");
|
|
26590
26759
|
|
|
26591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
26592
26761
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
26593
26762
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
26594
26763
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -26620,7 +26789,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
26620
26789
|
});
|
|
26621
26790
|
}, "chatCompleteness");
|
|
26622
26791
|
|
|
26623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26792
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
26624
26793
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
26625
26794
|
const { database } = context;
|
|
26626
26795
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -26751,7 +26920,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
26751
26920
|
};
|
|
26752
26921
|
}, "chatsStoreOver");
|
|
26753
26922
|
|
|
26754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
26755
26924
|
import { createHash as createHash6 } from "node:crypto";
|
|
26756
26925
|
var BATCH_CONTEXT = 50;
|
|
26757
26926
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -26889,7 +27058,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
26889
27058
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
26890
27059
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
26891
27060
|
|
|
26892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
26893
27062
|
import { setTimeout } from "node:timers/promises";
|
|
26894
27063
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
26895
27064
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -27201,7 +27370,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
27201
27370
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
27202
27371
|
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");
|
|
27203
27372
|
|
|
27204
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
27205
27374
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
27206
27375
|
const { database } = context;
|
|
27207
27376
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -27308,7 +27477,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
27308
27477
|
};
|
|
27309
27478
|
}, "conversationsStoreOver");
|
|
27310
27479
|
|
|
27311
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
27312
27481
|
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";
|
|
27313
27482
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
27314
27483
|
const { database } = context;
|
|
@@ -27333,7 +27502,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
27333
27502
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
27334
27503
|
}), "countersStoreOver");
|
|
27335
27504
|
|
|
27336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27505
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
27337
27506
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
27338
27507
|
var MENTION_QUERY = defineQuery({
|
|
27339
27508
|
entity: "mention",
|
|
@@ -27549,7 +27718,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
27549
27718
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
27550
27719
|
}, "listPlaces");
|
|
27551
27720
|
|
|
27552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
27553
27722
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
27554
27723
|
const { database } = context;
|
|
27555
27724
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -27584,7 +27753,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
27584
27753
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
27585
27754
|
}), "mentionsStoreOver");
|
|
27586
27755
|
|
|
27587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27756
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
27588
27757
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
27589
27758
|
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");
|
|
27590
27759
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -27599,7 +27768,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
27599
27768
|
}));
|
|
27600
27769
|
}, "documentLinkMessages");
|
|
27601
27770
|
|
|
27602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27771
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
27603
27772
|
var stemmerFor = stemmerCache();
|
|
27604
27773
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
27605
27774
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -27643,7 +27812,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
27643
27812
|
});
|
|
27644
27813
|
}, "laterSharingRare");
|
|
27645
27814
|
|
|
27646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
27647
27816
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
27648
27817
|
const { database } = context;
|
|
27649
27818
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -27668,9 +27837,9 @@ var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
|
27668
27837
|
const chatKey = chatKeyOf(key2, chatId);
|
|
27669
27838
|
return chatKey === void 0 ? { items: [], hasMore: false } : messagePage(context, chatKey, window);
|
|
27670
27839
|
}, "messages"),
|
|
27671
|
-
countMessages: /* @__PURE__ */ __name(async (key2, chatId, { since } = {}) => {
|
|
27840
|
+
countMessages: /* @__PURE__ */ __name(async (key2, chatId, { since, until } = {}) => {
|
|
27672
27841
|
const chatKey = chatKeyOf(key2, chatId);
|
|
27673
|
-
return chatKey === void 0 ? 0 : countMessages(context, chatKey, since);
|
|
27842
|
+
return chatKey === void 0 ? 0 : countMessages(context, chatKey, since, until);
|
|
27674
27843
|
}, "countMessages"),
|
|
27675
27844
|
changes: /* @__PURE__ */ __name(async (key2, chatId, at) => {
|
|
27676
27845
|
const chatKey = chatKeyOf(key2, chatId);
|
|
@@ -27778,7 +27947,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
27778
27947
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
27779
27948
|
}), "messagesStoreOver");
|
|
27780
27949
|
|
|
27781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
27782
27951
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
27783
27952
|
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
27784
27953
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -27835,7 +28004,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
27835
28004
|
});
|
|
27836
28005
|
}, "personPreparation");
|
|
27837
28006
|
|
|
27838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
27839
28008
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
27840
28009
|
const id2 = Number(uid);
|
|
27841
28010
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -27843,7 +28012,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
27843
28012
|
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)));
|
|
27844
28013
|
}, "personSeenInAccounts");
|
|
27845
28014
|
|
|
27846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28015
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
27847
28016
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
27848
28017
|
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);
|
|
27849
28018
|
if (!row2)
|
|
@@ -27909,7 +28078,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
27909
28078
|
return { id: id2, personId, removed: true };
|
|
27910
28079
|
}, "removeNote");
|
|
27911
28080
|
|
|
27912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
27913
28082
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
27914
28083
|
const { database } = context;
|
|
27915
28084
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -27994,13 +28163,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
27994
28163
|
};
|
|
27995
28164
|
}, "peopleStoreOver");
|
|
27996
28165
|
|
|
27997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
27998
28167
|
import { createHash as createHash8 } from "node:crypto";
|
|
27999
28168
|
|
|
28000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28169
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
28001
28170
|
import { createHash as createHash7 } from "node:crypto";
|
|
28002
28171
|
|
|
28003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
28004
28173
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
28005
28174
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
28006
28175
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -28222,7 +28391,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
28222
28391
|
};
|
|
28223
28392
|
}, "rankReplyGraph");
|
|
28224
28393
|
|
|
28225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
28226
28395
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
28227
28396
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
28228
28397
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -28396,7 +28565,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
28396
28565
|
return { items, evidence, summary, graph: graph.quality };
|
|
28397
28566
|
}, "calculateAdminStatistics");
|
|
28398
28567
|
|
|
28399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28568
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
28400
28569
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
28401
28570
|
const dates = [];
|
|
28402
28571
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -28418,7 +28587,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
28418
28587
|
return dates[0].node.resolution.date;
|
|
28419
28588
|
}, "rankingContextRange");
|
|
28420
28589
|
|
|
28421
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28590
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
28422
28591
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
28423
28592
|
let counts;
|
|
28424
28593
|
try {
|
|
@@ -28713,7 +28882,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
28713
28882
|
});
|
|
28714
28883
|
}, "rankQuery");
|
|
28715
28884
|
|
|
28716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28885
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
28717
28886
|
function fail4(message2, reason = "query.too-large") {
|
|
28718
28887
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
28719
28888
|
}
|
|
@@ -28890,7 +29059,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
28890
29059
|
return result;
|
|
28891
29060
|
}), "adminStatisticsQuery");
|
|
28892
29061
|
|
|
28893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
28894
29063
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
28895
29064
|
if (!execution.accounts.length)
|
|
28896
29065
|
return { conversations: [], chats: [] };
|
|
@@ -28908,7 +29077,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
28908
29077
|
return { conversations: conversations2, chats: chats2 };
|
|
28909
29078
|
}, "conversationEligibility");
|
|
28910
29079
|
|
|
28911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29080
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
28912
29081
|
import { createHash as createHash9 } from "node:crypto";
|
|
28913
29082
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
28914
29083
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -29058,7 +29227,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
29058
29227
|
return result;
|
|
29059
29228
|
}, "rankingEvidence");
|
|
29060
29229
|
|
|
29061
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
29062
29231
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
29063
29232
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
29064
29233
|
if (execution.corpus === "mail")
|
|
@@ -29077,7 +29246,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
29077
29246
|
};
|
|
29078
29247
|
}, "queriesStoreOver");
|
|
29079
29248
|
|
|
29080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
29081
29250
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
29082
29251
|
const { database, now: now2 } = context;
|
|
29083
29252
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -29116,10 +29285,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
29116
29285
|
}));
|
|
29117
29286
|
}, "chatEventsOf");
|
|
29118
29287
|
|
|
29119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
29120
29289
|
import { createHash as createHash10 } from "node:crypto";
|
|
29121
29290
|
|
|
29122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
29123
29292
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
29124
29293
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
29125
29294
|
timeZone: zone,
|
|
@@ -29134,7 +29303,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
29134
29303
|
};
|
|
29135
29304
|
}, "calendarKey");
|
|
29136
29305
|
|
|
29137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
29138
29307
|
var RETENTION_TOLERANCE = 864e5;
|
|
29139
29308
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
29140
29309
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -29188,7 +29357,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
29188
29357
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
29189
29358
|
}, "retentionCohorts");
|
|
29190
29359
|
|
|
29191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
29192
29361
|
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
29193
29362
|
var week = /* @__PURE__ */ __name((day) => {
|
|
29194
29363
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
@@ -29324,7 +29493,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
29324
29493
|
};
|
|
29325
29494
|
}, "retentionQuery");
|
|
29326
29495
|
|
|
29327
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
29328
29497
|
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
29329
29498
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
29330
29499
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -29455,7 +29624,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
29455
29624
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
29456
29625
|
})), "trackedChats");
|
|
29457
29626
|
|
|
29458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29627
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
29459
29628
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
29460
29629
|
const { database } = context;
|
|
29461
29630
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -29511,7 +29680,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29511
29680
|
};
|
|
29512
29681
|
}, "rosterStoreOver");
|
|
29513
29682
|
|
|
29514
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29683
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
29515
29684
|
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");
|
|
29516
29685
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
29517
29686
|
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 ?`);
|
|
@@ -29535,7 +29704,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
29535
29704
|
}
|
|
29536
29705
|
}, "backfillNormalized");
|
|
29537
29706
|
|
|
29538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
29539
29708
|
var INDEX2 = "message_words";
|
|
29540
29709
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
29541
29710
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -29662,7 +29831,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
29662
29831
|
});
|
|
29663
29832
|
}, "resetSearchIndex");
|
|
29664
29833
|
|
|
29665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29834
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
29666
29835
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
29667
29836
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
29668
29837
|
const before2 = stemsState(database);
|
|
@@ -29757,7 +29926,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
29757
29926
|
return resetStems(database, { now: now2 });
|
|
29758
29927
|
}, "followDefaultStemmers");
|
|
29759
29928
|
|
|
29760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29929
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
29761
29930
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
29762
29931
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
29763
29932
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -29779,7 +29948,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
29779
29948
|
});
|
|
29780
29949
|
}, "termCandidates");
|
|
29781
29950
|
|
|
29782
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
29783
29952
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
29784
29953
|
const { database } = context;
|
|
29785
29954
|
const stemmerFor2 = stemmerCache();
|
|
@@ -29801,7 +29970,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29801
29970
|
};
|
|
29802
29971
|
}, "searchIndexStoreOver");
|
|
29803
29972
|
|
|
29804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29973
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
29805
29974
|
var HISTORY_KEPT = 1e3;
|
|
29806
29975
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
29807
29976
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -29870,7 +30039,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
29870
30039
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
29871
30040
|
}, "clearHistory");
|
|
29872
30041
|
|
|
29873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30042
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
29874
30043
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
29875
30044
|
const { database } = context;
|
|
29876
30045
|
return {
|
|
@@ -29894,7 +30063,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29894
30063
|
};
|
|
29895
30064
|
}, "searchesStoreOver");
|
|
29896
30065
|
|
|
29897
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
29898
30067
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
29899
30068
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
29900
30069
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -29937,7 +30106,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
29937
30106
|
};
|
|
29938
30107
|
}, "agentActionsStoreOver");
|
|
29939
30108
|
|
|
29940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
29941
30110
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
29942
30111
|
}) => {
|
|
29943
30112
|
const { database, now: now2 } = context;
|
|
@@ -29996,7 +30165,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
29996
30165
|
};
|
|
29997
30166
|
}, "botUpdateStoreOver");
|
|
29998
30167
|
|
|
29999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30168
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
30000
30169
|
var DAY4 = 864e5;
|
|
30001
30170
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
30002
30171
|
if (filter.accountIds !== void 0 && filter.accountId !== void 0)
|
|
@@ -30105,7 +30274,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
30105
30274
|
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);
|
|
30106
30275
|
}, "listEvents");
|
|
30107
30276
|
|
|
30108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
30109
30278
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
30110
30279
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
30111
30280
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -30160,7 +30329,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
30160
30329
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
30161
30330
|
}, "forgetCalendarRows");
|
|
30162
30331
|
|
|
30163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
30164
30333
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
30165
30334
|
id: Number(row2.id),
|
|
30166
30335
|
accountId: Number(row2.account_id),
|
|
@@ -30747,7 +30916,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30747
30916
|
};
|
|
30748
30917
|
}, "eventStoreOver");
|
|
30749
30918
|
|
|
30750
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
30751
30920
|
var CATALOG_QUERY = defineQuery({
|
|
30752
30921
|
entity: "document",
|
|
30753
30922
|
backend: "sql",
|
|
@@ -30989,7 +31158,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30989
31158
|
};
|
|
30990
31159
|
}, "catalogStoreOver");
|
|
30991
31160
|
|
|
30992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
30993
31162
|
import { createHash as createHash11 } from "node:crypto";
|
|
30994
31163
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
30995
31164
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -31087,7 +31256,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
31087
31256
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
31088
31257
|
}, "contextEvidenceRequest");
|
|
31089
31258
|
|
|
31090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
31091
31260
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
31092
31261
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
31093
31262
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -31100,7 +31269,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
31100
31269
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
31101
31270
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
31102
31271
|
|
|
31103
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31272
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
31104
31273
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
31105
31274
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
31106
31275
|
signal?.throwIfAborted();
|
|
@@ -31199,7 +31368,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
31199
31368
|
});
|
|
31200
31369
|
}, "readMeetingContextEvidence");
|
|
31201
31370
|
|
|
31202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31371
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
31203
31372
|
var corpora = {
|
|
31204
31373
|
message: {
|
|
31205
31374
|
table: "messages",
|
|
@@ -31438,7 +31607,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
31438
31607
|
}
|
|
31439
31608
|
}), "contextRecordsOver");
|
|
31440
31609
|
|
|
31441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31610
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
31442
31611
|
var NOTE_FIELDS = [
|
|
31443
31612
|
"text",
|
|
31444
31613
|
"exact",
|
|
@@ -31537,7 +31706,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
31537
31706
|
if (query.signal?.aborted)
|
|
31538
31707
|
throw new CliError("validation_error", "search was aborted", { reason: "query.aborted", complete: false });
|
|
31539
31708
|
if (context.now() - started > QUERY_LIMITS2.milliseconds)
|
|
31540
|
-
|
|
31709
|
+
outOfTime();
|
|
31541
31710
|
}, "check");
|
|
31542
31711
|
const tests = /* @__PURE__ */ new Map();
|
|
31543
31712
|
const fragments = /* @__PURE__ */ new Map();
|
|
@@ -31868,7 +32037,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
31868
32037
|
};
|
|
31869
32038
|
}, "noteSearchOver");
|
|
31870
32039
|
|
|
31871
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32040
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
31872
32041
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
31873
32042
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
31874
32043
|
var EVENT_CORPUS = {
|
|
@@ -32000,7 +32169,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
32000
32169
|
};
|
|
32001
32170
|
}, "eventSearchOver");
|
|
32002
32171
|
|
|
32003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
32004
32173
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32005
32174
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32006
32175
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32016,10 +32185,11 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFinding
|
|
|
32016
32185
|
singular: "evidence finding",
|
|
32017
32186
|
cited: "reference",
|
|
32018
32187
|
reference,
|
|
32019
|
-
anySubject: true
|
|
32188
|
+
anySubject: true,
|
|
32189
|
+
payments: true
|
|
32020
32190
|
}), "validateEvidenceFindings");
|
|
32021
32191
|
|
|
32022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32192
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
32023
32193
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
32024
32194
|
try {
|
|
32025
32195
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -32031,7 +32201,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
32031
32201
|
}
|
|
32032
32202
|
}, "calendarMoment");
|
|
32033
32203
|
|
|
32034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
32035
32205
|
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";
|
|
32036
32206
|
var iso8 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
32037
32207
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -32057,6 +32227,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32057
32227
|
scope: row2.scope == null ? null : row2.scope,
|
|
32058
32228
|
source: String(row2.source),
|
|
32059
32229
|
evidence: evidenceOf(context, { type: "fact", id: Number(row2.id) }),
|
|
32230
|
+
payment: row2.type === "payment" ? paymentOf(row2.metadata) : null,
|
|
32060
32231
|
createdAt: iso8(row2.created_at),
|
|
32061
32232
|
updatedAt: iso8(row2.updated_at)
|
|
32062
32233
|
}), "factOf");
|
|
@@ -32071,7 +32242,11 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32071
32242
|
proposedBy: proposerOf(database, row2.author_type, row2.author_id),
|
|
32072
32243
|
proposed: row2.status === "proposed"
|
|
32073
32244
|
}, by), "withdrawn");
|
|
32074
|
-
const decided = /* @__PURE__ */ __name((row2, by) => assertMayDecide({
|
|
32245
|
+
const decided = /* @__PURE__ */ __name((row2, by) => assertMayDecide({
|
|
32246
|
+
id: `fact:${row2.id}`,
|
|
32247
|
+
proposedBy: proposerOf(database, row2.author_type, row2.author_id),
|
|
32248
|
+
ownerOnly: row2.type === "payment"
|
|
32249
|
+
}, by, context.decisions), "decided");
|
|
32075
32250
|
const keepDecision = /* @__PURE__ */ __name((id2, by, reason) => {
|
|
32076
32251
|
const why = [by === "owner" ? void 0 : by.reason.trim(), reason?.trim() || void 0].filter(Boolean).join(": ");
|
|
32077
32252
|
if (by === "owner" && !why)
|
|
@@ -32100,6 +32275,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32100
32275
|
const occurredAt = input.occurredAt === void 0 ? null : calendarMoment(input.occurredAt, "occurredAt");
|
|
32101
32276
|
if (occurredAt !== null && !Number.isFinite(occurredAt))
|
|
32102
32277
|
throw new CliError("validation_error", "occurredAt takes an ISO timestamp");
|
|
32278
|
+
const payment = paymentInput(type, input);
|
|
32103
32279
|
const id2 = write(database, () => {
|
|
32104
32280
|
const project = input.project === void 0 ? void 0 : requiredThing(database, input.project, "the project");
|
|
32105
32281
|
if (project && project.type !== "project")
|
|
@@ -32108,10 +32284,14 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32108
32284
|
const replaced = input.supersedes === void 0 ? void 0 : rowOf2(input.supersedes);
|
|
32109
32285
|
if (replaced && replaced.status !== "proposed" && replaced.status !== "accepted")
|
|
32110
32286
|
throw new CliError("validation_error", `${input.supersedes} is ${String(replaced.status)}; only a proposed or accepted fact can be corrected`);
|
|
32287
|
+
if (replaced && replaced.type === "payment" !== (type === "payment"))
|
|
32288
|
+
throw new CliError("validation_error", "a payment fact corrects a payment fact, and only one");
|
|
32289
|
+
if (payment?.counterparty)
|
|
32290
|
+
requiredThing(database, payment.counterparty, "the counterparty");
|
|
32111
32291
|
const owner = input.by === "owner";
|
|
32112
32292
|
const { actor, model } = authorActor(context, input.by);
|
|
32113
32293
|
const at = now2();
|
|
32114
|
-
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, created_at, updated_at) VALUES (?, ?, ?, 'proposed', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(nextId(database, "facts"), type, statement, project?.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", at, at)?.id);
|
|
32294
|
+
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, project?.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", payment ? JSON.stringify({ payment }) : null, at, at)?.id);
|
|
32115
32295
|
linkEvidence(context, { type: "fact", id: made }, input.evidence ?? [], owner ? "owner" : "agent");
|
|
32116
32296
|
if (input.createdFrom !== void 0) {
|
|
32117
32297
|
const from2 = requiredThing(database, input.createdFrom, "the source");
|
|
@@ -32129,7 +32309,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32129
32309
|
const subject2 = options.subject === void 0 ? void 0 : requiredThing(database, options.subject);
|
|
32130
32310
|
const by = proposedBySql("f.author_type", "f.author_id", options.proposedBy);
|
|
32131
32311
|
const order = options.order === "created" ? "f.created_at" : "coalesce(f.occurred_at, f.created_at)";
|
|
32132
|
-
|
|
32312
|
+
const paid = paymentSql(options.payment);
|
|
32313
|
+
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}${paid.sql} ORDER BY ${order} DESC, f.id DESC LIMIT ?`).all(options.type ?? null, options.type ?? null, project?.id ?? null, project?.id ?? null, subject2?.type ?? null, subject2?.type ?? null, subject2?.id ?? null, options.status ?? null, options.status ?? null, ...by.params, ...paid.params, Math.min(Math.max(options.limit ?? 100, 1), 500)).map(factOf);
|
|
32133
32314
|
}, "list"),
|
|
32134
32315
|
accept: /* @__PURE__ */ __name((reference2, by, reason) => {
|
|
32135
32316
|
const row2 = rowOf2(reference2);
|
|
@@ -32186,6 +32367,51 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32186
32367
|
sources: /* @__PURE__ */ __name((reference2) => evidenceSourcesOf(database, { type: "fact", id: Number(rowOf2(reference2).id) }), "sources")
|
|
32187
32368
|
};
|
|
32188
32369
|
}, "factOperationsOver");
|
|
32370
|
+
var paymentInput = /* @__PURE__ */ __name((type, input) => {
|
|
32371
|
+
if (type !== "payment") {
|
|
32372
|
+
if (input.payment !== void 0)
|
|
32373
|
+
throw new CliError("validation_error", "only a payment fact takes a payment");
|
|
32374
|
+
return void 0;
|
|
32375
|
+
}
|
|
32376
|
+
if (input.payment === void 0)
|
|
32377
|
+
throw new CliError("validation_error", "a payment fact needs its payment: amount, currency, direction and state");
|
|
32378
|
+
const evidence = input.evidence?.length ?? 0;
|
|
32379
|
+
if (evidence < 1 || evidence > 8)
|
|
32380
|
+
throw new CliError("validation_error", "a payment fact cites 1\u20138 references: the ask, the transfer or a sheet row");
|
|
32381
|
+
return validatePayment(input.payment);
|
|
32382
|
+
}, "paymentInput");
|
|
32383
|
+
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
32384
|
+
if (metadata3 == null)
|
|
32385
|
+
return null;
|
|
32386
|
+
try {
|
|
32387
|
+
const { payment } = JSON.parse(String(metadata3));
|
|
32388
|
+
return payment ?? null;
|
|
32389
|
+
} catch {
|
|
32390
|
+
return null;
|
|
32391
|
+
}
|
|
32392
|
+
}, "paymentOf");
|
|
32393
|
+
var paymentSql = /* @__PURE__ */ __name((filter) => {
|
|
32394
|
+
if (filter === void 0)
|
|
32395
|
+
return { sql: "", params: [] };
|
|
32396
|
+
const parts = ["f.type = 'payment'"];
|
|
32397
|
+
const params = [];
|
|
32398
|
+
const state = filter.open ? "expected" : filter.state;
|
|
32399
|
+
if (filter.open && filter.state !== void 0 && filter.state !== "expected")
|
|
32400
|
+
parts.push("0");
|
|
32401
|
+
if (filter.direction !== void 0) {
|
|
32402
|
+
parts.push("json_extract(f.metadata, '$.payment.direction') = ?");
|
|
32403
|
+
params.push(filter.direction);
|
|
32404
|
+
}
|
|
32405
|
+
if (state !== void 0) {
|
|
32406
|
+
parts.push("json_extract(f.metadata, '$.payment.state') = ?");
|
|
32407
|
+
params.push(state);
|
|
32408
|
+
}
|
|
32409
|
+
if (filter.open)
|
|
32410
|
+
parts.push("f.status IN ('proposed', 'accepted')");
|
|
32411
|
+
if (filter.open === false)
|
|
32412
|
+
parts.push("NOT (json_extract(f.metadata, '$.payment.state') = 'expected' AND f.status IN ('proposed', 'accepted'))");
|
|
32413
|
+
return { sql: ` AND ${parts.join(" AND ")}`, params };
|
|
32414
|
+
}, "paymentSql");
|
|
32189
32415
|
var migratedFrom = /* @__PURE__ */ __name((metadata3) => {
|
|
32190
32416
|
try {
|
|
32191
32417
|
const { memory } = JSON.parse(metadata3);
|
|
@@ -32208,7 +32434,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32208
32434
|
};
|
|
32209
32435
|
}, "factsStoreOver");
|
|
32210
32436
|
|
|
32211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32437
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
32212
32438
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
32213
32439
|
throw new CliError("validation_error", message2);
|
|
32214
32440
|
}, "invalid");
|
|
@@ -32270,6 +32496,19 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
32270
32496
|
});
|
|
32271
32497
|
return facts2.acceptChecked(fact.ref, decidedBy).ref;
|
|
32272
32498
|
}
|
|
32499
|
+
if (finding.kind === "payment") {
|
|
32500
|
+
const fact = facts2.add({
|
|
32501
|
+
type: "payment",
|
|
32502
|
+
statement: finding.statement ?? paymentTitle(finding),
|
|
32503
|
+
payment: finding.payment,
|
|
32504
|
+
...finding.project === void 0 ? {} : { project: finding.project },
|
|
32505
|
+
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
32506
|
+
...finding.supersedes === void 0 ? {} : { supersedes: finding.supersedes },
|
|
32507
|
+
evidence,
|
|
32508
|
+
by: agent
|
|
32509
|
+
});
|
|
32510
|
+
return facts2.acceptChecked(fact.ref, decidedBy).ref;
|
|
32511
|
+
}
|
|
32273
32512
|
if (finding.project === void 0)
|
|
32274
32513
|
return invalid2("a task finding names the project the task goes in");
|
|
32275
32514
|
const task = tasks2.create({
|
|
@@ -32307,7 +32546,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
32307
32546
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
32308
32547
|
}, "findingsCoreOver");
|
|
32309
32548
|
|
|
32310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32549
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
32311
32550
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32312
32551
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32313
32552
|
var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32467,7 +32706,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32467
32706
|
};
|
|
32468
32707
|
}, "proposedActionsStoreOver");
|
|
32469
32708
|
|
|
32470
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
32471
32710
|
var stale = /* @__PURE__ */ __name(() => {
|
|
32472
32711
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
32473
32712
|
reason: "evidence-findings.stale"
|
|
@@ -32608,7 +32847,11 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32608
32847
|
const { author, decision: checked } = decider(decision.by);
|
|
32609
32848
|
const reason = typeof decision.reason === "string" ? decision.reason.trim().slice(0, 2e3) : "";
|
|
32610
32849
|
const decidedBy = reason && checked.by === "owner" ? { ...checked, reason } : reason && checked.by === "agent" ? { ...checked, reason: `${checked.reason}: ${reason}` } : checked;
|
|
32611
|
-
assertMayDecide({
|
|
32850
|
+
assertMayDecide({
|
|
32851
|
+
id: id2,
|
|
32852
|
+
proposedBy: proposals.proposer(id2),
|
|
32853
|
+
ownerOnly: batch.input.findings.some((finding) => finding.kind === "payment")
|
|
32854
|
+
}, decision.by, context.decisions);
|
|
32612
32855
|
if (batch.receipt) {
|
|
32613
32856
|
if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
|
|
32614
32857
|
return invalid3("this findings batch was already reviewed with a different decision");
|
|
@@ -32644,7 +32887,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32644
32887
|
};
|
|
32645
32888
|
}, "evidenceFindingsStoreOver");
|
|
32646
32889
|
|
|
32647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
32648
32891
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
32649
32892
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
32650
32893
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -32697,7 +32940,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
32697
32940
|
}, "forPerson")
|
|
32698
32941
|
}), "involvementStoreOver");
|
|
32699
32942
|
|
|
32700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
32701
32944
|
import { createHash as createHash12 } from "node:crypto";
|
|
32702
32945
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
32703
32946
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -32783,7 +33026,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
32783
33026
|
};
|
|
32784
33027
|
}, "meetingProjectsStoreOver");
|
|
32785
33028
|
|
|
32786
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
32787
33030
|
var relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
32788
33031
|
id: link3.id,
|
|
32789
33032
|
from: link3.from,
|
|
@@ -32817,16 +33060,58 @@ var relationProposalsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32817
33060
|
database.prepare("UPDATE links SET role = CASE WHEN ? THEN ? ELSE role END, purpose = CASE WHEN ? THEN ? ELSE purpose END, updated_at = ? WHERE id = ?").run(Number("role" in changes), changes.role ?? null, Number("purpose" in changes), changes.purpose ?? null, now2(), Number(link3.id));
|
|
32818
33061
|
return linkOf(database, database.prepare("SELECT * FROM links WHERE id = ?").get(Number(link3.id)));
|
|
32819
33062
|
}, "applyUpdate");
|
|
33063
|
+
const rescored = /* @__PURE__ */ __name((action, input, scored, by) => {
|
|
33064
|
+
const proposer = proposerOfAction(action);
|
|
33065
|
+
const own = proposer.type === "bot" && proposer.kind === "rule" && botKey(proposer.name) === botKey(by.bot);
|
|
33066
|
+
const before2 = action.payload;
|
|
33067
|
+
const payload = own ? {
|
|
33068
|
+
...before2,
|
|
33069
|
+
...scored,
|
|
33070
|
+
evidence: input.evidence ?? [],
|
|
33071
|
+
...input.purpose === void 0 ? {} : { purpose: purposeOf(input.purpose) }
|
|
33072
|
+
} : { ...before2, ...scored };
|
|
33073
|
+
const reason = own && input.reason !== void 0 ? input.reason : action.reason;
|
|
33074
|
+
if (JSON.stringify(payload) === JSON.stringify(before2) && reason === action.reason)
|
|
33075
|
+
return action;
|
|
33076
|
+
database.prepare("UPDATE proposed_actions SET payload = ?, reason = ?, updated_at = ? WHERE id = ? AND status = 'proposed'").run(JSON.stringify(payload), reason, now2(), Number(action.id));
|
|
33077
|
+
return operations.get(action.id);
|
|
33078
|
+
}, "rescored");
|
|
32820
33079
|
return {
|
|
32821
|
-
/**
|
|
33080
|
+
/**
|
|
33081
|
+
* Where a pair stands before a scan proposes it: a link joins it, a `relationship` proposal for it was rejected,
|
|
33082
|
+
* or one is pending. A rejection is matched by the pair alone, whoever proposed it and with whatever scorer.
|
|
33083
|
+
*/
|
|
33084
|
+
state: /* @__PURE__ */ __name((paired, { to, kind: kind3 }) => {
|
|
33085
|
+
let found2;
|
|
33086
|
+
try {
|
|
33087
|
+
found2 = paired();
|
|
33088
|
+
} catch (error) {
|
|
33089
|
+
if (error instanceof CliError && (error.code === "not_found" || error.code === "validation_error"))
|
|
33090
|
+
return;
|
|
33091
|
+
throw error;
|
|
33092
|
+
}
|
|
33093
|
+
const { from: from2, existing } = found2;
|
|
33094
|
+
const rows = database.prepare("SELECT id, status FROM proposed_actions WHERE kind='relationship' AND status IN ('proposed','rejected') AND target_type=? AND target_id=? AND json_extract(payload,'$.to')=? AND json_extract(payload,'$.kind')=? ORDER BY id").all(from2.type, from2.id, to, kind3);
|
|
33095
|
+
const pending = rows.find((row2) => row2.status === "proposed");
|
|
33096
|
+
return {
|
|
33097
|
+
linked: existing !== void 0,
|
|
33098
|
+
confirmed: existing !== void 0 && Number(existing.confirmed) === 1,
|
|
33099
|
+
rejected: rows.some((row2) => row2.status === "rejected"),
|
|
33100
|
+
pending: pending ? operations.get(String(pending.id)) : null
|
|
33101
|
+
};
|
|
33102
|
+
}, "state"),
|
|
33103
|
+
/** The same pending pair returns the proposal already held; a scored one updates its score in place. */
|
|
32822
33104
|
propose: /* @__PURE__ */ __name((from2, input, by) => {
|
|
32823
33105
|
const evidence = input.evidence ?? [];
|
|
32824
33106
|
if (!Array.isArray(evidence) || evidence.length > 5 || evidence.some((ref3) => typeof ref3 !== "string"))
|
|
32825
33107
|
throw new CliError("validation_error", "a relationship proposal cites up to 5 references");
|
|
33108
|
+
const scored = scoredOf(input);
|
|
32826
33109
|
return write(database, () => {
|
|
32827
33110
|
const held = database.prepare("SELECT id FROM proposed_actions WHERE kind='relationship' AND status='proposed' AND target_type=? AND target_id=? AND json_extract(payload,'$.to')=? AND json_extract(payload,'$.kind')=? ORDER BY id LIMIT 1").get(from2.type, from2.id, input.to, input.kind);
|
|
32828
|
-
if (held)
|
|
32829
|
-
|
|
33111
|
+
if (held) {
|
|
33112
|
+
const action = operations.get(String(held.id));
|
|
33113
|
+
return scored ? rescored(action, input, scored, by) : action;
|
|
33114
|
+
}
|
|
32830
33115
|
return operations.propose({
|
|
32831
33116
|
kind: "relationship",
|
|
32832
33117
|
by,
|
|
@@ -32837,7 +33122,8 @@ var relationProposalsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32837
33122
|
kind: input.kind,
|
|
32838
33123
|
...input.role === void 0 ? {} : { role: input.role },
|
|
32839
33124
|
...input.purpose === void 0 ? {} : { purpose: purposeOf(input.purpose) },
|
|
32840
|
-
evidence
|
|
33125
|
+
evidence,
|
|
33126
|
+
...scored
|
|
32841
33127
|
},
|
|
32842
33128
|
...input.reason === void 0 ? {} : { reason: input.reason }
|
|
32843
33129
|
});
|
|
@@ -32933,6 +33219,17 @@ var relationProposalsOver = /* @__PURE__ */ __name((context) => {
|
|
|
32933
33219
|
}), "decideLink")
|
|
32934
33220
|
};
|
|
32935
33221
|
}, "relationProposalsOver");
|
|
33222
|
+
var scoredOf = /* @__PURE__ */ __name((input) => {
|
|
33223
|
+
if (input.score === void 0 && input.signals === void 0)
|
|
33224
|
+
return void 0;
|
|
33225
|
+
const { score, signals } = input;
|
|
33226
|
+
if (typeof score !== "number" || !(score >= 0 && score <= 1) || !Array.isArray(signals) || signals.length > 20)
|
|
33227
|
+
throw new CliError("validation_error", "a scored proposal takes a score of 0\u20131 and up to 20 signals");
|
|
33228
|
+
for (const signal of signals)
|
|
33229
|
+
if (typeof signal?.scorer !== "string" || typeof signal.why !== "string" || signal.why.length > 500 || typeof signal.weight !== "number" || !(signal.weight >= 0 && signal.weight <= 1))
|
|
33230
|
+
throw new CliError("validation_error", "a signal names its scorer, a weight of 0\u20131 and why, up to 500 characters");
|
|
33231
|
+
return { score, signals: signals.map(({ scorer, weight, why }) => ({ scorer, weight, why })) };
|
|
33232
|
+
}, "scoredOf");
|
|
32936
33233
|
var changesOf = /* @__PURE__ */ __name((input) => {
|
|
32937
33234
|
const changes = {};
|
|
32938
33235
|
if (input.role !== void 0)
|
|
@@ -32955,16 +33252,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
32955
33252
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
32956
33253
|
}, "decidedOrigin");
|
|
32957
33254
|
|
|
32958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
32959
33256
|
import { createHash as createHash15 } from "node:crypto";
|
|
32960
33257
|
|
|
32961
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
32962
33259
|
import { createHash as createHash14 } from "node:crypto";
|
|
32963
33260
|
|
|
32964
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
32965
33262
|
import { createHash as createHash13 } from "node:crypto";
|
|
32966
33263
|
|
|
32967
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
32968
33265
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
32969
33266
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
32970
33267
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -33015,7 +33312,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
33015
33312
|
return input;
|
|
33016
33313
|
}, "consolidationApplyInput");
|
|
33017
33314
|
|
|
33018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
33019
33316
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
33020
33317
|
id: String(row2.id),
|
|
33021
33318
|
sourceId: String(row2.source_id),
|
|
@@ -33090,7 +33387,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
33090
33387
|
}, { beforeCommit: check3 });
|
|
33091
33388
|
}, "applyTagConsolidation");
|
|
33092
33389
|
|
|
33093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
33094
33391
|
var selections = [
|
|
33095
33392
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
33096
33393
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -33234,7 +33531,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
33234
33531
|
};
|
|
33235
33532
|
}, "previewRows");
|
|
33236
33533
|
|
|
33237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
33238
33535
|
var kinds = ["project", "tag", "topic"];
|
|
33239
33536
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
33240
33537
|
if (signal?.aborted)
|
|
@@ -33498,7 +33795,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33498
33795
|
};
|
|
33499
33796
|
}, "vocabularyStoreOver");
|
|
33500
33797
|
|
|
33501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
33502
33799
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
33503
33800
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
33504
33801
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -33944,6 +34241,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33944
34241
|
});
|
|
33945
34242
|
return proposals.propose(from2, input, by);
|
|
33946
34243
|
}, "proposeRelation"),
|
|
34244
|
+
relationState: /* @__PURE__ */ __name(async (key2, input) => proposals.state(() => pair(key2, input), input), "relationState"),
|
|
33947
34245
|
updateRelation: /* @__PURE__ */ __name((async (key2, id2, input) => {
|
|
33948
34246
|
checked(key2);
|
|
33949
34247
|
const link3 = linkOf(database, relation(id2));
|
|
@@ -34054,7 +34352,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
34054
34352
|
return key2.padEnd(3, "X");
|
|
34055
34353
|
}, "projectKey");
|
|
34056
34354
|
|
|
34057
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
34058
34356
|
var DAY5 = 864e5;
|
|
34059
34357
|
var SETTING4 = "logs_pruned_at";
|
|
34060
34358
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -34081,7 +34379,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
34081
34379
|
};
|
|
34082
34380
|
}, "logPruner");
|
|
34083
34381
|
|
|
34084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
34085
34383
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
34086
34384
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
34087
34385
|
reason: "meeting-findings.stale"
|
|
@@ -34249,7 +34547,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34249
34547
|
};
|
|
34250
34548
|
}, "meetingFindingsStoreOver");
|
|
34251
34549
|
|
|
34252
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
34253
34551
|
var RANK_BATCH = 512;
|
|
34254
34552
|
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";
|
|
34255
34553
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -34520,7 +34818,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
34520
34818
|
}
|
|
34521
34819
|
}), "meetingVectorsOver");
|
|
34522
34820
|
|
|
34523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34821
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
34524
34822
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
34525
34823
|
var TEXTS = {
|
|
34526
34824
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -34621,11 +34919,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34621
34919
|
};
|
|
34622
34920
|
}, "sourceMentionStoreOver");
|
|
34623
34921
|
|
|
34624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
34625
34923
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
34626
34924
|
import { dirname } from "node:path";
|
|
34627
34925
|
|
|
34628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
34629
34927
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
34630
34928
|
var CLIENTS_SETTING = "clients";
|
|
34631
34929
|
var coreVersion = (() => {
|
|
@@ -34683,7 +34981,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
34683
34981
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
34684
34982
|
}, "refusalAdvice");
|
|
34685
34983
|
|
|
34686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
34687
34985
|
var GENERATED = [
|
|
34688
34986
|
{
|
|
34689
34987
|
"name": "20261010184427_initial",
|
|
@@ -35591,7 +35889,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
35591
35889
|
}
|
|
35592
35890
|
];
|
|
35593
35891
|
|
|
35594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
35595
35893
|
var MANIFEST = [
|
|
35596
35894
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
35597
35895
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -35674,7 +35972,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
35674
35972
|
return migrations;
|
|
35675
35973
|
}, "generatedMigrations");
|
|
35676
35974
|
|
|
35677
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
35678
35976
|
var MIGRATIONS = generatedMigrations();
|
|
35679
35977
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
35680
35978
|
version INTEGER PRIMARY KEY,
|
|
@@ -35727,7 +36025,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
35727
36025
|
}
|
|
35728
36026
|
}, "migrate");
|
|
35729
36027
|
|
|
35730
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
35731
36029
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
35732
36030
|
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 ?");
|
|
35733
36031
|
if (pending.get(0, 1) === void 0)
|
|
@@ -35749,7 +36047,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
35749
36047
|
}
|
|
35750
36048
|
}, "fillJoinKeys");
|
|
35751
36049
|
|
|
35752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
35753
36051
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
35754
36052
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
35755
36053
|
try {
|
|
@@ -35762,8 +36060,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
35762
36060
|
}, "openSqlite");
|
|
35763
36061
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
35764
36062
|
quietSqliteWarning();
|
|
35765
|
-
const { drizzle } = await import("./node-
|
|
35766
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
36063
|
+
const { drizzle } = await import("./node-ENCKD6SS.js");
|
|
36064
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-4ICXMPYY.js");
|
|
35767
36065
|
const client = await nodeClient(path, { readOnly });
|
|
35768
36066
|
try {
|
|
35769
36067
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -35773,8 +36071,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
35773
36071
|
}
|
|
35774
36072
|
}, "openUnderNode");
|
|
35775
36073
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
35776
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
35777
|
-
const { drizzle } = await import("./bun-
|
|
36074
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-GIBBI5DV.js");
|
|
36075
|
+
const { drizzle } = await import("./bun-MSNAKMDK.js");
|
|
35778
36076
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
35779
36077
|
try {
|
|
35780
36078
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -35784,7 +36082,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
35784
36082
|
}
|
|
35785
36083
|
}, "openUnderBun");
|
|
35786
36084
|
|
|
35787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
35788
36086
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
35789
36087
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
35790
36088
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -35799,7 +36097,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
35799
36097
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
35800
36098
|
}, "assertReadCompatible");
|
|
35801
36099
|
|
|
35802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36100
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
35803
36101
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
35804
36102
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
35805
36103
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -35845,7 +36143,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
35845
36143
|
});
|
|
35846
36144
|
}, "moveSuggestedLinks");
|
|
35847
36145
|
|
|
35848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
35849
36147
|
var BACKFILL_ON_OPEN = 5e3;
|
|
35850
36148
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
35851
36149
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -35907,13 +36205,13 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
35907
36205
|
}
|
|
35908
36206
|
}, "openStoreContext");
|
|
35909
36207
|
|
|
35910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36208
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
35911
36209
|
import { createHash as createHash17 } from "node:crypto";
|
|
35912
36210
|
|
|
35913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36211
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
35914
36212
|
import { createHash as createHash16 } from "node:crypto";
|
|
35915
36213
|
|
|
35916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36214
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
35917
36215
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
35918
36216
|
var ref = text3(2048);
|
|
35919
36217
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -35979,7 +36277,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
35979
36277
|
}))
|
|
35980
36278
|
});
|
|
35981
36279
|
|
|
35982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
35983
36281
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
35984
36282
|
var invalid5 = /* @__PURE__ */ __name((field4) => {
|
|
35985
36283
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -36112,7 +36410,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
36112
36410
|
return createHash16("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
36113
36411
|
}, "projectAnnotationsFingerprint");
|
|
36114
36412
|
|
|
36115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36413
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
36116
36414
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
36117
36415
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
36118
36416
|
var targetSchema = strictObject({
|
|
@@ -36219,7 +36517,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
36219
36517
|
}, "planBoundProjectAnnotations");
|
|
36220
36518
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
36221
36519
|
|
|
36222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
36223
36521
|
import { createHash as createHash18 } from "node:crypto";
|
|
36224
36522
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
36225
36523
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -36313,7 +36611,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
36313
36611
|
})).digest("hex");
|
|
36314
36612
|
}, "projectAnnotationSnapshotFingerprint");
|
|
36315
36613
|
|
|
36316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
36317
36615
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
36318
36616
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
36319
36617
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -36330,7 +36628,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
36330
36628
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
36331
36629
|
}, "projectAnnotationRequest");
|
|
36332
36630
|
|
|
36333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
36334
36632
|
var SnapshotBudget = class {
|
|
36335
36633
|
static {
|
|
36336
36634
|
__name(this, "SnapshotBudget");
|
|
@@ -36356,13 +36654,13 @@ var SnapshotBudget = class {
|
|
|
36356
36654
|
}
|
|
36357
36655
|
};
|
|
36358
36656
|
|
|
36359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36657
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
36360
36658
|
import { createHash as createHash20 } from "node:crypto";
|
|
36361
36659
|
|
|
36362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
36363
36661
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
36364
36662
|
|
|
36365
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
36366
36664
|
import { createHash as createHash19 } from "node:crypto";
|
|
36367
36665
|
var invalid7 = /* @__PURE__ */ __name(() => {
|
|
36368
36666
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -36505,7 +36803,7 @@ var ProjectSnapshotSources = class {
|
|
|
36505
36803
|
}
|
|
36506
36804
|
};
|
|
36507
36805
|
|
|
36508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
36509
36807
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
36510
36808
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
36511
36809
|
}, "unsupported");
|
|
@@ -36676,7 +36974,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
36676
36974
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
36677
36975
|
}), "projectAnnotationSnapshot");
|
|
36678
36976
|
|
|
36679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
36680
36978
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
36681
36979
|
const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
36682
36980
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -36738,7 +37036,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
36738
37036
|
};
|
|
36739
37037
|
}), "previewAnnotationSnapshot");
|
|
36740
37038
|
|
|
36741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
36742
37040
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
|
|
36743
37041
|
const mappings = { ...bindings };
|
|
36744
37042
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -36780,7 +37078,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
36780
37078
|
return mappings;
|
|
36781
37079
|
}, "restoreAnnotationRecords");
|
|
36782
37080
|
|
|
36783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
36784
37082
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36785
37083
|
async preview(request) {
|
|
36786
37084
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -36810,7 +37108,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36810
37108
|
}
|
|
36811
37109
|
}), "projectAnnotationStoreOver");
|
|
36812
37110
|
|
|
36813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
36814
37112
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
36815
37113
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
36816
37114
|
let merged = { from: from2, to };
|
|
@@ -36823,7 +37121,28 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
36823
37121
|
}, "markRange");
|
|
36824
37122
|
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");
|
|
36825
37123
|
|
|
36826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37124
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
37125
|
+
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
37126
|
+
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
37127
|
+
chatId: String(row2.key).slice(prefix.length),
|
|
37128
|
+
...JSON.parse(String(row2.value)),
|
|
37129
|
+
at: new Date(Number(row2.at)).toISOString()
|
|
37130
|
+
}), "markOf");
|
|
37131
|
+
var taskAnalysisMarks = /* @__PURE__ */ __name((database, account) => {
|
|
37132
|
+
const prefix = prefixOf2(account);
|
|
37133
|
+
return database.prepare("SELECT key, value, at FROM store_settings WHERE substr(key, 1, ?) = ? ORDER BY at DESC").all(prefix.length, prefix).map((row2) => markOf(prefix, row2));
|
|
37134
|
+
}, "taskAnalysisMarks");
|
|
37135
|
+
var taskAnalysisMark = /* @__PURE__ */ __name((database, account, chatId) => {
|
|
37136
|
+
const prefix = prefixOf2(account);
|
|
37137
|
+
const row2 = database.prepare("SELECT key, value, at FROM store_settings WHERE key = ?").get(prefix + chatId);
|
|
37138
|
+
return row2 ? markOf(prefix, row2) : void 0;
|
|
37139
|
+
}, "taskAnalysisMark");
|
|
37140
|
+
var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, checked, ...saved }, now2) => {
|
|
37141
|
+
const checkedAt = checked ? new Date(now2).toISOString() : taskAnalysisMark(database, account, chatId)?.checkedAt;
|
|
37142
|
+
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);
|
|
37143
|
+
}, "setTaskAnalysisMark");
|
|
37144
|
+
|
|
37145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
36827
37146
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
36828
37147
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
36829
37148
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -36833,7 +37152,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
36833
37152
|
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);
|
|
36834
37153
|
}, "setTaskRulesStop");
|
|
36835
37154
|
|
|
36836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37155
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
36837
37156
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
36838
37157
|
const { database } = context;
|
|
36839
37158
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -36885,11 +37204,14 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36885
37204
|
return chatKey === void 0 ? [] : ranges(context, chatKey);
|
|
36886
37205
|
}, "ranges"),
|
|
36887
37206
|
taskRulesStop: /* @__PURE__ */ __name(async (key2) => taskRulesStop(database, key2), "taskRulesStop"),
|
|
36888
|
-
setTaskRulesStop: /* @__PURE__ */ __name(async (key2, until) => setTaskRulesStop(database, key2, until, context.now()), "setTaskRulesStop")
|
|
37207
|
+
setTaskRulesStop: /* @__PURE__ */ __name(async (key2, until) => setTaskRulesStop(database, key2, until, context.now()), "setTaskRulesStop"),
|
|
37208
|
+
taskAnalysisMarks: /* @__PURE__ */ __name(async (key2) => taskAnalysisMarks(database, key2), "taskAnalysisMarks"),
|
|
37209
|
+
taskAnalysisMark: /* @__PURE__ */ __name(async (key2, chatId) => taskAnalysisMark(database, key2, chatId), "taskAnalysisMark"),
|
|
37210
|
+
setTaskAnalysisMark: /* @__PURE__ */ __name(async (key2, mark) => setTaskAnalysisMark(database, key2, mark, context.now()), "setTaskAnalysisMark")
|
|
36889
37211
|
};
|
|
36890
37212
|
}, "syncStoreOver");
|
|
36891
37213
|
|
|
36892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37214
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
36893
37215
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
36894
37216
|
const { database } = context;
|
|
36895
37217
|
return {
|
|
@@ -36911,7 +37233,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36911
37233
|
};
|
|
36912
37234
|
}, "tagsStoreOver");
|
|
36913
37235
|
|
|
36914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
36915
37237
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
36916
37238
|
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
|
|
36917
37239
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -37038,7 +37360,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
37038
37360
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
37039
37361
|
}, "savePictureChunks");
|
|
37040
37362
|
|
|
37041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
37042
37364
|
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,
|
|
37043
37365
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
37044
37366
|
FROM messages m
|
|
@@ -37127,7 +37449,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
37127
37449
|
return plain2(best(found2));
|
|
37128
37450
|
}, "nearestMessages");
|
|
37129
37451
|
|
|
37130
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
37131
37453
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
37132
37454
|
const { database } = context;
|
|
37133
37455
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -37385,7 +37707,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
37385
37707
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
37386
37708
|
}), "vectorsStoreOver");
|
|
37387
37709
|
|
|
37388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
37389
37711
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
37390
37712
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
37391
37713
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -37473,10 +37795,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
37473
37795
|
}
|
|
37474
37796
|
}, "lastBackup");
|
|
37475
37797
|
|
|
37476
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
37477
37799
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
37478
37800
|
|
|
37479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
37480
37802
|
var COUNTED_TABLES = [
|
|
37481
37803
|
"accounts",
|
|
37482
37804
|
"chats",
|
|
@@ -37561,7 +37883,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
37561
37883
|
};
|
|
37562
37884
|
}, "storeContents");
|
|
37563
37885
|
|
|
37564
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.556.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5fb5e28714725a9ac5c32d6d19d5eccc/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
37565
37887
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
37566
37888
|
const context = await openStoreContext(options);
|
|
37567
37889
|
try {
|
|
@@ -37750,6 +38072,8 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
37750
38072
|
}, "storeOver");
|
|
37751
38073
|
|
|
37752
38074
|
export {
|
|
38075
|
+
amountsOf,
|
|
38076
|
+
dueDayOf,
|
|
37753
38077
|
isBotProvider,
|
|
37754
38078
|
inSource,
|
|
37755
38079
|
sourceOf,
|
|
@@ -37772,6 +38096,8 @@ export {
|
|
|
37772
38096
|
SEARCH_QUERY,
|
|
37773
38097
|
MESSAGE_PARSING,
|
|
37774
38098
|
searchError,
|
|
38099
|
+
outOfTime,
|
|
38100
|
+
isQueryLimit,
|
|
37775
38101
|
exhausted,
|
|
37776
38102
|
PRESET_VERSION,
|
|
37777
38103
|
FIELD_VERSION,
|
|
@@ -37812,6 +38138,7 @@ export {
|
|
|
37812
38138
|
CHAT_COLUMNS,
|
|
37813
38139
|
TRACKED_CHAT_COLUMNS,
|
|
37814
38140
|
titlePart,
|
|
38141
|
+
MAIL_AGENDA_COLUMNS,
|
|
37815
38142
|
AGENDA_COLUMNS,
|
|
37816
38143
|
correctWords,
|
|
37817
38144
|
THREAD_COLUMNS,
|