@wirecat/tg-cli 0.113.0 → 0.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/tg.js +6 -2
- package/dist/bundle/{adapter-EQKEFGPB.js → adapter-YAEHX3QB.js} +45 -45
- package/dist/bundle/{all-profiles-TTBFF663.js → all-profiles-R5CW42HQ.js} +8 -8
- package/dist/bundle/{anthropic-XPZS7267.js → anthropic-F25RHYV2.js} +5 -5
- package/dist/bundle/{app-server-ZSZ7KRAY.js → app-server-FAG6FNXR.js} +41 -40
- package/dist/bundle/{bot-api-X7BOVNIO.js → bot-api-KOIAXTQR.js} +46 -46
- package/dist/bundle/{bot-history-DWIUIPN5.js → bot-history-PRAOZEWC.js} +16 -15
- package/dist/bundle/{bun-ZGZVAJU2.js → bun-XIMM6EHD.js} +2 -2
- package/dist/bundle/{bun-sqlite-UN2UJ6SI.js → bun-sqlite-DSUCO4TR.js} +4 -4
- package/dist/bundle/{chunk-KK3JVOOV.js → chunk-2PAKHXIV.js} +29 -28
- package/dist/bundle/{chunk-KQ23JWLJ.js → chunk-34USFPBF.js} +18 -18
- package/dist/bundle/{chunk-WSAHUQ6K.js → chunk-3EZ43DAF.js} +3 -3
- package/dist/bundle/{chunk-Q264PYGE.js → chunk-3R43O3GG.js} +49 -16
- package/dist/bundle/{chunk-JDQSX2JQ.js → chunk-4JOKO4IW.js} +6810 -5767
- package/dist/bundle/{chunk-6OKGHHRL.js → chunk-5HKMEXVQ.js} +35 -35
- package/dist/bundle/{chunk-7IWDS2CM.js → chunk-6SPLZI5P.js} +2 -2
- package/dist/bundle/{chunk-J6USEBA6.js → chunk-7FOT4XD2.js} +2178 -923
- package/dist/bundle/{chunk-GX4LRLVD.js → chunk-AL36NHO6.js} +5110 -946
- package/dist/bundle/{chunk-UE75KPAC.js → chunk-ALHKUQDZ.js} +4 -4
- package/dist/bundle/{chunk-IDUYRTPF.js → chunk-C34IDOA5.js} +2 -2
- package/dist/bundle/{chunk-XXNJF3ZM.js → chunk-C7K7AP6G.js} +72 -30
- package/dist/bundle/{chunk-ZID2Y4XU.js → chunk-CDCBFMEI.js} +2 -2
- package/dist/bundle/{chunk-TQ6EA7TB.js → chunk-CS5DQ6KM.js} +15 -14
- package/dist/bundle/{chunk-6WJ5M2Q4.js → chunk-DQQEN3X4.js} +4 -4
- package/dist/bundle/{chunk-4GLMEES6.js → chunk-E2IRSRTB.js} +1 -1
- package/dist/bundle/{chunk-PCRLXJRH.js → chunk-EARO464A.js} +9 -7
- package/dist/bundle/{chunk-K3F46QVN.js → chunk-EQJG44KE.js} +4 -4
- package/dist/bundle/{chunk-VDEXNNMH.js → chunk-HA35XN2Z.js} +6 -4
- package/dist/bundle/{chunk-HNN7EKIM.js → chunk-I6BKSGZQ.js} +333 -164
- package/dist/bundle/{chunk-U3MJQLZQ.js → chunk-IN25CJ3D.js} +13 -13
- package/dist/bundle/{chunk-EGR5IJCG.js → chunk-J5U2HKGZ.js} +32 -26
- package/dist/bundle/{chunk-OQR442B6.js → chunk-KIZT2MI6.js} +1 -1
- package/dist/bundle/{chunk-AGUCXSSM.js → chunk-KZQXOZFC.js} +5 -5
- package/dist/bundle/chunk-L4CMCC3V.js +34 -0
- package/dist/bundle/{chunk-OYNSFQ7K.js → chunk-LPUFOWL3.js} +1 -1
- package/dist/bundle/{chunk-T4TTRFP5.js → chunk-M3IWROIF.js} +7 -7
- package/dist/bundle/{chunk-ENXO43TV.js → chunk-MQTTVQ3V.js} +6 -6
- package/dist/bundle/{chunk-G74QMORP.js → chunk-NJ2I4KFZ.js} +2 -2
- package/dist/bundle/{chunk-PHPNA2HU.js → chunk-NKP3RUM4.js} +11 -11
- package/dist/bundle/{chunk-VDATXIO4.js → chunk-NMVFFWF2.js} +6 -6
- package/dist/bundle/{chunk-KOWQVHXI.js → chunk-NTF34HJP.js} +3 -3
- package/dist/bundle/{chunk-JO45BOYE.js → chunk-NUVBC3LJ.js} +8 -3
- package/dist/bundle/{chunk-UIVLDKWT.js → chunk-O7CBGHI7.js} +1 -1
- package/dist/bundle/{chunk-VVA4555T.js → chunk-OFDMD3YF.js} +8 -8
- package/dist/bundle/{chunk-OC4RRFKH.js → chunk-OWHF6BON.js} +4 -4
- package/dist/bundle/{chunk-HO53POQG.js → chunk-P4YBABUC.js} +5 -40
- package/dist/bundle/{chunk-TUD4MU7S.js → chunk-QCXYJKPF.js} +2 -2
- package/dist/bundle/{chunk-JW7BMJ6O.js → chunk-RBC7JQ4Y.js} +2 -2
- package/dist/bundle/{chunk-5NF7M4MN.js → chunk-RFRI2HFT.js} +1 -1
- package/dist/bundle/{chunk-MTX5EDYJ.js → chunk-TKNCJMYN.js} +1096 -499
- package/dist/bundle/{chunk-PHYDBR5M.js → chunk-TRRRRGMI.js} +2 -2
- package/dist/bundle/{chunk-KVLCIZUK.js → chunk-TTTDZOBW.js} +3 -3
- package/dist/bundle/{chunk-AVUIWZTP.js → chunk-ULFTCR5W.js} +2 -2
- package/dist/bundle/{chunk-IYKRHDX6.js → chunk-VHO66SMY.js} +174 -45
- package/dist/bundle/{chunk-XZ2ZHIAO.js → chunk-VVKEWWSO.js} +1 -1
- package/dist/bundle/{chunk-BI5YJZJB.js → chunk-WIRDTH3J.js} +115 -29
- package/dist/bundle/{chunk-4SQB5VKL.js → chunk-WOQGUIXE.js} +1 -1
- package/dist/bundle/{chunk-OSBAISA5.js → chunk-XDOPONC3.js} +8 -13
- package/dist/bundle/{chunk-3MAYYFKY.js → chunk-Y3AQHPAJ.js} +1 -1
- package/dist/bundle/{chunk-T5RM4Y35.js → chunk-Y4LCSCSH.js} +3 -3
- package/dist/bundle/{chunk-Z6TRIW2O.js → chunk-YPABTT7A.js} +8 -8
- package/dist/bundle/{chunk-6F6K3LWV.js → chunk-YQ64ZNLD.js} +14 -13
- package/dist/bundle/{chunk-JRTZ5I6M.js → chunk-ZFMOPKPT.js} +2 -2
- package/dist/bundle/command-contract-SOTDPG22.js +31 -0
- package/dist/bundle/{decode-AMQVTEMW.js → decode-7U4SXPAN.js} +4 -4
- package/dist/bundle/{echarts-ECYONFQJ.js → echarts-GKEZEAL7.js} +2 -2
- package/dist/bundle/{embed-VZYBZEWI.js → embed-IDZDQMSW.js} +5 -5
- package/dist/bundle/{embedder-GSWBGHRK.js → embedder-RY5R2PGO.js} +8 -8
- package/dist/bundle/{entry-LALZILY4.js → entry-P6YZ3ZV6.js} +8 -5
- package/dist/bundle/{first-run-LEAI623Q.js → first-run-66KTCVQK.js} +9 -9
- package/dist/bundle/first-screen-NY46X6QU.js +29 -0
- package/dist/bundle/{identity-54HA5GN6.js → identity-GXVKGCNU.js} +3 -3
- package/dist/bundle/{instructions-AXLQQS3G.js → instructions-P5E34PQR.js} +1 -1
- package/dist/bundle/{mcp-VVMPUDSL.js → mcp-FUSDPAOL.js} +2 -2
- package/dist/bundle/{node-7JHC5K77.js → node-GKPRXS5Y.js} +2 -2
- package/dist/bundle/{node-sqlite-LYJEK46T.js → node-sqlite-VUXFVPJ6.js} +10 -4
- package/dist/bundle/{oauth-BROPKI3K.js → oauth-7SQIPMOY.js} +6 -6
- package/dist/bundle/{open-C6XQ46JK.js → open-W3BN2SIO.js} +4 -3
- package/dist/bundle/{openai-VWSU7ZDD.js → openai-LQTK3ZMC.js} +13 -13
- package/dist/bundle/{process-QKEFL5HL.js → process-U2P5Z6UF.js} +1 -1
- package/dist/bundle/{program-ACY7O33O.js → program-DIPSLR6O.js} +48 -48
- package/dist/bundle/{prompt-EGULVW2F.js → prompt-GESHKSM5.js} +4 -4
- package/dist/bundle/{proxy-transport-KIMADLQ2.js → proxy-transport-C2EUUT32.js} +4 -4
- package/dist/bundle/{recognize-UMTKLWVR.js → recognize-FEQTIJET.js} +3 -3
- package/dist/bundle/{remote-DABI7PSQ.js → remote-UXOPBPKS.js} +6 -6
- package/dist/bundle/{rerank-ZFATWWBE.js → rerank-L4JM4REK.js} +6 -6
- package/dist/bundle/{serve-B7YYCMGN.js → serve-DDWW44DB.js} +10 -9
- package/dist/bundle/{server-DGKZISZH.js → server-UTWBIZHB.js} +32 -32
- package/dist/bundle/server-ZI7WDAW6.js +56 -0
- package/dist/bundle/{state-AQ2PABA5.js → state-EV7FGEK4.js} +5 -5
- package/dist/bundle/{store-46GJTFLJ.js → store-EXBUF4OG.js} +11 -10
- package/dist/bundle/store-maintenance-command-UBZE2Z6T.js +46 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +6 -4
- package/dist/commands/context.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +5 -0
- package/dist/reasons.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-452UZ2PU.js +0 -3603
- package/dist/bundle/command-contract-GV67H22L.js +0 -32
- package/dist/bundle/first-screen-MOCVLE23.js +0 -30
- package/dist/bundle/server-UC7UWUIS.js +0 -56
- package/dist/bundle/store-maintenance-command-FCFKHGRM.js +0 -45
- /package/dist/bundle/{chunk-HPXYN7F3.js → chunk-NUN6OGOV.js} +0 -0
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
resolvePaths
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-34USFPBF.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/path.js
|
|
11
11
|
import { join } from "node:path";
|
|
12
12
|
var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
|
|
13
13
|
var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
|
|
@@ -3,15 +3,15 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
readSharedSection,
|
|
5
5
|
writeSharedSection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NMVFFWF2.js";
|
|
7
7
|
import {
|
|
8
8
|
CliError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EARO464A.js";
|
|
10
10
|
import {
|
|
11
11
|
__name
|
|
12
12
|
} from "./chunk-ZVVMGPBJ.js";
|
|
13
13
|
|
|
14
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
|
|
15
15
|
var PERMISSION_ANSWERS = ["readonly", "allow"];
|
|
16
16
|
var QUESTIONS = ["languages", "tools", "permissions"];
|
|
17
17
|
var SECTION = "setup";
|
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
CliError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EARO464A.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
|
|
11
11
|
var MAX_BUFFERED_INPUT = 16 * 1024 * 1024;
|
|
12
12
|
var MAX_SECRET_INPUT = 64 * 1024;
|
|
13
13
|
var policies = /* @__PURE__ */ new WeakMap();
|
|
@@ -3,15 +3,18 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
answerOf,
|
|
5
5
|
messengerContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WIRDTH3J.js";
|
|
7
7
|
import {
|
|
8
|
+
FETCHING,
|
|
8
9
|
RULES_VERSION,
|
|
9
10
|
applyTaskRulesOnArrival,
|
|
11
|
+
capability,
|
|
10
12
|
chatEventAnswer,
|
|
11
13
|
memberAnswer,
|
|
12
14
|
newSendId,
|
|
13
15
|
onlineDeps,
|
|
14
16
|
openRequestTask,
|
|
17
|
+
patiently,
|
|
15
18
|
pollVoteAnswer,
|
|
16
19
|
queryTerms,
|
|
17
20
|
senderIsMe,
|
|
@@ -20,7 +23,7 @@ import {
|
|
|
20
23
|
syncsOneChat,
|
|
21
24
|
typedQuery,
|
|
22
25
|
withQuery
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4JOKO4IW.js";
|
|
24
27
|
import {
|
|
25
28
|
stringWidth,
|
|
26
29
|
wrapAnsi
|
|
@@ -45,38 +48,39 @@ import {
|
|
|
45
48
|
modelTarget,
|
|
46
49
|
nextStep,
|
|
47
50
|
outputFor,
|
|
51
|
+
parseDuration,
|
|
48
52
|
recalledAccount,
|
|
49
53
|
recordLogFor,
|
|
50
54
|
renderAnswer,
|
|
51
55
|
snakeKeys,
|
|
52
56
|
storeTable,
|
|
53
57
|
withoutProviderRefs
|
|
54
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-AL36NHO6.js";
|
|
55
59
|
import {
|
|
56
60
|
failureKey
|
|
57
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-YPABTT7A.js";
|
|
58
62
|
import {
|
|
59
63
|
envName
|
|
60
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-C34IDOA5.js";
|
|
61
65
|
import {
|
|
62
66
|
holdLock,
|
|
63
67
|
lockPath,
|
|
64
68
|
releaseLock,
|
|
65
69
|
servingProfiles,
|
|
66
70
|
takeLock
|
|
67
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-NTF34HJP.js";
|
|
68
72
|
import {
|
|
69
73
|
holdersOf
|
|
70
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-KIZT2MI6.js";
|
|
71
75
|
import {
|
|
72
76
|
checkedOptions,
|
|
73
77
|
range
|
|
74
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-RBC7JQ4Y.js";
|
|
75
79
|
import {
|
|
76
80
|
messagesFor,
|
|
77
81
|
systemFor,
|
|
78
82
|
validateImages
|
|
79
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-QCXYJKPF.js";
|
|
80
84
|
import {
|
|
81
85
|
MIGRATIONS,
|
|
82
86
|
drainNoteIndex,
|
|
@@ -105,19 +109,19 @@ import {
|
|
|
105
109
|
storeClients,
|
|
106
110
|
storeContents,
|
|
107
111
|
vectorIndexCounts
|
|
108
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-7FOT4XD2.js";
|
|
109
113
|
import {
|
|
110
114
|
queryFieldsOf
|
|
111
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-I6BKSGZQ.js";
|
|
112
116
|
import {
|
|
113
117
|
storePath
|
|
114
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-TRRRRGMI.js";
|
|
115
119
|
import {
|
|
116
120
|
openCache
|
|
117
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-XDOPONC3.js";
|
|
118
122
|
import {
|
|
119
123
|
readSecret
|
|
120
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-3EZ43DAF.js";
|
|
121
125
|
import {
|
|
122
126
|
Credentials,
|
|
123
127
|
pathsAreOverridden,
|
|
@@ -125,7 +129,7 @@ import {
|
|
|
125
129
|
singleLine,
|
|
126
130
|
visibleControls,
|
|
127
131
|
writeSecurely
|
|
128
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-34USFPBF.js";
|
|
129
133
|
import {
|
|
130
134
|
CliError,
|
|
131
135
|
array,
|
|
@@ -150,7 +154,7 @@ import {
|
|
|
150
154
|
transform,
|
|
151
155
|
trim,
|
|
152
156
|
union
|
|
153
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-EARO464A.js";
|
|
154
158
|
import {
|
|
155
159
|
__commonJS,
|
|
156
160
|
__name,
|
|
@@ -5490,11 +5494,11 @@ var require_liquid_node = __commonJS({
|
|
|
5490
5494
|
}
|
|
5491
5495
|
});
|
|
5492
5496
|
|
|
5493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5497
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5494
5498
|
import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
|
|
5495
5499
|
import { dirname, resolve } from "node:path";
|
|
5496
5500
|
|
|
5497
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5501
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5498
5502
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5499
5503
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5500
5504
|
import { Transform } from "node:stream";
|
|
@@ -5601,7 +5605,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5601
5605
|
renameSync(pending, to);
|
|
5602
5606
|
}, "unsealFile");
|
|
5603
5607
|
|
|
5604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5605
5609
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5606
5610
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5607
5611
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5625,7 +5629,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5625
5629
|
};
|
|
5626
5630
|
}, "compatibilityOf");
|
|
5627
5631
|
|
|
5628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5629
5633
|
import { createHash as createHash2 } from "node:crypto";
|
|
5630
5634
|
var COPY_MARK = "__repair_";
|
|
5631
5635
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5879,7 +5883,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5879
5883
|
return found;
|
|
5880
5884
|
}, "deleteCopy");
|
|
5881
5885
|
|
|
5882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5883
5887
|
import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
|
|
5884
5888
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
5885
5889
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
|
|
@@ -5926,7 +5930,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
|
|
|
5926
5930
|
renderAnswer(this, outputFor(this), itemOf(answer));
|
|
5927
5931
|
}), "storeInfoCommand");
|
|
5928
5932
|
|
|
5929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5933
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
5930
5934
|
var ENCRYPT_OPTION = [
|
|
5931
5935
|
"--encrypt",
|
|
5932
5936
|
"compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
|
|
@@ -5945,7 +5949,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
5945
5949
|
return password;
|
|
5946
5950
|
}, "passwordOf");
|
|
5947
5951
|
|
|
5948
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
5949
5953
|
import { existsSync as existsSync3, readFileSync } from "node:fs";
|
|
5950
5954
|
import { join } from "node:path";
|
|
5951
5955
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
@@ -6116,7 +6120,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6116
6120
|
}, "problem");
|
|
6117
6121
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6118
6122
|
|
|
6119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6120
6124
|
import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
|
|
6121
6125
|
import { join as join2 } from "node:path";
|
|
6122
6126
|
var ANSWERED_KEPT = 1e3;
|
|
@@ -6169,7 +6173,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6169
6173
|
}, "recordReply");
|
|
6170
6174
|
var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
|
|
6171
6175
|
|
|
6172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6176
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6173
6177
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6174
6178
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6175
6179
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -6275,7 +6279,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
6275
6279
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
6276
6280
|
}, "filled");
|
|
6277
6281
|
|
|
6278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
6279
6283
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
6280
6284
|
var TEMPLATE_LIMITS = {
|
|
6281
6285
|
parse: 32768,
|
|
@@ -6435,7 +6439,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6435
6439
|
}
|
|
6436
6440
|
}, "renderReplyTemplate");
|
|
6437
6441
|
|
|
6438
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
6439
6443
|
var DRY_RUN_DAYS = 7;
|
|
6440
6444
|
var PAGE = 500;
|
|
6441
6445
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -6549,7 +6553,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
6549
6553
|
}
|
|
6550
6554
|
}, "storedSince");
|
|
6551
6555
|
|
|
6552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6556
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
6553
6557
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
6554
6558
|
const host = new URL(baseUrl).host;
|
|
6555
6559
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -6580,7 +6584,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
6580
6584
|
};
|
|
6581
6585
|
}, "embeddingKeys");
|
|
6582
6586
|
|
|
6583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
6584
6588
|
var options = strictObject({
|
|
6585
6589
|
temperature: range(0, 2),
|
|
6586
6590
|
top_p: range(0, 1),
|
|
@@ -6629,7 +6633,7 @@ var openai = {
|
|
|
6629
6633
|
}, "complete")
|
|
6630
6634
|
};
|
|
6631
6635
|
|
|
6632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6636
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
6633
6637
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
6634
6638
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
6635
6639
|
if (deps.signal?.aborted)
|
|
@@ -6644,7 +6648,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
6644
6648
|
if (!adapter && target.provider === "openai")
|
|
6645
6649
|
adapter = openai;
|
|
6646
6650
|
if (!adapter && target.provider === "anthropic")
|
|
6647
|
-
adapter = (await import("./anthropic-
|
|
6651
|
+
adapter = (await import("./anthropic-F25RHYV2.js")).anthropic;
|
|
6648
6652
|
if (!adapter)
|
|
6649
6653
|
throw new CliError("validation_error", `no model adapter for ${target.provider}`);
|
|
6650
6654
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -6685,7 +6689,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
6685
6689
|
}, "complete")
|
|
6686
6690
|
}), "modelGateway");
|
|
6687
6691
|
|
|
6688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
6689
6693
|
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
|
|
6690
6694
|
import { join as join3 } from "node:path";
|
|
6691
6695
|
var shape = strictObject({
|
|
@@ -6710,7 +6714,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
6710
6714
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
6711
6715
|
}, "mayModelReply");
|
|
6712
6716
|
|
|
6713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6717
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
6714
6718
|
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
|
|
6715
6719
|
ai: true
|
|
6716
6720
|
}) => async (rule2, message, chat, now) => {
|
|
@@ -6757,7 +6761,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
6757
6761
|
return result2;
|
|
6758
6762
|
}, "replyRenderer");
|
|
6759
6763
|
|
|
6760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
6761
6765
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
6762
6766
|
var NO_RULES = "no rules";
|
|
6763
6767
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -6850,7 +6854,84 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
6850
6854
|
return { skip: why };
|
|
6851
6855
|
}, "replyTo");
|
|
6852
6856
|
|
|
6853
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
|
|
6858
|
+
var START_SYNC_DELAY_MS = 3e4;
|
|
6859
|
+
var START_SYNC_BUDGET_MS = 5 * 6e4;
|
|
6860
|
+
var START_SYNC_WINDOW_MS = 7 * 864e5;
|
|
6861
|
+
var START_SYNC_PER_CHAT = 500;
|
|
6862
|
+
var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note, warn, delayMs = START_SYNC_DELAY_MS, budgetMs = START_SYNC_BUDGET_MS, windowMs = START_SYNC_WINDOW_MS, now = Date.now }) => {
|
|
6863
|
+
const controller = new AbortController();
|
|
6864
|
+
let timer;
|
|
6865
|
+
let pass = Promise.resolve();
|
|
6866
|
+
let started = false;
|
|
6867
|
+
let done;
|
|
6868
|
+
const run = /* @__PURE__ */ __name(async () => {
|
|
6869
|
+
const stop = AbortSignal.any([controller.signal, AbortSignal.timeout(budgetMs)]);
|
|
6870
|
+
const floor = now() - windowMs;
|
|
6871
|
+
const moved = [];
|
|
6872
|
+
for (const chat of await chats(stop)) {
|
|
6873
|
+
const lastAt = Date.parse(chat.lastMessageAt ?? "");
|
|
6874
|
+
if (Number.isNaN(lastAt) || lastAt < floor)
|
|
6875
|
+
continue;
|
|
6876
|
+
moved.push({ chat, lastAt, held: await newestHeld(chat.id) });
|
|
6877
|
+
}
|
|
6878
|
+
const anywhere = moved.reduce((top, { held }) => held === void 0 ? top : Math.max(top, held), -Infinity);
|
|
6879
|
+
if (!Number.isFinite(anywhere))
|
|
6880
|
+
return;
|
|
6881
|
+
const behind = moved.filter(({ lastAt, held }) => lastAt > (held ?? anywhere)).sort((one, other) => other.lastAt - one.lastAt);
|
|
6882
|
+
if (behind.length === 0)
|
|
6883
|
+
return;
|
|
6884
|
+
const summary = { chats: 0, fetched: 0, failed: 0, stopped: false };
|
|
6885
|
+
done = summary;
|
|
6886
|
+
for (const { chat, held } of behind) {
|
|
6887
|
+
if (stop.aborted)
|
|
6888
|
+
break;
|
|
6889
|
+
try {
|
|
6890
|
+
summary.fetched += (await fetch2(chat.id, Math.max(held ?? anywhere, floor), stop)).fetched;
|
|
6891
|
+
summary.chats += 1;
|
|
6892
|
+
} catch (error) {
|
|
6893
|
+
if (stop.aborted)
|
|
6894
|
+
break;
|
|
6895
|
+
summary.failed += 1;
|
|
6896
|
+
const errorCode = failureKey(error);
|
|
6897
|
+
warn({
|
|
6898
|
+
code: "start_sync_chat_failed",
|
|
6899
|
+
chatId: chat.id,
|
|
6900
|
+
errorCode,
|
|
6901
|
+
text: `what ${chat.id} received while serve was down was not fetched: ${errorCode}`
|
|
6902
|
+
});
|
|
6903
|
+
}
|
|
6904
|
+
}
|
|
6905
|
+
summary.stopped = stop.aborted && summary.chats + summary.failed < behind.length;
|
|
6906
|
+
note({
|
|
6907
|
+
code: "start_sync",
|
|
6908
|
+
text: `caught up ${summary.fetched} message(s) in ${summary.chats} chat(s) that moved while serve was down` + (summary.stopped ? ` \u2014 stopped at the time limit, ${behind.length - summary.chats - summary.failed} left` : "")
|
|
6909
|
+
});
|
|
6910
|
+
}, "run");
|
|
6911
|
+
return {
|
|
6912
|
+
start: /* @__PURE__ */ __name(() => {
|
|
6913
|
+
if (started || controller.signal.aborted)
|
|
6914
|
+
return;
|
|
6915
|
+
started = true;
|
|
6916
|
+
timer = setTimeout(() => {
|
|
6917
|
+
pass = run().catch((error) => {
|
|
6918
|
+
if (controller.signal.aborted)
|
|
6919
|
+
return;
|
|
6920
|
+
const errorCode = failureKey(error);
|
|
6921
|
+
warn({ code: "start_sync_failed", errorCode, text: `the catch-up on start failed: ${errorCode}` });
|
|
6922
|
+
});
|
|
6923
|
+
}, delayMs);
|
|
6924
|
+
}, "start"),
|
|
6925
|
+
stop: /* @__PURE__ */ __name(async () => {
|
|
6926
|
+
controller.abort();
|
|
6927
|
+
clearTimeout(timer);
|
|
6928
|
+
await pass;
|
|
6929
|
+
}, "stop"),
|
|
6930
|
+
summary: /* @__PURE__ */ __name(() => done, "summary")
|
|
6931
|
+
};
|
|
6932
|
+
}, "startSync");
|
|
6933
|
+
|
|
6934
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
6854
6935
|
var FIRST_FETCH_MS = 6e4;
|
|
6855
6936
|
var DAY_MS = 864e5;
|
|
6856
6937
|
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
@@ -6904,7 +6985,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
|
|
|
6904
6985
|
};
|
|
6905
6986
|
}, "memberFetches");
|
|
6906
6987
|
|
|
6907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
6908
6989
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
6909
6990
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
6910
6991
|
if (context.format === "pretty") {
|
|
@@ -6937,7 +7018,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
6937
7018
|
return context;
|
|
6938
7019
|
}, "recordDiagnostics");
|
|
6939
7020
|
|
|
6940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7021
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
6941
7022
|
var STEMS_EVERY_MS = 3e4;
|
|
6942
7023
|
var STEMS_SLICE_MS = 2e3;
|
|
6943
7024
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -6977,7 +7058,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
6977
7058
|
};
|
|
6978
7059
|
}, "stemFills");
|
|
6979
7060
|
|
|
6980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/render/messages.js
|
|
6981
7062
|
import { styleText } from "node:util";
|
|
6982
7063
|
var TIME_WIDTH = 8;
|
|
6983
7064
|
var INDENT = " ".repeat(TIME_WIDTH + 2);
|
|
@@ -7153,7 +7234,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
|
|
|
7153
7234
|
return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
|
|
7154
7235
|
}, "editedAt");
|
|
7155
7236
|
|
|
7156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
7157
7238
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
7158
7239
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
7159
7240
|
kind: attachment.kind,
|
|
@@ -7248,7 +7329,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
7248
7329
|
locale: messenger.app.locale
|
|
7249
7330
|
}), "viewOf");
|
|
7250
7331
|
|
|
7251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
7252
7333
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
7253
7334
|
value: value.value,
|
|
7254
7335
|
observed_at: value.observedAt,
|
|
@@ -7315,7 +7396,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
7315
7396
|
}
|
|
7316
7397
|
}, "watchEventItem");
|
|
7317
7398
|
|
|
7318
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7399
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
7319
7400
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
7320
7401
|
output: { entity: "watch_item" },
|
|
7321
7402
|
effects: REMOTE_READ,
|
|
@@ -7470,7 +7551,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
7470
7551
|
}
|
|
7471
7552
|
}, "describe");
|
|
7472
7553
|
|
|
7473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
7474
7555
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
7475
7556
|
const command = annotate(new Command("serve"), {
|
|
7476
7557
|
output: { entity: "serve_summary" },
|
|
@@ -7513,7 +7594,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
7513
7594
|
const counts = {};
|
|
7514
7595
|
const rules = replying(context, messenger, Date.parse(startedAt));
|
|
7515
7596
|
const tasks = tasking(context, warn);
|
|
7516
|
-
const { handled } = environmentOf(this);
|
|
7597
|
+
const { handled, startSyncDelayMs } = environmentOf(this);
|
|
7517
7598
|
const count3 = /* @__PURE__ */ __name((event) => {
|
|
7518
7599
|
counts[event.event] = (counts[event.event] ?? 0) + 1;
|
|
7519
7600
|
if (event.event === "message") {
|
|
@@ -7537,6 +7618,50 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
7537
7618
|
}).chats.fetchMembers(chatId, {}), "fetch"),
|
|
7538
7619
|
warn
|
|
7539
7620
|
});
|
|
7621
|
+
const fetching = messenger.fetching ?? FETCHING;
|
|
7622
|
+
const catchingUp = startSync({
|
|
7623
|
+
chats: /* @__PURE__ */ __name(async (stop) => {
|
|
7624
|
+
const list = capability(connection, "chats", "list its chats");
|
|
7625
|
+
const all = [];
|
|
7626
|
+
for (let offset = 0; ; ) {
|
|
7627
|
+
const page = await patiently(() => list({ offset, limit: 100 }), context.renderer.note, stop);
|
|
7628
|
+
for (const chat of page.items)
|
|
7629
|
+
all.push(chat);
|
|
7630
|
+
offset += page.items.length;
|
|
7631
|
+
if (!page.hasMore || page.items.length === 0)
|
|
7632
|
+
return all;
|
|
7633
|
+
}
|
|
7634
|
+
}, "chats"),
|
|
7635
|
+
newestHeld: /* @__PURE__ */ __name((chatId) => context.withStore(async (store, account) => {
|
|
7636
|
+
const [newest] = await store.messages.messagesWindow(account, chatId, {
|
|
7637
|
+
at: startedAt,
|
|
7638
|
+
before: 1,
|
|
7639
|
+
after: 0
|
|
7640
|
+
});
|
|
7641
|
+
return newest ? Date.parse(newest.timestamp) : void 0;
|
|
7642
|
+
}, { name: "serve catch-up" }), "newestHeld"),
|
|
7643
|
+
fetch: /* @__PURE__ */ __name((chatId, sinceMs, stop) => context.withStore((store, account) => servicesFor({
|
|
7644
|
+
...onlineDeps(messenger, connection, context.guard, {
|
|
7645
|
+
profile: context.profile,
|
|
7646
|
+
env: context.env
|
|
7647
|
+
}),
|
|
7648
|
+
store: /* @__PURE__ */ __name(async () => store, "store"),
|
|
7649
|
+
account: /* @__PURE__ */ __name(async () => account, "account")
|
|
7650
|
+
}).archive.fetch(chatId, {
|
|
7651
|
+
limit: START_SYNC_PER_CHAT,
|
|
7652
|
+
pageSize: fetching.page,
|
|
7653
|
+
pauseMs: parseDuration(fetching.pause, "pause"),
|
|
7654
|
+
sinceMs,
|
|
7655
|
+
catchUp: false,
|
|
7656
|
+
note: context.renderer.note,
|
|
7657
|
+
stop,
|
|
7658
|
+
onPage: /* @__PURE__ */ __name(() => {
|
|
7659
|
+
}, "onPage")
|
|
7660
|
+
}), { name: "serve catch-up" }), "fetch"),
|
|
7661
|
+
note,
|
|
7662
|
+
warn,
|
|
7663
|
+
...startSyncDelayMs === void 0 ? {} : { delayMs: startSyncDelayMs }
|
|
7664
|
+
});
|
|
7540
7665
|
const stems = stemFills({
|
|
7541
7666
|
withStore: /* @__PURE__ */ __name((work) => context.withStore((store) => work(store), { name: "serve stems" }), "withStore"),
|
|
7542
7667
|
warn
|
|
@@ -7551,12 +7676,15 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
7551
7676
|
rules.connected(open);
|
|
7552
7677
|
members.start();
|
|
7553
7678
|
stems.start();
|
|
7679
|
+
if (messenger.history !== "store" && typeof open.chats === "function")
|
|
7680
|
+
catchingUp.start();
|
|
7554
7681
|
}, "connected")
|
|
7555
7682
|
});
|
|
7556
7683
|
} finally {
|
|
7557
7684
|
await relaying;
|
|
7558
7685
|
await relay?.close();
|
|
7559
7686
|
rules.stop();
|
|
7687
|
+
await catchingUp.stop();
|
|
7560
7688
|
await members.stop();
|
|
7561
7689
|
await stems.stop();
|
|
7562
7690
|
await rules.settled();
|
|
@@ -7571,6 +7699,7 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
7571
7699
|
...rules.summary(),
|
|
7572
7700
|
...members.summary().fetched + members.summary().failed > 0 ? { members: members.summary() } : {},
|
|
7573
7701
|
...stems.summary().stemmed > 0 ? { stems: stems.summary() } : {},
|
|
7702
|
+
...catchingUp.summary() ? { caught_up: catchingUp.summary() } : {},
|
|
7574
7703
|
...tasks.summary()
|
|
7575
7704
|
}));
|
|
7576
7705
|
});
|
|
@@ -7686,7 +7815,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
7686
7815
|
};
|
|
7687
7816
|
}, "tasking");
|
|
7688
7817
|
|
|
7689
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
7690
7819
|
import { existsSync as existsSync6 } from "node:fs";
|
|
7691
7820
|
var PATH = "store tables list";
|
|
7692
7821
|
var STORE_TABLES_QUERY = {
|
|
@@ -7729,7 +7858,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
7729
7858
|
return tables;
|
|
7730
7859
|
}, "storeTablesCommand");
|
|
7731
7860
|
|
|
7732
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
7733
7862
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
7734
7863
|
var WORD_INDEX = "message_words";
|
|
7735
7864
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.553.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.75.0_commander@15._c8fb11a0c49a39da33a9d557d170ff7b/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
|
|
8
8
|
import { PassThrough, Writable } from "node:stream";
|
|
9
9
|
var lineReader = /* @__PURE__ */ __name((onMessage) => {
|
|
10
10
|
let rest = "";
|