@wirecat/cli-memo 0.131.80 → 0.131.81
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-RVKEGURX.js → all-profiles-AG3WU2VX.js} +5 -5
- package/dist/bundle/{anthropic-FC6XUSWM.js → anthropic-5OJ6VVBT.js} +2 -2
- package/dist/bundle/{app-server-IRNKU3IF.js → app-server-CYMFIH4U.js} +36 -36
- package/dist/bundle/auto-PI3CSWZS.js +91 -0
- package/dist/bundle/{bun-TYBGE5BX.js → bun-YI3OK27Z.js} +2 -2
- package/dist/bundle/{bun-sqlite-YENHHNPL.js → bun-sqlite-YXHIEV5I.js} +3 -3
- package/dist/bundle/{chunk-HHZMDFE2.js → chunk-26HACUK7.js} +45 -45
- package/dist/bundle/{chunk-IJUXHUNZ.js → chunk-2DLWUJW2.js} +2 -2
- package/dist/bundle/{chunk-FIJTCBPQ.js → chunk-3UQC4O3L.js} +8 -8
- package/dist/bundle/{chunk-GNII3UL7.js → chunk-5MGGZJAL.js} +1 -1
- package/dist/bundle/{chunk-JDQSL2EY.js → chunk-6GFML7RP.js} +2 -2
- package/dist/bundle/{chunk-SULQCO3Y.js → chunk-6KPJKZNM.js} +5 -5
- package/dist/bundle/{chunk-NUKMYB65.js → chunk-7CU4TLEU.js} +4 -4
- package/dist/bundle/{chunk-MDIXXKVU.js → chunk-7END7RSM.js} +9 -9
- package/dist/bundle/{chunk-X3NHAO6T.js → chunk-7TGAZTZ7.js} +1 -1
- package/dist/bundle/{chunk-OH4AIBZF.js → chunk-ACUFYEMU.js} +1 -1
- package/dist/bundle/{chunk-OFRIG3CX.js → chunk-B44MN5AV.js} +3 -3
- package/dist/bundle/{chunk-JJ6ODCVQ.js → chunk-BM7X632R.js} +2 -2
- package/dist/bundle/{chunk-FR646D4S.js → chunk-BXFFFWJC.js} +1 -1
- package/dist/bundle/{chunk-RWVB7SLQ.js → chunk-C4PKTIIC.js} +20 -20
- package/dist/bundle/{chunk-NH7KIGIS.js → chunk-CYNITS32.js} +2 -2
- package/dist/bundle/{chunk-C2FE62E5.js → chunk-D6QYOZQ7.js} +29 -29
- package/dist/bundle/{chunk-BS5JBNGX.js → chunk-DWWQE6QB.js} +951 -725
- package/dist/bundle/{chunk-ZMSEKQQQ.js → chunk-EHBC5J5T.js} +1 -1
- package/dist/bundle/{chunk-MLYPJ4EC.js → chunk-ENNO7YI4.js} +6 -6
- package/dist/bundle/{chunk-Q46O7KXY.js → chunk-F5G2ECJT.js} +5 -5
- package/dist/bundle/{chunk-2CJIZZSI.js → chunk-FSWVWWK6.js} +12 -12
- package/dist/bundle/{chunk-EOXWI2EX.js → chunk-GAGGDEEV.js} +4 -4
- package/dist/bundle/{chunk-CUWTYE5A.js → chunk-GTOC7CVD.js} +2 -2
- package/dist/bundle/{chunk-OSE7GXAR.js → chunk-HMLUAJ5X.js} +1 -1
- package/dist/bundle/{chunk-VTBIVTS5.js → chunk-IMGEDPEG.js} +3 -3
- package/dist/bundle/{chunk-2FICCBKH.js → chunk-IMOHS6Z4.js} +1 -1
- package/dist/bundle/{chunk-3H56E3VI.js → chunk-ISODMBTI.js} +4 -4
- package/dist/bundle/{chunk-JPC7GSJO.js → chunk-J53G4IDW.js} +14 -9
- package/dist/bundle/{chunk-PX55CRD3.js → chunk-JURO45D4.js} +77 -77
- package/dist/bundle/{chunk-IW6O2SAG.js → chunk-KAJJEVBN.js} +10 -10
- package/dist/bundle/{chunk-UTYGPWUY.js → chunk-L4JRQ3EF.js} +3 -3
- package/dist/bundle/{chunk-666J5H2Z.js → chunk-LEVVMGYP.js} +1 -1
- package/dist/bundle/{chunk-R4XCBPD2.js → chunk-LQRUSNYT.js} +1 -1
- package/dist/bundle/{chunk-SKX3BNTE.js → chunk-M27DVXQY.js} +7 -7
- package/dist/bundle/{chunk-VQJDYQ55.js → chunk-OW7QEJQC.js} +32 -32
- package/dist/bundle/{chunk-TJ2B36VK.js → chunk-OXUVXJQZ.js} +7 -7
- package/dist/bundle/{chunk-KNRYIHUJ.js → chunk-QACKJE66.js} +281 -281
- package/dist/bundle/{chunk-6W6CLZKX.js → chunk-QKDLZFET.js} +12 -12
- package/dist/bundle/{chunk-RUM4GGHP.js → chunk-RRAO2HEO.js} +4 -4
- package/dist/bundle/{chunk-XZJUAG7B.js → chunk-SFZATVW3.js} +3 -3
- package/dist/bundle/{chunk-K3JEAMTT.js → chunk-SUN4Z4O5.js} +1 -1
- package/dist/bundle/{chunk-CVQJ7L4C.js → chunk-SZXP5BLK.js} +4 -4
- package/dist/bundle/{chunk-S2KXO7MO.js → chunk-TGKW746D.js} +1 -1
- package/dist/bundle/{chunk-GHYJW4ZH.js → chunk-TM7HPDDC.js} +2 -2
- package/dist/bundle/{chunk-F62N6QMI.js → chunk-U5KHIIEZ.js} +1 -1
- package/dist/bundle/{chunk-HXPU3ABX.js → chunk-UIPF5ZPZ.js} +326 -301
- package/dist/bundle/{chunk-W26VONC6.js → chunk-UXAVR5L4.js} +5 -5
- package/dist/bundle/{chunk-SGV2Z4BO.js → chunk-VR5JZXFD.js} +148 -148
- package/dist/bundle/{chunk-C4TAEYDQ.js → chunk-W2NETMA4.js} +5 -5
- package/dist/bundle/{chunk-UBUCTVHB.js → chunk-W6JVRWUC.js} +1 -1
- package/dist/bundle/{chunk-HFQXEMRG.js → chunk-WVTH7Q23.js} +1 -1
- package/dist/bundle/{chunk-KDLOSANT.js → chunk-Y22BK4VX.js} +5 -5
- package/dist/bundle/{chunk-HKXACNLD.js → chunk-YMM7JV6G.js} +2 -2
- package/dist/bundle/{chunk-4IKO3JAA.js → chunk-YVY6VV6C.js} +4 -4
- package/dist/bundle/{chunk-DS5SA5QP.js → chunk-YZLQY6MO.js} +5 -5
- package/dist/bundle/{chunk-JTQAMVZH.js → chunk-ZA3QA66B.js} +13 -13
- package/dist/bundle/{chunk-KVQY7R66.js → chunk-ZQRDE63F.js} +2 -2
- package/dist/bundle/{chunk-CEGA7A35.js → chunk-ZSDIUMUQ.js} +2 -2
- package/dist/bundle/{chunk-ZMLDVE22.js → chunk-ZYBFT7EU.js} +6 -6
- package/dist/bundle/{command-contract-SR6ONYV4.js → command-contract-G4GWD3V6.js} +11 -11
- package/dist/bundle/{command-server-entry-2WXZVYIX.js → command-server-entry-CNTXCJJ4.js} +17 -17
- package/dist/bundle/{decode-U7VFYQAA.js → decode-LV4O5H3M.js} +2 -2
- package/dist/bundle/{echarts-2PXBBLLJ.js → echarts-7FYCTGV2.js} +2 -2
- package/dist/bundle/{embed-DPA5QOIR.js → embed-BJ6VBMFC.js} +3 -3
- package/dist/bundle/{embedder-IGI2UTFK.js → embedder-EMU2SEDZ.js} +6 -6
- package/dist/bundle/{entry-IFOQTBXC.js → entry-IXBQ4UNV.js} +5 -5
- package/dist/bundle/{entry-7PAYGIQO.js → entry-SWFZ52CW.js} +5 -5
- package/dist/bundle/failure-KXBXKFBC.js +71 -0
- package/dist/bundle/{first-run-WHDDKA4V.js → first-run-74EADT2V.js} +5 -5
- package/dist/bundle/{first-screen-P5C57USR.js → first-screen-IW4EUPTH.js} +12 -12
- package/dist/bundle/{instructions-W7F7OQZS.js → instructions-HTJ3I5F5.js} +1 -1
- package/dist/bundle/{mcp-3LAFWOGW.js → mcp-RO7CEZ4P.js} +35 -35
- package/dist/bundle/memo.js +3 -3
- package/dist/bundle/{node-K6MWX3SW.js → node-GTF4PZZJ.js} +2 -2
- package/dist/bundle/{node-sqlite-WV6GCPEC.js → node-sqlite-TCF6PKCK.js} +4 -4
- package/dist/bundle/{oauth-EH2Y54DG.js → oauth-MQWM7KWY.js} +4 -4
- package/dist/bundle/{open-PB4W3UAM.js → open-NDV2TOBL.js} +2 -2
- package/dist/bundle/{openai-76OKHXWR.js → openai-BQAQJD34.js} +7 -7
- package/dist/bundle/{process-FMQ7Q7AI.js → process-YWF25XAX.js} +1 -1
- package/dist/bundle/{program-BR2QHF36.js → program-L4PM3UNK.js} +133 -68
- package/dist/bundle/{prompt-AW4T6CC2.js → prompt-ME3B7BVG.js} +2 -2
- package/dist/bundle/{recognize-X5DMT3HH.js → recognize-NJTH7EAF.js} +1 -1
- package/dist/bundle/{remote-HVKKXNYZ.js → remote-2SQT2DEL.js} +4 -4
- package/dist/bundle/{rerank-IXMWD7JV.js → rerank-OYYNHRTD.js} +4 -4
- package/dist/bundle/{serve-42XTYB26.js → serve-KMZU3JKX.js} +6 -6
- package/dist/bundle/server-K3HNYEDO.js +64 -0
- package/dist/bundle/{server-NNE7MUYT.js → server-OPVBIS67.js} +54 -53
- package/dist/bundle/server-QP3EDFBW.js +50 -0
- package/dist/bundle/{state-EOU37GAH.js → state-Y6JT6KT3.js} +3 -3
- package/dist/bundle/{store-F3REYMA6.js → store-X53QOU4W.js} +9 -9
- package/dist/bundle/store-maintenance-command-ELTUGXWJ.js +49 -0
- package/dist/bundle/update-4NPCGZ2P.js +74 -0
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +5 -0
- package/dist/examples.js.map +1 -1
- package/dist/mcp/catalogue.d.ts +3 -0
- package/dist/mcp/catalogue.d.ts.map +1 -1
- package/dist/mcp/catalogue.js +1 -0
- package/dist/mcp/catalogue.js.map +1 -1
- package/dist/people/proposal-rows.d.ts +6 -1
- package/dist/people/proposal-rows.d.ts.map +1 -1
- package/dist/people/proposal-rows.js +14 -5
- package/dist/people/proposal-rows.js.map +1 -1
- package/dist/people/proposals-command.d.ts.map +1 -1
- package/dist/people/proposals-command.js +45 -1
- package/dist/people/proposals-command.js.map +1 -1
- package/dist/store/groups-command.d.ts.map +1 -1
- package/dist/store/groups-command.js +37 -2
- package/dist/store/groups-command.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-GTL4YGZX.js +0 -91
- package/dist/bundle/failure-NAM37T2T.js +0 -71
- package/dist/bundle/server-HUEXB5QL.js +0 -64
- package/dist/bundle/server-YLXOJOTR.js +0 -50
- package/dist/bundle/store-maintenance-command-TOBBH3ZK.js +0 -49
- package/dist/bundle/update-3QB752NL.js +0 -74
- /package/dist/bundle/{chunk-ID2I2X2Z.js → chunk-VI7FFUEX.js} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
fold,
|
|
13
13
|
normalize,
|
|
14
14
|
parseStemmers
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OXUVXJQZ.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-LEVVMGYP.js";
|
|
41
41
|
import {
|
|
42
42
|
quietSqliteWarning,
|
|
43
43
|
storeCapable
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-YZLQY6MO.js";
|
|
45
45
|
import {
|
|
46
46
|
PRAGMAS,
|
|
47
47
|
TIME_LIMIT_FUNCTION,
|
|
48
48
|
TimeLimitReached,
|
|
49
49
|
isQueryOnly
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-TGKW746D.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-JURO45D4.js";
|
|
230
230
|
import {
|
|
231
231
|
holdsCredential,
|
|
232
232
|
secretNamed,
|
|
233
233
|
sqliteCode
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-BM7X632R.js";
|
|
235
235
|
import {
|
|
236
236
|
DEFAULT_TASK_CATEGORIES,
|
|
237
237
|
sharedConfigPath,
|
|
238
238
|
storedTaskCategories,
|
|
239
239
|
taskCategoriesReader
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-RRAO2HEO.js";
|
|
241
241
|
import {
|
|
242
242
|
refuseOwnerStoreInTests,
|
|
243
243
|
storePath
|
|
244
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-LQRUSNYT.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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/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(":");
|
|
@@ -11510,7 +11510,8 @@ var currentPairOf = /* @__PURE__ */ __name((database, payload) => {
|
|
|
11510
11510
|
const to = payload.with === null ? currentPerson(database, Number(payload.persons[1])) : personOf(database, pkOf(database, payload.with));
|
|
11511
11511
|
return from2 === void 0 || to === void 0 ? void 0 : [from2, to];
|
|
11512
11512
|
}, "currentPairOf");
|
|
11513
|
-
var
|
|
11513
|
+
var BY_SCORE = "json_extract(payload, '$.score') IS NULL, json_extract(payload, '$.score') DESC, id DESC";
|
|
11514
|
+
var linkRows = /* @__PURE__ */ __name((database, statuses = ["proposed", "rejected"], page3) => database.prepare("SELECT id, status, payload FROM proposed_actions WHERE kind = ? AND status IN (SELECT value FROM json_each(?)) " + (page3 === void 0 ? "ORDER BY id" : `ORDER BY ${page3.order === "score" ? BY_SCORE : "id DESC"} LIMIT ? OFFSET ?`)).all(IDENTITY_LINK_KIND, JSON.stringify(statuses), ...page3 === void 0 ? [] : [page3.limit, page3.offset]).map((row2) => {
|
|
11514
11515
|
const payload = JSON.parse(String(row2.payload));
|
|
11515
11516
|
return { id: String(row2.id), status: String(row2.status), payload, pair: currentPairOf(database, payload) };
|
|
11516
11517
|
}), "linkRows");
|
|
@@ -11598,13 +11599,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
11598
11599
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
11599
11600
|
}, "forgetErasedLinks");
|
|
11600
11601
|
|
|
11601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11602
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
|
|
11602
11603
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
11603
11604
|
|
|
11604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11605
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
11605
11606
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
11606
11607
|
|
|
11607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
11608
11609
|
var TASK_CLOSE_KIND = "task_close";
|
|
11609
11610
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
11610
11611
|
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 +11653,168 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
11652
11653
|
}, "assertMayDecide");
|
|
11653
11654
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
11654
11655
|
|
|
11655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
11657
|
+
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
11658
|
+
var import_tldts = __toESM(require_cjs(), 1);
|
|
11659
|
+
var WEIGHTS = {
|
|
11660
|
+
spam_folder: 4,
|
|
11661
|
+
dmarc_fail: 3,
|
|
11662
|
+
brand_spoof: 3,
|
|
11663
|
+
young_domain: 5,
|
|
11664
|
+
reply_to_elsewhere: 1,
|
|
11665
|
+
never_opened: 2,
|
|
11666
|
+
dkim_not_passed: 2,
|
|
11667
|
+
disposable_domain: 2,
|
|
11668
|
+
bulk_never_replied: 1,
|
|
11669
|
+
replied: -5
|
|
11670
|
+
};
|
|
11671
|
+
var FRAUD_SIGNALS = ["dmarc_fail", "brand_spoof", "young_domain", "disposable_domain"];
|
|
11672
|
+
var DMARC_SINCE = "2022-01-01T00:00:00.000Z";
|
|
11673
|
+
var YOUNG_DAYS = 180;
|
|
11674
|
+
var registrableOf = /* @__PURE__ */ __name((address) => {
|
|
11675
|
+
const host = address.slice(address.lastIndexOf("@") + 1).toLowerCase();
|
|
11676
|
+
return (0, import_tldts.getDomain)(host) ?? host;
|
|
11677
|
+
}, "registrableOf");
|
|
11678
|
+
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
11679
|
+
"gmail.com",
|
|
11680
|
+
"googlemail.com",
|
|
11681
|
+
"yahoo.com",
|
|
11682
|
+
"outlook.com",
|
|
11683
|
+
"hotmail.com",
|
|
11684
|
+
"live.com",
|
|
11685
|
+
"msn.com",
|
|
11686
|
+
"icloud.com",
|
|
11687
|
+
"me.com",
|
|
11688
|
+
"aol.com",
|
|
11689
|
+
"proton.me",
|
|
11690
|
+
"protonmail.com",
|
|
11691
|
+
"gmx.com",
|
|
11692
|
+
"gmx.de",
|
|
11693
|
+
"mail.com",
|
|
11694
|
+
"yandex.ru",
|
|
11695
|
+
"ya.ru",
|
|
11696
|
+
"mail.ru",
|
|
11697
|
+
"bk.ru",
|
|
11698
|
+
"inbox.ru",
|
|
11699
|
+
"list.ru",
|
|
11700
|
+
"rambler.ru",
|
|
11701
|
+
"zoho.com"
|
|
11702
|
+
]);
|
|
11703
|
+
var BRANDS = {
|
|
11704
|
+
paypal: ["paypal"],
|
|
11705
|
+
apple: ["apple", "icloud"],
|
|
11706
|
+
microsoft: [
|
|
11707
|
+
"microsoft",
|
|
11708
|
+
"outlook",
|
|
11709
|
+
"office",
|
|
11710
|
+
"office365",
|
|
11711
|
+
"live",
|
|
11712
|
+
"hotmail",
|
|
11713
|
+
"azure",
|
|
11714
|
+
"onedrive",
|
|
11715
|
+
"microsoftadvertising"
|
|
11716
|
+
],
|
|
11717
|
+
google: ["google", "gmail", "youtube", "googlemail"],
|
|
11718
|
+
amazon: ["amazon", "amazonaws", "aws"],
|
|
11719
|
+
netflix: ["netflix"],
|
|
11720
|
+
facebook: ["facebook", "facebookmail", "meta", "fb"],
|
|
11721
|
+
instagram: ["instagram", "facebookmail"],
|
|
11722
|
+
whatsapp: ["whatsapp"],
|
|
11723
|
+
linkedin: ["linkedin"],
|
|
11724
|
+
dhl: ["dhl"],
|
|
11725
|
+
fedex: ["fedex"],
|
|
11726
|
+
docusign: ["docusign"],
|
|
11727
|
+
dropbox: ["dropbox", "dropboxmail", "hellosign"],
|
|
11728
|
+
binance: ["binance"],
|
|
11729
|
+
coinbase: ["coinbase"],
|
|
11730
|
+
revolut: ["revolut"]
|
|
11731
|
+
};
|
|
11732
|
+
var NAMES_OTHERS = /* @__PURE__ */ new Set(["coursera", "quora"]);
|
|
11733
|
+
var named = /* @__PURE__ */ __name((brand, text8) => new RegExp(`\\b${brand}\\b`, "i").test(text8), "named");
|
|
11734
|
+
var spoofedBrand = /* @__PURE__ */ __name((name, address) => {
|
|
11735
|
+
if (name === void 0 || address === void 0)
|
|
11736
|
+
return void 0;
|
|
11737
|
+
const label2 = registrableOf(address).split(".")[0] ?? "";
|
|
11738
|
+
if (NAMES_OTHERS.has(label2))
|
|
11739
|
+
return void 0;
|
|
11740
|
+
const relay = /\s+via\s+(.+)$/i.exec(name)?.[1];
|
|
11741
|
+
if (relay !== void 0 && Object.entries(BRANDS).some(([brand, owned]) => named(brand, relay) && owned.includes(label2)))
|
|
11742
|
+
return void 0;
|
|
11743
|
+
return Object.entries(BRANDS).find(([brand, owned]) => named(brand, name) && !owned.includes(label2))?.[0];
|
|
11744
|
+
}, "spoofedBrand");
|
|
11745
|
+
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11746
|
+
var youngAt = /* @__PURE__ */ __name((age, at2) => {
|
|
11747
|
+
if (age?.created === void 0)
|
|
11748
|
+
return false;
|
|
11749
|
+
const old = Date.parse(at2) - Date.parse(age.created);
|
|
11750
|
+
return old >= 0 && old < YOUNG_DAYS * DAY_MS;
|
|
11751
|
+
}, "youngAt");
|
|
11752
|
+
var most = /* @__PURE__ */ __name((items, test) => items.filter((item) => test(item)).length * 2 >= items.length, "most");
|
|
11753
|
+
var scoreGroup = /* @__PURE__ */ __name((items, context) => {
|
|
11754
|
+
const signals = [];
|
|
11755
|
+
const judged = items.filter((item) => item.headers?.auth?.dmarc !== void 0 && item.receivedAt >= DMARC_SINCE);
|
|
11756
|
+
if (most(items, (item) => item.labels?.includes("Spam")))
|
|
11757
|
+
signals.push("spam_folder");
|
|
11758
|
+
const forged = /* @__PURE__ */ __name((item) => item.headers?.auth?.dmarc === "fail" && item.headers.auth.dkim !== "pass", "forged");
|
|
11759
|
+
if (judged.length && most(judged, forged) && !judged.some((item) => item.headers?.auth?.dmarc === "pass"))
|
|
11760
|
+
signals.push("dmarc_fail");
|
|
11761
|
+
if (items.some((item) => spoofedBrand(item.headers?.fromName, item.headers?.from) !== void 0))
|
|
11762
|
+
signals.push("brand_spoof");
|
|
11763
|
+
const sender = items.find((item) => item.headers?.from !== void 0)?.headers?.from;
|
|
11764
|
+
const domain = sender === void 0 ? void 0 : registrableOf(sender);
|
|
11765
|
+
const first = items.reduce((a, b) => a.receivedAt < b.receivedAt ? a : b);
|
|
11766
|
+
if (domain !== void 0 && youngAt(context.ages.get(domain), first.receivedAt))
|
|
11767
|
+
signals.push("young_domain");
|
|
11768
|
+
if (most(items, (item) => {
|
|
11769
|
+
const { from: from2, replyTo } = item.headers ?? {};
|
|
11770
|
+
return from2 !== void 0 && replyTo !== void 0 && registrableOf(replyTo) !== registrableOf(from2);
|
|
11771
|
+
}))
|
|
11772
|
+
signals.push("reply_to_elsewhere");
|
|
11773
|
+
const known2 = items.filter((item) => item.seen !== void 0);
|
|
11774
|
+
if (known2.length && known2.every((item) => !item.seen))
|
|
11775
|
+
signals.push("never_opened");
|
|
11776
|
+
const stamped = items.filter((item) => item.headers?.auth !== void 0);
|
|
11777
|
+
if (stamped.length && most(stamped, (item) => item.headers?.auth?.dkim !== "pass"))
|
|
11778
|
+
signals.push("dkim_not_passed");
|
|
11779
|
+
if (domain !== void 0 && (0, import_disposable_email_domains_js.isDisposableEmailDomain)(domain))
|
|
11780
|
+
signals.push("disposable_domain");
|
|
11781
|
+
if (context.bulk >= 0.8 && !context.replied)
|
|
11782
|
+
signals.push("bulk_never_replied");
|
|
11783
|
+
if (context.replied)
|
|
11784
|
+
signals.push("replied");
|
|
11785
|
+
const kept2 = signals.includes("dmarc_fail") && !signals.some((signal) => signal !== "dmarc_fail" && FRAUD_SIGNALS.includes(signal)) ? signals.filter((signal) => signal !== "dmarc_fail") : signals;
|
|
11786
|
+
return { score: kept2.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept2 };
|
|
11787
|
+
}, "scoreGroup");
|
|
11788
|
+
|
|
11789
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
|
|
11790
|
+
var BY_ADDRESS = "SELECT DISTINCT o.id FROM organizations o JOIN organization_identities oi ON oi.organization_id = o.id JOIN identities i ON i.id = oi.identity_id WHERE o.deleted_at IS NULL AND i.provider = 'email' AND ";
|
|
11791
|
+
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
11792
|
+
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
11793
|
+
const at2 = now2();
|
|
11794
|
+
database.prepare("INSERT INTO identities (provider, external_id, created_at, updated_at) VALUES ('email', ?, ?, ?) ON CONFLICT (provider, external_id) DO NOTHING").run(email, at2, at2);
|
|
11795
|
+
database.prepare("INSERT INTO organization_identities (identity_id, organization_id, method, author, created_at, updated_at) SELECT id, ?, ?, ?, ?, ? FROM identities WHERE provider = 'email' AND external_id = ? ON CONFLICT (identity_id, organization_id) DO NOTHING").run(organization2, method, author, at2, at2, email);
|
|
11796
|
+
}, "holdAddress");
|
|
11797
|
+
var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, method, author, reason }) => {
|
|
11798
|
+
const { database, now: now2 } = context;
|
|
11799
|
+
const domain = email?.split("@")[1];
|
|
11800
|
+
let found2 = email === void 0 ? [] : idsOf2(database.prepare(`${BY_ADDRESS}lower(i.external_id) = ?`).all(email));
|
|
11801
|
+
if (!found2.length && domain && !FREE_MAIL.has(domain))
|
|
11802
|
+
found2 = idsOf2(database.prepare(`${BY_ADDRESS}substr(lower(i.external_id), -length(?)) = ?`).all(`@${domain}`, `@${domain}`));
|
|
11803
|
+
if (!found2.length)
|
|
11804
|
+
found2 = database.prepare("SELECT id, name FROM organizations WHERE deleted_at IS NULL").all().filter((row2) => fold(String(row2.name)).trim() === fold(name).trim()).map((row2) => Number(row2.id));
|
|
11805
|
+
if (found2.length > 1)
|
|
11806
|
+
throw new CliError("validation_error", `${found2.length} organizations match ${name} (${found2.map((id3) => `organization:${id3}`).join(", ")}); name the one meant as a reference`, { reason });
|
|
11807
|
+
const at2 = now2();
|
|
11808
|
+
const id2 = found2[0] ?? Number(database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES ('company', ?, 'work', ?, ?) RETURNING id").get(name, at2, at2)?.id);
|
|
11809
|
+
if (email !== void 0)
|
|
11810
|
+
holdAddress(context, id2, email, { method, author });
|
|
11811
|
+
return id2;
|
|
11812
|
+
}, "organizationOfAddress");
|
|
11813
|
+
|
|
11814
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
11656
11815
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11657
11816
|
|
|
11658
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11817
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
11659
11818
|
import { existsSync, statSync } from "node:fs";
|
|
11660
11819
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
11661
11820
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -11681,7 +11840,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
11681
11840
|
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
11841
|
}, "checkJournal");
|
|
11683
11842
|
|
|
11684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
11685
11844
|
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
11845
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
11687
11846
|
const match = WRITE.exec(sql2);
|
|
@@ -11761,7 +11920,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
11761
11920
|
}, "committedWrites");
|
|
11762
11921
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
11763
11922
|
|
|
11764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
11765
11924
|
var ARMS = [
|
|
11766
11925
|
[
|
|
11767
11926
|
"message",
|
|
@@ -11889,7 +12048,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
11889
12048
|
return recomputed;
|
|
11890
12049
|
}, "drainInvolvementQueue");
|
|
11891
12050
|
|
|
11892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
11893
12052
|
import { domainToUnicode } from "node:url";
|
|
11894
12053
|
|
|
11895
12054
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -21911,7 +22070,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
21911
22070
|
}, "oa");
|
|
21912
22071
|
var na = { parse: O, get: aa, isValid: oa };
|
|
21913
22072
|
|
|
21914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
21915
22074
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
21916
22075
|
var ID = /^[\w-]{10,}$/;
|
|
21917
22076
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21953,7 +22112,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21953
22112
|
return { url, documentId: googleDocumentId(url) };
|
|
21954
22113
|
}), "googleDocumentLinks");
|
|
21955
22114
|
|
|
21956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
21957
22116
|
var PHONE_PLANS = [
|
|
21958
22117
|
{
|
|
21959
22118
|
country: "us",
|
|
@@ -22333,7 +22492,7 @@ var PHONE_PLANS = [
|
|
|
22333
22492
|
}
|
|
22334
22493
|
];
|
|
22335
22494
|
|
|
22336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
22337
22496
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
22338
22497
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
22339
22498
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -22407,7 +22566,7 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
22407
22566
|
return found2 ? `+${found2[1]}` : void 0;
|
|
22408
22567
|
}, "storedPhone");
|
|
22409
22568
|
|
|
22410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22569
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
22411
22570
|
var BEFORE = [
|
|
22412
22571
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
22413
22572
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -22667,7 +22826,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
22667
22826
|
return found2.sort((a, b) => a.start - b.start);
|
|
22668
22827
|
}, "findPlaces");
|
|
22669
22828
|
|
|
22670
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
22671
22830
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
22672
22831
|
var MENTION_VERSIONS = {
|
|
22673
22832
|
phone: 1,
|
|
@@ -22843,7 +23002,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
22843
23002
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
22844
23003
|
}, "exactlyOne");
|
|
22845
23004
|
|
|
22846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
22847
23006
|
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
23007
|
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
23008
|
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 +23010,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
22851
23010
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
22852
23011
|
var NAME_WORDS = WORDS.split(" ");
|
|
22853
23012
|
|
|
22854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23013
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
22855
23014
|
var LATIN_TO_CYRILLIC = {
|
|
22856
23015
|
shch: "\u0449",
|
|
22857
23016
|
sch: "\u0449",
|
|
@@ -23059,7 +23218,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
23059
23218
|
return found2;
|
|
23060
23219
|
}, "findUnknownNames");
|
|
23061
23220
|
|
|
23062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
23063
23222
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
23064
23223
|
"webpage",
|
|
23065
23224
|
"share",
|
|
@@ -23099,7 +23258,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
23099
23258
|
});
|
|
23100
23259
|
}, "matchDownloads");
|
|
23101
23260
|
|
|
23102
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
23103
23262
|
var QUERY_VERSION = 1;
|
|
23104
23263
|
var QUERY_LIMITS2 = {
|
|
23105
23264
|
...QUERY_LIMITS,
|
|
@@ -23137,7 +23296,7 @@ function exhausted(budget) {
|
|
|
23137
23296
|
}
|
|
23138
23297
|
__name(exhausted, "exhausted");
|
|
23139
23298
|
|
|
23140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23299
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
23141
23300
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
23142
23301
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
23143
23302
|
kind: "char",
|
|
@@ -23537,7 +23696,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
23537
23696
|
return out;
|
|
23538
23697
|
}, "foldRegex");
|
|
23539
23698
|
|
|
23540
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
23541
23700
|
var PRESET_VERSION = 1;
|
|
23542
23701
|
var PRESETS = {
|
|
23543
23702
|
password: {
|
|
@@ -23591,7 +23750,7 @@ var PRESETS = {
|
|
|
23591
23750
|
}
|
|
23592
23751
|
};
|
|
23593
23752
|
|
|
23594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23753
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
23595
23754
|
var FIELD_VERSION = 2;
|
|
23596
23755
|
var UNITS = {
|
|
23597
23756
|
"": 1,
|
|
@@ -24063,12 +24222,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
24063
24222
|
return validateFields(parsed4.output);
|
|
24064
24223
|
}, "validateAst");
|
|
24065
24224
|
|
|
24066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
24067
24226
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
24068
24227
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
24069
24228
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
24070
24229
|
|
|
24071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
24072
24231
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
24073
24232
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
24074
24233
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -24092,7 +24251,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
24092
24251
|
};
|
|
24093
24252
|
}, "linkMatch");
|
|
24094
24253
|
|
|
24095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24254
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
24096
24255
|
var SETTING = "phoneCountries";
|
|
24097
24256
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
24098
24257
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -24123,7 +24282,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
24123
24282
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
24124
24283
|
}, "valueMatch");
|
|
24125
24284
|
|
|
24126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24285
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
24127
24286
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
24128
24287
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
24129
24288
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -24151,7 +24310,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
24151
24310
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
24152
24311
|
}, "vocabularySimilarity");
|
|
24153
24312
|
|
|
24154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24313
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
24155
24314
|
import { createHash } from "node:crypto";
|
|
24156
24315
|
var folded3 = /* @__PURE__ */ __name((name) => {
|
|
24157
24316
|
try {
|
|
@@ -24217,7 +24376,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
24217
24376
|
});
|
|
24218
24377
|
}, "guardTagCreation");
|
|
24219
24378
|
|
|
24220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24379
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
24221
24380
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
24222
24381
|
throw new CliError("validation_error", message3);
|
|
24223
24382
|
}, "invalid");
|
|
@@ -24294,7 +24453,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
24294
24453
|
};
|
|
24295
24454
|
}, "createTagRedirectIndex");
|
|
24296
24455
|
|
|
24297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24456
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
24298
24457
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
24299
24458
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
24300
24459
|
if (!row2)
|
|
@@ -24322,7 +24481,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
24322
24481
|
return snapshot2;
|
|
24323
24482
|
}, "tagRedirectSnapshot");
|
|
24324
24483
|
|
|
24325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24484
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
24326
24485
|
import { createHash as createHash2 } from "node:crypto";
|
|
24327
24486
|
var TASK_KEY_PREFIXES = {
|
|
24328
24487
|
question: "Q",
|
|
@@ -24350,7 +24509,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
24350
24509
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
24351
24510
|
}, "taskAccountOf");
|
|
24352
24511
|
|
|
24353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24512
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
24354
24513
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
24355
24514
|
if (iso17 === null || iso17 === void 0)
|
|
24356
24515
|
return null;
|
|
@@ -24364,7 +24523,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
24364
24523
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
24365
24524
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
24366
24525
|
|
|
24367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
24368
24527
|
var TAG_KINDS = ["tag", "topic"];
|
|
24369
24528
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
24370
24529
|
var TAG_TYPE = {
|
|
@@ -24567,7 +24726,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
24567
24726
|
return result;
|
|
24568
24727
|
}, "tagsOf");
|
|
24569
24728
|
|
|
24570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
24571
24730
|
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
24731
|
var SPEECH = speech("att");
|
|
24573
24732
|
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 +25092,7 @@ var FIELD_COMPILERS = {
|
|
|
24933
25092
|
subject
|
|
24934
25093
|
};
|
|
24935
25094
|
|
|
24936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
24937
25096
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
24938
25097
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
24939
25098
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -24949,7 +25108,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
24949
25108
|
};
|
|
24950
25109
|
}, "placeOf");
|
|
24951
25110
|
|
|
24952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
24953
25112
|
var DRAIN_ON_WRITE = 500;
|
|
24954
25113
|
var METHOD = "rules";
|
|
24955
25114
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -25115,7 +25274,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
25115
25274
|
return queued.length;
|
|
25116
25275
|
}, "drainMentions");
|
|
25117
25276
|
|
|
25118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
25119
25278
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
25120
25279
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
25121
25280
|
if (!exists2)
|
|
@@ -25123,7 +25282,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
25123
25282
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
25124
25283
|
}, "indexRow");
|
|
25125
25284
|
|
|
25126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25285
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
25127
25286
|
var INDEX = "message_stems";
|
|
25128
25287
|
var SETTING2 = "searchStemmers";
|
|
25129
25288
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -25245,7 +25404,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
25245
25404
|
};
|
|
25246
25405
|
}, "stemmerCache");
|
|
25247
25406
|
|
|
25248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
25249
25408
|
var rehearsal = new AsyncLocalStorage();
|
|
25250
25409
|
var SQLITE_BUSY = 5;
|
|
25251
25410
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -25388,7 +25547,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
25388
25547
|
}
|
|
25389
25548
|
}, "read");
|
|
25390
25549
|
|
|
25391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
25392
25551
|
var FOLDED = [
|
|
25393
25552
|
{ table: "tasks", column: "title" },
|
|
25394
25553
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -25425,7 +25584,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
25425
25584
|
return filled2;
|
|
25426
25585
|
}, "fillFolded");
|
|
25427
25586
|
|
|
25428
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
25429
25588
|
import { createHash as createHash3 } from "node:crypto";
|
|
25430
25589
|
var CHUNK_CHARS = 1200;
|
|
25431
25590
|
var CHUNK_OVERLAP = 150;
|
|
@@ -25530,7 +25689,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
25530
25689
|
return chunks2;
|
|
25531
25690
|
}, "cutChunks");
|
|
25532
25691
|
|
|
25533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
25534
25693
|
var DAY2 = 864e5;
|
|
25535
25694
|
var CURRENCY = [
|
|
25536
25695
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -25656,7 +25815,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
25656
25815
|
return best?.day ?? null;
|
|
25657
25816
|
}, "dueDayOf");
|
|
25658
25817
|
|
|
25659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
25660
25819
|
var DAY3 = 864e5;
|
|
25661
25820
|
var STOP_WORDS = new Set([
|
|
25662
25821
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -25811,7 +25970,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
25811
25970
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
25812
25971
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
25813
25972
|
|
|
25814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25973
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
25815
25974
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
25816
25975
|
coalesce(CASE k.chunkable_type
|
|
25817
25976
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -25953,7 +26112,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
25953
26112
|
}, "dropUnusedVectors");
|
|
25954
26113
|
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
26114
|
|
|
25956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
25957
26116
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
25958
26117
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
25959
26118
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -26228,7 +26387,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
26228
26387
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
26229
26388
|
])), "vectorCounts");
|
|
26230
26389
|
|
|
26231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
26232
26391
|
var DOCUMENT_PICTURE = "document_picture";
|
|
26233
26392
|
var SCAN_PAGE2 = 5e3;
|
|
26234
26393
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -26291,12 +26450,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
26291
26450
|
}, "nearestPictures")
|
|
26292
26451
|
}), "documentPicturesOver");
|
|
26293
26452
|
|
|
26294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
26295
26454
|
var noteIndexText = /* @__PURE__ */ __name((title, text8) => title ? `${title}
|
|
26296
26455
|
|
|
26297
26456
|
${text8}` : text8, "noteIndexText");
|
|
26298
26457
|
|
|
26299
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
26300
26459
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
26301
26460
|
var ENRICHMENT_POSITION = 1e6;
|
|
26302
26461
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -26390,7 +26549,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
26390
26549
|
}), "clear")
|
|
26391
26550
|
}), "enrichmentsOver");
|
|
26392
26551
|
|
|
26393
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26552
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
26394
26553
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
26395
26554
|
const literal5 = escaped2 ?? plain2 ?? "";
|
|
26396
26555
|
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
@@ -26455,7 +26614,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
26455
26614
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
26456
26615
|
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
26616
|
|
|
26458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
26459
26618
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
26460
26619
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
26461
26620
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -26545,7 +26704,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
26545
26704
|
});
|
|
26546
26705
|
}, "linkMeeting");
|
|
26547
26706
|
|
|
26548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
|
|
26549
26708
|
var MAX_TITLE = 120;
|
|
26550
26709
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
26551
26710
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -26576,8 +26735,38 @@ var displayTitleOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
26576
26735
|
return stored4;
|
|
26577
26736
|
}
|
|
26578
26737
|
}, "displayTitleOf");
|
|
26738
|
+
var FOUND_TASK_TITLES_TO_FILL = "found_task_titles_to_fill";
|
|
26739
|
+
var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500 } = {}) => {
|
|
26740
|
+
if (!database.prepare("SELECT 1 AS found FROM store_settings WHERE key = ?").get(FOUND_TASK_TITLES_TO_FILL))
|
|
26741
|
+
return 0;
|
|
26742
|
+
const next = database.prepare(`SELECT id, type, title, source_locator FROM tasks WHERE id > ? AND package_id IS NOT NULL AND deleted_at IS NULL AND source_locator LIKE 'msg:%' AND ${PLACEHOLDER_TITLE_SQL} ORDER BY id LIMIT ?`);
|
|
26743
|
+
const store = database.prepare(`UPDATE tasks SET title = ?, title_folded = ? WHERE id = ? AND ${PLACEHOLDER_TITLE_SQL}`);
|
|
26744
|
+
let filled2 = 0;
|
|
26745
|
+
let after2 = 0;
|
|
26746
|
+
try {
|
|
26747
|
+
for (; ; ) {
|
|
26748
|
+
const rows = writeBatch(database, () => {
|
|
26749
|
+
const page3 = next.all(after2, batch);
|
|
26750
|
+
for (const row2 of page3) {
|
|
26751
|
+
const title = displayTitleOf(database, row2);
|
|
26752
|
+
if (title !== String(row2.title))
|
|
26753
|
+
filled2 += store.run(title, folded4(title), Number(row2.id)).changes;
|
|
26754
|
+
}
|
|
26755
|
+
if (page3.length < batch)
|
|
26756
|
+
database.prepare("DELETE FROM store_settings WHERE key = ?").run(FOUND_TASK_TITLES_TO_FILL);
|
|
26757
|
+
return page3;
|
|
26758
|
+
});
|
|
26759
|
+
if (rows.length < batch)
|
|
26760
|
+
return filled2;
|
|
26761
|
+
after2 = Number(rows.at(-1)?.id);
|
|
26762
|
+
}
|
|
26763
|
+
} catch (error) {
|
|
26764
|
+
warn(`could not store the titles of found tasks; the next open tries again: ${String(error)}`);
|
|
26765
|
+
return filled2;
|
|
26766
|
+
}
|
|
26767
|
+
}, "fillFoundTaskTitles");
|
|
26579
26768
|
|
|
26580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26769
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
26581
26770
|
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
26771
|
var UNSEARCHED_EVENT_TYPES = [
|
|
26583
26772
|
"working-location",
|
|
@@ -26824,7 +27013,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
26824
27013
|
return true;
|
|
26825
27014
|
}, "resetNoteIndex");
|
|
26826
27015
|
|
|
26827
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
26828
27017
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
26829
27018
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
26830
27019
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -26843,7 +27032,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
26843
27032
|
}
|
|
26844
27033
|
}, "resolvePersonLinks");
|
|
26845
27034
|
|
|
26846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
26847
27036
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
26848
27037
|
id: integer("id").primaryKey(),
|
|
26849
27038
|
name: text("name").notNull().unique(),
|
|
@@ -26852,7 +27041,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
26852
27041
|
updatedAt: integer("updated_at").notNull()
|
|
26853
27042
|
});
|
|
26854
27043
|
|
|
26855
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
26856
27045
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
26857
27046
|
id: integer("id").primaryKey(),
|
|
26858
27047
|
linkId: integer("link_id").notNull(),
|
|
@@ -26864,7 +27053,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
26864
27053
|
createdAt: integer("created_at").notNull()
|
|
26865
27054
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
26866
27055
|
|
|
26867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27056
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
26868
27057
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
26869
27058
|
sourceKey: text("source_key").notNull(),
|
|
26870
27059
|
collection: text("collection").notNull(),
|
|
@@ -26874,13 +27063,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
26874
27063
|
createdAt: integer("created_at").notNull()
|
|
26875
27064
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
26876
27065
|
|
|
26877
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
26878
27067
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
26879
27068
|
id: integer("id").notNull(),
|
|
26880
27069
|
indexableType: text("indexable_type").notNull()
|
|
26881
27070
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
26882
27071
|
|
|
26883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27072
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
26884
27073
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
26885
27074
|
id: integer("id").primaryKey(),
|
|
26886
27075
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -26900,7 +27089,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
26900
27089
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
26901
27090
|
]);
|
|
26902
27091
|
|
|
26903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
26904
27093
|
var enrichments = sqliteTable("enrichments", {
|
|
26905
27094
|
subjectType: text("subject_type").notNull(),
|
|
26906
27095
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -26912,7 +27101,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
26912
27101
|
createdAt: integer("created_at").notNull()
|
|
26913
27102
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
26914
27103
|
|
|
26915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
26916
27105
|
var templates = sqliteTable("templates", {
|
|
26917
27106
|
key: text("key").notNull(),
|
|
26918
27107
|
channel: text("channel").notNull(),
|
|
@@ -26934,7 +27123,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
26934
27123
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
26935
27124
|
]);
|
|
26936
27125
|
|
|
26937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
26938
27127
|
var links = sqliteTable("links", {
|
|
26939
27128
|
id: integer("id").primaryKey(),
|
|
26940
27129
|
fromType: text("from_type").notNull(),
|
|
@@ -26965,7 +27154,7 @@ var links = sqliteTable("links", {
|
|
|
26965
27154
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
26966
27155
|
]);
|
|
26967
27156
|
|
|
26968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
26969
27158
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
26970
27159
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
26971
27160
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -26991,7 +27180,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
26991
27180
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
26992
27181
|
]);
|
|
26993
27182
|
|
|
26994
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
26995
27184
|
var accounts = sqliteTable("accounts", {
|
|
26996
27185
|
id: integer("id").primaryKey(),
|
|
26997
27186
|
provider: text("provider").notNull(),
|
|
@@ -29001,7 +29190,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
29001
29190
|
at: integer("at").notNull()
|
|
29002
29191
|
});
|
|
29003
29192
|
|
|
29004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29193
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
29005
29194
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
29006
29195
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
29007
29196
|
find: orm.select({
|
|
@@ -29226,7 +29415,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
29226
29415
|
}, "meetingIdentityPk");
|
|
29227
29416
|
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
29417
|
|
|
29229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
29230
29419
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
29231
29420
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
29232
29421
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -29286,7 +29475,159 @@ var localWord = /* @__PURE__ */ __name((address) => {
|
|
|
29286
29475
|
var isRoleAddress = /* @__PURE__ */ __name((address) => ROLE.has(localWord(address)), "isRoleAddress");
|
|
29287
29476
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
29288
29477
|
|
|
29289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
29479
|
+
var TAKES = {
|
|
29480
|
+
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
29481
|
+
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
29482
|
+
};
|
|
29483
|
+
var article2 = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
29484
|
+
var wrongKind = /* @__PURE__ */ __name((text8, kind3, takes) => new CliError("validation_error", `${text8} names ${article2(kind3)} ${kind3}; this takes ${TAKES[takes]}`, {
|
|
29485
|
+
reason: "ref.wrong-kind"
|
|
29486
|
+
}), "wrongKind");
|
|
29487
|
+
var wrongProvider = /* @__PURE__ */ __name((text8, provider, kind3) => {
|
|
29488
|
+
const entry2 = providerNamed(provider);
|
|
29489
|
+
const command = entry2?.command;
|
|
29490
|
+
const opens = kind3 === "entity" ? void 0 : entry2?.opens?.[kind3];
|
|
29491
|
+
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text8}` : "open it with its own CLI";
|
|
29492
|
+
const label2 = providerLabel(provider);
|
|
29493
|
+
return new CliError("validation_error", `${text8} is ${article2(label2.toLowerCase())} ${label2} ${kind3}; ${how}`, {
|
|
29494
|
+
reason: "ref.wrong-provider"
|
|
29495
|
+
});
|
|
29496
|
+
}, "wrongProvider");
|
|
29497
|
+
var chatReferenceOf = /* @__PURE__ */ __name((text8, provider, takes = "chat") => {
|
|
29498
|
+
const trimmed = text8.trim();
|
|
29499
|
+
if (!looksLikeReference(trimmed))
|
|
29500
|
+
return void 0;
|
|
29501
|
+
const reference2 = parseReference(trimmed);
|
|
29502
|
+
if (reference2.type !== "chat" && reference2.type !== "message")
|
|
29503
|
+
throw wrongKind(trimmed, reference2.type, takes);
|
|
29504
|
+
if (reference2.provider !== provider)
|
|
29505
|
+
throw wrongProvider(trimmed, reference2.provider, reference2.type);
|
|
29506
|
+
const found2 = {
|
|
29507
|
+
text: trimmed,
|
|
29508
|
+
provider: reference2.provider,
|
|
29509
|
+
account: reference2.account,
|
|
29510
|
+
chat: reference2.chat,
|
|
29511
|
+
...reference2.type === "message" ? { message: reference2.message } : {}
|
|
29512
|
+
};
|
|
29513
|
+
return found2;
|
|
29514
|
+
}, "chatReferenceOf");
|
|
29515
|
+
var contactReferenceOf = /* @__PURE__ */ __name((text8, provider) => {
|
|
29516
|
+
const trimmed = text8.trim();
|
|
29517
|
+
if (!trimmed.startsWith("contact:"))
|
|
29518
|
+
return void 0;
|
|
29519
|
+
const reference2 = parseReference(trimmed);
|
|
29520
|
+
if (reference2.type !== "contact")
|
|
29521
|
+
return void 0;
|
|
29522
|
+
if (provider !== void 0 && reference2.provider !== provider)
|
|
29523
|
+
throw wrongProvider(trimmed, reference2.provider, reference2.type);
|
|
29524
|
+
return reference2.id;
|
|
29525
|
+
}, "contactReferenceOf");
|
|
29526
|
+
var wrongAccount = /* @__PURE__ */ __name((reference2, scope3, profiles) => {
|
|
29527
|
+
const here = scope3.account === void 0 ? "the account of this profile is not known yet" : `${scope3.profile === void 0 ? "this profile" : `profile ${scope3.profile}`} is account ${scope3.account}`;
|
|
29528
|
+
const others = profiles === void 0 ? "" : `. Profiles signed in to ${reference2.account}: ${profiles.length > 0 ? profiles.join(", ") : "none here"}`;
|
|
29529
|
+
return new CliError("validation_error", `${reference2.text} belongs to account ${reference2.account}; ${here}${others}`, { reason: "ref.wrong-account" });
|
|
29530
|
+
}, "wrongAccount");
|
|
29531
|
+
var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn2) => {
|
|
29532
|
+
if (scope3.account !== void 0 && scope3.account === reference2.account)
|
|
29533
|
+
return;
|
|
29534
|
+
const profiles = await profilesOn2?.(reference2.account).catch(() => void 0);
|
|
29535
|
+
throw wrongAccount(reference2, scope3, profiles);
|
|
29536
|
+
}, "ensureAccount");
|
|
29537
|
+
|
|
29538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
29539
|
+
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
29540
|
+
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
29541
|
+
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
29542
|
+
const wanted = foldName(reference2.trim());
|
|
29543
|
+
const matches2 = chats2.filter((chat2) => chat2.title !== null && foldName(chat2.title).includes(wanted));
|
|
29544
|
+
if (matches2.length === 1 && matches2[0])
|
|
29545
|
+
return matches2[0];
|
|
29546
|
+
if (matches2.length === 0)
|
|
29547
|
+
throw new CliError("not_found", `no chat matches "${reference2}"`);
|
|
29548
|
+
throw ambiguous(reference2, "chats", matches2.map((chat2) => ({ id: chat2.id, title: chat2.title })), ({ title }) => singleLine(String(title)));
|
|
29549
|
+
}, "pickChat");
|
|
29550
|
+
var pickPerson = /* @__PURE__ */ __name((reference2, people2) => {
|
|
29551
|
+
const trimmed = reference2.trim();
|
|
29552
|
+
const contact = contactReferenceOf(trimmed, people2.provider);
|
|
29553
|
+
if (contact !== void 0) {
|
|
29554
|
+
const named3 = people2.get(contact);
|
|
29555
|
+
if (named3)
|
|
29556
|
+
return named3;
|
|
29557
|
+
throw new CliError("not_found", `no person ${contact} in what this account has seen`);
|
|
29558
|
+
}
|
|
29559
|
+
const known2 = people2.get(trimmed);
|
|
29560
|
+
if (known2)
|
|
29561
|
+
return known2;
|
|
29562
|
+
if (isId(trimmed))
|
|
29563
|
+
throw new CliError("not_found", `no person ${trimmed} in what this account has seen`);
|
|
29564
|
+
const wanted = foldName(trimmed.replace(/^@/, ""));
|
|
29565
|
+
const everyone = people2.all().toSorted((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
29566
|
+
const fields4 = /* @__PURE__ */ __name((person2) => [person2.alias, person2.name, person2.username].filter(isPresent).map(foldName), "fields");
|
|
29567
|
+
const exact = everyone.filter((person2) => fields4(person2).includes(wanted));
|
|
29568
|
+
const matches2 = exact.length > 0 ? exact : everyone.filter((person2) => fields4(person2).some((one2) => one2.includes(wanted)));
|
|
29569
|
+
if (matches2.length === 1 && matches2[0])
|
|
29570
|
+
return matches2[0];
|
|
29571
|
+
if (matches2.length === 0)
|
|
29572
|
+
throw new CliError("not_found", `nobody matches "${reference2}"`);
|
|
29573
|
+
throw ambiguous(reference2, "people", matches2.map(({ id: id2, name, username }) => ({ id: id2, name, username })), ({ name, username }) => singleLine([name, username && `@${username}`].filter(isPresent).join(" ")));
|
|
29574
|
+
}, "pickPerson");
|
|
29575
|
+
var ambiguous = /* @__PURE__ */ __name((reference2, what, candidates, label2) => {
|
|
29576
|
+
const width = Math.max(...candidates.map(({ id: id2 }) => id2.length));
|
|
29577
|
+
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label2(candidate)}`).join("\n");
|
|
29578
|
+
return new CliError("validation_error", `"${singleLine(reference2)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
29579
|
+
${lines}`, { candidates });
|
|
29580
|
+
}, "ambiguous");
|
|
29581
|
+
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
29582
|
+
|
|
29583
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
29584
|
+
var QUOTES = [
|
|
29585
|
+
['"', '"'],
|
|
29586
|
+
["'", "'"],
|
|
29587
|
+
["\xAB", "\xBB"],
|
|
29588
|
+
["\u201C", "\u201D"],
|
|
29589
|
+
["\u201E", "\u201C"],
|
|
29590
|
+
["\u2018", "\u2019"],
|
|
29591
|
+
["`", "`"]
|
|
29592
|
+
];
|
|
29593
|
+
var READABLE = /[\p{L}\p{N}]/u;
|
|
29594
|
+
var PLACEHOLDERS = /* @__PURE__ */ new Set(["null", "undefined", "none", "\u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0438", "deleted account", "\u0443\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442"]);
|
|
29595
|
+
var unquoted = /* @__PURE__ */ __name((text8) => {
|
|
29596
|
+
let at2 = text8.replace(/\s+/gu, " ").trim();
|
|
29597
|
+
for (; ; ) {
|
|
29598
|
+
const pair = QUOTES.find(([open, close]) => at2.length >= 2 && at2.startsWith(open) && at2.endsWith(close));
|
|
29599
|
+
if (pair === void 0)
|
|
29600
|
+
return at2;
|
|
29601
|
+
at2 = at2.slice(pair[0].length, at2.length - pair[1].length).trim();
|
|
29602
|
+
}
|
|
29603
|
+
}, "unquoted");
|
|
29604
|
+
var given = /* @__PURE__ */ __name((value) => {
|
|
29605
|
+
const text8 = typeof value === "string" ? value.trim() : "";
|
|
29606
|
+
return text8 === "" ? void 0 : text8;
|
|
29607
|
+
}, "given");
|
|
29608
|
+
var displayName = /* @__PURE__ */ __name((name, fallbacks = {}) => {
|
|
29609
|
+
const unwrapped = typeof name === "string" ? unquoted(name) : "";
|
|
29610
|
+
const cleaned = PLACEHOLDERS.has(unwrapped.toLowerCase()) ? "" : unwrapped;
|
|
29611
|
+
if (READABLE.test(cleaned))
|
|
29612
|
+
return cleaned;
|
|
29613
|
+
const borrowed = fallbacks.name === void 0 || fallbacks.name === null ? null : displayName(fallbacks.name);
|
|
29614
|
+
if (borrowed !== null && READABLE.test(borrowed) && !borrowed.startsWith("@"))
|
|
29615
|
+
return borrowed;
|
|
29616
|
+
const username = given(fallbacks.username);
|
|
29617
|
+
return (username === void 0 ? void 0 : username.startsWith("@") ? username : `@${username}`) ?? given(fallbacks.phone) ?? given(fallbacks.email) ?? (cleaned === "" ? null : cleaned);
|
|
29618
|
+
}, "displayName");
|
|
29619
|
+
var nameKey = /* @__PURE__ */ __name((name) => {
|
|
29620
|
+
if (typeof name !== "string")
|
|
29621
|
+
return null;
|
|
29622
|
+
const unwrapped = unquoted(name);
|
|
29623
|
+
if (PLACEHOLDERS.has(unwrapped.toLowerCase()))
|
|
29624
|
+
return null;
|
|
29625
|
+
const words4 = foldName(unwrapped).split(/[^\p{L}\p{N}]+/u).filter((word2) => word2 !== "");
|
|
29626
|
+
return words4.length === 0 ? null : words4.sort().join(" ");
|
|
29627
|
+
}, "nameKey");
|
|
29628
|
+
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
29629
|
+
|
|
29630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
29290
29631
|
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
29632
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
29292
29633
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -29301,7 +29642,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
29301
29642
|
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
29643
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
29303
29644
|
|
|
29304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29645
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
29305
29646
|
var MESSAGE_FIELDS = {
|
|
29306
29647
|
pk: messages.id,
|
|
29307
29648
|
nativeId: messages.externalId,
|
|
@@ -29472,7 +29813,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
29472
29813
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
29473
29814
|
}), "chatActivity");
|
|
29474
29815
|
|
|
29475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
29476
29817
|
var HIT_FIELDS = {
|
|
29477
29818
|
...MESSAGE_FIELDS,
|
|
29478
29819
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29571,7 +29912,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29571
29912
|
};
|
|
29572
29913
|
}, "directReplies");
|
|
29573
29914
|
|
|
29574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29575
29916
|
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
29917
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29577
29918
|
const found2 = identityRow(context, ref3);
|
|
@@ -29727,7 +30068,24 @@ var renameAfterLeaving = /* @__PURE__ */ __name((context, person2, left) => {
|
|
|
29727
30068
|
const kept2 = database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ? AND trim(coalesce(i.name, '')) <> '' ORDER BY l.created_at, i.id LIMIT 1").get(person2)?.name;
|
|
29728
30069
|
database.prepare("UPDATE persons SET name = ?, updated_at = ? WHERE id = ?").run(typeof kept2 === "string" ? kept2 : null, context.now(), person2);
|
|
29729
30070
|
}, "renameAfterLeaving");
|
|
30071
|
+
var shownAs = /* @__PURE__ */ __name((person2) => `${displayName(person2.name, { name: person2.identities.find((identity) => identity.name)?.name ?? null }) ?? "a person with no name"} (person:${person2.uid})`, "shownAs");
|
|
30072
|
+
var heldBy = /* @__PURE__ */ __name((context, from2, refs) => {
|
|
30073
|
+
const uid = from2.startsWith("person:") ? from2.slice("person:".length) : from2;
|
|
30074
|
+
const found2 = /^[1-9]\d*$/.test(uid) ? context.database.prepare("SELECT id FROM persons WHERE id = ?").get(uid) : void 0;
|
|
30075
|
+
if (found2 === void 0)
|
|
30076
|
+
throw new CliError("not_found", `no person:${uid} in the store`, { param: "from" });
|
|
30077
|
+
const pk = currentPerson(context.database, Number(found2.id));
|
|
30078
|
+
for (const ref3 of refs) {
|
|
30079
|
+
const row2 = required(context, ref3);
|
|
30080
|
+
if (row2.personPk === pk)
|
|
30081
|
+
continue;
|
|
30082
|
+
const holder2 = recordOf(context, row2.personPk);
|
|
30083
|
+
throw new CliError("validation_error", `${ref3.provider}:${ref3.id} sits on ${shownAs(holder2)}, not on ${shownAs(recordOf(context, pk))}; nothing changed. Name person:${holder2.uid} to take it off them`, { reason: "identity.held-elsewhere", param: "from", reference: `person:${holder2.uid}` });
|
|
30084
|
+
}
|
|
30085
|
+
}, "heldBy");
|
|
29730
30086
|
var unlinkIdentity = /* @__PURE__ */ __name((context, ref3, options) => {
|
|
30087
|
+
if (options.from !== void 0)
|
|
30088
|
+
heldBy(context, options.from, [ref3]);
|
|
29731
30089
|
const found2 = required(context, ref3);
|
|
29732
30090
|
const others = context.orm.select({ n: sql`count(*)` }).from(identityLinks).where(eq(identityLinks.personId, found2.personPk)).get();
|
|
29733
30091
|
if (Number(others?.n) <= 1)
|
|
@@ -29735,7 +30093,7 @@ var unlinkIdentity = /* @__PURE__ */ __name((context, ref3, options) => {
|
|
|
29735
30093
|
const at2 = context.now();
|
|
29736
30094
|
const named3 = context.orm.select({ name: identities.name }).from(identities).where(eq(identities.id, found2.pk)).get();
|
|
29737
30095
|
const alone = Number(context.orm.insert(persons).values({ name: named3?.name ?? null, createdAt: at2, updatedAt: at2 }).returning({ pk: persons.id }).get()?.pk);
|
|
29738
|
-
move(context, found2.pk, found2.personPk, alone, {
|
|
30096
|
+
move(context, found2.pk, found2.personPk, alone, { method: "unlink", by: options.by });
|
|
29739
30097
|
renameAfterLeaving(context, found2.personPk, [found2.pk]);
|
|
29740
30098
|
return recordOf(context, alone);
|
|
29741
30099
|
}, "unlinkIdentity");
|
|
@@ -29752,7 +30110,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29752
30110
|
}, "mentioning");
|
|
29753
30111
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29754
30112
|
|
|
29755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
29756
30114
|
var PROFILE_PLACEHOLDER = "<profile>";
|
|
29757
30115
|
var unregistered = /* @__PURE__ */ __name((provider) => `no CLI has registered ${provider} in this store yet; run its CLI once`, "unregistered");
|
|
29758
30116
|
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 +30209,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
|
29851
30209
|
return `${WORDS2[summary.kind]} ${named3}${notes2 === "" ? "" : ` (${notes2})`}`;
|
|
29852
30210
|
}, "refLabel");
|
|
29853
30211
|
|
|
29854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
29855
30213
|
var accountKeys = /* @__PURE__ */ __name((database, ids2) => {
|
|
29856
30214
|
const unique2 = [...new Set(ids2)];
|
|
29857
30215
|
if (unique2.length === 0)
|
|
@@ -29940,7 +30298,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
29940
30298
|
}, "refEndsOf");
|
|
29941
30299
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
29942
30300
|
|
|
29943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
29944
30302
|
var EXCERPT_CHARS = 280;
|
|
29945
30303
|
var TITLE_CHARS = 120;
|
|
29946
30304
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -30364,7 +30722,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30364
30722
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
30365
30723
|
}), "refsStoreOver");
|
|
30366
30724
|
|
|
30367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
30368
30726
|
var sourceOf3 = /* @__PURE__ */ __name((read3, ref3) => ({
|
|
30369
30727
|
ref: ref3,
|
|
30370
30728
|
kind: read3.kind,
|
|
@@ -30402,7 +30760,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
30402
30760
|
});
|
|
30403
30761
|
}, "evidenceSourcesOf");
|
|
30404
30762
|
|
|
30405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
30406
30764
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
30407
30765
|
var MAX_TEXT_CHARS = 2e6;
|
|
30408
30766
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -30428,7 +30786,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
30428
30786
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
30429
30787
|
}, "pdfPreviewLimits");
|
|
30430
30788
|
|
|
30431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30789
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
30432
30790
|
import { randomBytes } from "node:crypto";
|
|
30433
30791
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
30434
30792
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -30441,7 +30799,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
30441
30799
|
return time3 + random;
|
|
30442
30800
|
}, "ulid");
|
|
30443
30801
|
|
|
30444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30802
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
30445
30803
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
30446
30804
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
30447
30805
|
if (!meta && !sections?.length)
|
|
@@ -30462,7 +30820,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
30462
30820
|
return typeof language === "string" && language !== "" ? language : null;
|
|
30463
30821
|
}, "languageOf");
|
|
30464
30822
|
|
|
30465
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
30466
30824
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
30467
30825
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
30468
30826
|
if (isObject2(value))
|
|
@@ -30705,7 +31063,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30705
31063
|
};
|
|
30706
31064
|
}, "filesStoreOver");
|
|
30707
31065
|
|
|
30708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
30709
31067
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
30710
31068
|
entity: "document",
|
|
30711
31069
|
backend: "sql",
|
|
@@ -30751,7 +31109,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
30751
31109
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
30752
31110
|
}, "importedDocumentWhere");
|
|
30753
31111
|
|
|
30754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31112
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
30755
31113
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30756
31114
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30757
31115
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30759,7 +31117,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30759
31117
|
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
31118
|
}, "reviewLink");
|
|
30761
31119
|
|
|
30762
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31120
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
30763
31121
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30764
31122
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
30765
31123
|
var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
@@ -30792,7 +31150,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
30792
31150
|
};
|
|
30793
31151
|
}, "linkOf");
|
|
30794
31152
|
|
|
30795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
30796
31154
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
30797
31155
|
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
31156
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -30813,7 +31171,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
30813
31171
|
return changed;
|
|
30814
31172
|
}, "dateFileNotes");
|
|
30815
31173
|
|
|
30816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31174
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
30817
31175
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
30818
31176
|
const value = text8.trim();
|
|
30819
31177
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -30826,7 +31184,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
30826
31184
|
return value;
|
|
30827
31185
|
}, "oneOf");
|
|
30828
31186
|
|
|
30829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
30830
31188
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
30831
31189
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
30832
31190
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31341,7 +31699,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31341
31699
|
};
|
|
31342
31700
|
}, "notesStoreOver");
|
|
31343
31701
|
|
|
31344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31702
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
31345
31703
|
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
31704
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31347
31705
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31600,7 +31958,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31600
31958
|
};
|
|
31601
31959
|
}, "memoriesStoreOver");
|
|
31602
31960
|
|
|
31603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
31604
31962
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
31605
31963
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
31606
31964
|
throw new CliError(code, message3, { reason });
|
|
@@ -31748,7 +32106,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31748
32106
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
31749
32107
|
}, "reviewedRowsOver");
|
|
31750
32108
|
|
|
31751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
31752
32110
|
var MAX_LINES = 500;
|
|
31753
32111
|
var PARENTS = {
|
|
31754
32112
|
invoice: {
|
|
@@ -31848,7 +32206,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
31848
32206
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
31849
32207
|
}, "moneyLinesOver");
|
|
31850
32208
|
|
|
31851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
31852
32210
|
var COUNTED = {
|
|
31853
32211
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
31854
32212
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -31923,7 +32281,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
31923
32281
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
31924
32282
|
}, "refundRulesOver");
|
|
31925
32283
|
|
|
31926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
31927
32285
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
31928
32286
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
31929
32287
|
var PAID = netPaidSql("i.id");
|
|
@@ -32321,7 +32679,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32321
32679
|
};
|
|
32322
32680
|
}, "financeStoreOver");
|
|
32323
32681
|
|
|
32324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
32325
32683
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
32326
32684
|
throw new CliError("validation_error", message3, { reason });
|
|
32327
32685
|
}, "refuse");
|
|
@@ -32399,7 +32757,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32399
32757
|
};
|
|
32400
32758
|
}, "paymentEntriesOver");
|
|
32401
32759
|
|
|
32402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
32403
32761
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32404
32762
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32405
32763
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32426,7 +32784,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
32426
32784
|
return valid;
|
|
32427
32785
|
}, "validateEvidenceFindings");
|
|
32428
32786
|
|
|
32429
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32787
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
32430
32788
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32431
32789
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32432
32790
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32617,7 +32975,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32617
32975
|
};
|
|
32618
32976
|
}, "proposedActionsStoreOver");
|
|
32619
32977
|
|
|
32620
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32978
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
32621
32979
|
var CONFIRMED = "proposal";
|
|
32622
32980
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
32623
32981
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -32658,7 +33016,9 @@ var openIdentityLink = /* @__PURE__ */ __name((context, opening, index2) => writ
|
|
|
32658
33016
|
signal: opening.signal,
|
|
32659
33017
|
score: opening.score ?? null,
|
|
32660
33018
|
...opening.candidates && opening.candidates.length > 2 ? { candidates: opening.candidates.map(String) } : {},
|
|
32661
|
-
evidence: opening.evidence ?? []
|
|
33019
|
+
evidence: opening.evidence ?? [],
|
|
33020
|
+
...opening.shared === void 0 ? {} : { shared: opening.shared },
|
|
33021
|
+
...opening.mailbox === void 0 ? {} : { mailbox: opening.mailbox }
|
|
32662
33022
|
};
|
|
32663
33023
|
const action = operations.propose({
|
|
32664
33024
|
kind: IDENTITY_LINK_KIND,
|
|
@@ -32730,6 +33090,47 @@ var settleMentions = /* @__PURE__ */ __name(({ database, now: now2 }, payload, t
|
|
|
32730
33090
|
const cleared = to === "found" ? ", target_type = NULL, target_id = NULL" : "";
|
|
32731
33091
|
database.prepare(`UPDATE mentions SET status = ?${cleared}, updated_at = ? WHERE status = 'proposed' AND target_type = 'identity' AND target_id = ?`).run(to, now2(), Number(identity.id));
|
|
32732
33092
|
}, "settleMentions");
|
|
33093
|
+
var organizationExists = /* @__PURE__ */ __name(({ database }, id2) => Number.isSafeInteger(id2) && database.prepare("SELECT 1 FROM organizations WHERE id = ? AND deleted_at IS NULL").get(id2) !== void 0, "organizationExists");
|
|
33094
|
+
var toCompany = /* @__PURE__ */ __name((context, proposal, company, author, noted) => {
|
|
33095
|
+
const payload = proposal.payload;
|
|
33096
|
+
if (proposal.status !== "proposed")
|
|
33097
|
+
throw new CliError("validation_error", `${proposal.id} is already ${proposal.status}`, {
|
|
33098
|
+
reason: "proposal.wrong-state"
|
|
33099
|
+
});
|
|
33100
|
+
const address = payload.mailbox;
|
|
33101
|
+
if (payload.shared === void 0 || address === void 0)
|
|
33102
|
+
throw new CliError("validation_error", `${proposal.id} is not about a shared mailbox; confirm or reject it`, {
|
|
33103
|
+
reason: "identity.not-shared"
|
|
33104
|
+
});
|
|
33105
|
+
const name = company.name?.trim() || void 0;
|
|
33106
|
+
const domain = address.split("@")[1] ?? "";
|
|
33107
|
+
let organization2;
|
|
33108
|
+
if (company.organization !== void 0) {
|
|
33109
|
+
if (!organizationExists(context, company.organization))
|
|
33110
|
+
throw new CliError("not_found", `no organization:${company.organization}`, { reason: "organization.not-found" });
|
|
33111
|
+
organization2 = company.organization;
|
|
33112
|
+
holdAddress(context, organization2, address, { method: CONFIRMED, author: "owner" });
|
|
33113
|
+
} else {
|
|
33114
|
+
if (name === void 0 && FREE_MAIL.has(domain))
|
|
33115
|
+
throw new CliError("validation_error", `${address} is a free mailbox; name the company or its organization`, {
|
|
33116
|
+
reason: "organization.unnamed"
|
|
33117
|
+
});
|
|
33118
|
+
organization2 = organizationOfAddress(context, {
|
|
33119
|
+
name: name ?? domain,
|
|
33120
|
+
email: address,
|
|
33121
|
+
method: CONFIRMED,
|
|
33122
|
+
author: "owner",
|
|
33123
|
+
reason: "organization.ambiguous"
|
|
33124
|
+
});
|
|
33125
|
+
}
|
|
33126
|
+
const rejected2 = proposalOperationsOver(context).reject(proposal.id, author, {
|
|
33127
|
+
dismissed: true,
|
|
33128
|
+
organization: `organization:${organization2}`,
|
|
33129
|
+
...noted
|
|
33130
|
+
});
|
|
33131
|
+
settleMentions(context, payload, "found");
|
|
33132
|
+
return rejected2;
|
|
33133
|
+
}, "toCompany");
|
|
32733
33134
|
var decideIdentityLink = /* @__PURE__ */ __name((context, id2, decision) => write(context.database, () => {
|
|
32734
33135
|
const operations = proposalOperationsOver(context);
|
|
32735
33136
|
const proposal = operations.get(id2);
|
|
@@ -32739,6 +33140,11 @@ var decideIdentityLink = /* @__PURE__ */ __name((context, id2, decision) => writ
|
|
|
32739
33140
|
const author = deciderAuthor(decision.by);
|
|
32740
33141
|
const reason = decision.reason?.trim() || void 0;
|
|
32741
33142
|
const noted = reason === void 0 ? {} : { reason };
|
|
33143
|
+
if (decision.company !== void 0) {
|
|
33144
|
+
if (decision.confirm)
|
|
33145
|
+
throw new CliError("validation_error", "a company's mailbox keeps the two people apart; it is not a confirm");
|
|
33146
|
+
return toCompany(context, proposal, decision.company, author, noted);
|
|
33147
|
+
}
|
|
32742
33148
|
if (!decision.confirm) {
|
|
32743
33149
|
const rejected2 = operations.reject(id2, author, { dismissed: true, ...noted });
|
|
32744
33150
|
settleMentions(context, proposal.payload, "found");
|
|
@@ -32775,13 +33181,14 @@ var SHOWN = {
|
|
|
32775
33181
|
executed: "confirmed",
|
|
32776
33182
|
failed: "confirmed"
|
|
32777
33183
|
};
|
|
32778
|
-
var
|
|
33184
|
+
var byOrder = /* @__PURE__ */ __name((rows, order) => order !== "score" ? rows : rows.sort((a, b) => (b.payload.score ?? -1) - (a.payload.score ?? -1)), "byOrder");
|
|
33185
|
+
var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, status: status2 = "proposed", order = "newest", limit, offset }) => {
|
|
32779
33186
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 500)
|
|
32780
33187
|
throw new CliError("validation_error", "a list of link proposals takes 1\u2013500 items");
|
|
32781
33188
|
const asked = person2 === void 0 ? void 0 : currentPerson(context.database, Number(person2));
|
|
32782
33189
|
const operations = proposalOperationsOver(context);
|
|
32783
33190
|
const statuses = Object.keys(SHOWN).filter((one2) => status2 === "all" || SHOWN[one2] === status2);
|
|
32784
|
-
const rows = asked === void 0 ? linkRows(context.database, statuses, { limit: limit + 1, offset }) : linkRows(context.database, statuses).filter((row2) => row2.pair?.includes(asked) ?? false).reverse().slice(offset, offset + limit + 1);
|
|
33191
|
+
const rows = asked === void 0 ? linkRows(context.database, statuses, { limit: limit + 1, offset, order }) : byOrder(linkRows(context.database, statuses).filter((row2) => row2.pair?.includes(asked) ?? false).reverse(), order).slice(offset, offset + limit + 1);
|
|
32785
33192
|
const items = rows.slice(0, limit).map((row2) => {
|
|
32786
33193
|
const action = operations.get(row2.id);
|
|
32787
33194
|
const payload = row2.payload;
|
|
@@ -32795,6 +33202,8 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
32795
33202
|
joins: payload.joins,
|
|
32796
33203
|
signal: payload.signal,
|
|
32797
33204
|
score: payload.score,
|
|
33205
|
+
shared: payload.shared ?? null,
|
|
33206
|
+
mailbox: payload.mailbox ?? null,
|
|
32798
33207
|
candidates: (payload.candidates ?? []).map((uid) => `person:${uid}`),
|
|
32799
33208
|
reason: action.reason,
|
|
32800
33209
|
evidence: payload.evidence,
|
|
@@ -32805,7 +33214,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
32805
33214
|
return { items, hasMore: rows.length > limit };
|
|
32806
33215
|
}, "identityLinkRows");
|
|
32807
33216
|
|
|
32808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
32809
33218
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
32810
33219
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
32811
33220
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -32895,12 +33304,8 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
32895
33304
|
const chosen = [...new Map(refs.map((ref3) => [`${ref3.provider}:${ref3.id}`, ref3])).values()];
|
|
32896
33305
|
if (chosen.length === 0)
|
|
32897
33306
|
throw new CliError("validation_error", "name at least one identity to split off");
|
|
32898
|
-
|
|
32899
|
-
|
|
32900
|
-
if (row2.personPk !== person2)
|
|
32901
|
-
throw new CliError("validation_error", `${ref3.provider}:${ref3.id} is not an identity of person:${person2}`);
|
|
32902
|
-
return row2;
|
|
32903
|
-
});
|
|
33307
|
+
heldBy(context, uid, chosen);
|
|
33308
|
+
const found2 = chosen.map((ref3) => required(context, ref3));
|
|
32904
33309
|
if (found2.length === recordOf(context, person2).identities.length)
|
|
32905
33310
|
throw new CliError("validation_error", "a split leaves at least one identity with the person");
|
|
32906
33311
|
const at2 = context.now();
|
|
@@ -32912,7 +33317,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
32912
33317
|
return recordOf(context, alone);
|
|
32913
33318
|
}, "split");
|
|
32914
33319
|
|
|
32915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33320
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
|
|
32916
33321
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
32917
33322
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
32918
33323
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -32929,6 +33334,8 @@ var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
|
32929
33334
|
const chosen = [...new Map(input.identities.map((ref3) => [refOf2(ref3), ref3])).values()];
|
|
32930
33335
|
if (chosen.length === 0)
|
|
32931
33336
|
throw new CliError("validation_error", "name at least one identity to split off");
|
|
33337
|
+
if (input.from !== void 0)
|
|
33338
|
+
heldBy(context, input.from, chosen);
|
|
32932
33339
|
const persons2 = new Set(chosen.map((ref3) => required(context, ref3).personPk));
|
|
32933
33340
|
if (persons2.size > 1)
|
|
32934
33341
|
throw new CliError("validation_error", "the identities that leave are all of one person", {
|
|
@@ -33065,8 +33472,15 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
33065
33472
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33066
33473
|
}, "forgetErasedSplits");
|
|
33067
33474
|
|
|
33068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33069
|
-
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null) => Number(orm.insert(accounts).values({
|
|
33475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
33476
|
+
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
33477
|
+
provider,
|
|
33478
|
+
externalId: account,
|
|
33479
|
+
name,
|
|
33480
|
+
scope: scope3 ?? startScope ?? "personal",
|
|
33481
|
+
createdAt: now2(),
|
|
33482
|
+
updatedAt: now2()
|
|
33483
|
+
}).onConflictDoUpdate({
|
|
33070
33484
|
target: [accounts.provider, accounts.externalId],
|
|
33071
33485
|
set: {
|
|
33072
33486
|
scope: scope3 ?? sql`${accounts.scope}`,
|
|
@@ -33091,6 +33505,24 @@ var storedAccount = /* @__PURE__ */ __name(({ orm }, { provider, account }) => {
|
|
|
33091
33505
|
throw new CliError("not_found", `no ${provider} account ${account} in the store`);
|
|
33092
33506
|
return found2;
|
|
33093
33507
|
}, "storedAccount");
|
|
33508
|
+
var setAccountScope = /* @__PURE__ */ __name((context, key2, scope3) => {
|
|
33509
|
+
const { database, now: now2 } = context;
|
|
33510
|
+
const held = storedAccount(context, key2);
|
|
33511
|
+
if (held.scope === scope3)
|
|
33512
|
+
return held;
|
|
33513
|
+
database.prepare("UPDATE accounts SET scope = ?, updated_at = ? WHERE id = ?").run(scope3, now2(), held.id);
|
|
33514
|
+
database.prepare("UPDATE chunks SET scope = ? WHERE account_id = ? AND chunkable_type <> 'conversation' AND scope IN ('personal', 'work')").run(scope3, held.id);
|
|
33515
|
+
for (const [type, ids2] of [
|
|
33516
|
+
["document", "SELECT id FROM documents WHERE account_id = ?"],
|
|
33517
|
+
["email", "SELECT id FROM emails WHERE account_id = ?"],
|
|
33518
|
+
[
|
|
33519
|
+
"event",
|
|
33520
|
+
"SELECT DISTINCT ce.event_id AS id FROM calendar_entries ce JOIN calendars c ON c.id = ce.calendar_id WHERE c.account_id = ? AND ce.event_id IS NOT NULL"
|
|
33521
|
+
]
|
|
33522
|
+
])
|
|
33523
|
+
database.prepare(`INSERT OR IGNORE INTO ${type}_index_pending (indexable_type, id) SELECT '${type}', id FROM (${ids2})`).run(held.id);
|
|
33524
|
+
return { ...held, scope: scope3 };
|
|
33525
|
+
}, "setAccountScope");
|
|
33094
33526
|
var purgeAccount = /* @__PURE__ */ __name(({ orm, database, now: now2 }, accountKey) => {
|
|
33095
33527
|
const unseenBefore = unreferenced(database, "identities");
|
|
33096
33528
|
const at2 = now2();
|
|
@@ -33208,7 +33640,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
33208
33640
|
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
33641
|
}, "dropOrphanPeople");
|
|
33210
33642
|
|
|
33211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
33212
33644
|
var HISTORY_KEY = "$history";
|
|
33213
33645
|
var objectOf3 = /* @__PURE__ */ __name((text8) => {
|
|
33214
33646
|
if (typeof text8 !== "string")
|
|
@@ -33284,9 +33716,16 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
33284
33716
|
return rest;
|
|
33285
33717
|
}, "withoutHistory");
|
|
33286
33718
|
|
|
33287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
33288
33720
|
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
33721
|
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");
|
|
33722
|
+
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
33723
|
+
const pk = findChatPk(context, accountKey, chatId);
|
|
33724
|
+
if (pk === void 0)
|
|
33725
|
+
return false;
|
|
33726
|
+
revisedBy(context, "owner", () => context.database.prepare("UPDATE chats SET scope = ?, updated_at = ? WHERE id = ?").run(scope3, context.now(), pk));
|
|
33727
|
+
return true;
|
|
33728
|
+
}, "setChatScope");
|
|
33290
33729
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
33291
33730
|
accountId: accountKey,
|
|
33292
33731
|
externalId: chatId,
|
|
@@ -33430,11 +33869,11 @@ var replaceMembers = /* @__PURE__ */ __name(({ database }, chatKey, members2, at
|
|
|
33430
33869
|
var members = /* @__PURE__ */ __name(({ orm }, chatKey) => orm.select({ id: identities.externalId, name: identities.name, username: identities.username }).from(chatMembers).innerJoin(identities, eq(identities.id, chatMembers.identityId)).where(eq(chatMembers.chatId, chatKey)).orderBy(sql`${identities.name} IS NULL`, identities.name, identities.externalId).all(), "members");
|
|
33431
33870
|
var byRecency = [sql`${chats.lastMessageAt} DESC NULLS LAST`, chats.id];
|
|
33432
33871
|
var notLeft = sql`${chats.membershipState} IS NOT 'left'`;
|
|
33433
|
-
var
|
|
33434
|
-
var rejoin = /* @__PURE__ */ __name(({ orm }, accountKey, present2) => orm.update(chats).set({ membershipState: null }).where(and(eq(chats.accountId, accountKey), eq(chats.membershipState, "left"),
|
|
33872
|
+
var named2 = /* @__PURE__ */ __name((present2) => sql`${chats.externalId} IN (SELECT value FROM json_each(${JSON.stringify(present2)}))`, "named");
|
|
33873
|
+
var rejoin = /* @__PURE__ */ __name(({ orm }, accountKey, present2) => orm.update(chats).set({ membershipState: null }).where(and(eq(chats.accountId, accountKey), eq(chats.membershipState, "left"), named2(present2))).returning({ pk: chats.id }).all().length, "rejoin");
|
|
33435
33874
|
var markLeft = /* @__PURE__ */ __name((context, accountKey, present2) => {
|
|
33436
33875
|
revisedBy(context, "rejoin", () => rejoin(context, accountKey, present2));
|
|
33437
|
-
return context.orm.update(chats).set({ membershipState: "left" }).where(and(eq(chats.accountId, accountKey), notLeft, sql`NOT (${
|
|
33876
|
+
return context.orm.update(chats).set({ membershipState: "left" }).where(and(eq(chats.accountId, accountKey), notLeft, sql`NOT (${named2(present2)})`)).returning({ pk: chats.id }).all().length;
|
|
33438
33877
|
}, "markLeft");
|
|
33439
33878
|
var leftChats = /* @__PURE__ */ __name(({ orm }, accountKey) => {
|
|
33440
33879
|
const found2 = orm.select({ pk: chats.id, id: chats.externalId, title: chats.title }).from(chats).where(and(eq(chats.accountId, accountKey), eq(chats.membershipState, "left"))).all();
|
|
@@ -33575,7 +34014,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
33575
34014
|
}
|
|
33576
34015
|
}, "replaceAutoTags");
|
|
33577
34016
|
|
|
33578
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34017
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
33579
34018
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
33580
34019
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
33581
34020
|
var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
|
|
@@ -33594,7 +34033,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
33594
34033
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
33595
34034
|
}, "counterFreshness");
|
|
33596
34035
|
|
|
33597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
33598
34037
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
33599
34038
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
33600
34039
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -33634,7 +34073,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
33634
34073
|
}, "maskStoredBotTokens");
|
|
33635
34074
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
33636
34075
|
|
|
33637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34076
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
33638
34077
|
import { createHash as createHash4 } from "node:crypto";
|
|
33639
34078
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
33640
34079
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -33732,7 +34171,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
33732
34171
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
33733
34172
|
}, "contextEvidenceRequest");
|
|
33734
34173
|
|
|
33735
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34174
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
33736
34175
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
33737
34176
|
var ACTIVITY = `
|
|
33738
34177
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -33862,18 +34301,18 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
33862
34301
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
33863
34302
|
}), "mailActivity");
|
|
33864
34303
|
|
|
33865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
33866
34305
|
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
34306
|
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
34307
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
33869
34308
|
var OUTLOOK = /^(-{2,}\s*original message\s*-{2,}|-{2,}\s*исходное сообщение\s*-{2,}|from:\s.+)$/iu;
|
|
33870
34309
|
var SENT_FROM = /^(sent from my |отправлено с |enviado desde mi )/iu;
|
|
33871
34310
|
var CONTENT = /^p\.?\s?s\b|\?|(\S+\s+){8}\S/iu;
|
|
33872
|
-
var
|
|
34311
|
+
var unquoted2 = /* @__PURE__ */ __name((line) => line.replace(/^(\s*>)+\s?/, ""), "unquoted");
|
|
33873
34312
|
var squash = /* @__PURE__ */ __name((text8) => text8.toLowerCase().replace(/\s+/g, " ").trim(), "squash");
|
|
33874
|
-
var flat2 = /* @__PURE__ */ __name((text8) => squash(text8.split("\n").map(
|
|
34313
|
+
var flat2 = /* @__PURE__ */ __name((text8) => squash(text8.split("\n").map(unquoted2).join("\n")), "flat");
|
|
33875
34314
|
var alreadyHeld = /* @__PURE__ */ __name((quote3, earlier) => {
|
|
33876
|
-
const lines = quote3.map((line) => squash(
|
|
34315
|
+
const lines = quote3.map((line) => squash(unquoted2(line))).filter((line) => line.length > 0);
|
|
33877
34316
|
const total = lines.reduce((sum, line) => sum + line.length, 0);
|
|
33878
34317
|
if (total === 0)
|
|
33879
34318
|
return true;
|
|
@@ -34003,7 +34442,7 @@ var mailOwnText = /* @__PURE__ */ __name((body2) => {
|
|
|
34003
34442
|
return text8 || body2.trim();
|
|
34004
34443
|
}, "mailOwnText");
|
|
34005
34444
|
|
|
34006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34445
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
34007
34446
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
34008
34447
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
34009
34448
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -34116,7 +34555,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
34116
34555
|
return emails3 + threads;
|
|
34117
34556
|
}, "drainEmailIndex");
|
|
34118
34557
|
|
|
34119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34558
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
34120
34559
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
34121
34560
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
34122
34561
|
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 +34653,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
34214
34653
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
34215
34654
|
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
34655
|
|
|
34217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
34218
34657
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
34219
34658
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
34220
34659
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -34264,7 +34703,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
34264
34703
|
return threads.length;
|
|
34265
34704
|
}, "markEmailsRestored");
|
|
34266
34705
|
|
|
34267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34706
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
34268
34707
|
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
34708
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
34270
34709
|
WHERE p.account_id = ?
|
|
@@ -34324,7 +34763,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
34324
34763
|
}, "indexedMailPieces");
|
|
34325
34764
|
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
34765
|
|
|
34327
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34766
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
34328
34767
|
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
34768
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
34330
34769
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34391,7 +34830,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
34391
34830
|
}
|
|
34392
34831
|
}), "mailRulesOver");
|
|
34393
34832
|
|
|
34394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34833
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
34395
34834
|
function checkMeetingCancelled(signal) {
|
|
34396
34835
|
if (!signal?.aborted)
|
|
34397
34836
|
return;
|
|
@@ -34402,7 +34841,7 @@ function checkMeetingCancelled(signal) {
|
|
|
34402
34841
|
}
|
|
34403
34842
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
34404
34843
|
|
|
34405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
34406
34845
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
34407
34846
|
id: Number(row2.id),
|
|
34408
34847
|
accountId: Number(row2.account_id),
|
|
@@ -34452,7 +34891,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34452
34891
|
createdAt: Number(row2.created_at)
|
|
34453
34892
|
}), "transcriptRowOf");
|
|
34454
34893
|
|
|
34455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34894
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
34456
34895
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
34457
34896
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
34458
34897
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -34619,7 +35058,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34619
35058
|
}
|
|
34620
35059
|
}), "meetingReadsOver");
|
|
34621
35060
|
|
|
34622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
34623
35062
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
34624
35063
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
34625
35064
|
const params = [input.accountId];
|
|
@@ -34662,7 +35101,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
34662
35101
|
return { clauses, params };
|
|
34663
35102
|
}, "meetingSelectionSql");
|
|
34664
35103
|
|
|
34665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
34666
35105
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34667
35106
|
async meetingChatLines(input) {
|
|
34668
35107
|
checkMeetingCancelled(input.signal);
|
|
@@ -34690,7 +35129,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34690
35129
|
}
|
|
34691
35130
|
}), "meetingChatLinesOver");
|
|
34692
35131
|
|
|
34693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35132
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
34694
35133
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
34695
35134
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
34696
35135
|
}, "missing");
|
|
@@ -34813,7 +35252,7 @@ function meetingContextLinksOver(context) {
|
|
|
34813
35252
|
}
|
|
34814
35253
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
34815
35254
|
|
|
34816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
34817
35256
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
34818
35257
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
34819
35258
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34842,7 +35281,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
34842
35281
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
34843
35282
|
}, "indexedText");
|
|
34844
35283
|
|
|
34845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
34846
35285
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
34847
35286
|
var meetingCurrentIndexRows = `
|
|
34848
35287
|
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 +35312,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
34873
35312
|
}, "invalidateMeetingStems");
|
|
34874
35313
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
34875
35314
|
|
|
34876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
34877
35316
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
34878
35317
|
return {
|
|
34879
35318
|
async indexSearch(original) {
|
|
@@ -34941,10 +35380,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
34941
35380
|
}
|
|
34942
35381
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
34943
35382
|
|
|
34944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35383
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
34945
35384
|
import { createHash as createHash5 } from "node:crypto";
|
|
34946
35385
|
|
|
34947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/lucene/plain.js
|
|
34948
35387
|
var REPAIRED = /* @__PURE__ */ new Set([
|
|
34949
35388
|
"query.invalid-syntax",
|
|
34950
35389
|
"query.unclosed-literal",
|
|
@@ -35051,7 +35490,7 @@ var plainQuery = /* @__PURE__ */ __name((text8, fields4 = SEARCH_FIELDS) => {
|
|
|
35051
35490
|
return text8;
|
|
35052
35491
|
}, "plainQuery");
|
|
35053
35492
|
|
|
35054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35493
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
35055
35494
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
35056
35495
|
const padded = ` ${term} `;
|
|
35057
35496
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -35060,7 +35499,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
35060
35499
|
return [...pieces];
|
|
35061
35500
|
}, "trigrams");
|
|
35062
35501
|
|
|
35063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35502
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
35064
35503
|
var SHORTEST_CORRECTION = 3;
|
|
35065
35504
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
35066
35505
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -35107,7 +35546,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
35107
35546
|
return corrections;
|
|
35108
35547
|
}, "correctWords");
|
|
35109
35548
|
|
|
35110
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35549
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
35111
35550
|
var SHORTEST_GARBLED = 4;
|
|
35112
35551
|
var MOST_WIDENED = 64;
|
|
35113
35552
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -35199,7 +35638,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
35199
35638
|
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
35639
|
}, "widenWords");
|
|
35201
35640
|
|
|
35202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
35203
35642
|
import { readFileSync } from "node:fs";
|
|
35204
35643
|
var loaded;
|
|
35205
35644
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -35258,7 +35697,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
35258
35697
|
return false;
|
|
35259
35698
|
}, "knownRussianWord");
|
|
35260
35699
|
|
|
35261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35700
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
35262
35701
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
35263
35702
|
var MOST_WORDS = 128;
|
|
35264
35703
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -35514,7 +35953,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer) => {
|
|
|
35514
35953
|
return [...found2];
|
|
35515
35954
|
}, "matchedMeetingWords");
|
|
35516
35955
|
|
|
35517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35518
35957
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35519
35958
|
throw new CliError("validation_error", message3);
|
|
35520
35959
|
}, "fail");
|
|
@@ -35698,7 +36137,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35698
36137
|
}
|
|
35699
36138
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
35700
36139
|
|
|
35701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36140
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
35702
36141
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35703
36142
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
35704
36143
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -35730,7 +36169,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35730
36169
|
}
|
|
35731
36170
|
}), "meetingLanguagesOver");
|
|
35732
36171
|
|
|
35733
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
35734
36173
|
import { createHash as createHash6 } from "node:crypto";
|
|
35735
36174
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
35736
36175
|
if (value === void 0)
|
|
@@ -35820,7 +36259,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
35820
36259
|
}
|
|
35821
36260
|
}), "meetingParticipantSearchOver");
|
|
35822
36261
|
|
|
35823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
35824
36263
|
var preparationQueries = {
|
|
35825
36264
|
participants: {
|
|
35826
36265
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -35870,7 +36309,7 @@ var preparationQueries = {
|
|
|
35870
36309
|
}
|
|
35871
36310
|
};
|
|
35872
36311
|
|
|
35873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
35874
36313
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35875
36314
|
async preparationContext(original) {
|
|
35876
36315
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -35911,7 +36350,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35911
36350
|
}
|
|
35912
36351
|
}), "meetingPreparationContextOver");
|
|
35913
36352
|
|
|
35914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
35915
36354
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
35916
36355
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
35917
36356
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -35925,7 +36364,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
35925
36364
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
35926
36365
|
)`, "preparationSubjects");
|
|
35927
36366
|
|
|
35928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
35929
36368
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35930
36369
|
async preparationKnowledge(original) {
|
|
35931
36370
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -35970,7 +36409,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
35970
36409
|
}
|
|
35971
36410
|
}), "meetingPreparationKnowledgeOver");
|
|
35972
36411
|
|
|
35973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36412
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
35974
36413
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35975
36414
|
async preparationNotes(original) {
|
|
35976
36415
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36023,7 +36462,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36023
36462
|
}
|
|
36024
36463
|
}), "meetingPreparationNotesOver");
|
|
36025
36464
|
|
|
36026
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36465
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
36027
36466
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36028
36467
|
async relatedHistory(original) {
|
|
36029
36468
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -36094,7 +36533,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36094
36533
|
}
|
|
36095
36534
|
}), "meetingRelatedHistoryOver");
|
|
36096
36535
|
|
|
36097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
36098
36537
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
36099
36538
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
36100
36539
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -36175,7 +36614,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36175
36614
|
}
|
|
36176
36615
|
}), "meetingReviewOver");
|
|
36177
36616
|
|
|
36178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
36179
36618
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
36180
36619
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
36181
36620
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -36229,7 +36668,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36229
36668
|
}
|
|
36230
36669
|
}), "meetingSeriesHistoryOver");
|
|
36231
36670
|
|
|
36232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
36233
36672
|
var MOST_ROWS = 5e5;
|
|
36234
36673
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
36235
36674
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -36298,7 +36737,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36298
36737
|
}
|
|
36299
36738
|
}), "meetingStatsOver");
|
|
36300
36739
|
|
|
36301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36740
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
36302
36741
|
var CURSOR_KEY = "meetings";
|
|
36303
36742
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
36304
36743
|
id: Number(row2.id),
|
|
@@ -36867,7 +37306,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36867
37306
|
};
|
|
36868
37307
|
}, "meetingStoreOver");
|
|
36869
37308
|
|
|
36870
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
36871
37310
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
36872
37311
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
36873
37312
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -36893,7 +37332,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
36893
37332
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
36894
37333
|
}, "release");
|
|
36895
37334
|
|
|
36896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
36897
37336
|
var THREAD_COLUMNS = {
|
|
36898
37337
|
subject: {
|
|
36899
37338
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -36910,7 +37349,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
36910
37349
|
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
37350
|
}, "threadRows");
|
|
36912
37351
|
|
|
36913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37352
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
36914
37353
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
36915
37354
|
id: `email:${place.emailId}`,
|
|
36916
37355
|
chatId: place.threadExternalId,
|
|
@@ -37452,7 +37891,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
37452
37891
|
}
|
|
37453
37892
|
}), "mailStoreOver");
|
|
37454
37893
|
|
|
37455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37894
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
37456
37895
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
37457
37896
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
37458
37897
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -37542,7 +37981,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
37542
37981
|
}, "knownWord");
|
|
37543
37982
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
37544
37983
|
|
|
37545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
37546
37985
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
37547
37986
|
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
37987
|
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 +38067,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
37628
38067
|
return found2;
|
|
37629
38068
|
}, "spokenTranscripts");
|
|
37630
38069
|
|
|
37631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
37632
38071
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
37633
38072
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
37634
38073
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -37675,7 +38114,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
37675
38114
|
});
|
|
37676
38115
|
}, "placeHits");
|
|
37677
38116
|
|
|
37678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38117
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
37679
38118
|
var GROUPS = {
|
|
37680
38119
|
chat: {
|
|
37681
38120
|
key: "m.chat_id",
|
|
@@ -37697,7 +38136,7 @@ var GROUPS = {
|
|
|
37697
38136
|
}
|
|
37698
38137
|
};
|
|
37699
38138
|
|
|
37700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
37701
38140
|
var MESSAGES2 = {
|
|
37702
38141
|
rows: "messages",
|
|
37703
38142
|
threads: "chats",
|
|
@@ -38181,7 +38620,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
38181
38620
|
};
|
|
38182
38621
|
}, "runCompiled");
|
|
38183
38622
|
|
|
38184
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38623
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
38185
38624
|
function invalidMetadata() {
|
|
38186
38625
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
38187
38626
|
}
|
|
@@ -38283,7 +38722,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
38283
38722
|
};
|
|
38284
38723
|
}), "counterTargets");
|
|
38285
38724
|
|
|
38286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
38287
38726
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
38288
38727
|
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
38728
|
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 +38841,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
38402
38841
|
}));
|
|
38403
38842
|
}, "attachmentViews");
|
|
38404
38843
|
|
|
38405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
38406
38845
|
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
38846
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
38408
38847
|
const { orm, database, now: now2 } = context;
|
|
@@ -38440,7 +38879,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
38440
38879
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
38441
38880
|
}, "intoVoiceAttachment");
|
|
38442
38881
|
|
|
38443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
38444
38883
|
var FIELDS = [
|
|
38445
38884
|
"threadExternalId",
|
|
38446
38885
|
"senderIdentityId",
|
|
@@ -38759,12 +39198,12 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
38759
39198
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
38760
39199
|
}, "writeDerivedReactions");
|
|
38761
39200
|
|
|
38762
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
38763
39202
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
38764
39203
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
38765
39204
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
38766
39205
|
return {
|
|
38767
|
-
accountPk: /* @__PURE__ */ __name((key2, name = null) => accountPk(context, key2, name), "accountPk"),
|
|
39206
|
+
accountPk: /* @__PURE__ */ __name((key2, name = null, startScope) => accountPk(context, key2, name, startScope), "accountPk"),
|
|
38768
39207
|
findAccountPk: findAccountPk2,
|
|
38769
39208
|
findChatPk: findChatPk2,
|
|
38770
39209
|
chatKeyOf: /* @__PURE__ */ __name((key2, chatId) => {
|
|
@@ -38780,7 +39219,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
38780
39219
|
};
|
|
38781
39220
|
}, "keysOver");
|
|
38782
39221
|
|
|
38783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39222
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
38784
39223
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
38785
39224
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
38786
39225
|
if (!row2)
|
|
@@ -38827,156 +39266,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
38827
39266
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
38828
39267
|
}, "forgetProfile");
|
|
38829
39268
|
|
|
38830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38831
|
-
var TAKES = {
|
|
38832
|
-
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
38833
|
-
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
38834
|
-
};
|
|
38835
|
-
var article2 = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
38836
|
-
var wrongKind = /* @__PURE__ */ __name((text8, kind3, takes) => new CliError("validation_error", `${text8} names ${article2(kind3)} ${kind3}; this takes ${TAKES[takes]}`, {
|
|
38837
|
-
reason: "ref.wrong-kind"
|
|
38838
|
-
}), "wrongKind");
|
|
38839
|
-
var wrongProvider = /* @__PURE__ */ __name((text8, provider, kind3) => {
|
|
38840
|
-
const entry2 = providerNamed(provider);
|
|
38841
|
-
const command = entry2?.command;
|
|
38842
|
-
const opens = kind3 === "entity" ? void 0 : entry2?.opens?.[kind3];
|
|
38843
|
-
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text8}` : "open it with its own CLI";
|
|
38844
|
-
const label2 = providerLabel(provider);
|
|
38845
|
-
return new CliError("validation_error", `${text8} is ${article2(label2.toLowerCase())} ${label2} ${kind3}; ${how}`, {
|
|
38846
|
-
reason: "ref.wrong-provider"
|
|
38847
|
-
});
|
|
38848
|
-
}, "wrongProvider");
|
|
38849
|
-
var chatReferenceOf = /* @__PURE__ */ __name((text8, provider, takes = "chat") => {
|
|
38850
|
-
const trimmed = text8.trim();
|
|
38851
|
-
if (!looksLikeReference(trimmed))
|
|
38852
|
-
return void 0;
|
|
38853
|
-
const reference2 = parseReference(trimmed);
|
|
38854
|
-
if (reference2.type !== "chat" && reference2.type !== "message")
|
|
38855
|
-
throw wrongKind(trimmed, reference2.type, takes);
|
|
38856
|
-
if (reference2.provider !== provider)
|
|
38857
|
-
throw wrongProvider(trimmed, reference2.provider, reference2.type);
|
|
38858
|
-
const found2 = {
|
|
38859
|
-
text: trimmed,
|
|
38860
|
-
provider: reference2.provider,
|
|
38861
|
-
account: reference2.account,
|
|
38862
|
-
chat: reference2.chat,
|
|
38863
|
-
...reference2.type === "message" ? { message: reference2.message } : {}
|
|
38864
|
-
};
|
|
38865
|
-
return found2;
|
|
38866
|
-
}, "chatReferenceOf");
|
|
38867
|
-
var contactReferenceOf = /* @__PURE__ */ __name((text8, provider) => {
|
|
38868
|
-
const trimmed = text8.trim();
|
|
38869
|
-
if (!trimmed.startsWith("contact:"))
|
|
38870
|
-
return void 0;
|
|
38871
|
-
const reference2 = parseReference(trimmed);
|
|
38872
|
-
if (reference2.type !== "contact")
|
|
38873
|
-
return void 0;
|
|
38874
|
-
if (provider !== void 0 && reference2.provider !== provider)
|
|
38875
|
-
throw wrongProvider(trimmed, reference2.provider, reference2.type);
|
|
38876
|
-
return reference2.id;
|
|
38877
|
-
}, "contactReferenceOf");
|
|
38878
|
-
var wrongAccount = /* @__PURE__ */ __name((reference2, scope3, profiles) => {
|
|
38879
|
-
const here = scope3.account === void 0 ? "the account of this profile is not known yet" : `${scope3.profile === void 0 ? "this profile" : `profile ${scope3.profile}`} is account ${scope3.account}`;
|
|
38880
|
-
const others = profiles === void 0 ? "" : `. Profiles signed in to ${reference2.account}: ${profiles.length > 0 ? profiles.join(", ") : "none here"}`;
|
|
38881
|
-
return new CliError("validation_error", `${reference2.text} belongs to account ${reference2.account}; ${here}${others}`, { reason: "ref.wrong-account" });
|
|
38882
|
-
}, "wrongAccount");
|
|
38883
|
-
var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn2) => {
|
|
38884
|
-
if (scope3.account !== void 0 && scope3.account === reference2.account)
|
|
38885
|
-
return;
|
|
38886
|
-
const profiles = await profilesOn2?.(reference2.account).catch(() => void 0);
|
|
38887
|
-
throw wrongAccount(reference2, scope3, profiles);
|
|
38888
|
-
}, "ensureAccount");
|
|
38889
|
-
|
|
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
|
-
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
38892
|
-
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
38893
|
-
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
38894
|
-
const wanted = foldName(reference2.trim());
|
|
38895
|
-
const matches2 = chats2.filter((chat2) => chat2.title !== null && foldName(chat2.title).includes(wanted));
|
|
38896
|
-
if (matches2.length === 1 && matches2[0])
|
|
38897
|
-
return matches2[0];
|
|
38898
|
-
if (matches2.length === 0)
|
|
38899
|
-
throw new CliError("not_found", `no chat matches "${reference2}"`);
|
|
38900
|
-
throw ambiguous(reference2, "chats", matches2.map((chat2) => ({ id: chat2.id, title: chat2.title })), ({ title }) => singleLine(String(title)));
|
|
38901
|
-
}, "pickChat");
|
|
38902
|
-
var pickPerson = /* @__PURE__ */ __name((reference2, people2) => {
|
|
38903
|
-
const trimmed = reference2.trim();
|
|
38904
|
-
const contact = contactReferenceOf(trimmed, people2.provider);
|
|
38905
|
-
if (contact !== void 0) {
|
|
38906
|
-
const named3 = people2.get(contact);
|
|
38907
|
-
if (named3)
|
|
38908
|
-
return named3;
|
|
38909
|
-
throw new CliError("not_found", `no person ${contact} in what this account has seen`);
|
|
38910
|
-
}
|
|
38911
|
-
const known2 = people2.get(trimmed);
|
|
38912
|
-
if (known2)
|
|
38913
|
-
return known2;
|
|
38914
|
-
if (isId(trimmed))
|
|
38915
|
-
throw new CliError("not_found", `no person ${trimmed} in what this account has seen`);
|
|
38916
|
-
const wanted = foldName(trimmed.replace(/^@/, ""));
|
|
38917
|
-
const everyone = people2.all().toSorted((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
38918
|
-
const fields4 = /* @__PURE__ */ __name((person2) => [person2.alias, person2.name, person2.username].filter(isPresent).map(foldName), "fields");
|
|
38919
|
-
const exact = everyone.filter((person2) => fields4(person2).includes(wanted));
|
|
38920
|
-
const matches2 = exact.length > 0 ? exact : everyone.filter((person2) => fields4(person2).some((one2) => one2.includes(wanted)));
|
|
38921
|
-
if (matches2.length === 1 && matches2[0])
|
|
38922
|
-
return matches2[0];
|
|
38923
|
-
if (matches2.length === 0)
|
|
38924
|
-
throw new CliError("not_found", `nobody matches "${reference2}"`);
|
|
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
|
-
}, "pickPerson");
|
|
38927
|
-
var ambiguous = /* @__PURE__ */ __name((reference2, what, candidates, label2) => {
|
|
38928
|
-
const width = Math.max(...candidates.map(({ id: id2 }) => id2.length));
|
|
38929
|
-
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label2(candidate)}`).join("\n");
|
|
38930
|
-
return new CliError("validation_error", `"${singleLine(reference2)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
38931
|
-
${lines}`, { candidates });
|
|
38932
|
-
}, "ambiguous");
|
|
38933
|
-
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
38934
|
-
|
|
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
|
-
var QUOTES = [
|
|
38937
|
-
['"', '"'],
|
|
38938
|
-
["'", "'"],
|
|
38939
|
-
["\xAB", "\xBB"],
|
|
38940
|
-
["\u201C", "\u201D"],
|
|
38941
|
-
["\u201E", "\u201C"],
|
|
38942
|
-
["\u2018", "\u2019"],
|
|
38943
|
-
["`", "`"]
|
|
38944
|
-
];
|
|
38945
|
-
var READABLE = /[\p{L}\p{N}]/u;
|
|
38946
|
-
var PLACEHOLDERS = /* @__PURE__ */ new Set(["null", "undefined", "none", "\u0431\u0435\u0437 \u0438\u043C\u0435\u043D\u0438", "deleted account", "\u0443\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442"]);
|
|
38947
|
-
var unquoted2 = /* @__PURE__ */ __name((text8) => {
|
|
38948
|
-
let at2 = text8.replace(/\s+/gu, " ").trim();
|
|
38949
|
-
for (; ; ) {
|
|
38950
|
-
const pair = QUOTES.find(([open, close]) => at2.length >= 2 && at2.startsWith(open) && at2.endsWith(close));
|
|
38951
|
-
if (pair === void 0)
|
|
38952
|
-
return at2;
|
|
38953
|
-
at2 = at2.slice(pair[0].length, at2.length - pair[1].length).trim();
|
|
38954
|
-
}
|
|
38955
|
-
}, "unquoted");
|
|
38956
|
-
var given = /* @__PURE__ */ __name((value) => {
|
|
38957
|
-
const text8 = typeof value === "string" ? value.trim() : "";
|
|
38958
|
-
return text8 === "" ? void 0 : text8;
|
|
38959
|
-
}, "given");
|
|
38960
|
-
var displayName = /* @__PURE__ */ __name((name, fallbacks = {}) => {
|
|
38961
|
-
const unwrapped = typeof name === "string" ? unquoted2(name) : "";
|
|
38962
|
-
const cleaned = PLACEHOLDERS.has(unwrapped.toLowerCase()) ? "" : unwrapped;
|
|
38963
|
-
if (READABLE.test(cleaned))
|
|
38964
|
-
return cleaned;
|
|
38965
|
-
const username = given(fallbacks.username);
|
|
38966
|
-
return (username === void 0 ? void 0 : username.startsWith("@") ? username : `@${username}`) ?? given(fallbacks.phone) ?? given(fallbacks.email) ?? (cleaned === "" ? null : cleaned);
|
|
38967
|
-
}, "displayName");
|
|
38968
|
-
var nameKey = /* @__PURE__ */ __name((name) => {
|
|
38969
|
-
if (typeof name !== "string")
|
|
38970
|
-
return null;
|
|
38971
|
-
const unwrapped = unquoted2(name);
|
|
38972
|
-
if (PLACEHOLDERS.has(unwrapped.toLowerCase()))
|
|
38973
|
-
return null;
|
|
38974
|
-
const words4 = foldName(unwrapped).split(/[^\p{L}\p{N}]+/u).filter((word2) => word2 !== "");
|
|
38975
|
-
return words4.length === 0 ? null : words4.sort().join(" ");
|
|
38976
|
-
}, "nameKey");
|
|
38977
|
-
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
38978
|
-
|
|
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
|
|
39269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
|
|
38980
39270
|
var CYRILLIC_TO_LATIN = {
|
|
38981
39271
|
\u0430: "a",
|
|
38982
39272
|
\u0431: "b",
|
|
@@ -39093,140 +39383,7 @@ var spellings = /* @__PURE__ */ __name((text8) => {
|
|
|
39093
39383
|
return [.../* @__PURE__ */ new Set([folded6, LATIN.test(folded6) ? toCyrillic(folded6) : folded6])];
|
|
39094
39384
|
}, "spellings");
|
|
39095
39385
|
|
|
39096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39097
|
-
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
39098
|
-
var import_tldts = __toESM(require_cjs(), 1);
|
|
39099
|
-
var WEIGHTS = {
|
|
39100
|
-
spam_folder: 4,
|
|
39101
|
-
dmarc_fail: 3,
|
|
39102
|
-
brand_spoof: 3,
|
|
39103
|
-
young_domain: 5,
|
|
39104
|
-
reply_to_elsewhere: 1,
|
|
39105
|
-
never_opened: 2,
|
|
39106
|
-
dkim_not_passed: 2,
|
|
39107
|
-
disposable_domain: 2,
|
|
39108
|
-
bulk_never_replied: 1,
|
|
39109
|
-
replied: -5
|
|
39110
|
-
};
|
|
39111
|
-
var FRAUD_SIGNALS = ["dmarc_fail", "brand_spoof", "young_domain", "disposable_domain"];
|
|
39112
|
-
var DMARC_SINCE = "2022-01-01T00:00:00.000Z";
|
|
39113
|
-
var YOUNG_DAYS = 180;
|
|
39114
|
-
var registrableOf = /* @__PURE__ */ __name((address) => {
|
|
39115
|
-
const host = address.slice(address.lastIndexOf("@") + 1).toLowerCase();
|
|
39116
|
-
return (0, import_tldts.getDomain)(host) ?? host;
|
|
39117
|
-
}, "registrableOf");
|
|
39118
|
-
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
39119
|
-
"gmail.com",
|
|
39120
|
-
"googlemail.com",
|
|
39121
|
-
"yahoo.com",
|
|
39122
|
-
"outlook.com",
|
|
39123
|
-
"hotmail.com",
|
|
39124
|
-
"live.com",
|
|
39125
|
-
"msn.com",
|
|
39126
|
-
"icloud.com",
|
|
39127
|
-
"me.com",
|
|
39128
|
-
"aol.com",
|
|
39129
|
-
"proton.me",
|
|
39130
|
-
"protonmail.com",
|
|
39131
|
-
"gmx.com",
|
|
39132
|
-
"gmx.de",
|
|
39133
|
-
"mail.com",
|
|
39134
|
-
"yandex.ru",
|
|
39135
|
-
"ya.ru",
|
|
39136
|
-
"mail.ru",
|
|
39137
|
-
"bk.ru",
|
|
39138
|
-
"inbox.ru",
|
|
39139
|
-
"list.ru",
|
|
39140
|
-
"rambler.ru",
|
|
39141
|
-
"zoho.com"
|
|
39142
|
-
]);
|
|
39143
|
-
var BRANDS = {
|
|
39144
|
-
paypal: ["paypal"],
|
|
39145
|
-
apple: ["apple", "icloud"],
|
|
39146
|
-
microsoft: [
|
|
39147
|
-
"microsoft",
|
|
39148
|
-
"outlook",
|
|
39149
|
-
"office",
|
|
39150
|
-
"office365",
|
|
39151
|
-
"live",
|
|
39152
|
-
"hotmail",
|
|
39153
|
-
"azure",
|
|
39154
|
-
"onedrive",
|
|
39155
|
-
"microsoftadvertising"
|
|
39156
|
-
],
|
|
39157
|
-
google: ["google", "gmail", "youtube", "googlemail"],
|
|
39158
|
-
amazon: ["amazon", "amazonaws", "aws"],
|
|
39159
|
-
netflix: ["netflix"],
|
|
39160
|
-
facebook: ["facebook", "facebookmail", "meta", "fb"],
|
|
39161
|
-
instagram: ["instagram", "facebookmail"],
|
|
39162
|
-
whatsapp: ["whatsapp"],
|
|
39163
|
-
linkedin: ["linkedin"],
|
|
39164
|
-
dhl: ["dhl"],
|
|
39165
|
-
fedex: ["fedex"],
|
|
39166
|
-
docusign: ["docusign"],
|
|
39167
|
-
dropbox: ["dropbox", "dropboxmail", "hellosign"],
|
|
39168
|
-
binance: ["binance"],
|
|
39169
|
-
coinbase: ["coinbase"],
|
|
39170
|
-
revolut: ["revolut"]
|
|
39171
|
-
};
|
|
39172
|
-
var NAMES_OTHERS = /* @__PURE__ */ new Set(["coursera", "quora"]);
|
|
39173
|
-
var named2 = /* @__PURE__ */ __name((brand, text8) => new RegExp(`\\b${brand}\\b`, "i").test(text8), "named");
|
|
39174
|
-
var spoofedBrand = /* @__PURE__ */ __name((name, address) => {
|
|
39175
|
-
if (name === void 0 || address === void 0)
|
|
39176
|
-
return void 0;
|
|
39177
|
-
const label2 = registrableOf(address).split(".")[0] ?? "";
|
|
39178
|
-
if (NAMES_OTHERS.has(label2))
|
|
39179
|
-
return void 0;
|
|
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(label2)))
|
|
39182
|
-
return void 0;
|
|
39183
|
-
return Object.entries(BRANDS).find(([brand, owned]) => named2(brand, name) && !owned.includes(label2))?.[0];
|
|
39184
|
-
}, "spoofedBrand");
|
|
39185
|
-
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
39186
|
-
var youngAt = /* @__PURE__ */ __name((age, at2) => {
|
|
39187
|
-
if (age?.created === void 0)
|
|
39188
|
-
return false;
|
|
39189
|
-
const old = Date.parse(at2) - Date.parse(age.created);
|
|
39190
|
-
return old >= 0 && old < YOUNG_DAYS * DAY_MS;
|
|
39191
|
-
}, "youngAt");
|
|
39192
|
-
var most = /* @__PURE__ */ __name((items, test) => items.filter((item) => test(item)).length * 2 >= items.length, "most");
|
|
39193
|
-
var scoreGroup = /* @__PURE__ */ __name((items, context) => {
|
|
39194
|
-
const signals = [];
|
|
39195
|
-
const judged = items.filter((item) => item.headers?.auth?.dmarc !== void 0 && item.receivedAt >= DMARC_SINCE);
|
|
39196
|
-
if (most(items, (item) => item.labels?.includes("Spam")))
|
|
39197
|
-
signals.push("spam_folder");
|
|
39198
|
-
const forged = /* @__PURE__ */ __name((item) => item.headers?.auth?.dmarc === "fail" && item.headers.auth.dkim !== "pass", "forged");
|
|
39199
|
-
if (judged.length && most(judged, forged) && !judged.some((item) => item.headers?.auth?.dmarc === "pass"))
|
|
39200
|
-
signals.push("dmarc_fail");
|
|
39201
|
-
if (items.some((item) => spoofedBrand(item.headers?.fromName, item.headers?.from) !== void 0))
|
|
39202
|
-
signals.push("brand_spoof");
|
|
39203
|
-
const sender = items.find((item) => item.headers?.from !== void 0)?.headers?.from;
|
|
39204
|
-
const domain = sender === void 0 ? void 0 : registrableOf(sender);
|
|
39205
|
-
const first = items.reduce((a, b) => a.receivedAt < b.receivedAt ? a : b);
|
|
39206
|
-
if (domain !== void 0 && youngAt(context.ages.get(domain), first.receivedAt))
|
|
39207
|
-
signals.push("young_domain");
|
|
39208
|
-
if (most(items, (item) => {
|
|
39209
|
-
const { from: from2, replyTo } = item.headers ?? {};
|
|
39210
|
-
return from2 !== void 0 && replyTo !== void 0 && registrableOf(replyTo) !== registrableOf(from2);
|
|
39211
|
-
}))
|
|
39212
|
-
signals.push("reply_to_elsewhere");
|
|
39213
|
-
const known2 = items.filter((item) => item.seen !== void 0);
|
|
39214
|
-
if (known2.length && known2.every((item) => !item.seen))
|
|
39215
|
-
signals.push("never_opened");
|
|
39216
|
-
const stamped = items.filter((item) => item.headers?.auth !== void 0);
|
|
39217
|
-
if (stamped.length && most(stamped, (item) => item.headers?.auth?.dkim !== "pass"))
|
|
39218
|
-
signals.push("dkim_not_passed");
|
|
39219
|
-
if (domain !== void 0 && (0, import_disposable_email_domains_js.isDisposableEmailDomain)(domain))
|
|
39220
|
-
signals.push("disposable_domain");
|
|
39221
|
-
if (context.bulk >= 0.8 && !context.replied)
|
|
39222
|
-
signals.push("bulk_never_replied");
|
|
39223
|
-
if (context.replied)
|
|
39224
|
-
signals.push("replied");
|
|
39225
|
-
const kept2 = signals.includes("dmarc_fail") && !signals.some((signal) => signal !== "dmarc_fail" && FRAUD_SIGNALS.includes(signal)) ? signals.filter((signal) => signal !== "dmarc_fail") : signals;
|
|
39226
|
-
return { score: kept2.reduce((sum, signal) => sum + WEIGHTS[signal], 0), signals: kept2 };
|
|
39227
|
-
}, "scoreGroup");
|
|
39228
|
-
|
|
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
|
|
39386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
|
|
39230
39387
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
39231
39388
|
const found2 = /* @__PURE__ */ new Map();
|
|
39232
39389
|
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()) {
|
|
@@ -39248,7 +39405,7 @@ var companyDomain = /* @__PURE__ */ __name((address) => {
|
|
|
39248
39405
|
const domain = address.split("@")[1];
|
|
39249
39406
|
return domain === void 0 || FREE_MAIL.has(domain) || isRoleAddress(address) ? void 0 : domain;
|
|
39250
39407
|
}, "companyDomain");
|
|
39251
|
-
var tracesOf = /* @__PURE__ */ __name((database, person2) => {
|
|
39408
|
+
var tracesOf = /* @__PURE__ */ __name((database, person2, except) => {
|
|
39252
39409
|
const traces = { phones: [], emails: [], domains: [] };
|
|
39253
39410
|
for (const row2 of database.prepare("SELECT i.id, i.provider, i.external_id, i.phone, i.email FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ? AND i.provider <> 'org-email' ORDER BY i.id").all(person2)) {
|
|
39254
39411
|
const identity = Number(row2.id);
|
|
@@ -39258,7 +39415,7 @@ var tracesOf = /* @__PURE__ */ __name((database, person2) => {
|
|
|
39258
39415
|
if (stored4 !== void 0)
|
|
39259
39416
|
traces.phones.push({ identity, value: stored4 });
|
|
39260
39417
|
for (const address of [addressOf(row2.email), provider === "email" ? addressOf(row2.external_id) : void 0]) {
|
|
39261
|
-
if (address === void 0)
|
|
39418
|
+
if (address === void 0 || address === except)
|
|
39262
39419
|
continue;
|
|
39263
39420
|
traces.emails.push({ identity, value: address });
|
|
39264
39421
|
const domain = companyDomain(address);
|
|
@@ -39280,8 +39437,8 @@ function* common(a, b) {
|
|
|
39280
39437
|
}
|
|
39281
39438
|
__name(common, "common");
|
|
39282
39439
|
var commonChat = /* @__PURE__ */ __name((database, a, b) => database.prepare("SELECT m1.chat_id, m1.identity_id AS one, m2.identity_id AS other FROM identity_links l1 JOIN chat_members m1 ON m1.identity_id = l1.identity_id JOIN chat_members m2 ON m2.chat_id = m1.chat_id JOIN identity_links l2 ON l2.identity_id = m2.identity_id WHERE l1.person_id = ? AND l2.person_id = ? ORDER BY m1.chat_id LIMIT 1").get(a, b), "commonChat");
|
|
39283
|
-
function* sharedTraces(database, a, b, name) {
|
|
39284
|
-
const [one2, other] = [tracesOf(database, a), tracesOf(database, b)];
|
|
39440
|
+
function* sharedTraces(database, a, b, name, except) {
|
|
39441
|
+
const [one2, other] = [tracesOf(database, a, except), tracesOf(database, b, except)];
|
|
39285
39442
|
for (const phone of common(one2.phones, other.phones))
|
|
39286
39443
|
yield {
|
|
39287
39444
|
identity: phone[0].identity,
|
|
@@ -39323,7 +39480,7 @@ function* sharedTraces(database, a, b, name) {
|
|
|
39323
39480
|
}
|
|
39324
39481
|
__name(sharedTraces, "sharedTraces");
|
|
39325
39482
|
|
|
39326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39483
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
39327
39484
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
39328
39485
|
var PERSON_BY = {
|
|
39329
39486
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -39346,11 +39503,13 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids2) => {
|
|
|
39346
39503
|
return [...found2].sort((a, b) => a - b);
|
|
39347
39504
|
}, "personsByIdentifiers");
|
|
39348
39505
|
|
|
39349
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
39350
39507
|
var BY = "rule";
|
|
39351
39508
|
var RULE2 = { bot: "rule", kind: "rule" };
|
|
39352
39509
|
var MOST_SHARING = 6;
|
|
39353
39510
|
var CURSOR = "people.scan";
|
|
39511
|
+
var RULES = 2;
|
|
39512
|
+
var SHARED_SCORE = { alone: 0.1, name: 0.4, trace: 0.3, weakTrace: 0.2 };
|
|
39354
39513
|
var phonePairJoins = /* @__PURE__ */ __name((holders) => holders.some(({ provider }) => BARE_INTERNATIONAL_PROVIDERS.includes(provider)), "phonePairJoins");
|
|
39355
39514
|
var addressGroupJoins = /* @__PURE__ */ __name((people2) => people2 <= 2, "addressGroupJoins");
|
|
39356
39515
|
var NOT_A_BOT = "i.bot IS NOT 1 AND i.provider NOT LIKE '%-bot'";
|
|
@@ -39377,11 +39536,13 @@ var cursorNow = /* @__PURE__ */ __name((database) => ({
|
|
|
39377
39536
|
event: maxOf(database, "SELECT max(id) AS n FROM identity_link_events"),
|
|
39378
39537
|
revision: maxOf(database, "SELECT max(id) AS n FROM identity_revisions"),
|
|
39379
39538
|
participant: maxOf(database, "SELECT max(id) AS n FROM meeting_participants"),
|
|
39380
|
-
at: maxOf(database, "SELECT max(updated_at) AS n FROM identities")
|
|
39539
|
+
at: maxOf(database, "SELECT max(updated_at) AS n FROM identities"),
|
|
39540
|
+
rules: RULES
|
|
39381
39541
|
}), "cursorNow");
|
|
39382
39542
|
var savedCursor = /* @__PURE__ */ __name((database) => {
|
|
39383
39543
|
const value = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(CURSOR)?.value;
|
|
39384
|
-
|
|
39544
|
+
const cursor = value === void 0 ? void 0 : JSON.parse(String(value));
|
|
39545
|
+
return cursor?.rules === RULES ? cursor : void 0;
|
|
39385
39546
|
}, "savedCursor");
|
|
39386
39547
|
var changedSince = /* @__PURE__ */ __name((database, since) => new Set(database.prepare("SELECT id FROM identities WHERE id > ? OR updated_at > ? UNION SELECT identity_id FROM identity_link_events WHERE id > ? UNION SELECT identity_id FROM identity_revisions WHERE id > ? UNION SELECT identity_id FROM meeting_participants WHERE id > ?").all(since.identity, since.at, since.event, since.revision, since.participant).map(({ id: id2 }) => Number(id2))), "changedSince");
|
|
39387
39548
|
var holderOf = /* @__PURE__ */ __name((row2) => {
|
|
@@ -39510,14 +39671,66 @@ var samePhone = /* @__PURE__ */ __name((pass, holders) => {
|
|
|
39510
39671
|
else
|
|
39511
39672
|
proposeEachPair(pass, people2, "phone");
|
|
39512
39673
|
}, "samePhone");
|
|
39674
|
+
var nameOf2 = /* @__PURE__ */ __name(({ database }, person2) => {
|
|
39675
|
+
const name = database.prepare("SELECT name FROM persons WHERE id = ?").get(person2)?.name;
|
|
39676
|
+
return typeof name === "string" ? name : null;
|
|
39677
|
+
}, "nameOf");
|
|
39678
|
+
var TRACE_WORDS = {
|
|
39679
|
+
phone: "the same phone",
|
|
39680
|
+
email: "another address only they have",
|
|
39681
|
+
chat: "a chat they are both in",
|
|
39682
|
+
"email-domain": "mail at the same company"
|
|
39683
|
+
};
|
|
39684
|
+
var sharedMailboxCase = /* @__PURE__ */ __name((context, address, from2, to) => {
|
|
39685
|
+
const reasons = [`both have the shared mailbox ${address}`];
|
|
39686
|
+
let score = SHARED_SCORE.alone;
|
|
39687
|
+
const name = nameOf2(context, from2);
|
|
39688
|
+
const key2 = variantKey(name);
|
|
39689
|
+
if (key2 !== null && key2 === variantKey(nameOf2(context, to))) {
|
|
39690
|
+
score += SHARED_SCORE.name;
|
|
39691
|
+
reasons.push(`the same name \xAB${name}\xBB`);
|
|
39692
|
+
}
|
|
39693
|
+
let evidence = [];
|
|
39694
|
+
for (const trace of sharedTraces(context.database, from2, to, name ?? "", address))
|
|
39695
|
+
if (!(trace.kind === "email" && isRoleAddress(trace.value ?? "")) && strongEnough(context, from2, to, trace)) {
|
|
39696
|
+
score += trace.value === void 0 ? SHARED_SCORE.weakTrace : SHARED_SCORE.trace;
|
|
39697
|
+
reasons.push(TRACE_WORDS[trace.kind]);
|
|
39698
|
+
evidence = trace.evidence;
|
|
39699
|
+
break;
|
|
39700
|
+
}
|
|
39701
|
+
return { score: Math.round(score * 10) / 10, reason: reasons.join("; "), evidence };
|
|
39702
|
+
}, "sharedMailboxCase");
|
|
39703
|
+
var proposeShared = /* @__PURE__ */ __name((pass, { address, holders, shared }) => {
|
|
39704
|
+
const people2 = peopleOf(pass.context, holders);
|
|
39705
|
+
if (people2.size < 2)
|
|
39706
|
+
return;
|
|
39707
|
+
const persons2 = [...people2.keys()].sort((a, b) => a - b);
|
|
39708
|
+
for (const [at2, from2] of persons2.entries())
|
|
39709
|
+
for (const to of persons2.slice(at2 + 1))
|
|
39710
|
+
propose(pass, {
|
|
39711
|
+
identity: people2.get(from2),
|
|
39712
|
+
with: people2.get(to),
|
|
39713
|
+
from: from2,
|
|
39714
|
+
to,
|
|
39715
|
+
joins: "person",
|
|
39716
|
+
signal: "email",
|
|
39717
|
+
candidates: persons2,
|
|
39718
|
+
shared,
|
|
39719
|
+
mailbox: address,
|
|
39720
|
+
...sharedMailboxCase(pass.context, address, from2, to)
|
|
39721
|
+
});
|
|
39722
|
+
}, "proposeShared");
|
|
39513
39723
|
var sameEmail = /* @__PURE__ */ __name((pass, address, holders) => {
|
|
39514
39724
|
if (isNoReplyAddress(address))
|
|
39515
39725
|
return;
|
|
39516
39726
|
const people2 = peopleOf(pass.context, holders);
|
|
39517
39727
|
if (people2.size < 2 || tooMany(pass, people2, "identity.shared-email", "email"))
|
|
39518
39728
|
return;
|
|
39519
|
-
|
|
39520
|
-
|
|
39729
|
+
const role = isRoleAddress(address);
|
|
39730
|
+
if (role || sharedLine(pass.context, holders)) {
|
|
39731
|
+
pass.shared.push({ address, holders, shared: role ? "role" : "line" });
|
|
39732
|
+
return;
|
|
39733
|
+
}
|
|
39521
39734
|
if (!addressGroupJoins(people2.size))
|
|
39522
39735
|
return proposeEachPair(pass, people2, "email");
|
|
39523
39736
|
const contact = holders.find(({ provider }) => provider === "email");
|
|
@@ -39605,7 +39818,8 @@ var scanMatches = /* @__PURE__ */ __name((context, { full = false } = {}) => {
|
|
|
39605
39818
|
const pass = {
|
|
39606
39819
|
context,
|
|
39607
39820
|
index: linkIndex(database),
|
|
39608
|
-
result: { full: changed === void 0, merged: [], proposed: [], skipped: [] }
|
|
39821
|
+
result: { full: changed === void 0, merged: [], proposed: [], skipped: [] },
|
|
39822
|
+
shared: []
|
|
39609
39823
|
};
|
|
39610
39824
|
for (const [address, holders] of emailHolders(database))
|
|
39611
39825
|
if (holders.length > 1 && touched(holders))
|
|
@@ -39613,6 +39827,8 @@ var scanMatches = /* @__PURE__ */ __name((context, { full = false } = {}) => {
|
|
|
39613
39827
|
for (const holders of phoneHolders(database).values())
|
|
39614
39828
|
if (holders.length > 1 && touched(holders))
|
|
39615
39829
|
write(database, () => samePhone(pass, holders));
|
|
39830
|
+
for (const group of pass.shared)
|
|
39831
|
+
write(database, () => proposeShared(pass, group));
|
|
39616
39832
|
for (const row2 of guestRows(database))
|
|
39617
39833
|
if ((changed === void 0 || changed.has(row2.identity)) && !pass.index.names(row2.ref))
|
|
39618
39834
|
write(database, () => guestEmail(pass, row2));
|
|
@@ -39624,7 +39840,7 @@ var scanMatches = /* @__PURE__ */ __name((context, { full = false } = {}) => {
|
|
|
39624
39840
|
return pass.result;
|
|
39625
39841
|
}, "scanMatches");
|
|
39626
39842
|
|
|
39627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
39628
39844
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
39629
39845
|
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
39846
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -39683,7 +39899,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
39683
39899
|
return personOf2(context, ref3);
|
|
39684
39900
|
}, "linkToOwner");
|
|
39685
39901
|
|
|
39686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
39687
39903
|
var PROVIDERS_SETTING = "providers";
|
|
39688
39904
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
39689
39905
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -39699,9 +39915,9 @@ var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
|
39699
39915
|
var loadProviders = /* @__PURE__ */ __name((database) => {
|
|
39700
39916
|
useStoredProviders(storedProvidersOf(database));
|
|
39701
39917
|
}, "loadProviders");
|
|
39702
|
-
var
|
|
39918
|
+
var nameOf3 = /* @__PURE__ */ __name((stored4) => typeof stored4 === "object" && stored4 !== null ? stored4.name : void 0, "nameOf");
|
|
39703
39919
|
var keptBeside = /* @__PURE__ */ __name((entry2, stored4) => {
|
|
39704
|
-
const found2 = stored4.find((one2) =>
|
|
39920
|
+
const found2 = stored4.find((one2) => nameOf3(one2) === entry2.name);
|
|
39705
39921
|
let held;
|
|
39706
39922
|
try {
|
|
39707
39923
|
held = found2 === void 0 ? void 0 : providerEntryOf(found2);
|
|
@@ -39717,7 +39933,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39717
39933
|
write(database, () => {
|
|
39718
39934
|
const stored4 = storedProvidersOf(database);
|
|
39719
39935
|
const entry2 = keptBeside(providerEntryOf(value), stored4);
|
|
39720
|
-
const others = stored4.filter((one2) =>
|
|
39936
|
+
const others = stored4.filter((one2) => nameOf3(one2) !== entry2.name);
|
|
39721
39937
|
try {
|
|
39722
39938
|
useStoredProviders(others);
|
|
39723
39939
|
addProvider(entry2);
|
|
@@ -39731,7 +39947,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39731
39947
|
});
|
|
39732
39948
|
}, "registerProvider");
|
|
39733
39949
|
|
|
39734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
39735
39951
|
var DAY4 = 864e5;
|
|
39736
39952
|
var RECENTLY_CLOSED_MS = 14 * DAY4;
|
|
39737
39953
|
var TEXT_LIMIT = 20;
|
|
@@ -39929,7 +40145,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
39929
40145
|
};
|
|
39930
40146
|
}, "taskSimilarityOver");
|
|
39931
40147
|
|
|
39932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
39933
40149
|
var SETTING3 = "taskCategories";
|
|
39934
40150
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
39935
40151
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -39948,7 +40164,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
39948
40164
|
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
40165
|
}, "saveTaskCategories");
|
|
39950
40166
|
|
|
39951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
39952
40168
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
39953
40169
|
var ALLOWED = "taskAgentClose";
|
|
39954
40170
|
var MIN = "taskAgentCloseMin";
|
|
@@ -40004,7 +40220,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
40004
40220
|
];
|
|
40005
40221
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
40006
40222
|
|
|
40007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
40008
40224
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
40009
40225
|
var KEY = "taskFirstPassPerChat";
|
|
40010
40226
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -40024,7 +40240,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
40024
40240
|
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
40241
|
}, "saveFirstPassPerChat");
|
|
40026
40242
|
|
|
40027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
40028
40244
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
40029
40245
|
var EXTERNAL_ID_CHARS = 200;
|
|
40030
40246
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -40051,7 +40267,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
40051
40267
|
return text8;
|
|
40052
40268
|
}, "sourceUrlOf");
|
|
40053
40269
|
|
|
40054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40270
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
40055
40271
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
40056
40272
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
40057
40273
|
name,
|
|
@@ -40279,7 +40495,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
40279
40495
|
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
40496
|
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
40497
|
|
|
40282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40498
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
40283
40499
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
40284
40500
|
if (row2.author_type == null)
|
|
40285
40501
|
return null;
|
|
@@ -40307,7 +40523,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
40307
40523
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
40308
40524
|
}, "addComment");
|
|
40309
40525
|
|
|
40310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
40311
40527
|
var TASK_RELATION_KINDS = [
|
|
40312
40528
|
"blocked-by",
|
|
40313
40529
|
"follow-up-of",
|
|
@@ -40437,7 +40653,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
40437
40653
|
};
|
|
40438
40654
|
}, "taskRelationsStoreOver");
|
|
40439
40655
|
|
|
40440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
40441
40657
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
40442
40658
|
var iso8 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
40443
40659
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at2) => {
|
|
@@ -40966,7 +41182,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
40966
41182
|
};
|
|
40967
41183
|
}, "workTasksOver");
|
|
40968
41184
|
|
|
40969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41185
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
40970
41186
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
40971
41187
|
const { database, now: now2 } = context;
|
|
40972
41188
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -41015,7 +41231,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
41015
41231
|
};
|
|
41016
41232
|
}, "taskCloseOver");
|
|
41017
41233
|
|
|
41018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
41019
41235
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
41020
41236
|
const { database, now: now2 } = context;
|
|
41021
41237
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -41233,7 +41449,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
41233
41449
|
};
|
|
41234
41450
|
}, "taskPairsOver");
|
|
41235
41451
|
|
|
41236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
41237
41453
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
41238
41454
|
var TASK_STATS_SQL = {
|
|
41239
41455
|
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 +41488,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
41272
41488
|
}, "statNames")
|
|
41273
41489
|
}), "taskStatsOver");
|
|
41274
41490
|
|
|
41275
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41491
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
41276
41492
|
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
41493
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
41278
41494
|
const key2 = inboxKey(account);
|
|
@@ -41390,7 +41606,12 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41390
41606
|
const key2 = typedKey(database, task.kind);
|
|
41391
41607
|
const author = actorOfOrigin(database, task.origin);
|
|
41392
41608
|
const closedBy = task.closedBy ? actorOfOrigin(database, task.closedBy) : void 0;
|
|
41393
|
-
const
|
|
41609
|
+
const title = displayTitleOf(database, {
|
|
41610
|
+
type: task.kind,
|
|
41611
|
+
title: `${task.kind} \u2014 ${task.source}`,
|
|
41612
|
+
source_locator: task.source
|
|
41613
|
+
});
|
|
41614
|
+
const made = database.prepare("INSERT INTO tasks (project_id, number, key, title, type, status, due_at, closed_at, closed_by_type, closed_by_id, close_reason, author_type, author_id, source, package_id, source_locator, source_kind, source_group, created_at, updated_at, title_folded, close_reason_folded, category) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(project2, number3, key2, title, task.kind, task.state, time(task.dueAt), time(task.closedAt), closedBy?.type ?? null, closedBy?.id ?? null, task.reason ?? null, author.type, author.id, task.origin, task.id, task.source, task.sourceKind, task.group, task.createdAt.getTime(), now2(), folded4(title), folded4(task.reason), task.category ?? null);
|
|
41394
41615
|
recordTaskEvent(database, Number(made?.id), author, "created", null, task.createdAt.getTime());
|
|
41395
41616
|
});
|
|
41396
41617
|
}, "insert"),
|
|
@@ -41479,14 +41700,14 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
41479
41700
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
41480
41701
|
}, "oneOf");
|
|
41481
41702
|
|
|
41482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41703
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
41483
41704
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
41484
41705
|
const { database } = context;
|
|
41485
41706
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
41486
41707
|
return {
|
|
41487
|
-
saveAccount: /* @__PURE__ */ __name(async (key2, { name }) => {
|
|
41708
|
+
saveAccount: /* @__PURE__ */ __name(async (key2, { name, scope: scope3 }) => {
|
|
41488
41709
|
const pk = write(database, () => {
|
|
41489
|
-
const made = accountPk2(key2, name);
|
|
41710
|
+
const made = accountPk2(key2, name, scope3);
|
|
41490
41711
|
linkInbox(database, `${key2.provider}:${key2.account}`, made);
|
|
41491
41712
|
return made;
|
|
41492
41713
|
});
|
|
@@ -41510,6 +41731,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
41510
41731
|
...keyed,
|
|
41511
41732
|
accounts: /* @__PURE__ */ __name(async () => heldAccounts(context), "accounts"),
|
|
41512
41733
|
storedAccounts: /* @__PURE__ */ __name(async () => storedAccounts(context), "storedAccounts"),
|
|
41734
|
+
setScope: /* @__PURE__ */ __name(async (key2, scope3) => write(database, () => setAccountScope(context, key2, scope3)), "setScope"),
|
|
41513
41735
|
accountGroups: /* @__PURE__ */ __name(async () => accountGroupsOf(database), "accountGroups"),
|
|
41514
41736
|
profiles: /* @__PURE__ */ __name(async () => profilesOf(database), "profiles"),
|
|
41515
41737
|
saveProfile: /* @__PURE__ */ __name(async (app, profile, key2) => write(database, () => saveProfile(database, app, profile, key2, context.now())), "saveProfile"),
|
|
@@ -41540,7 +41762,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
41540
41762
|
};
|
|
41541
41763
|
}, "accountsStoreOver");
|
|
41542
41764
|
|
|
41543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
41544
41766
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
41545
41767
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
41546
41768
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -41564,7 +41786,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
41564
41786
|
})), "keepDownloads");
|
|
41565
41787
|
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
41788
|
|
|
41567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41789
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
41568
41790
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
41569
41791
|
const { database } = context;
|
|
41570
41792
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -41621,7 +41843,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41621
41843
|
}, "keepAttachmentText")
|
|
41622
41844
|
}), "attachmentsStoreOver");
|
|
41623
41845
|
|
|
41624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
41625
41847
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
41626
41848
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
41627
41849
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -41806,7 +42028,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
41806
42028
|
return done;
|
|
41807
42029
|
}, "rekeyChats");
|
|
41808
42030
|
|
|
41809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
41810
42032
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
41811
42033
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
41812
42034
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -41864,7 +42086,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
41864
42086
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
41865
42087
|
}, "chatCoverage");
|
|
41866
42088
|
|
|
41867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42089
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
41868
42090
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41869
42091
|
const { database } = context;
|
|
41870
42092
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -41888,6 +42110,12 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41888
42110
|
const accountKey = findAccountPk2(key2);
|
|
41889
42111
|
return accountKey === void 0 ? [] : chatsWith(context, accountKey, key2, memberId);
|
|
41890
42112
|
}, "chatsWith"),
|
|
42113
|
+
setChatScope: /* @__PURE__ */ __name(async (key2, chatId, scope3) => {
|
|
42114
|
+
const accountKey = findAccountPk2(key2);
|
|
42115
|
+
if (accountKey === void 0)
|
|
42116
|
+
return false;
|
|
42117
|
+
return write(database, () => setChatScope(context, accountKey, chatId, scope3));
|
|
42118
|
+
}, "setChatScope"),
|
|
41891
42119
|
chatScopes: /* @__PURE__ */ __name(async (key2, chatIds) => {
|
|
41892
42120
|
const accountKey = findAccountPk2(key2);
|
|
41893
42121
|
return accountKey === void 0 ? /* @__PURE__ */ new Map() : chatScopes(context, accountKey, chatIds);
|
|
@@ -42003,7 +42231,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42003
42231
|
};
|
|
42004
42232
|
}, "chatsStoreOver");
|
|
42005
42233
|
|
|
42006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
42007
42235
|
import { createHash as createHash7 } from "node:crypto";
|
|
42008
42236
|
var BATCH_CONTEXT = 50;
|
|
42009
42237
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -42141,7 +42369,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
42141
42369
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
42142
42370
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
42143
42371
|
|
|
42144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
42145
42373
|
import { setTimeout } from "node:timers/promises";
|
|
42146
42374
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
42147
42375
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -42453,7 +42681,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
42453
42681
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
42454
42682
|
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
42683
|
|
|
42456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42684
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
42457
42685
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
42458
42686
|
const { database } = context;
|
|
42459
42687
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42560,7 +42788,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42560
42788
|
};
|
|
42561
42789
|
}, "conversationsStoreOver");
|
|
42562
42790
|
|
|
42563
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
42564
42792
|
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
42793
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
42566
42794
|
const { database } = context;
|
|
@@ -42585,7 +42813,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42585
42813
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
42586
42814
|
}), "countersStoreOver");
|
|
42587
42815
|
|
|
42588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
42589
42817
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
42590
42818
|
var MENTION_QUERY = defineQuery({
|
|
42591
42819
|
entity: "mention",
|
|
@@ -42804,7 +43032,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
42804
43032
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
42805
43033
|
}, "listPlaces");
|
|
42806
43034
|
|
|
42807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
42808
43036
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
42809
43037
|
const { database } = context;
|
|
42810
43038
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42839,7 +43067,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42839
43067
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
42840
43068
|
}), "mentionsStoreOver");
|
|
42841
43069
|
|
|
42842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
42843
43071
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
42844
43072
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
42845
43073
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -42938,7 +43166,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
42938
43166
|
});
|
|
42939
43167
|
}, "waitingChats");
|
|
42940
43168
|
|
|
42941
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43169
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
|
|
42942
43170
|
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
43171
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
42944
43172
|
const statement = database.prepare(SQL);
|
|
@@ -42958,7 +43186,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
42958
43186
|
return found2;
|
|
42959
43187
|
}, "chatActivityCounts");
|
|
42960
43188
|
|
|
42961
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
42962
43190
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
42963
43191
|
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");
|
|
42964
43192
|
const rows = messageId === void 0 ? read3.all(chatKey) : read3.all(chatKey, messageId);
|
|
@@ -42973,7 +43201,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
42973
43201
|
}));
|
|
42974
43202
|
}, "documentLinkMessages");
|
|
42975
43203
|
|
|
42976
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
42977
43205
|
var stemmerFor = stemmerCache();
|
|
42978
43206
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
42979
43207
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -43017,7 +43245,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
43017
43245
|
});
|
|
43018
43246
|
}, "laterSharingRare");
|
|
43019
43247
|
|
|
43020
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
43021
43249
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
43022
43250
|
const { database } = context;
|
|
43023
43251
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -43158,7 +43386,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43158
43386
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
43159
43387
|
}), "messagesStoreOver");
|
|
43160
43388
|
|
|
43161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
|
|
43162
43390
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted"];
|
|
43163
43391
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
43164
43392
|
"noreply",
|
|
@@ -43221,7 +43449,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
43221
43449
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
43222
43450
|
}, "isCompanyName");
|
|
43223
43451
|
|
|
43224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
|
|
43225
43453
|
var SMALL_GROUP_MEMBERS = 10;
|
|
43226
43454
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
43227
43455
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
@@ -43276,7 +43504,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
43276
43504
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
43277
43505
|
}, "shownReasons");
|
|
43278
43506
|
|
|
43279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43507
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
|
|
43280
43508
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
43281
43509
|
var MIN_QUERY = 3;
|
|
43282
43510
|
var ftsPhrase = /* @__PURE__ */ __name((text8) => `"${text8.replaceAll('"', '""')}"`, "ftsPhrase");
|
|
@@ -43299,7 +43527,7 @@ var scopeParams = /* @__PURE__ */ __name((scope3) => scope3 === "all" ? [] : [JS
|
|
|
43299
43527
|
var SCOPED_IDENTITIES = /* @__PURE__ */ __name((scope3) => `SELECT identity_id FROM identity_links WHERE ${IN_SCOPE(scope3, "person_id")}`, "SCOPED_IDENTITIES");
|
|
43300
43528
|
var MESSAGE_COUNTS = /* @__PURE__ */ __name((scope3) => `SELECT l.person_id AS person, sum(x.n) AS n FROM (SELECT sender_identity_id AS identity, count(*) AS n FROM messages WHERE sender_identity_id ${scope3 === "all" ? "IS NOT NULL" : `IN (${SCOPED_IDENTITIES(scope3)})`} GROUP BY 1) x JOIN identity_links l ON l.identity_id = x.identity GROUP BY 1`, "MESSAGE_COUNTS");
|
|
43301
43529
|
var MAIL_COUNTS = /* @__PURE__ */ __name((scope3) => `SELECT l.person_id AS person, count(*) AS n, sum(EXISTS (SELECT 1 FROM email_mailboxes m JOIN mailboxes b ON b.id = m.mailbox_id WHERE m.email_id = e.id AND b.kind = 'bulk')) AS bulk FROM emails e JOIN identity_links l ON l.identity_id = e.from_identity_id WHERE e.outgoing IS NOT 1 AND e.deleted_at IS NULL AND ${IN_SCOPE(scope3, "l.person_id")} GROUP BY 1`, "MAIL_COUNTS");
|
|
43302
|
-
var IDENTITIES = /* @__PURE__ */ __name((scope3) => `SELECT l.person_id AS person, i.id, i.provider, i.external_id, i.username, i.phone, i.email, i.bot FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE ${IN_SCOPE(scope3, "l.person_id")} ORDER BY i.id`, "IDENTITIES");
|
|
43530
|
+
var IDENTITIES = /* @__PURE__ */ __name((scope3) => `SELECT l.person_id AS person, i.id, i.provider, i.external_id, i.name, i.username, i.phone, i.email, i.bot FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE ${IN_SCOPE(scope3, "l.person_id")} ORDER BY i.id`, "IDENTITIES");
|
|
43303
43531
|
var NEVER_REPLIED = "SELECT identity_id FROM account_identities WHERE mail_signals LIKE '%bulk_never_replied%'";
|
|
43304
43532
|
var OWNED = "SELECT identity_id FROM organization_identities";
|
|
43305
43533
|
var LAST_CONTACTS = /* @__PURE__ */ __name((identities2) => `SELECT l.person_id AS person, max(t) AS at FROM (SELECT sender_identity_id AS identity, max(sent_at) AS t FROM messages WHERE sender_identity_id IN (${identities2}) AND deleted_at IS NULL GROUP BY 1 UNION ALL SELECT from_identity_id, max(coalesce(sent_at, received_at)) FROM emails WHERE from_identity_id IN (${identities2}) AND deleted_at IS NULL GROUP BY 1 UNION ALL SELECT identity_id, max(last_messaged_at) FROM account_identities WHERE identity_id IN (${identities2}) GROUP BY 1) x JOIN identity_links l ON l.identity_id = x.identity GROUP BY 1`, "LAST_CONTACTS");
|
|
@@ -43312,6 +43540,7 @@ var factsOf2 = /* @__PURE__ */ __name((database, scope3) => {
|
|
|
43312
43540
|
for (const row2 of database.prepare(IDENTITIES(scope3)).all(...scopeParams(scope3))) {
|
|
43313
43541
|
const person2 = Number(row2.person);
|
|
43314
43542
|
const one2 = facts2.get(person2) ?? {
|
|
43543
|
+
name: null,
|
|
43315
43544
|
username: null,
|
|
43316
43545
|
usernameSource: null,
|
|
43317
43546
|
phone: null,
|
|
@@ -43322,6 +43551,9 @@ var factsOf2 = /* @__PURE__ */ __name((database, scope3) => {
|
|
|
43322
43551
|
organization: false
|
|
43323
43552
|
};
|
|
43324
43553
|
const email = text8(row2.email) ?? (row2.provider === "email" ? text8(row2.external_id) : null);
|
|
43554
|
+
const named3 = displayName(text8(row2.name));
|
|
43555
|
+
if (one2.name === null && isReadable(named3) && !named3?.startsWith("@"))
|
|
43556
|
+
one2.name = named3;
|
|
43325
43557
|
if (one2.username === null && text8(row2.username) !== null) {
|
|
43326
43558
|
one2.username = text8(row2.username);
|
|
43327
43559
|
one2.usernameSource = String(row2.provider);
|
|
@@ -43375,7 +43607,7 @@ var classified = /* @__PURE__ */ __name((database, people2, scope3, reasons = sh
|
|
|
43375
43607
|
return people2.map(({ id: id2, name, owner }) => {
|
|
43376
43608
|
const own = facts2.get(id2);
|
|
43377
43609
|
const contact = { username: own?.username ?? null, phone: own?.phone ?? null, email: own?.email ?? null };
|
|
43378
|
-
const shown2 = displayName(name, contact);
|
|
43610
|
+
const shown2 = displayName(name, { ...contact, name: own?.name ?? null });
|
|
43379
43611
|
const ties = reasons.get(id2) ?? [];
|
|
43380
43612
|
const { kind: kind3, signals } = kindOf2(shown2, own, ties, mail.get(id2));
|
|
43381
43613
|
return {
|
|
@@ -43405,7 +43637,7 @@ var withLastContact = /* @__PURE__ */ __name((database, people2, known2) => {
|
|
|
43405
43637
|
}, "withLastContact");
|
|
43406
43638
|
var nameOrderOf = /* @__PURE__ */ __name((shown2) => `${isReadable(shown2) ? 0 : 1}${fold(shown2 ?? "")}`, "nameOrderOf");
|
|
43407
43639
|
var byName = /* @__PURE__ */ __name((a, b) => a.nameOrder < b.nameOrder ? -1 : a.nameOrder > b.nameOrder ? 1 : a.id - b.id, "byName");
|
|
43408
|
-
var KIND_RULES = "
|
|
43640
|
+
var KIND_RULES = "3";
|
|
43409
43641
|
var RULES_KEY = "people.kind_rules";
|
|
43410
43642
|
var WHOLE_PASS = 2e4;
|
|
43411
43643
|
var UNDER_LOCK = 5e3;
|
|
@@ -43583,7 +43815,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
43583
43815
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
43584
43816
|
}, "similarPeople");
|
|
43585
43817
|
|
|
43586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/test-data.js
|
|
43587
43819
|
var SEED_PEOPLE = [
|
|
43588
43820
|
{ name: "Owner", username: "owner" },
|
|
43589
43821
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -43600,7 +43832,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
43600
43832
|
];
|
|
43601
43833
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
43602
43834
|
|
|
43603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
|
|
43604
43836
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
43605
43837
|
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";
|
|
43606
43838
|
var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -43748,10 +43980,10 @@ var movesOf = /* @__PURE__ */ __name((context, found2) => {
|
|
|
43748
43980
|
}
|
|
43749
43981
|
const rest = found2.held.filter(({ ref: ref3 }) => !unmerged.has(ref3));
|
|
43750
43982
|
for (const group of nameGroups(rest))
|
|
43751
|
-
moves.push({ op: "unlink", identities: group.map(({ ref: ref3 }) => ref3) });
|
|
43983
|
+
moves.push({ op: "unlink", identities: group.map(({ ref: ref3 }) => ref3), from: `person:${found2.person}` });
|
|
43752
43984
|
return moves;
|
|
43753
43985
|
}, "movesOf");
|
|
43754
|
-
var commandOf = /* @__PURE__ */ __name((move2) => move2.op === "unmerge" ? `people unmerge ${move2.merge}` : `people unlink ${move2.identities.map(shellWord).join(" ")}`, "commandOf");
|
|
43986
|
+
var commandOf = /* @__PURE__ */ __name((move2) => move2.op === "unmerge" ? `people unmerge ${move2.merge}` : `people unlink ${move2.identities.map(shellWord).join(" ")} --from ${move2.from}`, "commandOf");
|
|
43755
43987
|
var shellWord = /* @__PURE__ */ __name((ref3) => /^[\w@.:+/=-]+$/u.test(ref3) ? ref3 : `'${ref3.replaceAll("'", "'\\''")}'`, "shellWord");
|
|
43756
43988
|
var shown = /* @__PURE__ */ __name((context, found2) => {
|
|
43757
43989
|
const moves = movesOf(context, found2);
|
|
@@ -43790,7 +44022,7 @@ var personDoubts = /* @__PURE__ */ __name((context, { limit, offset }) => {
|
|
|
43790
44022
|
};
|
|
43791
44023
|
}, "personDoubts");
|
|
43792
44024
|
|
|
43793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44025
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
43794
44026
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
43795
44027
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
43796
44028
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -43859,7 +44091,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
43859
44091
|
});
|
|
43860
44092
|
}, "personPreparation");
|
|
43861
44093
|
|
|
43862
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
43863
44095
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
43864
44096
|
const id2 = Number(uid);
|
|
43865
44097
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -43867,7 +44099,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
43867
44099
|
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)));
|
|
43868
44100
|
}, "personSeenInAccounts");
|
|
43869
44101
|
|
|
43870
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
43871
44103
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
43872
44104
|
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);
|
|
43873
44105
|
if (!row2)
|
|
@@ -43934,7 +44166,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
43934
44166
|
return { id: id2, personId, removed: true };
|
|
43935
44167
|
}, "removeNote");
|
|
43936
44168
|
|
|
43937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44169
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
43938
44170
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
43939
44171
|
const { database } = context;
|
|
43940
44172
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -44053,13 +44285,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
44053
44285
|
};
|
|
44054
44286
|
}, "peopleStoreOver");
|
|
44055
44287
|
|
|
44056
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
44057
44289
|
import { createHash as createHash9 } from "node:crypto";
|
|
44058
44290
|
|
|
44059
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
44060
44292
|
import { createHash as createHash8 } from "node:crypto";
|
|
44061
44293
|
|
|
44062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
44063
44295
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
44064
44296
|
var AUTHOR_MEASURES = [
|
|
44065
44297
|
"messages",
|
|
@@ -44199,7 +44431,7 @@ var withoutUrls = /* @__PURE__ */ __name((text8) => text8.replace(/\S+/gu, (toke
|
|
|
44199
44431
|
var rankingWords = /* @__PURE__ */ __name((text8) => withoutUrls(text8).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
44200
44432
|
var rankingQuestion = /* @__PURE__ */ __name((text8) => withoutUrls(text8).includes("?"), "rankingQuestion");
|
|
44201
44433
|
|
|
44202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44434
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
44203
44435
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
44204
44436
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
44205
44437
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -44421,7 +44653,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
44421
44653
|
};
|
|
44422
44654
|
}, "rankReplyGraph");
|
|
44423
44655
|
|
|
44424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
44425
44657
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
44426
44658
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
44427
44659
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -44595,7 +44827,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
44595
44827
|
return { items, evidence, summary, graph: graph.quality };
|
|
44596
44828
|
}, "calculateAdminStatistics");
|
|
44597
44829
|
|
|
44598
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
44599
44831
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
44600
44832
|
const dates = [];
|
|
44601
44833
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -44617,7 +44849,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
44617
44849
|
return dates[0].node.resolution.date;
|
|
44618
44850
|
}, "rankingContextRange");
|
|
44619
44851
|
|
|
44620
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
44621
44853
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
44622
44854
|
let counts;
|
|
44623
44855
|
try {
|
|
@@ -44912,7 +45144,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
44912
45144
|
});
|
|
44913
45145
|
}, "rankQuery");
|
|
44914
45146
|
|
|
44915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
44916
45148
|
function fail2(message3, reason = "query.too-large") {
|
|
44917
45149
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
44918
45150
|
}
|
|
@@ -45089,7 +45321,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
45089
45321
|
return result;
|
|
45090
45322
|
}), "adminStatisticsQuery");
|
|
45091
45323
|
|
|
45092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45324
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
45093
45325
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
45094
45326
|
if (!execution.accounts.length)
|
|
45095
45327
|
return { conversations: [], chats: [] };
|
|
@@ -45107,7 +45339,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
45107
45339
|
return { conversations: conversations2, chats: chats2 };
|
|
45108
45340
|
}, "conversationEligibility");
|
|
45109
45341
|
|
|
45110
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
45111
45343
|
import { createHash as createHash10 } from "node:crypto";
|
|
45112
45344
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
45113
45345
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -45257,7 +45489,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
45257
45489
|
return result;
|
|
45258
45490
|
}, "rankingEvidence");
|
|
45259
45491
|
|
|
45260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
45261
45493
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
45262
45494
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
45263
45495
|
if (execution.corpus === "mail")
|
|
@@ -45278,7 +45510,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
45278
45510
|
};
|
|
45279
45511
|
}, "queriesStoreOver");
|
|
45280
45512
|
|
|
45281
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45513
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
45282
45514
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
45283
45515
|
const { database, now: now2 } = context;
|
|
45284
45516
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -45317,10 +45549,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
45317
45549
|
}));
|
|
45318
45550
|
}, "chatEventsOf");
|
|
45319
45551
|
|
|
45320
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45552
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
45321
45553
|
import { createHash as createHash11 } from "node:crypto";
|
|
45322
45554
|
|
|
45323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
45324
45556
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
45325
45557
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
45326
45558
|
timeZone: zone,
|
|
@@ -45340,7 +45572,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
45340
45572
|
return date3.toISOString().slice(0, 10);
|
|
45341
45573
|
}, "weekKey");
|
|
45342
45574
|
|
|
45343
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
45344
45576
|
var RETENTION_TOLERANCE = 864e5;
|
|
45345
45577
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
45346
45578
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -45394,7 +45626,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
45394
45626
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
45395
45627
|
}, "retentionCohorts");
|
|
45396
45628
|
|
|
45397
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45629
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
45398
45630
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
45399
45631
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
45400
45632
|
validateRetentionOptions(options);
|
|
@@ -45525,7 +45757,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
45525
45757
|
};
|
|
45526
45758
|
}, "retentionQuery");
|
|
45527
45759
|
|
|
45528
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
45529
45761
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
45530
45762
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
45531
45763
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -45654,7 +45886,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
45654
45886
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
45655
45887
|
})), "trackedChats");
|
|
45656
45888
|
|
|
45657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45889
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
45658
45890
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45659
45891
|
const { database } = context;
|
|
45660
45892
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -45710,7 +45942,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45710
45942
|
};
|
|
45711
45943
|
}, "rosterStoreOver");
|
|
45712
45944
|
|
|
45713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45945
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
45714
45946
|
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");
|
|
45715
45947
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
45716
45948
|
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 ?`);
|
|
@@ -45734,7 +45966,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
45734
45966
|
}
|
|
45735
45967
|
}, "backfillNormalized");
|
|
45736
45968
|
|
|
45737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45969
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
45738
45970
|
var INDEX2 = "message_words";
|
|
45739
45971
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
45740
45972
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -45861,7 +46093,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
45861
46093
|
});
|
|
45862
46094
|
}, "resetSearchIndex");
|
|
45863
46095
|
|
|
45864
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46096
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
45865
46097
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
45866
46098
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
45867
46099
|
const before2 = stemsState(database);
|
|
@@ -45956,7 +46188,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
45956
46188
|
return resetStems(database, { now: now2 });
|
|
45957
46189
|
}, "followDefaultStemmers");
|
|
45958
46190
|
|
|
45959
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
45960
46192
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
45961
46193
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
45962
46194
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -45978,7 +46210,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
45978
46210
|
});
|
|
45979
46211
|
}, "termCandidates");
|
|
45980
46212
|
|
|
45981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
45982
46214
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45983
46215
|
const { database } = context;
|
|
45984
46216
|
const stemmerFor2 = stemmerCache();
|
|
@@ -46002,7 +46234,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46002
46234
|
};
|
|
46003
46235
|
}, "searchIndexStoreOver");
|
|
46004
46236
|
|
|
46005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
46006
46238
|
var HISTORY_KEPT = 1e3;
|
|
46007
46239
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
46008
46240
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -46071,7 +46303,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
46071
46303
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
46072
46304
|
}, "clearHistory");
|
|
46073
46305
|
|
|
46074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
46075
46307
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46076
46308
|
const { database } = context;
|
|
46077
46309
|
return {
|
|
@@ -46095,7 +46327,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46095
46327
|
};
|
|
46096
46328
|
}, "searchesStoreOver");
|
|
46097
46329
|
|
|
46098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46330
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
46099
46331
|
import { createHash as createHash12 } from "node:crypto";
|
|
46100
46332
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
46101
46333
|
var sha256 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(value).digest("hex"), "sha256");
|
|
@@ -46307,7 +46539,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46307
46539
|
};
|
|
46308
46540
|
}, "addedSourcesOver");
|
|
46309
46541
|
|
|
46310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
46311
46543
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
46312
46544
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
46313
46545
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -46350,7 +46582,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
46350
46582
|
};
|
|
46351
46583
|
}, "agentActionsStoreOver");
|
|
46352
46584
|
|
|
46353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
46354
46586
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
46355
46587
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
46356
46588
|
if (typeof value !== "string")
|
|
@@ -46396,7 +46628,7 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
46396
46628
|
}
|
|
46397
46629
|
}, "suggestBaseStages");
|
|
46398
46630
|
|
|
46399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
46400
46632
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
46401
46633
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cutoff) => {
|
|
46402
46634
|
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);
|
|
@@ -46413,7 +46645,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cuto
|
|
|
46413
46645
|
});
|
|
46414
46646
|
}, "stageAmountsOf");
|
|
46415
46647
|
|
|
46416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
46417
46649
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
46418
46650
|
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");
|
|
46419
46651
|
var MAX_STAGES = 30;
|
|
@@ -46778,7 +47010,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46778
47010
|
};
|
|
46779
47011
|
}, "dealsStoreOver");
|
|
46780
47012
|
|
|
46781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47013
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
46782
47014
|
var KEY2 = "ownerLanguages";
|
|
46783
47015
|
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(" "));
|
|
46784
47016
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -46808,7 +47040,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
46808
47040
|
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);
|
|
46809
47041
|
}, "saveOwnerLanguages");
|
|
46810
47042
|
|
|
46811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47043
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
46812
47044
|
var OUTCOMES = {
|
|
46813
47045
|
lead: ["open", "open", "open", "won", "lost"],
|
|
46814
47046
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -46910,7 +47142,7 @@ var baseStagesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46910
47142
|
return row2;
|
|
46911
47143
|
}, "baseStageRow");
|
|
46912
47144
|
const stageNames = /* @__PURE__ */ __name((pipeline) => baseStagesOf(database, pipeline).map((stage) => `${stage.name} (${stageRef(stage.id)})`).join(", "), "stageNames");
|
|
46913
|
-
const
|
|
47145
|
+
const nameOf4 = /* @__PURE__ */ __name((value) => text3(value, "a stage's name", 80, "stage.base-field") ?? refuse("a stage needs a name", "stage.base-field"), "nameOf");
|
|
46914
47146
|
const unique2 = /* @__PURE__ */ __name((pipeline, name, except) => {
|
|
46915
47147
|
const held = database.prepare("SELECT id FROM pipeline_stages WHERE pipeline_id = ? AND name_folded = ?").get(pipeline, fold(name));
|
|
46916
47148
|
if (held && Number(held.id) !== except)
|
|
@@ -47006,7 +47238,7 @@ var baseStagesOver = /* @__PURE__ */ __name((context) => {
|
|
|
47006
47238
|
show,
|
|
47007
47239
|
add: /* @__PURE__ */ __name((kind3, input) => {
|
|
47008
47240
|
const chosen = kindOf4(kind3);
|
|
47009
|
-
const name =
|
|
47241
|
+
const name = nameOf4(input.name);
|
|
47010
47242
|
const outcome = input.outcome === void 0 ? "open" : oneOf3(input.outcome, STAGE_OUTCOMES, "a stage's outcome");
|
|
47011
47243
|
write(database, () => {
|
|
47012
47244
|
const pipeline = ensure(chosen);
|
|
@@ -47025,7 +47257,7 @@ var baseStagesOver = /* @__PURE__ */ __name((context) => {
|
|
|
47025
47257
|
}, "add"),
|
|
47026
47258
|
rename: /* @__PURE__ */ __name((kind3, stage, name) => {
|
|
47027
47259
|
const chosen = kindOf4(kind3);
|
|
47028
|
-
const named3 =
|
|
47260
|
+
const named3 = nameOf4(name);
|
|
47029
47261
|
write(database, () => {
|
|
47030
47262
|
const pipeline = ensure(chosen);
|
|
47031
47263
|
const row2 = baseStageRow(pipeline, stage);
|
|
@@ -47141,7 +47373,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47141
47373
|
};
|
|
47142
47374
|
}, "baseStagesStoreOver");
|
|
47143
47375
|
|
|
47144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47376
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
47145
47377
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
47146
47378
|
}) => {
|
|
47147
47379
|
const { database, now: now2 } = context;
|
|
@@ -47200,7 +47432,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
47200
47432
|
};
|
|
47201
47433
|
}, "botUpdateStoreOver");
|
|
47202
47434
|
|
|
47203
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47435
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
47204
47436
|
import { createHash as createHash13 } from "node:crypto";
|
|
47205
47437
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
47206
47438
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -47552,7 +47784,7 @@ var fieldReferences = /* @__PURE__ */ __name((record4, options = {}) => {
|
|
|
47552
47784
|
return found2;
|
|
47553
47785
|
}, "fieldReferences");
|
|
47554
47786
|
|
|
47555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47787
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
47556
47788
|
var IMPORTER = { bot: "import" };
|
|
47557
47789
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
47558
47790
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -47597,7 +47829,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
47597
47829
|
};
|
|
47598
47830
|
}), "moneyLinesOf");
|
|
47599
47831
|
|
|
47600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
47601
47833
|
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
47602
47834
|
var ROLE_LABELS = {
|
|
47603
47835
|
organization: {
|
|
@@ -47638,7 +47870,7 @@ var ROLE_LABELS = {
|
|
|
47638
47870
|
}
|
|
47639
47871
|
};
|
|
47640
47872
|
|
|
47641
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47873
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
47642
47874
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
47643
47875
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
47644
47876
|
var listOf = /* @__PURE__ */ __name((list2) => {
|
|
@@ -47722,7 +47954,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
47722
47954
|
};
|
|
47723
47955
|
}, "relationRolesOver");
|
|
47724
47956
|
|
|
47725
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47957
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/crm.js
|
|
47726
47958
|
var isCrmUserId = /* @__PURE__ */ __name((id2) => /^\d{1,20}$/.test(id2), "isCrmUserId");
|
|
47727
47959
|
var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
|
|
47728
47960
|
const text8 = id2.trim();
|
|
@@ -47730,7 +47962,7 @@ var normalCrmUserId = /* @__PURE__ */ __name((id2) => {
|
|
|
47730
47962
|
}, "normalCrmUserId");
|
|
47731
47963
|
var isItemKind = /* @__PURE__ */ __name((kind3) => kind3 === "deal" || kind3 === "lead", "isItemKind");
|
|
47732
47964
|
|
|
47733
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47965
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
47734
47966
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
47735
47967
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
47736
47968
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -47833,7 +48065,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
47833
48065
|
return [{ setting: String(row2.key), value: settingValue(database, parsed4.key, parsed4.name) }];
|
|
47834
48066
|
}), "crmSettingsOf");
|
|
47835
48067
|
|
|
47836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
47837
48069
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
47838
48070
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
47839
48071
|
id: link3.id,
|
|
@@ -48193,7 +48425,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
48193
48425
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
48194
48426
|
}, "decidedOrigin");
|
|
48195
48427
|
|
|
48196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
48197
48429
|
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");
|
|
48198
48430
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
48199
48431
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -48331,7 +48563,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
48331
48563
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
48332
48564
|
}), "relationsStoreOver");
|
|
48333
48565
|
|
|
48334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
48335
48567
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
48336
48568
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
48337
48569
|
added: 0,
|
|
@@ -48521,7 +48753,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48521
48753
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
48522
48754
|
}, "recordRelationshipsOver");
|
|
48523
48755
|
|
|
48524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48756
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
48525
48757
|
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";
|
|
48526
48758
|
var DAY_MS2 = 864e5;
|
|
48527
48759
|
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");
|
|
@@ -48677,7 +48909,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48677
48909
|
};
|
|
48678
48910
|
}, "contractsStoreOver");
|
|
48679
48911
|
|
|
48680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48912
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
48681
48913
|
var BUSINESS_FIND_MAX = 2001;
|
|
48682
48914
|
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");
|
|
48683
48915
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -48781,7 +49013,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
48781
49013
|
};
|
|
48782
49014
|
}, "businessSearchOver");
|
|
48783
49015
|
|
|
48784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
48785
49017
|
var DAY5 = 864e5;
|
|
48786
49018
|
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}')`;
|
|
48787
49019
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -48891,7 +49123,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
48891
49123
|
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);
|
|
48892
49124
|
}, "listEvents");
|
|
48893
49125
|
|
|
48894
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
48895
49127
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
48896
49128
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
48897
49129
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -48948,7 +49180,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
48948
49180
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
48949
49181
|
}, "forgetCalendarRows");
|
|
48950
49182
|
|
|
48951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
48952
49184
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
48953
49185
|
id: Number(row2.id),
|
|
48954
49186
|
accountId: Number(row2.account_id),
|
|
@@ -49551,7 +49783,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49551
49783
|
};
|
|
49552
49784
|
}, "eventStoreOver");
|
|
49553
49785
|
|
|
49554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
49555
49787
|
var CATALOG_QUERY = defineQuery({
|
|
49556
49788
|
entity: "document",
|
|
49557
49789
|
backend: "sql",
|
|
@@ -49793,7 +50025,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49793
50025
|
};
|
|
49794
50026
|
}, "catalogStoreOver");
|
|
49795
50027
|
|
|
49796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
49797
50029
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
49798
50030
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
49799
50031
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -49806,7 +50038,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
49806
50038
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
49807
50039
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
49808
50040
|
|
|
49809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50041
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
49810
50042
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
49811
50043
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
49812
50044
|
signal?.throwIfAborted();
|
|
@@ -49905,7 +50137,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
49905
50137
|
});
|
|
49906
50138
|
}, "readMeetingContextEvidence");
|
|
49907
50139
|
|
|
49908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50140
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
49909
50141
|
var corpora = {
|
|
49910
50142
|
message: {
|
|
49911
50143
|
table: "messages",
|
|
@@ -50144,7 +50376,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
50144
50376
|
}
|
|
50145
50377
|
}), "contextRecordsOver");
|
|
50146
50378
|
|
|
50147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50379
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
50148
50380
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
50149
50381
|
var SOURCE = "crm";
|
|
50150
50382
|
var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${idPart(key2.account)}/${type}/${idPart(externalId)}`, "crmIdentityId");
|
|
@@ -50273,7 +50505,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50273
50505
|
return { savePipeline, saveItemRow };
|
|
50274
50506
|
}, "crmRowsOver");
|
|
50275
50507
|
|
|
50276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50508
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
|
|
50277
50509
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
50278
50510
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
50279
50511
|
var DryRun = class extends Error {
|
|
@@ -50350,7 +50582,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50350
50582
|
}
|
|
50351
50583
|
}, "removeCrmContacts");
|
|
50352
50584
|
|
|
50353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
50354
50586
|
var PENDING = "crm:pending-relations";
|
|
50355
50587
|
var PENDING_DAYS = 30;
|
|
50356
50588
|
var PENDING_MOST = 5e3;
|
|
@@ -50843,16 +51075,16 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
50843
51075
|
};
|
|
50844
51076
|
}, "crmCopiesOver");
|
|
50845
51077
|
|
|
50846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
50847
51079
|
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
50848
51080
|
|
|
50849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
50850
51082
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
50851
51083
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
50852
51084
|
var TOKEN2 = /^[A-Za-z0-9_-]{21}[AQgw]$/;
|
|
50853
51085
|
var isDecisionToken = /* @__PURE__ */ __name((value) => typeof value === "string" && TOKEN2.test(value), "isDecisionToken");
|
|
50854
51086
|
|
|
50855
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
50856
51088
|
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
50857
51089
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
50858
51090
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -50951,7 +51183,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
50951
51183
|
};
|
|
50952
51184
|
}, "decisionRequestStoreOver");
|
|
50953
51185
|
|
|
50954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
50955
51187
|
var NOTE_FIELDS = [
|
|
50956
51188
|
"text",
|
|
50957
51189
|
"exact",
|
|
@@ -50998,9 +51230,9 @@ var CORPORA2 = [
|
|
|
50998
51230
|
];
|
|
50999
51231
|
var matchedRows = /* @__PURE__ */ __name((context, query) => {
|
|
51000
51232
|
const chosen = CORPORA2.filter(({ type }) => (query.source === void 0 || query.source === "file" === (type === "document")) && (!query.folderIds?.length || query.withInternal === true || type === "document"));
|
|
51001
|
-
const
|
|
51233
|
+
const idsOf3 = /* @__PURE__ */ __name((type) => query.refs?.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []), "idsOf");
|
|
51002
51234
|
const rows = chosen.flatMap((corpus) => {
|
|
51003
|
-
const ids2 =
|
|
51235
|
+
const ids2 = idsOf3(corpus.type);
|
|
51004
51236
|
if (ids2?.length === 0)
|
|
51005
51237
|
return [];
|
|
51006
51238
|
return searchCorpus(context, { ...query, ...query.folderIds ? { accountIds: query.folderIds } : {}, ...ids2 ? { ids: ids2 } : {} }, corpus);
|
|
@@ -51387,7 +51619,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
51387
51619
|
};
|
|
51388
51620
|
}, "noteSearchOver");
|
|
51389
51621
|
|
|
51390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
51391
51623
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
51392
51624
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
51393
51625
|
var EVENT_CORPUS = {
|
|
@@ -51519,7 +51751,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
51519
51751
|
};
|
|
51520
51752
|
}, "eventSearchOver");
|
|
51521
51753
|
|
|
51522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
51523
51755
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
51524
51756
|
try {
|
|
51525
51757
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -51531,7 +51763,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
51531
51763
|
}
|
|
51532
51764
|
}, "calendarMoment");
|
|
51533
51765
|
|
|
51534
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51766
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
51535
51767
|
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";
|
|
51536
51768
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
51537
51769
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -51751,7 +51983,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51751
51983
|
};
|
|
51752
51984
|
}, "factsStoreOver");
|
|
51753
51985
|
|
|
51754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
51755
51987
|
var invalid4 = /* @__PURE__ */ __name((message3) => {
|
|
51756
51988
|
throw new CliError("validation_error", message3);
|
|
51757
51989
|
}, "invalid");
|
|
@@ -51856,7 +52088,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
51856
52088
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
|
|
51857
52089
|
}, "findingsCoreOver");
|
|
51858
52090
|
|
|
51859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52091
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
51860
52092
|
var stale = /* @__PURE__ */ __name(() => {
|
|
51861
52093
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
51862
52094
|
reason: "evidence-findings.stale"
|
|
@@ -52058,7 +52290,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52058
52290
|
};
|
|
52059
52291
|
}, "evidenceFindingsStoreOver");
|
|
52060
52292
|
|
|
52061
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
52062
52294
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
52063
52295
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
52064
52296
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -52111,7 +52343,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
52111
52343
|
}, "forPerson")
|
|
52112
52344
|
}), "involvementStoreOver");
|
|
52113
52345
|
|
|
52114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
52115
52347
|
var LABELLED = {
|
|
52116
52348
|
note: "note",
|
|
52117
52349
|
document: "document",
|
|
@@ -52123,7 +52355,7 @@ var LABELLED = {
|
|
|
52123
52355
|
account: "folder"
|
|
52124
52356
|
};
|
|
52125
52357
|
|
|
52126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
52127
52359
|
import { createHash as createHash15 } from "node:crypto";
|
|
52128
52360
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
52129
52361
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -52209,7 +52441,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
52209
52441
|
};
|
|
52210
52442
|
}, "meetingProjectsStoreOver");
|
|
52211
52443
|
|
|
52212
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
52213
52445
|
var ORGANIZATIONS_QUERY = {
|
|
52214
52446
|
entity: "organization",
|
|
52215
52447
|
backend: "sql",
|
|
@@ -52250,7 +52482,7 @@ var REMINDERS_QUERY = {
|
|
|
52250
52482
|
})
|
|
52251
52483
|
};
|
|
52252
52484
|
|
|
52253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
52254
52486
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
52255
52487
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
52256
52488
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -52271,7 +52503,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
52271
52503
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
52272
52504
|
}, "categorySql");
|
|
52273
52505
|
|
|
52274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
52275
52507
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
52276
52508
|
id: String(row2.id),
|
|
52277
52509
|
ref: `organization:${row2.id}`,
|
|
@@ -52316,7 +52548,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
52316
52548
|
}), "setOwnOrganization")
|
|
52317
52549
|
}), "organizationsStoreOver");
|
|
52318
52550
|
|
|
52319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
52320
52552
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
52321
52553
|
var ACCOUNT_ENDS = [
|
|
52322
52554
|
["deal", "deals"],
|
|
@@ -52460,13 +52692,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
52460
52692
|
__name(proposalItem, "proposalItem");
|
|
52461
52693
|
}, "relationListOver");
|
|
52462
52694
|
|
|
52463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
52464
52696
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
52465
52697
|
...relationListOver(context),
|
|
52466
52698
|
...relationRolesOver(context)
|
|
52467
52699
|
}), "relationReadsOver");
|
|
52468
52700
|
|
|
52469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
52470
52702
|
var TABLES5 = { memory: "memories", fact: "facts" };
|
|
52471
52703
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
52472
52704
|
var DEFAULT_LIMIT = 500;
|
|
@@ -52709,16 +52941,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52709
52941
|
};
|
|
52710
52942
|
}, "sourceReviewStoreOver");
|
|
52711
52943
|
|
|
52712
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52944
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
52713
52945
|
import { createHash as createHash18 } from "node:crypto";
|
|
52714
52946
|
|
|
52715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52947
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
52716
52948
|
import { createHash as createHash17 } from "node:crypto";
|
|
52717
52949
|
|
|
52718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
52719
52951
|
import { createHash as createHash16 } from "node:crypto";
|
|
52720
52952
|
|
|
52721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
52722
52954
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
52723
52955
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
52724
52956
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -52769,7 +53001,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
52769
53001
|
return input;
|
|
52770
53002
|
}, "consolidationApplyInput");
|
|
52771
53003
|
|
|
52772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
52773
53005
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
52774
53006
|
id: String(row2.id),
|
|
52775
53007
|
sourceId: String(row2.source_id),
|
|
@@ -52844,7 +53076,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
52844
53076
|
}, { beforeCommit: check3 });
|
|
52845
53077
|
}, "applyTagConsolidation");
|
|
52846
53078
|
|
|
52847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
52848
53080
|
var selections = [
|
|
52849
53081
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
52850
53082
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -52988,7 +53220,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
52988
53220
|
};
|
|
52989
53221
|
}, "previewRows");
|
|
52990
53222
|
|
|
52991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
52992
53224
|
var kinds = ["project", "tag", "topic"];
|
|
52993
53225
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
52994
53226
|
if (signal?.aborted)
|
|
@@ -53252,7 +53484,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53252
53484
|
};
|
|
53253
53485
|
}, "vocabularyStoreOver");
|
|
53254
53486
|
|
|
53255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53487
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
53256
53488
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
53257
53489
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
53258
53490
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -53801,7 +54033,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
53801
54033
|
return key2.padEnd(3, "X");
|
|
53802
54034
|
}, "projectKey");
|
|
53803
54035
|
|
|
53804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
53805
54037
|
var DAY6 = 864e5;
|
|
53806
54038
|
var SETTING5 = "logs_pruned_at";
|
|
53807
54039
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY6, botUpdatePayloadsMs: 30 * DAY6 };
|
|
@@ -53828,7 +54060,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
53828
54060
|
};
|
|
53829
54061
|
}, "logPruner");
|
|
53830
54062
|
|
|
53831
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
53832
54064
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
53833
54065
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
53834
54066
|
var invalid6 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -53843,7 +54075,7 @@ var emailEvidence = /* @__PURE__ */ __name((raw) => {
|
|
|
53843
54075
|
}
|
|
53844
54076
|
return invalid6("mail finding evidence is a msg:email/\u2026 reference");
|
|
53845
54077
|
}, "emailEvidence");
|
|
53846
|
-
var
|
|
54078
|
+
var RULES2 = {
|
|
53847
54079
|
plural: "mail findings",
|
|
53848
54080
|
singular: "mail finding",
|
|
53849
54081
|
cited: "reference",
|
|
@@ -53958,15 +54190,15 @@ var one = /* @__PURE__ */ __name((raw, ids2) => {
|
|
|
53958
54190
|
if (!MAIL_FINDING_KINDS.includes(raw.kind))
|
|
53959
54191
|
return invalid6(`a mail finding is a ${MAIL_FINDING_KINDS.join(", ")}`);
|
|
53960
54192
|
const { needs, may } = MAIL_FINDING_FIELDS[raw.kind];
|
|
53961
|
-
findingFields(raw, ["id", "kind", ...needs, ...may, "evidence"],
|
|
53962
|
-
findingNeeds(raw, needs,
|
|
54193
|
+
findingFields(raw, ["id", "kind", ...needs, ...may, "evidence"], RULES2.singular);
|
|
54194
|
+
findingNeeds(raw, needs, RULES2.singular);
|
|
53963
54195
|
if (raw.kind === "fact") {
|
|
53964
54196
|
const { reason, ...fact } = raw;
|
|
53965
|
-
return { ...validateFinding(fact,
|
|
54197
|
+
return { ...validateFinding(fact, RULES2, ids2), reason: findingText(reason, 2e3) };
|
|
53966
54198
|
}
|
|
53967
54199
|
if (raw.kind === "task") {
|
|
53968
54200
|
const { externalId, sourceUrl, ...task } = raw;
|
|
53969
|
-
const checked3 = validateFinding(task,
|
|
54201
|
+
const checked3 = validateFinding(task, RULES2, ids2);
|
|
53970
54202
|
return {
|
|
53971
54203
|
...checked3,
|
|
53972
54204
|
...optional2("externalId", externalId, (value) => {
|
|
@@ -53977,7 +54209,7 @@ var one = /* @__PURE__ */ __name((raw, ids2) => {
|
|
|
53977
54209
|
};
|
|
53978
54210
|
}
|
|
53979
54211
|
const id2 = findingId(raw.id, ids2);
|
|
53980
|
-
const evidence = validEvidence(raw.evidence,
|
|
54212
|
+
const evidence = validEvidence(raw.evidence, RULES2);
|
|
53981
54213
|
const reference2 = /* @__PURE__ */ __name((value, pattern, what) => {
|
|
53982
54214
|
const text8 = findingText(value, 400);
|
|
53983
54215
|
if (!pattern.test(text8))
|
|
@@ -54167,7 +54399,7 @@ var one = /* @__PURE__ */ __name((raw, ids2) => {
|
|
|
54167
54399
|
var KEY3 = /^[a-z0-9][a-z0-9-]{0,39}:[1-9]\d*(-r[1-9]\d*)?$/;
|
|
54168
54400
|
var KEY_SHAPE = "a mail findings key is the one `review --holder` gave: <holder>:<through_id>, and -r<resets> after a reset, such as mail-triage:9123456 or mail-triage:9123456-r1";
|
|
54169
54401
|
var validateMailFindings = /* @__PURE__ */ __name((input) => {
|
|
54170
|
-
const batch = validateBatch(input,
|
|
54402
|
+
const batch = validateBatch(input, RULES2, MAIL_FINDINGS_PER_RUN, one);
|
|
54171
54403
|
if (!KEY3.test(batch.key))
|
|
54172
54404
|
return invalid6(KEY_SHAPE);
|
|
54173
54405
|
return batch;
|
|
@@ -54187,7 +54419,7 @@ var mailFindingProblem = /* @__PURE__ */ __name((raw, error) => {
|
|
|
54187
54419
|
}, "mailFindingProblem");
|
|
54188
54420
|
var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
54189
54421
|
const problems = [];
|
|
54190
|
-
const batch = validateBatch(input,
|
|
54422
|
+
const batch = validateBatch(input, RULES2, MAIL_FINDINGS_PER_RUN, (finding, ids2) => {
|
|
54191
54423
|
try {
|
|
54192
54424
|
return one(finding, ids2);
|
|
54193
54425
|
} catch (error) {
|
|
@@ -54204,7 +54436,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
54204
54436
|
}, "checkMailFindings");
|
|
54205
54437
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
54206
54438
|
|
|
54207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
54208
54440
|
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";
|
|
54209
54441
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
54210
54442
|
const { database, now: now2 } = context;
|
|
@@ -54417,7 +54649,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54417
54649
|
};
|
|
54418
54650
|
}, "ordersStoreOver");
|
|
54419
54651
|
|
|
54420
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54652
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
54421
54653
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
54422
54654
|
throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
|
|
54423
54655
|
reason: "mail-findings.stale"
|
|
@@ -54529,27 +54761,13 @@ var mailFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54529
54761
|
}
|
|
54530
54762
|
return read3;
|
|
54531
54763
|
}, "cite");
|
|
54532
|
-
const
|
|
54533
|
-
|
|
54534
|
-
|
|
54535
|
-
|
|
54536
|
-
|
|
54537
|
-
|
|
54538
|
-
|
|
54539
|
-
if (!found2.length && domain && !FREE_MAIL.has(domain))
|
|
54540
|
-
found2 = organizationsOf(`${BY_ADDRESS}substr(lower(i.external_id), -length(?)) = ?`, `@${domain}`, `@${domain}`);
|
|
54541
|
-
if (!found2.length)
|
|
54542
|
-
found2 = database.prepare("SELECT id, name FROM organizations WHERE deleted_at IS NULL").all().filter((row2) => fold(String(row2.name)).trim() === fold(name).trim()).map((row2) => Number(row2.id));
|
|
54543
|
-
if (found2.length > 1)
|
|
54544
|
-
return invalid7(`${found2.length} organizations match ${name} (${found2.map((id3) => `organization:${id3}`).join(", ")}); name the one meant as a reference`, "finance.party");
|
|
54545
|
-
const at2 = now2();
|
|
54546
|
-
const id2 = found2[0] ?? Number(database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES ('company', ?, 'work', ?, ?) RETURNING id").get(name, at2, at2)?.id);
|
|
54547
|
-
if (email !== void 0) {
|
|
54548
|
-
database.prepare("INSERT INTO identities (provider, external_id, created_at, updated_at) VALUES ('email', ?, ?, ?) ON CONFLICT (provider, external_id) DO NOTHING").run(email, at2, at2);
|
|
54549
|
-
database.prepare("INSERT INTO organization_identities (identity_id, organization_id, method, author, created_at, updated_at) SELECT id, ?, 'mail-finding', 'owner', ?, ? FROM identities WHERE provider = 'email' AND external_id = ? ON CONFLICT (identity_id, organization_id) DO NOTHING").run(id2, at2, at2, email);
|
|
54550
|
-
}
|
|
54551
|
-
return `organization:${id2}`;
|
|
54552
|
-
}, "organizationNamed");
|
|
54764
|
+
const organizationNamed = /* @__PURE__ */ __name((name, email) => `organization:${organizationOfAddress(context, {
|
|
54765
|
+
name,
|
|
54766
|
+
...email === void 0 ? {} : { email },
|
|
54767
|
+
method: "mail-finding",
|
|
54768
|
+
author: "owner",
|
|
54769
|
+
reason: "finance.party"
|
|
54770
|
+
})}`, "organizationNamed");
|
|
54553
54771
|
const partyOf = /* @__PURE__ */ __name((reference2, name, email) => reference2 ?? (name === void 0 ? void 0 : organizationNamed(name, email)), "partyOf");
|
|
54554
54772
|
const entry2 = /* @__PURE__ */ __name((finding, evidence) => {
|
|
54555
54773
|
const by = "owner";
|
|
@@ -54874,7 +55092,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
54874
55092
|
};
|
|
54875
55093
|
}, "mailFindingsStoreOver");
|
|
54876
55094
|
|
|
54877
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
54878
55096
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
54879
55097
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
54880
55098
|
reason: "meeting-findings.stale"
|
|
@@ -55042,7 +55260,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55042
55260
|
};
|
|
55043
55261
|
}, "meetingFindingsStoreOver");
|
|
55044
55262
|
|
|
55045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
55046
55264
|
var RANK_BATCH = 512;
|
|
55047
55265
|
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";
|
|
55048
55266
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -55313,7 +55531,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
55313
55531
|
}
|
|
55314
55532
|
}), "meetingVectorsOver");
|
|
55315
55533
|
|
|
55316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
55317
55535
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
55318
55536
|
var TEXTS = {
|
|
55319
55537
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -55414,7 +55632,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55414
55632
|
};
|
|
55415
55633
|
}, "sourceMentionStoreOver");
|
|
55416
55634
|
|
|
55417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
55418
55636
|
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";
|
|
55419
55637
|
var MAX_SPLITS = 100;
|
|
55420
55638
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -55645,11 +55863,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55645
55863
|
};
|
|
55646
55864
|
}, "transactionsStoreOver");
|
|
55647
55865
|
|
|
55648
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
55649
55867
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
55650
55868
|
import { dirname as dirname2 } from "node:path";
|
|
55651
55869
|
|
|
55652
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
55653
55871
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
55654
55872
|
var CLIENTS_SETTING = "clients";
|
|
55655
55873
|
var coreVersion = (() => {
|
|
@@ -55710,7 +55928,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
55710
55928
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
55711
55929
|
}, "refusalAdvice");
|
|
55712
55930
|
|
|
55713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55931
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
55714
55932
|
var GENERATED = [
|
|
55715
55933
|
{
|
|
55716
55934
|
"name": "20261010184427_initial",
|
|
@@ -57047,10 +57265,16 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
57047
57265
|
"DROP TRIGGER IF EXISTS person_kind_deal_owner_person_au;",
|
|
57048
57266
|
"CREATE TRIGGER person_kind_deal_owner_person_au AFTER UPDATE OF owner ON persons\nWHEN OLD.owner IS NOT NEW.owner BEGIN\n UPDATE persons SET kind = NULL WHERE kind IS NOT NULL AND id IN (SELECT d.to_id FROM links o JOIN links d ON d.from_type = o.from_type AND d.from_id = o.from_id AND d.kind = 'related-to' AND +d.to_type = 'person' WHERE o.to_type = 'person' AND o.role = 'owner' AND o.from_type IN ('deal', 'lead') AND o.to_id IN (SELECT NEW.id UNION SELECT e.from_person_id FROM identity_link_events e JOIN identity_links l ON l.identity_id = e.identity_id WHERE l.person_id = NEW.id));\nEND;"
|
|
57049
57267
|
]
|
|
57268
|
+
},
|
|
57269
|
+
{
|
|
57270
|
+
"name": "20261110182602_version-65-found-task-titles",
|
|
57271
|
+
"statements": [
|
|
57272
|
+
"-- A found task's title was its message's first line only while reading, so it went blank when the message was deleted.\n-- The line comes from displayTitleOf in code, so the next writable open stores it for the tasks still titled\n-- `<kind> \u2014 <source>` and deletes this key (fillFoundTaskTitles). A store with no such task gets no key.\nINSERT OR REPLACE INTO store_settings (key, value, at)\nSELECT 'found_task_titles_to_fill', '1', unixepoch() * 1000 WHERE EXISTS (\n SELECT 1 FROM tasks WHERE package_id IS NOT NULL AND deleted_at IS NULL AND source_locator LIKE 'msg:%'\n AND title = type || ' \u2014 ' || source_locator\n);"
|
|
57273
|
+
]
|
|
57050
57274
|
}
|
|
57051
57275
|
];
|
|
57052
57276
|
|
|
57053
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
57054
57278
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
57055
57279
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
57056
57280
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -57283,7 +57507,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
57283
57507
|
return { ...result, foreignKeyViolations };
|
|
57284
57508
|
}, "rollBack");
|
|
57285
57509
|
|
|
57286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
57287
57511
|
var V31_TABLES = [
|
|
57288
57512
|
"accounts",
|
|
57289
57513
|
"account_identities",
|
|
@@ -57410,7 +57634,8 @@ var MANIFEST = [
|
|
|
57410
57634
|
{ name: "20261110005159_version-62-person-kinds", version: 62, minCompatible: 56 },
|
|
57411
57635
|
{ name: "20261110005200_version-62-person-kinds-triggers", version: 62, minCompatible: 56 },
|
|
57412
57636
|
{ name: "20261110020704_version-63-people-ties-messages-crm", version: 63, minCompatible: 56 },
|
|
57413
|
-
{ name: "20261110084658_version-64-deal-link-triggers", version: 64, minCompatible: 56 }
|
|
57637
|
+
{ name: "20261110084658_version-64-deal-link-triggers", version: 64, minCompatible: 56 },
|
|
57638
|
+
{ name: "20261110182602_version-65-found-task-titles", version: 65, minCompatible: 56 }
|
|
57414
57639
|
];
|
|
57415
57640
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
57416
57641
|
const migrations = [];
|
|
@@ -57446,7 +57671,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
57446
57671
|
return migrations;
|
|
57447
57672
|
}, "generatedMigrations");
|
|
57448
57673
|
|
|
57449
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
57450
57675
|
var MIGRATIONS = generatedMigrations();
|
|
57451
57676
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
57452
57677
|
version INTEGER PRIMARY KEY,
|
|
@@ -57543,7 +57768,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
57543
57768
|
}
|
|
57544
57769
|
}, "migrate");
|
|
57545
57770
|
|
|
57546
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57771
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
57547
57772
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
57548
57773
|
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 ?");
|
|
57549
57774
|
if (pending.get(0, 1) === void 0)
|
|
@@ -57565,7 +57790,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
57565
57790
|
}
|
|
57566
57791
|
}, "fillJoinKeys");
|
|
57567
57792
|
|
|
57568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
57569
57794
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
57570
57795
|
refuseOwnerStoreInTests(path);
|
|
57571
57796
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -57579,8 +57804,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
57579
57804
|
}, "openSqlite");
|
|
57580
57805
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
57581
57806
|
quietSqliteWarning();
|
|
57582
|
-
const { drizzle } = await import("./node-
|
|
57583
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
57807
|
+
const { drizzle } = await import("./node-GTF4PZZJ.js");
|
|
57808
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-TCF6PKCK.js");
|
|
57584
57809
|
const client = await nodeClient(path, { readOnly });
|
|
57585
57810
|
try {
|
|
57586
57811
|
if (!readOnly)
|
|
@@ -57594,8 +57819,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
57594
57819
|
}
|
|
57595
57820
|
}, "openUnderNode");
|
|
57596
57821
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
57597
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
57598
|
-
const { drizzle } = await import("./bun-
|
|
57822
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-YXHIEV5I.js");
|
|
57823
|
+
const { drizzle } = await import("./bun-YI3OK27Z.js");
|
|
57599
57824
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
57600
57825
|
try {
|
|
57601
57826
|
if (!readOnly)
|
|
@@ -57609,7 +57834,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
57609
57834
|
}
|
|
57610
57835
|
}, "openUnderBun");
|
|
57611
57836
|
|
|
57612
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
57613
57838
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
57614
57839
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
57615
57840
|
try {
|
|
@@ -57677,7 +57902,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
57677
57902
|
});
|
|
57678
57903
|
}, "movePaymentFacts");
|
|
57679
57904
|
|
|
57680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
57681
57906
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
57682
57907
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
57683
57908
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -57695,7 +57920,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
57695
57920
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
57696
57921
|
}, "assertReadCompatible");
|
|
57697
57922
|
|
|
57698
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
57699
57924
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
57700
57925
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
57701
57926
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -57741,7 +57966,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
57741
57966
|
});
|
|
57742
57967
|
}, "moveSuggestedLinks");
|
|
57743
57968
|
|
|
57744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57969
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
57745
57970
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
57746
57971
|
var TEST_PROVIDER = "chat";
|
|
57747
57972
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -57762,7 +57987,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
57762
57987
|
}
|
|
57763
57988
|
}, "purgeTestAccounts");
|
|
57764
57989
|
|
|
57765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
57766
57991
|
var BACKFILL_ON_OPEN = 5e3;
|
|
57767
57992
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
57768
57993
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -57838,6 +58063,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
57838
58063
|
movePaymentFacts({ ...opened, now: now2, decisions: decisions2 });
|
|
57839
58064
|
purgeTestAccounts({ ...opened, now: now2, decisions: decisions2 }, warn);
|
|
57840
58065
|
maskStoredBotTokens({ ...opened, now: now2, decisions: decisions2 });
|
|
58066
|
+
fillFoundTaskTitles(database, warn);
|
|
57841
58067
|
const pending = pendingNormalization(database);
|
|
57842
58068
|
if (pending > 0 && pending <= BACKFILL_ON_OPEN)
|
|
57843
58069
|
backfillNormalized(database);
|
|
@@ -57863,7 +58089,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
57863
58089
|
}
|
|
57864
58090
|
}, "openStoreContext");
|
|
57865
58091
|
|
|
57866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
57867
58093
|
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";
|
|
57868
58094
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
57869
58095
|
const { database, now: now2 } = context;
|
|
@@ -57969,10 +58195,10 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57969
58195
|
};
|
|
57970
58196
|
}, "productsStoreOver");
|
|
57971
58197
|
|
|
57972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58198
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
57973
58199
|
import { createHash as createHash19 } from "node:crypto";
|
|
57974
58200
|
|
|
57975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
57976
58202
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
57977
58203
|
var ref = text6(2048);
|
|
57978
58204
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -58042,7 +58268,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
58042
58268
|
}))
|
|
58043
58269
|
});
|
|
58044
58270
|
|
|
58045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58271
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
58046
58272
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
58047
58273
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
58048
58274
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -58146,7 +58372,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
58146
58372
|
invalid9("external.unused");
|
|
58147
58373
|
}, "validateProjectAnnotationsGraph");
|
|
58148
58374
|
|
|
58149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
58150
58376
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
58151
58377
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
58152
58378
|
var targetSchema = strictObject({
|
|
@@ -58252,7 +58478,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
58252
58478
|
};
|
|
58253
58479
|
}, "planBoundProjectAnnotations");
|
|
58254
58480
|
|
|
58255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
58256
58482
|
import { createHash as createHash20 } from "node:crypto";
|
|
58257
58483
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
58258
58484
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -58346,7 +58572,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
58346
58572
|
})).digest("hex");
|
|
58347
58573
|
}, "projectAnnotationSnapshotFingerprint");
|
|
58348
58574
|
|
|
58349
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
58350
58576
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
58351
58577
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
58352
58578
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -58363,7 +58589,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
58363
58589
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
58364
58590
|
}, "projectAnnotationRequest");
|
|
58365
58591
|
|
|
58366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58592
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
58367
58593
|
var SnapshotBudget = class {
|
|
58368
58594
|
static {
|
|
58369
58595
|
__name(this, "SnapshotBudget");
|
|
@@ -58389,13 +58615,13 @@ var SnapshotBudget = class {
|
|
|
58389
58615
|
}
|
|
58390
58616
|
};
|
|
58391
58617
|
|
|
58392
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
58393
58619
|
import { createHash as createHash22 } from "node:crypto";
|
|
58394
58620
|
|
|
58395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
58396
58622
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
58397
58623
|
|
|
58398
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
58399
58625
|
import { createHash as createHash21 } from "node:crypto";
|
|
58400
58626
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
58401
58627
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -58538,7 +58764,7 @@ var ProjectSnapshotSources = class {
|
|
|
58538
58764
|
}
|
|
58539
58765
|
};
|
|
58540
58766
|
|
|
58541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
58542
58768
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
58543
58769
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
58544
58770
|
}, "unsupported");
|
|
@@ -58716,7 +58942,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
58716
58942
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
58717
58943
|
}), "projectAnnotationSnapshot");
|
|
58718
58944
|
|
|
58719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58945
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
58720
58946
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
58721
58947
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
58722
58948
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -58778,7 +59004,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
58778
59004
|
};
|
|
58779
59005
|
}), "previewAnnotationSnapshot");
|
|
58780
59006
|
|
|
58781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
58782
59008
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
58783
59009
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
58784
59010
|
if (link3.kind === "evidence" && to)
|
|
@@ -58845,7 +59071,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
58845
59071
|
return mappings;
|
|
58846
59072
|
}, "restoreAnnotationRecords");
|
|
58847
59073
|
|
|
58848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
58849
59075
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
58850
59076
|
async preview(request) {
|
|
58851
59077
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -58875,7 +59101,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
58875
59101
|
}
|
|
58876
59102
|
}), "projectAnnotationStoreOver");
|
|
58877
59103
|
|
|
58878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
58879
59105
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
58880
59106
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
58881
59107
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -58946,7 +59172,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
58946
59172
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
58947
59173
|
}, "recordRelationsOver");
|
|
58948
59174
|
|
|
58949
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59175
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
58950
59176
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
58951
59177
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
58952
59178
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -59000,7 +59226,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
59000
59226
|
return { pointedAt, remap };
|
|
59001
59227
|
}, "recordRemapOver");
|
|
59002
59228
|
|
|
59003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
59004
59230
|
var runs = 0;
|
|
59005
59231
|
var PAGE = 500;
|
|
59006
59232
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -59213,7 +59439,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
59213
59439
|
return pointerOf("records", index2, "fields", key2);
|
|
59214
59440
|
}, "waitingPointer");
|
|
59215
59441
|
|
|
59216
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
59217
59443
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
59218
59444
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
59219
59445
|
var ORG_EMAIL = "org-email";
|
|
@@ -59379,7 +59605,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
59379
59605
|
]);
|
|
59380
59606
|
}, "renameMade");
|
|
59381
59607
|
|
|
59382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
59383
59609
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
59384
59610
|
name: given2(fields4, "name"),
|
|
59385
59611
|
unit: given2(fields4, "unit"),
|
|
@@ -59502,7 +59728,7 @@ var DIRECT_PROJECTORS = {
|
|
|
59502
59728
|
lead: dealProjector("lead")
|
|
59503
59729
|
};
|
|
59504
59730
|
|
|
59505
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
59506
59732
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
59507
59733
|
const importer = authorActor(context, IMPORTER).actor;
|
|
59508
59734
|
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;
|
|
@@ -59712,7 +59938,7 @@ var MONEY_PROJECTORS = {
|
|
|
59712
59938
|
}
|
|
59713
59939
|
};
|
|
59714
59940
|
|
|
59715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
59716
59942
|
var CALLS_CALENDAR = "calls";
|
|
59717
59943
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
59718
59944
|
if (!isImportedProvider(source2.provider))
|
|
@@ -59887,7 +60113,7 @@ var PHONE_PROJECTORS = {
|
|
|
59887
60113
|
}
|
|
59888
60114
|
};
|
|
59889
60115
|
|
|
59890
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60116
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
59891
60117
|
var RECORD_PROJECTORS = {
|
|
59892
60118
|
...MONEY_PROJECTORS,
|
|
59893
60119
|
...DIRECT_PROJECTORS,
|
|
@@ -59897,7 +60123,7 @@ var RECORD_PROJECTORS = {
|
|
|
59897
60123
|
project: null
|
|
59898
60124
|
};
|
|
59899
60125
|
|
|
59900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
59901
60127
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
59902
60128
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
59903
60129
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -59959,7 +60185,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
59959
60185
|
return { settle, checkShares };
|
|
59960
60186
|
}, "recordSettlingOver");
|
|
59961
60187
|
|
|
59962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
59963
60189
|
import { createHash as createHash23 } from "node:crypto";
|
|
59964
60190
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
59965
60191
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -59975,7 +60201,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
59975
60201
|
return { stamp, untouched };
|
|
59976
60202
|
}, "importStampsOver");
|
|
59977
60203
|
|
|
59978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
59979
60205
|
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";
|
|
59980
60206
|
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";
|
|
59981
60207
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -60206,7 +60432,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60206
60432
|
};
|
|
60207
60433
|
}, "subscriptionsStoreOver");
|
|
60208
60434
|
|
|
60209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60435
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
60210
60436
|
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";
|
|
60211
60437
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
60212
60438
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -60328,7 +60554,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60328
60554
|
};
|
|
60329
60555
|
}, "walletsStoreOver");
|
|
60330
60556
|
|
|
60331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
60332
60558
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
60333
60559
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
60334
60560
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -60587,7 +60813,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
60587
60813
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
60588
60814
|
}, "recordWritesOver");
|
|
60589
60815
|
|
|
60590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
60591
60817
|
var LIMIT = 1e3;
|
|
60592
60818
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
60593
60819
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -60810,7 +61036,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
60810
61036
|
};
|
|
60811
61037
|
}, "recordStoreOver");
|
|
60812
61038
|
|
|
60813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
60814
61040
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
60815
61041
|
key: row2.key,
|
|
60816
61042
|
channel: row2.channel,
|
|
@@ -60865,7 +61091,7 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
60865
61091
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
60866
61092
|
}, "storedTemplateBodies");
|
|
60867
61093
|
|
|
60868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
60869
61095
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
60870
61096
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
60871
61097
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -60900,7 +61126,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
60900
61126
|
return proxy;
|
|
60901
61127
|
}, "storeErrors");
|
|
60902
61128
|
|
|
60903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
60904
61130
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
60905
61131
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
60906
61132
|
let merged2 = { from: from2, to };
|
|
@@ -60913,7 +61139,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
60913
61139
|
}, "markRange");
|
|
60914
61140
|
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");
|
|
60915
61141
|
|
|
60916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
60917
61143
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
60918
61144
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
60919
61145
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -60934,7 +61160,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
60934
61160
|
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);
|
|
60935
61161
|
}, "setTaskAnalysisMark");
|
|
60936
61162
|
|
|
60937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61163
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
60938
61164
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
60939
61165
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
60940
61166
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -60944,7 +61170,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
60944
61170
|
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);
|
|
60945
61171
|
}, "setTaskRulesStop");
|
|
60946
61172
|
|
|
60947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61173
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
60948
61174
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
60949
61175
|
const { database } = context;
|
|
60950
61176
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -61003,7 +61229,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61003
61229
|
};
|
|
61004
61230
|
}, "syncStoreOver");
|
|
61005
61231
|
|
|
61006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
61007
61233
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
61008
61234
|
const { database } = context;
|
|
61009
61235
|
return {
|
|
@@ -61025,7 +61251,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61025
61251
|
};
|
|
61026
61252
|
}, "tagsStoreOver");
|
|
61027
61253
|
|
|
61028
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61254
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
61029
61255
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
61030
61256
|
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
|
|
61031
61257
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -61152,7 +61378,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
61152
61378
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
61153
61379
|
}, "savePictureChunks");
|
|
61154
61380
|
|
|
61155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
61156
61382
|
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,
|
|
61157
61383
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
61158
61384
|
FROM messages m
|
|
@@ -61241,7 +61467,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
61241
61467
|
return plain2(best(found2));
|
|
61242
61468
|
}, "nearestMessages");
|
|
61243
61469
|
|
|
61244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61470
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
61245
61471
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
61246
61472
|
const { database } = context;
|
|
61247
61473
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -61500,7 +61726,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
61500
61726
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
61501
61727
|
}), "vectorsStoreOver");
|
|
61502
61728
|
|
|
61503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
61504
61730
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
61505
61731
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
61506
61732
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -61588,10 +61814,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
61588
61814
|
}
|
|
61589
61815
|
}, "lastBackup");
|
|
61590
61816
|
|
|
61591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61817
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
61592
61818
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
61593
61819
|
|
|
61594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
61595
61821
|
var COUNTED_TABLES = [
|
|
61596
61822
|
"accounts",
|
|
61597
61823
|
"chats",
|
|
@@ -61676,7 +61902,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
61676
61902
|
};
|
|
61677
61903
|
}, "storeContents");
|
|
61678
61904
|
|
|
61679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.635.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_3655968b1fddf86e6ebc40f56f82dd2f/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
61680
61906
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
61681
61907
|
const context = await openStoreContext(options);
|
|
61682
61908
|
try {
|
|
@@ -61939,6 +62165,8 @@ export {
|
|
|
61939
62165
|
mayDecide,
|
|
61940
62166
|
assertMayDecide,
|
|
61941
62167
|
deciderAuthor,
|
|
62168
|
+
registrableOf,
|
|
62169
|
+
scoreGroup,
|
|
61942
62170
|
isGoogleDocumentHost,
|
|
61943
62171
|
googleDocumentLinks,
|
|
61944
62172
|
DEFAULT_PHONE_COUNTRIES,
|
|
@@ -61991,6 +62219,13 @@ export {
|
|
|
61991
62219
|
drainCorpus,
|
|
61992
62220
|
drainNoteIndex,
|
|
61993
62221
|
resetNoteIndex,
|
|
62222
|
+
chatReferenceOf,
|
|
62223
|
+
wrongAccount,
|
|
62224
|
+
ensureAccount,
|
|
62225
|
+
isId,
|
|
62226
|
+
foldName,
|
|
62227
|
+
pickChat,
|
|
62228
|
+
pickPerson,
|
|
61994
62229
|
AGENDA_COLUMNS,
|
|
61995
62230
|
profilesOn,
|
|
61996
62231
|
storedProfilesFor,
|
|
@@ -62030,15 +62265,6 @@ export {
|
|
|
62030
62265
|
resetAttachmentWords,
|
|
62031
62266
|
attachmentColumns,
|
|
62032
62267
|
accountGroupsOf,
|
|
62033
|
-
chatReferenceOf,
|
|
62034
|
-
wrongAccount,
|
|
62035
|
-
ensureAccount,
|
|
62036
|
-
isId,
|
|
62037
|
-
foldName,
|
|
62038
|
-
pickChat,
|
|
62039
|
-
pickPerson,
|
|
62040
|
-
registrableOf,
|
|
62041
|
-
scoreGroup,
|
|
62042
62268
|
savedTaskCategories,
|
|
62043
62269
|
DEFAULT_AGENT_CLOSE,
|
|
62044
62270
|
certaintyOf,
|