@wirecat/tg-cli 0.101.0 → 0.102.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 +1 -1
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +14 -17
- package/dist/bot/transport.js.map +1 -1
- package/dist/bundle/{adapter-A3VD4Y6Z.js → adapter-M2HRSFFL.js} +90 -28
- package/dist/bundle/{all-profiles-UPVNHXB2.js → all-profiles-GOD2QNTK.js} +29 -8
- package/dist/bundle/{anthropic-IRKNWPIB.js → anthropic-LKU7RWMA.js} +3 -3
- package/dist/bundle/{bot-api-UNTQG2M5.js → bot-api-X3MPFVPL.js} +42 -46
- package/dist/bundle/{bot-history-V4RTY5K7.js → bot-history-OUMVVG22.js} +10 -10
- package/dist/bundle/{bun-2JZPG2NL.js → bun-LIZ6MKFS.js} +2 -2
- package/dist/bundle/{bun-sqlite-TZHKM225.js → bun-sqlite-2IFQYQ44.js} +2 -2
- package/dist/bundle/{chunk-VA5YEJS3.js → chunk-264DAFJV.js} +4 -4
- package/dist/bundle/{chunk-ZV24I2UJ.js → chunk-2SUTCDGO.js} +1 -1
- package/dist/bundle/{chunk-BX6HH4F6.js → chunk-334UBWOB.js} +10 -10
- package/dist/bundle/{chunk-2DGOFLDA.js → chunk-4PDEQL6T.js} +1 -1
- package/dist/bundle/chunk-4QB4WDLT.js +922 -0
- package/dist/bundle/{chunk-MLLJ74LM.js → chunk-5D6OJREA.js} +1 -1
- package/dist/bundle/{chunk-RF54YDBB.js → chunk-5DFGJPT6.js} +4 -4
- package/dist/bundle/{chunk-TGREFJVA.js → chunk-5VSR5ENL.js} +7 -7
- package/dist/bundle/{chunk-VCGL2ETF.js → chunk-AUOXTGTU.js} +1 -1
- package/dist/bundle/{chunk-X4Y2ROJI.js → chunk-BBC546ZA.js} +91 -2
- package/dist/bundle/{chunk-QOWSVDPZ.js → chunk-BQYTIYGB.js} +106 -95
- package/dist/bundle/{chunk-XCKD54TN.js → chunk-CLWYQNSC.js} +5 -5
- package/dist/bundle/{chunk-7CBUCTB6.js → chunk-CRZPQQHE.js} +27 -33
- package/dist/bundle/chunk-DE7LFMY2.js +440 -0
- package/dist/bundle/{chunk-ODSVNH3H.js → chunk-ENE5CSVY.js} +2373 -1266
- package/dist/bundle/{chunk-G2US6LJB.js → chunk-ERQDBK5I.js} +1 -1
- package/dist/bundle/{chunk-W2336E7Y.js → chunk-F2TG3BA2.js} +4 -4
- package/dist/bundle/{chunk-DYNSP6FW.js → chunk-FBWOQMPE.js} +1442 -769
- package/dist/bundle/{chunk-5TPT2S2Z.js → chunk-FOUE7XLK.js} +1 -1
- package/dist/bundle/{chunk-RVCS7Q3A.js → chunk-GSKFAE3I.js} +1287 -512
- package/dist/bundle/{chunk-6IPY2QRG.js → chunk-HLAZ65AW.js} +1 -1
- package/dist/bundle/{chunk-A5JSTZZZ.js → chunk-JFSVXMN6.js} +2 -2
- package/dist/bundle/{chunk-N5UFBWDM.js → chunk-M5UH5CF3.js} +5 -7
- package/dist/bundle/{chunk-F7TDFWXY.js → chunk-MGG7JSNO.js} +2 -2
- package/dist/bundle/{chunk-H6OXALTJ.js → chunk-OCWARAFE.js} +1 -1
- package/dist/bundle/{chunk-S7ZNLLY5.js → chunk-OHBHHBYL.js} +2 -2
- package/dist/bundle/{chunk-5GKXETRP.js → chunk-PSH7K6TL.js} +610 -51
- package/dist/bundle/{chunk-VYDTI254.js → chunk-Q2NYEX4A.js} +53 -34
- package/dist/bundle/{chunk-G3ZRY436.js → chunk-QEPZUFPL.js} +46 -46
- package/dist/bundle/{chunk-BXQS5RCE.js → chunk-QL7CQ6VZ.js} +253 -78
- package/dist/bundle/{chunk-NC5WS7OP.js → chunk-SRU3OF4R.js} +1 -1
- package/dist/bundle/{chunk-PUBS2F5J.js → chunk-TV5DGHBT.js} +242 -242
- package/dist/bundle/{chunk-ZEOCU24Z.js → chunk-TXBUDJ3P.js} +1 -1
- package/dist/bundle/{chunk-ACGTFLEB.js → chunk-U4RRZUNP.js} +8 -8
- package/dist/bundle/{chunk-LPB2MDUW.js → chunk-UK3GAN7Q.js} +6 -6
- package/dist/bundle/{chunk-UN6CKIBN.js → chunk-UR6ASUSG.js} +8 -5
- package/dist/bundle/{chunk-U46UNBMT.js → chunk-V52SBQYF.js} +236 -13
- package/dist/bundle/{chunk-S2JSZWEC.js → chunk-VUJ34PEQ.js} +9 -9
- package/dist/bundle/{chunk-QYVVRQTN.js → chunk-W5EB4JLV.js} +2 -2
- package/dist/bundle/{chunk-3KHKYYCR.js → chunk-WMOEOVWZ.js} +1 -0
- package/dist/bundle/{chunk-VRSN7VLO.js → chunk-WVEHUKCZ.js} +1 -1
- package/dist/bundle/{chunk-64DK7S4F.js → chunk-XXTJUZMB.js} +1 -1
- package/dist/bundle/{chunk-54R2GDQ3.js → chunk-Y4XSWI22.js} +3 -3
- package/dist/bundle/{chunk-4ZS73HTJ.js → chunk-YHB57PFN.js} +1 -1
- package/dist/bundle/{chunk-G77QOTXE.js → chunk-ZRNRQFTF.js} +1 -1
- package/dist/bundle/{command-contract-TKDI7E56.js → command-contract-A6VZN3ZR.js} +11 -11
- package/dist/bundle/{echarts-QZ6PR3VC.js → echarts-27W2CIBD.js} +2 -2
- package/dist/bundle/{embed-UBXCXSRD.js → embed-FGJ273X2.js} +2 -2
- package/dist/bundle/{embedder-B4ZTKC23.js → embedder-7ELL3CQ3.js} +5 -5
- package/dist/bundle/{entry-BTUTHO5M.js → entry-SEE5YWIX.js} +3 -3
- package/dist/bundle/{first-run-UC4HRIFV.js → first-run-BD7FEC3W.js} +5 -5
- package/dist/bundle/{first-screen-SMCX6YKY.js → first-screen-ASZV6LSA.js} +12 -12
- package/dist/bundle/{identity-QSDEGDH7.js → identity-QR4F42T6.js} +1 -1
- package/dist/bundle/{instructions-BBGLZKO3.js → instructions-L74K64PV.js} +1 -1
- package/dist/bundle/{node-LZZX22VR.js → node-RSL3HANO.js} +2 -2
- package/dist/bundle/{node-sqlite-BPGT6T5U.js → node-sqlite-7R3PYQGJ.js} +2 -2
- package/dist/bundle/{oauth-XNE2KPKJ.js → oauth-4ESGXF6U.js} +5 -5
- package/dist/bundle/{open-SXGYZLB5.js → open-DFYEUGTA.js} +1 -1
- package/dist/bundle/{process-GPUXC4PG.js → process-RMV3AKLB.js} +1 -1
- package/dist/bundle/{program-NEXEAL7T.js → program-PIUYQHBF.js} +54 -59
- package/dist/bundle/{prompt-SORGLEYI.js → prompt-H7GYQQLL.js} +2 -2
- package/dist/bundle/{recognize-UJBXORVD.js → recognize-3GMOLZF4.js} +3 -3
- package/dist/bundle/{remote-W72AR7KH.js → remote-IRWTCI2B.js} +3 -3
- package/dist/bundle/{rerank-3Y2VZM3J.js → rerank-W3OSXXBN.js} +3 -3
- package/dist/bundle/{serve-VDZIVOPR.js → serve-ZCPO44NO.js} +7 -7
- package/dist/bundle/{server-ZFHN4GUF.js → server-FXU4QFRB.js} +35 -32
- package/dist/bundle/{server-BERXP4GW.js → server-YWL4HDOP.js} +68 -59
- package/dist/bundle/{state-DGR4EE3E.js → state-MJPTDIB5.js} +3 -3
- package/dist/bundle/{store-MRCFSCZD.js → store-6VNQG56O.js} +7 -7
- package/dist/bundle/store-maintenance-command-62TQTMER.js +43 -0
- package/dist/bundle/tg.js +2 -2
- package/dist/telegram/sending.d.ts.map +1 -1
- package/dist/telegram/sending.js +52 -3
- package/dist/telegram/sending.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/chunk-22PQUX72.js +0 -190
- package/dist/bundle/chunk-CJ6IYCYP.js +0 -583
- package/dist/bundle/chunk-NKJJJAIJ.js +0 -237
- package/dist/bundle/chunk-NMGO6LW6.js +0 -1950
- package/dist/bundle/chunk-OILBDLWL.js +0 -724
- package/dist/bundle/chunk-OPBTNQ35.js +0 -1007
- package/dist/bundle/store-maintenance-command-DCMZDMYS.js +0 -46
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { createRequire as __tgRequire } from "node:module";
|
|
2
2
|
const require = __tgRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
renderMessages
|
|
5
|
-
} from "./chunk-22PQUX72.js";
|
|
6
3
|
import {
|
|
7
4
|
answerOf,
|
|
8
5
|
messengerContext
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PSH7K6TL.js";
|
|
10
7
|
import {
|
|
11
8
|
RULES_VERSION,
|
|
12
9
|
applyTaskRulesOnArrival,
|
|
13
10
|
chatEventAnswer,
|
|
14
11
|
memberAnswer,
|
|
12
|
+
newSendId,
|
|
15
13
|
onlineDeps,
|
|
16
14
|
openRequestTask,
|
|
17
15
|
pollVoteAnswer,
|
|
@@ -21,10 +19,11 @@ import {
|
|
|
21
19
|
syncsOneChat,
|
|
22
20
|
typedQuery,
|
|
23
21
|
withQuery
|
|
24
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FBWOQMPE.js";
|
|
25
23
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
stringWidth,
|
|
25
|
+
wrapAnsi
|
|
26
|
+
} from "./chunk-ZZLKX62Z.js";
|
|
28
27
|
import {
|
|
29
28
|
Command,
|
|
30
29
|
LOCAL_READ,
|
|
@@ -32,12 +31,14 @@ import {
|
|
|
32
31
|
REMOTE_READ,
|
|
33
32
|
REMOTE_WRITE,
|
|
34
33
|
annotate,
|
|
34
|
+
codeOf,
|
|
35
|
+
currentRun,
|
|
35
36
|
destroysNothing,
|
|
36
37
|
endpoint,
|
|
37
38
|
environmentOf,
|
|
38
|
-
failureKey,
|
|
39
39
|
itemOf,
|
|
40
40
|
jsonlRecords,
|
|
41
|
+
levelFor,
|
|
41
42
|
lineOf,
|
|
42
43
|
listOf,
|
|
43
44
|
modelTarget,
|
|
@@ -49,34 +50,32 @@ import {
|
|
|
49
50
|
snakeKeys,
|
|
50
51
|
storeTable,
|
|
51
52
|
withoutProviderRefs
|
|
52
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-GSKFAE3I.js";
|
|
53
54
|
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
levelFor
|
|
57
|
-
} from "./chunk-OPBTNQ35.js";
|
|
55
|
+
failureKey
|
|
56
|
+
} from "./chunk-DE7LFMY2.js";
|
|
58
57
|
import {
|
|
59
58
|
envName
|
|
60
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-2SUTCDGO.js";
|
|
61
60
|
import {
|
|
62
61
|
holdLock,
|
|
63
62
|
lockPath,
|
|
64
63
|
releaseLock,
|
|
65
64
|
servingProfiles,
|
|
66
65
|
takeLock
|
|
67
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-W5EB4JLV.js";
|
|
68
67
|
import {
|
|
69
68
|
holdersOf
|
|
70
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-WVEHUKCZ.js";
|
|
71
70
|
import {
|
|
72
71
|
checkedOptions,
|
|
73
72
|
range
|
|
74
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-SRU3OF4R.js";
|
|
75
74
|
import {
|
|
76
75
|
messagesFor,
|
|
77
76
|
systemFor,
|
|
78
77
|
validateImages
|
|
79
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-OCWARAFE.js";
|
|
80
79
|
import {
|
|
81
80
|
MIGRATIONS,
|
|
82
81
|
drainNoteIndex,
|
|
@@ -105,23 +104,25 @@ import {
|
|
|
105
104
|
storeClients,
|
|
106
105
|
storeContents,
|
|
107
106
|
vectorIndexCounts
|
|
108
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-TV5DGHBT.js";
|
|
109
108
|
import {
|
|
110
109
|
queryFieldsOf
|
|
111
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-QEPZUFPL.js";
|
|
112
111
|
import {
|
|
113
112
|
storePath
|
|
114
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-ZRNRQFTF.js";
|
|
115
114
|
import {
|
|
116
115
|
openCache
|
|
117
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-CLWYQNSC.js";
|
|
118
117
|
import {
|
|
119
118
|
readSecret
|
|
120
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-MGG7JSNO.js";
|
|
121
120
|
import {
|
|
122
121
|
Credentials,
|
|
123
122
|
pathsAreOverridden,
|
|
124
123
|
resolvePaths,
|
|
124
|
+
singleLine,
|
|
125
|
+
visibleControls,
|
|
125
126
|
writeSecurely
|
|
126
127
|
} from "./chunk-DG62L57H.js";
|
|
127
128
|
import {
|
|
@@ -2433,10 +2434,10 @@ var require_liquid_node = __commonJS({
|
|
|
2433
2434
|
readHashes(jekyllStyle) {
|
|
2434
2435
|
const hashes = [];
|
|
2435
2436
|
while (true) {
|
|
2436
|
-
const
|
|
2437
|
-
if (!
|
|
2437
|
+
const hash2 = this.readHash(jekyllStyle);
|
|
2438
|
+
if (!hash2)
|
|
2438
2439
|
return hashes;
|
|
2439
|
-
hashes.push(
|
|
2440
|
+
hashes.push(hash2);
|
|
2440
2441
|
}
|
|
2441
2442
|
}
|
|
2442
2443
|
readHash(jekyllStyle) {
|
|
@@ -2705,16 +2706,16 @@ var require_liquid_node = __commonJS({
|
|
|
2705
2706
|
constructor(input, jekyllStyle) {
|
|
2706
2707
|
this.hash = {};
|
|
2707
2708
|
const tokenizer = input instanceof Tokenizer ? input : new Tokenizer(input, {});
|
|
2708
|
-
for (const
|
|
2709
|
-
this.hash[
|
|
2709
|
+
for (const hash2 of tokenizer.readHashes(jekyllStyle)) {
|
|
2710
|
+
this.hash[hash2.name.content] = hash2.value;
|
|
2710
2711
|
}
|
|
2711
2712
|
}
|
|
2712
2713
|
*render(ctx) {
|
|
2713
|
-
const
|
|
2714
|
+
const hash2 = {};
|
|
2714
2715
|
for (const key of Object.keys(this.hash)) {
|
|
2715
|
-
|
|
2716
|
+
hash2[key] = this.hash[key] === void 0 ? true : yield evalToken(this.hash[key], ctx);
|
|
2716
2717
|
}
|
|
2717
|
-
return
|
|
2718
|
+
return hash2;
|
|
2718
2719
|
}
|
|
2719
2720
|
};
|
|
2720
2721
|
function createTagClass(options2) {
|
|
@@ -2726,8 +2727,8 @@ var require_liquid_node = __commonJS({
|
|
|
2726
2727
|
}
|
|
2727
2728
|
}
|
|
2728
2729
|
*render(ctx, emitter) {
|
|
2729
|
-
const
|
|
2730
|
-
return yield options2.render.call(this, ctx, emitter,
|
|
2730
|
+
const hash2 = yield new Hash(this.token.args, ctx.opts.keyValueSeparator).render(ctx);
|
|
2731
|
+
return yield options2.render.call(this, ctx, emitter, hash2);
|
|
2731
2732
|
}
|
|
2732
2733
|
};
|
|
2733
2734
|
}
|
|
@@ -4108,10 +4109,10 @@ var require_liquid_node = __commonJS({
|
|
|
4108
4109
|
const str = stringify(v);
|
|
4109
4110
|
pattern = stringify(pattern);
|
|
4110
4111
|
replacement = stringify(replacement);
|
|
4111
|
-
const
|
|
4112
|
-
const outputSize = str.length + (
|
|
4112
|
+
const parts2 = str.split(pattern);
|
|
4113
|
+
const outputSize = str.length + (parts2.length - 1) * (replacement.length - pattern.length);
|
|
4113
4114
|
this.context.memoryLimit.use(outputSize);
|
|
4114
|
-
return
|
|
4115
|
+
return parts2.join(replacement);
|
|
4115
4116
|
}
|
|
4116
4117
|
__name(replace, "replace");
|
|
4117
4118
|
function replace_first(v, arg1, arg2) {
|
|
@@ -4349,17 +4350,17 @@ var require_liquid_node = __commonJS({
|
|
|
4349
4350
|
}
|
|
4350
4351
|
const continueKey = "continue-" + this.variable + "-" + this.collection.getText();
|
|
4351
4352
|
ctx.push(createScope({ continue: ctx.getRegister(continueKey, {}) }));
|
|
4352
|
-
const
|
|
4353
|
+
const hash2 = yield this.hash.render(ctx);
|
|
4353
4354
|
ctx.pop();
|
|
4354
|
-
const modifiers = this.liquid.options.orderedFilterParameters ? Object.keys(
|
|
4355
|
+
const modifiers = this.liquid.options.orderedFilterParameters ? Object.keys(hash2).filter((x) => MODIFIERS.includes(x)) : MODIFIERS.filter((x) => hash2[x] !== void 0);
|
|
4355
4356
|
collection = modifiers.reduce((collection2, modifier) => {
|
|
4356
4357
|
if (modifier === "offset")
|
|
4357
|
-
return offset(collection2,
|
|
4358
|
+
return offset(collection2, hash2["offset"]);
|
|
4358
4359
|
if (modifier === "limit")
|
|
4359
|
-
return limit2(collection2,
|
|
4360
|
+
return limit2(collection2, hash2["limit"]);
|
|
4360
4361
|
return reversed(collection2);
|
|
4361
4362
|
}, collection);
|
|
4362
|
-
ctx.setRegister(continueKey, (
|
|
4363
|
+
ctx.setRegister(continueKey, (hash2["offset"] || 0) + collection.length);
|
|
4363
4364
|
const scope = createScope({ forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) });
|
|
4364
4365
|
ctx.push(scope);
|
|
4365
4366
|
for (const item of collection) {
|
|
@@ -4574,12 +4575,12 @@ var require_liquid_node = __commonJS({
|
|
|
4574
4575
|
this.hash = new Hash(tokenizer, liquid.options.keyValueSeparator);
|
|
4575
4576
|
}
|
|
4576
4577
|
*render(ctx, emitter) {
|
|
4577
|
-
const { liquid, hash } = this;
|
|
4578
|
+
const { liquid, hash: hash2 } = this;
|
|
4578
4579
|
const filepath = yield renderFilePath(this.file, ctx, liquid);
|
|
4579
4580
|
assert(filepath, () => `illegal file path "${filepath}"`);
|
|
4580
4581
|
const childCtx = ctx.spawn();
|
|
4581
4582
|
const scope = childCtx.bottom();
|
|
4582
|
-
__assign(scope, yield
|
|
4583
|
+
__assign(scope, yield hash2.render(ctx));
|
|
4583
4584
|
if (this.with) {
|
|
4584
4585
|
const { value, alias } = this.with;
|
|
4585
4586
|
scope[alias || filepath] = yield evalToken(value, ctx);
|
|
@@ -4700,14 +4701,14 @@ var require_liquid_node = __commonJS({
|
|
|
4700
4701
|
this.hash = new Hash(tokenizer, liquid.options.jekyllInclude || liquid.options.keyValueSeparator);
|
|
4701
4702
|
}
|
|
4702
4703
|
*render(ctx, emitter) {
|
|
4703
|
-
const { liquid, hash, withVar } = this;
|
|
4704
|
+
const { liquid, hash: hash2, withVar } = this;
|
|
4704
4705
|
const { renderer } = liquid;
|
|
4705
4706
|
const filepath = yield renderFilePath(this.file, ctx, liquid);
|
|
4706
4707
|
assert(filepath, () => `illegal file path "${filepath}"`);
|
|
4707
4708
|
const saved = ctx.saveRegister("blocks", "blockMode");
|
|
4708
4709
|
ctx.setRegister("blocks", {});
|
|
4709
4710
|
ctx.setRegister("blockMode", BlockMode.OUTPUT);
|
|
4710
|
-
const scope = createScope(yield
|
|
4711
|
+
const scope = createScope(yield hash2.render(ctx));
|
|
4711
4712
|
if (withVar)
|
|
4712
4713
|
scope[filepath] = yield evalToken(withVar, ctx);
|
|
4713
4714
|
const templates = yield liquid._parsePartialFile(filepath, ctx.sync, this.currentFile);
|
|
@@ -5488,11 +5489,11 @@ var require_liquid_node = __commonJS({
|
|
|
5488
5489
|
}
|
|
5489
5490
|
});
|
|
5490
5491
|
|
|
5491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5492
5493
|
import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
|
|
5493
5494
|
import { dirname, resolve } from "node:path";
|
|
5494
5495
|
|
|
5495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5496
5497
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5497
5498
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5498
5499
|
import { Transform } from "node:stream";
|
|
@@ -5508,8 +5509,8 @@ var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Prom
|
|
|
5508
5509
|
var checkFor = /* @__PURE__ */ __name(async (password, cost = COST) => {
|
|
5509
5510
|
refuseEmpty(password);
|
|
5510
5511
|
const salt = randomBytes(SALT);
|
|
5511
|
-
const
|
|
5512
|
-
return { salt: salt.toString("hex"), ...cost, hash };
|
|
5512
|
+
const hash2 = createHash("sha256").update(await keyOf(password, salt, cost)).digest("hex");
|
|
5513
|
+
return { salt: salt.toString("hex"), ...cost, hash: hash2 };
|
|
5513
5514
|
}, "checkFor");
|
|
5514
5515
|
var passes = /* @__PURE__ */ __name(async (password, check2) => {
|
|
5515
5516
|
refuseCost(check2);
|
|
@@ -5599,7 +5600,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5599
5600
|
renameSync(pending, to);
|
|
5600
5601
|
}, "unsealFile");
|
|
5601
5602
|
|
|
5602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5603
5604
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5604
5605
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5605
5606
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5623,7 +5624,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5623
5624
|
};
|
|
5624
5625
|
}, "compatibilityOf");
|
|
5625
5626
|
|
|
5626
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5627
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5627
5628
|
import { createHash as createHash2 } from "node:crypto";
|
|
5628
5629
|
var COPY_MARK = "__repair_";
|
|
5629
5630
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5877,7 +5878,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5877
5878
|
return found;
|
|
5878
5879
|
}, "deleteCopy");
|
|
5879
5880
|
|
|
5880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5881
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5881
5882
|
import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
|
|
5882
5883
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
5883
5884
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
|
|
@@ -5924,7 +5925,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
|
|
|
5924
5925
|
renderAnswer(this, outputFor(this), itemOf(answer));
|
|
5925
5926
|
}), "storeInfoCommand");
|
|
5926
5927
|
|
|
5927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5928
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
5928
5929
|
var ENCRYPT_OPTION = [
|
|
5929
5930
|
"--encrypt",
|
|
5930
5931
|
"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"
|
|
@@ -5943,7 +5944,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
5943
5944
|
return password;
|
|
5944
5945
|
}, "passwordOf");
|
|
5945
5946
|
|
|
5946
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5947
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
5947
5948
|
import { existsSync as existsSync3, readFileSync } from "node:fs";
|
|
5948
5949
|
import { join } from "node:path";
|
|
5949
5950
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
@@ -6114,7 +6115,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6114
6115
|
}, "problem");
|
|
6115
6116
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6116
6117
|
|
|
6117
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6118
6119
|
import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
|
|
6119
6120
|
import { join as join2 } from "node:path";
|
|
6120
6121
|
var ANSWERED_KEPT = 1e3;
|
|
@@ -6167,7 +6168,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6167
6168
|
}, "recordReply");
|
|
6168
6169
|
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");
|
|
6169
6170
|
|
|
6170
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6171
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6171
6172
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6172
6173
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6173
6174
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -6242,14 +6243,14 @@ var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
|
6242
6243
|
}, "decide");
|
|
6243
6244
|
var mentionsOwner = /* @__PURE__ */ __name((message, owner) => message.replyTo?.outgoing === true || owner.id !== null && (message.mentions ?? []).includes(owner.id) || owner.username !== void 0 && hasWord(message.text, `@${owner.username}`), "mentionsOwner");
|
|
6244
6245
|
var local = /* @__PURE__ */ __name((zone, now) => {
|
|
6245
|
-
const
|
|
6246
|
+
const parts2 = new Intl.DateTimeFormat("en-US", {
|
|
6246
6247
|
timeZone: zone,
|
|
6247
6248
|
weekday: "short",
|
|
6248
6249
|
hour: "2-digit",
|
|
6249
6250
|
minute: "2-digit",
|
|
6250
6251
|
hourCycle: "h23"
|
|
6251
6252
|
}).formatToParts(now);
|
|
6252
|
-
const part = /* @__PURE__ */ __name((type) =>
|
|
6253
|
+
const part = /* @__PURE__ */ __name((type) => parts2.find((one) => one.type === type)?.value ?? "", "part");
|
|
6253
6254
|
return {
|
|
6254
6255
|
day: part("weekday").toLowerCase(),
|
|
6255
6256
|
minute: Number(part("hour")) * 60 + Number(part("minute"))
|
|
@@ -6273,7 +6274,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
6273
6274
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
6274
6275
|
}, "filled");
|
|
6275
6276
|
|
|
6276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
6277
6278
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
6278
6279
|
var TEMPLATE_LIMITS = {
|
|
6279
6280
|
parse: 32768,
|
|
@@ -6316,7 +6317,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6316
6317
|
let parsingAI = false;
|
|
6317
6318
|
try {
|
|
6318
6319
|
const zone = input.timezone ?? "UTC";
|
|
6319
|
-
const
|
|
6320
|
+
const parts2 = Object.fromEntries(new Intl.DateTimeFormat("en-CA", {
|
|
6320
6321
|
timeZone: zone,
|
|
6321
6322
|
year: "numeric",
|
|
6322
6323
|
month: "2-digit",
|
|
@@ -6327,7 +6328,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6327
6328
|
timeZoneName: "longOffset",
|
|
6328
6329
|
hourCycle: "h23"
|
|
6329
6330
|
}).formatToParts(input.now).map(({ type, value }) => [type, value]));
|
|
6330
|
-
const localTime = `${
|
|
6331
|
+
const localTime = `${parts2.year}-${parts2.month}-${parts2.day}T${parts2.hour}:${parts2.minute}:${parts2.second}${parts2.timeZoneName?.replace("GMT", "") || "+00:00"}`;
|
|
6331
6332
|
const engine = new import_liquidjs.Liquid({
|
|
6332
6333
|
ownPropertyOnly: true,
|
|
6333
6334
|
strictVariables: true,
|
|
@@ -6433,7 +6434,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6433
6434
|
}
|
|
6434
6435
|
}, "renderReplyTemplate");
|
|
6435
6436
|
|
|
6436
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6437
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
6437
6438
|
var DRY_RUN_DAYS = 7;
|
|
6438
6439
|
var PAGE = 500;
|
|
6439
6440
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -6547,7 +6548,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
6547
6548
|
}
|
|
6548
6549
|
}, "storedSince");
|
|
6549
6550
|
|
|
6550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
6551
6552
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
6552
6553
|
const host = new URL(baseUrl).host;
|
|
6553
6554
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -6578,7 +6579,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
6578
6579
|
};
|
|
6579
6580
|
}, "embeddingKeys");
|
|
6580
6581
|
|
|
6581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6582
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
6582
6583
|
var options = strictObject({
|
|
6583
6584
|
temperature: range(0, 2),
|
|
6584
6585
|
top_p: range(0, 1),
|
|
@@ -6627,7 +6628,7 @@ var openai = {
|
|
|
6627
6628
|
}, "complete")
|
|
6628
6629
|
};
|
|
6629
6630
|
|
|
6630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
6631
6632
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
6632
6633
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
6633
6634
|
if (deps.signal?.aborted)
|
|
@@ -6642,7 +6643,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
6642
6643
|
if (!adapter && target.provider === "openai")
|
|
6643
6644
|
adapter = openai;
|
|
6644
6645
|
if (!adapter && target.provider === "anthropic")
|
|
6645
|
-
adapter = (await import("./anthropic-
|
|
6646
|
+
adapter = (await import("./anthropic-LKU7RWMA.js")).anthropic;
|
|
6646
6647
|
if (!adapter)
|
|
6647
6648
|
throw new CliError("validation_error", `no model adapter for ${target.provider}`);
|
|
6648
6649
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -6683,7 +6684,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
6683
6684
|
}, "complete")
|
|
6684
6685
|
}), "modelGateway");
|
|
6685
6686
|
|
|
6686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
6687
6688
|
import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
|
|
6688
6689
|
import { join as join3 } from "node:path";
|
|
6689
6690
|
var shape = strictObject({
|
|
@@ -6708,7 +6709,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
6708
6709
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
6709
6710
|
}, "mayModelReply");
|
|
6710
6711
|
|
|
6711
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
6712
6713
|
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
|
|
6713
6714
|
ai: true
|
|
6714
6715
|
}) => async (rule2, message, chat, now) => {
|
|
@@ -6755,7 +6756,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
6755
6756
|
return result2;
|
|
6756
6757
|
}, "replyRenderer");
|
|
6757
6758
|
|
|
6758
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6759
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
6759
6760
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
6760
6761
|
var NO_RULES = "no rules";
|
|
6761
6762
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -6848,7 +6849,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
6848
6849
|
return { skip: why };
|
|
6849
6850
|
}, "replyTo");
|
|
6850
6851
|
|
|
6851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
6852
6853
|
var FIRST_FETCH_MS = 6e4;
|
|
6853
6854
|
var DAY_MS = 864e5;
|
|
6854
6855
|
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
@@ -6902,7 +6903,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
|
|
|
6902
6903
|
};
|
|
6903
6904
|
}, "memberFetches");
|
|
6904
6905
|
|
|
6905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
6906
6907
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
6907
6908
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
6908
6909
|
if (context.format === "pretty") {
|
|
@@ -6935,7 +6936,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
6935
6936
|
return context;
|
|
6936
6937
|
}, "recordDiagnostics");
|
|
6937
6938
|
|
|
6938
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
6939
6940
|
var STEMS_EVERY_MS = 3e4;
|
|
6940
6941
|
var STEMS_SLICE_MS = 2e3;
|
|
6941
6942
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -6975,7 +6976,180 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
6975
6976
|
};
|
|
6976
6977
|
}, "stemFills");
|
|
6977
6978
|
|
|
6978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/render/messages.js
|
|
6980
|
+
import { styleText } from "node:util";
|
|
6981
|
+
var TIME_WIDTH = 8;
|
|
6982
|
+
var INDENT = " ".repeat(TIME_WIDTH + 2);
|
|
6983
|
+
var MIN_WIDTH = 40;
|
|
6984
|
+
var SENDER_COLOURS = ["green", "yellow", "magenta", "blue", "red"];
|
|
6985
|
+
var renderMessages = /* @__PURE__ */ __name((messages, options2 = {}) => {
|
|
6986
|
+
if (messages.length === 0)
|
|
6987
|
+
return "(nothing)";
|
|
6988
|
+
const day = dayFormatter(options2);
|
|
6989
|
+
const paint = painter(options2);
|
|
6990
|
+
let previous;
|
|
6991
|
+
const blocks = [];
|
|
6992
|
+
for (const message of messages) {
|
|
6993
|
+
const date = day(message.timestamp);
|
|
6994
|
+
if (date !== previous)
|
|
6995
|
+
blocks.push(paint("dim", `\u2500\u2500 ${date} \u2500\u2500`));
|
|
6996
|
+
previous = date;
|
|
6997
|
+
blocks.push(renderMessage(message, options2));
|
|
6998
|
+
}
|
|
6999
|
+
return blocks.join("\n\n");
|
|
7000
|
+
}, "renderMessages");
|
|
7001
|
+
var renderMessage = /* @__PURE__ */ __name((message, options2 = {}) => {
|
|
7002
|
+
const paint = painter(options2);
|
|
7003
|
+
const width = Math.max(MIN_WIDTH, options2.width ?? 80);
|
|
7004
|
+
const room = width - INDENT.length;
|
|
7005
|
+
const time = timeFormatter(options2);
|
|
7006
|
+
const verbosity = options2.verbosity ?? 0;
|
|
7007
|
+
const chat = "chatTitle" in message ? paint("dim", ` \xB7 ${singleLine(message.chatTitle ?? message.chatId)}`) : "";
|
|
7008
|
+
const mark = "anchor" in message && message.anchor ? paint("bold", " \u25C0") : "";
|
|
7009
|
+
const lines = [`${paint("dim", time(message.timestamp))} ${senderOf(message, options2)}${chat}${mark}`];
|
|
7010
|
+
const body = /* @__PURE__ */ __name((text) => wrapAnsi(visibleControls(text), room, { hard: true }).split("\n"), "body");
|
|
7011
|
+
const email = message.email;
|
|
7012
|
+
if (email)
|
|
7013
|
+
lines.push(paint("dim", mailLine(email)));
|
|
7014
|
+
if (message.replyTo)
|
|
7015
|
+
lines.push(paint("dim", preview("\u21B3", message.replyTo, room, options2)));
|
|
7016
|
+
if (message.forwardedFrom) {
|
|
7017
|
+
lines.push(paint("dim", `\u21AA ${nameOf(message.forwardedFrom, options2)}`));
|
|
7018
|
+
if (message.forwardedFrom.text)
|
|
7019
|
+
for (const line of body(message.forwardedFrom.text))
|
|
7020
|
+
lines.push(line);
|
|
7021
|
+
lines.push(...attachmentLines(message.forwardedFrom.attachments, paint, options2));
|
|
7022
|
+
}
|
|
7023
|
+
if (message.text)
|
|
7024
|
+
for (const line of body(message.text))
|
|
7025
|
+
lines.push(line);
|
|
7026
|
+
lines.push(...attachmentLines(message.attachments, paint, options2));
|
|
7027
|
+
if (message.reactions && message.reactions.total > 0)
|
|
7028
|
+
lines.push(paint("dim", reactionLine(message.reactions)));
|
|
7029
|
+
if (message.editedAt)
|
|
7030
|
+
lines.push(paint("dim", `edited ${editedAt(message, options2)}`));
|
|
7031
|
+
if (verbosity >= 1) {
|
|
7032
|
+
const fields = [
|
|
7033
|
+
["message", message.id],
|
|
7034
|
+
["sender", message.senderId],
|
|
7035
|
+
["chat", message.chatId],
|
|
7036
|
+
["reply to", message.replyTo?.id ?? message.replyToId],
|
|
7037
|
+
["thread", message.threadId],
|
|
7038
|
+
["forward of", message.forwardedFrom?.id],
|
|
7039
|
+
...message.attachments.map((a) => ["link", a.url])
|
|
7040
|
+
];
|
|
7041
|
+
if (verbosity >= 2) {
|
|
7042
|
+
fields.push(["provider", options2.provider], ["profile", options2.profile], ["sent", message.timestamp], ["edited", message.editedAt], ["outgoing", message.outgoing === null ? "unknown" : String(message.outgoing)], ...message.attachments.map((a) => ["attachment", JSON.stringify(a)]), ["metadata", message.providerMetadata && JSON.stringify(message.providerMetadata)]);
|
|
7043
|
+
}
|
|
7044
|
+
const shown = fields.filter((field) => typeof field[1] === "string");
|
|
7045
|
+
const label = Math.max(...shown.map(([key]) => key.length));
|
|
7046
|
+
lines.push("", ...shown.map(([key, value]) => paint("dim", `${key.padEnd(label)} ${singleLine(value)}`)));
|
|
7047
|
+
}
|
|
7048
|
+
return lines.map((line, index) => index === 0 || line === "" ? line : `${INDENT}${line}`).join("\n");
|
|
7049
|
+
}, "renderMessage");
|
|
7050
|
+
var mailLine = /* @__PURE__ */ __name(({ to, cc, labels }) => {
|
|
7051
|
+
const names = /* @__PURE__ */ __name((people) => people.map(({ name, address }) => singleLine(name ?? address)).join(", "), "names");
|
|
7052
|
+
return [to.length ? `to ${names(to)}` : "", cc.length ? `cc ${names(cc)}` : "", labels.join(", ")].filter(Boolean).join(" \xB7 ");
|
|
7053
|
+
}, "mailLine");
|
|
7054
|
+
var painter = /* @__PURE__ */ __name(({ color = false }) => (style, text) => color ? styleText(style, text, { validateStream: false }) : text, "painter");
|
|
7055
|
+
var senderOf = /* @__PURE__ */ __name((message, options2) => {
|
|
7056
|
+
const paint = painter(options2);
|
|
7057
|
+
if (message.outgoing === true)
|
|
7058
|
+
return paint(["bold", "cyan"], you(options2));
|
|
7059
|
+
const name = nameOf(message, options2);
|
|
7060
|
+
if (!options2.senderColors)
|
|
7061
|
+
return paint("bold", name);
|
|
7062
|
+
const colour = SENDER_COLOURS[hash(message.senderId ?? name) % SENDER_COLOURS.length] ?? "green";
|
|
7063
|
+
return paint(["bold", colour], name);
|
|
7064
|
+
}, "senderOf");
|
|
7065
|
+
var nameOf = /* @__PURE__ */ __name(({ senderName, senderId, outgoing }, options2) => outgoing === true ? you(options2) : singleLine(senderName ?? senderId ?? "unknown"), "nameOf");
|
|
7066
|
+
var DEFAULT_LOCALE = "ru-RU";
|
|
7067
|
+
var you = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE }) => locale.startsWith("ru") ? "\u0432\u044B" : "you", "you");
|
|
7068
|
+
var hash = /* @__PURE__ */ __name((value) => [...value].reduce((sum, char) => sum * 31 + char.charCodeAt(0) >>> 0, 7), "hash");
|
|
7069
|
+
var preview = /* @__PURE__ */ __name((mark, quoted, room, options2) => {
|
|
7070
|
+
const text = singleLine(quoted.text.split("\n")[0] ?? "") || (quoted.attachments[0] ? `\u{1F4CE} ${quoted.attachments[0].kind}` : "");
|
|
7071
|
+
const line = text ? `${mark} ${nameOf(quoted, options2)}: ${text}` : `${mark} message ${quoted.id}`;
|
|
7072
|
+
if (stringWidth(line) <= room)
|
|
7073
|
+
return line;
|
|
7074
|
+
return `${wrapAnsi(line, room - 1, { hard: true }).split("\n")[0]}\u2026`;
|
|
7075
|
+
}, "preview");
|
|
7076
|
+
var attachmentLines = /* @__PURE__ */ __name((attachments, paint, options2) => {
|
|
7077
|
+
const link = /* @__PURE__ */ __name((label, raw) => {
|
|
7078
|
+
if (raw === void 0)
|
|
7079
|
+
return label;
|
|
7080
|
+
const url = singleLine(raw);
|
|
7081
|
+
return options2.color ? `\x1B]8;;${url}\x07${label}\x1B]8;;\x07` : `${label} ${url}`;
|
|
7082
|
+
}, "link");
|
|
7083
|
+
let number2 = 0;
|
|
7084
|
+
const keyboard = attachments.flatMap((attachment) => attachment.buttons ?? []).map((row) => paint("dim", row.map((button) => link(`[${++number2} ${singleLine(button.text)}]`, button.url)).join(" ")));
|
|
7085
|
+
const polls = attachments.flatMap((attachment) => attachment.poll ? pollLines(attachment.poll) : []);
|
|
7086
|
+
const groups = /* @__PURE__ */ new Map();
|
|
7087
|
+
for (const attachment of attachments) {
|
|
7088
|
+
if (attachment.buttons || attachment.poll)
|
|
7089
|
+
continue;
|
|
7090
|
+
const key = singleLine(attachment.name ?? attachment.title ?? attachment.kind);
|
|
7091
|
+
groups.set(key, [...groups.get(key) ?? [], attachment]);
|
|
7092
|
+
}
|
|
7093
|
+
const files = [...groups].map(([label, same2]) => {
|
|
7094
|
+
const first = same2[0];
|
|
7095
|
+
const size = first?.size === void 0 ? "" : ` \xB7 ${megabytes(first.size)}`;
|
|
7096
|
+
if (same2.length === 1)
|
|
7097
|
+
return paint("dim", `\u{1F4CE} ${link(`${label}${size}`, first?.url)}`);
|
|
7098
|
+
const each = same2.map((attachment, index) => link(String(index + 1), attachment.url)).join(" ");
|
|
7099
|
+
return paint("dim", `\u{1F4CE} ${label} \xD7${same2.length} ${each}`);
|
|
7100
|
+
});
|
|
7101
|
+
return [...polls, ...files, ...keyboard];
|
|
7102
|
+
}, "attachmentLines");
|
|
7103
|
+
var pollLines = /* @__PURE__ */ __name((poll) => {
|
|
7104
|
+
const kind = [
|
|
7105
|
+
poll.closed ? "closed" : "",
|
|
7106
|
+
poll.multiple ? "several answers" : "",
|
|
7107
|
+
poll.anonymous ? "anonymous" : "",
|
|
7108
|
+
poll.quiz ? "quiz" : ""
|
|
7109
|
+
].filter(Boolean);
|
|
7110
|
+
const count3 = /* @__PURE__ */ __name((voters) => voters === null ? "?" : String(voters), "count");
|
|
7111
|
+
return [
|
|
7112
|
+
`\u{1F4CA} ${visibleControls(poll.question)}`,
|
|
7113
|
+
...poll.answers.map((answer) => ` [${answer.id}] ${visibleControls(answer.text)} \u2014 ${count3(answer.voters)}${answer.chosen ? " \u2713" : ""}`),
|
|
7114
|
+
` ${[`${count3(poll.voters)} voted`, ...kind].join(" \xB7 ")}`
|
|
7115
|
+
];
|
|
7116
|
+
}, "pollLines");
|
|
7117
|
+
var megabytes = /* @__PURE__ */ __name((bytes) => bytes >= 1e6 ? `${Math.round(bytes / 1e6)} MB` : `${Math.max(1, Math.round(bytes / 1e3))} KB`, "megabytes");
|
|
7118
|
+
var parts = /* @__PURE__ */ __name((format, iso) => Object.fromEntries(format.formatToParts(new Date(iso)).map(({ type, value }) => [type, value])), "parts");
|
|
7119
|
+
var timeFormatter = /* @__PURE__ */ __name(({ timeZone }) => {
|
|
7120
|
+
const format = new Intl.DateTimeFormat("en-GB", {
|
|
7121
|
+
hour: "2-digit",
|
|
7122
|
+
minute: "2-digit",
|
|
7123
|
+
second: "2-digit",
|
|
7124
|
+
hourCycle: "h23",
|
|
7125
|
+
...timeZone ? { timeZone } : {}
|
|
7126
|
+
});
|
|
7127
|
+
return (iso) => {
|
|
7128
|
+
const { hour, minute, second } = parts(format, iso);
|
|
7129
|
+
return `${hour}:${minute}:${second}`;
|
|
7130
|
+
};
|
|
7131
|
+
}, "timeFormatter");
|
|
7132
|
+
var dayFormatter = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE, timeZone }) => {
|
|
7133
|
+
const format = new Intl.DateTimeFormat(locale, {
|
|
7134
|
+
day: "numeric",
|
|
7135
|
+
month: "long",
|
|
7136
|
+
year: "numeric",
|
|
7137
|
+
...timeZone ? { timeZone } : {}
|
|
7138
|
+
});
|
|
7139
|
+
return (iso) => format.format(new Date(iso)).replace(/\s*г\.$/, "");
|
|
7140
|
+
}, "dayFormatter");
|
|
7141
|
+
var reactionLine = /* @__PURE__ */ __name(({ counts, mine }) => {
|
|
7142
|
+
const shown = counts.map(({ reaction, count: count3 }) => `${singleLine(reaction)} ${count3}`).join(" ");
|
|
7143
|
+
return mine ? `${shown} (you: ${singleLine(mine)})` : shown;
|
|
7144
|
+
}, "reactionLine");
|
|
7145
|
+
var editedAt = /* @__PURE__ */ __name((message, options2) => {
|
|
7146
|
+
const edited = message.editedAt ?? message.timestamp;
|
|
7147
|
+
const time = timeFormatter(options2)(edited);
|
|
7148
|
+
const day = dayFormatter(options2);
|
|
7149
|
+
return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
|
|
7150
|
+
}, "editedAt");
|
|
7151
|
+
|
|
7152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
6979
7153
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
6980
7154
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
6981
7155
|
kind: attachment.kind,
|
|
@@ -7062,7 +7236,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
7062
7236
|
locale: messenger.app.locale
|
|
7063
7237
|
}), "viewOf");
|
|
7064
7238
|
|
|
7065
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
7066
7240
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
7067
7241
|
value: value.value,
|
|
7068
7242
|
observed_at: value.observedAt,
|
|
@@ -7129,7 +7303,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
7129
7303
|
}
|
|
7130
7304
|
}, "watchEventItem");
|
|
7131
7305
|
|
|
7132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
7133
7307
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
7134
7308
|
output: { entity: "watch_item" },
|
|
7135
7309
|
effects: REMOTE_READ,
|
|
@@ -7284,7 +7458,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
7284
7458
|
}
|
|
7285
7459
|
}, "describe");
|
|
7286
7460
|
|
|
7287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
7288
7462
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
7289
7463
|
const command = annotate(new Command("serve"), {
|
|
7290
7464
|
output: { entity: "serve_summary" },
|
|
@@ -7500,7 +7674,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
7500
7674
|
};
|
|
7501
7675
|
}, "tasking");
|
|
7502
7676
|
|
|
7503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
7504
7678
|
import { existsSync as existsSync6 } from "node:fs";
|
|
7505
7679
|
var PATH = "store tables list";
|
|
7506
7680
|
var STORE_TABLES_QUERY = {
|
|
@@ -7543,7 +7717,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
7543
7717
|
return tables;
|
|
7544
7718
|
}, "storeTablesCommand");
|
|
7545
7719
|
|
|
7546
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
7547
7721
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
7548
7722
|
var WORD_INDEX = "message_words";
|
|
7549
7723
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -8158,6 +8332,7 @@ export {
|
|
|
8158
8332
|
writeReplyConsent,
|
|
8159
8333
|
replyModelIdentity,
|
|
8160
8334
|
replyRenderer,
|
|
8335
|
+
renderMessages,
|
|
8161
8336
|
messageItem,
|
|
8162
8337
|
messageItems,
|
|
8163
8338
|
selfOf,
|