@wirecat/mail-cli 0.33.0 → 0.35.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/CHANGELOG.md +39 -0
- package/README.md +4 -1
- package/contracts/wirecat.json +54 -4
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/agent-KWLCQCSC.js +39 -0
- package/dist/bundle/{all-profiles-W3CGXEEJ.js → all-profiles-6BDSMVOO.js} +63 -21
- package/dist/bundle/{anthropic-UMDO5AKP.js → anthropic-C3XUXUCJ.js} +8 -8
- package/dist/bundle/{app-server-4SICQ5RP.js → app-server-GUHDK4OR.js} +82 -64
- package/dist/bundle/{bun-QVVCH4MJ.js → bun-FN7AM4AG.js} +2 -2
- package/dist/bundle/{bun-sqlite-CHD4AIUK.js → bun-sqlite-56IVBF22.js} +6 -6
- package/dist/bundle/{chunk-HFFHL7SV.js → chunk-2B67TUIF.js} +101 -69
- package/dist/bundle/{chunk-OOYIPK4F.js → chunk-2UNQTKRH.js} +1 -1
- package/dist/bundle/{chunk-LXUHYDNE.js → chunk-3ACF6TIV.js} +1 -1
- package/dist/bundle/chunk-3EV2B7KZ.js +726 -0
- package/dist/bundle/chunk-3KAJCOJP.js +109 -0
- package/dist/bundle/{chunk-2BFXHCZW.js → chunk-3WAZKCDF.js} +2 -2
- package/dist/bundle/{chunk-LKGJMM6W.js → chunk-46SBNO67.js} +12 -63
- package/dist/bundle/{chunk-LB5FTCPZ.js → chunk-4IASS7NQ.js} +128 -10
- package/dist/bundle/chunk-4U5ODZO7.js +360 -0
- package/dist/bundle/{chunk-QN423PC6.js → chunk-5WYBI35N.js} +3 -3
- package/dist/bundle/{chunk-GZYICXO4.js → chunk-5XQI7WCJ.js} +1 -1
- package/dist/bundle/{chunk-JUYUWMTG.js → chunk-635AFLZO.js} +4 -4
- package/dist/bundle/{chunk-2P44S7XK.js → chunk-6B4WZVLN.js} +36 -28
- package/dist/bundle/{chunk-47YNANPZ.js → chunk-6Q5THDNW.js} +3 -3
- package/dist/bundle/chunk-6VARUB3J.js +787 -0
- package/dist/bundle/{chunk-BRRHYXUP.js → chunk-7FXZKQAC.js} +87 -76
- package/dist/bundle/{chunk-EW3JFV7J.js → chunk-7JVKQ6NM.js} +4 -4
- package/dist/bundle/{chunk-OWAJN74H.js → chunk-7KMI47AP.js} +106 -257
- package/dist/bundle/{chunk-BF73DBAA.js → chunk-7PXAUMK5.js} +30 -15
- package/dist/bundle/{chunk-UX76GMQM.js → chunk-7YMLEWTX.js} +43 -64
- package/dist/bundle/{chunk-2L6D54BR.js → chunk-AISQNKT7.js} +8 -8
- package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
- package/dist/bundle/{chunk-OFMYFFEF.js → chunk-AXKIXVQA.js} +991 -1609
- package/dist/bundle/{chunk-UAV74EY4.js → chunk-CDGVYQXG.js} +1 -1
- package/dist/bundle/{chunk-RXUVXAMM.js → chunk-CFQQTDSA.js} +1 -1
- package/dist/bundle/chunk-CMGZXBJW.js +259 -0
- package/dist/bundle/{chunk-H46MANPR.js → chunk-DD2P67NP.js} +3 -3
- package/dist/bundle/{chunk-IBIFX2LK.js → chunk-DFHUJTP5.js} +2 -2
- package/dist/bundle/{chunk-DI74RP6R.js → chunk-DREU6TN6.js} +31 -85
- package/dist/bundle/{chunk-XQXYAOBV.js → chunk-DZHEVVXA.js} +53 -33
- package/dist/bundle/{chunk-LFBD6RTX.js → chunk-E6HSSKRX.js} +4 -4
- package/dist/bundle/{chunk-UYZDH5LK.js → chunk-EHAXFDDP.js} +1 -1
- package/dist/bundle/chunk-EU4J6GCJ.js +52 -0
- package/dist/bundle/{chunk-CHNNKHLL.js → chunk-EX4Z7CCO.js} +4051 -2788
- package/dist/bundle/chunk-G662S2M4.js +559 -0
- package/dist/bundle/{chunk-XN5KH24X.js → chunk-GG634DR3.js} +5 -5
- package/dist/bundle/{chunk-FSMCXQH2.js → chunk-GU3PYIV2.js} +2 -2
- package/dist/bundle/{chunk-SW7YGW3T.js → chunk-HF5QWKK2.js} +18 -8
- package/dist/bundle/chunk-HJDIMVFW.js +108 -0
- package/dist/bundle/chunk-HKWZG7CZ.js +334 -0
- package/dist/bundle/{chunk-BI5P7JWM.js → chunk-HM6AMYHR.js} +2 -2
- package/dist/bundle/{chunk-35AH33VJ.js → chunk-HVXOA4FO.js} +1 -1
- package/dist/bundle/{chunk-LXAX6AZU.js → chunk-I3QZCQJT.js} +6 -6
- package/dist/bundle/{chunk-I3UAD4EI.js → chunk-ILEKGH44.js} +68 -59
- package/dist/bundle/{chunk-SDWYOYGN.js → chunk-J5ULUTWE.js} +4 -4
- package/dist/bundle/{chunk-TK77DCE5.js → chunk-L4RCWRWS.js} +1 -1
- package/dist/bundle/chunk-MCJYJIH5.js +192 -0
- package/dist/bundle/{chunk-S6CHYNFE.js → chunk-NEDS4ORI.js} +2 -2
- package/dist/bundle/{chunk-QO7BK4WD.js → chunk-ODQCRZX5.js} +35 -12
- package/dist/bundle/chunk-OO4OKMNB.js +80 -0
- package/dist/bundle/{chunk-JCQ47WR4.js → chunk-OOQFBRNR.js} +144 -10
- package/dist/bundle/{chunk-LACMDMDI.js → chunk-OTP2HJ67.js} +9 -9
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-AEKWEYIG.js → chunk-PQDQCCGG.js} +19 -19
- package/dist/bundle/{chunk-BZY5W35X.js → chunk-Q5U2HIBJ.js} +7 -7
- package/dist/bundle/{chunk-74BYHR44.js → chunk-QFMKCU42.js} +3738 -3415
- package/dist/bundle/{chunk-SYUIAMVA.js → chunk-QYCMB7JY.js} +373 -533
- package/dist/bundle/{chunk-KLLT572M.js → chunk-RBV2AM52.js} +2 -100
- package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-RJNKM3CQ.js} +1 -1
- package/dist/bundle/{chunk-6IS4BEN4.js → chunk-RQHWSNX4.js} +4 -4
- package/dist/bundle/chunk-RQJGX7F7.js +170 -0
- package/dist/bundle/{chunk-RENCSP47.js → chunk-TARNPINT.js} +3 -3
- package/dist/bundle/chunk-TP2BCK2Z.js +721 -0
- package/dist/bundle/{chunk-MJ7DUSHT.js → chunk-TP766H4O.js} +18 -14
- package/dist/bundle/{chunk-2X344EUT.js → chunk-UHGKN5US.js} +8 -8
- package/dist/bundle/{chunk-L3MKFI3Y.js → chunk-UWDRU3R6.js} +2 -2
- package/dist/bundle/chunk-V4O47JV6.js +72 -0
- package/dist/bundle/{chunk-CIG4UVP6.js → chunk-W4JYGMTU.js} +14 -13
- package/dist/bundle/{chunk-JADBHKBP.js → chunk-W7ICCFG5.js} +1 -1
- package/dist/bundle/{chunk-MNJ3BMPZ.js → chunk-WDEVKKAD.js} +3 -3
- package/dist/bundle/{chunk-TBZLGT7R.js → chunk-WZKM5I7B.js} +23 -119
- package/dist/bundle/{chunk-MT7T5N2N.js → chunk-XKKYRMGG.js} +4 -4
- package/dist/bundle/chunk-XQNKAM26.js +338 -0
- package/dist/bundle/{chunk-UWF3SSRL.js → chunk-YA44BG3N.js} +58 -9
- package/dist/bundle/{chunk-Y2P2LC5R.js → chunk-YCIWSKOH.js} +9 -9
- package/dist/bundle/{chunk-7OYZU5SP.js → chunk-YQTRKNZQ.js} +4 -4
- package/dist/bundle/chunk-YRAJFTFU.js +353 -0
- package/dist/bundle/chunk-YTI533XF.js +29 -0
- package/dist/bundle/{chunk-UG2QDGAH.js → chunk-ZMYRPMAJ.js} +1 -1
- package/dist/bundle/{chunk-CZ6ZXDSO.js → chunk-ZX7HZDD6.js} +182 -562
- package/dist/bundle/{chunk-IPSLQX64.js → chunk-ZYEU35MB.js} +2 -2
- package/dist/bundle/command-contract-D5UXWHMS.js +39 -0
- package/dist/bundle/{command-server-entry-G2ZHCN5J.js → command-server-entry-TPJ47FYS.js} +28 -25
- package/dist/bundle/decode-XHUASXQK.js +296 -0
- package/dist/bundle/{dispatch-RHIK22OA.js → dispatch-MQZHGGVP.js} +8 -8
- package/dist/bundle/{dist-X5G2IMYG.js → dist-BAE4IQ52.js} +34 -29
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-UZJ6AREV.js → echarts-U7Z2PKIG.js} +2 -2
- package/dist/bundle/{embed-FEXLUH3T.js → embed-W7GPB6EI.js} +6 -6
- package/dist/bundle/{embedder-NHQARKFJ.js → embedder-T72XLFQ5.js} +9 -9
- package/dist/bundle/{failure-7DIA4OET.js → failure-MP6VKL5Y.js} +2 -2
- package/dist/bundle/{first-run-PS5NR2QG.js → first-run-C44TJXRI.js} +12 -12
- package/dist/bundle/first-screen-IESI7DAU.js +39 -0
- package/dist/bundle/{instructions-SDDUBGH4.js → instructions-WGMWQNPP.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-GN4FTJX5.js → mcp-YGOAUNC3.js} +2 -2
- package/dist/bundle/meeting-combined-XGZBSWIQ.js +24 -0
- package/dist/bundle/meeting-model-QVHLD4WI.js +24 -0
- package/dist/bundle/meeting-semantic-QKQHUHXX.js +21 -0
- package/dist/bundle/{node-ELCNUOCE.js → node-WANDMJJQ.js} +2 -2
- package/dist/bundle/{node-sqlite-2E5MKZMH.js → node-sqlite-NM5XA4DR.js} +7 -7
- package/dist/bundle/{oauth-JGPEIY3M.js → oauth-6E63ELEE.js} +8 -8
- package/dist/bundle/{open-6DEMCZAB.js → open-5542RTLE.js} +5 -5
- package/dist/bundle/{openai-IVKDU5AH.js → openai-NOYNPFB5.js} +28 -26
- package/dist/bundle/{process-67DAKAAQ.js → process-7AEXXSBX.js} +1 -1
- package/dist/bundle/{program-ESJDQMAJ.js → program-VMA5CGNR.js} +5712 -3640
- package/dist/bundle/{prompt-ZBWOT5KG.js → prompt-WYYO4AJL.js} +5 -5
- package/dist/bundle/{recognize-UUBH2DOH.js → recognize-UGCCOMAS.js} +4 -4
- package/dist/bundle/{remote-UYTNWNOB.js → remote-VZS6BNQB.js} +9 -9
- package/dist/bundle/{rerank-X2633CQN.js → rerank-O46D5GJ2.js} +7 -7
- package/dist/bundle/{serve-CP7Q4OVW.js → serve-QAAF2LCW.js} +10 -10
- package/dist/bundle/server-456MYK3X.js +84 -0
- package/dist/bundle/{server-I7MXRSAG.js → server-Q3PUZLLX.js} +77 -58
- package/dist/bundle/{sqlite-runtime-BX55LI5G.js → sqlite-runtime-EQBCDO2U.js} +6 -6
- package/dist/bundle/{state-LLNJQXFH.js → state-XIOHYXCR.js} +6 -6
- package/dist/bundle/{store-N27XI3VV.js → store-OXJZZUR7.js} +34 -17
- package/dist/bundle/{store-K4KU5N75.js → store-VJBL5XKR.js} +30 -20
- package/dist/bundle/store-maintenance-command-D7XYIX52.js +71 -0
- package/dist/bundle/surface-N7LK7PKN.js +70 -0
- package/dist/commands/read.d.ts +2 -2
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +5 -4
- package/dist/commands/read.js.map +1 -1
- package/dist/commands/sync.d.ts +2 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +16 -9
- package/dist/commands/sync.js.map +1 -1
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -1
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -2
- package/dist/identity.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-BDCC2J2Z.js +0 -2
- package/dist/bundle/command-contract-NRNQAFFE.js +0 -36
- package/dist/bundle/decode-U6V6D6XH.js +0 -162
- package/dist/bundle/first-screen-C2WTLOG2.js +0 -34
- package/dist/bundle/server-QGTMJ7SF.js +0 -67
- package/dist/bundle/store-maintenance-command-VPAFQCNA.js +0 -58
|
@@ -2,34 +2,34 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
validateFormattedText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YCIWSKOH.js";
|
|
6
6
|
import {
|
|
7
7
|
inputPolicy
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NEDS4ORI.js";
|
|
9
9
|
import {
|
|
10
10
|
RECORDS_SCHEMA_VERSION,
|
|
11
11
|
RECORD_TYPES,
|
|
12
12
|
pointerOf
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DREU6TN6.js";
|
|
14
14
|
import {
|
|
15
15
|
parseReference
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6VARUB3J.js";
|
|
17
17
|
import {
|
|
18
18
|
indent
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7FXZKQAC.js";
|
|
20
20
|
import {
|
|
21
21
|
CliError
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-HM6AMYHR.js";
|
|
23
23
|
import {
|
|
24
24
|
__name
|
|
25
25
|
} from "./chunk-ZVVMGPBJ.js";
|
|
26
26
|
|
|
27
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/checks.js
|
|
28
28
|
var spelled = /* @__PURE__ */ __name((check, args) => `${check.replaceAll(".", " ")}${args === void 0 ? "" : ` ${args}`}`, "spelled");
|
|
29
29
|
var bareCheck = /* @__PURE__ */ __name((check, args) => `\`${spelled(check, args)}\``, "bareCheck");
|
|
30
30
|
var checkWords = /* @__PURE__ */ __name((command, profile) => (check, args) => `\`${command} ${profile === void 0 ? "" : `${profile} `}${spelled(check, args)}\``, "checkWords");
|
|
31
31
|
|
|
32
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/links.js
|
|
33
33
|
var LINK_VERSION = "v1";
|
|
34
34
|
var DEFAULT_LINK_CONFIG = { base: "https://wirecat.dev/o", enabled: true };
|
|
35
35
|
var APP_PREFIX = "wirecat://open";
|
|
@@ -57,6 +57,8 @@ var partsOf = /* @__PURE__ */ __name((target) => {
|
|
|
57
57
|
return ["digest", target.date];
|
|
58
58
|
case "sync":
|
|
59
59
|
return target.account === void 0 ? ["sync", target.tool] : ["sync", target.tool, target.account];
|
|
60
|
+
case "meeting":
|
|
61
|
+
return ["meeting", target.provider, target.account, target.meeting];
|
|
60
62
|
}
|
|
61
63
|
}, "partsOf");
|
|
62
64
|
var pathOf = /* @__PURE__ */ __name((target) => partsOf(target).map(encodeURIComponent).join("/"), "pathOf");
|
|
@@ -82,6 +84,8 @@ var targetOfParts = /* @__PURE__ */ __name((parts) => {
|
|
|
82
84
|
return rest.length === 1 && isMoment(a, DATE) ? { type: "digest", date: a } : null;
|
|
83
85
|
case "sync":
|
|
84
86
|
return rest.length === 1 || rest.length === 2 ? { type: "sync", tool: a, ...rest.length === 2 ? { account: b } : {} } : null;
|
|
87
|
+
case "meeting":
|
|
88
|
+
return rest.length === 3 ? { type: "meeting", provider: a, account: b, meeting: c } : null;
|
|
85
89
|
default:
|
|
86
90
|
return null;
|
|
87
91
|
}
|
|
@@ -146,7 +150,7 @@ var linkFor = /* @__PURE__ */ __name((ref, { form, config = DEFAULT_LINK_CONFIG,
|
|
|
146
150
|
return form === "app" ? `${APP_PREFIX}${path}` : `${config.base}#${path}`;
|
|
147
151
|
}, "linkFor");
|
|
148
152
|
|
|
149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/markdown.js
|
|
150
154
|
var MARKERS = [
|
|
151
155
|
["**", "bold"],
|
|
152
156
|
["~~", "strike"],
|
|
@@ -192,7 +196,7 @@ var closing = /* @__PURE__ */ __name((input, open, marker) => {
|
|
|
192
196
|
return end;
|
|
193
197
|
}, "closing");
|
|
194
198
|
|
|
195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
|
|
196
200
|
var STYLES = [
|
|
197
201
|
["**", "bold"],
|
|
198
202
|
["__", "underline"],
|
|
@@ -352,7 +356,7 @@ var parseMarkdownSpans = /* @__PURE__ */ __name((input) => {
|
|
|
352
356
|
return validateFormattedText(result);
|
|
353
357
|
}, "parseMarkdownSpans");
|
|
354
358
|
|
|
355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/polls.js
|
|
356
360
|
var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
|
|
357
361
|
const cast = votes.filter((vote) => vote.answers.length > 0);
|
|
358
362
|
const mine = self === null ? void 0 : votes.find((vote) => vote.person.id === self);
|
|
@@ -367,7 +371,7 @@ var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
|
|
|
367
371
|
};
|
|
368
372
|
}, "countedPoll");
|
|
369
373
|
|
|
370
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/records-table.js
|
|
371
375
|
var TABLE_RECORD_TYPES = Object.keys(RECORD_TYPES).filter((type) => RECORD_TYPES[type].sheet !== false);
|
|
372
376
|
var TableError = class extends Error {
|
|
373
377
|
static {
|
|
@@ -2357,7 +2361,7 @@ var createDataURL = /* @__PURE__ */ __name(function(width, height, getPixel) {
|
|
|
2357
2361
|
var qrcode_default = qrcode;
|
|
2358
2362
|
var stringToBytes = qrcode.stringToBytes;
|
|
2359
2363
|
|
|
2360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/terminal/qr.js
|
|
2361
2365
|
var QUIET_ZONE = 4;
|
|
2362
2366
|
var BLACK_ON_WHITE = "\x1B[30;107m";
|
|
2363
2367
|
var RESET = "\x1B[0m";
|
|
@@ -2404,7 +2408,7 @@ var plainQr = /* @__PURE__ */ __name((link) => {
|
|
|
2404
2408
|
return lines.join("\n");
|
|
2405
2409
|
}, "plainQr");
|
|
2406
2410
|
|
|
2407
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2411
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
|
|
2408
2412
|
var MARGIN = 2;
|
|
2409
2413
|
var atTerminal = /* @__PURE__ */ __name((input) => input.isTTY === true && !inputPolicy(input).noInput, "atTerminal");
|
|
2410
2414
|
var PASTE_QR = "agents: paste the QR code above into the chat as a code block, exactly as printed; when a new one is printed, paste it and say the old one expired";
|
|
@@ -2,26 +2,26 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
isCliFailure
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UWDRU3R6.js";
|
|
6
6
|
import {
|
|
7
7
|
secretNamed,
|
|
8
8
|
withoutSecrets
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3ACF6TIV.js";
|
|
10
10
|
import {
|
|
11
11
|
isContentKey
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7FXZKQAC.js";
|
|
13
13
|
import {
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-ZVVMGPBJ.js";
|
|
16
16
|
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
18
18
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
19
19
|
import { createHash } from "node:crypto";
|
|
20
20
|
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
22
22
|
import { homedir } from "node:os";
|
|
23
23
|
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
25
25
|
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
26
26
|
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
27
27
|
if (event.event === "store")
|
|
@@ -73,7 +73,7 @@ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!
|
|
|
73
73
|
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
74
74
|
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
75
75
|
|
|
76
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
76
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
77
77
|
var MESSAGE_AT_MOST = 500;
|
|
78
78
|
var CAUSES_AT_MOST = 5;
|
|
79
79
|
var FRAMES_AT_MOST = 15;
|
|
@@ -185,7 +185,7 @@ var redactText = /* @__PURE__ */ __name((text) => {
|
|
|
185
185
|
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
186
186
|
}, "redactText");
|
|
187
187
|
|
|
188
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
189
189
|
var REDACTED = "[redacted]";
|
|
190
190
|
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
191
191
|
if (!record)
|
|
@@ -3,12 +3,12 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
CliError,
|
|
5
5
|
errorCodes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HM6AMYHR.js";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-ZVVMGPBJ.js";
|
|
10
10
|
|
|
11
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/errors/failures.js
|
|
12
12
|
var isCliFailure = /* @__PURE__ */ __name((value) => value instanceof Error && value.name === "CliError" && errorCodes.includes(value.code), "isCliFailure");
|
|
13
13
|
var isCommanderFailure = /* @__PURE__ */ __name((value) => {
|
|
14
14
|
const { code, exitCode } = value ?? {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
QUERY_LIMITS,
|
|
5
|
+
queryError
|
|
6
|
+
} from "./chunk-AXKIXVQA.js";
|
|
7
|
+
import {
|
|
8
|
+
CliError,
|
|
9
|
+
isCliError
|
|
10
|
+
} from "./chunk-HM6AMYHR.js";
|
|
11
|
+
import {
|
|
12
|
+
__name
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
16
|
+
var QUERY_VERSION = 1;
|
|
17
|
+
var QUERY_LIMITS2 = {
|
|
18
|
+
...QUERY_LIMITS,
|
|
19
|
+
pattern: 1024,
|
|
20
|
+
states: 1e4,
|
|
21
|
+
expansions: 1e4,
|
|
22
|
+
candidates: 5e4,
|
|
23
|
+
bodyBytes: 8388608,
|
|
24
|
+
milliseconds: 2e3,
|
|
25
|
+
work: 1e7
|
|
26
|
+
};
|
|
27
|
+
var SEARCH_QUERY = {
|
|
28
|
+
command: "search",
|
|
29
|
+
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
|
|
30
|
+
};
|
|
31
|
+
var MESSAGE_PARSING = { ...SEARCH_QUERY, proximity: true };
|
|
32
|
+
var MOST_WORDS_APART = 50;
|
|
33
|
+
function searchError(reason, span, alternative) {
|
|
34
|
+
queryError(reason, span, alternative, SEARCH_QUERY);
|
|
35
|
+
}
|
|
36
|
+
__name(searchError, "searchError");
|
|
37
|
+
var ANSWER_MS = 1e3;
|
|
38
|
+
var searchTimeLimit = /* @__PURE__ */ __name((deadline, now = Date.now()) => deadline?.explicit ? Math.max(QUERY_LIMITS2.milliseconds, deadline.endsAt - now - ANSWER_MS) : void 0, "searchTimeLimit");
|
|
39
|
+
function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
|
|
40
|
+
throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
|
|
41
|
+
}
|
|
42
|
+
__name(outOfTime, "outOfTime");
|
|
43
|
+
var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
|
|
44
|
+
function exhausted(budget) {
|
|
45
|
+
throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
|
|
46
|
+
reason: "query.too-large",
|
|
47
|
+
budget,
|
|
48
|
+
complete: false
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
__name(exhausted, "exhausted");
|
|
52
|
+
function tooWideTerm([term], budget) {
|
|
53
|
+
if (term === void 0)
|
|
54
|
+
exhausted(budget);
|
|
55
|
+
const part = term.replace(/[*?]+/gu, " ").trim().split(/\s+/u).sort((a, b) => b.length - a.length)[0] ?? term;
|
|
56
|
+
throw new CliError("validation_error", `search exceeded its ${budget} budget: ${term} is checked word by word, and too many messages hold it \u2014 write *${part}* (any word holding it, read from the index), more of the word, or add chat: or date:`, { reason: "query.too-large", budget, term, complete: false });
|
|
57
|
+
}
|
|
58
|
+
__name(tooWideTerm, "tooWideTerm");
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
QUERY_VERSION,
|
|
62
|
+
QUERY_LIMITS2 as QUERY_LIMITS,
|
|
63
|
+
SEARCH_QUERY,
|
|
64
|
+
MESSAGE_PARSING,
|
|
65
|
+
MOST_WORDS_APART,
|
|
66
|
+
searchError,
|
|
67
|
+
searchTimeLimit,
|
|
68
|
+
outOfTime,
|
|
69
|
+
isQueryLimit,
|
|
70
|
+
exhausted,
|
|
71
|
+
tooWideTerm
|
|
72
|
+
};
|
|
@@ -2,31 +2,31 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
updateCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RQHWSNX4.js";
|
|
6
6
|
import {
|
|
7
7
|
QUESTIONS,
|
|
8
8
|
readSetupAnswers,
|
|
9
9
|
unanswered,
|
|
10
10
|
writeSetupAnswers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WDEVKKAD.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_STEMMERS,
|
|
14
14
|
LANGUAGES
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ODQCRZX5.js";
|
|
16
16
|
import {
|
|
17
17
|
sharedConfigPath
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Q5U2HIBJ.js";
|
|
19
19
|
import {
|
|
20
20
|
installerOf
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HVXOA4FO.js";
|
|
22
22
|
import {
|
|
23
23
|
storePath
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZYEU35MB.js";
|
|
25
25
|
import {
|
|
26
26
|
__name
|
|
27
27
|
} from "./chunk-ZVVMGPBJ.js";
|
|
28
28
|
|
|
29
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/first-run.js
|
|
30
30
|
import { spawnSync } from "node:child_process";
|
|
31
31
|
import { accessSync, constants, realpathSync } from "node:fs";
|
|
32
32
|
import { delimiter, join } from "node:path";
|
|
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
|
|
|
84
84
|
return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
|
|
85
85
|
}, "suggested");
|
|
86
86
|
var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
|
|
87
|
-
const { openStore } = await import("./store-
|
|
87
|
+
const { openStore } = await import("./store-OXJZZUR7.js");
|
|
88
88
|
const store = await openStore({ env });
|
|
89
89
|
let rebuild = false;
|
|
90
90
|
try {
|
|
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
|
|
|
113
113
|
if (!rebuild)
|
|
114
114
|
return;
|
|
115
115
|
const [{ openCache }, { buildStems }] = await Promise.all([
|
|
116
|
-
import("./open-
|
|
117
|
-
import("./store-maintenance-command-
|
|
116
|
+
import("./open-5542RTLE.js"),
|
|
117
|
+
import("./store-maintenance-command-D7XYIX52.js")
|
|
118
118
|
]);
|
|
119
119
|
const database = await openCache(storePath(env));
|
|
120
120
|
try {
|
|
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
|
|
|
126
126
|
var askTools = /* @__PURE__ */ __name(async (run) => {
|
|
127
127
|
const { command, env, io } = run;
|
|
128
128
|
const installed = run.installed ?? ((name) => onPath(name, env));
|
|
129
|
-
const { WIRECAT_TOOLS } = await import("./first-screen-
|
|
129
|
+
const { WIRECAT_TOOLS } = await import("./first-screen-IESI7DAU.js");
|
|
130
130
|
const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
|
|
131
131
|
const missing = others.filter((tool) => !installed(tool.command));
|
|
132
132
|
io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
|
|
@@ -197,9 +197,10 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
|
|
|
197
197
|
command: start.command,
|
|
198
198
|
env: start.env,
|
|
199
199
|
contentLanguages: start.contentLanguages,
|
|
200
|
-
|
|
200
|
+
// `setup describe` and `setup apply` are a program's; only the bare walk-through asks everything again.
|
|
201
|
+
all: start.path.length === 1 && start.path[0] === "setup",
|
|
201
202
|
io: {
|
|
202
|
-
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-
|
|
203
|
+
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-WYYO4AJL.js")).readSecret(prompt, { input, echo: true }), "ask"),
|
|
203
204
|
say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
|
|
204
205
|
`), "say")
|
|
205
206
|
}
|
|
@@ -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.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/shared-5XR7K42U.js
|
|
8
8
|
var entityKind = /* @__PURE__ */ Symbol.for("drizzle:entityKind");
|
|
9
9
|
var kindsByConstructor = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
function collectKinds(ctor) {
|
|
@@ -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-Q5U2HIBJ.js";
|
|
7
7
|
import {
|
|
8
8
|
CliError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HM6AMYHR.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.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/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";
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
+
DEFAULT_PACE,
|
|
4
5
|
FloodMemory,
|
|
5
6
|
OFFLINE,
|
|
7
|
+
Pacer,
|
|
6
8
|
RecipientList,
|
|
7
|
-
capability,
|
|
8
9
|
ceilingRefusal,
|
|
9
10
|
chatIdIn,
|
|
10
11
|
floodPathFor,
|
|
11
12
|
guardFor,
|
|
12
13
|
holdEnd,
|
|
14
|
+
pacePathFor,
|
|
13
15
|
profilesOnAccount,
|
|
14
16
|
recipientsPathFor,
|
|
15
17
|
refuseLacking,
|
|
16
18
|
servicesFor,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
waitForTurn
|
|
20
|
+
} from "./chunk-QFMKCU42.js";
|
|
21
|
+
import {
|
|
22
|
+
capability,
|
|
23
|
+
throughWrapper
|
|
24
|
+
} from "./chunk-3EV2B7KZ.js";
|
|
20
25
|
import {
|
|
21
26
|
servingProfiles
|
|
22
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-TARNPINT.js";
|
|
23
28
|
import {
|
|
24
29
|
asFirstWord,
|
|
25
30
|
baseContext,
|
|
@@ -33,7 +38,7 @@ import {
|
|
|
33
38
|
recalledAccount,
|
|
34
39
|
rememberAccount,
|
|
35
40
|
rootOf2 as rootOf
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QYCMB7JY.js";
|
|
37
42
|
import {
|
|
38
43
|
AUTHORITY_KEY,
|
|
39
44
|
CEILING_KEY,
|
|
@@ -45,34 +50,31 @@ import {
|
|
|
45
50
|
levelFor,
|
|
46
51
|
readKeysForCommand,
|
|
47
52
|
skipFlagFor
|
|
48
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-HF5QWKK2.js";
|
|
49
54
|
import {
|
|
50
55
|
providerErrorKey
|
|
51
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-UHGKN5US.js";
|
|
52
57
|
import {
|
|
53
58
|
openStore
|
|
54
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-EX4Z7CCO.js";
|
|
55
60
|
import {
|
|
56
61
|
chatReferenceOf,
|
|
57
62
|
ensureAccount,
|
|
58
63
|
foldName,
|
|
59
64
|
isId,
|
|
60
65
|
pickPerson
|
|
61
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-DREU6TN6.js";
|
|
62
67
|
import {
|
|
63
68
|
isCliFailure
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import {
|
|
66
|
-
resolvePaths
|
|
67
|
-
} from "./chunk-BRRHYXUP.js";
|
|
69
|
+
} from "./chunk-UWDRU3R6.js";
|
|
68
70
|
import {
|
|
69
71
|
CliError
|
|
70
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-HM6AMYHR.js";
|
|
71
73
|
import {
|
|
72
74
|
__name
|
|
73
75
|
} from "./chunk-ZVVMGPBJ.js";
|
|
74
76
|
|
|
75
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
77
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
|
|
76
78
|
import { openSync } from "node:fs";
|
|
77
79
|
import { createInterface } from "node:readline";
|
|
78
80
|
import { ReadStream } from "node:tty";
|
|
@@ -127,102 +129,7 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
|
|
|
127
129
|
throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
|
|
128
130
|
}, "terminalAsker");
|
|
129
131
|
|
|
130
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
131
|
-
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
132
|
-
import { join } from "node:path";
|
|
133
|
-
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
134
|
-
var pacePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "pace", `${profile}.json`), "pacePathFor");
|
|
135
|
-
var Pacer = class {
|
|
136
|
-
static {
|
|
137
|
-
__name(this, "Pacer");
|
|
138
|
-
}
|
|
139
|
-
path;
|
|
140
|
-
rate;
|
|
141
|
-
now;
|
|
142
|
-
constructor(path, rate, now = Date.now) {
|
|
143
|
-
this.path = path;
|
|
144
|
-
this.rate = rate;
|
|
145
|
-
this.now = now;
|
|
146
|
-
}
|
|
147
|
-
get interval() {
|
|
148
|
-
return this.rate.perMinute > 0 ? 6e4 / this.rate.perMinute : 0;
|
|
149
|
-
}
|
|
150
|
-
/** When this call may go; reserved at once, so the next caller in any process lines up behind it. */
|
|
151
|
-
async reserve() {
|
|
152
|
-
if (this.interval === 0)
|
|
153
|
-
return this.now();
|
|
154
|
-
return withFileLockAsync(this.path, "the request pace", () => {
|
|
155
|
-
const now = this.now();
|
|
156
|
-
const tat = Math.max(this.read(now), now);
|
|
157
|
-
this.write(tat + this.interval, now);
|
|
158
|
-
return Math.max(now, tat - this.rate.burst * this.interval);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
/** The messenger asked every caller to wait: nothing goes before `now + waitMs`, in any process. */
|
|
162
|
-
async holdFor(waitMs) {
|
|
163
|
-
if (this.interval === 0)
|
|
164
|
-
return;
|
|
165
|
-
await withFileLockAsync(this.path, "the request pace", () => {
|
|
166
|
-
const now = this.now();
|
|
167
|
-
const hold = now + waitMs + this.rate.burst * this.interval;
|
|
168
|
-
this.write(Math.max(this.read(now), hold), now);
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/** The owner's `flood clear`: every process may go again at once. */
|
|
172
|
-
async reset() {
|
|
173
|
-
await withFileLockAsync(this.path, "the request pace", () => this.write(0, this.now()));
|
|
174
|
-
}
|
|
175
|
-
read(now) {
|
|
176
|
-
try {
|
|
177
|
-
const file = JSON.parse(readFileSync(this.path, "utf8"));
|
|
178
|
-
const tat = Number(file.tat);
|
|
179
|
-
if (!Number.isFinite(tat))
|
|
180
|
-
return 0;
|
|
181
|
-
const at = Number(file.at);
|
|
182
|
-
return Number.isFinite(at) && at > now ? now + Math.max(0, tat - at) : tat;
|
|
183
|
-
} catch {
|
|
184
|
-
return 0;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
write(tat, at) {
|
|
188
|
-
const temporary = `${this.path}.${process.pid}.tmp`;
|
|
189
|
-
writeFileSync(temporary, JSON.stringify({ tat, at }), { mode: 384 });
|
|
190
|
-
renameSync(temporary, this.path);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
var ANNOUNCE_WAIT_MS = 5e3;
|
|
194
|
-
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
195
|
-
var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
|
|
196
|
-
const { name, operation, warn } = options;
|
|
197
|
-
const now = options.now ?? Date.now;
|
|
198
|
-
let at = now();
|
|
199
|
-
try {
|
|
200
|
-
at = await pacer.reserve();
|
|
201
|
-
} catch (error) {
|
|
202
|
-
warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
|
|
203
|
-
event: "warning",
|
|
204
|
-
code: "wait_not_remembered",
|
|
205
|
-
operation
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
const waitMs = at - now();
|
|
209
|
-
if (waitMs <= 0)
|
|
210
|
-
return;
|
|
211
|
-
if (waitMs > (options.longestWaitMs ?? LONGEST_PACE_WAIT_MS))
|
|
212
|
-
throw new CliError("rate_limited", `this profile's next request to ${name} has to wait ${Math.ceil(waitMs / 1e3)} s more \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
213
|
-
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
214
|
-
const seconds = Math.ceil(waitMs / 1e3);
|
|
215
|
-
warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
216
|
-
event: "warning",
|
|
217
|
-
code: "pace_wait",
|
|
218
|
-
operation,
|
|
219
|
-
counts: { seconds }
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
|
|
223
|
-
}, "waitForTurn");
|
|
224
|
-
|
|
225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
132
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
226
133
|
var HOUSEKEEPING = /* @__PURE__ */ new Set([
|
|
227
134
|
"help",
|
|
228
135
|
"guide",
|
|
@@ -302,7 +209,7 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
|
|
|
302
209
|
throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
|
|
303
210
|
}, "refuseUnknownPermissionKeys");
|
|
304
211
|
|
|
305
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
|
|
306
213
|
var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
|
|
307
214
|
var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
|
|
308
215
|
var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
|
|
@@ -399,7 +306,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
399
306
|
});
|
|
400
307
|
}, "flooded");
|
|
401
308
|
|
|
402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
|
|
403
310
|
var observed = /* @__PURE__ */ __name((messenger, events) => {
|
|
404
311
|
const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
|
|
405
312
|
const write = currentOperation();
|
|
@@ -498,7 +405,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
|
|
|
498
405
|
counts[part] = (counts[part] ?? 0) + items.length;
|
|
499
406
|
}, "byPart");
|
|
500
407
|
|
|
501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
408
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
|
|
502
409
|
var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
|
|
503
410
|
var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
|
|
504
411
|
let warned = false;
|
|
@@ -1074,7 +981,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
|
|
|
1074
981
|
}
|
|
1075
982
|
}, "keep");
|
|
1076
983
|
|
|
1077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
|
|
1078
985
|
var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
|
|
1079
986
|
let opened;
|
|
1080
987
|
return {
|
|
@@ -1477,9 +1384,6 @@ var messengerContext = /* @__PURE__ */ __name((command, messenger, resolving = {
|
|
|
1477
1384
|
export {
|
|
1478
1385
|
answerOf,
|
|
1479
1386
|
terminalAsker,
|
|
1480
|
-
DEFAULT_PACE,
|
|
1481
|
-
pacePathFor,
|
|
1482
|
-
Pacer,
|
|
1483
1387
|
commandPermissions,
|
|
1484
1388
|
knownPermissionKeys,
|
|
1485
1389
|
knownBeside,
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
} from "./chunk-Y5E2WNWB.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HM6AMYHR.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
14
14
|
import { createRequire } from "node:module";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
|
|
17
17
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
|
|
18
18
|
var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
19
19
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
@@ -70,7 +70,7 @@ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
|
70
70
|
throw invalid();
|
|
71
71
|
}, "checkOggDuration");
|
|
72
72
|
|
|
73
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
73
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
74
74
|
var SAMPLE_RATE = 16e3;
|
|
75
75
|
var LEAD = SAMPLE_RATE / 2;
|
|
76
76
|
var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
|