@wirecat/cli-memo 0.131.72 → 0.131.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/memo.js +2 -2
- package/dist/bundle/{all-profiles-G6S5HOBT.js → all-profiles-L5QBYI3V.js} +5 -5
- package/dist/bundle/{anthropic-LA6PXTPQ.js → anthropic-XXKHNCQS.js} +13 -4
- package/dist/bundle/{app-server-SESNZIAV.js → app-server-FDMP3IBP.js} +35 -35
- package/dist/bundle/auto-YQAECIZA.js +85 -0
- package/dist/bundle/{bun-PZNVNH4G.js → bun-VLN4HBWB.js} +2 -2
- package/dist/bundle/{bun-sqlite-VICDK5FS.js → bun-sqlite-KJCYXNMS.js} +2 -2
- package/dist/bundle/{chunk-FXZ7PQKG.js → chunk-2BH2RNFR.js} +5 -5
- package/dist/bundle/{chunk-RGIS2DRA.js → chunk-2C323QNQ.js} +4 -4
- package/dist/bundle/{chunk-SR7C53CS.js → chunk-3CANRF2G.js} +2 -2
- package/dist/bundle/{chunk-A4UQKFGY.js → chunk-6OPZTBRR.js} +12 -12
- package/dist/bundle/{chunk-I4HWKPQR.js → chunk-6ZRBQTKZ.js} +4 -4
- package/dist/bundle/{chunk-ASDOPGKC.js → chunk-A7QXBRUH.js} +2 -2
- package/dist/bundle/{chunk-IXZWUHSG.js → chunk-B7ATMWVO.js} +7 -7
- package/dist/bundle/{chunk-FOPDWCRG.js → chunk-BBLT77AO.js} +5 -5
- package/dist/bundle/{chunk-NRLXWY4Q.js → chunk-BOZEBD3I.js} +433 -368
- package/dist/bundle/{chunk-FPWF2XLH.js → chunk-BTVND2RV.js} +12 -12
- package/dist/bundle/{chunk-HIHZNBR7.js → chunk-C3UOKLIT.js} +1 -1
- package/dist/bundle/{chunk-UCRR7R6Q.js → chunk-E75LK7GD.js} +2 -2
- package/dist/bundle/{chunk-M2DAITNE.js → chunk-EH7ACKFW.js} +2 -2
- package/dist/bundle/{chunk-MSTWHRLN.js → chunk-EI2P5E4C.js} +1 -1
- package/dist/bundle/{chunk-FHIGY5K6.js → chunk-EQLOQOIB.js} +1 -1
- package/dist/bundle/{chunk-2VETW2QK.js → chunk-FMSXN2N6.js} +482 -369
- package/dist/bundle/{chunk-UX52EWLQ.js → chunk-FSXQLNU4.js} +1 -1
- package/dist/bundle/{chunk-K55WZ67L.js → chunk-H74CWBSY.js} +3 -3
- package/dist/bundle/{chunk-FENNNSCI.js → chunk-HBP7AQXX.js} +5 -5
- package/dist/bundle/{chunk-SVVSGUMU.js → chunk-I6MGDSYH.js} +4 -4
- package/dist/bundle/{chunk-ZM6J47GY.js → chunk-IDCYBSML.js} +2 -2
- package/dist/bundle/{chunk-QUPPO7DB.js → chunk-IKH4RCJO.js} +1 -1
- package/dist/bundle/{chunk-PHL53ERQ.js → chunk-IUEYR3TK.js} +4 -4
- package/dist/bundle/{chunk-MKOQDN3I.js → chunk-J7ESMDVV.js} +1 -1
- package/dist/bundle/{chunk-INQAQ55X.js → chunk-JABLJBXL.js} +80 -76
- package/dist/bundle/{chunk-YBL4QKLV.js → chunk-JLC2RE4Y.js} +46 -46
- package/dist/bundle/{chunk-FDSM2TU6.js → chunk-JPXDDRBD.js} +8 -8
- package/dist/bundle/{chunk-SL2LXOCN.js → chunk-K54MCZWM.js} +2 -2
- package/dist/bundle/{chunk-5XRCF57Z.js → chunk-KK3ZHBMI.js} +1 -1
- package/dist/bundle/{chunk-THPGFRPZ.js → chunk-KQTR6YA4.js} +9 -9
- package/dist/bundle/{chunk-II2SXJEO.js → chunk-LG5SQGNM.js} +28 -28
- package/dist/bundle/{chunk-LIF2HXIQ.js → chunk-LHZ4QBWB.js} +1 -1
- package/dist/bundle/{chunk-6Z62U7NY.js → chunk-LOYI3STE.js} +3 -3
- package/dist/bundle/{chunk-WT2P44YD.js → chunk-MLN4DPXN.js} +10 -10
- package/dist/bundle/{chunk-FVJSDDSV.js → chunk-MM3OMWST.js} +11 -9
- package/dist/bundle/{chunk-G3FQTKHT.js → chunk-NMOWIFH3.js} +7 -7
- package/dist/bundle/{chunk-ESYCZ575.js → chunk-O5KXCQE4.js} +2 -2
- package/dist/bundle/{chunk-CLQXHFKG.js → chunk-OGUXOAOH.js} +5 -5
- package/dist/bundle/{chunk-H3LAORYX.js → chunk-ON7ZROFP.js} +2 -2
- package/dist/bundle/{chunk-KH43CUE2.js → chunk-PAHBDQ5A.js} +5 -5
- package/dist/bundle/{chunk-MAGAWAPG.js → chunk-PF6LXPK5.js} +167 -165
- package/dist/bundle/{chunk-BD7AGXJJ.js → chunk-QHLEMEF3.js} +31 -31
- package/dist/bundle/{chunk-U3P5F57B.js → chunk-R3PK4Y7C.js} +1 -1
- package/dist/bundle/{chunk-G7XOBQB5.js → chunk-RB266FS6.js} +3 -3
- package/dist/bundle/{chunk-IRBYZUI7.js → chunk-SILEPITK.js} +27 -36
- package/dist/bundle/{chunk-STJWETNW.js → chunk-US2HTCJA.js} +4 -4
- package/dist/bundle/{chunk-6B3GQMR6.js → chunk-VPR47AG4.js} +1 -1
- package/dist/bundle/{chunk-3LS76TFB.js → chunk-VQUSPMYO.js} +1 -1
- package/dist/bundle/{chunk-RF6KPQWV.js → chunk-W6JPIP5C.js} +2 -2
- package/dist/bundle/{chunk-XXEHPPNS.js → chunk-WJNLBQSV.js} +1099 -743
- package/dist/bundle/{chunk-XNX3U6GD.js → chunk-X35Q5CHE.js} +6 -6
- package/dist/bundle/{chunk-B7LGXY3S.js → chunk-XGXEWKR7.js} +4 -4
- package/dist/bundle/{chunk-CPUQC7UF.js → chunk-XM6ZAPFW.js} +1 -1
- package/dist/bundle/{chunk-2RNNWFU7.js → chunk-YDGZJK6U.js} +13 -13
- package/dist/bundle/{chunk-3ZSPTUG3.js → chunk-ZI5Y2EUA.js} +6 -6
- package/dist/bundle/{chunk-PGOMGFXA.js → chunk-ZIGVDRSI.js} +1 -1
- package/dist/bundle/{command-contract-7QECBB6M.js → command-contract-6HJ322BP.js} +11 -11
- package/dist/bundle/{decode-WRWXOJML.js → decode-OS6Y6ICA.js} +2 -2
- package/dist/bundle/{echarts-MTCNTCST.js → echarts-JKGDUDYL.js} +2 -2
- package/dist/bundle/{embed-PPPCHSTE.js → embed-UB4LH6MF.js} +3 -3
- package/dist/bundle/{embedder-UJBIX6A2.js → embedder-TUQBG22Y.js} +6 -6
- package/dist/bundle/{entry-W6SHKRBE.js → entry-N4NCIQYH.js} +4 -4
- package/dist/bundle/failure-BJEFFYH3.js +65 -0
- package/dist/bundle/{first-run-7HAWGQ3B.js → first-run-VNJHZYGS.js} +5 -5
- package/dist/bundle/{first-screen-FRRTKWFB.js → first-screen-4XGF2NZ3.js} +12 -12
- package/dist/bundle/{instructions-JKIO4JF7.js → instructions-Q6IZQUU7.js} +1 -1
- package/dist/bundle/{mcp-OL6ZYF2T.js → mcp-REIASUJR.js} +35 -35
- package/dist/bundle/memo.js +6 -6
- package/dist/bundle/{node-3AIXDDDR.js → node-ZSSIVKVC.js} +2 -2
- package/dist/bundle/{node-sqlite-NX722DXD.js → node-sqlite-AUNJSQQL.js} +3 -3
- package/dist/bundle/{oauth-2NPSI7Q3.js → oauth-2MTJFCMI.js} +4 -4
- package/dist/bundle/{open-AFRN6Q36.js → open-U7RC27MJ.js} +2 -2
- package/dist/bundle/{openai-U5CQFLRU.js → openai-2SJCG6XM.js} +7 -7
- package/dist/bundle/{process-J2IBN6X7.js → process-UEQX5STY.js} +1 -1
- package/dist/bundle/{program-MRG4ZQQI.js → program-G3F26HW7.js} +168 -87
- package/dist/bundle/{prompt-6XNKR4VQ.js → prompt-F23FC5PJ.js} +2 -2
- package/dist/bundle/{recognize-G3GI32QS.js → recognize-ZVEGVD56.js} +1 -1
- package/dist/bundle/{remote-DJO255PT.js → remote-CZXQS7PS.js} +4 -4
- package/dist/bundle/{rerank-5SBZRIHF.js → rerank-IRFXSVVO.js} +4 -4
- package/dist/bundle/{serve-BZVBKGU3.js → serve-6CIMU5HP.js} +6 -6
- package/dist/bundle/server-27KXLL4E.js +61 -0
- package/dist/bundle/{server-D5BJDKTJ.js → server-H24MAUT2.js} +50 -50
- package/dist/bundle/server-TWMUWMFM.js +48 -0
- package/dist/bundle/{state-A57F7T5D.js → state-TRWZWXB5.js} +3 -3
- package/dist/bundle/{store-JXD7SGIK.js → store-E4QUOOLX.js} +9 -9
- package/dist/bundle/store-maintenance-command-GLHRB2VZ.js +47 -0
- package/dist/bundle/update-QQEM73O5.js +68 -0
- package/dist/contract-overrides/search.d.ts.map +1 -1
- package/dist/contract-overrides/search.js +9 -3
- package/dist/contract-overrides/search.js.map +1 -1
- package/dist/digest/backfill.d.ts.map +1 -1
- package/dist/digest/backfill.js +7 -7
- package/dist/digest/backfill.js.map +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +9 -3
- package/dist/examples.js.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/search/answers.d.ts +9 -2
- package/dist/search/answers.d.ts.map +1 -1
- package/dist/search/answers.js +59 -5
- package/dist/search/answers.js.map +1 -1
- package/dist/search/command.d.ts.map +1 -1
- package/dist/search/command.js +38 -7
- package/dist/search/command.js.map +1 -1
- package/dist/search/search.d.ts +6 -2
- package/dist/search/search.d.ts.map +1 -1
- package/dist/search/search.js +14 -5
- package/dist/search/search.js.map +1 -1
- package/dist/store/group.d.ts +1 -1
- package/dist/store/group.d.ts.map +1 -1
- package/dist/store/group.js +2 -1
- package/dist/store/group.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/skills/cli-memo/SKILL.md +3 -3
- package/skills/cli-memo/topics/meetings.md +2 -1
- package/skills/cli-memo/topics/search.md +1 -0
- package/dist/bundle/auto-WU47LYXJ.js +0 -85
- package/dist/bundle/failure-NRJ3EPBO.js +0 -65
- package/dist/bundle/server-AEZPZ3ZD.js +0 -48
- package/dist/bundle/server-CIT5B2SV.js +0 -61
- package/dist/bundle/store-maintenance-command-5DG4SEQA.js +0 -47
- package/dist/bundle/update-NI24ED4V.js +0 -68
- /package/dist/bundle/{chunk-YSYFOIW7.js → chunk-ZOWQ5B33.js} +0 -0
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
ORDER_STATUSES,
|
|
36
36
|
PRIORITY_LABELS,
|
|
37
37
|
QUERY_LIMITS,
|
|
38
|
+
READ_BUDGET_EXCEEDED,
|
|
38
39
|
RELATION_KINDS,
|
|
39
40
|
REPORTER_SQL,
|
|
40
41
|
REVIEW_LIMIT,
|
|
@@ -174,12 +175,12 @@ import {
|
|
|
174
175
|
walkQuery,
|
|
175
176
|
walletLine,
|
|
176
177
|
zonedMoment
|
|
177
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-JABLJBXL.js";
|
|
178
179
|
import {
|
|
179
180
|
holdsCredential,
|
|
180
181
|
secretNamed,
|
|
181
182
|
sqliteCode
|
|
182
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-EH7ACKFW.js";
|
|
183
184
|
import {
|
|
184
185
|
DEFAULT_STEMMERS,
|
|
185
186
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -192,27 +193,27 @@ import {
|
|
|
192
193
|
fold,
|
|
193
194
|
normalize,
|
|
194
195
|
parseStemmers
|
|
195
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-NMOWIFH3.js";
|
|
196
197
|
import {
|
|
197
198
|
DEFAULT_TASK_CATEGORIES,
|
|
198
199
|
sharedConfigPath,
|
|
199
200
|
storedTaskCategories,
|
|
200
201
|
taskCategoriesReader
|
|
201
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-I6MGDSYH.js";
|
|
202
203
|
import {
|
|
203
204
|
refuseOwnerStoreInTests,
|
|
204
205
|
storePath
|
|
205
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-R3PK4Y7C.js";
|
|
206
207
|
import {
|
|
207
208
|
quietSqliteWarning,
|
|
208
209
|
storeCapable
|
|
209
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-PAHBDQ5A.js";
|
|
210
211
|
import {
|
|
211
212
|
PRAGMAS,
|
|
212
213
|
TIME_LIMIT_FUNCTION,
|
|
213
214
|
TimeLimitReached,
|
|
214
215
|
isQueryOnly
|
|
215
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-EI2P5E4C.js";
|
|
216
217
|
import {
|
|
217
218
|
array,
|
|
218
219
|
boolean,
|
|
@@ -263,7 +264,7 @@ import {
|
|
|
263
264
|
sql,
|
|
264
265
|
sqliteTable,
|
|
265
266
|
text
|
|
266
|
-
} from "./chunk-
|
|
267
|
+
} from "./chunk-XM6ZAPFW.js";
|
|
267
268
|
import {
|
|
268
269
|
__commonJS,
|
|
269
270
|
__name,
|
|
@@ -10007,7 +10008,7 @@ var require_cjs = __commonJS({
|
|
|
10007
10008
|
}
|
|
10008
10009
|
});
|
|
10009
10010
|
|
|
10010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
10011
10012
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10012
10013
|
const methods = whole;
|
|
10013
10014
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10135,7 +10136,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10135
10136
|
};
|
|
10136
10137
|
}, "bindAccount");
|
|
10137
10138
|
|
|
10138
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10139
10140
|
var IndexBuilderOn = class {
|
|
10140
10141
|
static {
|
|
10141
10142
|
__name(this, "IndexBuilderOn");
|
|
@@ -10330,7 +10331,7 @@ function alias(table, alias2) {
|
|
|
10330
10331
|
}
|
|
10331
10332
|
__name(alias, "alias");
|
|
10332
10333
|
|
|
10333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
10334
10335
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10335
10336
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10336
10337
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -10449,7 +10450,7 @@ var fieldError = /* @__PURE__ */ __name((schema, value, at2 = []) => {
|
|
|
10449
10450
|
return void 0;
|
|
10450
10451
|
}, "fieldError");
|
|
10451
10452
|
|
|
10452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
10453
10454
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
10454
10455
|
var PARTY = ["person", "organization"];
|
|
10455
10456
|
var ORGANIZATION = ["organization"];
|
|
@@ -10823,7 +10824,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
|
|
|
10823
10824
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
10824
10825
|
var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
10825
10826
|
|
|
10826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10827
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10827
10828
|
var ENTITY_TABLES = {
|
|
10828
10829
|
...RECORD_TABLES,
|
|
10829
10830
|
account: "accounts",
|
|
@@ -10862,7 +10863,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10862
10863
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10863
10864
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10864
10865
|
|
|
10865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
10866
10867
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
10867
10868
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
10868
10869
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -10919,7 +10920,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
10919
10920
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
10920
10921
|
}, "proposedBySql");
|
|
10921
10922
|
|
|
10922
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
|
|
10923
10924
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
10924
10925
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
10925
10926
|
var KEPT = 20;
|
|
@@ -11014,7 +11015,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
11014
11015
|
return scrubbed;
|
|
11015
11016
|
}, "scrubSourceReviews");
|
|
11016
11017
|
|
|
11017
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11018
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
11018
11019
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
11019
11020
|
var REFERABLE = {
|
|
11020
11021
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -11174,7 +11175,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
11174
11175
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
11175
11176
|
}, "taskIdOf");
|
|
11176
11177
|
|
|
11177
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
|
|
11178
11179
|
var QUOTE_LIMIT = 500;
|
|
11179
11180
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
11180
11181
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -11453,10 +11454,10 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
11453
11454
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
11454
11455
|
}, "deleteDocumentRow");
|
|
11455
11456
|
|
|
11456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/identity-links.js
|
|
11457
11458
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
11458
11459
|
|
|
11459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
|
|
11460
11461
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
11461
11462
|
var mergeSql = /* @__PURE__ */ __name((event2) => `(${event2}.from_person_id IS NOT NULL AND ${event2}.from_person_id <> ${event2}.to_person_id AND ${event2}.method NOT IN (${SEPARATIONS.map((method) => `'${method}'`).join(", ")}) AND NOT EXISTS (SELECT 1 FROM identity_link_events stay WHERE stay.to_person_id = ${event2}.from_person_id AND stay.identity_id <> ${event2}.identity_id AND stay.id < ${event2}.id AND stay.id = (SELECT max(s.id) FROM identity_link_events s WHERE s.identity_id = stay.identity_id AND s.id < ${event2}.id) AND NOT EXISTS (SELECT 1 FROM identity_link_events went WHERE went.identity_id = stay.identity_id AND went.from_person_id = ${event2}.from_person_id AND went.to_person_id = ${event2}.to_person_id AND went.id = (SELECT min(w.id) FROM identity_link_events w WHERE w.identity_id = stay.identity_id AND w.id > ${event2}.id))))`, "mergeSql");
|
|
11462
11463
|
var mergedAwaySql = /* @__PURE__ */ __name((person2) => `(${person2}.owner = 0 AND NOT EXISTS (SELECT 1 FROM identity_links ml WHERE ml.person_id = ${person2}.id) AND EXISTS (SELECT 1 FROM identity_link_events me WHERE me.from_person_id = ${person2}.id AND ${mergeSql("me")}))`, "mergedAwaySql");
|
|
@@ -11488,7 +11489,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
11488
11489
|
}, "samePersons");
|
|
11489
11490
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
11490
11491
|
|
|
11491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
|
|
11492
11493
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
11493
11494
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
11494
11495
|
const at2 = ref3.indexOf(":");
|
|
@@ -11594,7 +11595,7 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
11594
11595
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
11595
11596
|
}, "forgetErasedLinks");
|
|
11596
11597
|
|
|
11597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11598
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
11598
11599
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
11599
11600
|
id: integer("id").primaryKey(),
|
|
11600
11601
|
name: text("name").notNull().unique(),
|
|
@@ -11603,7 +11604,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
11603
11604
|
updatedAt: integer("updated_at").notNull()
|
|
11604
11605
|
});
|
|
11605
11606
|
|
|
11606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
11607
11608
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
11608
11609
|
id: integer("id").primaryKey(),
|
|
11609
11610
|
linkId: integer("link_id").notNull(),
|
|
@@ -11615,7 +11616,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
11615
11616
|
createdAt: integer("created_at").notNull()
|
|
11616
11617
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
11617
11618
|
|
|
11618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11619
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
11619
11620
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
11620
11621
|
sourceKey: text("source_key").notNull(),
|
|
11621
11622
|
collection: text("collection").notNull(),
|
|
@@ -11625,13 +11626,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
11625
11626
|
createdAt: integer("created_at").notNull()
|
|
11626
11627
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
11627
11628
|
|
|
11628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11629
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
11629
11630
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
11630
11631
|
id: integer("id").notNull(),
|
|
11631
11632
|
indexableType: text("indexable_type").notNull()
|
|
11632
11633
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
11633
11634
|
|
|
11634
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
11635
11636
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
11636
11637
|
id: integer("id").primaryKey(),
|
|
11637
11638
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -11651,7 +11652,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
11651
11652
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
11652
11653
|
]);
|
|
11653
11654
|
|
|
11654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11655
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
11655
11656
|
var enrichments = sqliteTable("enrichments", {
|
|
11656
11657
|
subjectType: text("subject_type").notNull(),
|
|
11657
11658
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -11663,7 +11664,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
11663
11664
|
createdAt: integer("created_at").notNull()
|
|
11664
11665
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
11665
11666
|
|
|
11666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11667
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
11667
11668
|
var templates = sqliteTable("templates", {
|
|
11668
11669
|
key: text("key").notNull(),
|
|
11669
11670
|
channel: text("channel").notNull(),
|
|
@@ -11685,7 +11686,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
11685
11686
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
11686
11687
|
]);
|
|
11687
11688
|
|
|
11688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11689
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
11689
11690
|
var links = sqliteTable("links", {
|
|
11690
11691
|
id: integer("id").primaryKey(),
|
|
11691
11692
|
fromType: text("from_type").notNull(),
|
|
@@ -11716,7 +11717,7 @@ var links = sqliteTable("links", {
|
|
|
11716
11717
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
11717
11718
|
]);
|
|
11718
11719
|
|
|
11719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
11720
11721
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
11721
11722
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
11722
11723
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -11742,7 +11743,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
11742
11743
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
11743
11744
|
]);
|
|
11744
11745
|
|
|
11745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11746
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
11746
11747
|
var accounts = sqliteTable("accounts", {
|
|
11747
11748
|
id: integer("id").primaryKey(),
|
|
11748
11749
|
provider: text("provider").notNull(),
|
|
@@ -13741,10 +13742,10 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
13741
13742
|
at: integer("at").notNull()
|
|
13742
13743
|
});
|
|
13743
13744
|
|
|
13744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
13745
13746
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
13746
13747
|
|
|
13747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
13748
13749
|
import { existsSync, statSync } from "node:fs";
|
|
13749
13750
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
13750
13751
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -13770,7 +13771,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
13770
13771
|
throw new CliError("conflict", "the store's journal file was deleted or replaced by another program while this command had the store open, so nothing more is written; `store recover` says what to do", { reason: "store.journal-replaced" });
|
|
13771
13772
|
}, "checkJournal");
|
|
13772
13773
|
|
|
13773
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
13774
13775
|
var WRITE = /^\s*(?:WITH\b[\s\S]*?\)\s*)?(INSERT|REPLACE|UPDATE|DELETE)\b(?:\s+OR\s+[A-Za-z]+)?\s+(?:INTO\s+|FROM\s+)?(?:("?)(\w+)\2\.)?["`[]?(\w+)/i;
|
|
13775
13776
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
13776
13777
|
const match = WRITE.exec(sql2);
|
|
@@ -13850,7 +13851,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
13850
13851
|
}, "committedWrites");
|
|
13851
13852
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
13852
13853
|
|
|
13853
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
13854
13855
|
var ARMS = [
|
|
13855
13856
|
[
|
|
13856
13857
|
"message",
|
|
@@ -13978,7 +13979,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
13978
13979
|
return recomputed;
|
|
13979
13980
|
}, "drainInvolvementQueue");
|
|
13980
13981
|
|
|
13981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13982
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13982
13983
|
import { domainToUnicode } from "node:url";
|
|
13983
13984
|
|
|
13984
13985
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -24000,7 +24001,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
24000
24001
|
}, "oa");
|
|
24001
24002
|
var na = { parse: O, get: aa, isValid: oa };
|
|
24002
24003
|
|
|
24003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
24004
24005
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
24005
24006
|
var ID = /^[\w-]{10,}$/;
|
|
24006
24007
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -24042,7 +24043,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text7) => [...text7.matchAll(L
|
|
|
24042
24043
|
return { url, documentId: googleDocumentId(url) };
|
|
24043
24044
|
}), "googleDocumentLinks");
|
|
24044
24045
|
|
|
24045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24046
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
24046
24047
|
var PHONE_PLANS = [
|
|
24047
24048
|
{
|
|
24048
24049
|
country: "us",
|
|
@@ -24422,7 +24423,7 @@ var PHONE_PLANS = [
|
|
|
24422
24423
|
}
|
|
24423
24424
|
];
|
|
24424
24425
|
|
|
24425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
24426
24427
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
24427
24428
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
24428
24429
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -24496,7 +24497,7 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
24496
24497
|
return found2 ? `+${found2[1]}` : void 0;
|
|
24497
24498
|
}, "storedPhone");
|
|
24498
24499
|
|
|
24499
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24500
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
24500
24501
|
var BEFORE = [
|
|
24501
24502
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
24502
24503
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -24756,7 +24757,7 @@ var findPlaces = /* @__PURE__ */ __name((text7) => {
|
|
|
24756
24757
|
return found2.sort((a, b) => a.start - b.start);
|
|
24757
24758
|
}, "findPlaces");
|
|
24758
24759
|
|
|
24759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
24760
24761
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
24761
24762
|
var MENTION_VERSIONS = {
|
|
24762
24763
|
phone: 1,
|
|
@@ -24932,7 +24933,7 @@ var exactlyOne = /* @__PURE__ */ __name((text7, options) => {
|
|
|
24932
24933
|
return one2 && one2.start === 0 && one2.end === text7.length ? one2.value : void 0;
|
|
24933
24934
|
}, "exactlyOne");
|
|
24934
24935
|
|
|
24935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
24936
24937
|
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";
|
|
24937
24938
|
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";
|
|
24938
24939
|
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";
|
|
@@ -24940,7 +24941,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
24940
24941
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
24941
24942
|
var NAME_WORDS = WORDS.split(" ");
|
|
24942
24943
|
|
|
24943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24944
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
24944
24945
|
var LATIN_TO_CYRILLIC = {
|
|
24945
24946
|
shch: "\u0449",
|
|
24946
24947
|
sch: "\u0449",
|
|
@@ -25148,7 +25149,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text7, stem, taken) => {
|
|
|
25148
25149
|
return found2;
|
|
25149
25150
|
}, "findUnknownNames");
|
|
25150
25151
|
|
|
25151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
25152
25153
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
25153
25154
|
"webpage",
|
|
25154
25155
|
"share",
|
|
@@ -25188,7 +25189,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
25188
25189
|
});
|
|
25189
25190
|
}, "matchDownloads");
|
|
25190
25191
|
|
|
25191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25192
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
25192
25193
|
var QUERY_VERSION = 1;
|
|
25193
25194
|
var QUERY_LIMITS2 = {
|
|
25194
25195
|
...QUERY_LIMITS,
|
|
@@ -25224,7 +25225,7 @@ function exhausted(budget) {
|
|
|
25224
25225
|
}
|
|
25225
25226
|
__name(exhausted, "exhausted");
|
|
25226
25227
|
|
|
25227
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25228
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
25228
25229
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
25229
25230
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
25230
25231
|
kind: "char",
|
|
@@ -25624,7 +25625,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
25624
25625
|
return out;
|
|
25625
25626
|
}, "foldRegex");
|
|
25626
25627
|
|
|
25627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25628
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
25628
25629
|
var PRESET_VERSION = 1;
|
|
25629
25630
|
var PRESETS = {
|
|
25630
25631
|
password: {
|
|
@@ -25678,7 +25679,7 @@ var PRESETS = {
|
|
|
25678
25679
|
}
|
|
25679
25680
|
};
|
|
25680
25681
|
|
|
25681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
25682
25683
|
var FIELD_VERSION = 2;
|
|
25683
25684
|
var UNITS = {
|
|
25684
25685
|
"": 1,
|
|
@@ -26139,12 +26140,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
26139
26140
|
return validateFields(parsed4.output);
|
|
26140
26141
|
}, "validateAst");
|
|
26141
26142
|
|
|
26142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
26143
26144
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
26144
26145
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
26145
26146
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
26146
26147
|
|
|
26147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
26148
26149
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
26149
26150
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
26150
26151
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -26168,7 +26169,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
26168
26169
|
};
|
|
26169
26170
|
}, "linkMatch");
|
|
26170
26171
|
|
|
26171
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
26172
26173
|
var SETTING = "phoneCountries";
|
|
26173
26174
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
26174
26175
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -26199,7 +26200,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
26199
26200
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
26200
26201
|
}, "valueMatch");
|
|
26201
26202
|
|
|
26202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26203
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
26203
26204
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
26204
26205
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
26205
26206
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -26227,7 +26228,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
26227
26228
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
26228
26229
|
}, "vocabularySimilarity");
|
|
26229
26230
|
|
|
26230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26231
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
26231
26232
|
import { createHash } from "node:crypto";
|
|
26232
26233
|
var folded3 = /* @__PURE__ */ __name((name) => {
|
|
26233
26234
|
try {
|
|
@@ -26293,7 +26294,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
26293
26294
|
});
|
|
26294
26295
|
}, "guardTagCreation");
|
|
26295
26296
|
|
|
26296
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
26297
26298
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
26298
26299
|
throw new CliError("validation_error", message3);
|
|
26299
26300
|
}, "invalid");
|
|
@@ -26370,7 +26371,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
26370
26371
|
};
|
|
26371
26372
|
}, "createTagRedirectIndex");
|
|
26372
26373
|
|
|
26373
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
26374
26375
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
26375
26376
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
26376
26377
|
if (!row2)
|
|
@@ -26398,7 +26399,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
26398
26399
|
return snapshot2;
|
|
26399
26400
|
}, "tagRedirectSnapshot");
|
|
26400
26401
|
|
|
26401
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
26402
26403
|
import { createHash as createHash2 } from "node:crypto";
|
|
26403
26404
|
var TASK_KEY_PREFIXES = {
|
|
26404
26405
|
question: "Q",
|
|
@@ -26426,7 +26427,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
26426
26427
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
26427
26428
|
}, "taskAccountOf");
|
|
26428
26429
|
|
|
26429
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26430
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
26430
26431
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
26431
26432
|
if (iso17 === null || iso17 === void 0)
|
|
26432
26433
|
return null;
|
|
@@ -26440,7 +26441,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
26440
26441
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
26441
26442
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
26442
26443
|
|
|
26443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
26444
26445
|
var TAG_KINDS = ["tag", "topic"];
|
|
26445
26446
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
26446
26447
|
var TAG_TYPE = {
|
|
@@ -26643,7 +26644,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
26643
26644
|
return result;
|
|
26644
26645
|
}, "tagsOf");
|
|
26645
26646
|
|
|
26646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26647
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
26647
26648
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
26648
26649
|
var SPEECH = speech("att");
|
|
26649
26650
|
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");
|
|
@@ -27007,7 +27008,7 @@ var FIELD_COMPILERS = {
|
|
|
27007
27008
|
subject
|
|
27008
27009
|
};
|
|
27009
27010
|
|
|
27010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
27011
27012
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
27012
27013
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
27013
27014
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -27023,7 +27024,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
27023
27024
|
};
|
|
27024
27025
|
}, "placeOf");
|
|
27025
27026
|
|
|
27026
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
27027
27028
|
var DRAIN_ON_WRITE = 500;
|
|
27028
27029
|
var METHOD = "rules";
|
|
27029
27030
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -27189,7 +27190,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
27189
27190
|
return queued.length;
|
|
27190
27191
|
}, "drainMentions");
|
|
27191
27192
|
|
|
27192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27193
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
27193
27194
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
27194
27195
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
27195
27196
|
if (!exists2)
|
|
@@ -27197,7 +27198,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
27197
27198
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
27198
27199
|
}, "indexRow");
|
|
27199
27200
|
|
|
27200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
27201
27202
|
var INDEX = "message_stems";
|
|
27202
27203
|
var SETTING2 = "searchStemmers";
|
|
27203
27204
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -27319,7 +27320,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
27319
27320
|
};
|
|
27320
27321
|
}, "stemmerCache");
|
|
27321
27322
|
|
|
27322
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
27323
27324
|
var rehearsal = new AsyncLocalStorage();
|
|
27324
27325
|
var SQLITE_BUSY = 5;
|
|
27325
27326
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -27462,7 +27463,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
27462
27463
|
}
|
|
27463
27464
|
}, "read");
|
|
27464
27465
|
|
|
27465
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27466
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
27466
27467
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
27467
27468
|
coalesce(CASE k.chunkable_type
|
|
27468
27469
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -27604,7 +27605,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
27604
27605
|
}, "dropUnusedVectors");
|
|
27605
27606
|
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");
|
|
27606
27607
|
|
|
27607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
27608
27609
|
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({
|
|
27609
27610
|
target: [accounts.provider, accounts.externalId],
|
|
27610
27611
|
set: {
|
|
@@ -27740,7 +27741,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
27740
27741
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
27741
27742
|
}, "dropOrphanPeople");
|
|
27742
27743
|
|
|
27743
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
27744
27745
|
var FOLDED = [
|
|
27745
27746
|
{ table: "tasks", column: "title" },
|
|
27746
27747
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -27777,7 +27778,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
27777
27778
|
return filled2;
|
|
27778
27779
|
}, "fillFolded");
|
|
27779
27780
|
|
|
27780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
27781
27782
|
var HISTORY_KEY = "$history";
|
|
27782
27783
|
var objectOf2 = /* @__PURE__ */ __name((text7) => {
|
|
27783
27784
|
if (typeof text7 !== "string")
|
|
@@ -27853,7 +27854,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
27853
27854
|
return rest;
|
|
27854
27855
|
}, "withoutHistory");
|
|
27855
27856
|
|
|
27856
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
27857
27858
|
import { createHash as createHash3 } from "node:crypto";
|
|
27858
27859
|
var CHUNK_CHARS = 1200;
|
|
27859
27860
|
var CHUNK_OVERLAP = 150;
|
|
@@ -27958,7 +27959,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
27958
27959
|
return chunks2;
|
|
27959
27960
|
}, "cutChunks");
|
|
27960
27961
|
|
|
27961
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
27962
27963
|
var DAY2 = 864e5;
|
|
27963
27964
|
var CURRENCY = [
|
|
27964
27965
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -28084,7 +28085,7 @@ var dueDayOf = /* @__PURE__ */ __name((text7, createdMs) => {
|
|
|
28084
28085
|
return best?.day ?? null;
|
|
28085
28086
|
}, "dueDayOf");
|
|
28086
28087
|
|
|
28087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
28088
28089
|
var DAY3 = 864e5;
|
|
28089
28090
|
var STOP_WORDS = new Set([
|
|
28090
28091
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -28239,7 +28240,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
28239
28240
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
28240
28241
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
28241
28242
|
|
|
28242
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
28243
28244
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
28244
28245
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
28245
28246
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -28514,7 +28515,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
28514
28515
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
28515
28516
|
])), "vectorCounts");
|
|
28516
28517
|
|
|
28517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28518
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
28518
28519
|
var DOCUMENT_PICTURE = "document_picture";
|
|
28519
28520
|
var SCAN_PAGE2 = 5e3;
|
|
28520
28521
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -28577,12 +28578,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
28577
28578
|
}, "nearestPictures")
|
|
28578
28579
|
}), "documentPicturesOver");
|
|
28579
28580
|
|
|
28580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
28581
28582
|
var noteIndexText = /* @__PURE__ */ __name((title, text7) => title ? `${title}
|
|
28582
28583
|
|
|
28583
28584
|
${text7}` : text7, "noteIndexText");
|
|
28584
28585
|
|
|
28585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
28586
28587
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
28587
28588
|
var ENRICHMENT_POSITION = 1e6;
|
|
28588
28589
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -28676,7 +28677,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
28676
28677
|
}), "clear")
|
|
28677
28678
|
}), "enrichmentsOver");
|
|
28678
28679
|
|
|
28679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28680
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
28680
28681
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
28681
28682
|
const literal5 = escaped2 ?? plain2 ?? "";
|
|
28682
28683
|
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
@@ -28741,7 +28742,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
28741
28742
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
28742
28743
|
var bound2 = /* @__PURE__ */ __name(({ sql: text7, params }) => sql.join(text7.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
|
|
28743
28744
|
|
|
28744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
28745
28746
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
28746
28747
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
28747
28748
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -28831,7 +28832,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
28831
28832
|
});
|
|
28832
28833
|
}, "linkMeeting");
|
|
28833
28834
|
|
|
28834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
28835
28836
|
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), ''))";
|
|
28836
28837
|
var UNSEARCHED_EVENT_TYPES = [
|
|
28837
28838
|
"working-location",
|
|
@@ -29078,7 +29079,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
29078
29079
|
return true;
|
|
29079
29080
|
}, "resetNoteIndex");
|
|
29080
29081
|
|
|
29081
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
29082
29083
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
29083
29084
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
29084
29085
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -29097,7 +29098,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
29097
29098
|
}
|
|
29098
29099
|
}, "resolvePersonLinks");
|
|
29099
29100
|
|
|
29100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
29101
29102
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
29102
29103
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
29103
29104
|
find: orm.select({
|
|
@@ -29322,7 +29323,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
29322
29323
|
}, "meetingIdentityPk");
|
|
29323
29324
|
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");
|
|
29324
29325
|
|
|
29325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
29326
29327
|
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");
|
|
29327
29328
|
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");
|
|
29328
29329
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -29514,6 +29515,7 @@ var purgeChats = /* @__PURE__ */ __name(({ orm, database, now: now2 }, pks) => {
|
|
|
29514
29515
|
forgetDanglingEvidence(database, at2);
|
|
29515
29516
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
29516
29517
|
}, "purgeChats");
|
|
29518
|
+
var chatScopes = /* @__PURE__ */ __name(({ database }, accountKey, chatIds) => new Map(database.prepare("SELECT c.external_id AS id, coalesce(c.scope, a.scope) AS scope FROM chats c JOIN accounts a ON a.id = c.account_id WHERE c.account_id = ? AND c.external_id IN (SELECT value FROM json_each(?))").all(accountKey, JSON.stringify(chatIds)).map((row2) => [String(row2.id), String(row2.scope)])), "chatScopes");
|
|
29517
29519
|
var chatsWith = /* @__PURE__ */ __name(({ orm, now: now2 }, accountKey, key2, memberId) => {
|
|
29518
29520
|
const rows = orm.select({ chat: chats }).from(chats).where(and(eq(chats.accountId, accountKey), notLeft, or(
|
|
29519
29521
|
inArray(chats.id, orm.select({ pk: chatMembers.chatId }).from(chatMembers).innerJoin(identities, eq(identities.id, chatMembers.identityId)).where(and(eq(identities.provider, key2.provider), eq(identities.externalId, memberId)))),
|
|
@@ -29612,7 +29614,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
29612
29614
|
}
|
|
29613
29615
|
}, "replaceAutoTags");
|
|
29614
29616
|
|
|
29615
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
29616
29618
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
29617
29619
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
29618
29620
|
var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
|
|
@@ -29631,7 +29633,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
29631
29633
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
29632
29634
|
}, "counterFreshness");
|
|
29633
29635
|
|
|
29634
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29636
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
29635
29637
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
29636
29638
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
29637
29639
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -29671,7 +29673,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
29671
29673
|
}, "maskStoredBotTokens");
|
|
29672
29674
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
29673
29675
|
|
|
29674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29676
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
29675
29677
|
import { createHash as createHash4 } from "node:crypto";
|
|
29676
29678
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29677
29679
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -29769,7 +29771,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
29769
29771
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
29770
29772
|
}, "contextEvidenceRequest");
|
|
29771
29773
|
|
|
29772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
29773
29775
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
29774
29776
|
var ACTIVITY = `
|
|
29775
29777
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -29899,7 +29901,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
29899
29901
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
29900
29902
|
}), "mailActivity");
|
|
29901
29903
|
|
|
29902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29904
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
29903
29905
|
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");
|
|
29904
29906
|
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;
|
|
29905
29907
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -30040,7 +30042,7 @@ var mailOwnText = /* @__PURE__ */ __name((body2) => {
|
|
|
30040
30042
|
return text7 || body2.trim();
|
|
30041
30043
|
}, "mailOwnText");
|
|
30042
30044
|
|
|
30043
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
30044
30046
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
30045
30047
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
30046
30048
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -30153,7 +30155,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
30153
30155
|
return emails3 + threads;
|
|
30154
30156
|
}, "drainEmailIndex");
|
|
30155
30157
|
|
|
30156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30158
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
30157
30159
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
30158
30160
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
30159
30161
|
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,
|
|
@@ -30251,7 +30253,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
30251
30253
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
30252
30254
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
30253
30255
|
|
|
30254
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30256
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
30255
30257
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
30256
30258
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
30257
30259
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -30301,7 +30303,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
30301
30303
|
return threads.length;
|
|
30302
30304
|
}, "markEmailsRestored");
|
|
30303
30305
|
|
|
30304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
30305
30307
|
var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
|
|
30306
30308
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
30307
30309
|
WHERE p.account_id = ?
|
|
@@ -30361,7 +30363,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
30361
30363
|
}, "indexedMailPieces");
|
|
30362
30364
|
var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
|
|
30363
30365
|
|
|
30364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
30365
30367
|
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");
|
|
30366
30368
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
30367
30369
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -30428,7 +30430,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
30428
30430
|
}
|
|
30429
30431
|
}), "mailRulesOver");
|
|
30430
30432
|
|
|
30431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30433
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
30432
30434
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30433
30435
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30434
30436
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30436,7 +30438,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30436
30438
|
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);
|
|
30437
30439
|
}, "reviewLink");
|
|
30438
30440
|
|
|
30439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
30440
30442
|
function checkMeetingCancelled(signal) {
|
|
30441
30443
|
if (!signal?.aborted)
|
|
30442
30444
|
return;
|
|
@@ -30447,7 +30449,7 @@ function checkMeetingCancelled(signal) {
|
|
|
30447
30449
|
}
|
|
30448
30450
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
30449
30451
|
|
|
30450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
30451
30453
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
30452
30454
|
id: Number(row2.id),
|
|
30453
30455
|
accountId: Number(row2.account_id),
|
|
@@ -30497,7 +30499,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
30497
30499
|
createdAt: Number(row2.created_at)
|
|
30498
30500
|
}), "transcriptRowOf");
|
|
30499
30501
|
|
|
30500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30502
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
30501
30503
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
30502
30504
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
30503
30505
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -30664,7 +30666,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30664
30666
|
}
|
|
30665
30667
|
}), "meetingReadsOver");
|
|
30666
30668
|
|
|
30667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30669
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
30668
30670
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
30669
30671
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
30670
30672
|
const params = [input.accountId];
|
|
@@ -30707,7 +30709,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
30707
30709
|
return { clauses, params };
|
|
30708
30710
|
}, "meetingSelectionSql");
|
|
30709
30711
|
|
|
30710
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
30711
30713
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
30712
30714
|
async meetingChatLines(input) {
|
|
30713
30715
|
checkMeetingCancelled(input.signal);
|
|
@@ -30735,10 +30737,10 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30735
30737
|
}
|
|
30736
30738
|
}), "meetingChatLinesOver");
|
|
30737
30739
|
|
|
30738
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30740
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
30739
30741
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
30740
30742
|
|
|
30741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
30742
30744
|
var TASK_CLOSE_KIND = "task_close";
|
|
30743
30745
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
30744
30746
|
var isOwnerOnlyKind = /* @__PURE__ */ __name((kind3) => kind3 === MAIL_FINDINGS_KIND || kind3 === MEETING_FINDINGS_KIND || kind3 === TASK_CLOSE_KIND || kind3 === SOURCE_REVIEW_KIND || kind3 === IDENTITY_LINK_KIND, "isOwnerOnlyKind");
|
|
@@ -30786,7 +30788,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
30786
30788
|
}, "assertMayDecide");
|
|
30787
30789
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
30788
30790
|
|
|
30789
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
30790
30792
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
30791
30793
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
30792
30794
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -30846,7 +30848,7 @@ var localWord = /* @__PURE__ */ __name((address) => {
|
|
|
30846
30848
|
var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)), "isRoleAddress");
|
|
30847
30849
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
30848
30850
|
|
|
30849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
30850
30852
|
var identitiesOf = /* @__PURE__ */ __name(({ database }, person2) => database.prepare("SELECT identity_id AS pk FROM identity_links WHERE person_id = ?").all(person2).map(({ pk }) => Number(pk)), "identitiesOf");
|
|
30851
30853
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
30852
30854
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -30861,7 +30863,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
30861
30863
|
var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
|
|
30862
30864
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
30863
30865
|
|
|
30864
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
30865
30867
|
var MESSAGE_FIELDS = {
|
|
30866
30868
|
pk: messages.id,
|
|
30867
30869
|
nativeId: messages.externalId,
|
|
@@ -31032,7 +31034,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
31032
31034
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
31033
31035
|
}), "chatActivity");
|
|
31034
31036
|
|
|
31035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
31036
31038
|
var HIT_FIELDS = {
|
|
31037
31039
|
...MESSAGE_FIELDS,
|
|
31038
31040
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -31131,7 +31133,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
31131
31133
|
};
|
|
31132
31134
|
}, "directReplies");
|
|
31133
31135
|
|
|
31134
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
31135
31137
|
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");
|
|
31136
31138
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
31137
31139
|
const found2 = identityRow(context, ref3);
|
|
@@ -31288,7 +31290,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
31288
31290
|
}, "mentioning");
|
|
31289
31291
|
var escaped = /* @__PURE__ */ __name((text7) => text7.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
31290
31292
|
|
|
31291
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
31292
31294
|
var PROFILE_PLACEHOLDER = "<profile>";
|
|
31293
31295
|
var unregistered = /* @__PURE__ */ __name((provider) => `no CLI has registered ${provider} in this store yet; run its CLI once`, "unregistered");
|
|
31294
31296
|
var profilesOn = /* @__PURE__ */ __name((profiles, app, key2) => Object.entries(profiles[app] ?? {}).filter(([, saved]) => saved.provider === key2.provider && saved.account === key2.account).map(([name]) => name), "profilesOn");
|
|
@@ -31387,7 +31389,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
|
31387
31389
|
return `${WORDS2[summary.kind]} ${named3}${notes2 === "" ? "" : ` (${notes2})`}`;
|
|
31388
31390
|
}, "refLabel");
|
|
31389
31391
|
|
|
31390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
31391
31393
|
var accountKeys = /* @__PURE__ */ __name((database, ids2) => {
|
|
31392
31394
|
const unique2 = [...new Set(ids2)];
|
|
31393
31395
|
if (unique2.length === 0)
|
|
@@ -31474,7 +31476,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text7) => {
|
|
|
31474
31476
|
}, "refEndsOf");
|
|
31475
31477
|
var refAccountsOf = /* @__PURE__ */ __name((database, text7) => refEndsOf(database, text7)?.flat(), "refAccountsOf");
|
|
31476
31478
|
|
|
31477
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31479
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
31478
31480
|
var EXCERPT_CHARS = 280;
|
|
31479
31481
|
var TITLE_CHARS = 120;
|
|
31480
31482
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -31898,7 +31900,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
31898
31900
|
ends: /* @__PURE__ */ __name(async (text7) => refEndsOf(context.database, text7), "ends")
|
|
31899
31901
|
}), "refsStoreOver");
|
|
31900
31902
|
|
|
31901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
31902
31904
|
var sourceOf3 = /* @__PURE__ */ __name((read3, ref3) => ({
|
|
31903
31905
|
ref: ref3,
|
|
31904
31906
|
kind: read3.kind,
|
|
@@ -31936,7 +31938,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
31936
31938
|
});
|
|
31937
31939
|
}, "evidenceSourcesOf");
|
|
31938
31940
|
|
|
31939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
31940
31942
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
31941
31943
|
var MAX_TEXT_CHARS = 2e6;
|
|
31942
31944
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -31962,7 +31964,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
31962
31964
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
31963
31965
|
}, "pdfPreviewLimits");
|
|
31964
31966
|
|
|
31965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
31966
31968
|
import { randomBytes } from "node:crypto";
|
|
31967
31969
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
31968
31970
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -31975,7 +31977,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
31975
31977
|
return time3 + random;
|
|
31976
31978
|
}, "ulid");
|
|
31977
31979
|
|
|
31978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
31979
31981
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
31980
31982
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
31981
31983
|
if (!meta && !sections?.length)
|
|
@@ -31996,7 +31998,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
31996
31998
|
return typeof language === "string" && language !== "" ? language : null;
|
|
31997
31999
|
}, "languageOf");
|
|
31998
32000
|
|
|
31999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
32000
32002
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
32001
32003
|
var objectOf3 = /* @__PURE__ */ __name((value) => {
|
|
32002
32004
|
if (isObject2(value))
|
|
@@ -32239,7 +32241,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
32239
32241
|
};
|
|
32240
32242
|
}, "filesStoreOver");
|
|
32241
32243
|
|
|
32242
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
32243
32245
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
32244
32246
|
entity: "document",
|
|
32245
32247
|
backend: "sql",
|
|
@@ -32285,7 +32287,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
32285
32287
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
32286
32288
|
}, "importedDocumentWhere");
|
|
32287
32289
|
|
|
32288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
32289
32291
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
32290
32292
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
32291
32293
|
var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
@@ -32318,7 +32320,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
32318
32320
|
};
|
|
32319
32321
|
}, "linkOf");
|
|
32320
32322
|
|
|
32321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
32322
32324
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
32323
32325
|
const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
|
|
32324
32326
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -32339,7 +32341,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
32339
32341
|
return changed;
|
|
32340
32342
|
}, "dateFileNotes");
|
|
32341
32343
|
|
|
32342
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
32343
32345
|
var textOf2 = /* @__PURE__ */ __name((text7, what, max = 1e5, allowEmpty = false) => {
|
|
32344
32346
|
const value = text7.trim();
|
|
32345
32347
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -32352,11 +32354,12 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
32352
32354
|
return value;
|
|
32353
32355
|
}, "oneOf");
|
|
32354
32356
|
|
|
32355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
32356
32358
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
32357
32359
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
32358
32360
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso4(value), "optionalIso");
|
|
32359
32361
|
var targetKey = /* @__PURE__ */ __name((text7) => fold(text7).trim().replace(/^@/, ""), "targetKey");
|
|
32362
|
+
var keepRevision = /* @__PURE__ */ __name((database, row2, at2) => database.prepare("INSERT INTO document_revisions (document_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(row2.id), String(row2.body ?? ""), Number(row2.revision), at2), "keepRevision");
|
|
32360
32363
|
var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
32361
32364
|
id: String(row2.id),
|
|
32362
32365
|
ref: `document:${row2.id}`,
|
|
@@ -32647,7 +32650,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32647
32650
|
const same = (found2.body ?? "") === text7 && (found2.title ?? null) === title && (found2.front_matter ?? null) === keptFrontMatter && (found2.metadata ?? null) === keptMetadata && (found2.content_hash ?? null) === hash2 && found2.deleted_at == null;
|
|
32648
32651
|
if (!same) {
|
|
32649
32652
|
if ((found2.body ?? "") !== text7)
|
|
32650
|
-
database
|
|
32653
|
+
keepRevision(database, found2, at2);
|
|
32651
32654
|
database.prepare("UPDATE documents SET title = ?, body = ?, front_matter = ?, content_hash = ?, metadata = ?, language = ?, revision = revision + ?, updated_at = ?, deleted_at = NULL WHERE id = ?").run(title, text7, keptFrontMatter, hash2, keptMetadata, language, (found2.body ?? "") === text7 ? 0 : 1, at2, id2);
|
|
32652
32655
|
}
|
|
32653
32656
|
syncFile(database, at2, id2, own ? {} : { place: here });
|
|
@@ -32791,7 +32794,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32791
32794
|
if (reference2 === void 0)
|
|
32792
32795
|
return { known: true, type: null, id: null };
|
|
32793
32796
|
const thing = thingOf(database, reference2);
|
|
32794
|
-
return thing ? { known: true, type: thing.type, id: thing.id } : { known: false, type: null, id: null };
|
|
32797
|
+
return thing ? { known: true, type: thing.type, id: idsOf(database, thing.type, thing.id) } : { known: false, type: null, id: null };
|
|
32795
32798
|
}, "pair");
|
|
32796
32799
|
const from2 = pair(options.from);
|
|
32797
32800
|
const to = pair(options.to);
|
|
@@ -32804,7 +32807,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32804
32807
|
...options.origin === void 0 ? [] : [{ sql: "source = ?", value: options.origin }],
|
|
32805
32808
|
...options.confirmed === void 0 ? [] : [{ sql: "confirmed = ?", value: options.confirmed ? 1 : 0 }]
|
|
32806
32809
|
];
|
|
32807
|
-
return database.prepare(`SELECT * FROM links WHERE (? IS NULL OR (from_type = ? AND from_id
|
|
32810
|
+
return database.prepare(`SELECT * FROM links WHERE (? IS NULL OR (from_type = ? AND from_id IN (SELECT value FROM json_each(?)))) AND (? IS NULL OR (to_type = ? AND to_id IN (SELECT value FROM json_each(?)))) AND (? = 0 OR to_id IS NULL)${filters.map(({ sql: sql2 }) => ` AND (${sql2})`).join("")} ORDER BY created_at, id LIMIT 5000`).all(from2.type, from2.type, from2.id, to.type, to.type, to.id, options.unresolved ? 1 : 0, ...filters.map(({ value }) => value)).map((row2) => linkOf(database, row2));
|
|
32808
32811
|
}, "links"),
|
|
32809
32812
|
removeLink: /* @__PURE__ */ __name(async (id2, by) => write(database, () => {
|
|
32810
32813
|
assertMayWithdraw({ id: `link:${id2}`, proposedBy: { type: "unknown" }, proposed: false }, by);
|
|
@@ -32862,7 +32865,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32862
32865
|
};
|
|
32863
32866
|
}, "notesStoreOver");
|
|
32864
32867
|
|
|
32865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
32866
32869
|
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";
|
|
32867
32870
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
32868
32871
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -33121,7 +33124,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33121
33124
|
};
|
|
33122
33125
|
}, "memoriesStoreOver");
|
|
33123
33126
|
|
|
33124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33127
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
33125
33128
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
33126
33129
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
33127
33130
|
throw new CliError(code, message3, { reason });
|
|
@@ -33269,7 +33272,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
33269
33272
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
33270
33273
|
}, "reviewedRowsOver");
|
|
33271
33274
|
|
|
33272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33275
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
33273
33276
|
var MAX_LINES = 500;
|
|
33274
33277
|
var PARENTS = {
|
|
33275
33278
|
invoice: {
|
|
@@ -33369,7 +33372,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
33369
33372
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
33370
33373
|
}, "moneyLinesOver");
|
|
33371
33374
|
|
|
33372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
33373
33376
|
var COUNTED = {
|
|
33374
33377
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
33375
33378
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -33444,7 +33447,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
33444
33447
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
33445
33448
|
}, "refundRulesOver");
|
|
33446
33449
|
|
|
33447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
33448
33451
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
33449
33452
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
33450
33453
|
var PAID = netPaidSql("i.id");
|
|
@@ -33842,7 +33845,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33842
33845
|
};
|
|
33843
33846
|
}, "financeStoreOver");
|
|
33844
33847
|
|
|
33845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
33846
33849
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
33847
33850
|
throw new CliError("validation_error", message3, { reason });
|
|
33848
33851
|
}, "refuse");
|
|
@@ -33920,7 +33923,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
33920
33923
|
};
|
|
33921
33924
|
}, "paymentEntriesOver");
|
|
33922
33925
|
|
|
33923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
33924
33927
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
33925
33928
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
33926
33929
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -33947,7 +33950,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
33947
33950
|
return valid;
|
|
33948
33951
|
}, "validateEvidenceFindings");
|
|
33949
33952
|
|
|
33950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
33951
33954
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
33952
33955
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
33953
33956
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -34133,7 +34136,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34133
34136
|
};
|
|
34134
34137
|
}, "proposedActionsStoreOver");
|
|
34135
34138
|
|
|
34136
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
34137
34140
|
var CONFIRMED = "proposal";
|
|
34138
34141
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
34139
34142
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -34320,7 +34323,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
34320
34323
|
return { items, hasMore: rows.length > offset + limit };
|
|
34321
34324
|
}, "identityLinkRows");
|
|
34322
34325
|
|
|
34323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
34324
34327
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
34325
34328
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
34326
34329
|
}, "missing");
|
|
@@ -34443,7 +34446,7 @@ function meetingContextLinksOver(context) {
|
|
|
34443
34446
|
}
|
|
34444
34447
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
34445
34448
|
|
|
34446
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
34447
34450
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
34448
34451
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
34449
34452
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34472,7 +34475,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
34472
34475
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
34473
34476
|
}, "indexedText");
|
|
34474
34477
|
|
|
34475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
34476
34479
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
34477
34480
|
var meetingCurrentIndexRows = `
|
|
34478
34481
|
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
|
|
@@ -34503,7 +34506,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
34503
34506
|
}, "invalidateMeetingStems");
|
|
34504
34507
|
var meetingStemmableText = /* @__PURE__ */ __name((text7) => text7.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
34505
34508
|
|
|
34506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
34507
34510
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
34508
34511
|
return {
|
|
34509
34512
|
async indexSearch(original) {
|
|
@@ -34571,10 +34574,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
34571
34574
|
}
|
|
34572
34575
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
34573
34576
|
|
|
34574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
34575
34578
|
import { createHash as createHash5 } from "node:crypto";
|
|
34576
34579
|
|
|
34577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/lucene/plain.js
|
|
34578
34581
|
var REPAIRED = /* @__PURE__ */ new Set([
|
|
34579
34582
|
"query.invalid-syntax",
|
|
34580
34583
|
"query.unclosed-literal",
|
|
@@ -34681,7 +34684,7 @@ var plainQuery = /* @__PURE__ */ __name((text7, fields4 = SEARCH_FIELDS) => {
|
|
|
34681
34684
|
return text7;
|
|
34682
34685
|
}, "plainQuery");
|
|
34683
34686
|
|
|
34684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
34685
34688
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
34686
34689
|
const padded = ` ${term} `;
|
|
34687
34690
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -34690,7 +34693,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
34690
34693
|
return [...pieces];
|
|
34691
34694
|
}, "trigrams");
|
|
34692
34695
|
|
|
34693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
34694
34697
|
var SHORTEST_CORRECTION = 3;
|
|
34695
34698
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
34696
34699
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -34737,7 +34740,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
34737
34740
|
return corrections;
|
|
34738
34741
|
}, "correctWords");
|
|
34739
34742
|
|
|
34740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
34741
34744
|
var SHORTEST_GARBLED = 4;
|
|
34742
34745
|
var MOST_WIDENED = 64;
|
|
34743
34746
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -34829,7 +34832,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
34829
34832
|
return found2.map((words3) => words3.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
|
|
34830
34833
|
}, "widenWords");
|
|
34831
34834
|
|
|
34832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
34833
34836
|
import { readFileSync } from "node:fs";
|
|
34834
34837
|
var loaded;
|
|
34835
34838
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -34888,7 +34891,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
34888
34891
|
return false;
|
|
34889
34892
|
}, "knownRussianWord");
|
|
34890
34893
|
|
|
34891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34894
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
34892
34895
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
34893
34896
|
var MOST_WORDS = 128;
|
|
34894
34897
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -35114,8 +35117,37 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text7, stemmer) => {
|
|
|
35114
35117
|
}, "check");
|
|
35115
35118
|
return check3(tree);
|
|
35116
35119
|
}, "matchMeetingText");
|
|
35120
|
+
var matchedMeetingWords = /* @__PURE__ */ __name((tree, text7, stemmer) => {
|
|
35121
|
+
const tokens = normalize(text7).match(/[\p{L}\p{N}]+/gu) ?? [];
|
|
35122
|
+
let stemmed;
|
|
35123
|
+
const stemsOf2 = /* @__PURE__ */ __name(() => stemmed ??= stemmer ? stemmer.explain(meetingStemmableText(text7)) : [], "stemsOf");
|
|
35124
|
+
const found2 = /* @__PURE__ */ new Set();
|
|
35125
|
+
const word2 = /* @__PURE__ */ __name((term) => {
|
|
35126
|
+
for (const token of tokens)
|
|
35127
|
+
if (term.whole ? token === term.literal : token.startsWith(term.literal))
|
|
35128
|
+
found2.add(token);
|
|
35129
|
+
for (const { word: word3, stem } of stemsOf2())
|
|
35130
|
+
if (term.stems.includes(stem))
|
|
35131
|
+
found2.add(word3);
|
|
35132
|
+
for (const widened of term.widened)
|
|
35133
|
+
if (tokens.includes(widened))
|
|
35134
|
+
found2.add(widened);
|
|
35135
|
+
}, "word");
|
|
35136
|
+
const visit = /* @__PURE__ */ __name((node) => {
|
|
35137
|
+
if (node.kind === "speaker")
|
|
35138
|
+
return;
|
|
35139
|
+
if (node.kind === "boolean")
|
|
35140
|
+
for (const part2 of [...node.must, ...node.should])
|
|
35141
|
+
visit(part2);
|
|
35142
|
+
else
|
|
35143
|
+
for (const term of node.words)
|
|
35144
|
+
word2(term);
|
|
35145
|
+
}, "visit");
|
|
35146
|
+
visit(tree);
|
|
35147
|
+
return [...found2];
|
|
35148
|
+
}, "matchedMeetingWords");
|
|
35117
35149
|
|
|
35118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35119
35151
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35120
35152
|
throw new CliError("validation_error", message3);
|
|
35121
35153
|
}, "fail");
|
|
@@ -35211,9 +35243,9 @@ function meetingHitSearchOver({ database }) {
|
|
|
35211
35243
|
if (after2)
|
|
35212
35244
|
params.push(after2.tier, after2.tier, after2.started, after2.started, after2.meeting, after2.meeting, after2.kind, after2.kind, after2.id);
|
|
35213
35245
|
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 (
|
|
35214
|
-
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
|
|
35215
|
-
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
|
|
35216
|
-
UNION ALL SELECT h.tier,m.started,m.id,2,s.id,NULL,${bytes("s", fields2)},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)
|
|
35246
|
+
SELECT h.tier,m.started,m.id AS meeting_id,0 AS kind,r.id,r.start_ms,${bytes("r", ["text", "speaker_name"])} 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,r.speaker_name AS speaker 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
|
|
35247
|
+
UNION ALL SELECT h.tier,m.started,m.id,1,c.id,NULL,${bytes("c", ["text"])},NULL,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
|
|
35248
|
+
UNION ALL SELECT h.tier,m.started,m.id,2,s.id,NULL,${bytes("s", fields2)},NULL,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)
|
|
35217
35249
|
SELECT h.*,${bytes("m", ["title"])}+${bytes("s", ["doc_url"])} AS context_bytes FROM hits h
|
|
35218
35250
|
JOIN meetings m ON m.id=h.meeting_id LEFT JOIN meeting_summaries s ON h.kind=2 AND s.id=h.id
|
|
35219
35251
|
${seek} ORDER BY h.tier,h.started DESC,h.meeting_id,h.kind,h.id LIMIT ?`;
|
|
@@ -35227,7 +35259,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35227
35259
|
fail("Invalid stored meeting search text size");
|
|
35228
35260
|
total += size2;
|
|
35229
35261
|
if (total > maxReadBytes)
|
|
35230
|
-
fail(
|
|
35262
|
+
fail(READ_BUDGET_EXCEEDED);
|
|
35231
35263
|
}
|
|
35232
35264
|
checkMeetingCancelled(input.signal);
|
|
35233
35265
|
const items = rows.slice(0, limit).map((row2) => {
|
|
@@ -35263,6 +35295,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35263
35295
|
text: text7,
|
|
35264
35296
|
startMs: row2.start_ms === null ? null : Number(row2.start_ms),
|
|
35265
35297
|
...kind3 === 0 ? {
|
|
35298
|
+
speakerName: row2.speaker === null ? null : String(row2.speaker),
|
|
35266
35299
|
language: row2.language === null ? null : String(row2.language),
|
|
35267
35300
|
line: Number(row2.position) + 1,
|
|
35268
35301
|
linesTotal: Number(row2.lines_total)
|
|
@@ -35273,8 +35306,9 @@ function meetingHitSearchOver({ database }) {
|
|
|
35273
35306
|
const corrections = matchMeetingText(tree, item.text, state.stemmer);
|
|
35274
35307
|
if (!corrections)
|
|
35275
35308
|
return [];
|
|
35309
|
+
const matchedWords = matchedMeetingWords(tree, item.text, state.stemmer);
|
|
35276
35310
|
return [
|
|
35277
|
-
corrections.length ? { ...item, match: "corrected", corrections } : { ...item, match: "words" }
|
|
35311
|
+
corrections.length ? { ...item, match: "corrected", corrections, matchedWords } : { ...item, match: "words", matchedWords }
|
|
35278
35312
|
];
|
|
35279
35313
|
});
|
|
35280
35314
|
if (fresh.length !== items.length)
|
|
@@ -35297,7 +35331,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35297
35331
|
}
|
|
35298
35332
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
35299
35333
|
|
|
35300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
35301
35335
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35302
35336
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
35303
35337
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -35329,7 +35363,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35329
35363
|
}
|
|
35330
35364
|
}), "meetingLanguagesOver");
|
|
35331
35365
|
|
|
35332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
35333
35367
|
import { createHash as createHash6 } from "node:crypto";
|
|
35334
35368
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
35335
35369
|
if (value === void 0)
|
|
@@ -35419,7 +35453,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
35419
35453
|
}
|
|
35420
35454
|
}), "meetingParticipantSearchOver");
|
|
35421
35455
|
|
|
35422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35456
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
35423
35457
|
var preparationQueries = {
|
|
35424
35458
|
participants: {
|
|
35425
35459
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -35469,7 +35503,7 @@ var preparationQueries = {
|
|
|
35469
35503
|
}
|
|
35470
35504
|
};
|
|
35471
35505
|
|
|
35472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
35473
35507
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35474
35508
|
async preparationContext(original) {
|
|
35475
35509
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -35510,7 +35544,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35510
35544
|
}
|
|
35511
35545
|
}), "meetingPreparationContextOver");
|
|
35512
35546
|
|
|
35513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35547
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
35514
35548
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
35515
35549
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
35516
35550
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -35524,7 +35558,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
35524
35558
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
35525
35559
|
)`, "preparationSubjects");
|
|
35526
35560
|
|
|
35527
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
35528
35562
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35529
35563
|
async preparationKnowledge(original) {
|
|
35530
35564
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -35569,7 +35603,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
35569
35603
|
}
|
|
35570
35604
|
}), "meetingPreparationKnowledgeOver");
|
|
35571
35605
|
|
|
35572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35606
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
35573
35607
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35574
35608
|
async preparationNotes(original) {
|
|
35575
35609
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -35622,7 +35656,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35622
35656
|
}
|
|
35623
35657
|
}), "meetingPreparationNotesOver");
|
|
35624
35658
|
|
|
35625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
35626
35660
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35627
35661
|
async relatedHistory(original) {
|
|
35628
35662
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -35693,7 +35727,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35693
35727
|
}
|
|
35694
35728
|
}), "meetingRelatedHistoryOver");
|
|
35695
35729
|
|
|
35696
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35730
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
35697
35731
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
35698
35732
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
35699
35733
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -35774,7 +35808,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35774
35808
|
}
|
|
35775
35809
|
}), "meetingReviewOver");
|
|
35776
35810
|
|
|
35777
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
35778
35812
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
35779
35813
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
35780
35814
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -35828,7 +35862,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35828
35862
|
}
|
|
35829
35863
|
}), "meetingSeriesHistoryOver");
|
|
35830
35864
|
|
|
35831
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
35832
35866
|
var MOST_ROWS = 5e5;
|
|
35833
35867
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
35834
35868
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -35897,7 +35931,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35897
35931
|
}
|
|
35898
35932
|
}), "meetingStatsOver");
|
|
35899
35933
|
|
|
35900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35934
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
35901
35935
|
var CURSOR_KEY = "meetings";
|
|
35902
35936
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
35903
35937
|
id: Number(row2.id),
|
|
@@ -36270,7 +36304,7 @@ var filtered = /* @__PURE__ */ __name((filter = {}) => {
|
|
|
36270
36304
|
const [limit, offset] = page(filter);
|
|
36271
36305
|
return {
|
|
36272
36306
|
sql: `SELECT * FROM meetings${where.length ? ` WHERE ${where.join(" AND ")}` : ""}
|
|
36273
|
-
ORDER BY
|
|
36307
|
+
ORDER BY started_at DESC, id LIMIT ? OFFSET ?`,
|
|
36274
36308
|
params: [...params, limit, offset]
|
|
36275
36309
|
};
|
|
36276
36310
|
}, "filtered");
|
|
@@ -36466,7 +36500,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36466
36500
|
};
|
|
36467
36501
|
}, "meetingStoreOver");
|
|
36468
36502
|
|
|
36469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
36470
36504
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
36471
36505
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
36472
36506
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -36492,7 +36526,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
36492
36526
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
36493
36527
|
}, "release");
|
|
36494
36528
|
|
|
36495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
36496
36530
|
var THREAD_COLUMNS = {
|
|
36497
36531
|
subject: {
|
|
36498
36532
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -36509,7 +36543,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
36509
36543
|
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);
|
|
36510
36544
|
}, "threadRows");
|
|
36511
36545
|
|
|
36512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36546
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
36513
36547
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
36514
36548
|
id: `email:${place.emailId}`,
|
|
36515
36549
|
chatId: place.threadExternalId,
|
|
@@ -37051,7 +37085,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
37051
37085
|
}
|
|
37052
37086
|
}), "mailStoreOver");
|
|
37053
37087
|
|
|
37054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
37055
37089
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
37056
37090
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
37057
37091
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -37141,7 +37175,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
37141
37175
|
}, "knownWord");
|
|
37142
37176
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
37143
37177
|
|
|
37144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
37145
37179
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
37146
37180
|
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");
|
|
37147
37181
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -37227,7 +37261,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
37227
37261
|
return found2;
|
|
37228
37262
|
}, "spokenTranscripts");
|
|
37229
37263
|
|
|
37230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
37231
37265
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
37232
37266
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
37233
37267
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -37274,7 +37308,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
37274
37308
|
});
|
|
37275
37309
|
}, "placeHits");
|
|
37276
37310
|
|
|
37277
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37311
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
37278
37312
|
var GROUPS = {
|
|
37279
37313
|
chat: {
|
|
37280
37314
|
key: "m.chat_id",
|
|
@@ -37296,7 +37330,7 @@ var GROUPS = {
|
|
|
37296
37330
|
}
|
|
37297
37331
|
};
|
|
37298
37332
|
|
|
37299
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
37300
37334
|
var MESSAGES2 = {
|
|
37301
37335
|
rows: "messages",
|
|
37302
37336
|
threads: "chats",
|
|
@@ -37779,7 +37813,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
37779
37813
|
};
|
|
37780
37814
|
}, "runCompiled");
|
|
37781
37815
|
|
|
37782
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
37783
37817
|
function invalidMetadata() {
|
|
37784
37818
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
37785
37819
|
}
|
|
@@ -37881,7 +37915,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
37881
37915
|
};
|
|
37882
37916
|
}), "counterTargets");
|
|
37883
37917
|
|
|
37884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37918
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
37885
37919
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
37886
37920
|
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,
|
|
37887
37921
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -38000,7 +38034,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
38000
38034
|
}));
|
|
38001
38035
|
}, "attachmentViews");
|
|
38002
38036
|
|
|
38003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
38004
38038
|
var transcript2 = /* @__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");
|
|
38005
38039
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text7, source2) => {
|
|
38006
38040
|
const { orm, database, now: now2 } = context;
|
|
@@ -38038,7 +38072,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
38038
38072
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
38039
38073
|
}, "intoVoiceAttachment");
|
|
38040
38074
|
|
|
38041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38075
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
38042
38076
|
var FIELDS = [
|
|
38043
38077
|
"threadExternalId",
|
|
38044
38078
|
"senderIdentityId",
|
|
@@ -38357,7 +38391,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
38357
38391
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
38358
38392
|
}, "writeDerivedReactions");
|
|
38359
38393
|
|
|
38360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
38361
38395
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
38362
38396
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
38363
38397
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -38378,7 +38412,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
38378
38412
|
};
|
|
38379
38413
|
}, "keysOver");
|
|
38380
38414
|
|
|
38381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38415
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
38382
38416
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
38383
38417
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
38384
38418
|
if (!row2)
|
|
@@ -38425,7 +38459,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
38425
38459
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
38426
38460
|
}, "forgetProfile");
|
|
38427
38461
|
|
|
38428
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38462
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
38429
38463
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
38430
38464
|
const owner = ownerPerson(context.database).id;
|
|
38431
38465
|
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);
|
|
@@ -38447,7 +38481,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
38447
38481
|
return personOf2(context, ref3);
|
|
38448
38482
|
}, "linkToOwner");
|
|
38449
38483
|
|
|
38450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38484
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
38451
38485
|
var PROVIDERS_SETTING = "providers";
|
|
38452
38486
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
38453
38487
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -38495,7 +38529,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
38495
38529
|
});
|
|
38496
38530
|
}, "registerProvider");
|
|
38497
38531
|
|
|
38498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38532
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
38499
38533
|
var DAY4 = 864e5;
|
|
38500
38534
|
var RECENTLY_CLOSED_MS = 14 * DAY4;
|
|
38501
38535
|
var TEXT_LIMIT = 20;
|
|
@@ -38694,7 +38728,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
38694
38728
|
};
|
|
38695
38729
|
}, "taskSimilarityOver");
|
|
38696
38730
|
|
|
38697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
38698
38732
|
var SETTING3 = "taskCategories";
|
|
38699
38733
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
38700
38734
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -38713,7 +38747,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
38713
38747
|
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);
|
|
38714
38748
|
}, "saveTaskCategories");
|
|
38715
38749
|
|
|
38716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
38717
38751
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
38718
38752
|
var ALLOWED = "taskAgentClose";
|
|
38719
38753
|
var MIN = "taskAgentCloseMin";
|
|
@@ -38769,7 +38803,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
38769
38803
|
];
|
|
38770
38804
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
38771
38805
|
|
|
38772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
38773
38807
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
38774
38808
|
var KEY = "taskFirstPassPerChat";
|
|
38775
38809
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -38789,7 +38823,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
38789
38823
|
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);
|
|
38790
38824
|
}, "saveFirstPassPerChat");
|
|
38791
38825
|
|
|
38792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
38793
38827
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
38794
38828
|
var EXTERNAL_ID_CHARS = 200;
|
|
38795
38829
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -38816,7 +38850,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
38816
38850
|
return text7;
|
|
38817
38851
|
}, "sourceUrlOf");
|
|
38818
38852
|
|
|
38819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
38820
38854
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
38821
38855
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
38822
38856
|
name,
|
|
@@ -39044,7 +39078,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
39044
39078
|
var TASK_PEOPLE = `WITH merged AS (SELECT json_extract(value, '$[0]') AS id, json_extract(value, '$[1]') AS now FROM json_each(?)), counts AS (SELECT coalesce(m.now, a.assignee_id) AS person, count(DISTINCT t.id) AS n FROM task_assignments a JOIN tasks t ON t.id = a.task_id AND t.deleted_at IS NULL LEFT JOIN merged m ON m.id = a.assignee_id WHERE a.assignee_type = 'person' GROUP BY 1) SELECT p.id, p.name, p.owner, coalesce(c.n, 0) AS n FROM persons p LEFT JOIN counts c ON c.person = p.id WHERE NOT ${mergedAwaySql("p")} ORDER BY p.owner DESC, n DESC, p.name IS NULL, p.name COLLATE NOCASE, p.id LIMIT ?`;
|
|
39045
39079
|
var mergedAssignees = /* @__PURE__ */ __name((database) => JSON.stringify(database.prepare(`SELECT DISTINCT a.assignee_id AS id FROM task_assignments a JOIN persons p ON p.id = a.assignee_id WHERE a.assignee_type = 'person' AND ${mergedAwaySql("p")}`).all().map(({ id: id2 }) => [Number(id2), currentPerson(database, Number(id2))])), "mergedAssignees");
|
|
39046
39080
|
|
|
39047
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
39048
39082
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
39049
39083
|
if (row2.author_type == null)
|
|
39050
39084
|
return null;
|
|
@@ -39072,7 +39106,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
39072
39106
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
39073
39107
|
}, "addComment");
|
|
39074
39108
|
|
|
39075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
39076
39110
|
var TASK_RELATION_KINDS = [
|
|
39077
39111
|
"blocked-by",
|
|
39078
39112
|
"follow-up-of",
|
|
@@ -39202,7 +39236,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
39202
39236
|
};
|
|
39203
39237
|
}, "taskRelationsStoreOver");
|
|
39204
39238
|
|
|
39205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
39206
39240
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
39207
39241
|
var iso8 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
39208
39242
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at2) => {
|
|
@@ -39731,7 +39765,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
39731
39765
|
};
|
|
39732
39766
|
}, "workTasksOver");
|
|
39733
39767
|
|
|
39734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39768
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
39735
39769
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
39736
39770
|
const { database, now: now2 } = context;
|
|
39737
39771
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -39780,7 +39814,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
39780
39814
|
};
|
|
39781
39815
|
}, "taskCloseOver");
|
|
39782
39816
|
|
|
39783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39817
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
39784
39818
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
39785
39819
|
const { database, now: now2 } = context;
|
|
39786
39820
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -39998,7 +40032,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
39998
40032
|
};
|
|
39999
40033
|
}, "taskPairsOver");
|
|
40000
40034
|
|
|
40001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
40002
40036
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
40003
40037
|
var TASK_STATS_SQL = {
|
|
40004
40038
|
rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? BOARD_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
|
|
@@ -40037,7 +40071,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
40037
40071
|
}, "statNames")
|
|
40038
40072
|
}), "taskStatsOver");
|
|
40039
40073
|
|
|
40040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
40041
40075
|
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";
|
|
40042
40076
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
40043
40077
|
const key2 = inboxKey(account);
|
|
@@ -40244,7 +40278,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
40244
40278
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
40245
40279
|
}, "oneOf");
|
|
40246
40280
|
|
|
40247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
40248
40282
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
40249
40283
|
const { database } = context;
|
|
40250
40284
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -40305,7 +40339,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
40305
40339
|
};
|
|
40306
40340
|
}, "accountsStoreOver");
|
|
40307
40341
|
|
|
40308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
40309
40343
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
40310
40344
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
40311
40345
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -40329,7 +40363,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
40329
40363
|
})), "keepDownloads");
|
|
40330
40364
|
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");
|
|
40331
40365
|
|
|
40332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
40333
40367
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
40334
40368
|
const { database } = context;
|
|
40335
40369
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -40386,7 +40420,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
40386
40420
|
}, "keepAttachmentText")
|
|
40387
40421
|
}), "attachmentsStoreOver");
|
|
40388
40422
|
|
|
40389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
40390
40424
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
40391
40425
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
40392
40426
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -40571,7 +40605,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
40571
40605
|
return done;
|
|
40572
40606
|
}, "rekeyChats");
|
|
40573
40607
|
|
|
40574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
40575
40609
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
40576
40610
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
40577
40611
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -40629,7 +40663,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
40629
40663
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
40630
40664
|
}, "chatCoverage");
|
|
40631
40665
|
|
|
40632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40666
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
40633
40667
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
40634
40668
|
const { database } = context;
|
|
40635
40669
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -40653,6 +40687,10 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40653
40687
|
const accountKey = findAccountPk2(key2);
|
|
40654
40688
|
return accountKey === void 0 ? [] : chatsWith(context, accountKey, key2, memberId);
|
|
40655
40689
|
}, "chatsWith"),
|
|
40690
|
+
chatScopes: /* @__PURE__ */ __name(async (key2, chatIds) => {
|
|
40691
|
+
const accountKey = findAccountPk2(key2);
|
|
40692
|
+
return accountKey === void 0 ? /* @__PURE__ */ new Map() : chatScopes(context, accountKey, chatIds);
|
|
40693
|
+
}, "chatScopes"),
|
|
40656
40694
|
markChatsLeft: /* @__PURE__ */ __name(async (key2, present2) => {
|
|
40657
40695
|
const accountKey = findAccountPk2(key2);
|
|
40658
40696
|
if (accountKey === void 0)
|
|
@@ -40764,7 +40802,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40764
40802
|
};
|
|
40765
40803
|
}, "chatsStoreOver");
|
|
40766
40804
|
|
|
40767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40805
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
40768
40806
|
import { createHash as createHash7 } from "node:crypto";
|
|
40769
40807
|
var BATCH_CONTEXT = 50;
|
|
40770
40808
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -40902,7 +40940,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
40902
40940
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
40903
40941
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
40904
40942
|
|
|
40905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
40906
40944
|
import { setTimeout } from "node:timers/promises";
|
|
40907
40945
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
40908
40946
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -41214,7 +41252,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
41214
41252
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
41215
41253
|
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");
|
|
41216
41254
|
|
|
41217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
41218
41256
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41219
41257
|
const { database } = context;
|
|
41220
41258
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -41321,7 +41359,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41321
41359
|
};
|
|
41322
41360
|
}, "conversationsStoreOver");
|
|
41323
41361
|
|
|
41324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
41325
41363
|
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";
|
|
41326
41364
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
41327
41365
|
const { database } = context;
|
|
@@ -41346,7 +41384,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41346
41384
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
41347
41385
|
}), "countersStoreOver");
|
|
41348
41386
|
|
|
41349
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
41350
41388
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
41351
41389
|
var MENTION_QUERY = defineQuery({
|
|
41352
41390
|
entity: "mention",
|
|
@@ -41565,7 +41603,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
41565
41603
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
41566
41604
|
}, "listPlaces");
|
|
41567
41605
|
|
|
41568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41606
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
41569
41607
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
41570
41608
|
const { database } = context;
|
|
41571
41609
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -41600,7 +41638,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41600
41638
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
41601
41639
|
}), "mentionsStoreOver");
|
|
41602
41640
|
|
|
41603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
41604
41642
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
41605
41643
|
const read3 = database.prepare("SELECT m.id, m.external_id, m.text, m.sent_at, m.sender_name, coalesce(m.sender_chat_external_id, i.external_id) AS sender_id FROM messages m LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.chat_id = ? AND m.deleted_at IS NULL AND (m.text LIKE '%google.com%' OR m.text LIKE '%forms.gle%') " + (messageId === void 0 ? "" : "AND m.external_id = ? ") + "ORDER BY m.sent_at DESC, m.id DESC");
|
|
41606
41644
|
const rows = messageId === void 0 ? read3.all(chatKey) : read3.all(chatKey, messageId);
|
|
@@ -41615,7 +41653,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
41615
41653
|
}));
|
|
41616
41654
|
}, "documentLinkMessages");
|
|
41617
41655
|
|
|
41618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
41619
41657
|
var stemmerFor = stemmerCache();
|
|
41620
41658
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
41621
41659
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -41659,7 +41697,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
41659
41697
|
});
|
|
41660
41698
|
}, "laterSharingRare");
|
|
41661
41699
|
|
|
41662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41700
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
41663
41701
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
41664
41702
|
const { database } = context;
|
|
41665
41703
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -41794,7 +41832,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41794
41832
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
41795
41833
|
}), "messagesStoreOver");
|
|
41796
41834
|
|
|
41797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
41798
41836
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
41799
41837
|
var PERSON_BY = {
|
|
41800
41838
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -41817,7 +41855,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids2) => {
|
|
|
41817
41855
|
return [...found2].sort((a, b) => a - b);
|
|
41818
41856
|
}, "personsByIdentifiers");
|
|
41819
41857
|
|
|
41820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41858
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
41821
41859
|
var BY = "rule";
|
|
41822
41860
|
var RULE2 = { bot: "rule", kind: "rule" };
|
|
41823
41861
|
var MOST_SHARING = 6;
|
|
@@ -42007,7 +42045,7 @@ var scanMatches = /* @__PURE__ */ __name((context, { full = false } = {}) => {
|
|
|
42007
42045
|
return pass.result;
|
|
42008
42046
|
}, "scanMatches");
|
|
42009
42047
|
|
|
42010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
42011
42049
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
42012
42050
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
42013
42051
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -42112,14 +42150,22 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
42112
42150
|
return recordOf2(context, alone);
|
|
42113
42151
|
}, "split");
|
|
42114
42152
|
|
|
42115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
42116
42154
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
42155
|
+
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
42156
|
+
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
42157
|
+
var NOTE_PROJECTS = `SELECT l.to_id FROM links l WHERE l.from_type='note' AND l.from_id=n.id AND l.to_type='project'
|
|
42158
|
+
AND l.kind=${linkKind("about")}`;
|
|
42159
|
+
var NOTE_SCOPES = `SELECT p.scope FROM main.projects p WHERE (n.notable_type='project' AND p.id=n.notable_id)
|
|
42160
|
+
OR p.id IN (${NOTE_PROJECTS})
|
|
42161
|
+
UNION SELECT 'personal' WHERE n.notable_type<>'project' AND NOT EXISTS(${NOTE_PROJECTS})`;
|
|
42117
42162
|
var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
42118
|
-
var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, { accounts: accounts2, limit }) => {
|
|
42163
|
+
var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, { accounts: accounts2, scopes, limit }) => {
|
|
42119
42164
|
const asked = Number(uid);
|
|
42120
42165
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(asked) || !Number.isSafeInteger(limit) || limit < 1)
|
|
42121
42166
|
throw new CliError("validation_error", "person preparation takes a person id and a positive limit");
|
|
42122
42167
|
const page3 = /* @__PURE__ */ __name((rows) => ({ items: rows.slice(0, limit), hasMore: rows.length > limit }), "page");
|
|
42168
|
+
const inScopes = JSON.stringify(scopes);
|
|
42123
42169
|
return read(database, () => {
|
|
42124
42170
|
const person2 = JSON.stringify(samePersons(database, asked));
|
|
42125
42171
|
const projects2 = `SELECT l.to_id FROM links l WHERE l.from_type='person' AND l.from_id IN (SELECT value FROM json_each(?))
|
|
@@ -42131,7 +42177,8 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
42131
42177
|
OR f.project_id IN (${projects2}))
|
|
42132
42178
|
AND (f.subject_type IS NOT 'project' OR f.subject_id IN (${GLOBAL_PROJECT}))
|
|
42133
42179
|
AND (f.project_id IS NULL OR f.project_id IN (${GLOBAL_PROJECT}))
|
|
42134
|
-
|
|
42180
|
+
AND coalesce(f.scope,${projectScope("coalesce(f.project_id,CASE WHEN f.subject_type='project' THEN f.subject_id END)")},'personal') ${IN_SCOPES}
|
|
42181
|
+
ORDER BY f.updated_at DESC, f.id DESC LIMIT ?`).all(person2, person2, person2, inScopes, limit + 1).map((row2) => ({
|
|
42135
42182
|
ref: `fact:${row2.id}`,
|
|
42136
42183
|
type: String(row2.type),
|
|
42137
42184
|
statement: String(row2.statement),
|
|
@@ -42145,7 +42192,8 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
42145
42192
|
AND ((n.notable_type='person' AND n.notable_id IN (SELECT value FROM json_each(?))) OR EXISTS(SELECT 1 FROM links l WHERE l.from_type='note'
|
|
42146
42193
|
AND l.from_id=n.id AND l.to_type='person' AND l.to_id IN (SELECT value FROM json_each(?)) AND l.kind=${linkKind("about")} AND l.confirmed=1))
|
|
42147
42194
|
AND (n.notable_type='person' OR (n.notable_type='project' AND n.notable_id IN (${GLOBAL_PROJECT})))
|
|
42148
|
-
|
|
42195
|
+
AND NOT EXISTS(SELECT 1 FROM (${NOTE_SCOPES}) WHERE scope NOT ${IN_SCOPES})
|
|
42196
|
+
ORDER BY n.updated_at DESC, n.id DESC LIMIT ?`).all(person2, person2, inScopes, limit + 1).map((row2) => ({
|
|
42149
42197
|
ref: `note:${row2.id}`,
|
|
42150
42198
|
title: row2.title == null ? null : String(row2.title),
|
|
42151
42199
|
text: String(row2.body),
|
|
@@ -42155,10 +42203,10 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
42155
42203
|
const tasks2 = database.prepare(`SELECT t.id,t.title,t.due_at,t.project_id,t.source_locator,t.created_at,group_concat(DISTINCT ta.role) AS role
|
|
42156
42204
|
FROM task_assignments ta JOIN tasks t ON t.id=ta.task_id JOIN main.projects p ON p.id=t.project_id
|
|
42157
42205
|
WHERE ta.assignee_type='person' AND ta.assignee_id IN (SELECT value FROM json_each(?)) AND t.deleted_at IS NULL AND t.status NOT IN ('done','dismissed')
|
|
42158
|
-
AND p.deleted_at IS NULL AND (p.account_id IS NULL OR p.account_id IN (SELECT a.id FROM accounts a
|
|
42206
|
+
AND p.deleted_at IS NULL AND ((p.account_id IS NULL AND p.scope ${IN_SCOPES}) OR p.account_id IN (SELECT a.id FROM accounts a
|
|
42159
42207
|
JOIN json_each(?) k ON a.provider=json_extract(k.value,'$.provider')
|
|
42160
42208
|
AND a.external_id=json_extract(k.value,'$.account')))
|
|
42161
|
-
GROUP BY t.id ORDER BY t.due_at IS NULL, t.due_at, t.created_at, t.id LIMIT ?`).all(person2, JSON.stringify(accounts2.map(({ provider, account }) => ({ provider, account }))), limit + 1).map((row2) => ({
|
|
42209
|
+
GROUP BY t.id ORDER BY t.due_at IS NULL, t.due_at, t.created_at, t.id LIMIT ?`).all(person2, inScopes, JSON.stringify(accounts2.map(({ provider, account }) => ({ provider, account }))), limit + 1).map((row2) => ({
|
|
42162
42210
|
ref: `task:${taskIdOf(database, Number(row2.id))}`,
|
|
42163
42211
|
title: String(row2.title),
|
|
42164
42212
|
role: String(row2.role),
|
|
@@ -42171,7 +42219,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
42171
42219
|
});
|
|
42172
42220
|
}, "personPreparation");
|
|
42173
42221
|
|
|
42174
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42222
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
42175
42223
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
42176
42224
|
const id2 = Number(uid);
|
|
42177
42225
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -42179,7 +42227,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
42179
42227
|
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(currentPerson(database, id2), JSON.stringify(accountIds)));
|
|
42180
42228
|
}, "personSeenInAccounts");
|
|
42181
42229
|
|
|
42182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
42183
42231
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
42184
42232
|
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);
|
|
42185
42233
|
if (!row2)
|
|
@@ -42246,7 +42294,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
42246
42294
|
return { id: id2, personId, removed: true };
|
|
42247
42295
|
}, "removeNote");
|
|
42248
42296
|
|
|
42249
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
42250
42298
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
42251
42299
|
const { database } = context;
|
|
42252
42300
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -42345,13 +42393,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
42345
42393
|
};
|
|
42346
42394
|
}, "peopleStoreOver");
|
|
42347
42395
|
|
|
42348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42396
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
42349
42397
|
import { createHash as createHash9 } from "node:crypto";
|
|
42350
42398
|
|
|
42351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42399
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
42352
42400
|
import { createHash as createHash8 } from "node:crypto";
|
|
42353
42401
|
|
|
42354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
42355
42403
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
42356
42404
|
var AUTHOR_MEASURES = [
|
|
42357
42405
|
"messages",
|
|
@@ -42491,7 +42539,7 @@ var withoutUrls = /* @__PURE__ */ __name((text7) => text7.replace(/\S+/gu, (toke
|
|
|
42491
42539
|
var rankingWords = /* @__PURE__ */ __name((text7) => withoutUrls(text7).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
42492
42540
|
var rankingQuestion = /* @__PURE__ */ __name((text7) => withoutUrls(text7).includes("?"), "rankingQuestion");
|
|
42493
42541
|
|
|
42494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
42495
42543
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
42496
42544
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
42497
42545
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -42713,7 +42761,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
42713
42761
|
};
|
|
42714
42762
|
}, "rankReplyGraph");
|
|
42715
42763
|
|
|
42716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
42717
42765
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
42718
42766
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
42719
42767
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -42887,7 +42935,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
42887
42935
|
return { items, evidence, summary, graph: graph.quality };
|
|
42888
42936
|
}, "calculateAdminStatistics");
|
|
42889
42937
|
|
|
42890
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
42891
42939
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
42892
42940
|
const dates = [];
|
|
42893
42941
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -42909,7 +42957,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
42909
42957
|
return dates[0].node.resolution.date;
|
|
42910
42958
|
}, "rankingContextRange");
|
|
42911
42959
|
|
|
42912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42960
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
42913
42961
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
42914
42962
|
let counts;
|
|
42915
42963
|
try {
|
|
@@ -43204,7 +43252,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
43204
43252
|
});
|
|
43205
43253
|
}, "rankQuery");
|
|
43206
43254
|
|
|
43207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
43208
43256
|
function fail2(message3, reason = "query.too-large") {
|
|
43209
43257
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
43210
43258
|
}
|
|
@@ -43381,7 +43429,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
43381
43429
|
return result;
|
|
43382
43430
|
}), "adminStatisticsQuery");
|
|
43383
43431
|
|
|
43384
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43432
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
43385
43433
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
43386
43434
|
if (!execution.accounts.length)
|
|
43387
43435
|
return { conversations: [], chats: [] };
|
|
@@ -43399,7 +43447,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
43399
43447
|
return { conversations: conversations2, chats: chats2 };
|
|
43400
43448
|
}, "conversationEligibility");
|
|
43401
43449
|
|
|
43402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
43403
43451
|
import { createHash as createHash10 } from "node:crypto";
|
|
43404
43452
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
43405
43453
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -43549,7 +43597,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
43549
43597
|
return result;
|
|
43550
43598
|
}, "rankingEvidence");
|
|
43551
43599
|
|
|
43552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
43553
43601
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
43554
43602
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
|
|
43555
43603
|
const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
|
|
@@ -43643,7 +43691,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
43643
43691
|
});
|
|
43644
43692
|
}, "waitingChats");
|
|
43645
43693
|
|
|
43646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
43647
43695
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
43648
43696
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
43649
43697
|
if (execution.corpus === "mail")
|
|
@@ -43664,7 +43712,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
43664
43712
|
};
|
|
43665
43713
|
}, "queriesStoreOver");
|
|
43666
43714
|
|
|
43667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
43668
43716
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
43669
43717
|
const { database, now: now2 } = context;
|
|
43670
43718
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -43703,10 +43751,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
43703
43751
|
}));
|
|
43704
43752
|
}, "chatEventsOf");
|
|
43705
43753
|
|
|
43706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
43707
43755
|
import { createHash as createHash11 } from "node:crypto";
|
|
43708
43756
|
|
|
43709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
43710
43758
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
43711
43759
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
43712
43760
|
timeZone: zone,
|
|
@@ -43726,7 +43774,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
43726
43774
|
return date3.toISOString().slice(0, 10);
|
|
43727
43775
|
}, "weekKey");
|
|
43728
43776
|
|
|
43729
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43777
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
43730
43778
|
var RETENTION_TOLERANCE = 864e5;
|
|
43731
43779
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
43732
43780
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -43780,7 +43828,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
43780
43828
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
43781
43829
|
}, "retentionCohorts");
|
|
43782
43830
|
|
|
43783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
43784
43832
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
43785
43833
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
43786
43834
|
validateRetentionOptions(options);
|
|
@@ -43911,7 +43959,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
43911
43959
|
};
|
|
43912
43960
|
}, "retentionQuery");
|
|
43913
43961
|
|
|
43914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
43915
43963
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
43916
43964
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
43917
43965
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -44042,7 +44090,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
44042
44090
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
44043
44091
|
})), "trackedChats");
|
|
44044
44092
|
|
|
44045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44093
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
44046
44094
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
44047
44095
|
const { database } = context;
|
|
44048
44096
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -44098,7 +44146,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
44098
44146
|
};
|
|
44099
44147
|
}, "rosterStoreOver");
|
|
44100
44148
|
|
|
44101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
44102
44150
|
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");
|
|
44103
44151
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
44104
44152
|
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 ?`);
|
|
@@ -44122,7 +44170,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
44122
44170
|
}
|
|
44123
44171
|
}, "backfillNormalized");
|
|
44124
44172
|
|
|
44125
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44173
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
44126
44174
|
var INDEX2 = "message_words";
|
|
44127
44175
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
44128
44176
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -44249,7 +44297,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
44249
44297
|
});
|
|
44250
44298
|
}, "resetSearchIndex");
|
|
44251
44299
|
|
|
44252
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
44253
44301
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
44254
44302
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
44255
44303
|
const before2 = stemsState(database);
|
|
@@ -44344,7 +44392,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
44344
44392
|
return resetStems(database, { now: now2 });
|
|
44345
44393
|
}, "followDefaultStemmers");
|
|
44346
44394
|
|
|
44347
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
44348
44396
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
44349
44397
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
44350
44398
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -44366,7 +44414,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
44366
44414
|
});
|
|
44367
44415
|
}, "termCandidates");
|
|
44368
44416
|
|
|
44369
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44417
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
44370
44418
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
44371
44419
|
const { database } = context;
|
|
44372
44420
|
const stemmerFor2 = stemmerCache();
|
|
@@ -44390,7 +44438,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
44390
44438
|
};
|
|
44391
44439
|
}, "searchIndexStoreOver");
|
|
44392
44440
|
|
|
44393
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
44394
44442
|
var HISTORY_KEPT = 1e3;
|
|
44395
44443
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
44396
44444
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -44459,7 +44507,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
44459
44507
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
44460
44508
|
}, "clearHistory");
|
|
44461
44509
|
|
|
44462
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
44463
44511
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
44464
44512
|
const { database } = context;
|
|
44465
44513
|
return {
|
|
@@ -44483,10 +44531,16 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
44483
44531
|
};
|
|
44484
44532
|
}, "searchesStoreOver");
|
|
44485
44533
|
|
|
44486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
44487
44535
|
import { createHash as createHash12 } from "node:crypto";
|
|
44488
44536
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
44489
44537
|
var sha256 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(value).digest("hex"), "sha256");
|
|
44538
|
+
var SOURCE_KEY = /^(?!sha256:)[a-z][a-z0-9-]{0,39}:[A-Za-z0-9._~-]{1,200}$/;
|
|
44539
|
+
var sourceKeyOf = /* @__PURE__ */ __name((key2) => {
|
|
44540
|
+
if (!SOURCE_KEY.test(key2))
|
|
44541
|
+
throw new CliError("validation_error", "a source key is <namespace>:<id>: a lower-case namespace other than sha256, then letters, digits, . _ ~ or -", { param: "sourceKey" });
|
|
44542
|
+
return key2;
|
|
44543
|
+
}, "sourceKeyOf");
|
|
44490
44544
|
var addedSourceKeyOf = /* @__PURE__ */ __name((content2) => {
|
|
44491
44545
|
const kind3 = oneOf(content2.kind, ADDED_KINDS, "an added source's kind");
|
|
44492
44546
|
if (kind3 === "file" && !content2.bytes)
|
|
@@ -44498,7 +44552,8 @@ var addedSourceKeyOf = /* @__PURE__ */ __name((content2) => {
|
|
|
44498
44552
|
throw new CliError("validation_error", "an added source without text needs its address");
|
|
44499
44553
|
const hash2 = kind3 === "file" ? sha256(content2.bytes) : sha256(normalized || url);
|
|
44500
44554
|
const hashes = [...new Set(kind3 === "file" || !text7 ? [hash2] : [hash2, sha256(content2.text)])];
|
|
44501
|
-
|
|
44555
|
+
const externalId = content2.sourceKey === void 0 ? `sha256:${hash2}` : sourceKeyOf(content2.sourceKey);
|
|
44556
|
+
return { externalId, hash: hash2, hashes };
|
|
44502
44557
|
}, "addedSourceKeyOf");
|
|
44503
44558
|
var checked = /* @__PURE__ */ __name((input) => {
|
|
44504
44559
|
const read3 = oneOf(input.read, ["extracted", "no-text"], "what was read");
|
|
@@ -44626,6 +44681,12 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
44626
44681
|
const own = ownRow(source2.externalId);
|
|
44627
44682
|
if (own !== void 0 && own.deleted_at == null) {
|
|
44628
44683
|
const id3 = Number(own.id);
|
|
44684
|
+
const revised2 = input.sourceKey !== void 0 && own.content_hash !== source2.hash;
|
|
44685
|
+
if (revised2) {
|
|
44686
|
+
keepRevision(database, own, at2);
|
|
44687
|
+
database.prepare("UPDATE documents SET kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?, revision = revision + 1, updated_at = ? WHERE id = ?").run(source2.kind, source2.title, source2.fileName, source2.extension, source2.url, input.mime ?? null, input.size ?? input.bytes?.byteLength ?? null, source2.hash, source2.text, source2.read === "extracted" ? "text" : "none", metadata3, languageOf(input.metadata), at2, id3);
|
|
44688
|
+
placeFile(id3, at2, source2.fileName ?? source2.title ?? source2.externalId);
|
|
44689
|
+
}
|
|
44629
44690
|
if (source2.copy !== null && own.storage !== "copy")
|
|
44630
44691
|
database.prepare("UPDATE documents SET storage = 'copy', local_path = ?, updated_at = ? WHERE id = ?").run(source2.copy, at2, id3);
|
|
44631
44692
|
const kept2 = source2.copy !== null || own.storage === "copy" ? "copy" : "text";
|
|
@@ -44634,6 +44695,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
44634
44695
|
created: false,
|
|
44635
44696
|
duplicateOf: null,
|
|
44636
44697
|
kept: kept2,
|
|
44698
|
+
changed: revised2,
|
|
44637
44699
|
subjects: about(id3, subjects, input.by)
|
|
44638
44700
|
};
|
|
44639
44701
|
}
|
|
@@ -44641,7 +44703,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
44641
44703
|
if (duplicate !== void 0) {
|
|
44642
44704
|
const linked = about(duplicate, subjects, input.by);
|
|
44643
44705
|
const note3 = documentAt(duplicate);
|
|
44644
|
-
return { note: note3, created: false, duplicateOf: note3.ref, kept: null, subjects: linked };
|
|
44706
|
+
return { note: note3, created: false, duplicateOf: note3.ref, kept: null, changed: false, subjects: linked };
|
|
44645
44707
|
}
|
|
44646
44708
|
const values = [
|
|
44647
44709
|
source2.kind,
|
|
@@ -44673,6 +44735,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
44673
44735
|
created: !own,
|
|
44674
44736
|
duplicateOf: null,
|
|
44675
44737
|
kept: source2.copy === null ? "text" : "copy",
|
|
44738
|
+
changed: true,
|
|
44676
44739
|
subjects: about(id2, subjects, input.by)
|
|
44677
44740
|
};
|
|
44678
44741
|
});
|
|
@@ -44680,7 +44743,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
44680
44743
|
};
|
|
44681
44744
|
}, "addedSourcesOver");
|
|
44682
44745
|
|
|
44683
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44746
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
44684
44747
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
44685
44748
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
44686
44749
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -44723,7 +44786,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
44723
44786
|
};
|
|
44724
44787
|
}, "agentActionsStoreOver");
|
|
44725
44788
|
|
|
44726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44789
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
44727
44790
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
44728
44791
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
44729
44792
|
if (typeof value !== "string")
|
|
@@ -44769,7 +44832,7 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2) =>
|
|
|
44769
44832
|
}
|
|
44770
44833
|
}, "suggestBaseStages");
|
|
44771
44834
|
|
|
44772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
44773
44836
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
44774
44837
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cutoff) => {
|
|
44775
44838
|
const rows = database.prepare(`SELECT stage_id, currency, count(*) AS items, coalesce(sum(amount), 0) AS units FROM ${TABLES2[kind3]} WHERE stage_id IN (${stageIds.map(() => "?").join(", ") || "NULL"}) AND deleted_at IS NULL AND (? IS NULL OR created_at >= ?) GROUP BY stage_id, currency ORDER BY currency`).all(...stageIds, cutoff, cutoff);
|
|
@@ -44786,7 +44849,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cuto
|
|
|
44786
44849
|
});
|
|
44787
44850
|
}, "stageAmountsOf");
|
|
44788
44851
|
|
|
44789
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
44790
44853
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
44791
44854
|
var itemsSql = /* @__PURE__ */ __name((kind3) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id, bs.id AS base_stage_ref_id, bs.name AS base_stage_name FROM ${TABLES3[kind3]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id LEFT JOIN pipeline_stages bs ON s.base_confirmed = 1 AND bs.id = s.base_stage_id`, "itemsSql");
|
|
44792
44855
|
var MAX_STAGES = 30;
|
|
@@ -45151,7 +45214,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45151
45214
|
};
|
|
45152
45215
|
}, "dealsStoreOver");
|
|
45153
45216
|
|
|
45154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
45155
45218
|
var KEY2 = "ownerLanguages";
|
|
45156
45219
|
var ISO_639_1 = new Set("aa ab ae af ak am an ar as av ay az ba be bg bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt qu rm rn ro ru rw sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu".split(" "));
|
|
45157
45220
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -45181,7 +45244,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
45181
45244
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY2, JSON.stringify(languages), now2);
|
|
45182
45245
|
}, "saveOwnerLanguages");
|
|
45183
45246
|
|
|
45184
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
45185
45248
|
var OUTCOMES = {
|
|
45186
45249
|
lead: ["open", "open", "open", "won", "lost"],
|
|
45187
45250
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -45514,7 +45577,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45514
45577
|
};
|
|
45515
45578
|
}, "baseStagesStoreOver");
|
|
45516
45579
|
|
|
45517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
45518
45581
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
45519
45582
|
}) => {
|
|
45520
45583
|
const { database, now: now2 } = context;
|
|
@@ -45573,7 +45636,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
45573
45636
|
};
|
|
45574
45637
|
}, "botUpdateStoreOver");
|
|
45575
45638
|
|
|
45576
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45639
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
45577
45640
|
import { createHash as createHash13 } from "node:crypto";
|
|
45578
45641
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
45579
45642
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -45925,7 +45988,7 @@ var fieldReferences = /* @__PURE__ */ __name((record4, options = {}) => {
|
|
|
45925
45988
|
return found2;
|
|
45926
45989
|
}, "fieldReferences");
|
|
45927
45990
|
|
|
45928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
45929
45992
|
var IMPORTER = { bot: "import" };
|
|
45930
45993
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
45931
45994
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -45970,7 +46033,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
45970
46033
|
};
|
|
45971
46034
|
}), "moneyLinesOf");
|
|
45972
46035
|
|
|
45973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
45974
46037
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
45975
46038
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
45976
46039
|
var listOf = /* @__PURE__ */ __name((list2) => {
|
|
@@ -46044,7 +46107,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
46044
46107
|
};
|
|
46045
46108
|
}, "relationRolesOver");
|
|
46046
46109
|
|
|
46047
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/crm.js
|
|
46048
46111
|
var isCrmUserId = /* @__PURE__ */ __name((id2) => /^\d{1,20}$/.test(id2), "isCrmUserId");
|
|
46049
46112
|
var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
|
|
46050
46113
|
const text7 = id2.trim();
|
|
@@ -46052,7 +46115,7 @@ var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
|
|
|
46052
46115
|
}, "normalCrmUserId");
|
|
46053
46116
|
var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
|
|
46054
46117
|
|
|
46055
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
46056
46119
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
46057
46120
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
46058
46121
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -46151,7 +46214,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
46151
46214
|
return [{ setting: String(row2.key), value: settingValue(database, parsed4.key, parsed4.name) }];
|
|
46152
46215
|
}), "crmSettingsOf");
|
|
46153
46216
|
|
|
46154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
46155
46218
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
46156
46219
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
46157
46220
|
id: link3.id,
|
|
@@ -46511,7 +46574,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
46511
46574
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
46512
46575
|
}, "decidedOrigin");
|
|
46513
46576
|
|
|
46514
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
46515
46578
|
var keyOf3 = /* @__PURE__ */ __name((kind3, fromType, fromId, toType, toId, role) => `${String(kind3)}|${String(fromType)}:${String(fromId)}|${String(toType)}:${String(toId)}|${role == null ? "" : String(role)}`, "keyOf");
|
|
46516
46579
|
var KEYED = "kind IN ('member-of', 'related-to', 'reports-to', 'customer-of', 'partner-of') AND to_id IS NOT NULL";
|
|
46517
46580
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
@@ -46650,7 +46713,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
46650
46713
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
46651
46714
|
}), "relationsStoreOver");
|
|
46652
46715
|
|
|
46653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
46654
46717
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
46655
46718
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
46656
46719
|
added: 0,
|
|
@@ -46840,7 +46903,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46840
46903
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
46841
46904
|
}, "recordRelationshipsOver");
|
|
46842
46905
|
|
|
46843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
46844
46907
|
var CONTRACTS = "SELECT k.*, b.name AS author_name, b.kind AS author_kind FROM contracts k LEFT JOIN bots b ON k.author_type = 'bot' AND b.id = k.author_id";
|
|
46845
46908
|
var DAY_MS = 864e5;
|
|
46846
46909
|
var deadlineOf = /* @__PURE__ */ __name((expiration, days) => expiration === null || days === null ? null : new Date(Date.parse(`${expiration}T00:00:00Z`) - days * DAY_MS).toISOString().slice(0, 10), "deadlineOf");
|
|
@@ -46996,7 +47059,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46996
47059
|
};
|
|
46997
47060
|
}, "contractsStoreOver");
|
|
46998
47061
|
|
|
46999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
47000
47063
|
var BUSINESS_FIND_MAX = 2001;
|
|
47001
47064
|
var party2 = /* @__PURE__ */ __name((kind3, id2, as) => `LEFT JOIN persons ${as}p ON ${kind3} = 'person' AND ${as}p.id = ${id2} AND ${as}p.owner = 0 LEFT JOIN organizations ${as}o ON ${kind3} = 'organization' AND ${as}o.id = ${id2} LEFT JOIN projects ${as}j ON ${kind3} = 'project' AND ${as}j.id = ${id2}`, "party");
|
|
47002
47065
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -47100,7 +47163,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
47100
47163
|
};
|
|
47101
47164
|
}, "businessSearchOver");
|
|
47102
47165
|
|
|
47103
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
47104
47167
|
var DAY5 = 864e5;
|
|
47105
47168
|
var COUNTERPART_LINK = `EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'event' AND l.from_id = e.id AND l.to_type = 'person' AND l.to_id = ? AND l.kind = ${linkKind("related-to")} AND l.role = '${COUNTERPART_ROLE}')`;
|
|
47106
47169
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -47210,7 +47273,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
47210
47273
|
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);
|
|
47211
47274
|
}, "listEvents");
|
|
47212
47275
|
|
|
47213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
47214
47277
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
47215
47278
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
47216
47279
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -47267,7 +47330,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
47267
47330
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
47268
47331
|
}, "forgetCalendarRows");
|
|
47269
47332
|
|
|
47270
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
47271
47334
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
47272
47335
|
id: Number(row2.id),
|
|
47273
47336
|
accountId: Number(row2.account_id),
|
|
@@ -47870,7 +47933,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47870
47933
|
};
|
|
47871
47934
|
}, "eventStoreOver");
|
|
47872
47935
|
|
|
47873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
47874
47937
|
var CATALOG_QUERY = defineQuery({
|
|
47875
47938
|
entity: "document",
|
|
47876
47939
|
backend: "sql",
|
|
@@ -48112,7 +48175,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
48112
48175
|
};
|
|
48113
48176
|
}, "catalogStoreOver");
|
|
48114
48177
|
|
|
48115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
48116
48179
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
48117
48180
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
48118
48181
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -48125,7 +48188,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
48125
48188
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
48126
48189
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
48127
48190
|
|
|
48128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
48129
48192
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
48130
48193
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
48131
48194
|
signal?.throwIfAborted();
|
|
@@ -48224,7 +48287,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
48224
48287
|
});
|
|
48225
48288
|
}, "readMeetingContextEvidence");
|
|
48226
48289
|
|
|
48227
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
48228
48291
|
var corpora = {
|
|
48229
48292
|
message: {
|
|
48230
48293
|
table: "messages",
|
|
@@ -48463,7 +48526,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
48463
48526
|
}
|
|
48464
48527
|
}), "contextRecordsOver");
|
|
48465
48528
|
|
|
48466
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
48467
48530
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
48468
48531
|
var SOURCE = "crm";
|
|
48469
48532
|
var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${idPart(key2.account)}/${type}/${idPart(externalId)}`, "crmIdentityId");
|
|
@@ -48592,7 +48655,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48592
48655
|
return { savePipeline, saveItemRow };
|
|
48593
48656
|
}, "crmRowsOver");
|
|
48594
48657
|
|
|
48595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48658
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
48596
48659
|
var PENDING = "crm:pending-relations";
|
|
48597
48660
|
var PENDING_DAYS = 30;
|
|
48598
48661
|
var PENDING_MOST = 5e3;
|
|
@@ -49081,16 +49144,16 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
49081
49144
|
};
|
|
49082
49145
|
}, "crmCopiesOver");
|
|
49083
49146
|
|
|
49084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
49085
49148
|
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
49086
49149
|
|
|
49087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
49088
49151
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
49089
49152
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
49090
49153
|
var TOKEN2 = /^[A-Za-z0-9_-]{21}[AQgw]$/;
|
|
49091
49154
|
var isDecisionToken = /* @__PURE__ */ __name((value) => typeof value === "string" && TOKEN2.test(value), "isDecisionToken");
|
|
49092
49155
|
|
|
49093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49156
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
49094
49157
|
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
49095
49158
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
49096
49159
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -49189,7 +49252,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
49189
49252
|
};
|
|
49190
49253
|
}, "decisionRequestStoreOver");
|
|
49191
49254
|
|
|
49192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
49193
49256
|
var NOTE_FIELDS = [
|
|
49194
49257
|
"text",
|
|
49195
49258
|
"exact",
|
|
@@ -49625,7 +49688,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
49625
49688
|
};
|
|
49626
49689
|
}, "noteSearchOver");
|
|
49627
49690
|
|
|
49628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
49629
49692
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
49630
49693
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
49631
49694
|
var EVENT_CORPUS = {
|
|
@@ -49757,7 +49820,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
49757
49820
|
};
|
|
49758
49821
|
}, "eventSearchOver");
|
|
49759
49822
|
|
|
49760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
49761
49824
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
49762
49825
|
try {
|
|
49763
49826
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -49769,7 +49832,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
49769
49832
|
}
|
|
49770
49833
|
}, "calendarMoment");
|
|
49771
49834
|
|
|
49772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
49773
49836
|
var NAMED4 = "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";
|
|
49774
49837
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
49775
49838
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -49989,7 +50052,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49989
50052
|
};
|
|
49990
50053
|
}, "factsStoreOver");
|
|
49991
50054
|
|
|
49992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50055
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
49993
50056
|
var invalid4 = /* @__PURE__ */ __name((message3) => {
|
|
49994
50057
|
throw new CliError("validation_error", message3);
|
|
49995
50058
|
}, "invalid");
|
|
@@ -50094,7 +50157,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
50094
50157
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
|
|
50095
50158
|
}, "findingsCoreOver");
|
|
50096
50159
|
|
|
50097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
50098
50161
|
var stale = /* @__PURE__ */ __name(() => {
|
|
50099
50162
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
50100
50163
|
reason: "evidence-findings.stale"
|
|
@@ -50296,7 +50359,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50296
50359
|
};
|
|
50297
50360
|
}, "evidenceFindingsStoreOver");
|
|
50298
50361
|
|
|
50299
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
50300
50363
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
50301
50364
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
50302
50365
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -50313,11 +50376,11 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
50313
50376
|
return { recomputed, pending: pendingInvolvements(database) };
|
|
50314
50377
|
}, "drain"),
|
|
50315
50378
|
pending: /* @__PURE__ */ __name(() => pendingInvolvements(database), "pending"),
|
|
50316
|
-
forPerson: /* @__PURE__ */ __name((personId, {
|
|
50379
|
+
forPerson: /* @__PURE__ */ __name((personId, { scopes, since, until, only, before: before2, limit = 100 } = {}) => {
|
|
50317
50380
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 1e3)
|
|
50318
50381
|
throw new CliError("validation_error", "involvement limit takes 1\u20131000");
|
|
50319
50382
|
const filters = [
|
|
50320
|
-
...
|
|
50383
|
+
...scopes === void 0 ? [] : [["AND i.scope IN (SELECT value FROM json_each(?))", JSON.stringify(scopes)]],
|
|
50321
50384
|
...since === void 0 ? [] : [["AND i.occurred_at>=?", since]],
|
|
50322
50385
|
...until === void 0 ? [] : [["AND i.occurred_at<=?", until]]
|
|
50323
50386
|
];
|
|
@@ -50349,7 +50412,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
50349
50412
|
}, "forPerson")
|
|
50350
50413
|
}), "involvementStoreOver");
|
|
50351
50414
|
|
|
50352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50415
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
50353
50416
|
var LABELLED = {
|
|
50354
50417
|
note: "note",
|
|
50355
50418
|
document: "document",
|
|
@@ -50361,7 +50424,7 @@ var LABELLED = {
|
|
|
50361
50424
|
account: "folder"
|
|
50362
50425
|
};
|
|
50363
50426
|
|
|
50364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
50365
50428
|
import { createHash as createHash15 } from "node:crypto";
|
|
50366
50429
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
50367
50430
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -50447,7 +50510,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
50447
50510
|
};
|
|
50448
50511
|
}, "meetingProjectsStoreOver");
|
|
50449
50512
|
|
|
50450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50513
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
50451
50514
|
var ORGANIZATIONS_QUERY = {
|
|
50452
50515
|
entity: "organization",
|
|
50453
50516
|
backend: "sql",
|
|
@@ -50488,7 +50551,7 @@ var REMINDERS_QUERY = {
|
|
|
50488
50551
|
})
|
|
50489
50552
|
};
|
|
50490
50553
|
|
|
50491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
50492
50555
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
50493
50556
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
50494
50557
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -50509,7 +50572,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
50509
50572
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
50510
50573
|
}, "categorySql");
|
|
50511
50574
|
|
|
50512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
50513
50576
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
50514
50577
|
id: String(row2.id),
|
|
50515
50578
|
ref: `organization:${row2.id}`,
|
|
@@ -50554,7 +50617,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
50554
50617
|
}), "setOwnOrganization")
|
|
50555
50618
|
}), "organizationsStoreOver");
|
|
50556
50619
|
|
|
50557
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
50558
50621
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
50559
50622
|
var ACCOUNT_ENDS = [
|
|
50560
50623
|
["deal", "deals"],
|
|
@@ -50601,8 +50664,10 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
50601
50664
|
if (filter.to !== void 0)
|
|
50602
50665
|
end("to", filter.to);
|
|
50603
50666
|
const about = filter.about === void 0 ? void 0 : thing(filter.about, "the reference");
|
|
50667
|
+
const aboutIds = about ? idsOf(database, about.type, about.id) : "[]";
|
|
50604
50668
|
if (about)
|
|
50605
|
-
add2(`((r.from_type = ? AND r.from_id IN (SELECT value FROM json_each(?))) OR (r.to_type = ? AND r.to_id IN (SELECT value FROM json_each(?))))`, about.type,
|
|
50669
|
+
add2(`((r.from_type = ? AND r.from_id IN (SELECT value FROM json_each(?))) OR (r.to_type = ? AND r.to_id IN (SELECT value FROM json_each(?))))`, about.type, aboutIds, about.type, aboutIds);
|
|
50670
|
+
const aboutSame = new Set(JSON.parse(aboutIds));
|
|
50606
50671
|
if (filter.at !== void 0)
|
|
50607
50672
|
add2("(r.starts_at IS NULL OR r.starts_at <= ?) AND (r.ends_at IS NULL OR ? < r.ends_at)", filter.at, filter.at);
|
|
50608
50673
|
if (filter.standing !== void 0)
|
|
@@ -50644,7 +50709,7 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
50644
50709
|
if (!about)
|
|
50645
50710
|
return item;
|
|
50646
50711
|
const from2 = thingOf(database, item.from);
|
|
50647
|
-
const outgoing = from2?.type === about.type && from2.id
|
|
50712
|
+
const outgoing = from2?.type === about.type && aboutSame.has(from2.id);
|
|
50648
50713
|
return outgoing ? { ...item, direction: "outgoing" } : { ...item, direction: "incoming", inverse: inverseOf(item.kind) };
|
|
50649
50714
|
});
|
|
50650
50715
|
return { items, hasMore: rows.length > limit };
|
|
@@ -50693,13 +50758,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
50693
50758
|
__name(proposalItem, "proposalItem");
|
|
50694
50759
|
}, "relationListOver");
|
|
50695
50760
|
|
|
50696
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50761
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
50697
50762
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
50698
50763
|
...relationListOver(context),
|
|
50699
50764
|
...relationRolesOver(context)
|
|
50700
50765
|
}), "relationReadsOver");
|
|
50701
50766
|
|
|
50702
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
50703
50768
|
var TABLES5 = { memory: "memories", fact: "facts" };
|
|
50704
50769
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
50705
50770
|
var DEFAULT_LIMIT = 500;
|
|
@@ -50942,16 +51007,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50942
51007
|
};
|
|
50943
51008
|
}, "sourceReviewStoreOver");
|
|
50944
51009
|
|
|
50945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
50946
51011
|
import { createHash as createHash18 } from "node:crypto";
|
|
50947
51012
|
|
|
50948
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51013
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
50949
51014
|
import { createHash as createHash17 } from "node:crypto";
|
|
50950
51015
|
|
|
50951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
50952
51017
|
import { createHash as createHash16 } from "node:crypto";
|
|
50953
51018
|
|
|
50954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
50955
51020
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
50956
51021
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
50957
51022
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -51002,7 +51067,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
51002
51067
|
return input;
|
|
51003
51068
|
}, "consolidationApplyInput");
|
|
51004
51069
|
|
|
51005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
51006
51071
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
51007
51072
|
id: String(row2.id),
|
|
51008
51073
|
sourceId: String(row2.source_id),
|
|
@@ -51077,7 +51142,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
51077
51142
|
}, { beforeCommit: check3 });
|
|
51078
51143
|
}, "applyTagConsolidation");
|
|
51079
51144
|
|
|
51080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
51081
51146
|
var selections = [
|
|
51082
51147
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
51083
51148
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -51221,7 +51286,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
51221
51286
|
};
|
|
51222
51287
|
}, "previewRows");
|
|
51223
51288
|
|
|
51224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51289
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
51225
51290
|
var kinds = ["project", "tag", "topic"];
|
|
51226
51291
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
51227
51292
|
if (signal?.aborted)
|
|
@@ -51485,7 +51550,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51485
51550
|
};
|
|
51486
51551
|
}, "vocabularyStoreOver");
|
|
51487
51552
|
|
|
51488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
51489
51554
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
51490
51555
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
51491
51556
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -52034,7 +52099,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
52034
52099
|
return key2.padEnd(3, "X");
|
|
52035
52100
|
}, "projectKey");
|
|
52036
52101
|
|
|
52037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
52038
52103
|
var DAY6 = 864e5;
|
|
52039
52104
|
var SETTING5 = "logs_pruned_at";
|
|
52040
52105
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY6, botUpdatePayloadsMs: 30 * DAY6 };
|
|
@@ -52061,7 +52126,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
52061
52126
|
};
|
|
52062
52127
|
}, "logPruner");
|
|
52063
52128
|
|
|
52064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
52065
52130
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
52066
52131
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
52067
52132
|
var invalid6 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -52437,7 +52502,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
52437
52502
|
}, "checkMailFindings");
|
|
52438
52503
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
52439
52504
|
|
|
52440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52505
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
52441
52506
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
52442
52507
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
52443
52508
|
var WEIGHTS = {
|
|
@@ -52570,7 +52635,7 @@ var scoreGroup = /* @__PURE__ */ __name((items, context) => {
|
|
|
52570
52635
|
return { score: kept2.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept2 };
|
|
52571
52636
|
}, "scoreGroup");
|
|
52572
52637
|
|
|
52573
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
52574
52639
|
var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
|
|
52575
52640
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
52576
52641
|
const { database, now: now2 } = context;
|
|
@@ -52783,7 +52848,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52783
52848
|
};
|
|
52784
52849
|
}, "ordersStoreOver");
|
|
52785
52850
|
|
|
52786
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
52787
52852
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
52788
52853
|
throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
|
|
52789
52854
|
reason: "mail-findings.stale"
|
|
@@ -53240,7 +53305,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
53240
53305
|
};
|
|
53241
53306
|
}, "mailFindingsStoreOver");
|
|
53242
53307
|
|
|
53243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53308
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
53244
53309
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
53245
53310
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
53246
53311
|
reason: "meeting-findings.stale"
|
|
@@ -53408,7 +53473,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53408
53473
|
};
|
|
53409
53474
|
}, "meetingFindingsStoreOver");
|
|
53410
53475
|
|
|
53411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53476
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
53412
53477
|
var RANK_BATCH = 512;
|
|
53413
53478
|
var LIVE5 = "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";
|
|
53414
53479
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -53679,7 +53744,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
53679
53744
|
}
|
|
53680
53745
|
}), "meetingVectorsOver");
|
|
53681
53746
|
|
|
53682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
53683
53748
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
53684
53749
|
var TEXTS = {
|
|
53685
53750
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -53780,7 +53845,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53780
53845
|
};
|
|
53781
53846
|
}, "sourceMentionStoreOver");
|
|
53782
53847
|
|
|
53783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
53784
53849
|
var TRANSACTIONS = "SELECT t.*, w.name AS wallet_name, b.name AS author_name, b.kind AS author_kind, (SELECT coalesce(sum(amount), 0) FROM transaction_splits WHERE transaction_id = t.id) AS split FROM financial_transactions t JOIN financial_accounts w ON w.id = t.financial_account_id LEFT JOIN bots b ON t.author_type = 'bot' AND b.id = t.author_id";
|
|
53785
53850
|
var MAX_SPLITS = 100;
|
|
53786
53851
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -54011,11 +54076,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54011
54076
|
};
|
|
54012
54077
|
}, "transactionsStoreOver");
|
|
54013
54078
|
|
|
54014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
54015
54080
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
54016
54081
|
import { dirname as dirname2 } from "node:path";
|
|
54017
54082
|
|
|
54018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54083
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
54019
54084
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
54020
54085
|
var CLIENTS_SETTING = "clients";
|
|
54021
54086
|
var coreVersion = (() => {
|
|
@@ -54076,7 +54141,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
54076
54141
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
54077
54142
|
}, "refusalAdvice");
|
|
54078
54143
|
|
|
54079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
54080
54145
|
var GENERATED = [
|
|
54081
54146
|
{
|
|
54082
54147
|
"name": "20261010184427_initial",
|
|
@@ -55319,7 +55384,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
55319
55384
|
}
|
|
55320
55385
|
];
|
|
55321
55386
|
|
|
55322
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
55323
55388
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
55324
55389
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
55325
55390
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -55552,7 +55617,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
55552
55617
|
return { ...result, foreignKeyViolations };
|
|
55553
55618
|
}, "rollBack");
|
|
55554
55619
|
|
|
55555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
55556
55621
|
var V31_TABLES = [
|
|
55557
55622
|
"accounts",
|
|
55558
55623
|
"account_identities",
|
|
@@ -55710,7 +55775,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
55710
55775
|
return migrations;
|
|
55711
55776
|
}, "generatedMigrations");
|
|
55712
55777
|
|
|
55713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55778
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
55714
55779
|
var MIGRATIONS = generatedMigrations();
|
|
55715
55780
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
55716
55781
|
version INTEGER PRIMARY KEY,
|
|
@@ -55807,7 +55872,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
55807
55872
|
}
|
|
55808
55873
|
}, "migrate");
|
|
55809
55874
|
|
|
55810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
55811
55876
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
55812
55877
|
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 ?");
|
|
55813
55878
|
if (pending.get(0, 1) === void 0)
|
|
@@ -55829,7 +55894,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
55829
55894
|
}
|
|
55830
55895
|
}, "fillJoinKeys");
|
|
55831
55896
|
|
|
55832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55897
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
55833
55898
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
55834
55899
|
refuseOwnerStoreInTests(path);
|
|
55835
55900
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -55843,8 +55908,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
55843
55908
|
}, "openSqlite");
|
|
55844
55909
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
55845
55910
|
quietSqliteWarning();
|
|
55846
|
-
const { drizzle } = await import("./node-
|
|
55847
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
55911
|
+
const { drizzle } = await import("./node-ZSSIVKVC.js");
|
|
55912
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-AUNJSQQL.js");
|
|
55848
55913
|
const client = await nodeClient(path, { readOnly });
|
|
55849
55914
|
try {
|
|
55850
55915
|
if (!readOnly)
|
|
@@ -55858,8 +55923,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
55858
55923
|
}
|
|
55859
55924
|
}, "openUnderNode");
|
|
55860
55925
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
55861
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
55862
|
-
const { drizzle } = await import("./bun-
|
|
55926
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KJCYXNMS.js");
|
|
55927
|
+
const { drizzle } = await import("./bun-VLN4HBWB.js");
|
|
55863
55928
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
55864
55929
|
try {
|
|
55865
55930
|
if (!readOnly)
|
|
@@ -55873,7 +55938,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
55873
55938
|
}
|
|
55874
55939
|
}, "openUnderBun");
|
|
55875
55940
|
|
|
55876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
55877
55942
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
55878
55943
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
55879
55944
|
try {
|
|
@@ -55941,7 +56006,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
55941
56006
|
});
|
|
55942
56007
|
}, "movePaymentFacts");
|
|
55943
56008
|
|
|
55944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56009
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
55945
56010
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
55946
56011
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
55947
56012
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -55959,7 +56024,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
55959
56024
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
55960
56025
|
}, "assertReadCompatible");
|
|
55961
56026
|
|
|
55962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
55963
56028
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
55964
56029
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
55965
56030
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -56005,7 +56070,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
56005
56070
|
});
|
|
56006
56071
|
}, "moveSuggestedLinks");
|
|
56007
56072
|
|
|
56008
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
56009
56074
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
56010
56075
|
var TEST_PROVIDER = "chat";
|
|
56011
56076
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -56026,7 +56091,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
56026
56091
|
}
|
|
56027
56092
|
}, "purgeTestAccounts");
|
|
56028
56093
|
|
|
56029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
56030
56095
|
var BACKFILL_ON_OPEN = 5e3;
|
|
56031
56096
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
56032
56097
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -56127,7 +56192,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
56127
56192
|
}
|
|
56128
56193
|
}, "openStoreContext");
|
|
56129
56194
|
|
|
56130
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
56131
56196
|
var PRODUCTS = "SELECT c.*, b.name AS author_name, b.kind AS author_kind FROM catalog_items c LEFT JOIN bots b ON c.author_type = 'bot' AND b.id = c.author_id";
|
|
56132
56197
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
56133
56198
|
const { database, now: now2 } = context;
|
|
@@ -56233,10 +56298,10 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56233
56298
|
};
|
|
56234
56299
|
}, "productsStoreOver");
|
|
56235
56300
|
|
|
56236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
56237
56302
|
import { createHash as createHash19 } from "node:crypto";
|
|
56238
56303
|
|
|
56239
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
56240
56305
|
var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
56241
56306
|
var ref = text5(2048);
|
|
56242
56307
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -56306,7 +56371,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
56306
56371
|
}))
|
|
56307
56372
|
});
|
|
56308
56373
|
|
|
56309
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
56310
56375
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
56311
56376
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
56312
56377
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -56410,7 +56475,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
56410
56475
|
invalid9("external.unused");
|
|
56411
56476
|
}, "validateProjectAnnotationsGraph");
|
|
56412
56477
|
|
|
56413
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
56414
56479
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
56415
56480
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
56416
56481
|
var targetSchema = strictObject({
|
|
@@ -56516,7 +56581,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
56516
56581
|
};
|
|
56517
56582
|
}, "planBoundProjectAnnotations");
|
|
56518
56583
|
|
|
56519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56584
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
56520
56585
|
import { createHash as createHash20 } from "node:crypto";
|
|
56521
56586
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
56522
56587
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -56610,7 +56675,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
56610
56675
|
})).digest("hex");
|
|
56611
56676
|
}, "projectAnnotationSnapshotFingerprint");
|
|
56612
56677
|
|
|
56613
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56678
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
56614
56679
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
56615
56680
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
56616
56681
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -56627,7 +56692,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
56627
56692
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
56628
56693
|
}, "projectAnnotationRequest");
|
|
56629
56694
|
|
|
56630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
56631
56696
|
var SnapshotBudget = class {
|
|
56632
56697
|
static {
|
|
56633
56698
|
__name(this, "SnapshotBudget");
|
|
@@ -56653,13 +56718,13 @@ var SnapshotBudget = class {
|
|
|
56653
56718
|
}
|
|
56654
56719
|
};
|
|
56655
56720
|
|
|
56656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
56657
56722
|
import { createHash as createHash22 } from "node:crypto";
|
|
56658
56723
|
|
|
56659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
56660
56725
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
56661
56726
|
|
|
56662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
56663
56728
|
import { createHash as createHash21 } from "node:crypto";
|
|
56664
56729
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
56665
56730
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -56802,7 +56867,7 @@ var ProjectSnapshotSources = class {
|
|
|
56802
56867
|
}
|
|
56803
56868
|
};
|
|
56804
56869
|
|
|
56805
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
56806
56871
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
56807
56872
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
56808
56873
|
}, "unsupported");
|
|
@@ -56980,7 +57045,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
56980
57045
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
56981
57046
|
}), "projectAnnotationSnapshot");
|
|
56982
57047
|
|
|
56983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
56984
57049
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
56985
57050
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
56986
57051
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -57042,7 +57107,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
57042
57107
|
};
|
|
57043
57108
|
}), "previewAnnotationSnapshot");
|
|
57044
57109
|
|
|
57045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
57046
57111
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
57047
57112
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
57048
57113
|
if (link3.kind === "evidence" && to)
|
|
@@ -57109,7 +57174,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
57109
57174
|
return mappings;
|
|
57110
57175
|
}, "restoreAnnotationRecords");
|
|
57111
57176
|
|
|
57112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57177
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
57113
57178
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
57114
57179
|
async preview(request) {
|
|
57115
57180
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -57139,7 +57204,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
57139
57204
|
}
|
|
57140
57205
|
}), "projectAnnotationStoreOver");
|
|
57141
57206
|
|
|
57142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
57143
57208
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
57144
57209
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
57145
57210
|
const sql2 = /* @__PURE__ */ __name((text7) => database.prepare(text7), "sql");
|
|
@@ -57210,7 +57275,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
57210
57275
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
57211
57276
|
}, "recordRelationsOver");
|
|
57212
57277
|
|
|
57213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
57214
57279
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
57215
57280
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
57216
57281
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -57264,7 +57329,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
57264
57329
|
return { pointedAt, remap };
|
|
57265
57330
|
}, "recordRemapOver");
|
|
57266
57331
|
|
|
57267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
57268
57333
|
var runs = 0;
|
|
57269
57334
|
var PAGE = 500;
|
|
57270
57335
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -57477,7 +57542,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
57477
57542
|
return pointerOf("records", index2, "fields", key2);
|
|
57478
57543
|
}, "waitingPointer");
|
|
57479
57544
|
|
|
57480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
57481
57546
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
57482
57547
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
57483
57548
|
var ORG_EMAIL = "org-email";
|
|
@@ -57643,7 +57708,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
57643
57708
|
]);
|
|
57644
57709
|
}, "renameMade");
|
|
57645
57710
|
|
|
57646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
57647
57712
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
57648
57713
|
name: given(fields4, "name"),
|
|
57649
57714
|
unit: given(fields4, "unit"),
|
|
@@ -57766,7 +57831,7 @@ var DIRECT_PROJECTORS = {
|
|
|
57766
57831
|
lead: dealProjector("lead")
|
|
57767
57832
|
};
|
|
57768
57833
|
|
|
57769
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57834
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
57770
57835
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
57771
57836
|
const importer = authorActor(context, IMPORTER).actor;
|
|
57772
57837
|
return context.database.prepare("SELECT 1 FROM payment_allocations WHERE payment_id = ? AND NOT (author_type = ? AND author_id = ?) LIMIT 1").get(paymentId, importer.type, importer.id) !== void 0;
|
|
@@ -57976,7 +58041,7 @@ var MONEY_PROJECTORS = {
|
|
|
57976
58041
|
}
|
|
57977
58042
|
};
|
|
57978
58043
|
|
|
57979
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
57980
58045
|
var CALLS_CALENDAR = "calls";
|
|
57981
58046
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
57982
58047
|
if (!isImportedProvider(source2.provider))
|
|
@@ -58151,7 +58216,7 @@ var PHONE_PROJECTORS = {
|
|
|
58151
58216
|
}
|
|
58152
58217
|
};
|
|
58153
58218
|
|
|
58154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58219
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
58155
58220
|
var RECORD_PROJECTORS = {
|
|
58156
58221
|
...MONEY_PROJECTORS,
|
|
58157
58222
|
...DIRECT_PROJECTORS,
|
|
@@ -58161,7 +58226,7 @@ var RECORD_PROJECTORS = {
|
|
|
58161
58226
|
project: null
|
|
58162
58227
|
};
|
|
58163
58228
|
|
|
58164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
58165
58230
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
58166
58231
|
const sql2 = /* @__PURE__ */ __name((text7) => database.prepare(text7), "sql");
|
|
58167
58232
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -58223,7 +58288,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
58223
58288
|
return { settle, checkShares };
|
|
58224
58289
|
}, "recordSettlingOver");
|
|
58225
58290
|
|
|
58226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
58227
58292
|
import { createHash as createHash23 } from "node:crypto";
|
|
58228
58293
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
58229
58294
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -58239,7 +58304,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
58239
58304
|
return { stamp, untouched };
|
|
58240
58305
|
}, "importStampsOver");
|
|
58241
58306
|
|
|
58242
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
58243
58308
|
var SUBSCRIPTIONS = "SELECT s.*, b.name AS author_name, b.kind AS author_kind FROM subscriptions s LEFT JOIN bots b ON s.author_type = 'bot' AND b.id = s.author_id";
|
|
58244
58309
|
var PRICES = "SELECT p.*, b.name AS author_name, b.kind AS author_kind FROM subscription_prices p LEFT JOIN bots b ON p.author_type = 'bot' AND b.id = p.author_id";
|
|
58245
58310
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -58470,7 +58535,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58470
58535
|
};
|
|
58471
58536
|
}, "subscriptionsStoreOver");
|
|
58472
58537
|
|
|
58473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
58474
58539
|
var WALLETS = "SELECT w.*, b.name AS author_name, b.kind AS author_kind FROM financial_accounts w LEFT JOIN bots b ON w.author_type = 'bot' AND b.id = w.author_id";
|
|
58475
58540
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
58476
58541
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -58592,7 +58657,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58592
58657
|
};
|
|
58593
58658
|
}, "walletsStoreOver");
|
|
58594
58659
|
|
|
58595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
58596
58661
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
58597
58662
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
58598
58663
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -58851,7 +58916,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
58851
58916
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
58852
58917
|
}, "recordWritesOver");
|
|
58853
58918
|
|
|
58854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
58855
58920
|
var LIMIT = 1e3;
|
|
58856
58921
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
58857
58922
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -59074,7 +59139,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
59074
59139
|
};
|
|
59075
59140
|
}, "recordStoreOver");
|
|
59076
59141
|
|
|
59077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
59078
59143
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
59079
59144
|
key: row2.key,
|
|
59080
59145
|
channel: row2.channel,
|
|
@@ -59129,7 +59194,7 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
59129
59194
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
59130
59195
|
}, "storedTemplateBodies");
|
|
59131
59196
|
|
|
59132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59197
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
59133
59198
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
59134
59199
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
59135
59200
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -59164,7 +59229,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
59164
59229
|
return proxy;
|
|
59165
59230
|
}, "storeErrors");
|
|
59166
59231
|
|
|
59167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
59168
59233
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
59169
59234
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
59170
59235
|
let merged2 = { from: from2, to };
|
|
@@ -59177,7 +59242,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
59177
59242
|
}, "markRange");
|
|
59178
59243
|
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");
|
|
59179
59244
|
|
|
59180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59245
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
59181
59246
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
59182
59247
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
59183
59248
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -59198,7 +59263,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
59198
59263
|
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);
|
|
59199
59264
|
}, "setTaskAnalysisMark");
|
|
59200
59265
|
|
|
59201
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59266
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
59202
59267
|
var keyOf5 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
59203
59268
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
59204
59269
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf5(account));
|
|
@@ -59208,7 +59273,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
59208
59273
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf5(account), JSON.stringify(until), now2);
|
|
59209
59274
|
}, "setTaskRulesStop");
|
|
59210
59275
|
|
|
59211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
59212
59277
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
59213
59278
|
const { database } = context;
|
|
59214
59279
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -59267,7 +59332,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
59267
59332
|
};
|
|
59268
59333
|
}, "syncStoreOver");
|
|
59269
59334
|
|
|
59270
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
59271
59336
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
59272
59337
|
const { database } = context;
|
|
59273
59338
|
return {
|
|
@@ -59289,7 +59354,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
59289
59354
|
};
|
|
59290
59355
|
}, "tagsStoreOver");
|
|
59291
59356
|
|
|
59292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
59293
59358
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
59294
59359
|
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
|
|
59295
59360
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -59416,7 +59481,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
59416
59481
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
59417
59482
|
}, "savePictureChunks");
|
|
59418
59483
|
|
|
59419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59484
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
59420
59485
|
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,
|
|
59421
59486
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
59422
59487
|
FROM messages m
|
|
@@ -59505,7 +59570,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
59505
59570
|
return plain2(best(found2));
|
|
59506
59571
|
}, "nearestMessages");
|
|
59507
59572
|
|
|
59508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
59509
59574
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
59510
59575
|
const { database } = context;
|
|
59511
59576
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -59764,7 +59829,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
59764
59829
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
59765
59830
|
}), "vectorsStoreOver");
|
|
59766
59831
|
|
|
59767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
59768
59833
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
59769
59834
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
59770
59835
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -59852,10 +59917,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
59852
59917
|
}
|
|
59853
59918
|
}, "lastBackup");
|
|
59854
59919
|
|
|
59855
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59920
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
59856
59921
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
59857
59922
|
|
|
59858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
59859
59924
|
var COUNTED_TABLES = [
|
|
59860
59925
|
"accounts",
|
|
59861
59926
|
"chats",
|
|
@@ -59940,7 +60005,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
59940
60005
|
};
|
|
59941
60006
|
}, "storeContents");
|
|
59942
60007
|
|
|
59943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.91.0_commander@15.0.0_esbuild@0.28.2_type_5a9525690cd264264c4a3180795dd7f6/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
59944
60009
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
59945
60010
|
const context = await openStoreContext(options);
|
|
59946
60011
|
try {
|