@wirecat/cli-memo 0.131.79 → 0.131.80
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-ZMIHTBZD.js → all-profiles-RVKEGURX.js} +5 -5
- package/dist/bundle/{anthropic-PNRUKJHS.js → anthropic-FC6XUSWM.js} +2 -2
- package/dist/bundle/{app-server-RNASTWZO.js → app-server-IRNKU3IF.js} +36 -36
- package/dist/bundle/auto-GTL4YGZX.js +91 -0
- package/dist/bundle/{bun-QU4I5GWB.js → bun-TYBGE5BX.js} +2 -2
- package/dist/bundle/{bun-sqlite-J4KG5VML.js → bun-sqlite-YENHHNPL.js} +3 -3
- package/dist/bundle/{chunk-GJ7KTKIP.js → chunk-2CJIZZSI.js} +12 -12
- package/dist/bundle/{chunk-XO6RP5FV.js → chunk-2FICCBKH.js} +1 -1
- package/dist/bundle/{chunk-IU2QDYBO.js → chunk-3H56E3VI.js} +4 -4
- package/dist/bundle/{chunk-VIZBCX3C.js → chunk-4IKO3JAA.js} +4 -4
- package/dist/bundle/{chunk-5YS4WS74.js → chunk-666J5H2Z.js} +1 -1
- package/dist/bundle/{chunk-U3VXKVKI.js → chunk-6W6CLZKX.js} +12 -12
- package/dist/bundle/{chunk-TBCHID7L.js → chunk-BS5JBNGX.js} +591 -509
- package/dist/bundle/{chunk-CY7WACM7.js → chunk-C2FE62E5.js} +29 -29
- package/dist/bundle/{chunk-QOFD6JSB.js → chunk-C4TAEYDQ.js} +5 -5
- package/dist/bundle/{chunk-PI42ZHZQ.js → chunk-CEGA7A35.js} +2 -2
- package/dist/bundle/{chunk-Q5YM3JWV.js → chunk-CUWTYE5A.js} +2 -2
- package/dist/bundle/{chunk-UYKKJOND.js → chunk-CVQJ7L4C.js} +4 -4
- package/dist/bundle/{chunk-6ZO2ZVKV.js → chunk-DS5SA5QP.js} +5 -5
- package/dist/bundle/{chunk-J2KPUG2X.js → chunk-EOXWI2EX.js} +4 -4
- package/dist/bundle/{chunk-OP5MKU7T.js → chunk-F62N6QMI.js} +1 -1
- package/dist/bundle/{chunk-4XOAQ5EQ.js → chunk-FIJTCBPQ.js} +8 -8
- package/dist/bundle/{chunk-GDSCR5BG.js → chunk-FR646D4S.js} +1 -1
- package/dist/bundle/{chunk-BBJBWSGN.js → chunk-GHYJW4ZH.js} +2 -2
- package/dist/bundle/{chunk-PB4ZGGR4.js → chunk-GNII3UL7.js} +1 -1
- package/dist/bundle/{chunk-2C536VQW.js → chunk-HFQXEMRG.js} +1 -1
- package/dist/bundle/{chunk-RMKJWDVT.js → chunk-HHZMDFE2.js} +45 -45
- package/dist/bundle/{chunk-4FPSZCWN.js → chunk-HKXACNLD.js} +2 -2
- package/dist/bundle/{chunk-2TIK6LHL.js → chunk-HXPU3ABX.js} +362 -299
- package/dist/bundle/{chunk-GTYESBB2.js → chunk-IJUXHUNZ.js} +2 -2
- package/dist/bundle/{chunk-VSSWVVOZ.js → chunk-IW6O2SAG.js} +10 -10
- package/dist/bundle/{chunk-FCHVDLEL.js → chunk-JDQSL2EY.js} +2 -2
- package/dist/bundle/{chunk-ZIDR2CSX.js → chunk-JJ6ODCVQ.js} +2 -2
- package/dist/bundle/{chunk-4BSNHOEV.js → chunk-JPC7GSJO.js} +9 -9
- package/dist/bundle/{chunk-UC5YCXKS.js → chunk-JTQAMVZH.js} +13 -13
- package/dist/bundle/{chunk-46Z7UUCG.js → chunk-K3JEAMTT.js} +1 -1
- package/dist/bundle/{chunk-SM7PB5CU.js → chunk-KDLOSANT.js} +5 -5
- package/dist/bundle/{chunk-DAJEINOF.js → chunk-KNRYIHUJ.js} +281 -281
- package/dist/bundle/{chunk-QNI3Q7XS.js → chunk-KVQY7R66.js} +2 -2
- package/dist/bundle/{chunk-IE6AEPW3.js → chunk-MDIXXKVU.js} +9 -9
- package/dist/bundle/{chunk-SEIRBXJT.js → chunk-MLYPJ4EC.js} +6 -6
- package/dist/bundle/{chunk-DP2RZ6FO.js → chunk-NH7KIGIS.js} +2 -2
- package/dist/bundle/{chunk-H6QELEPY.js → chunk-NUKMYB65.js} +4 -4
- package/dist/bundle/{chunk-CLZHPHKI.js → chunk-OFRIG3CX.js} +3 -3
- package/dist/bundle/{chunk-WN7BSOD2.js → chunk-OH4AIBZF.js} +1 -1
- package/dist/bundle/{chunk-7SGURCSQ.js → chunk-OSE7GXAR.js} +1 -1
- package/dist/bundle/{chunk-LQBVQX47.js → chunk-PX55CRD3.js} +83 -78
- package/dist/bundle/{chunk-MQ6XB6BV.js → chunk-Q46O7KXY.js} +5 -5
- package/dist/bundle/{chunk-A5TSIMI2.js → chunk-R4XCBPD2.js} +1 -1
- package/dist/bundle/{chunk-YJUVVYS6.js → chunk-RUM4GGHP.js} +4 -4
- package/dist/bundle/{chunk-R24Q24U5.js → chunk-RWVB7SLQ.js} +20 -20
- package/dist/bundle/{chunk-CQPXUMIS.js → chunk-S2KXO7MO.js} +1 -1
- package/dist/bundle/{chunk-IHWPNLCI.js → chunk-SGV2Z4BO.js} +148 -148
- package/dist/bundle/{chunk-3GOMBG55.js → chunk-SKX3BNTE.js} +7 -7
- package/dist/bundle/{chunk-O4ZIN4AY.js → chunk-SULQCO3Y.js} +5 -5
- package/dist/bundle/{chunk-JDI7CKLO.js → chunk-TJ2B36VK.js} +7 -7
- package/dist/bundle/{chunk-3HCGK4FN.js → chunk-UBUCTVHB.js} +1 -1
- package/dist/bundle/{chunk-CX3D6D43.js → chunk-UTYGPWUY.js} +3 -3
- package/dist/bundle/{chunk-ZFUYVQII.js → chunk-VQJDYQ55.js} +32 -32
- package/dist/bundle/{chunk-RUHFWDHD.js → chunk-VTBIVTS5.js} +3 -3
- package/dist/bundle/{chunk-24FOGKJI.js → chunk-W26VONC6.js} +5 -5
- package/dist/bundle/{chunk-JX4YNSYT.js → chunk-X3NHAO6T.js} +1 -1
- package/dist/bundle/{chunk-TH3LLEA2.js → chunk-XZJUAG7B.js} +3 -3
- package/dist/bundle/{chunk-HKOHKYDY.js → chunk-ZMLDVE22.js} +6 -6
- package/dist/bundle/{chunk-AWUANCLC.js → chunk-ZMSEKQQQ.js} +1 -1
- package/dist/bundle/{command-contract-4ZJOMSQ2.js → command-contract-SR6ONYV4.js} +11 -11
- package/dist/bundle/{command-server-entry-VSWZ5K2Q.js → command-server-entry-2WXZVYIX.js} +17 -17
- package/dist/bundle/{decode-OPD4OHCW.js → decode-U7VFYQAA.js} +2 -2
- package/dist/bundle/{echarts-AXYKRYU7.js → echarts-2PXBBLLJ.js} +2 -2
- package/dist/bundle/{embed-6DBZRTQ7.js → embed-DPA5QOIR.js} +3 -3
- package/dist/bundle/{embedder-SQI6IDZC.js → embedder-IGI2UTFK.js} +6 -6
- package/dist/bundle/{entry-RV5QAV44.js → entry-7PAYGIQO.js} +5 -5
- package/dist/bundle/{entry-2GKNMGW6.js → entry-IFOQTBXC.js} +5 -5
- package/dist/bundle/failure-NAM37T2T.js +71 -0
- package/dist/bundle/{first-run-BBMUDHYX.js → first-run-WHDDKA4V.js} +5 -5
- package/dist/bundle/{first-screen-4BS5M4JW.js → first-screen-P5C57USR.js} +12 -12
- package/dist/bundle/{instructions-JNAROG65.js → instructions-W7F7OQZS.js} +1 -1
- package/dist/bundle/{mcp-3MBYSBNS.js → mcp-3LAFWOGW.js} +35 -35
- package/dist/bundle/memo.js +3 -3
- package/dist/bundle/{node-6OTEDFSP.js → node-K6MWX3SW.js} +2 -2
- package/dist/bundle/{node-sqlite-HBHJOJX6.js → node-sqlite-WV6GCPEC.js} +4 -4
- package/dist/bundle/{oauth-PVQSSPPE.js → oauth-EH2Y54DG.js} +4 -4
- package/dist/bundle/{open-ARBTD4LX.js → open-PB4W3UAM.js} +2 -2
- package/dist/bundle/{openai-2JRFTWUA.js → openai-76OKHXWR.js} +7 -7
- package/dist/bundle/{process-4ERCV4WX.js → process-FMQ7Q7AI.js} +1 -1
- package/dist/bundle/{program-5KVHPFJU.js → program-BR2QHF36.js} +174 -78
- package/dist/bundle/{prompt-4I34VBPK.js → prompt-AW4T6CC2.js} +2 -2
- package/dist/bundle/{recognize-22BJ7RWB.js → recognize-X5DMT3HH.js} +1 -1
- package/dist/bundle/{remote-BON3MKY5.js → remote-HVKKXNYZ.js} +4 -4
- package/dist/bundle/{rerank-6CCCIZDS.js → rerank-IXMWD7JV.js} +4 -4
- package/dist/bundle/{serve-FB54DFIV.js → serve-42XTYB26.js} +6 -6
- package/dist/bundle/server-HUEXB5QL.js +64 -0
- package/dist/bundle/{server-TL5WPR3I.js → server-NNE7MUYT.js} +52 -52
- package/dist/bundle/server-YLXOJOTR.js +50 -0
- package/dist/bundle/{state-23IF45K6.js → state-EOU37GAH.js} +3 -3
- package/dist/bundle/{store-FGNXSGJU.js → store-F3REYMA6.js} +9 -9
- package/dist/bundle/store-maintenance-command-TOBBH3ZK.js +49 -0
- package/dist/bundle/update-3QB752NL.js +74 -0
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +1 -0
- package/dist/examples.js.map +1 -1
- package/dist/knowledge/command.d.ts.map +1 -1
- package/dist/knowledge/command.js +2 -0
- package/dist/knowledge/command.js.map +1 -1
- package/dist/knowledge/document-context.d.ts +14 -0
- package/dist/knowledge/document-context.d.ts.map +1 -0
- package/dist/knowledge/document-context.js +33 -0
- package/dist/knowledge/document-context.js.map +1 -0
- package/dist/knowledge/project-activity-command.d.ts +5 -0
- package/dist/knowledge/project-activity-command.d.ts.map +1 -0
- package/dist/knowledge/project-activity-command.js +71 -0
- package/dist/knowledge/project-activity-command.js.map +1 -0
- package/dist/knowledge/relationships.d.ts +4 -0
- package/dist/knowledge/relationships.d.ts.map +1 -1
- package/dist/knowledge/relationships.js +14 -0
- package/dist/knowledge/relationships.js.map +1 -1
- package/dist/knowledge/roles-command.d.ts.map +1 -1
- package/dist/knowledge/roles-command.js +7 -4
- package/dist/knowledge/roles-command.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +1 -0
- package/dist/program.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/auto-TRSJQGJH.js +0 -91
- package/dist/bundle/failure-7RJ4HOL4.js +0 -71
- package/dist/bundle/server-SG4BOF6U.js +0 -64
- package/dist/bundle/server-UYEXFEEB.js +0 -50
- package/dist/bundle/store-maintenance-command-PDLIZ4J2.js +0 -49
- package/dist/bundle/update-QTZREQD6.js +0 -74
- /package/dist/bundle/{chunk-2AFREBSM.js → chunk-ID2I2X2Z.js} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
fold,
|
|
13
13
|
normalize,
|
|
14
14
|
parseStemmers
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TJ2B36VK.js";
|
|
16
16
|
import {
|
|
17
17
|
SQLiteTable,
|
|
18
18
|
TableAliasProxyHandler,
|
|
@@ -37,17 +37,17 @@ import {
|
|
|
37
37
|
sql,
|
|
38
38
|
sqliteTable,
|
|
39
39
|
text
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-666J5H2Z.js";
|
|
41
41
|
import {
|
|
42
42
|
quietSqliteWarning,
|
|
43
43
|
storeCapable
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-DS5SA5QP.js";
|
|
45
45
|
import {
|
|
46
46
|
PRAGMAS,
|
|
47
47
|
TIME_LIMIT_FUNCTION,
|
|
48
48
|
TimeLimitReached,
|
|
49
49
|
isQueryOnly
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-S2KXO7MO.js";
|
|
51
51
|
import {
|
|
52
52
|
ACCOUNT_GROUPS,
|
|
53
53
|
ADDED_ACCOUNT,
|
|
@@ -226,22 +226,22 @@ import {
|
|
|
226
226
|
walkQuery,
|
|
227
227
|
walletLine,
|
|
228
228
|
zonedMoment
|
|
229
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-PX55CRD3.js";
|
|
230
230
|
import {
|
|
231
231
|
holdsCredential,
|
|
232
232
|
secretNamed,
|
|
233
233
|
sqliteCode
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-JJ6ODCVQ.js";
|
|
235
235
|
import {
|
|
236
236
|
DEFAULT_TASK_CATEGORIES,
|
|
237
237
|
sharedConfigPath,
|
|
238
238
|
storedTaskCategories,
|
|
239
239
|
taskCategoriesReader
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-RUM4GGHP.js";
|
|
241
241
|
import {
|
|
242
242
|
refuseOwnerStoreInTests,
|
|
243
243
|
storePath
|
|
244
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-R4XCBPD2.js";
|
|
245
245
|
import {
|
|
246
246
|
array,
|
|
247
247
|
boolean,
|
|
@@ -10011,7 +10011,7 @@ var require_cjs = __commonJS({
|
|
|
10011
10011
|
}
|
|
10012
10012
|
});
|
|
10013
10013
|
|
|
10014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10014
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
10015
10015
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10016
10016
|
const methods = whole;
|
|
10017
10017
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10139,7 +10139,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10139
10139
|
};
|
|
10140
10140
|
}, "bindAccount");
|
|
10141
10141
|
|
|
10142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10143
10143
|
var IndexBuilderOn = class {
|
|
10144
10144
|
static {
|
|
10145
10145
|
__name(this, "IndexBuilderOn");
|
|
@@ -10334,7 +10334,7 @@ function alias(table, alias2) {
|
|
|
10334
10334
|
}
|
|
10335
10335
|
__name(alias, "alias");
|
|
10336
10336
|
|
|
10337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
10338
10338
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10339
10339
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10340
10340
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -10453,7 +10453,7 @@ var fieldError = /* @__PURE__ */ __name((schema, value, at2 = []) => {
|
|
|
10453
10453
|
return void 0;
|
|
10454
10454
|
}, "fieldError");
|
|
10455
10455
|
|
|
10456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10456
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
10457
10457
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
10458
10458
|
var PARTY = ["person", "organization"];
|
|
10459
10459
|
var ORGANIZATION = ["organization"];
|
|
@@ -10827,7 +10827,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
|
|
|
10827
10827
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
10828
10828
|
var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
10829
10829
|
|
|
10830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10831
10831
|
var ENTITY_TABLES = {
|
|
10832
10832
|
...RECORD_TABLES,
|
|
10833
10833
|
account: "accounts",
|
|
@@ -10866,7 +10866,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10866
10866
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10867
10867
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10868
10868
|
|
|
10869
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10869
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
10870
10870
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
10871
10871
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
10872
10872
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -10923,7 +10923,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
10923
10923
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
10924
10924
|
}, "proposedBySql");
|
|
10925
10925
|
|
|
10926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
|
|
10927
10927
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
10928
10928
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
10929
10929
|
var KEPT = 20;
|
|
@@ -11018,7 +11018,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
11018
11018
|
return scrubbed;
|
|
11019
11019
|
}, "scrubSourceReviews");
|
|
11020
11020
|
|
|
11021
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11021
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
11022
11022
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
11023
11023
|
var REFERABLE = {
|
|
11024
11024
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -11178,7 +11178,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
11178
11178
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
11179
11179
|
}, "taskIdOf");
|
|
11180
11180
|
|
|
11181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
|
|
11182
11182
|
var QUOTE_LIMIT = 500;
|
|
11183
11183
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
11184
11184
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -11457,10 +11457,10 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
11457
11457
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
11458
11458
|
}, "deleteDocumentRow");
|
|
11459
11459
|
|
|
11460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/identity-links.js
|
|
11461
11461
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
11462
11462
|
|
|
11463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11463
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
|
|
11464
11464
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
11465
11465
|
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");
|
|
11466
11466
|
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");
|
|
@@ -11492,7 +11492,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
11492
11492
|
}, "samePersons");
|
|
11493
11493
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
11494
11494
|
|
|
11495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
|
|
11496
11496
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
11497
11497
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
11498
11498
|
const at2 = ref3.indexOf(":");
|
|
@@ -11598,13 +11598,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
11598
11598
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
11599
11599
|
}, "forgetErasedLinks");
|
|
11600
11600
|
|
|
11601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11601
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
|
|
11602
11602
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
11603
11603
|
|
|
11604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
11605
11605
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
11606
11606
|
|
|
11607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
11608
11608
|
var TASK_CLOSE_KIND = "task_close";
|
|
11609
11609
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
11610
11610
|
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 || kind3 === IDENTITY_SPLIT_KIND, "isOwnerOnlyKind");
|
|
@@ -11652,10 +11652,10 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
11652
11652
|
}, "assertMayDecide");
|
|
11653
11653
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
11654
11654
|
|
|
11655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11655
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
11656
11656
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11657
11657
|
|
|
11658
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11658
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
11659
11659
|
import { existsSync, statSync } from "node:fs";
|
|
11660
11660
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
11661
11661
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -11681,7 +11681,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
11681
11681
|
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" });
|
|
11682
11682
|
}, "checkJournal");
|
|
11683
11683
|
|
|
11684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11684
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
11685
11685
|
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;
|
|
11686
11686
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
11687
11687
|
const match = WRITE.exec(sql2);
|
|
@@ -11761,7 +11761,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
11761
11761
|
}, "committedWrites");
|
|
11762
11762
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
11763
11763
|
|
|
11764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
11765
11765
|
var ARMS = [
|
|
11766
11766
|
[
|
|
11767
11767
|
"message",
|
|
@@ -11889,7 +11889,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
11889
11889
|
return recomputed;
|
|
11890
11890
|
}, "drainInvolvementQueue");
|
|
11891
11891
|
|
|
11892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
11893
11893
|
import { domainToUnicode } from "node:url";
|
|
11894
11894
|
|
|
11895
11895
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -21911,7 +21911,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
21911
21911
|
}, "oa");
|
|
21912
21912
|
var na = { parse: O, get: aa, isValid: oa };
|
|
21913
21913
|
|
|
21914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
21915
21915
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
21916
21916
|
var ID = /^[\w-]{10,}$/;
|
|
21917
21917
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21953,7 +21953,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21953
21953
|
return { url, documentId: googleDocumentId(url) };
|
|
21954
21954
|
}), "googleDocumentLinks");
|
|
21955
21955
|
|
|
21956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
21957
21957
|
var PHONE_PLANS = [
|
|
21958
21958
|
{
|
|
21959
21959
|
country: "us",
|
|
@@ -22333,7 +22333,7 @@ var PHONE_PLANS = [
|
|
|
22333
22333
|
}
|
|
22334
22334
|
];
|
|
22335
22335
|
|
|
22336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22336
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
22337
22337
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
22338
22338
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
22339
22339
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -22407,7 +22407,7 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
22407
22407
|
return found2 ? `+${found2[1]}` : void 0;
|
|
22408
22408
|
}, "storedPhone");
|
|
22409
22409
|
|
|
22410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
22411
22411
|
var BEFORE = [
|
|
22412
22412
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
22413
22413
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -22529,9 +22529,9 @@ var numberAfter = /* @__PURE__ */ __name((tokens, at2, text8) => {
|
|
|
22529
22529
|
return void 0;
|
|
22530
22530
|
let last = next;
|
|
22531
22531
|
for (let more = next + 1; more + 1 < tokens.length; more += 2) {
|
|
22532
|
-
const
|
|
22532
|
+
const label2 = tokens[more];
|
|
22533
22533
|
const value = tokens[more + 1];
|
|
22534
|
-
if (!AFTER_NUMBER.test(
|
|
22534
|
+
if (!AFTER_NUMBER.test(label2.text) || !NUMBER.test(value.text) || !gapOk(tokens[more - 1], label2))
|
|
22535
22535
|
break;
|
|
22536
22536
|
last = more + 1;
|
|
22537
22537
|
}
|
|
@@ -22667,7 +22667,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
22667
22667
|
return found2.sort((a, b) => a.start - b.start);
|
|
22668
22668
|
}, "findPlaces");
|
|
22669
22669
|
|
|
22670
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22670
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
22671
22671
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
22672
22672
|
var MENTION_VERSIONS = {
|
|
22673
22673
|
phone: 1,
|
|
@@ -22843,7 +22843,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
22843
22843
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
22844
22844
|
}, "exactlyOne");
|
|
22845
22845
|
|
|
22846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
22847
22847
|
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";
|
|
22848
22848
|
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";
|
|
22849
22849
|
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";
|
|
@@ -22851,7 +22851,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
22851
22851
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
22852
22852
|
var NAME_WORDS = WORDS.split(" ");
|
|
22853
22853
|
|
|
22854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
22855
22855
|
var LATIN_TO_CYRILLIC = {
|
|
22856
22856
|
shch: "\u0449",
|
|
22857
22857
|
sch: "\u0449",
|
|
@@ -23059,7 +23059,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
23059
23059
|
return found2;
|
|
23060
23060
|
}, "findUnknownNames");
|
|
23061
23061
|
|
|
23062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
23063
23063
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
23064
23064
|
"webpage",
|
|
23065
23065
|
"share",
|
|
@@ -23099,7 +23099,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
23099
23099
|
});
|
|
23100
23100
|
}, "matchDownloads");
|
|
23101
23101
|
|
|
23102
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
23103
23103
|
var QUERY_VERSION = 1;
|
|
23104
23104
|
var QUERY_LIMITS2 = {
|
|
23105
23105
|
...QUERY_LIMITS,
|
|
@@ -23137,7 +23137,7 @@ function exhausted(budget) {
|
|
|
23137
23137
|
}
|
|
23138
23138
|
__name(exhausted, "exhausted");
|
|
23139
23139
|
|
|
23140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23140
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
23141
23141
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
23142
23142
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
23143
23143
|
kind: "char",
|
|
@@ -23537,7 +23537,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
23537
23537
|
return out;
|
|
23538
23538
|
}, "foldRegex");
|
|
23539
23539
|
|
|
23540
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23540
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
23541
23541
|
var PRESET_VERSION = 1;
|
|
23542
23542
|
var PRESETS = {
|
|
23543
23543
|
password: {
|
|
@@ -23591,7 +23591,7 @@ var PRESETS = {
|
|
|
23591
23591
|
}
|
|
23592
23592
|
};
|
|
23593
23593
|
|
|
23594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
23595
23595
|
var FIELD_VERSION = 2;
|
|
23596
23596
|
var UNITS = {
|
|
23597
23597
|
"": 1,
|
|
@@ -24063,12 +24063,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
24063
24063
|
return validateFields(parsed4.output);
|
|
24064
24064
|
}, "validateAst");
|
|
24065
24065
|
|
|
24066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
24067
24067
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
24068
24068
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
24069
24069
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
24070
24070
|
|
|
24071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
24072
24072
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
24073
24073
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
24074
24074
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -24092,7 +24092,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
24092
24092
|
};
|
|
24093
24093
|
}, "linkMatch");
|
|
24094
24094
|
|
|
24095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
24096
24096
|
var SETTING = "phoneCountries";
|
|
24097
24097
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
24098
24098
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -24123,7 +24123,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
24123
24123
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
24124
24124
|
}, "valueMatch");
|
|
24125
24125
|
|
|
24126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
24127
24127
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
24128
24128
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
24129
24129
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -24151,7 +24151,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
24151
24151
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
24152
24152
|
}, "vocabularySimilarity");
|
|
24153
24153
|
|
|
24154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
24155
24155
|
import { createHash } from "node:crypto";
|
|
24156
24156
|
var folded3 = /* @__PURE__ */ __name((name) => {
|
|
24157
24157
|
try {
|
|
@@ -24217,7 +24217,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
24217
24217
|
});
|
|
24218
24218
|
}, "guardTagCreation");
|
|
24219
24219
|
|
|
24220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
24221
24221
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
24222
24222
|
throw new CliError("validation_error", message3);
|
|
24223
24223
|
}, "invalid");
|
|
@@ -24294,7 +24294,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
24294
24294
|
};
|
|
24295
24295
|
}, "createTagRedirectIndex");
|
|
24296
24296
|
|
|
24297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
24298
24298
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
24299
24299
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
24300
24300
|
if (!row2)
|
|
@@ -24322,7 +24322,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
24322
24322
|
return snapshot2;
|
|
24323
24323
|
}, "tagRedirectSnapshot");
|
|
24324
24324
|
|
|
24325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24325
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
24326
24326
|
import { createHash as createHash2 } from "node:crypto";
|
|
24327
24327
|
var TASK_KEY_PREFIXES = {
|
|
24328
24328
|
question: "Q",
|
|
@@ -24350,7 +24350,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
24350
24350
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
24351
24351
|
}, "taskAccountOf");
|
|
24352
24352
|
|
|
24353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
24354
24354
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
24355
24355
|
if (iso17 === null || iso17 === void 0)
|
|
24356
24356
|
return null;
|
|
@@ -24364,7 +24364,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
24364
24364
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
24365
24365
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
24366
24366
|
|
|
24367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
24368
24368
|
var TAG_KINDS = ["tag", "topic"];
|
|
24369
24369
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
24370
24370
|
var TAG_TYPE = {
|
|
@@ -24567,7 +24567,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
24567
24567
|
return result;
|
|
24568
24568
|
}, "tagsOf");
|
|
24569
24569
|
|
|
24570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24570
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
24571
24571
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
24572
24572
|
var SPEECH = speech("att");
|
|
24573
24573
|
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");
|
|
@@ -24933,7 +24933,7 @@ var FIELD_COMPILERS = {
|
|
|
24933
24933
|
subject
|
|
24934
24934
|
};
|
|
24935
24935
|
|
|
24936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
24937
24937
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
24938
24938
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
24939
24939
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -24949,7 +24949,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
24949
24949
|
};
|
|
24950
24950
|
}, "placeOf");
|
|
24951
24951
|
|
|
24952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
24953
24953
|
var DRAIN_ON_WRITE = 500;
|
|
24954
24954
|
var METHOD = "rules";
|
|
24955
24955
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -25115,7 +25115,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
25115
25115
|
return queued.length;
|
|
25116
25116
|
}, "drainMentions");
|
|
25117
25117
|
|
|
25118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
25119
25119
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
25120
25120
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
25121
25121
|
if (!exists2)
|
|
@@ -25123,7 +25123,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
25123
25123
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
25124
25124
|
}, "indexRow");
|
|
25125
25125
|
|
|
25126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
25127
25127
|
var INDEX = "message_stems";
|
|
25128
25128
|
var SETTING2 = "searchStemmers";
|
|
25129
25129
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -25245,7 +25245,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
25245
25245
|
};
|
|
25246
25246
|
}, "stemmerCache");
|
|
25247
25247
|
|
|
25248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
25249
25249
|
var rehearsal = new AsyncLocalStorage();
|
|
25250
25250
|
var SQLITE_BUSY = 5;
|
|
25251
25251
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -25388,7 +25388,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
25388
25388
|
}
|
|
25389
25389
|
}, "read");
|
|
25390
25390
|
|
|
25391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
25392
25392
|
var FOLDED = [
|
|
25393
25393
|
{ table: "tasks", column: "title" },
|
|
25394
25394
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -25425,7 +25425,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
25425
25425
|
return filled2;
|
|
25426
25426
|
}, "fillFolded");
|
|
25427
25427
|
|
|
25428
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
25429
25429
|
import { createHash as createHash3 } from "node:crypto";
|
|
25430
25430
|
var CHUNK_CHARS = 1200;
|
|
25431
25431
|
var CHUNK_OVERLAP = 150;
|
|
@@ -25530,7 +25530,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
25530
25530
|
return chunks2;
|
|
25531
25531
|
}, "cutChunks");
|
|
25532
25532
|
|
|
25533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25533
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
25534
25534
|
var DAY2 = 864e5;
|
|
25535
25535
|
var CURRENCY = [
|
|
25536
25536
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -25656,7 +25656,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
25656
25656
|
return best?.day ?? null;
|
|
25657
25657
|
}, "dueDayOf");
|
|
25658
25658
|
|
|
25659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
25660
25660
|
var DAY3 = 864e5;
|
|
25661
25661
|
var STOP_WORDS = new Set([
|
|
25662
25662
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -25811,7 +25811,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
25811
25811
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
25812
25812
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
25813
25813
|
|
|
25814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25814
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
25815
25815
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
25816
25816
|
coalesce(CASE k.chunkable_type
|
|
25817
25817
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -25953,7 +25953,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
25953
25953
|
}, "dropUnusedVectors");
|
|
25954
25954
|
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");
|
|
25955
25955
|
|
|
25956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
25957
25957
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
25958
25958
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
25959
25959
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -26228,7 +26228,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
26228
26228
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
26229
26229
|
])), "vectorCounts");
|
|
26230
26230
|
|
|
26231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26231
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
26232
26232
|
var DOCUMENT_PICTURE = "document_picture";
|
|
26233
26233
|
var SCAN_PAGE2 = 5e3;
|
|
26234
26234
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -26291,12 +26291,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
26291
26291
|
}, "nearestPictures")
|
|
26292
26292
|
}), "documentPicturesOver");
|
|
26293
26293
|
|
|
26294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
26295
26295
|
var noteIndexText = /* @__PURE__ */ __name((title, text8) => title ? `${title}
|
|
26296
26296
|
|
|
26297
26297
|
${text8}` : text8, "noteIndexText");
|
|
26298
26298
|
|
|
26299
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26299
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
26300
26300
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
26301
26301
|
var ENRICHMENT_POSITION = 1e6;
|
|
26302
26302
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -26390,7 +26390,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
26390
26390
|
}), "clear")
|
|
26391
26391
|
}), "enrichmentsOver");
|
|
26392
26392
|
|
|
26393
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
26394
26394
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
26395
26395
|
const literal5 = escaped2 ?? plain2 ?? "";
|
|
26396
26396
|
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
@@ -26455,7 +26455,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
26455
26455
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
26456
26456
|
var bound2 = /* @__PURE__ */ __name(({ sql: text8, params }) => sql.join(text8.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
|
|
26457
26457
|
|
|
26458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
26459
26459
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
26460
26460
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
26461
26461
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -26545,7 +26545,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
26545
26545
|
});
|
|
26546
26546
|
}, "linkMeeting");
|
|
26547
26547
|
|
|
26548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
|
|
26549
26549
|
var MAX_TITLE = 120;
|
|
26550
26550
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
26551
26551
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -26577,7 +26577,7 @@ var displayTitleOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
26577
26577
|
}
|
|
26578
26578
|
}, "displayTitleOf");
|
|
26579
26579
|
|
|
26580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
26581
26581
|
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), ''))";
|
|
26582
26582
|
var UNSEARCHED_EVENT_TYPES = [
|
|
26583
26583
|
"working-location",
|
|
@@ -26824,7 +26824,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
26824
26824
|
return true;
|
|
26825
26825
|
}, "resetNoteIndex");
|
|
26826
26826
|
|
|
26827
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26827
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
26828
26828
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
26829
26829
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
26830
26830
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -26843,7 +26843,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
26843
26843
|
}
|
|
26844
26844
|
}, "resolvePersonLinks");
|
|
26845
26845
|
|
|
26846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
26847
26847
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
26848
26848
|
id: integer("id").primaryKey(),
|
|
26849
26849
|
name: text("name").notNull().unique(),
|
|
@@ -26852,7 +26852,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
26852
26852
|
updatedAt: integer("updated_at").notNull()
|
|
26853
26853
|
});
|
|
26854
26854
|
|
|
26855
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
26856
26856
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
26857
26857
|
id: integer("id").primaryKey(),
|
|
26858
26858
|
linkId: integer("link_id").notNull(),
|
|
@@ -26864,7 +26864,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
26864
26864
|
createdAt: integer("created_at").notNull()
|
|
26865
26865
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
26866
26866
|
|
|
26867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
26868
26868
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
26869
26869
|
sourceKey: text("source_key").notNull(),
|
|
26870
26870
|
collection: text("collection").notNull(),
|
|
@@ -26874,13 +26874,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
26874
26874
|
createdAt: integer("created_at").notNull()
|
|
26875
26875
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
26876
26876
|
|
|
26877
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26877
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
26878
26878
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
26879
26879
|
id: integer("id").notNull(),
|
|
26880
26880
|
indexableType: text("indexable_type").notNull()
|
|
26881
26881
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
26882
26882
|
|
|
26883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26883
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
26884
26884
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
26885
26885
|
id: integer("id").primaryKey(),
|
|
26886
26886
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -26900,7 +26900,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
26900
26900
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
26901
26901
|
]);
|
|
26902
26902
|
|
|
26903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
26904
26904
|
var enrichments = sqliteTable("enrichments", {
|
|
26905
26905
|
subjectType: text("subject_type").notNull(),
|
|
26906
26906
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -26912,7 +26912,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
26912
26912
|
createdAt: integer("created_at").notNull()
|
|
26913
26913
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
26914
26914
|
|
|
26915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
26916
26916
|
var templates = sqliteTable("templates", {
|
|
26917
26917
|
key: text("key").notNull(),
|
|
26918
26918
|
channel: text("channel").notNull(),
|
|
@@ -26934,7 +26934,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
26934
26934
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
26935
26935
|
]);
|
|
26936
26936
|
|
|
26937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26937
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
26938
26938
|
var links = sqliteTable("links", {
|
|
26939
26939
|
id: integer("id").primaryKey(),
|
|
26940
26940
|
fromType: text("from_type").notNull(),
|
|
@@ -26965,7 +26965,7 @@ var links = sqliteTable("links", {
|
|
|
26965
26965
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
26966
26966
|
]);
|
|
26967
26967
|
|
|
26968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
26969
26969
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
26970
26970
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
26971
26971
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -26991,7 +26991,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
26991
26991
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
26992
26992
|
]);
|
|
26993
26993
|
|
|
26994
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26994
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
26995
26995
|
var accounts = sqliteTable("accounts", {
|
|
26996
26996
|
id: integer("id").primaryKey(),
|
|
26997
26997
|
provider: text("provider").notNull(),
|
|
@@ -29001,7 +29001,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
29001
29001
|
at: integer("at").notNull()
|
|
29002
29002
|
});
|
|
29003
29003
|
|
|
29004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
29005
29005
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
29006
29006
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
29007
29007
|
find: orm.select({
|
|
@@ -29226,7 +29226,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
29226
29226
|
}, "meetingIdentityPk");
|
|
29227
29227
|
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");
|
|
29228
29228
|
|
|
29229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
29230
29230
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
29231
29231
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
29232
29232
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -29286,7 +29286,7 @@ var localWord = /* @__PURE__ */ __name((address) => {
|
|
|
29286
29286
|
var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)), "isRoleAddress");
|
|
29287
29287
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
29288
29288
|
|
|
29289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29289
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
29290
29290
|
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");
|
|
29291
29291
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
29292
29292
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -29301,7 +29301,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
29301
29301
|
var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
|
|
29302
29302
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
29303
29303
|
|
|
29304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
29305
29305
|
var MESSAGE_FIELDS = {
|
|
29306
29306
|
pk: messages.id,
|
|
29307
29307
|
nativeId: messages.externalId,
|
|
@@ -29472,7 +29472,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
29472
29472
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
29473
29473
|
}), "chatActivity");
|
|
29474
29474
|
|
|
29475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
29476
29476
|
var HIT_FIELDS = {
|
|
29477
29477
|
...MESSAGE_FIELDS,
|
|
29478
29478
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29571,7 +29571,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29571
29571
|
};
|
|
29572
29572
|
}, "directReplies");
|
|
29573
29573
|
|
|
29574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29574
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29575
29575
|
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");
|
|
29576
29576
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29577
29577
|
const found2 = identityRow(context, ref3);
|
|
@@ -29752,7 +29752,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29752
29752
|
}, "mentioning");
|
|
29753
29753
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29754
29754
|
|
|
29755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29755
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
29756
29756
|
var PROFILE_PLACEHOLDER = "<profile>";
|
|
29757
29757
|
var unregistered = /* @__PURE__ */ __name((provider) => `no CLI has registered ${provider} in this store yet; run its CLI once`, "unregistered");
|
|
29758
29758
|
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");
|
|
@@ -29851,7 +29851,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
|
29851
29851
|
return `${WORDS2[summary.kind]} ${named3}${notes2 === "" ? "" : ` (${notes2})`}`;
|
|
29852
29852
|
}, "refLabel");
|
|
29853
29853
|
|
|
29854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
29855
29855
|
var accountKeys = /* @__PURE__ */ __name((database, ids2) => {
|
|
29856
29856
|
const unique2 = [...new Set(ids2)];
|
|
29857
29857
|
if (unique2.length === 0)
|
|
@@ -29940,7 +29940,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
29940
29940
|
}, "refEndsOf");
|
|
29941
29941
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
29942
29942
|
|
|
29943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
29944
29944
|
var EXCERPT_CHARS = 280;
|
|
29945
29945
|
var TITLE_CHARS = 120;
|
|
29946
29946
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -30364,7 +30364,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30364
30364
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
30365
30365
|
}), "refsStoreOver");
|
|
30366
30366
|
|
|
30367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
30368
30368
|
var sourceOf3 = /* @__PURE__ */ __name((read3, ref3) => ({
|
|
30369
30369
|
ref: ref3,
|
|
30370
30370
|
kind: read3.kind,
|
|
@@ -30402,7 +30402,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
30402
30402
|
});
|
|
30403
30403
|
}, "evidenceSourcesOf");
|
|
30404
30404
|
|
|
30405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
30406
30406
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
30407
30407
|
var MAX_TEXT_CHARS = 2e6;
|
|
30408
30408
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -30428,7 +30428,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
30428
30428
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
30429
30429
|
}, "pdfPreviewLimits");
|
|
30430
30430
|
|
|
30431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30431
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
30432
30432
|
import { randomBytes } from "node:crypto";
|
|
30433
30433
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
30434
30434
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -30441,7 +30441,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
30441
30441
|
return time3 + random;
|
|
30442
30442
|
}, "ulid");
|
|
30443
30443
|
|
|
30444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
30445
30445
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
30446
30446
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
30447
30447
|
if (!meta && !sections?.length)
|
|
@@ -30462,7 +30462,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
30462
30462
|
return typeof language === "string" && language !== "" ? language : null;
|
|
30463
30463
|
}, "languageOf");
|
|
30464
30464
|
|
|
30465
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30465
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
30466
30466
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
30467
30467
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
30468
30468
|
if (isObject2(value))
|
|
@@ -30705,7 +30705,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30705
30705
|
};
|
|
30706
30706
|
}, "filesStoreOver");
|
|
30707
30707
|
|
|
30708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
30709
30709
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
30710
30710
|
entity: "document",
|
|
30711
30711
|
backend: "sql",
|
|
@@ -30751,7 +30751,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
30751
30751
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
30752
30752
|
}, "importedDocumentWhere");
|
|
30753
30753
|
|
|
30754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
30755
30755
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30756
30756
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30757
30757
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30759,7 +30759,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30759
30759
|
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);
|
|
30760
30760
|
}, "reviewLink");
|
|
30761
30761
|
|
|
30762
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30762
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
30763
30763
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30764
30764
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
30765
30765
|
var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
@@ -30792,7 +30792,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
30792
30792
|
};
|
|
30793
30793
|
}, "linkOf");
|
|
30794
30794
|
|
|
30795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
30796
30796
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
30797
30797
|
const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
|
|
30798
30798
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -30813,7 +30813,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
30813
30813
|
return changed;
|
|
30814
30814
|
}, "dateFileNotes");
|
|
30815
30815
|
|
|
30816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
30817
30817
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
30818
30818
|
const value = text8.trim();
|
|
30819
30819
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -30826,7 +30826,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
30826
30826
|
return value;
|
|
30827
30827
|
}, "oneOf");
|
|
30828
30828
|
|
|
30829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
30830
30830
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
30831
30831
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
30832
30832
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31341,7 +31341,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31341
31341
|
};
|
|
31342
31342
|
}, "notesStoreOver");
|
|
31343
31343
|
|
|
31344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
31345
31345
|
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";
|
|
31346
31346
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31347
31347
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31600,7 +31600,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31600
31600
|
};
|
|
31601
31601
|
}, "memoriesStoreOver");
|
|
31602
31602
|
|
|
31603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
31604
31604
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
31605
31605
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
31606
31606
|
throw new CliError(code, message3, { reason });
|
|
@@ -31748,7 +31748,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31748
31748
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
31749
31749
|
}, "reviewedRowsOver");
|
|
31750
31750
|
|
|
31751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31751
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
31752
31752
|
var MAX_LINES = 500;
|
|
31753
31753
|
var PARENTS = {
|
|
31754
31754
|
invoice: {
|
|
@@ -31848,7 +31848,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
31848
31848
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
31849
31849
|
}, "moneyLinesOver");
|
|
31850
31850
|
|
|
31851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
31852
31852
|
var COUNTED = {
|
|
31853
31853
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
31854
31854
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -31923,7 +31923,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
31923
31923
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
31924
31924
|
}, "refundRulesOver");
|
|
31925
31925
|
|
|
31926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
31927
31927
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
31928
31928
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
31929
31929
|
var PAID = netPaidSql("i.id");
|
|
@@ -32321,7 +32321,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32321
32321
|
};
|
|
32322
32322
|
}, "financeStoreOver");
|
|
32323
32323
|
|
|
32324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32324
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
32325
32325
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
32326
32326
|
throw new CliError("validation_error", message3, { reason });
|
|
32327
32327
|
}, "refuse");
|
|
@@ -32399,7 +32399,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32399
32399
|
};
|
|
32400
32400
|
}, "paymentEntriesOver");
|
|
32401
32401
|
|
|
32402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
32403
32403
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32404
32404
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32405
32405
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32426,7 +32426,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
32426
32426
|
return valid;
|
|
32427
32427
|
}, "validateEvidenceFindings");
|
|
32428
32428
|
|
|
32429
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32429
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
32430
32430
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32431
32431
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32432
32432
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32617,7 +32617,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32617
32617
|
};
|
|
32618
32618
|
}, "proposedActionsStoreOver");
|
|
32619
32619
|
|
|
32620
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
32621
32621
|
var CONFIRMED = "proposal";
|
|
32622
32622
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
32623
32623
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -32805,7 +32805,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
32805
32805
|
return { items, hasMore: rows.length > limit };
|
|
32806
32806
|
}, "identityLinkRows");
|
|
32807
32807
|
|
|
32808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
32809
32809
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
32810
32810
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
32811
32811
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -32912,7 +32912,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
32912
32912
|
return recordOf(context, alone);
|
|
32913
32913
|
}, "split");
|
|
32914
32914
|
|
|
32915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
|
|
32916
32916
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
32917
32917
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
32918
32918
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -33065,7 +33065,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
33065
33065
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33066
33066
|
}, "forgetErasedSplits");
|
|
33067
33067
|
|
|
33068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
33069
33069
|
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({
|
|
33070
33070
|
target: [accounts.provider, accounts.externalId],
|
|
33071
33071
|
set: {
|
|
@@ -33208,7 +33208,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
33208
33208
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
33209
33209
|
}, "dropOrphanPeople");
|
|
33210
33210
|
|
|
33211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33211
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
33212
33212
|
var HISTORY_KEY = "$history";
|
|
33213
33213
|
var objectOf3 = /* @__PURE__ */ __name((text8) => {
|
|
33214
33214
|
if (typeof text8 !== "string")
|
|
@@ -33284,7 +33284,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
33284
33284
|
return rest;
|
|
33285
33285
|
}, "withoutHistory");
|
|
33286
33286
|
|
|
33287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
33288
33288
|
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");
|
|
33289
33289
|
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");
|
|
33290
33290
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -33575,7 +33575,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
33575
33575
|
}
|
|
33576
33576
|
}, "replaceAutoTags");
|
|
33577
33577
|
|
|
33578
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33578
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
33579
33579
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
33580
33580
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
33581
33581
|
var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
|
|
@@ -33594,7 +33594,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
33594
33594
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
33595
33595
|
}, "counterFreshness");
|
|
33596
33596
|
|
|
33597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
33598
33598
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
33599
33599
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
33600
33600
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -33634,7 +33634,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
33634
33634
|
}, "maskStoredBotTokens");
|
|
33635
33635
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
33636
33636
|
|
|
33637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33637
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
33638
33638
|
import { createHash as createHash4 } from "node:crypto";
|
|
33639
33639
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
33640
33640
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -33732,7 +33732,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
33732
33732
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
33733
33733
|
}, "contextEvidenceRequest");
|
|
33734
33734
|
|
|
33735
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33735
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
33736
33736
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
33737
33737
|
var ACTIVITY = `
|
|
33738
33738
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -33862,7 +33862,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
33862
33862
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
33863
33863
|
}), "mailActivity");
|
|
33864
33864
|
|
|
33865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
33866
33866
|
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");
|
|
33867
33867
|
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;
|
|
33868
33868
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -34003,7 +34003,7 @@ var mailOwnText = /* @__PURE__ */ __name((body2) => {
|
|
|
34003
34003
|
return text8 || body2.trim();
|
|
34004
34004
|
}, "mailOwnText");
|
|
34005
34005
|
|
|
34006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
34007
34007
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
34008
34008
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
34009
34009
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -34116,7 +34116,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
34116
34116
|
return emails3 + threads;
|
|
34117
34117
|
}, "drainEmailIndex");
|
|
34118
34118
|
|
|
34119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34119
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
34120
34120
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
34121
34121
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
34122
34122
|
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,
|
|
@@ -34214,7 +34214,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
34214
34214
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
34215
34215
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
34216
34216
|
|
|
34217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
34218
34218
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
34219
34219
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
34220
34220
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -34264,7 +34264,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
34264
34264
|
return threads.length;
|
|
34265
34265
|
}, "markEmailsRestored");
|
|
34266
34266
|
|
|
34267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34267
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
34268
34268
|
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
|
|
34269
34269
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
34270
34270
|
WHERE p.account_id = ?
|
|
@@ -34324,7 +34324,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
34324
34324
|
}, "indexedMailPieces");
|
|
34325
34325
|
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");
|
|
34326
34326
|
|
|
34327
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34327
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
34328
34328
|
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");
|
|
34329
34329
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
34330
34330
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34391,7 +34391,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
34391
34391
|
}
|
|
34392
34392
|
}), "mailRulesOver");
|
|
34393
34393
|
|
|
34394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
34395
34395
|
function checkMeetingCancelled(signal) {
|
|
34396
34396
|
if (!signal?.aborted)
|
|
34397
34397
|
return;
|
|
@@ -34402,7 +34402,7 @@ function checkMeetingCancelled(signal) {
|
|
|
34402
34402
|
}
|
|
34403
34403
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
34404
34404
|
|
|
34405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
34406
34406
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
34407
34407
|
id: Number(row2.id),
|
|
34408
34408
|
accountId: Number(row2.account_id),
|
|
@@ -34452,7 +34452,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34452
34452
|
createdAt: Number(row2.created_at)
|
|
34453
34453
|
}), "transcriptRowOf");
|
|
34454
34454
|
|
|
34455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
34456
34456
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
34457
34457
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
34458
34458
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -34619,7 +34619,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34619
34619
|
}
|
|
34620
34620
|
}), "meetingReadsOver");
|
|
34621
34621
|
|
|
34622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
34623
34623
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
34624
34624
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
34625
34625
|
const params = [input.accountId];
|
|
@@ -34662,7 +34662,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
34662
34662
|
return { clauses, params };
|
|
34663
34663
|
}, "meetingSelectionSql");
|
|
34664
34664
|
|
|
34665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34665
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
34666
34666
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34667
34667
|
async meetingChatLines(input) {
|
|
34668
34668
|
checkMeetingCancelled(input.signal);
|
|
@@ -34690,7 +34690,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34690
34690
|
}
|
|
34691
34691
|
}), "meetingChatLinesOver");
|
|
34692
34692
|
|
|
34693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34693
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
34694
34694
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
34695
34695
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
34696
34696
|
}, "missing");
|
|
@@ -34813,7 +34813,7 @@ function meetingContextLinksOver(context) {
|
|
|
34813
34813
|
}
|
|
34814
34814
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
34815
34815
|
|
|
34816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
34817
34817
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
34818
34818
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
34819
34819
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34842,7 +34842,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
34842
34842
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
34843
34843
|
}, "indexedText");
|
|
34844
34844
|
|
|
34845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
34846
34846
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
34847
34847
|
var meetingCurrentIndexRows = `
|
|
34848
34848
|
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
|
|
@@ -34873,7 +34873,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
34873
34873
|
}, "invalidateMeetingStems");
|
|
34874
34874
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
34875
34875
|
|
|
34876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34876
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
34877
34877
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
34878
34878
|
return {
|
|
34879
34879
|
async indexSearch(original) {
|
|
@@ -34941,10 +34941,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
34941
34941
|
}
|
|
34942
34942
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
34943
34943
|
|
|
34944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34944
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
34945
34945
|
import { createHash as createHash5 } from "node:crypto";
|
|
34946
34946
|
|
|
34947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34947
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/lucene/plain.js
|
|
34948
34948
|
var REPAIRED = /* @__PURE__ */ new Set([
|
|
34949
34949
|
"query.invalid-syntax",
|
|
34950
34950
|
"query.unclosed-literal",
|
|
@@ -35051,7 +35051,7 @@ var plainQuery = /* @__PURE__ */ __name((text8, fields4 = SEARCH_FIELDS) => {
|
|
|
35051
35051
|
return text8;
|
|
35052
35052
|
}, "plainQuery");
|
|
35053
35053
|
|
|
35054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35054
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
35055
35055
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
35056
35056
|
const padded = ` ${term} `;
|
|
35057
35057
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -35060,7 +35060,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
35060
35060
|
return [...pieces];
|
|
35061
35061
|
}, "trigrams");
|
|
35062
35062
|
|
|
35063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
35064
35064
|
var SHORTEST_CORRECTION = 3;
|
|
35065
35065
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
35066
35066
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -35107,7 +35107,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
35107
35107
|
return corrections;
|
|
35108
35108
|
}, "correctWords");
|
|
35109
35109
|
|
|
35110
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
35111
35111
|
var SHORTEST_GARBLED = 4;
|
|
35112
35112
|
var MOST_WIDENED = 64;
|
|
35113
35113
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -35199,7 +35199,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
35199
35199
|
return found2.map((words4) => words4.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
|
|
35200
35200
|
}, "widenWords");
|
|
35201
35201
|
|
|
35202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
35203
35203
|
import { readFileSync } from "node:fs";
|
|
35204
35204
|
var loaded;
|
|
35205
35205
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -35258,14 +35258,14 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
35258
35258
|
return false;
|
|
35259
35259
|
}, "knownRussianWord");
|
|
35260
35260
|
|
|
35261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
35262
35262
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
35263
35263
|
var MOST_WORDS = 128;
|
|
35264
35264
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
35265
35265
|
var speakers = /* @__PURE__ */ __name((database, accountId) => {
|
|
35266
35266
|
const found2 = /* @__PURE__ */ new Map();
|
|
35267
|
-
const add2 = /* @__PURE__ */ __name((key2,
|
|
35268
|
-
const speaker = found2.get(key2) ?? { label, names: /* @__PURE__ */ new Set(), participants: /* @__PURE__ */ new Set(), raw: /* @__PURE__ */ new Set() };
|
|
35267
|
+
const add2 = /* @__PURE__ */ __name((key2, label2, names, participant, raw) => {
|
|
35268
|
+
const speaker = found2.get(key2) ?? { label: label2, names: /* @__PURE__ */ new Set(), participants: /* @__PURE__ */ new Set(), raw: /* @__PURE__ */ new Set() };
|
|
35269
35269
|
for (const name of names)
|
|
35270
35270
|
if (name?.trim())
|
|
35271
35271
|
speaker.names.add(fold(name.trim()));
|
|
@@ -35282,14 +35282,14 @@ var speakers = /* @__PURE__ */ __name((database, accountId) => {
|
|
|
35282
35282
|
const personNames = database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id=l.identity_id WHERE l.person_id=?");
|
|
35283
35283
|
for (const row2 of participants3) {
|
|
35284
35284
|
const names = [row2.display_name, row2.identity_name, row2.person_name].map((name) => name === null || name === void 0 ? null : String(name));
|
|
35285
|
-
const
|
|
35285
|
+
const label2 = names.find((name) => name?.trim()) ?? "unnamed";
|
|
35286
35286
|
if (row2.person_id !== null && row2.person_id !== void 0) {
|
|
35287
35287
|
const others = personNames.all(Number(row2.person_id)).map((one2) => one2.name === null ? null : String(one2.name));
|
|
35288
|
-
add2(`person:${row2.person_id}`, String(row2.person_name ??
|
|
35288
|
+
add2(`person:${row2.person_id}`, String(row2.person_name ?? label2), [...names, ...others], Number(row2.id));
|
|
35289
35289
|
} else if (row2.identity_id !== null && row2.identity_id !== void 0 && !String(row2.identity_key).startsWith("name:"))
|
|
35290
|
-
add2(`identity:${row2.identity_id}`, row2.email ? `${
|
|
35290
|
+
add2(`identity:${row2.identity_id}`, row2.email ? `${label2} <${row2.email}>` : label2, names, Number(row2.id));
|
|
35291
35291
|
else
|
|
35292
|
-
add2(`name:${fold(
|
|
35292
|
+
add2(`name:${fold(label2)}`, label2, names, Number(row2.id));
|
|
35293
35293
|
}
|
|
35294
35294
|
for (const [key2, speaker] of found2) {
|
|
35295
35295
|
if (!key2.startsWith("name:"))
|
|
@@ -35514,7 +35514,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer) => {
|
|
|
35514
35514
|
return [...found2];
|
|
35515
35515
|
}, "matchedMeetingWords");
|
|
35516
35516
|
|
|
35517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35517
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35518
35518
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35519
35519
|
throw new CliError("validation_error", message3);
|
|
35520
35520
|
}, "fail");
|
|
@@ -35698,7 +35698,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35698
35698
|
}
|
|
35699
35699
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
35700
35700
|
|
|
35701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
35702
35702
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35703
35703
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
35704
35704
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -35730,7 +35730,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35730
35730
|
}
|
|
35731
35731
|
}), "meetingLanguagesOver");
|
|
35732
35732
|
|
|
35733
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
35734
35734
|
import { createHash as createHash6 } from "node:crypto";
|
|
35735
35735
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
35736
35736
|
if (value === void 0)
|
|
@@ -35820,7 +35820,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
35820
35820
|
}
|
|
35821
35821
|
}), "meetingParticipantSearchOver");
|
|
35822
35822
|
|
|
35823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
35824
35824
|
var preparationQueries = {
|
|
35825
35825
|
participants: {
|
|
35826
35826
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -35870,7 +35870,7 @@ var preparationQueries = {
|
|
|
35870
35870
|
}
|
|
35871
35871
|
};
|
|
35872
35872
|
|
|
35873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35873
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
35874
35874
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35875
35875
|
async preparationContext(original) {
|
|
35876
35876
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -35911,7 +35911,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35911
35911
|
}
|
|
35912
35912
|
}), "meetingPreparationContextOver");
|
|
35913
35913
|
|
|
35914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
35915
35915
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
35916
35916
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
35917
35917
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -35925,7 +35925,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
35925
35925
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
35926
35926
|
)`, "preparationSubjects");
|
|
35927
35927
|
|
|
35928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35928
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
35929
35929
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35930
35930
|
async preparationKnowledge(original) {
|
|
35931
35931
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -35970,7 +35970,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
35970
35970
|
}
|
|
35971
35971
|
}), "meetingPreparationKnowledgeOver");
|
|
35972
35972
|
|
|
35973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35973
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
35974
35974
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35975
35975
|
async preparationNotes(original) {
|
|
35976
35976
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36023,7 +36023,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36023
36023
|
}
|
|
36024
36024
|
}), "meetingPreparationNotesOver");
|
|
36025
36025
|
|
|
36026
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
36027
36027
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36028
36028
|
async relatedHistory(original) {
|
|
36029
36029
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -36094,7 +36094,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36094
36094
|
}
|
|
36095
36095
|
}), "meetingRelatedHistoryOver");
|
|
36096
36096
|
|
|
36097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
36098
36098
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
36099
36099
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
36100
36100
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -36175,7 +36175,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36175
36175
|
}
|
|
36176
36176
|
}), "meetingReviewOver");
|
|
36177
36177
|
|
|
36178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
36179
36179
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
36180
36180
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
36181
36181
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -36229,7 +36229,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36229
36229
|
}
|
|
36230
36230
|
}), "meetingSeriesHistoryOver");
|
|
36231
36231
|
|
|
36232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
36233
36233
|
var MOST_ROWS = 5e5;
|
|
36234
36234
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
36235
36235
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -36298,7 +36298,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36298
36298
|
}
|
|
36299
36299
|
}), "meetingStatsOver");
|
|
36300
36300
|
|
|
36301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
36302
36302
|
var CURSOR_KEY = "meetings";
|
|
36303
36303
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
36304
36304
|
id: Number(row2.id),
|
|
@@ -36867,7 +36867,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36867
36867
|
};
|
|
36868
36868
|
}, "meetingStoreOver");
|
|
36869
36869
|
|
|
36870
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
36871
36871
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
36872
36872
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
36873
36873
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -36893,7 +36893,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
36893
36893
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
36894
36894
|
}, "release");
|
|
36895
36895
|
|
|
36896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
36897
36897
|
var THREAD_COLUMNS = {
|
|
36898
36898
|
subject: {
|
|
36899
36899
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -36910,7 +36910,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
36910
36910
|
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);
|
|
36911
36911
|
}, "threadRows");
|
|
36912
36912
|
|
|
36913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
36914
36914
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
36915
36915
|
id: `email:${place.emailId}`,
|
|
36916
36916
|
chatId: place.threadExternalId,
|
|
@@ -37452,7 +37452,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
37452
37452
|
}
|
|
37453
37453
|
}), "mailStoreOver");
|
|
37454
37454
|
|
|
37455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
37456
37456
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
37457
37457
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
37458
37458
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -37542,7 +37542,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
37542
37542
|
}, "knownWord");
|
|
37543
37543
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
37544
37544
|
|
|
37545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
37546
37546
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
37547
37547
|
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");
|
|
37548
37548
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -37628,7 +37628,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
37628
37628
|
return found2;
|
|
37629
37629
|
}, "spokenTranscripts");
|
|
37630
37630
|
|
|
37631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
37632
37632
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
37633
37633
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
37634
37634
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -37675,7 +37675,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
37675
37675
|
});
|
|
37676
37676
|
}, "placeHits");
|
|
37677
37677
|
|
|
37678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37678
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
37679
37679
|
var GROUPS = {
|
|
37680
37680
|
chat: {
|
|
37681
37681
|
key: "m.chat_id",
|
|
@@ -37697,7 +37697,7 @@ var GROUPS = {
|
|
|
37697
37697
|
}
|
|
37698
37698
|
};
|
|
37699
37699
|
|
|
37700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37700
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
37701
37701
|
var MESSAGES2 = {
|
|
37702
37702
|
rows: "messages",
|
|
37703
37703
|
threads: "chats",
|
|
@@ -38181,7 +38181,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
38181
38181
|
};
|
|
38182
38182
|
}, "runCompiled");
|
|
38183
38183
|
|
|
38184
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38184
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
38185
38185
|
function invalidMetadata() {
|
|
38186
38186
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
38187
38187
|
}
|
|
@@ -38283,7 +38283,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
38283
38283
|
};
|
|
38284
38284
|
}), "counterTargets");
|
|
38285
38285
|
|
|
38286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
38287
38287
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
38288
38288
|
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,
|
|
38289
38289
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -38402,7 +38402,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
38402
38402
|
}));
|
|
38403
38403
|
}, "attachmentViews");
|
|
38404
38404
|
|
|
38405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
38406
38406
|
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");
|
|
38407
38407
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
38408
38408
|
const { orm, database, now: now2 } = context;
|
|
@@ -38440,7 +38440,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
38440
38440
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
38441
38441
|
}, "intoVoiceAttachment");
|
|
38442
38442
|
|
|
38443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38443
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
38444
38444
|
var FIELDS = [
|
|
38445
38445
|
"threadExternalId",
|
|
38446
38446
|
"senderIdentityId",
|
|
@@ -38759,7 +38759,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
38759
38759
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
38760
38760
|
}, "writeDerivedReactions");
|
|
38761
38761
|
|
|
38762
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38762
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
38763
38763
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
38764
38764
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
38765
38765
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -38780,7 +38780,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
38780
38780
|
};
|
|
38781
38781
|
}, "keysOver");
|
|
38782
38782
|
|
|
38783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38783
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
38784
38784
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
38785
38785
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
38786
38786
|
if (!row2)
|
|
@@ -38827,7 +38827,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
38827
38827
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
38828
38828
|
}, "forgetProfile");
|
|
38829
38829
|
|
|
38830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
38831
38831
|
var TAKES = {
|
|
38832
38832
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
38833
38833
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -38841,8 +38841,8 @@ var wrongProvider = /* @__PURE__ */ __name((text8, provider, kind3) => {
|
|
|
38841
38841
|
const command = entry2?.command;
|
|
38842
38842
|
const opens = kind3 === "entity" ? void 0 : entry2?.opens?.[kind3];
|
|
38843
38843
|
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text8}` : "open it with its own CLI";
|
|
38844
|
-
const
|
|
38845
|
-
return new CliError("validation_error", `${text8} is ${article2(
|
|
38844
|
+
const label2 = providerLabel(provider);
|
|
38845
|
+
return new CliError("validation_error", `${text8} is ${article2(label2.toLowerCase())} ${label2} ${kind3}; ${how}`, {
|
|
38846
38846
|
reason: "ref.wrong-provider"
|
|
38847
38847
|
});
|
|
38848
38848
|
}, "wrongProvider");
|
|
@@ -38887,7 +38887,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn
|
|
|
38887
38887
|
throw wrongAccount(reference2, scope3, profiles);
|
|
38888
38888
|
}, "ensureAccount");
|
|
38889
38889
|
|
|
38890
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
38891
38891
|
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
38892
38892
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
38893
38893
|
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
@@ -38924,15 +38924,15 @@ var pickPerson = /* @__PURE__ */ __name((reference2, people2) => {
|
|
|
38924
38924
|
throw new CliError("not_found", `nobody matches "${reference2}"`);
|
|
38925
38925
|
throw ambiguous(reference2, "people", matches2.map(({ id: id2, name, username }) => ({ id: id2, name, username })), ({ name, username }) => singleLine([name, username && `@${username}`].filter(isPresent).join(" ")));
|
|
38926
38926
|
}, "pickPerson");
|
|
38927
|
-
var ambiguous = /* @__PURE__ */ __name((reference2, what, candidates,
|
|
38927
|
+
var ambiguous = /* @__PURE__ */ __name((reference2, what, candidates, label2) => {
|
|
38928
38928
|
const width = Math.max(...candidates.map(({ id: id2 }) => id2.length));
|
|
38929
|
-
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${
|
|
38929
|
+
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label2(candidate)}`).join("\n");
|
|
38930
38930
|
return new CliError("validation_error", `"${singleLine(reference2)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
38931
38931
|
${lines}`, { candidates });
|
|
38932
38932
|
}, "ambiguous");
|
|
38933
38933
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
38934
38934
|
|
|
38935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38935
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
38936
38936
|
var QUOTES = [
|
|
38937
38937
|
['"', '"'],
|
|
38938
38938
|
["'", "'"],
|
|
@@ -38976,7 +38976,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
|
|
|
38976
38976
|
}, "nameKey");
|
|
38977
38977
|
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
38978
38978
|
|
|
38979
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
|
|
38980
38980
|
var CYRILLIC_TO_LATIN = {
|
|
38981
38981
|
\u0430: "a",
|
|
38982
38982
|
\u0431: "b",
|
|
@@ -39093,7 +39093,7 @@ var spellings = /* @__PURE__ */ __name((text8) => {
|
|
|
39093
39093
|
return [.../* @__PURE__ */ new Set([folded6, LATIN.test(folded6) ? toCyrillic(folded6) : folded6])];
|
|
39094
39094
|
}, "spellings");
|
|
39095
39095
|
|
|
39096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39096
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
39097
39097
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
39098
39098
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
39099
39099
|
var WEIGHTS = {
|
|
@@ -39174,13 +39174,13 @@ var named2 = /* @__PURE__ */ __name((brand, text8) => new RegExp(`\\b${brand}\\b
|
|
|
39174
39174
|
var spoofedBrand = /* @__PURE__ */ __name((name, address) => {
|
|
39175
39175
|
if (name === void 0 || address === void 0)
|
|
39176
39176
|
return void 0;
|
|
39177
|
-
const
|
|
39178
|
-
if (NAMES_OTHERS.has(
|
|
39177
|
+
const label2 = registrableOf(address).split(".")[0] ?? "";
|
|
39178
|
+
if (NAMES_OTHERS.has(label2))
|
|
39179
39179
|
return void 0;
|
|
39180
39180
|
const relay = /\s+via\s+(.+)$/i.exec(name)?.[1];
|
|
39181
|
-
if (relay !== void 0 && Object.entries(BRANDS).some(([brand, owned]) => named2(brand, relay) && owned.includes(
|
|
39181
|
+
if (relay !== void 0 && Object.entries(BRANDS).some(([brand, owned]) => named2(brand, relay) && owned.includes(label2)))
|
|
39182
39182
|
return void 0;
|
|
39183
|
-
return Object.entries(BRANDS).find(([brand, owned]) => named2(brand, name) && !owned.includes(
|
|
39183
|
+
return Object.entries(BRANDS).find(([brand, owned]) => named2(brand, name) && !owned.includes(label2))?.[0];
|
|
39184
39184
|
}, "spoofedBrand");
|
|
39185
39185
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
39186
39186
|
var youngAt = /* @__PURE__ */ __name((age, at2) => {
|
|
@@ -39226,7 +39226,7 @@ var scoreGroup = /* @__PURE__ */ __name((items, context) => {
|
|
|
39226
39226
|
return { score: kept2.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept2 };
|
|
39227
39227
|
}, "scoreGroup");
|
|
39228
39228
|
|
|
39229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
|
|
39230
39230
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
39231
39231
|
const found2 = /* @__PURE__ */ new Map();
|
|
39232
39232
|
for (const row2 of database.prepare("SELECT p.id, p.name FROM persons p WHERE p.owner = 0 AND p.name IS NOT NULL AND EXISTS (SELECT 1 FROM identity_links l WHERE l.person_id = p.id) ORDER BY p.id").all()) {
|
|
@@ -39323,7 +39323,7 @@ function* sharedTraces(database, a, b, name) {
|
|
|
39323
39323
|
}
|
|
39324
39324
|
__name(sharedTraces, "sharedTraces");
|
|
39325
39325
|
|
|
39326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
39327
39327
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
39328
39328
|
var PERSON_BY = {
|
|
39329
39329
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -39346,7 +39346,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids2) => {
|
|
|
39346
39346
|
return [...found2].sort((a, b) => a - b);
|
|
39347
39347
|
}, "personsByIdentifiers");
|
|
39348
39348
|
|
|
39349
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
39350
39350
|
var BY = "rule";
|
|
39351
39351
|
var RULE2 = { bot: "rule", kind: "rule" };
|
|
39352
39352
|
var MOST_SHARING = 6;
|
|
@@ -39624,7 +39624,7 @@ var scanMatches = /* @__PURE__ */ __name((context, { full = false } = {}) => {
|
|
|
39624
39624
|
return pass.result;
|
|
39625
39625
|
}, "scanMatches");
|
|
39626
39626
|
|
|
39627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39627
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
39628
39628
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
39629
39629
|
var ownerNames = /* @__PURE__ */ __name(({ database }, owner) => database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ?").all(owner).map(({ name }) => new Set(nameSkeletons(displayName(typeof name === "string" ? name : null)))).filter((words4) => words4.size > 0), "ownerNames");
|
|
39630
39630
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -39683,7 +39683,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
39683
39683
|
return personOf2(context, ref3);
|
|
39684
39684
|
}, "linkToOwner");
|
|
39685
39685
|
|
|
39686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39686
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
39687
39687
|
var PROVIDERS_SETTING = "providers";
|
|
39688
39688
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
39689
39689
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -39731,7 +39731,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39731
39731
|
});
|
|
39732
39732
|
}, "registerProvider");
|
|
39733
39733
|
|
|
39734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
39735
39735
|
var DAY4 = 864e5;
|
|
39736
39736
|
var RECENTLY_CLOSED_MS = 14 * DAY4;
|
|
39737
39737
|
var TEXT_LIMIT = 20;
|
|
@@ -39929,7 +39929,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
39929
39929
|
};
|
|
39930
39930
|
}, "taskSimilarityOver");
|
|
39931
39931
|
|
|
39932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39932
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
39933
39933
|
var SETTING3 = "taskCategories";
|
|
39934
39934
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
39935
39935
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -39948,7 +39948,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
39948
39948
|
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);
|
|
39949
39949
|
}, "saveTaskCategories");
|
|
39950
39950
|
|
|
39951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
39952
39952
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
39953
39953
|
var ALLOWED = "taskAgentClose";
|
|
39954
39954
|
var MIN = "taskAgentCloseMin";
|
|
@@ -40004,7 +40004,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
40004
40004
|
];
|
|
40005
40005
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
40006
40006
|
|
|
40007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
40008
40008
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
40009
40009
|
var KEY = "taskFirstPassPerChat";
|
|
40010
40010
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -40024,7 +40024,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
40024
40024
|
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);
|
|
40025
40025
|
}, "saveFirstPassPerChat");
|
|
40026
40026
|
|
|
40027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
40028
40028
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
40029
40029
|
var EXTERNAL_ID_CHARS = 200;
|
|
40030
40030
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -40051,7 +40051,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
40051
40051
|
return text8;
|
|
40052
40052
|
}, "sourceUrlOf");
|
|
40053
40053
|
|
|
40054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40054
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
40055
40055
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
40056
40056
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
40057
40057
|
name,
|
|
@@ -40279,7 +40279,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
40279
40279
|
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 ?`;
|
|
40280
40280
|
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");
|
|
40281
40281
|
|
|
40282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
40283
40283
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
40284
40284
|
if (row2.author_type == null)
|
|
40285
40285
|
return null;
|
|
@@ -40307,7 +40307,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
40307
40307
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
40308
40308
|
}, "addComment");
|
|
40309
40309
|
|
|
40310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
40311
40311
|
var TASK_RELATION_KINDS = [
|
|
40312
40312
|
"blocked-by",
|
|
40313
40313
|
"follow-up-of",
|
|
@@ -40437,7 +40437,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
40437
40437
|
};
|
|
40438
40438
|
}, "taskRelationsStoreOver");
|
|
40439
40439
|
|
|
40440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40440
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
40441
40441
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
40442
40442
|
var iso8 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
40443
40443
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at2) => {
|
|
@@ -40720,9 +40720,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
40720
40720
|
const renumbered = [];
|
|
40721
40721
|
let given3 = score;
|
|
40722
40722
|
if (!roomy || above !== void 0 && below !== void 0 && above.score - below.score < 1e-9) {
|
|
40723
|
-
const
|
|
40724
|
-
const band = priorityBand(
|
|
40725
|
-
const inBand = /* @__PURE__ */ __name((one2) => priorityLabel(one2.score) ===
|
|
40723
|
+
const label2 = priorityLabel((above ?? below)?.score ?? 0);
|
|
40724
|
+
const band = priorityBand(label2);
|
|
40725
|
+
const inBand = /* @__PURE__ */ __name((one2) => priorityLabel(one2.score) === label2, "inBand");
|
|
40726
40726
|
const ordered = [...column2.slice(0, index2), { id: task, key: String(row2.key), score }, ...column2.slice(index2)];
|
|
40727
40727
|
const spread = ordered.filter((one2) => one2.id === task || inBand(one2));
|
|
40728
40728
|
const gap = (band.to - band.from) / (spread.length + 1);
|
|
@@ -40913,8 +40913,8 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
40913
40913
|
})).sort((a, b) => b.count - a.count || a.value.localeCompare(b.value));
|
|
40914
40914
|
const priorities = /* @__PURE__ */ new Map();
|
|
40915
40915
|
for (const row2 of grouped("priority", "t.priority_score", "", "t.priority_score")) {
|
|
40916
|
-
const
|
|
40917
|
-
priorities.set(
|
|
40916
|
+
const label2 = priorityLabel(row2.priority_score == null ? null : Number(row2.priority_score)) ?? "none";
|
|
40917
|
+
priorities.set(label2, (priorities.get(label2) ?? 0) + Number(row2.n));
|
|
40918
40918
|
}
|
|
40919
40919
|
const states = new Map(grouped("state", "t.status", "", "t.status").map((row2) => [row2.status, Number(row2.n)]));
|
|
40920
40920
|
const groups = dueGroups(at2, timezoneOf(zone));
|
|
@@ -40966,7 +40966,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
40966
40966
|
};
|
|
40967
40967
|
}, "workTasksOver");
|
|
40968
40968
|
|
|
40969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40969
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
40970
40970
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
40971
40971
|
const { database, now: now2 } = context;
|
|
40972
40972
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -41015,7 +41015,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
41015
41015
|
};
|
|
41016
41016
|
}, "taskCloseOver");
|
|
41017
41017
|
|
|
41018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41018
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
41019
41019
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
41020
41020
|
const { database, now: now2 } = context;
|
|
41021
41021
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -41233,7 +41233,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
41233
41233
|
};
|
|
41234
41234
|
}, "taskPairsOver");
|
|
41235
41235
|
|
|
41236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
41237
41237
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
41238
41238
|
var TASK_STATS_SQL = {
|
|
41239
41239
|
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"),
|
|
@@ -41272,7 +41272,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
41272
41272
|
}, "statNames")
|
|
41273
41273
|
}), "taskStatsOver");
|
|
41274
41274
|
|
|
41275
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41275
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
41276
41276
|
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";
|
|
41277
41277
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
41278
41278
|
const key2 = inboxKey(account);
|
|
@@ -41479,7 +41479,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
41479
41479
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
41480
41480
|
}, "oneOf");
|
|
41481
41481
|
|
|
41482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
41483
41483
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
41484
41484
|
const { database } = context;
|
|
41485
41485
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -41540,7 +41540,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
41540
41540
|
};
|
|
41541
41541
|
}, "accountsStoreOver");
|
|
41542
41542
|
|
|
41543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41543
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
41544
41544
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
41545
41545
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
41546
41546
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -41564,7 +41564,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
41564
41564
|
})), "keepDownloads");
|
|
41565
41565
|
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");
|
|
41566
41566
|
|
|
41567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41567
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
41568
41568
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
41569
41569
|
const { database } = context;
|
|
41570
41570
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -41621,7 +41621,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41621
41621
|
}, "keepAttachmentText")
|
|
41622
41622
|
}), "attachmentsStoreOver");
|
|
41623
41623
|
|
|
41624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
41625
41625
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
41626
41626
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
41627
41627
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -41806,7 +41806,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
41806
41806
|
return done;
|
|
41807
41807
|
}, "rekeyChats");
|
|
41808
41808
|
|
|
41809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41809
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
41810
41810
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
41811
41811
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
41812
41812
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -41864,7 +41864,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
41864
41864
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
41865
41865
|
}, "chatCoverage");
|
|
41866
41866
|
|
|
41867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
41868
41868
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41869
41869
|
const { database } = context;
|
|
41870
41870
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -42003,7 +42003,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42003
42003
|
};
|
|
42004
42004
|
}, "chatsStoreOver");
|
|
42005
42005
|
|
|
42006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
42007
42007
|
import { createHash as createHash7 } from "node:crypto";
|
|
42008
42008
|
var BATCH_CONTEXT = 50;
|
|
42009
42009
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -42141,7 +42141,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
42141
42141
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
42142
42142
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
42143
42143
|
|
|
42144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
42145
42145
|
import { setTimeout } from "node:timers/promises";
|
|
42146
42146
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
42147
42147
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -42453,7 +42453,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
42453
42453
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
42454
42454
|
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");
|
|
42455
42455
|
|
|
42456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42456
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
42457
42457
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
42458
42458
|
const { database } = context;
|
|
42459
42459
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42560,7 +42560,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42560
42560
|
};
|
|
42561
42561
|
}, "conversationsStoreOver");
|
|
42562
42562
|
|
|
42563
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42563
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
42564
42564
|
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";
|
|
42565
42565
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
42566
42566
|
const { database } = context;
|
|
@@ -42585,7 +42585,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42585
42585
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
42586
42586
|
}), "countersStoreOver");
|
|
42587
42587
|
|
|
42588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42588
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
42589
42589
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
42590
42590
|
var MENTION_QUERY = defineQuery({
|
|
42591
42591
|
entity: "mention",
|
|
@@ -42804,7 +42804,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
42804
42804
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
42805
42805
|
}, "listPlaces");
|
|
42806
42806
|
|
|
42807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42807
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
42808
42808
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
42809
42809
|
const { database } = context;
|
|
42810
42810
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42839,7 +42839,126 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42839
42839
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
42840
42840
|
}), "mentionsStoreOver");
|
|
42841
42841
|
|
|
42842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42842
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
42843
|
+
var FAR = Number.MAX_SAFE_INTEGER;
|
|
42844
|
+
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
42845
|
+
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
42846
|
+
const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
|
|
42847
|
+
const parts = [
|
|
42848
|
+
`(${scope3.accounts.map(() => "(ac.provider=? AND ac.external_id=?)").join(" OR ") || "0"})`,
|
|
42849
|
+
`${PEER_KIND} IN (${kinds2.map(() => "?").join(",")})`
|
|
42850
|
+
];
|
|
42851
|
+
for (const { account, chatId } of scope3.chats) {
|
|
42852
|
+
parts.push("ac.provider=? AND ac.external_id=? AND c.external_id=?");
|
|
42853
|
+
params.push(account.provider, account.account, chatId);
|
|
42854
|
+
}
|
|
42855
|
+
for (const kind3 of scope3.kinds) {
|
|
42856
|
+
parts.push(`${PEER_KIND}=?`);
|
|
42857
|
+
params.push(kind3);
|
|
42858
|
+
}
|
|
42859
|
+
if (scope3.muted !== void 0) {
|
|
42860
|
+
parts.push(scope3.muted ? MUTED_NOW : `NOT ${MUTED_NOW}`);
|
|
42861
|
+
params.push(now2);
|
|
42862
|
+
}
|
|
42863
|
+
if (scope3.chats.length === 0)
|
|
42864
|
+
parts.push("c.searchable=1");
|
|
42865
|
+
return { sql: parts.join(" AND "), params };
|
|
42866
|
+
}, "chatsIn");
|
|
42867
|
+
var replyDelaysQuery = /* @__PURE__ */ __name((scope3, who, now2) => {
|
|
42868
|
+
const since = scope3.since ?? -FAR;
|
|
42869
|
+
const until = scope3.until ?? FAR;
|
|
42870
|
+
const chats2 = chatsIn(scope3, ["private"], now2);
|
|
42871
|
+
return {
|
|
42872
|
+
sql: `WITH scoped AS MATERIALIZED (
|
|
42873
|
+
SELECT c.id AS chat_id, coalesce((
|
|
42874
|
+
SELECT p.sent_at FROM messages p WHERE p.chat_id=c.id AND p.sent_at<? AND p.deleted_at IS NULL
|
|
42875
|
+
AND coalesce(p.outgoing,0)<>(SELECT coalesce(l.outgoing,0) FROM messages l
|
|
42876
|
+
WHERE l.chat_id=c.id AND l.sent_at<? AND l.deleted_at IS NULL ORDER BY l.sent_at DESC LIMIT 1)
|
|
42877
|
+
ORDER BY p.sent_at DESC LIMIT 1), ?) AS since
|
|
42878
|
+
FROM chats c JOIN accounts ac ON ac.id=c.account_id WHERE ${chats2.sql}
|
|
42879
|
+
), sides AS (
|
|
42880
|
+
SELECT m.chat_id, m.id, m.sent_at, coalesce(m.outgoing,0) AS mine,
|
|
42881
|
+
lag(coalesce(m.outgoing,0)) OVER (PARTITION BY m.chat_id ORDER BY m.sent_at, m.id) AS before
|
|
42882
|
+
FROM scoped s JOIN messages m ON m.chat_id=s.chat_id AND m.sent_at>=s.since AND m.sent_at<=?
|
|
42883
|
+
WHERE m.deleted_at IS NULL
|
|
42884
|
+
), runs AS (
|
|
42885
|
+
SELECT sent_at, mine, lag(sent_at) OVER (PARTITION BY chat_id ORDER BY sent_at, id) AS asked_at
|
|
42886
|
+
FROM sides WHERE before IS NULL OR before<>mine
|
|
42887
|
+
)
|
|
42888
|
+
SELECT sent_at AS replied_at, sent_at-asked_at AS delay_ms FROM runs
|
|
42889
|
+
WHERE asked_at IS NOT NULL AND mine=? AND sent_at>=? AND sent_at<=?`,
|
|
42890
|
+
params: [since, since, -FAR, ...chats2.params, until, who === "me" ? 1 : 0, since, until]
|
|
42891
|
+
};
|
|
42892
|
+
}, "replyDelaysQuery");
|
|
42893
|
+
var replyDelays = /* @__PURE__ */ __name((context, scope3, who) => {
|
|
42894
|
+
const { sql: sql2, params } = replyDelaysQuery(scope3, who, context.now());
|
|
42895
|
+
return read(context.database, () => context.database.prepare(sql2).all(...params).map((row2) => ({ repliedAt: Number(row2.replied_at), delayMs: Number(row2.delay_ms) })));
|
|
42896
|
+
}, "replyDelays");
|
|
42897
|
+
var newestMessagesQuery = /* @__PURE__ */ __name((scope3, now2) => {
|
|
42898
|
+
const chats2 = chatsIn(scope3, ["private", "group"], now2);
|
|
42899
|
+
return {
|
|
42900
|
+
sql: `SELECT c.id AS chat_id, ${PEER_KIND} AS kind, m.sent_at, coalesce(m.outgoing,0) AS mine, m.text,
|
|
42901
|
+
(EXISTS (SELECT 1 FROM json_each(CASE WHEN json_valid(m.mentions) THEN m.mentions ELSE '[]' END) WHERE value=ac.external_id)
|
|
42902
|
+
OR coalesce(json_extract(CASE WHEN json_valid(m.reply_to) THEN m.reply_to ELSE '{}' END,'$.outgoing'),0)=1
|
|
42903
|
+
OR EXISTS (SELECT 1 FROM messages q WHERE q.chat_id=c.id AND q.external_id=m.reply_to_external_id AND q.outgoing=1)
|
|
42904
|
+
) AS addressed,
|
|
42905
|
+
(SELECT i.username FROM identities i WHERE i.provider=ac.provider AND i.external_id=ac.external_id) AS owner_username,
|
|
42906
|
+
(${MUTED_NOW} OR coalesce(c.archived,0)=1)
|
|
42907
|
+
AND coalesce(c.marked_unread,0)=0 AS quiet
|
|
42908
|
+
FROM chats c JOIN accounts ac ON ac.id=c.account_id
|
|
42909
|
+
JOIN messages m ON m.id=(SELECT n.id FROM messages n WHERE n.chat_id=c.id AND n.deleted_at IS NULL ORDER BY n.sent_at DESC LIMIT 1)
|
|
42910
|
+
WHERE ${chats2.sql} AND m.sent_at>=? AND m.sent_at<=?`,
|
|
42911
|
+
params: [now2, ...chats2.params, scope3.since ?? -FAR, scope3.until ?? FAR]
|
|
42912
|
+
};
|
|
42913
|
+
}, "newestMessagesQuery");
|
|
42914
|
+
var TAIL_SQL = "SELECT sent_at, coalesce(outgoing,0) AS mine FROM messages WHERE chat_id=? AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT ?";
|
|
42915
|
+
var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
42916
|
+
const { sql: sql2, params } = newestMessagesQuery(scope3, context.now());
|
|
42917
|
+
const { database } = context;
|
|
42918
|
+
return read(database, () => {
|
|
42919
|
+
const tail = database.prepare(TAIL_SQL);
|
|
42920
|
+
return database.prepare(sql2).all(...params).map((row2) => ({
|
|
42921
|
+
chatId: Number(row2.chat_id),
|
|
42922
|
+
kind: String(row2.kind),
|
|
42923
|
+
sentAt: Number(row2.sent_at),
|
|
42924
|
+
mine: Number(row2.mine) === 1,
|
|
42925
|
+
text: String(row2.text),
|
|
42926
|
+
addressed: Number(row2.addressed) === 1,
|
|
42927
|
+
ownerUsername: row2.owner_username === null ? null : String(row2.owner_username),
|
|
42928
|
+
quiet: Number(row2.quiet) === 1
|
|
42929
|
+
})).filter(waits).map(({ chatId, kind: kind3 }) => {
|
|
42930
|
+
const unanswered = [];
|
|
42931
|
+
for (const row2 of tail.all(chatId, cap)) {
|
|
42932
|
+
if (Number(row2.mine) === 1)
|
|
42933
|
+
break;
|
|
42934
|
+
unanswered.push(Number(row2.sent_at));
|
|
42935
|
+
}
|
|
42936
|
+
return { kind: kind3, unanswered };
|
|
42937
|
+
});
|
|
42938
|
+
});
|
|
42939
|
+
}, "waitingChats");
|
|
42940
|
+
|
|
42941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
|
|
42942
|
+
var SQL = `SELECT coalesce(nullif(trim(c.title), ''), (SELECT sender_name FROM messages WHERE chat_id = c.id AND outgoing = 0 AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT 1)) AS title, ${MUTED_NOW} AS muted, w.messages, w.sent, (SELECT max(sent_at) FROM messages WHERE chat_id = c.id AND deleted_at IS NULL AND sent_at < ?) AS last FROM chats c, (SELECT count(*) AS messages, coalesce(sum(outgoing = 1), 0) AS sent FROM messages WHERE chat_id = ? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?) w WHERE c.id = ?`;
|
|
42943
|
+
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
42944
|
+
const statement = database.prepare(SQL);
|
|
42945
|
+
const found2 = /* @__PURE__ */ new Map();
|
|
42946
|
+
for (const key2 of new Set(chatKeys)) {
|
|
42947
|
+
const row2 = statement.get(now2, until, key2, since, until, key2);
|
|
42948
|
+
if (!row2)
|
|
42949
|
+
continue;
|
|
42950
|
+
found2.set(key2, {
|
|
42951
|
+
title: typeof row2.title === "string" && row2.title.trim() !== "" ? row2.title : null,
|
|
42952
|
+
muted: Number(row2.muted) === 1,
|
|
42953
|
+
messages: Number(row2.messages),
|
|
42954
|
+
sent: Number(row2.sent),
|
|
42955
|
+
lastAt: row2.last == null ? null : toIso(Number(row2.last)) ?? null
|
|
42956
|
+
});
|
|
42957
|
+
}
|
|
42958
|
+
return found2;
|
|
42959
|
+
}, "chatActivityCounts");
|
|
42960
|
+
|
|
42961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
42843
42962
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
42844
42963
|
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");
|
|
42845
42964
|
const rows = messageId === void 0 ? read3.all(chatKey) : read3.all(chatKey, messageId);
|
|
@@ -42854,7 +42973,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
42854
42973
|
}));
|
|
42855
42974
|
}, "documentLinkMessages");
|
|
42856
42975
|
|
|
42857
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
42858
42977
|
var stemmerFor = stemmerCache();
|
|
42859
42978
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
42860
42979
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -42898,7 +43017,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
42898
43017
|
});
|
|
42899
43018
|
}, "laterSharingRare");
|
|
42900
43019
|
|
|
42901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
42902
43021
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
42903
43022
|
const { database } = context;
|
|
42904
43023
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -43027,13 +43146,19 @@ var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
|
43027
43146
|
}, "accountMessagesOver");
|
|
43028
43147
|
var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
43029
43148
|
...keyed,
|
|
43149
|
+
chatActivityCounts: /* @__PURE__ */ __name(async (chats2, window) => {
|
|
43150
|
+
const { chatKeyOf } = keysOver(context);
|
|
43151
|
+
const keys = chats2.map(({ account, chatId }) => chatKeyOf(account, chatId));
|
|
43152
|
+
const found2 = chatActivityCounts(context, keys.filter((key2) => key2 !== void 0), window);
|
|
43153
|
+
return keys.map((key2) => key2 === void 0 ? void 0 : found2.get(key2));
|
|
43154
|
+
}, "chatActivityCounts"),
|
|
43030
43155
|
search: /* @__PURE__ */ __name(async (query, { limit, account }) => find(context, { text: query, limit, ...account ? { account } : {} }), "search"),
|
|
43031
43156
|
find: /* @__PURE__ */ __name(async (filter) => find(context, filter), "find"),
|
|
43032
43157
|
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies"),
|
|
43033
43158
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
43034
43159
|
}), "messagesStoreOver");
|
|
43035
43160
|
|
|
43036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
|
|
43037
43162
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted"];
|
|
43038
43163
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
43039
43164
|
"noreply",
|
|
@@ -43096,7 +43221,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
43096
43221
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
43097
43222
|
}, "isCompanyName");
|
|
43098
43223
|
|
|
43099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
|
|
43100
43225
|
var SMALL_GROUP_MEMBERS = 10;
|
|
43101
43226
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
43102
43227
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
@@ -43151,7 +43276,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
43151
43276
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
43152
43277
|
}, "shownReasons");
|
|
43153
43278
|
|
|
43154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43279
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
|
|
43155
43280
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
43156
43281
|
var MIN_QUERY = 3;
|
|
43157
43282
|
var ftsPhrase = /* @__PURE__ */ __name((text8) => `"${text8.replaceAll('"', '""')}"`, "ftsPhrase");
|
|
@@ -43458,7 +43583,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
43458
43583
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
43459
43584
|
}, "similarPeople");
|
|
43460
43585
|
|
|
43461
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/test-data.js
|
|
43462
43587
|
var SEED_PEOPLE = [
|
|
43463
43588
|
{ name: "Owner", username: "owner" },
|
|
43464
43589
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -43475,7 +43600,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
43475
43600
|
];
|
|
43476
43601
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
43477
43602
|
|
|
43478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
|
|
43479
43604
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
43480
43605
|
var COLUMNS5 = "l.person_id AS person, p.owner, p.name AS person_name, i.id AS pk, i.provider, i.external_id, i.name, i.phone, i.email, l.method, l.author, l.created_at, EXISTS (SELECT 1 FROM accounts a WHERE a.provider = i.provider AND a.external_id = i.external_id) AS account FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN persons p ON p.id = l.person_id";
|
|
43481
43606
|
var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -43607,28 +43732,29 @@ var everyDoubt = /* @__PURE__ */ __name((database) => {
|
|
|
43607
43732
|
}
|
|
43608
43733
|
return found2.sort((a, b) => Number(b.owner) - Number(a.owner) || (ORDER2.get(a.reason) ?? 0) - (ORDER2.get(b.reason) ?? 0) || a.person - b.person);
|
|
43609
43734
|
}, "everyDoubt");
|
|
43610
|
-
var
|
|
43735
|
+
var movesOf = /* @__PURE__ */ __name((context, found2) => {
|
|
43611
43736
|
if (found2.reason === "test-data" || found2.reason === "mixed-names")
|
|
43612
43737
|
return [];
|
|
43613
43738
|
const doubted = new Set(found2.held.map(({ ref: ref3 }) => ref3));
|
|
43614
|
-
const
|
|
43739
|
+
const moves = [];
|
|
43615
43740
|
const unmerged = /* @__PURE__ */ new Set();
|
|
43616
43741
|
for (const merge of merges(context, String(found2.person))) {
|
|
43617
43742
|
const refs = merge.identities.map(({ provider, id: id2 }) => `${provider}:${id2}`);
|
|
43618
43743
|
if (refs.length === 0 || !refs.every((ref3) => doubted.has(ref3)))
|
|
43619
43744
|
continue;
|
|
43620
|
-
|
|
43745
|
+
moves.push({ op: "unmerge", merge: merge.id });
|
|
43621
43746
|
for (const ref3 of refs)
|
|
43622
43747
|
unmerged.add(ref3);
|
|
43623
43748
|
}
|
|
43624
43749
|
const rest = found2.held.filter(({ ref: ref3 }) => !unmerged.has(ref3));
|
|
43625
43750
|
for (const group of nameGroups(rest))
|
|
43626
|
-
|
|
43627
|
-
return
|
|
43628
|
-
}, "
|
|
43751
|
+
moves.push({ op: "unlink", identities: group.map(({ ref: ref3 }) => ref3) });
|
|
43752
|
+
return moves;
|
|
43753
|
+
}, "movesOf");
|
|
43754
|
+
var commandOf = /* @__PURE__ */ __name((move2) => move2.op === "unmerge" ? `people unmerge ${move2.merge}` : `people unlink ${move2.identities.map(shellWord).join(" ")}`, "commandOf");
|
|
43629
43755
|
var shellWord = /* @__PURE__ */ __name((ref3) => /^[\w@.:+/=-]+$/u.test(ref3) ? ref3 : `'${ref3.replaceAll("'", "'\\''")}'`, "shellWord");
|
|
43630
43756
|
var shown = /* @__PURE__ */ __name((context, found2) => {
|
|
43631
|
-
const
|
|
43757
|
+
const moves = movesOf(context, found2);
|
|
43632
43758
|
return {
|
|
43633
43759
|
person: `person:${found2.person}`,
|
|
43634
43760
|
name: found2.name,
|
|
@@ -43645,9 +43771,10 @@ var shown = /* @__PURE__ */ __name((context, found2) => {
|
|
|
43645
43771
|
evidence: [
|
|
43646
43772
|
...found2.held.map(({ ref: ref3 }) => ref3),
|
|
43647
43773
|
...found2.address === void 0 ? [] : [`email:${found2.address}`],
|
|
43648
|
-
...
|
|
43774
|
+
...moves.flatMap((move2) => move2.op === "unmerge" ? [move2.merge] : [])
|
|
43649
43775
|
],
|
|
43650
|
-
fix
|
|
43776
|
+
fix: moves.map(commandOf),
|
|
43777
|
+
moves
|
|
43651
43778
|
};
|
|
43652
43779
|
}, "shown");
|
|
43653
43780
|
var personDoubts = /* @__PURE__ */ __name((context, { limit, offset }) => {
|
|
@@ -43663,7 +43790,7 @@ var personDoubts = /* @__PURE__ */ __name((context, { limit, offset }) => {
|
|
|
43663
43790
|
};
|
|
43664
43791
|
}, "personDoubts");
|
|
43665
43792
|
|
|
43666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
43667
43794
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
43668
43795
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
43669
43796
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -43732,7 +43859,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
43732
43859
|
});
|
|
43733
43860
|
}, "personPreparation");
|
|
43734
43861
|
|
|
43735
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
43736
43863
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
43737
43864
|
const id2 = Number(uid);
|
|
43738
43865
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -43740,7 +43867,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
43740
43867
|
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)));
|
|
43741
43868
|
}, "personSeenInAccounts");
|
|
43742
43869
|
|
|
43743
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
43744
43871
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
43745
43872
|
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);
|
|
43746
43873
|
if (!row2)
|
|
@@ -43807,7 +43934,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
43807
43934
|
return { id: id2, personId, removed: true };
|
|
43808
43935
|
}, "removeNote");
|
|
43809
43936
|
|
|
43810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43937
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
43811
43938
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
43812
43939
|
const { database } = context;
|
|
43813
43940
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -43926,13 +44053,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
43926
44053
|
};
|
|
43927
44054
|
}, "peopleStoreOver");
|
|
43928
44055
|
|
|
43929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44056
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
43930
44057
|
import { createHash as createHash9 } from "node:crypto";
|
|
43931
44058
|
|
|
43932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
43933
44060
|
import { createHash as createHash8 } from "node:crypto";
|
|
43934
44061
|
|
|
43935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
43936
44063
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
43937
44064
|
var AUTHOR_MEASURES = [
|
|
43938
44065
|
"messages",
|
|
@@ -44072,7 +44199,7 @@ var withoutUrls = /* @__PURE__ */ __name((text8) => text8.replace(/\S+/gu, (toke
|
|
|
44072
44199
|
var rankingWords = /* @__PURE__ */ __name((text8) => withoutUrls(text8).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
44073
44200
|
var rankingQuestion = /* @__PURE__ */ __name((text8) => withoutUrls(text8).includes("?"), "rankingQuestion");
|
|
44074
44201
|
|
|
44075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
44076
44203
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
44077
44204
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
44078
44205
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -44294,7 +44421,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
44294
44421
|
};
|
|
44295
44422
|
}, "rankReplyGraph");
|
|
44296
44423
|
|
|
44297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
44298
44425
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
44299
44426
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
44300
44427
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -44468,7 +44595,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
44468
44595
|
return { items, evidence, summary, graph: graph.quality };
|
|
44469
44596
|
}, "calculateAdminStatistics");
|
|
44470
44597
|
|
|
44471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44598
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
44472
44599
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
44473
44600
|
const dates = [];
|
|
44474
44601
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -44490,7 +44617,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
44490
44617
|
return dates[0].node.resolution.date;
|
|
44491
44618
|
}, "rankingContextRange");
|
|
44492
44619
|
|
|
44493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
44494
44621
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
44495
44622
|
let counts;
|
|
44496
44623
|
try {
|
|
@@ -44785,7 +44912,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
44785
44912
|
});
|
|
44786
44913
|
}, "rankQuery");
|
|
44787
44914
|
|
|
44788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
44789
44916
|
function fail2(message3, reason = "query.too-large") {
|
|
44790
44917
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
44791
44918
|
}
|
|
@@ -44962,7 +45089,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
44962
45089
|
return result;
|
|
44963
45090
|
}), "adminStatisticsQuery");
|
|
44964
45091
|
|
|
44965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
44966
45093
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
44967
45094
|
if (!execution.accounts.length)
|
|
44968
45095
|
return { conversations: [], chats: [] };
|
|
@@ -44980,7 +45107,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
44980
45107
|
return { conversations: conversations2, chats: chats2 };
|
|
44981
45108
|
}, "conversationEligibility");
|
|
44982
45109
|
|
|
44983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
44984
45111
|
import { createHash as createHash10 } from "node:crypto";
|
|
44985
45112
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
44986
45113
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -45130,106 +45257,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
45130
45257
|
return result;
|
|
45131
45258
|
}, "rankingEvidence");
|
|
45132
45259
|
|
|
45133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45134
|
-
var FAR = Number.MAX_SAFE_INTEGER;
|
|
45135
|
-
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
45136
|
-
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
45137
|
-
const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
|
|
45138
|
-
const parts = [
|
|
45139
|
-
`(${scope3.accounts.map(() => "(ac.provider=? AND ac.external_id=?)").join(" OR ") || "0"})`,
|
|
45140
|
-
`${PEER_KIND} IN (${kinds2.map(() => "?").join(",")})`
|
|
45141
|
-
];
|
|
45142
|
-
for (const { account, chatId } of scope3.chats) {
|
|
45143
|
-
parts.push("ac.provider=? AND ac.external_id=? AND c.external_id=?");
|
|
45144
|
-
params.push(account.provider, account.account, chatId);
|
|
45145
|
-
}
|
|
45146
|
-
for (const kind3 of scope3.kinds) {
|
|
45147
|
-
parts.push(`${PEER_KIND}=?`);
|
|
45148
|
-
params.push(kind3);
|
|
45149
|
-
}
|
|
45150
|
-
if (scope3.muted !== void 0) {
|
|
45151
|
-
parts.push(scope3.muted ? MUTED_NOW : `NOT ${MUTED_NOW}`);
|
|
45152
|
-
params.push(now2);
|
|
45153
|
-
}
|
|
45154
|
-
if (scope3.chats.length === 0)
|
|
45155
|
-
parts.push("c.searchable=1");
|
|
45156
|
-
return { sql: parts.join(" AND "), params };
|
|
45157
|
-
}, "chatsIn");
|
|
45158
|
-
var replyDelaysQuery = /* @__PURE__ */ __name((scope3, who, now2) => {
|
|
45159
|
-
const since = scope3.since ?? -FAR;
|
|
45160
|
-
const until = scope3.until ?? FAR;
|
|
45161
|
-
const chats2 = chatsIn(scope3, ["private"], now2);
|
|
45162
|
-
return {
|
|
45163
|
-
sql: `WITH scoped AS MATERIALIZED (
|
|
45164
|
-
SELECT c.id AS chat_id, coalesce((
|
|
45165
|
-
SELECT p.sent_at FROM messages p WHERE p.chat_id=c.id AND p.sent_at<? AND p.deleted_at IS NULL
|
|
45166
|
-
AND coalesce(p.outgoing,0)<>(SELECT coalesce(l.outgoing,0) FROM messages l
|
|
45167
|
-
WHERE l.chat_id=c.id AND l.sent_at<? AND l.deleted_at IS NULL ORDER BY l.sent_at DESC LIMIT 1)
|
|
45168
|
-
ORDER BY p.sent_at DESC LIMIT 1), ?) AS since
|
|
45169
|
-
FROM chats c JOIN accounts ac ON ac.id=c.account_id WHERE ${chats2.sql}
|
|
45170
|
-
), sides AS (
|
|
45171
|
-
SELECT m.chat_id, m.id, m.sent_at, coalesce(m.outgoing,0) AS mine,
|
|
45172
|
-
lag(coalesce(m.outgoing,0)) OVER (PARTITION BY m.chat_id ORDER BY m.sent_at, m.id) AS before
|
|
45173
|
-
FROM scoped s JOIN messages m ON m.chat_id=s.chat_id AND m.sent_at>=s.since AND m.sent_at<=?
|
|
45174
|
-
WHERE m.deleted_at IS NULL
|
|
45175
|
-
), runs AS (
|
|
45176
|
-
SELECT sent_at, mine, lag(sent_at) OVER (PARTITION BY chat_id ORDER BY sent_at, id) AS asked_at
|
|
45177
|
-
FROM sides WHERE before IS NULL OR before<>mine
|
|
45178
|
-
)
|
|
45179
|
-
SELECT sent_at AS replied_at, sent_at-asked_at AS delay_ms FROM runs
|
|
45180
|
-
WHERE asked_at IS NOT NULL AND mine=? AND sent_at>=? AND sent_at<=?`,
|
|
45181
|
-
params: [since, since, -FAR, ...chats2.params, until, who === "me" ? 1 : 0, since, until]
|
|
45182
|
-
};
|
|
45183
|
-
}, "replyDelaysQuery");
|
|
45184
|
-
var replyDelays = /* @__PURE__ */ __name((context, scope3, who) => {
|
|
45185
|
-
const { sql: sql2, params } = replyDelaysQuery(scope3, who, context.now());
|
|
45186
|
-
return read(context.database, () => context.database.prepare(sql2).all(...params).map((row2) => ({ repliedAt: Number(row2.replied_at), delayMs: Number(row2.delay_ms) })));
|
|
45187
|
-
}, "replyDelays");
|
|
45188
|
-
var newestMessagesQuery = /* @__PURE__ */ __name((scope3, now2) => {
|
|
45189
|
-
const chats2 = chatsIn(scope3, ["private", "group"], now2);
|
|
45190
|
-
return {
|
|
45191
|
-
sql: `SELECT c.id AS chat_id, ${PEER_KIND} AS kind, m.sent_at, coalesce(m.outgoing,0) AS mine, m.text,
|
|
45192
|
-
(EXISTS (SELECT 1 FROM json_each(CASE WHEN json_valid(m.mentions) THEN m.mentions ELSE '[]' END) WHERE value=ac.external_id)
|
|
45193
|
-
OR coalesce(json_extract(CASE WHEN json_valid(m.reply_to) THEN m.reply_to ELSE '{}' END,'$.outgoing'),0)=1
|
|
45194
|
-
OR EXISTS (SELECT 1 FROM messages q WHERE q.chat_id=c.id AND q.external_id=m.reply_to_external_id AND q.outgoing=1)
|
|
45195
|
-
) AS addressed,
|
|
45196
|
-
(SELECT i.username FROM identities i WHERE i.provider=ac.provider AND i.external_id=ac.external_id) AS owner_username,
|
|
45197
|
-
(${MUTED_NOW} OR coalesce(c.archived,0)=1)
|
|
45198
|
-
AND coalesce(c.marked_unread,0)=0 AS quiet
|
|
45199
|
-
FROM chats c JOIN accounts ac ON ac.id=c.account_id
|
|
45200
|
-
JOIN messages m ON m.id=(SELECT n.id FROM messages n WHERE n.chat_id=c.id AND n.deleted_at IS NULL ORDER BY n.sent_at DESC LIMIT 1)
|
|
45201
|
-
WHERE ${chats2.sql} AND m.sent_at>=? AND m.sent_at<=?`,
|
|
45202
|
-
params: [now2, ...chats2.params, scope3.since ?? -FAR, scope3.until ?? FAR]
|
|
45203
|
-
};
|
|
45204
|
-
}, "newestMessagesQuery");
|
|
45205
|
-
var TAIL_SQL = "SELECT sent_at, coalesce(outgoing,0) AS mine FROM messages WHERE chat_id=? AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT ?";
|
|
45206
|
-
var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
45207
|
-
const { sql: sql2, params } = newestMessagesQuery(scope3, context.now());
|
|
45208
|
-
const { database } = context;
|
|
45209
|
-
return read(database, () => {
|
|
45210
|
-
const tail = database.prepare(TAIL_SQL);
|
|
45211
|
-
return database.prepare(sql2).all(...params).map((row2) => ({
|
|
45212
|
-
chatId: Number(row2.chat_id),
|
|
45213
|
-
kind: String(row2.kind),
|
|
45214
|
-
sentAt: Number(row2.sent_at),
|
|
45215
|
-
mine: Number(row2.mine) === 1,
|
|
45216
|
-
text: String(row2.text),
|
|
45217
|
-
addressed: Number(row2.addressed) === 1,
|
|
45218
|
-
ownerUsername: row2.owner_username === null ? null : String(row2.owner_username),
|
|
45219
|
-
quiet: Number(row2.quiet) === 1
|
|
45220
|
-
})).filter(waits).map(({ chatId, kind: kind3 }) => {
|
|
45221
|
-
const unanswered = [];
|
|
45222
|
-
for (const row2 of tail.all(chatId, cap)) {
|
|
45223
|
-
if (Number(row2.mine) === 1)
|
|
45224
|
-
break;
|
|
45225
|
-
unanswered.push(Number(row2.sent_at));
|
|
45226
|
-
}
|
|
45227
|
-
return { kind: kind3, unanswered };
|
|
45228
|
-
});
|
|
45229
|
-
});
|
|
45230
|
-
}, "waitingChats");
|
|
45231
|
-
|
|
45232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.633.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_6b55a08b64e6f66e5ab3a99b7d6b1e87/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
45260
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
45233
45261
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
45234
45262
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
45235
45263
|
if (execution.corpus === "mail")
|
|
@@ -45250,7 +45278,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
45250
45278
|
};
|
|
45251
45279
|
}, "queriesStoreOver");
|
|
45252
45280
|
|
|
45253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
45254
45282
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
45255
45283
|
const { database, now: now2 } = context;
|
|
45256
45284
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -45289,10 +45317,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
45289
45317
|
}));
|
|
45290
45318
|
}, "chatEventsOf");
|
|
45291
45319
|
|
|
45292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45320
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
45293
45321
|
import { createHash as createHash11 } from "node:crypto";
|
|
45294
45322
|
|
|
45295
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
45296
45324
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
45297
45325
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
45298
45326
|
timeZone: zone,
|
|
@@ -45312,7 +45340,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
45312
45340
|
return date3.toISOString().slice(0, 10);
|
|
45313
45341
|
}, "weekKey");
|
|
45314
45342
|
|
|
45315
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
45316
45344
|
var RETENTION_TOLERANCE = 864e5;
|
|
45317
45345
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
45318
45346
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -45366,7 +45394,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
45366
45394
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
45367
45395
|
}, "retentionCohorts");
|
|
45368
45396
|
|
|
45369
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
45370
45398
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
45371
45399
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
45372
45400
|
validateRetentionOptions(options);
|
|
@@ -45497,7 +45525,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
45497
45525
|
};
|
|
45498
45526
|
}, "retentionQuery");
|
|
45499
45527
|
|
|
45500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45528
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
45501
45529
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
45502
45530
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
45503
45531
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -45626,7 +45654,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
45626
45654
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
45627
45655
|
})), "trackedChats");
|
|
45628
45656
|
|
|
45629
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45657
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
45630
45658
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45631
45659
|
const { database } = context;
|
|
45632
45660
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -45682,7 +45710,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45682
45710
|
};
|
|
45683
45711
|
}, "rosterStoreOver");
|
|
45684
45712
|
|
|
45685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
45686
45714
|
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");
|
|
45687
45715
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
45688
45716
|
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 ?`);
|
|
@@ -45706,7 +45734,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
45706
45734
|
}
|
|
45707
45735
|
}, "backfillNormalized");
|
|
45708
45736
|
|
|
45709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45737
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
45710
45738
|
var INDEX2 = "message_words";
|
|
45711
45739
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
45712
45740
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -45833,7 +45861,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
45833
45861
|
});
|
|
45834
45862
|
}, "resetSearchIndex");
|
|
45835
45863
|
|
|
45836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
45837
45865
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
45838
45866
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
45839
45867
|
const before2 = stemsState(database);
|
|
@@ -45928,7 +45956,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
45928
45956
|
return resetStems(database, { now: now2 });
|
|
45929
45957
|
}, "followDefaultStemmers");
|
|
45930
45958
|
|
|
45931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
45932
45960
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
45933
45961
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
45934
45962
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -45950,7 +45978,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
45950
45978
|
});
|
|
45951
45979
|
}, "termCandidates");
|
|
45952
45980
|
|
|
45953
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45981
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
45954
45982
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45955
45983
|
const { database } = context;
|
|
45956
45984
|
const stemmerFor2 = stemmerCache();
|
|
@@ -45974,7 +46002,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45974
46002
|
};
|
|
45975
46003
|
}, "searchIndexStoreOver");
|
|
45976
46004
|
|
|
45977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
45978
46006
|
var HISTORY_KEPT = 1e3;
|
|
45979
46007
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
45980
46008
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -46043,7 +46071,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
46043
46071
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
46044
46072
|
}, "clearHistory");
|
|
46045
46073
|
|
|
46046
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
46047
46075
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46048
46076
|
const { database } = context;
|
|
46049
46077
|
return {
|
|
@@ -46067,7 +46095,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46067
46095
|
};
|
|
46068
46096
|
}, "searchesStoreOver");
|
|
46069
46097
|
|
|
46070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
46071
46099
|
import { createHash as createHash12 } from "node:crypto";
|
|
46072
46100
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
46073
46101
|
var sha256 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(value).digest("hex"), "sha256");
|
|
@@ -46279,7 +46307,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46279
46307
|
};
|
|
46280
46308
|
}, "addedSourcesOver");
|
|
46281
46309
|
|
|
46282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
46283
46311
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
46284
46312
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
46285
46313
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -46322,7 +46350,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
46322
46350
|
};
|
|
46323
46351
|
}, "agentActionsStoreOver");
|
|
46324
46352
|
|
|
46325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
46326
46354
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
46327
46355
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
46328
46356
|
if (typeof value !== "string")
|
|
@@ -46368,7 +46396,7 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
46368
46396
|
}
|
|
46369
46397
|
}, "suggestBaseStages");
|
|
46370
46398
|
|
|
46371
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46399
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
46372
46400
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
46373
46401
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cutoff) => {
|
|
46374
46402
|
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);
|
|
@@ -46385,7 +46413,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cuto
|
|
|
46385
46413
|
});
|
|
46386
46414
|
}, "stageAmountsOf");
|
|
46387
46415
|
|
|
46388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
46389
46417
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
46390
46418
|
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");
|
|
46391
46419
|
var MAX_STAGES = 30;
|
|
@@ -46475,7 +46503,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46475
46503
|
const inScope = /* @__PURE__ */ __name((scope3, row2) => scope3 === void 0 || (scope3 === "own" ? row2.account_id == null : row2.account_provider === scope3.provider && row2.account_external_id === scope3.account), "inScope");
|
|
46476
46504
|
const kindOf4 = /* @__PURE__ */ __name((kind3) => kind3 === void 0 ? "deal" : oneOf3(kind3, DEAL_KINDS, "a kind"), "kindOf");
|
|
46477
46505
|
const pipelineRows = /* @__PURE__ */ __name((kind3, scope3, { deleted = false } = {}) => database.prepare(`SELECT p.*, a.provider AS account_provider, a.external_id AS account_external_id FROM pipelines p LEFT JOIN accounts a ON a.id = p.account_id WHERE (? IS NULL OR p.kind = ?) ${deleted ? "" : "AND p.deleted_at IS NULL "}ORDER BY p.name_folded, p.id`).all(kind3 ?? null, kind3 ?? null).filter((row2) => inScope(scope3, row2)), "pipelineRows");
|
|
46478
|
-
const
|
|
46506
|
+
const label2 = /* @__PURE__ */ __name((row2) => `pipeline:${row2.id} (${row2.name}${row2.account_provider == null ? "" : `, ${row2.account_provider}:${row2.account_external_id}`})`, "label");
|
|
46479
46507
|
const pipelineRow = /* @__PURE__ */ __name((reference2, kind3, scope3) => {
|
|
46480
46508
|
const named3 = reference2.trim();
|
|
46481
46509
|
if (/^pipeline:\d+$/.test(named3)) {
|
|
@@ -46490,7 +46518,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46490
46518
|
reason: "pipeline.not-found"
|
|
46491
46519
|
});
|
|
46492
46520
|
if (rows.length > 1)
|
|
46493
|
-
return refuse(`more than one pipeline is named ${named3}: ${rows.map(
|
|
46521
|
+
return refuse(`more than one pipeline is named ${named3}: ${rows.map(label2).join(", ")}; name one by its reference`, "pipeline.ambiguous");
|
|
46494
46522
|
return rows[0];
|
|
46495
46523
|
}, "pipelineRow");
|
|
46496
46524
|
const stagesOf = /* @__PURE__ */ __name((pipelineIds) => database.prepare(`SELECT s.*, (SELECT count(*) FROM deals d WHERE d.stage_id = s.id AND d.status = 'open' AND d.deleted_at IS NULL) + (SELECT count(*) FROM leads l WHERE l.stage_id = s.id AND l.status = 'open' AND l.deleted_at IS NULL) AS open FROM pipeline_stages s WHERE s.pipeline_id IN (${pipelineIds.map(() => "?").join(", ") || "NULL"}) ORDER BY s.pipeline_id, s.position, s.id`).all(...pipelineIds), "stagesOf");
|
|
@@ -46750,7 +46778,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46750
46778
|
};
|
|
46751
46779
|
}, "dealsStoreOver");
|
|
46752
46780
|
|
|
46753
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
46754
46782
|
var KEY2 = "ownerLanguages";
|
|
46755
46783
|
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(" "));
|
|
46756
46784
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -46780,7 +46808,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
46780
46808
|
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);
|
|
46781
46809
|
}, "saveOwnerLanguages");
|
|
46782
46810
|
|
|
46783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
46784
46812
|
var OUTCOMES = {
|
|
46785
46813
|
lead: ["open", "open", "open", "won", "lost"],
|
|
46786
46814
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -47113,7 +47141,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47113
47141
|
};
|
|
47114
47142
|
}, "baseStagesStoreOver");
|
|
47115
47143
|
|
|
47116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
47117
47145
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
47118
47146
|
}) => {
|
|
47119
47147
|
const { database, now: now2 } = context;
|
|
@@ -47172,7 +47200,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
47172
47200
|
};
|
|
47173
47201
|
}, "botUpdateStoreOver");
|
|
47174
47202
|
|
|
47175
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47203
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
47176
47204
|
import { createHash as createHash13 } from "node:crypto";
|
|
47177
47205
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
47178
47206
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -47524,7 +47552,7 @@ var fieldReferences = /* @__PURE__ */ __name((record4, options = {}) => {
|
|
|
47524
47552
|
return found2;
|
|
47525
47553
|
}, "fieldReferences");
|
|
47526
47554
|
|
|
47527
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
47528
47556
|
var IMPORTER = { bot: "import" };
|
|
47529
47557
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
47530
47558
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -47569,7 +47597,48 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
47569
47597
|
};
|
|
47570
47598
|
}), "moneyLinesOf");
|
|
47571
47599
|
|
|
47572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
47601
|
+
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
47602
|
+
var ROLE_LABELS = {
|
|
47603
|
+
organization: {
|
|
47604
|
+
employee: label("Employee", "\u0421\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A", "Empleado"),
|
|
47605
|
+
contractor: label("Contractor", "\u041F\u043E\u0434\u0440\u044F\u0434\u0447\u0438\u043A", "Contratista"),
|
|
47606
|
+
founder: label("Founder", "\u041E\u0441\u043D\u043E\u0432\u0430\u0442\u0435\u043B\u044C", "Fundador"),
|
|
47607
|
+
owner: label("Owner", "\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446", "Propietario"),
|
|
47608
|
+
manager: label("Manager", "\u0420\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C", "Directivo"),
|
|
47609
|
+
adviser: label("Adviser", "\u0421\u043E\u0432\u0435\u0442\u043D\u0438\u043A", "Asesor"),
|
|
47610
|
+
contact: label("Contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442", "Contacto")
|
|
47611
|
+
},
|
|
47612
|
+
project: {
|
|
47613
|
+
owner: label("Owner", "\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446", "Propietario"),
|
|
47614
|
+
manager: label("Manager", "\u0420\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C", "Directivo"),
|
|
47615
|
+
contributor: label("Contributor", "\u0423\u0447\u0430\u0441\u0442\u043D\u0438\u043A", "Colaborador"),
|
|
47616
|
+
"client-contact": label("Client contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442 \u043A\u043B\u0438\u0435\u043D\u0442\u0430", "Contacto del cliente"),
|
|
47617
|
+
approver: label("Approver", "\u0421\u043E\u0433\u043B\u0430\u0441\u0443\u044E\u0449\u0438\u0439", "Aprobador")
|
|
47618
|
+
},
|
|
47619
|
+
deal: {
|
|
47620
|
+
owner: label("Responsible", "\u041E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439", "Responsable"),
|
|
47621
|
+
contact: label("Contact", "\u041A\u043E\u043D\u0442\u0430\u043A\u0442", "Contacto"),
|
|
47622
|
+
"decision-maker": label("Decision-maker", "\u041F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442 \u0440\u0435\u0448\u0435\u043D\u0438\u0435", "Responsable de decidir"),
|
|
47623
|
+
influencer: label("Influencer", "\u0412\u043B\u0438\u044F\u0435\u0442 \u043D\u0430 \u0440\u0435\u0448\u0435\u043D\u0438\u0435", "Influye en la decisi\xF3n")
|
|
47624
|
+
},
|
|
47625
|
+
contract: {
|
|
47626
|
+
customer: label("Customer", "\u0417\u0430\u043A\u0430\u0437\u0447\u0438\u043A", "Cliente"),
|
|
47627
|
+
supplier: label("Supplier", "\u041F\u043E\u0441\u0442\u0430\u0432\u0449\u0438\u043A", "Proveedor"),
|
|
47628
|
+
signatory: label("Signatory", "\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0442", "Firmante"),
|
|
47629
|
+
guarantor: label("Guarantor", "\u041F\u043E\u0440\u0443\u0447\u0438\u0442\u0435\u043B\u044C", "Garante")
|
|
47630
|
+
},
|
|
47631
|
+
related: {
|
|
47632
|
+
colleague: label("Colleague", "\u041A\u043E\u043B\u043B\u0435\u0433\u0430", "Colega"),
|
|
47633
|
+
adviser: label("Adviser", "\u0421\u043E\u0432\u0435\u0442\u043D\u0438\u043A", "Asesor"),
|
|
47634
|
+
investor: label("Investor", "\u0418\u043D\u0432\u0435\u0441\u0442\u043E\u0440", "Inversor"),
|
|
47635
|
+
mentor: label("Mentor", "\u041D\u0430\u0441\u0442\u0430\u0432\u043D\u0438\u043A", "Mentor"),
|
|
47636
|
+
family: label("Family", "\u0421\u0435\u043C\u044C\u044F", "Familia"),
|
|
47637
|
+
friend: label("Friend", "\u0414\u0440\u0443\u0433", "Amigo")
|
|
47638
|
+
}
|
|
47639
|
+
};
|
|
47640
|
+
|
|
47641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
47573
47642
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
47574
47643
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
47575
47644
|
var listOf = /* @__PURE__ */ __name((list2) => {
|
|
@@ -47591,27 +47660,37 @@ var extraRolesOf = /* @__PURE__ */ __name((database, kind3, from2, to) => {
|
|
|
47591
47660
|
return list2 ? ownerRolesOf(database, list2).map(({ id: id2 }) => id2) : [];
|
|
47592
47661
|
}, "extraRolesOf");
|
|
47593
47662
|
var checkStoredRole = /* @__PURE__ */ __name((database, kind3, from2, to, role) => checkRole(kind3, from2, to, role, extraRolesOf(database, kind3, from2, to)), "checkStoredRole");
|
|
47594
|
-
var RELATED_FROM = {
|
|
47663
|
+
var RELATED_FROM = {
|
|
47664
|
+
deal: "'deal', 'lead'",
|
|
47665
|
+
contract: "'contract'",
|
|
47666
|
+
related: "'person', 'organization'"
|
|
47667
|
+
};
|
|
47595
47668
|
var usedBy = /* @__PURE__ */ __name((database, list2, role) => {
|
|
47596
47669
|
const related = RELATED_FROM[list2];
|
|
47597
|
-
const
|
|
47598
|
-
const
|
|
47670
|
+
const parties = list2 === "related";
|
|
47671
|
+
const links2 = related ? `kind = 'related-to' AND from_type IN (${related})${parties ? ` AND to_type IN (${related})` : ""}` : `kind = 'member-of' AND from_type = 'person' AND to_type = '${list2}'`;
|
|
47672
|
+
const proposals = related ? `target_type IN (${related}) AND json_extract(payload, '$.kind') = 'related-to'` + (parties ? " AND (json_extract(payload, '$.to') LIKE 'person:%' OR json_extract(payload, '$.to') LIKE 'organization:%')" : "") : `target_type = 'person' AND json_extract(payload, '$.kind') = 'member-of' AND json_extract(payload, '$.to') LIKE '${list2}:%'`;
|
|
47599
47673
|
return Number(database.prepare(`SELECT (SELECT count(*) FROM links WHERE role = ? AND deleted_at IS NULL AND ${links2}) + (SELECT count(*) FROM proposed_actions WHERE status = 'proposed' AND ${proposals} AND ((kind = 'relationship' AND json_extract(payload, '$.role') = ?) OR (kind = 'relationship_update' AND json_extract(payload, '$.changes.role') = ?))) AS n`).get(role, role, role)?.n);
|
|
47600
47674
|
}, "usedBy");
|
|
47601
47675
|
var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
47602
47676
|
const all2 = /* @__PURE__ */ __name((list2) => [
|
|
47603
|
-
...ROLE_LISTS[list2].map((id2) => ({
|
|
47604
|
-
|
|
47677
|
+
...ROLE_LISTS[list2].map((id2) => ({
|
|
47678
|
+
id: id2,
|
|
47679
|
+
label: null,
|
|
47680
|
+
labels: ROLE_LABELS[list2][id2],
|
|
47681
|
+
builtIn: true
|
|
47682
|
+
})),
|
|
47683
|
+
...ownerRolesOf(database, list2).map((role) => ({ ...role, labels: null, builtIn: false }))
|
|
47605
47684
|
], "all");
|
|
47606
|
-
const save2 = /* @__PURE__ */ __name((list2, roles) => database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(settingOf(list2), JSON.stringify(roles.map(({ id: id2, label }) =>
|
|
47685
|
+
const save2 = /* @__PURE__ */ __name((list2, roles) => database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(settingOf(list2), JSON.stringify(roles.map(({ id: id2, label: label2 }) => label2 ? { id: id2, label: label2 } : { id: id2 })), now2()), "save");
|
|
47607
47686
|
return {
|
|
47608
47687
|
roles: /* @__PURE__ */ __name(async (list2) => all2(listOf(list2)), "roles"),
|
|
47609
|
-
addRole: /* @__PURE__ */ __name(async (name, id2,
|
|
47688
|
+
addRole: /* @__PURE__ */ __name(async (name, id2, label2) => write(database, () => {
|
|
47610
47689
|
const list2 = listOf(name);
|
|
47611
47690
|
const role = id2.trim();
|
|
47612
47691
|
if (!/^[a-z][a-z0-9-]{0,39}$/.test(role))
|
|
47613
47692
|
throw new CliError("validation_error", "a role id is 1\u201340 lowercase letters, digits and -, from a letter");
|
|
47614
|
-
const text8 =
|
|
47693
|
+
const text8 = label2?.trim() || null;
|
|
47615
47694
|
if (text8 !== null && text8.length > 80)
|
|
47616
47695
|
throw new CliError("validation_error", "a role's label takes 1\u201380 characters");
|
|
47617
47696
|
if (all2(list2).some((one2) => one2.id === role))
|
|
@@ -47643,7 +47722,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
47643
47722
|
};
|
|
47644
47723
|
}, "relationRolesOver");
|
|
47645
47724
|
|
|
47646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/crm.js
|
|
47647
47726
|
var isCrmUserId = /* @__PURE__ */ __name((id2) => /^\d{1,20}$/.test(id2), "isCrmUserId");
|
|
47648
47727
|
var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
|
|
47649
47728
|
const text8 = id2.trim();
|
|
@@ -47651,7 +47730,7 @@ var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
|
|
|
47651
47730
|
}, "normalCrmUserId");
|
|
47652
47731
|
var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
|
|
47653
47732
|
|
|
47654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
47655
47734
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
47656
47735
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
47657
47736
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -47754,7 +47833,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
47754
47833
|
return [{ setting: String(row2.key), value: settingValue(database, parsed4.key, parsed4.name) }];
|
|
47755
47834
|
}), "crmSettingsOf");
|
|
47756
47835
|
|
|
47757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
47758
47837
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
47759
47838
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
47760
47839
|
id: link3.id,
|
|
@@ -48114,7 +48193,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
48114
48193
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
48115
48194
|
}, "decidedOrigin");
|
|
48116
48195
|
|
|
48117
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
48118
48197
|
var keyOf4 = /* @__PURE__ */ __name((kind3, fromType, fromId, toType, toId, role) => `${String(kind3)}|${String(fromType)}:${String(fromId)}|${String(toType)}:${String(toId)}|${role == null ? "" : String(role)}`, "keyOf");
|
|
48119
48198
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
48120
48199
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -48252,7 +48331,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
48252
48331
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
48253
48332
|
}), "relationsStoreOver");
|
|
48254
48333
|
|
|
48255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
48256
48335
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
48257
48336
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
48258
48337
|
added: 0,
|
|
@@ -48442,7 +48521,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48442
48521
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
48443
48522
|
}, "recordRelationshipsOver");
|
|
48444
48523
|
|
|
48445
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48524
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
48446
48525
|
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";
|
|
48447
48526
|
var DAY_MS2 = 864e5;
|
|
48448
48527
|
var deadlineOf = /* @__PURE__ */ __name((expiration, days) => expiration === null || days === null ? null : new Date(Date.parse(`${expiration}T00:00:00Z`) - days * DAY_MS2).toISOString().slice(0, 10), "deadlineOf");
|
|
@@ -48598,7 +48677,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48598
48677
|
};
|
|
48599
48678
|
}, "contractsStoreOver");
|
|
48600
48679
|
|
|
48601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48680
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
48602
48681
|
var BUSINESS_FIND_MAX = 2001;
|
|
48603
48682
|
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");
|
|
48604
48683
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -48702,7 +48781,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
48702
48781
|
};
|
|
48703
48782
|
}, "businessSearchOver");
|
|
48704
48783
|
|
|
48705
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48784
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
48706
48785
|
var DAY5 = 864e5;
|
|
48707
48786
|
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}')`;
|
|
48708
48787
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -48812,7 +48891,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
48812
48891
|
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);
|
|
48813
48892
|
}, "listEvents");
|
|
48814
48893
|
|
|
48815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48894
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
48816
48895
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
48817
48896
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
48818
48897
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -48869,7 +48948,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
48869
48948
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
48870
48949
|
}, "forgetCalendarRows");
|
|
48871
48950
|
|
|
48872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
48873
48952
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
48874
48953
|
id: Number(row2.id),
|
|
48875
48954
|
accountId: Number(row2.account_id),
|
|
@@ -49472,7 +49551,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49472
49551
|
};
|
|
49473
49552
|
}, "eventStoreOver");
|
|
49474
49553
|
|
|
49475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
49476
49555
|
var CATALOG_QUERY = defineQuery({
|
|
49477
49556
|
entity: "document",
|
|
49478
49557
|
backend: "sql",
|
|
@@ -49714,7 +49793,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49714
49793
|
};
|
|
49715
49794
|
}, "catalogStoreOver");
|
|
49716
49795
|
|
|
49717
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
49718
49797
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
49719
49798
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
49720
49799
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -49727,7 +49806,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
49727
49806
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
49728
49807
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
49729
49808
|
|
|
49730
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49809
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
49731
49810
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
49732
49811
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
49733
49812
|
signal?.throwIfAborted();
|
|
@@ -49826,7 +49905,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
49826
49905
|
});
|
|
49827
49906
|
}, "readMeetingContextEvidence");
|
|
49828
49907
|
|
|
49829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
49830
49909
|
var corpora = {
|
|
49831
49910
|
message: {
|
|
49832
49911
|
table: "messages",
|
|
@@ -50065,7 +50144,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
50065
50144
|
}
|
|
50066
50145
|
}), "contextRecordsOver");
|
|
50067
50146
|
|
|
50068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
50069
50148
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
50070
50149
|
var SOURCE = "crm";
|
|
50071
50150
|
var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${idPart(key2.account)}/${type}/${idPart(externalId)}`, "crmIdentityId");
|
|
@@ -50194,7 +50273,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50194
50273
|
return { savePipeline, saveItemRow };
|
|
50195
50274
|
}, "crmRowsOver");
|
|
50196
50275
|
|
|
50197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
|
|
50198
50277
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
50199
50278
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
50200
50279
|
var DryRun = class extends Error {
|
|
@@ -50271,7 +50350,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50271
50350
|
}
|
|
50272
50351
|
}, "removeCrmContacts");
|
|
50273
50352
|
|
|
50274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
50275
50354
|
var PENDING = "crm:pending-relations";
|
|
50276
50355
|
var PENDING_DAYS = 30;
|
|
50277
50356
|
var PENDING_MOST = 5e3;
|
|
@@ -50764,16 +50843,16 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
50764
50843
|
};
|
|
50765
50844
|
}, "crmCopiesOver");
|
|
50766
50845
|
|
|
50767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
50768
50847
|
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
50769
50848
|
|
|
50770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50849
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
50771
50850
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
50772
50851
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
50773
50852
|
var TOKEN2 = /^[A-Za-z0-9_-]{21}[AQgw]$/;
|
|
50774
50853
|
var isDecisionToken = /* @__PURE__ */ __name((value) => typeof value === "string" && TOKEN2.test(value), "isDecisionToken");
|
|
50775
50854
|
|
|
50776
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
50777
50856
|
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
50778
50857
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
50779
50858
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -50872,7 +50951,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
50872
50951
|
};
|
|
50873
50952
|
}, "decisionRequestStoreOver");
|
|
50874
50953
|
|
|
50875
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
50876
50955
|
var NOTE_FIELDS = [
|
|
50877
50956
|
"text",
|
|
50878
50957
|
"exact",
|
|
@@ -51308,7 +51387,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
51308
51387
|
};
|
|
51309
51388
|
}, "noteSearchOver");
|
|
51310
51389
|
|
|
51311
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
51312
51391
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
51313
51392
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
51314
51393
|
var EVENT_CORPUS = {
|
|
@@ -51440,7 +51519,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
51440
51519
|
};
|
|
51441
51520
|
}, "eventSearchOver");
|
|
51442
51521
|
|
|
51443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
51444
51523
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
51445
51524
|
try {
|
|
51446
51525
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -51452,7 +51531,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
51452
51531
|
}
|
|
51453
51532
|
}, "calendarMoment");
|
|
51454
51533
|
|
|
51455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
51456
51535
|
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";
|
|
51457
51536
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
51458
51537
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -51672,7 +51751,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51672
51751
|
};
|
|
51673
51752
|
}, "factsStoreOver");
|
|
51674
51753
|
|
|
51675
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
51676
51755
|
var invalid4 = /* @__PURE__ */ __name((message3) => {
|
|
51677
51756
|
throw new CliError("validation_error", message3);
|
|
51678
51757
|
}, "invalid");
|
|
@@ -51777,7 +51856,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
51777
51856
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
|
|
51778
51857
|
}, "findingsCoreOver");
|
|
51779
51858
|
|
|
51780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51859
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
51781
51860
|
var stale = /* @__PURE__ */ __name(() => {
|
|
51782
51861
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
51783
51862
|
reason: "evidence-findings.stale"
|
|
@@ -51979,7 +52058,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51979
52058
|
};
|
|
51980
52059
|
}, "evidenceFindingsStoreOver");
|
|
51981
52060
|
|
|
51982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
51983
52062
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
51984
52063
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
51985
52064
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -52032,7 +52111,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
52032
52111
|
}, "forPerson")
|
|
52033
52112
|
}), "involvementStoreOver");
|
|
52034
52113
|
|
|
52035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
52036
52115
|
var LABELLED = {
|
|
52037
52116
|
note: "note",
|
|
52038
52117
|
document: "document",
|
|
@@ -52044,7 +52123,7 @@ var LABELLED = {
|
|
|
52044
52123
|
account: "folder"
|
|
52045
52124
|
};
|
|
52046
52125
|
|
|
52047
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
52048
52127
|
import { createHash as createHash15 } from "node:crypto";
|
|
52049
52128
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
52050
52129
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -52130,7 +52209,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
52130
52209
|
};
|
|
52131
52210
|
}, "meetingProjectsStoreOver");
|
|
52132
52211
|
|
|
52133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
52134
52213
|
var ORGANIZATIONS_QUERY = {
|
|
52135
52214
|
entity: "organization",
|
|
52136
52215
|
backend: "sql",
|
|
@@ -52171,7 +52250,7 @@ var REMINDERS_QUERY = {
|
|
|
52171
52250
|
})
|
|
52172
52251
|
};
|
|
52173
52252
|
|
|
52174
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52253
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
52175
52254
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
52176
52255
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
52177
52256
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -52192,7 +52271,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
52192
52271
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
52193
52272
|
}, "categorySql");
|
|
52194
52273
|
|
|
52195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
52196
52275
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
52197
52276
|
id: String(row2.id),
|
|
52198
52277
|
ref: `organization:${row2.id}`,
|
|
@@ -52237,7 +52316,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
52237
52316
|
}), "setOwnOrganization")
|
|
52238
52317
|
}), "organizationsStoreOver");
|
|
52239
52318
|
|
|
52240
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
52241
52320
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
52242
52321
|
var ACCOUNT_ENDS = [
|
|
52243
52322
|
["deal", "deals"],
|
|
@@ -52335,18 +52414,21 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
52335
52414
|
return { items, hasMore: rows.length > limit };
|
|
52336
52415
|
}, "listRelations")
|
|
52337
52416
|
};
|
|
52338
|
-
function
|
|
52417
|
+
function roleOf4(kind3, from2, to, role) {
|
|
52339
52418
|
const fromThing = thingOf(database, from2);
|
|
52340
52419
|
const toThing = thingOf(database, to);
|
|
52341
|
-
const
|
|
52342
|
-
|
|
52343
|
-
|
|
52344
|
-
return !extraRolesOf(database, kind3, fromThing.type, toThing.type).includes(role);
|
|
52420
|
+
const roleList = fromThing && toThing && roleListOf(kind3, fromThing.type, toThing.type) || null;
|
|
52421
|
+
const custom = role !== null && roleList !== null && !ROLE_LISTS[roleList].includes(role) && !ownerRolesOf(database, roleList).some(({ id: id2 }) => id2 === role);
|
|
52422
|
+
return { roleList, custom };
|
|
52345
52423
|
}
|
|
52346
|
-
__name(
|
|
52424
|
+
__name(roleOf4, "roleOf");
|
|
52347
52425
|
function linkItem(id2, at2) {
|
|
52348
52426
|
const relation = relationOf(linkOf(database, database.prepare("SELECT * FROM links WHERE id = ?").get(id2)), at2);
|
|
52349
|
-
return {
|
|
52427
|
+
return {
|
|
52428
|
+
...relation,
|
|
52429
|
+
source: "link",
|
|
52430
|
+
...roleOf4(relation.kind, relation.from, relation.to, relation.role)
|
|
52431
|
+
};
|
|
52350
52432
|
}
|
|
52351
52433
|
__name(linkItem, "linkItem");
|
|
52352
52434
|
function proposalItem(id2) {
|
|
@@ -52372,19 +52454,19 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
52372
52454
|
endsAt: iso17(payload.endsAt),
|
|
52373
52455
|
createdAt: action.createdAt,
|
|
52374
52456
|
source: "proposal",
|
|
52375
|
-
|
|
52457
|
+
...roleOf4(payload.kind, payload.from, payload.to, payload.role ?? null)
|
|
52376
52458
|
};
|
|
52377
52459
|
}
|
|
52378
52460
|
__name(proposalItem, "proposalItem");
|
|
52379
52461
|
}, "relationListOver");
|
|
52380
52462
|
|
|
52381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52463
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
52382
52464
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
52383
52465
|
...relationListOver(context),
|
|
52384
52466
|
...relationRolesOver(context)
|
|
52385
52467
|
}), "relationReadsOver");
|
|
52386
52468
|
|
|
52387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52469
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
52388
52470
|
var TABLES5 = { memory: "memories", fact: "facts" };
|
|
52389
52471
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
52390
52472
|
var DEFAULT_LIMIT = 500;
|
|
@@ -52627,16 +52709,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52627
52709
|
};
|
|
52628
52710
|
}, "sourceReviewStoreOver");
|
|
52629
52711
|
|
|
52630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
52631
52713
|
import { createHash as createHash18 } from "node:crypto";
|
|
52632
52714
|
|
|
52633
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
52634
52716
|
import { createHash as createHash17 } from "node:crypto";
|
|
52635
52717
|
|
|
52636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
52637
52719
|
import { createHash as createHash16 } from "node:crypto";
|
|
52638
52720
|
|
|
52639
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
52640
52722
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
52641
52723
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
52642
52724
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -52687,7 +52769,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
52687
52769
|
return input;
|
|
52688
52770
|
}, "consolidationApplyInput");
|
|
52689
52771
|
|
|
52690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
52691
52773
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
52692
52774
|
id: String(row2.id),
|
|
52693
52775
|
sourceId: String(row2.source_id),
|
|
@@ -52762,7 +52844,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
52762
52844
|
}, { beforeCommit: check3 });
|
|
52763
52845
|
}, "applyTagConsolidation");
|
|
52764
52846
|
|
|
52765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52847
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
52766
52848
|
var selections = [
|
|
52767
52849
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
52768
52850
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -52906,7 +52988,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
52906
52988
|
};
|
|
52907
52989
|
}, "previewRows");
|
|
52908
52990
|
|
|
52909
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
52910
52992
|
var kinds = ["project", "tag", "topic"];
|
|
52911
52993
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
52912
52994
|
if (signal?.aborted)
|
|
@@ -53170,7 +53252,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53170
53252
|
};
|
|
53171
53253
|
}, "vocabularyStoreOver");
|
|
53172
53254
|
|
|
53173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
53174
53256
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
53175
53257
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
53176
53258
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -53505,7 +53587,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53505
53587
|
const labels = path === null ? labelsOf(database, thing) : subfolderLabels(thing.id, path).map((name) => ({ tag: name, origin: "owner" }));
|
|
53506
53588
|
const target = base.type === "folder" ? { ...base, path } : base;
|
|
53507
53589
|
return [
|
|
53508
|
-
{ target, tags: labels.map((
|
|
53590
|
+
{ target, tags: labels.map((label2) => label2.tag), labels, targetState: stateOfThing(database, thing) }
|
|
53509
53591
|
];
|
|
53510
53592
|
}),
|
|
53511
53593
|
hasMore: rows.length > limit
|
|
@@ -53719,7 +53801,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
53719
53801
|
return key2.padEnd(3, "X");
|
|
53720
53802
|
}, "projectKey");
|
|
53721
53803
|
|
|
53722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53804
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
53723
53805
|
var DAY6 = 864e5;
|
|
53724
53806
|
var SETTING5 = "logs_pruned_at";
|
|
53725
53807
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY6, botUpdatePayloadsMs: 30 * DAY6 };
|
|
@@ -53746,7 +53828,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
53746
53828
|
};
|
|
53747
53829
|
}, "logPruner");
|
|
53748
53830
|
|
|
53749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
53750
53832
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
53751
53833
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
53752
53834
|
var invalid6 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -54122,7 +54204,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
54122
54204
|
}, "checkMailFindings");
|
|
54123
54205
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
54124
54206
|
|
|
54125
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
54126
54208
|
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";
|
|
54127
54209
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
54128
54210
|
const { database, now: now2 } = context;
|
|
@@ -54335,7 +54417,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54335
54417
|
};
|
|
54336
54418
|
}, "ordersStoreOver");
|
|
54337
54419
|
|
|
54338
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
54339
54421
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
54340
54422
|
throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
|
|
54341
54423
|
reason: "mail-findings.stale"
|
|
@@ -54792,7 +54874,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
54792
54874
|
};
|
|
54793
54875
|
}, "mailFindingsStoreOver");
|
|
54794
54876
|
|
|
54795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54877
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
54796
54878
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
54797
54879
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
54798
54880
|
reason: "meeting-findings.stale"
|
|
@@ -54960,7 +55042,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54960
55042
|
};
|
|
54961
55043
|
}, "meetingFindingsStoreOver");
|
|
54962
55044
|
|
|
54963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
54964
55046
|
var RANK_BATCH = 512;
|
|
54965
55047
|
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";
|
|
54966
55048
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -55231,7 +55313,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
55231
55313
|
}
|
|
55232
55314
|
}), "meetingVectorsOver");
|
|
55233
55315
|
|
|
55234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
55235
55317
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
55236
55318
|
var TEXTS = {
|
|
55237
55319
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -55332,7 +55414,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55332
55414
|
};
|
|
55333
55415
|
}, "sourceMentionStoreOver");
|
|
55334
55416
|
|
|
55335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55417
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
55336
55418
|
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";
|
|
55337
55419
|
var MAX_SPLITS = 100;
|
|
55338
55420
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -55563,11 +55645,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55563
55645
|
};
|
|
55564
55646
|
}, "transactionsStoreOver");
|
|
55565
55647
|
|
|
55566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
55567
55649
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
55568
55650
|
import { dirname as dirname2 } from "node:path";
|
|
55569
55651
|
|
|
55570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55652
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
55571
55653
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
55572
55654
|
var CLIENTS_SETTING = "clients";
|
|
55573
55655
|
var coreVersion = (() => {
|
|
@@ -55628,7 +55710,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
55628
55710
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
55629
55711
|
}, "refusalAdvice");
|
|
55630
55712
|
|
|
55631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
55632
55714
|
var GENERATED = [
|
|
55633
55715
|
{
|
|
55634
55716
|
"name": "20261010184427_initial",
|
|
@@ -56968,7 +57050,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
56968
57050
|
}
|
|
56969
57051
|
];
|
|
56970
57052
|
|
|
56971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
56972
57054
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
56973
57055
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
56974
57056
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -57201,7 +57283,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
57201
57283
|
return { ...result, foreignKeyViolations };
|
|
57202
57284
|
}, "rollBack");
|
|
57203
57285
|
|
|
57204
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
57205
57287
|
var V31_TABLES = [
|
|
57206
57288
|
"accounts",
|
|
57207
57289
|
"account_identities",
|
|
@@ -57364,7 +57446,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
57364
57446
|
return migrations;
|
|
57365
57447
|
}, "generatedMigrations");
|
|
57366
57448
|
|
|
57367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
57368
57450
|
var MIGRATIONS = generatedMigrations();
|
|
57369
57451
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
57370
57452
|
version INTEGER PRIMARY KEY,
|
|
@@ -57461,7 +57543,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
57461
57543
|
}
|
|
57462
57544
|
}, "migrate");
|
|
57463
57545
|
|
|
57464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57546
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
57465
57547
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
57466
57548
|
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 ?");
|
|
57467
57549
|
if (pending.get(0, 1) === void 0)
|
|
@@ -57483,7 +57565,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
57483
57565
|
}
|
|
57484
57566
|
}, "fillJoinKeys");
|
|
57485
57567
|
|
|
57486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57568
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
57487
57569
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
57488
57570
|
refuseOwnerStoreInTests(path);
|
|
57489
57571
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -57497,8 +57579,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
57497
57579
|
}, "openSqlite");
|
|
57498
57580
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
57499
57581
|
quietSqliteWarning();
|
|
57500
|
-
const { drizzle } = await import("./node-
|
|
57501
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
57582
|
+
const { drizzle } = await import("./node-K6MWX3SW.js");
|
|
57583
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-WV6GCPEC.js");
|
|
57502
57584
|
const client = await nodeClient(path, { readOnly });
|
|
57503
57585
|
try {
|
|
57504
57586
|
if (!readOnly)
|
|
@@ -57512,8 +57594,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
57512
57594
|
}
|
|
57513
57595
|
}, "openUnderNode");
|
|
57514
57596
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
57515
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
57516
|
-
const { drizzle } = await import("./bun-
|
|
57597
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-YENHHNPL.js");
|
|
57598
|
+
const { drizzle } = await import("./bun-TYBGE5BX.js");
|
|
57517
57599
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
57518
57600
|
try {
|
|
57519
57601
|
if (!readOnly)
|
|
@@ -57527,7 +57609,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
57527
57609
|
}
|
|
57528
57610
|
}, "openUnderBun");
|
|
57529
57611
|
|
|
57530
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57612
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
57531
57613
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
57532
57614
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
57533
57615
|
try {
|
|
@@ -57595,7 +57677,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
57595
57677
|
});
|
|
57596
57678
|
}, "movePaymentFacts");
|
|
57597
57679
|
|
|
57598
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57680
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
57599
57681
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
57600
57682
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
57601
57683
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -57613,7 +57695,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
57613
57695
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
57614
57696
|
}, "assertReadCompatible");
|
|
57615
57697
|
|
|
57616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
57617
57699
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
57618
57700
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
57619
57701
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -57659,7 +57741,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
57659
57741
|
});
|
|
57660
57742
|
}, "moveSuggestedLinks");
|
|
57661
57743
|
|
|
57662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
57663
57745
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
57664
57746
|
var TEST_PROVIDER = "chat";
|
|
57665
57747
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -57680,7 +57762,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
57680
57762
|
}
|
|
57681
57763
|
}, "purgeTestAccounts");
|
|
57682
57764
|
|
|
57683
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
57684
57766
|
var BACKFILL_ON_OPEN = 5e3;
|
|
57685
57767
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
57686
57768
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -57781,7 +57863,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
57781
57863
|
}
|
|
57782
57864
|
}, "openStoreContext");
|
|
57783
57865
|
|
|
57784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
57785
57867
|
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";
|
|
57786
57868
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
57787
57869
|
const { database, now: now2 } = context;
|
|
@@ -57887,10 +57969,10 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57887
57969
|
};
|
|
57888
57970
|
}, "productsStoreOver");
|
|
57889
57971
|
|
|
57890
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57972
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
57891
57973
|
import { createHash as createHash19 } from "node:crypto";
|
|
57892
57974
|
|
|
57893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
57894
57976
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
57895
57977
|
var ref = text6(2048);
|
|
57896
57978
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -57960,7 +58042,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
57960
58042
|
}))
|
|
57961
58043
|
});
|
|
57962
58044
|
|
|
57963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
57964
58046
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
57965
58047
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
57966
58048
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -58064,7 +58146,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
58064
58146
|
invalid9("external.unused");
|
|
58065
58147
|
}, "validateProjectAnnotationsGraph");
|
|
58066
58148
|
|
|
58067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
58068
58150
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
58069
58151
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
58070
58152
|
var targetSchema = strictObject({
|
|
@@ -58170,7 +58252,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
58170
58252
|
};
|
|
58171
58253
|
}, "planBoundProjectAnnotations");
|
|
58172
58254
|
|
|
58173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
58174
58256
|
import { createHash as createHash20 } from "node:crypto";
|
|
58175
58257
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
58176
58258
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -58264,7 +58346,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
58264
58346
|
})).digest("hex");
|
|
58265
58347
|
}, "projectAnnotationSnapshotFingerprint");
|
|
58266
58348
|
|
|
58267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
58268
58350
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
58269
58351
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
58270
58352
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -58281,7 +58363,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
58281
58363
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
58282
58364
|
}, "projectAnnotationRequest");
|
|
58283
58365
|
|
|
58284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
58285
58367
|
var SnapshotBudget = class {
|
|
58286
58368
|
static {
|
|
58287
58369
|
__name(this, "SnapshotBudget");
|
|
@@ -58307,13 +58389,13 @@ var SnapshotBudget = class {
|
|
|
58307
58389
|
}
|
|
58308
58390
|
};
|
|
58309
58391
|
|
|
58310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
58311
58393
|
import { createHash as createHash22 } from "node:crypto";
|
|
58312
58394
|
|
|
58313
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
58314
58396
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
58315
58397
|
|
|
58316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
58317
58399
|
import { createHash as createHash21 } from "node:crypto";
|
|
58318
58400
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
58319
58401
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -58456,7 +58538,7 @@ var ProjectSnapshotSources = class {
|
|
|
58456
58538
|
}
|
|
58457
58539
|
};
|
|
58458
58540
|
|
|
58459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58541
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
58460
58542
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
58461
58543
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
58462
58544
|
}, "unsupported");
|
|
@@ -58634,7 +58716,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
58634
58716
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
58635
58717
|
}), "projectAnnotationSnapshot");
|
|
58636
58718
|
|
|
58637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
58638
58720
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
58639
58721
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
58640
58722
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -58696,7 +58778,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
58696
58778
|
};
|
|
58697
58779
|
}), "previewAnnotationSnapshot");
|
|
58698
58780
|
|
|
58699
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
58700
58782
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
58701
58783
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
58702
58784
|
if (link3.kind === "evidence" && to)
|
|
@@ -58763,7 +58845,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
58763
58845
|
return mappings;
|
|
58764
58846
|
}, "restoreAnnotationRecords");
|
|
58765
58847
|
|
|
58766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
58767
58849
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
58768
58850
|
async preview(request) {
|
|
58769
58851
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -58793,7 +58875,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
58793
58875
|
}
|
|
58794
58876
|
}), "projectAnnotationStoreOver");
|
|
58795
58877
|
|
|
58796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58878
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
58797
58879
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
58798
58880
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
58799
58881
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -58864,7 +58946,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
58864
58946
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
58865
58947
|
}, "recordRelationsOver");
|
|
58866
58948
|
|
|
58867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
58868
58950
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
58869
58951
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
58870
58952
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -58918,7 +59000,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
58918
59000
|
return { pointedAt, remap };
|
|
58919
59001
|
}, "recordRemapOver");
|
|
58920
59002
|
|
|
58921
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
58922
59004
|
var runs = 0;
|
|
58923
59005
|
var PAGE = 500;
|
|
58924
59006
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -59131,7 +59213,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
59131
59213
|
return pointerOf("records", index2, "fields", key2);
|
|
59132
59214
|
}, "waitingPointer");
|
|
59133
59215
|
|
|
59134
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
59135
59217
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
59136
59218
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
59137
59219
|
var ORG_EMAIL = "org-email";
|
|
@@ -59297,7 +59379,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
59297
59379
|
]);
|
|
59298
59380
|
}, "renameMade");
|
|
59299
59381
|
|
|
59300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
59301
59383
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
59302
59384
|
name: given2(fields4, "name"),
|
|
59303
59385
|
unit: given2(fields4, "unit"),
|
|
@@ -59420,7 +59502,7 @@ var DIRECT_PROJECTORS = {
|
|
|
59420
59502
|
lead: dealProjector("lead")
|
|
59421
59503
|
};
|
|
59422
59504
|
|
|
59423
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59505
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
59424
59506
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
59425
59507
|
const importer = authorActor(context, IMPORTER).actor;
|
|
59426
59508
|
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;
|
|
@@ -59630,7 +59712,7 @@ var MONEY_PROJECTORS = {
|
|
|
59630
59712
|
}
|
|
59631
59713
|
};
|
|
59632
59714
|
|
|
59633
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
59634
59716
|
var CALLS_CALENDAR = "calls";
|
|
59635
59717
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
59636
59718
|
if (!isImportedProvider(source2.provider))
|
|
@@ -59805,7 +59887,7 @@ var PHONE_PROJECTORS = {
|
|
|
59805
59887
|
}
|
|
59806
59888
|
};
|
|
59807
59889
|
|
|
59808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
59809
59891
|
var RECORD_PROJECTORS = {
|
|
59810
59892
|
...MONEY_PROJECTORS,
|
|
59811
59893
|
...DIRECT_PROJECTORS,
|
|
@@ -59815,7 +59897,7 @@ var RECORD_PROJECTORS = {
|
|
|
59815
59897
|
project: null
|
|
59816
59898
|
};
|
|
59817
59899
|
|
|
59818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59900
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
59819
59901
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
59820
59902
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
59821
59903
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -59877,7 +59959,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
59877
59959
|
return { settle, checkShares };
|
|
59878
59960
|
}, "recordSettlingOver");
|
|
59879
59961
|
|
|
59880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
59881
59963
|
import { createHash as createHash23 } from "node:crypto";
|
|
59882
59964
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
59883
59965
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -59893,7 +59975,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
59893
59975
|
return { stamp, untouched };
|
|
59894
59976
|
}, "importStampsOver");
|
|
59895
59977
|
|
|
59896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59978
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
59897
59979
|
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";
|
|
59898
59980
|
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";
|
|
59899
59981
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -60124,7 +60206,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60124
60206
|
};
|
|
60125
60207
|
}, "subscriptionsStoreOver");
|
|
60126
60208
|
|
|
60127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
60128
60210
|
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";
|
|
60129
60211
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
60130
60212
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -60246,7 +60328,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60246
60328
|
};
|
|
60247
60329
|
}, "walletsStoreOver");
|
|
60248
60330
|
|
|
60249
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
60250
60332
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
60251
60333
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
60252
60334
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -60505,7 +60587,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
60505
60587
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
60506
60588
|
}, "recordWritesOver");
|
|
60507
60589
|
|
|
60508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60590
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
60509
60591
|
var LIMIT = 1e3;
|
|
60510
60592
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
60511
60593
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -60728,7 +60810,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60728
60810
|
};
|
|
60729
60811
|
}, "recordStoreOver");
|
|
60730
60812
|
|
|
60731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
60732
60814
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
60733
60815
|
key: row2.key,
|
|
60734
60816
|
channel: row2.channel,
|
|
@@ -60783,7 +60865,7 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
60783
60865
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
60784
60866
|
}, "storedTemplateBodies");
|
|
60785
60867
|
|
|
60786
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
60787
60869
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
60788
60870
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
60789
60871
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -60818,7 +60900,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
60818
60900
|
return proxy;
|
|
60819
60901
|
}, "storeErrors");
|
|
60820
60902
|
|
|
60821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
60822
60904
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
60823
60905
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
60824
60906
|
let merged2 = { from: from2, to };
|
|
@@ -60831,7 +60913,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
60831
60913
|
}, "markRange");
|
|
60832
60914
|
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");
|
|
60833
60915
|
|
|
60834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
60835
60917
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
60836
60918
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
60837
60919
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -60852,7 +60934,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
60852
60934
|
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);
|
|
60853
60935
|
}, "setTaskAnalysisMark");
|
|
60854
60936
|
|
|
60855
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60937
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
60856
60938
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
60857
60939
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
60858
60940
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -60862,7 +60944,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
60862
60944
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf6(account), JSON.stringify(until), now2);
|
|
60863
60945
|
}, "setTaskRulesStop");
|
|
60864
60946
|
|
|
60865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60947
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
60866
60948
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
60867
60949
|
const { database } = context;
|
|
60868
60950
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -60921,7 +61003,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60921
61003
|
};
|
|
60922
61004
|
}, "syncStoreOver");
|
|
60923
61005
|
|
|
60924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
60925
61007
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
60926
61008
|
const { database } = context;
|
|
60927
61009
|
return {
|
|
@@ -60943,7 +61025,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60943
61025
|
};
|
|
60944
61026
|
}, "tagsStoreOver");
|
|
60945
61027
|
|
|
60946
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
60947
61029
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
60948
61030
|
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
|
|
60949
61031
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -61070,7 +61152,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
61070
61152
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
61071
61153
|
}, "savePictureChunks");
|
|
61072
61154
|
|
|
61073
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61155
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
61074
61156
|
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,
|
|
61075
61157
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
61076
61158
|
FROM messages m
|
|
@@ -61159,7 +61241,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
61159
61241
|
return plain2(best(found2));
|
|
61160
61242
|
}, "nearestMessages");
|
|
61161
61243
|
|
|
61162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
61163
61245
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
61164
61246
|
const { database } = context;
|
|
61165
61247
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -61418,7 +61500,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
61418
61500
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
61419
61501
|
}), "vectorsStoreOver");
|
|
61420
61502
|
|
|
61421
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
61422
61504
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
61423
61505
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
61424
61506
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -61506,10 +61588,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
61506
61588
|
}
|
|
61507
61589
|
}, "lastBackup");
|
|
61508
61590
|
|
|
61509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
61510
61592
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
61511
61593
|
|
|
61512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
61513
61595
|
var COUNTED_TABLES = [
|
|
61514
61596
|
"accounts",
|
|
61515
61597
|
"chats",
|
|
@@ -61594,7 +61676,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
61594
61676
|
};
|
|
61595
61677
|
}, "storeContents");
|
|
61596
61678
|
|
|
61597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.634.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_c47469194f2825719a552db4a380e89c/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
61598
61680
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
61599
61681
|
const context = await openStoreContext(options);
|
|
61600
61682
|
try {
|