@wirecat/tg-cli 0.133.0 → 0.135.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/README.md +2 -3
- package/contracts/wirecat.json +82 -2
- package/dist/bin/tg.js +2 -2
- package/dist/bot/generated/types.d.ts +188 -0
- package/dist/bot/generated/types.d.ts.map +1 -1
- package/dist/bundle/{adapter-GSGX3WBH.js → adapter-OHJF6PB5.js} +104 -69
- package/dist/bundle/agent-QPF2KU4I.js +37 -0
- package/dist/bundle/{all-profiles-VOCJ55YH.js → all-profiles-LQ73BIFB.js} +62 -20
- package/dist/bundle/{anthropic-J6CTLU3W.js → anthropic-YYBMT2HD.js} +5 -5
- package/dist/bundle/{app-server-GVFGA4TJ.js → app-server-HV4C4CSA.js} +72 -62
- package/dist/bundle/{bot-api-LWONPIGK.js → bot-api-URQXWMVR.js} +73 -92
- package/dist/bundle/{bot-history-XOW7Y2GC.js → bot-history-FRLCHPDQ.js} +23 -22
- package/dist/bundle/{bun-436CH6CP.js → bun-J3ML43BO.js} +2 -2
- package/dist/bundle/{bun-sqlite-ZLB5RK5Q.js → bun-sqlite-ZNB2B2DL.js} +6 -6
- package/dist/bundle/{chunk-UGS57TT5.js → chunk-24G3SEXH.js} +2 -2
- package/dist/bundle/chunk-27F6QBPY.js +555 -0
- package/dist/bundle/{chunk-6VCSOQFL.js → chunk-2OFCIF2W.js} +2 -2
- package/dist/bundle/{chunk-VGN5YXYI.js → chunk-2U7XA4IH.js} +2 -100
- package/dist/bundle/{chunk-LBZEZO32.js → chunk-4CLSIEWN.js} +65 -43
- package/dist/bundle/chunk-5CEKH6R6.js +340 -0
- package/dist/bundle/{chunk-SMI2EUH4.js → chunk-5WEEK65F.js} +1 -1
- package/dist/bundle/{chunk-OX73ERZW.js → chunk-6VWVYPH2.js} +3 -4
- package/dist/bundle/{chunk-5HKPQPD4.js → chunk-6WS474NQ.js} +6 -6
- package/dist/bundle/{chunk-IYAXLLGR.js → chunk-7GWOGEWJ.js} +6 -6
- package/dist/bundle/{chunk-TPD37ECC.js → chunk-AMRMU23L.js} +16 -3
- package/dist/bundle/{chunk-ZHO3TPHM.js → chunk-B2UXNYCD.js} +30 -15
- package/dist/bundle/{chunk-YY6FGKGD.js → chunk-B4ZMFU5I.js} +2 -2
- package/dist/bundle/{chunk-54WLIPIQ.js → chunk-BFKPMG5T.js} +1 -1
- package/dist/bundle/{chunk-KHUXDSXN.js → chunk-BQSODAU3.js} +1 -1
- package/dist/bundle/{chunk-N3JUHGKM.js → chunk-BXUMZWMN.js} +3786 -3364
- package/dist/bundle/{chunk-VTQMR3XG.js → chunk-E2VIO7RY.js} +3 -3
- package/dist/bundle/{chunk-UZ63ORMY.js → chunk-F5FOS64B.js} +4 -4
- package/dist/bundle/{chunk-LIQMUDIZ.js → chunk-GCUFGDKE.js} +2 -2
- package/dist/bundle/chunk-GUERS64O.js +108 -0
- package/dist/bundle/{chunk-5LRTYBZW.js → chunk-HILS2UL7.js} +12 -12
- package/dist/bundle/{chunk-6S77EKZU.js → chunk-IOJOLV25.js} +17 -15
- package/dist/bundle/{chunk-IBCXEVNY.js → chunk-JBS4VPAX.js} +3 -3
- package/dist/bundle/{chunk-5L44DSHV.js → chunk-K5QGBYDL.js} +4 -4
- package/dist/bundle/{chunk-NO2LIHWA.js → chunk-KKXF6TSS.js} +1 -1
- package/dist/bundle/chunk-L2ZQDTDU.js +7 -0
- package/dist/bundle/{chunk-HB5DP6L5.js → chunk-LFPUW7DR.js} +18 -18
- package/dist/bundle/{chunk-QWO7L4UH.js → chunk-LGYATGQI.js} +7 -7
- package/dist/bundle/{chunk-IH4Z3KZU.js → chunk-MA27675E.js} +2 -2
- package/dist/bundle/{chunk-6H2NW6HK.js → chunk-MDI7554C.js} +3 -3
- package/dist/bundle/{chunk-KVFUH5IT.js → chunk-MMZ4QAKJ.js} +1 -1
- package/dist/bundle/{chunk-XOX4BX5A.js → chunk-MOPBEBVS.js} +4 -4
- package/dist/bundle/{chunk-XKOMP3HV.js → chunk-MPRXUTIK.js} +6 -6
- package/dist/bundle/{chunk-QYLZD4DS.js → chunk-N7F5KT6U.js} +1 -1
- package/dist/bundle/{chunk-KUA24HWG.js → chunk-NBP6LXSY.js} +2 -2
- package/dist/bundle/{chunk-UQYL6TJ7.js → chunk-NP46ZKQW.js} +4 -4
- package/dist/bundle/{chunk-QGWISM4W.js → chunk-NRSJXUUO.js} +34 -28
- package/dist/bundle/{chunk-7NYP4RBO.js → chunk-NVWZ7S3I.js} +2294 -1221
- package/dist/bundle/chunk-OBIMTRA7.js +80 -0
- package/dist/bundle/{chunk-VWJTYAIQ.js → chunk-OQJURSRL.js} +17 -17
- package/dist/bundle/chunk-OU3WN4YH.js +50 -0
- package/dist/bundle/{chunk-VCAOH45X.js → chunk-PBK2ECXT.js} +1 -1
- package/dist/bundle/{chunk-TTDZVWDU.js → chunk-PHAFT2BO.js} +1 -1
- package/dist/bundle/{chunk-NTWXL2QV.js → chunk-PKIGE4NE.js} +2 -2
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-NAXOT35J.js → chunk-QBRQLOZA.js} +3 -3
- package/dist/bundle/{chunk-RABUG4KA.js → chunk-QD4MTOI7.js} +511 -472
- package/dist/bundle/{chunk-LOS4D6ZB.js → chunk-QHQ52UMF.js} +159 -569
- package/dist/bundle/{chunk-6CHIGUCY.js → chunk-R2G3MWEF.js} +31 -20
- package/dist/bundle/{chunk-THYGLTRB.js → chunk-RCEP5OXD.js} +7 -7
- package/dist/bundle/chunk-RHJ2VGHV.js +353 -0
- package/dist/bundle/{chunk-QVGEL66U.js → chunk-RXBKVNOK.js} +53 -11
- package/dist/bundle/{chunk-ZYAHZKYF.js → chunk-RZ7POTFA.js} +3 -3
- package/dist/bundle/{chunk-KEN4B57V.js → chunk-S7PIM4GG.js} +2 -2
- package/dist/bundle/{chunk-BXVB42KJ.js → chunk-SIDGH56R.js} +2 -2
- package/dist/bundle/{chunk-XDQU5HBO.js → chunk-SRMELB6Q.js} +12 -12
- package/dist/bundle/{chunk-SMU6NA7F.js → chunk-SVPNU7PD.js} +4 -4
- package/dist/bundle/{chunk-JPNVEPS4.js → chunk-TB2MG6PE.js} +2351 -2028
- package/dist/bundle/{chunk-JGMXBAGH.js → chunk-UN5TH2CG.js} +156 -434
- package/dist/bundle/{chunk-YAPDU3SV.js → chunk-V3ZWYMXT.js} +1 -1
- package/dist/bundle/{chunk-7NF3V5L2.js → chunk-VFU25P57.js} +4 -4
- package/dist/bundle/{chunk-LQQSDGQ6.js → chunk-VJEMCJPL.js} +56 -46
- package/dist/bundle/{chunk-UIAKLELF.js → chunk-VK2NDTBS.js} +94 -64
- package/dist/bundle/{chunk-UKBK2VWZ.js → chunk-W6A2OZ3C.js} +232 -176
- package/dist/bundle/{chunk-IPPCQ7IK.js → chunk-WDI6LA4X.js} +2 -2
- package/dist/bundle/{chunk-N7QREPZW.js → chunk-WTGRQGQL.js} +16 -9
- package/dist/bundle/{chunk-57KJ3TRS.js → chunk-WUCTF2XE.js} +9 -9
- package/dist/bundle/{chunk-JKSD43L7.js → chunk-WZCRCCOZ.js} +6 -6
- package/dist/bundle/{chunk-H7ML7X3G.js → chunk-XB6O445X.js} +144 -10
- package/dist/bundle/{chunk-O6JUVATT.js → chunk-XKFES4EM.js} +35 -12
- package/dist/bundle/chunk-YBUX6EAK.js +388 -0
- package/dist/bundle/{chunk-WCYKVX3B.js → chunk-YMRL7MYS.js} +7 -7
- package/dist/bundle/{chunk-M6QOM6SL.js → chunk-Z6M6NZUX.js} +1 -1
- package/dist/bundle/chunk-ZCDRXKCR.js +727 -0
- package/dist/bundle/{chunk-6A44ZZFC.js → chunk-ZJ3S4S6H.js} +43 -64
- package/dist/bundle/{chunk-TCI7I6YF.js → chunk-ZL7TJXFL.js} +11 -25
- package/dist/bundle/{chunk-2KQDJHF3.js → chunk-ZMBVZWUW.js} +29 -1
- package/dist/bundle/{chunk-OWY52JBO.js → chunk-ZMTASSIB.js} +7 -7
- package/dist/bundle/{chunk-D2SJLZSH.js → chunk-ZQ5ERQHO.js} +2 -2
- package/dist/bundle/{chunk-CEJYNB3I.js → chunk-ZWVDXVG3.js} +4 -4
- package/dist/bundle/command-contract-K4MU32K6.js +37 -0
- package/dist/bundle/{command-server-entry-AE27QXTE.js → command-server-entry-XP6BVJIK.js} +27 -27
- package/dist/bundle/{decode-RQPPZ72F.js → decode-TUB45ALX.js} +5 -5
- package/dist/bundle/{dispatch-KQO2MCSH.js → dispatch-ICPUKMEG.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-FZRIACN4.js → echarts-HJ7D7XTM.js} +2 -2
- package/dist/bundle/{embed-TOSWWMDL.js → embed-4QDN36YF.js} +6 -6
- package/dist/bundle/{embedder-JHIQSBGD.js → embedder-Q7ID2LEG.js} +9 -9
- package/dist/bundle/{entry-DU4KRXTG.js → entry-Z6VRZP7F.js} +9 -9
- package/dist/bundle/{failure-3YC3YGYO.js → failure-PEPNEEK7.js} +2 -2
- package/dist/bundle/{first-run-DQQT4FID.js → first-run-GKBEHAAX.js} +12 -12
- package/dist/bundle/first-screen-IA3ONZ75.js +37 -0
- package/dist/bundle/{instructions-WI64CJQ6.js → instructions-26ZXYYMY.js} +1 -1
- package/dist/bundle/{mcp-VMS6PBCU.js → mcp-KGWT6TGO.js} +2 -2
- package/dist/bundle/meeting-combined-KUV2HP52.js +23 -0
- package/dist/bundle/{meeting-model-XNRSREIK.js → meeting-model-JB7X4CA3.js} +11 -11
- package/dist/bundle/{meeting-semantic-OOSCHQMB.js → meeting-semantic-MQNUVG33.js} +6 -6
- package/dist/bundle/{node-JLKDNVKV.js → node-RIANITAT.js} +2 -2
- package/dist/bundle/{node-sqlite-YOGH26O2.js → node-sqlite-I2P26Z3S.js} +7 -7
- package/dist/bundle/{oauth-FOMXM5HP.js → oauth-GFMJL2ZZ.js} +8 -8
- package/dist/bundle/{open-SM2UXUKM.js → open-CWVYEFNN.js} +5 -5
- package/dist/bundle/{openai-J2H7S6ZF.js → openai-PQLK7YTJ.js} +15 -15
- package/dist/bundle/{process-HI7OZBOI.js → process-P4D4KFWE.js} +1 -1
- package/dist/bundle/{program-VY4HFU25.js → program-MF4QZJKH.js} +70 -64
- package/dist/bundle/{prompt-NUUVFMOF.js → prompt-JWIOYU53.js} +5 -5
- package/dist/bundle/{proxy-transport-AN4VMRRN.js → proxy-transport-DWY6ABVT.js} +5 -5
- package/dist/bundle/{recognize-MALJHPDI.js → recognize-IPJL4CQZ.js} +4 -4
- package/dist/bundle/{remote-QUDRSTS2.js → remote-DVY6F6YO.js} +9 -9
- package/dist/bundle/{rerank-2DSO3D3S.js → rerank-XSPWLBIO.js} +7 -7
- package/dist/bundle/{serve-NCJ52MY3.js → serve-AJAVEH2M.js} +15 -15
- package/dist/bundle/server-GGXUR5BZ.js +78 -0
- package/dist/bundle/{server-Y3M544AM.js → server-GII7NIKF.js} +65 -54
- package/dist/bundle/{sqlite-runtime-NJUSXVKK.js → sqlite-runtime-KFDYJTUO.js} +6 -6
- package/dist/bundle/{state-AVOWQVET.js → state-76OJSCQC.js} +6 -6
- package/dist/bundle/{store-MMIYOL4H.js → store-2KJS4YMH.js} +28 -17
- package/dist/bundle/{store-BZ5ICDRP.js → store-FBP2J23G.js} +20 -19
- package/dist/bundle/store-maintenance-command-NUWOUZ62.js +65 -0
- package/dist/bundle/surface-EGSHCISG.js +64 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/telegram/adapter.d.ts +9 -2
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/adapter.js +5 -6
- package/dist/telegram/adapter.js.map +1 -1
- package/dist/telegram/messages.d.ts +12 -0
- package/dist/telegram/messages.d.ts.map +1 -1
- package/dist/telegram/messages.js +40 -0
- package/dist/telegram/messages.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +7 -4
- package/skills/tg-cli/references/messages.md +5 -1
- package/skills/tg-cli/references/search.md +2 -0
- package/dist/bundle/chunk-SHTHNBHG.js +0 -2
- package/dist/bundle/command-contract-TQIARAB4.js +0 -37
- package/dist/bundle/first-screen-7N4CTZSA.js +0 -37
- package/dist/bundle/meeting-combined-3RAOFQ7M.js +0 -23
- package/dist/bundle/server-CHGON5I2.js +0 -70
- package/dist/bundle/store-maintenance-command-VKZ4WHUB.js +0 -61
|
@@ -1,70 +1,35 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
agentArguments,
|
|
7
|
-
agentJson,
|
|
8
|
-
commandAvailability,
|
|
9
|
-
failureContext
|
|
10
|
-
} from "./chunk-JGMXBAGH.js";
|
|
4
|
+
commandAvailability
|
|
5
|
+
} from "./chunk-OU3WN4YH.js";
|
|
11
6
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
7
|
+
lentConnection
|
|
8
|
+
} from "./chunk-5CEKH6R6.js";
|
|
14
9
|
import {
|
|
15
|
-
QUERY_ARGUMENT
|
|
16
|
-
|
|
17
|
-
onlineDeps,
|
|
18
|
-
refuseLacking,
|
|
19
|
-
servicesFor,
|
|
20
|
-
storeModeDeps
|
|
21
|
-
} from "./chunk-N3JUHGKM.js";
|
|
10
|
+
QUERY_ARGUMENT
|
|
11
|
+
} from "./chunk-ZCDRXKCR.js";
|
|
22
12
|
import {
|
|
23
|
-
MAX_BUFFERED_INPUT
|
|
24
|
-
} from "./chunk-UGS57TT5.js";
|
|
25
|
-
import {
|
|
26
|
-
DEFAULT_OUTPUT_BYTES,
|
|
27
|
-
ENTITIES,
|
|
28
|
-
LOCAL_WRITE,
|
|
29
|
-
REMOTE_WRITE,
|
|
30
|
-
answerSchema,
|
|
31
13
|
authorityAllowed,
|
|
32
14
|
botApiAllowed,
|
|
33
15
|
changesMessenger,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
judgedAnswer,
|
|
37
|
-
judgedEffects,
|
|
38
|
-
keyForCommand,
|
|
39
|
-
levelFor,
|
|
40
|
-
listOf,
|
|
41
|
-
readKeysForCommand,
|
|
42
|
-
refuseStoreChange,
|
|
43
|
-
sealed,
|
|
44
|
-
startRecording
|
|
45
|
-
} from "./chunk-UKBK2VWZ.js";
|
|
16
|
+
flatten
|
|
17
|
+
} from "./chunk-W6A2OZ3C.js";
|
|
46
18
|
import {
|
|
47
|
-
currentCaller
|
|
48
|
-
|
|
49
|
-
runContextOf,
|
|
50
|
-
withCaller
|
|
51
|
-
} from "./chunk-QWO7L4UH.js";
|
|
19
|
+
currentCaller
|
|
20
|
+
} from "./chunk-LGYATGQI.js";
|
|
52
21
|
import {
|
|
53
22
|
enclosingTraceId,
|
|
54
23
|
inRun,
|
|
55
24
|
newRunId,
|
|
56
25
|
traceOf
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import {
|
|
59
|
-
storeDamaged
|
|
60
|
-
} from "./chunk-ZYAHZKYF.js";
|
|
26
|
+
} from "./chunk-4CLSIEWN.js";
|
|
61
27
|
import {
|
|
62
28
|
queryDescription
|
|
63
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-QD4MTOI7.js";
|
|
64
30
|
import {
|
|
65
|
-
captureStreams
|
|
66
|
-
|
|
67
|
-
} from "./chunk-6CHIGUCY.js";
|
|
31
|
+
captureStreams
|
|
32
|
+
} from "./chunk-R2G3MWEF.js";
|
|
68
33
|
import {
|
|
69
34
|
COMPACT_FLAG,
|
|
70
35
|
SNAKE_CASE,
|
|
@@ -75,13 +40,7 @@ import {
|
|
|
75
40
|
errorObjectOf,
|
|
76
41
|
integer,
|
|
77
42
|
isoDate,
|
|
78
|
-
itemEnvelopeSchema,
|
|
79
|
-
listEnvelopeSchema,
|
|
80
43
|
literal,
|
|
81
|
-
looseObject,
|
|
82
|
-
maxLength,
|
|
83
|
-
maxValue,
|
|
84
|
-
mcpErrorResult,
|
|
85
44
|
minLength,
|
|
86
45
|
minValue,
|
|
87
46
|
number,
|
|
@@ -92,30 +51,25 @@ import {
|
|
|
92
51
|
pipe,
|
|
93
52
|
record,
|
|
94
53
|
regex,
|
|
95
|
-
safeParse,
|
|
96
54
|
strictObject,
|
|
97
55
|
string,
|
|
98
|
-
summarize,
|
|
99
56
|
text,
|
|
100
|
-
toJsonSchema,
|
|
101
|
-
toStandardJsonSchema,
|
|
102
57
|
union,
|
|
103
58
|
unknown,
|
|
104
59
|
word,
|
|
105
60
|
writes
|
|
106
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RXBKVNOK.js";
|
|
107
62
|
import {
|
|
108
|
-
CliError
|
|
109
|
-
|
|
110
|
-
} from "./chunk-LIQMUDIZ.js";
|
|
63
|
+
CliError
|
|
64
|
+
} from "./chunk-GCUFGDKE.js";
|
|
111
65
|
import {
|
|
112
66
|
__name
|
|
113
67
|
} from "./chunk-ZVVMGPBJ.js";
|
|
114
68
|
|
|
115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
69
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
116
70
|
import { Readable } from "node:stream";
|
|
117
71
|
|
|
118
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
72
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
|
|
119
73
|
var LINT_SEVERITIES = ["high", "medium", "low"];
|
|
120
74
|
var lintRuleSchema = strictObject({
|
|
121
75
|
id: word,
|
|
@@ -261,7 +215,7 @@ var overrideSchema = strictObject({
|
|
|
261
215
|
});
|
|
262
216
|
var overridesSchema = array(overrideSchema);
|
|
263
217
|
|
|
264
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
218
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
|
|
265
219
|
var auditRuleSchema = strictObject({ id: word, severity: picklist(LINT_SEVERITIES), summary: text });
|
|
266
220
|
var defineAuditRules = /* @__PURE__ */ __name((input) => parseRegistry("audit rules", array(auditRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineAuditRules");
|
|
267
221
|
var AUDIT_RULES = defineAuditRules([
|
|
@@ -316,17 +270,20 @@ var parityGroupSchema = strictObject({
|
|
|
316
270
|
absent: optional(word),
|
|
317
271
|
/** The one CLI that has the path or flag by design; every other CLI compared must lack it. */
|
|
318
272
|
only: optional(word),
|
|
273
|
+
/** The one CLI whose value (a summary, a value name) differs by design; every other CLI compared must agree. */
|
|
274
|
+
differs: optional(word),
|
|
319
275
|
reason: pipe(text, minLength(10, "say why, in a sentence")),
|
|
320
276
|
/** Warns from 14 days before and fails 14 days after, as a lint override does. */
|
|
321
277
|
review_after: optional(pipe(string(), isoDate("a date, YYYY-MM-DD")))
|
|
322
278
|
}))
|
|
323
279
|
});
|
|
280
|
+
var kindOf = /* @__PURE__ */ __name((entry) => ["absent", "only", "differs"].filter((one) => entry[one] !== void 0), "kindOf");
|
|
324
281
|
var defineParityGroups = /* @__PURE__ */ __name((input) => parseRegistry("parity groups", array(parityGroupSchema), input, (groups) => [
|
|
325
282
|
...duplicates(groups.map((group) => group.name)).map((name) => `"${name}" is listed twice`),
|
|
326
283
|
...groups.flatMap((group) => [
|
|
327
284
|
...duplicates(group.differences.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `${group.name}: "${both}" is listed twice`),
|
|
328
|
-
...group.differences.filter((entry) => (entry.
|
|
329
|
-
...group.differences.filter((entry) => entry.
|
|
285
|
+
...group.differences.filter((entry) => kindOf(entry).length === 1 && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`${kindOf(entry)[0]}\`, which measures the values itself; drop \`expected\``),
|
|
286
|
+
...group.differences.filter((entry) => kindOf(entry).length > 1).map((entry) => `${group.name}: "${entry.target}" has ${kindOf(entry).map((one) => `\`${one}\``).join(" and ")}; keep one`)
|
|
330
287
|
])
|
|
331
288
|
]), "defineParityGroups");
|
|
332
289
|
var MEMO_HAS_NO_PROFILES = [
|
|
@@ -341,6 +298,12 @@ var MEMO_HAS_NO_PROFILES = [
|
|
|
341
298
|
absent: "memo",
|
|
342
299
|
reason: "memo has no profiles: it reads other CLIs' stores and selects their accounts with --source and --account (https://github.com/WireCatLabs/cli-base/issues/390)"
|
|
343
300
|
}));
|
|
301
|
+
var MEMO_MCP_SUMMARIES = ["mcp", "mcp serve"].map((path) => ({
|
|
302
|
+
rule: "same-path-contract",
|
|
303
|
+
target: `${path}: summary`,
|
|
304
|
+
differs: "memo",
|
|
305
|
+
reason: "memo has no profiles, so its mcp commands serve memo's commands rather than a profile's"
|
|
306
|
+
}));
|
|
344
307
|
var MEMO_DOCTOR_DEEP = {
|
|
345
308
|
rule: "same-path-contract",
|
|
346
309
|
target: "doctor --deep",
|
|
@@ -363,7 +326,13 @@ var FAMILY_SINCE_0_98 = [
|
|
|
363
326
|
review(ENTITY, "entity lead", "b24's CRM lead and memo's differ (measured 2026-11-13)"),
|
|
364
327
|
review(ENTITY, "entity product", "b24's CRM product and memo's differ (measured 2026-11-13)"),
|
|
365
328
|
review(REASON, "reason ai.address-refused=model.address-refused", "one failure under two names; cli-core 0.650.0 keeps one"),
|
|
366
|
-
review(REASON, "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)")
|
|
329
|
+
review(REASON, "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)"),
|
|
330
|
+
{
|
|
331
|
+
rule: REASON,
|
|
332
|
+
target: "reason account-remove.unknown-profile=account-rename.unknown-profile",
|
|
333
|
+
reason: "one failure under two names in cli-core 0.715\u20130.716; 0.717.0 gives account rename profile.unknown",
|
|
334
|
+
review_after: "2026-12-10"
|
|
335
|
+
}
|
|
367
336
|
];
|
|
368
337
|
var PARITY_GROUPS = defineParityGroups([
|
|
369
338
|
{ name: "messengers", members: ["tg", "max"], covers: "tree", differences: MESSENGERS_SINCE_0_98 },
|
|
@@ -371,7 +340,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
371
340
|
name: "all",
|
|
372
341
|
members: ["tg", "max", "memo", "drive", "zm", "wa"],
|
|
373
342
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
|
|
374
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
343
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
375
344
|
},
|
|
376
345
|
// mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
|
|
377
346
|
// differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
|
|
@@ -380,7 +349,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
380
349
|
name: "mail-shared",
|
|
381
350
|
members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
|
|
382
351
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
|
|
383
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
352
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
384
353
|
},
|
|
385
354
|
// gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
|
|
386
355
|
// CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
|
|
@@ -392,27 +361,60 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
392
361
|
},
|
|
393
362
|
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
|
|
394
363
|
// recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
|
|
395
|
-
//
|
|
364
|
+
// amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
|
|
365
|
+
// wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
|
|
366
|
+
// linear-cli shares only these roots too: it is the first tracker CLI, so its issues commands have no group yet.
|
|
367
|
+
// notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
|
|
368
|
+
// its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
|
|
369
|
+
// and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
|
|
396
370
|
{
|
|
397
371
|
name: "shared-roots",
|
|
398
|
-
members: [
|
|
372
|
+
members: [
|
|
373
|
+
"tg",
|
|
374
|
+
"max",
|
|
375
|
+
"memo",
|
|
376
|
+
"drive",
|
|
377
|
+
"zm",
|
|
378
|
+
"wa",
|
|
379
|
+
"b24",
|
|
380
|
+
"beeline",
|
|
381
|
+
"pbx",
|
|
382
|
+
"notion",
|
|
383
|
+
"amo",
|
|
384
|
+
"hubspot",
|
|
385
|
+
"attio",
|
|
386
|
+
"ydisk",
|
|
387
|
+
"wordpress",
|
|
388
|
+
"linear"
|
|
389
|
+
],
|
|
399
390
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
|
|
400
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
391
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
401
392
|
},
|
|
402
|
-
// The CRM CLIs on cli-core's shared CRM commands.
|
|
403
|
-
// skips it, as beeline. Only b24
|
|
404
|
-
// later) and `deals delete` (amoCRM's
|
|
405
|
-
// https://www.amocrm.ru/developers/content/crm_platform/leads-api)
|
|
406
|
-
// these need no difference. `people`, `organizations`,
|
|
407
|
-
// is on cli-core's shared people and organizations
|
|
408
|
-
// in options, outputs and summaries.
|
|
393
|
+
// The CRM CLIs on cli-core's shared CRM commands. hubspot-cli is not in the family packages, so `audit --family`
|
|
394
|
+
// skips it, as beeline. Only b24 and hubspot have `leads` (amoCRM
|
|
395
|
+
// has no lead apart from a deal), only b24 has `products` (amo leaves them for later) and `deals delete` (amoCRM's
|
|
396
|
+
// API v4 cannot delete a lead, https://www.amocrm.ru/developers/content/crm_platform/leads-api), and hubspot writes
|
|
397
|
+
// no deals yet; a list of roots does not compare presence, so these need no difference. `people`, `organizations`,
|
|
398
|
+
// `users`, `api` and `session` join once b24's released tree is on cli-core's shared people and organizations
|
|
399
|
+
// commands: measured against b24 0.23.0 on 2026-11-16 they differ in options, outputs and summaries.
|
|
409
400
|
{
|
|
410
401
|
name: "crm",
|
|
411
|
-
members: ["b24", "amo"],
|
|
402
|
+
members: ["b24", "amo", "hubspot", "attio"],
|
|
412
403
|
covers: ["deals", "sync", "search", "store", "schedule", "account"],
|
|
413
|
-
differences: [
|
|
404
|
+
differences: [
|
|
405
|
+
{
|
|
406
|
+
rule: "same-path-contract",
|
|
407
|
+
target: "schedule: summary",
|
|
408
|
+
differs: "hubspot",
|
|
409
|
+
reason: "cli-core cuts the summary to a fixed width after it puts in the CLI's name (src/cli/help/commands-text.ts), so hubspot's longer name ends it a word earlier than b24's and amo's",
|
|
410
|
+
review_after: "2026-12-01"
|
|
411
|
+
}
|
|
412
|
+
]
|
|
414
413
|
}
|
|
415
414
|
]);
|
|
415
|
+
var SHARED_DIFFERENCES = [
|
|
416
|
+
...new Map(PARITY_GROUPS.flatMap((group) => group.differences).filter((entry) => entry.rule === "same-entity-schema" || entry.rule === "same-error-reason").map((entry) => [`${entry.rule} ${entry.target}`, entry])).values()
|
|
417
|
+
];
|
|
416
418
|
var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
|
|
417
419
|
var defineRequiredRoots = /* @__PURE__ */ __name((input) => parseRegistry("required roots", array(requiredRootSchema), input, (roots2) => duplicates(roots2.map((root) => root.path.join(" "))).map((path) => `"${path}" is listed twice`)), "defineRequiredRoots");
|
|
418
420
|
var REQUIRED_ROOTS = defineRequiredRoots([
|
|
@@ -424,7 +426,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
|
|
|
424
426
|
{ path: ["upgrade"], meaning: "updates the CLI" }
|
|
425
427
|
]);
|
|
426
428
|
|
|
427
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
429
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
|
|
428
430
|
var fieldRuleSchema = strictObject({ id: word, rule: text });
|
|
429
431
|
var defineFieldRules = /* @__PURE__ */ __name((input) => parseRegistry("output field rules", array(fieldRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineFieldRules");
|
|
430
432
|
var FIELD_RULES = defineFieldRules([
|
|
@@ -440,7 +442,7 @@ var FIELD_RULES = defineFieldRules([
|
|
|
440
442
|
}
|
|
441
443
|
]);
|
|
442
444
|
|
|
443
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
445
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
|
|
444
446
|
var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
|
|
445
447
|
var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
|
|
446
448
|
var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
|
|
@@ -462,7 +464,7 @@ var IDENTIFIERS = defineIdentifiers([
|
|
|
462
464
|
{ key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
|
|
463
465
|
]);
|
|
464
466
|
|
|
465
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
467
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-account.js
|
|
466
468
|
var ACCOUNT_FLAGS = [
|
|
467
469
|
{
|
|
468
470
|
name: "--client-id",
|
|
@@ -499,7 +501,7 @@ var ACCOUNT_FLAGS = [
|
|
|
499
501
|
{ name: "--hide-phone", role: "output", type: "switch", meaning: "leave the phone number out of the answer" }
|
|
500
502
|
];
|
|
501
503
|
|
|
502
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
504
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
|
|
503
505
|
var CALENDAR_FLAGS = [
|
|
504
506
|
{ name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
|
|
505
507
|
{
|
|
@@ -587,7 +589,25 @@ var CALENDAR_FLAGS = [
|
|
|
587
589
|
}
|
|
588
590
|
];
|
|
589
591
|
|
|
590
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
592
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-content.js
|
|
593
|
+
var CONTENT_FLAGS = [
|
|
594
|
+
{ name: "--slug", value: "<slug>", role: "value", type: "string", meaning: "the last part of its web address" },
|
|
595
|
+
{
|
|
596
|
+
name: "--tags",
|
|
597
|
+
value: "<ids>",
|
|
598
|
+
role: "value",
|
|
599
|
+
type: "list",
|
|
600
|
+
meaning: "its tags and categories, by comma-separated ids; replaces the ones it has"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: "--replace-body",
|
|
604
|
+
role: "mode",
|
|
605
|
+
type: "switch",
|
|
606
|
+
meaning: "write the new text over a body the tool cannot fully read back, losing what it could not show"
|
|
607
|
+
}
|
|
608
|
+
];
|
|
609
|
+
|
|
610
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-crm.js
|
|
591
611
|
var CRM_FLAGS = [
|
|
592
612
|
{
|
|
593
613
|
name: "--email",
|
|
@@ -751,7 +771,7 @@ var CRM_FLAGS = [
|
|
|
751
771
|
}
|
|
752
772
|
];
|
|
753
773
|
|
|
754
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
774
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
|
|
755
775
|
var HOW_FLAGS = [
|
|
756
776
|
{
|
|
757
777
|
name: "--limit",
|
|
@@ -1131,13 +1151,7 @@ var HOW_FLAGS = [
|
|
|
1131
1151
|
type: "string",
|
|
1132
1152
|
meaning: "a person whose reply counts as an answer; repeat it for more"
|
|
1133
1153
|
},
|
|
1134
|
-
{
|
|
1135
|
-
name: "--browser",
|
|
1136
|
-
value: "<program>",
|
|
1137
|
-
role: "mode",
|
|
1138
|
-
type: "string",
|
|
1139
|
-
meaning: "the browser program to open for sign-in"
|
|
1140
|
-
},
|
|
1154
|
+
{ name: "--browser", value: "<program>", role: "mode", type: "string", meaning: "the browser to open for sign-in" },
|
|
1141
1155
|
{
|
|
1142
1156
|
name: "--credential-storage",
|
|
1143
1157
|
value: "<storage>",
|
|
@@ -1146,6 +1160,8 @@ var HOW_FLAGS = [
|
|
|
1146
1160
|
meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
|
|
1147
1161
|
},
|
|
1148
1162
|
{ name: "--checkpoint", value: "<file>", role: "mode", type: "path", meaning: "keep resume progress in this file" },
|
|
1163
|
+
{ name: "--site", value: "<address>", role: "mode", type: "string", meaning: "the owner's site a sign-in is for" },
|
|
1164
|
+
{ name: "--login", value: "<name>", role: "mode", type: "string", meaning: "the user name a password is for" },
|
|
1149
1165
|
{
|
|
1150
1166
|
name: "--expected-event-id",
|
|
1151
1167
|
value: "<id>",
|
|
@@ -1748,7 +1764,7 @@ var HOW_FLAGS = [
|
|
|
1748
1764
|
}
|
|
1749
1765
|
];
|
|
1750
1766
|
|
|
1751
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1767
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-knowledge.js
|
|
1752
1768
|
var KNOWLEDGE_FLAGS = [
|
|
1753
1769
|
{
|
|
1754
1770
|
name: "--accept-terms",
|
|
@@ -1784,6 +1800,13 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1784
1800
|
meaning: "at most this many characters read",
|
|
1785
1801
|
unit: "characters"
|
|
1786
1802
|
},
|
|
1803
|
+
{
|
|
1804
|
+
name: "--tab",
|
|
1805
|
+
value: "<id>",
|
|
1806
|
+
role: "target",
|
|
1807
|
+
type: "id",
|
|
1808
|
+
meaning: "one tab of a document, by its id: only its text is read"
|
|
1809
|
+
},
|
|
1787
1810
|
{
|
|
1788
1811
|
name: "--tag",
|
|
1789
1812
|
value: "<name>",
|
|
@@ -1800,7 +1823,7 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1800
1823
|
}
|
|
1801
1824
|
];
|
|
1802
1825
|
|
|
1803
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1826
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
|
|
1804
1827
|
var MAIL_FLAGS = [
|
|
1805
1828
|
{
|
|
1806
1829
|
name: "--cc",
|
|
@@ -1830,7 +1853,7 @@ var MAIL_FLAGS = [
|
|
|
1830
1853
|
}
|
|
1831
1854
|
];
|
|
1832
1855
|
|
|
1833
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1856
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-privacy.js
|
|
1834
1857
|
var PRIVACY_FLAGS = [
|
|
1835
1858
|
{
|
|
1836
1859
|
name: "--about-text",
|
|
@@ -1891,7 +1914,7 @@ var PRIVACY_FLAGS = [
|
|
|
1891
1914
|
{ name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
|
|
1892
1915
|
];
|
|
1893
1916
|
|
|
1894
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1917
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-schedule.js
|
|
1895
1918
|
var SCHEDULE_FLAGS = [
|
|
1896
1919
|
{
|
|
1897
1920
|
name: "--locale",
|
|
@@ -1924,7 +1947,18 @@ var SCHEDULE_FLAGS = [
|
|
|
1924
1947
|
}
|
|
1925
1948
|
];
|
|
1926
1949
|
|
|
1927
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1950
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-search.js
|
|
1951
|
+
var SEARCH_FLAGS = [
|
|
1952
|
+
{
|
|
1953
|
+
name: "--like",
|
|
1954
|
+
value: "<text>",
|
|
1955
|
+
role: "query",
|
|
1956
|
+
type: "string",
|
|
1957
|
+
meaning: "a made-up example of the text sought, such as a reply that would answer the question, searched by meaning beside the query"
|
|
1958
|
+
}
|
|
1959
|
+
];
|
|
1960
|
+
|
|
1961
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
|
|
1928
1962
|
var WHAT_FLAGS = [
|
|
1929
1963
|
{
|
|
1930
1964
|
name: "--analysis-provider",
|
|
@@ -2921,7 +2955,7 @@ var WHAT_FLAGS = [
|
|
|
2921
2955
|
}
|
|
2922
2956
|
];
|
|
2923
2957
|
|
|
2924
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2958
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
|
|
2925
2959
|
var FLAG_TYPES = [
|
|
2926
2960
|
"switch",
|
|
2927
2961
|
"count",
|
|
@@ -3051,6 +3085,10 @@ var verbs = [
|
|
|
3051
3085
|
["export", "write from the store to a file"],
|
|
3052
3086
|
["import", "bring a file or list the user gives into the store or the messenger, once"],
|
|
3053
3087
|
["download", "save a file from the source to this machine"],
|
|
3088
|
+
["upload", "put a file from this machine on the source"],
|
|
3089
|
+
["publish", "open a thing to anyone who has its public link"],
|
|
3090
|
+
["unpublish", "close a thing's public link"],
|
|
3091
|
+
["stale", "mark a saved memory as out of date, keeping it"],
|
|
3054
3092
|
["transcribe", "turn speech into text"],
|
|
3055
3093
|
["extract", "read the text inside files already on this machine into the store"],
|
|
3056
3094
|
["migrate", "bring a file up to this build's schema"],
|
|
@@ -3147,6 +3185,8 @@ var collections = [
|
|
|
3147
3185
|
["messages", "posts in a messenger chat, or emails"],
|
|
3148
3186
|
["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
|
|
3149
3187
|
["polls", "polls in a chat"],
|
|
3188
|
+
["posts", "posts and pages on a site or blog the owner publishes"],
|
|
3189
|
+
["channels", "the sites and social accounts the owner publishes posts on"],
|
|
3150
3190
|
["reactions", "reactions to a message"],
|
|
3151
3191
|
["recipients", "who a message goes to"],
|
|
3152
3192
|
["replies", "the automatic replies of a profile"],
|
|
@@ -3193,6 +3233,10 @@ var collections = [
|
|
|
3193
3233
|
["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
|
|
3194
3234
|
["splits", "parts of one transaction, each with its own amount and category"],
|
|
3195
3235
|
["users", "people who work in the owner's account at a service, such as a CRM's employees"],
|
|
3236
|
+
["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
|
|
3237
|
+
["teams", "groups in a tracker that own issues, states and labels"],
|
|
3238
|
+
["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
|
|
3239
|
+
["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
|
|
3196
3240
|
["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
|
|
3197
3241
|
["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
|
|
3198
3242
|
["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
|
|
@@ -3261,6 +3305,10 @@ var singulars = [
|
|
|
3261
3305
|
["privacy", "who may find, see, call or add the account"],
|
|
3262
3306
|
["metadata", "a profile's cached source attributes"],
|
|
3263
3307
|
["auth", "the credentials a bot profile uses: its token and the secrets beside it"],
|
|
3308
|
+
[
|
|
3309
|
+
"scheduled",
|
|
3310
|
+
"a chat's messages the messenger will send later; their ids are their own, never the ids of sent messages"
|
|
3311
|
+
],
|
|
3264
3312
|
[
|
|
3265
3313
|
"schedule",
|
|
3266
3314
|
"a profile's timers the owner saved, each running a command of this tool or an agent; the tool's own background work is jobs"
|
|
@@ -3268,6 +3316,7 @@ var singulars = [
|
|
|
3268
3316
|
];
|
|
3269
3317
|
var views = [
|
|
3270
3318
|
["tree", "the parent and child hierarchy of stored sources"],
|
|
3319
|
+
["stats", "a thing's own numbers, such as a post's views, as read at each sync"],
|
|
3271
3320
|
["logs", "the log of a running process"],
|
|
3272
3321
|
["events", "what happened in a thing over time"],
|
|
3273
3322
|
["scheduled", "what is scheduled to happen"],
|
|
@@ -3340,11 +3389,13 @@ var VOCABULARY = defineVocabulary({
|
|
|
3340
3389
|
...MAIL_FLAGS,
|
|
3341
3390
|
...KNOWLEDGE_FLAGS,
|
|
3342
3391
|
...CRM_FLAGS,
|
|
3343
|
-
...SCHEDULE_FLAGS
|
|
3392
|
+
...SCHEDULE_FLAGS,
|
|
3393
|
+
...CONTENT_FLAGS,
|
|
3394
|
+
...SEARCH_FLAGS
|
|
3344
3395
|
]
|
|
3345
3396
|
});
|
|
3346
3397
|
|
|
3347
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3348
3399
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3349
3400
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3350
3401
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3515,7 +3566,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3515
3566
|
const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
|
|
3516
3567
|
const lend = ctx.connection;
|
|
3517
3568
|
let borrowed;
|
|
3518
|
-
let
|
|
3569
|
+
let answered = false;
|
|
3519
3570
|
let result;
|
|
3520
3571
|
let failure;
|
|
3521
3572
|
const streams = captureStreams();
|
|
@@ -3537,7 +3588,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3537
3588
|
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
3538
3589
|
agent: {
|
|
3539
3590
|
result: /* @__PURE__ */ __name((value) => {
|
|
3540
|
-
|
|
3591
|
+
answered = true;
|
|
3541
3592
|
result = value;
|
|
3542
3593
|
}, "result"),
|
|
3543
3594
|
failure: /* @__PURE__ */ __name((object2) => {
|
|
@@ -3559,7 +3610,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3559
3610
|
}));
|
|
3560
3611
|
if (failure)
|
|
3561
3612
|
return { error: failure };
|
|
3562
|
-
if (
|
|
3613
|
+
if (answered)
|
|
3563
3614
|
return { result };
|
|
3564
3615
|
if (code !== 0)
|
|
3565
3616
|
throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
|
|
@@ -3571,468 +3622,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3571
3622
|
}
|
|
3572
3623
|
}, "runCommandForAgent");
|
|
3573
3624
|
|
|
3574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.106.0_commander@15_8d845c31697914d824aa80d8eec93941/node_modules/@wirecat/cli-core/dist/mcp/tool.js
|
|
3575
|
-
var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
|
|
3576
|
-
var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
|
|
3577
|
-
var message = pipe(
|
|
3578
|
-
string(),
|
|
3579
|
-
maxLength(256),
|
|
3580
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
|
|
3581
|
-
regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
|
|
3582
|
-
description("message id")
|
|
3583
|
-
);
|
|
3584
|
-
var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
3585
|
-
var WRITE = {
|
|
3586
|
-
readOnlyHint: false,
|
|
3587
|
-
destructiveHint: true,
|
|
3588
|
-
idempotentHint: false,
|
|
3589
|
-
openWorldHint: true
|
|
3590
|
-
};
|
|
3591
|
-
var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
|
|
3592
|
-
var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
|
|
3593
|
-
var tierOf = /* @__PURE__ */ __name((key2, definition, messenger) => {
|
|
3594
|
-
if (definition.annotations.readOnlyHint === true)
|
|
3595
|
-
return "read";
|
|
3596
|
-
if (/^admin|_admin/.test(key2))
|
|
3597
|
-
return "admin";
|
|
3598
|
-
if (/delete|ban|kick|remove|purge|block/.test(key2))
|
|
3599
|
-
return "destructive";
|
|
3600
|
-
if (/draft/.test(key2))
|
|
3601
|
-
return "draft";
|
|
3602
|
-
if (key2 === "messages_pin" && messenger?.quietPins === false)
|
|
3603
|
-
return "write-public";
|
|
3604
|
-
if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key2))
|
|
3605
|
-
return "write-private";
|
|
3606
|
-
return "write-public";
|
|
3607
|
-
}, "tierOf");
|
|
3608
|
-
var effectsOf = /* @__PURE__ */ __name((definition) => {
|
|
3609
|
-
if (definition.effects)
|
|
3610
|
-
return definition.effects;
|
|
3611
|
-
const { readOnlyHint, openWorldHint } = definition.annotations;
|
|
3612
|
-
if (readOnlyHint === true)
|
|
3613
|
-
return { remote: openWorldHint === false ? "none" : "read", local: "read" };
|
|
3614
|
-
return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
|
|
3615
|
-
}, "effectsOf");
|
|
3616
|
-
var outcomeOf = /* @__PURE__ */ __name((result) => {
|
|
3617
|
-
if (!result.isError)
|
|
3618
|
-
return { status: "ok" };
|
|
3619
|
-
const code = result.structuredContent?.error?.code;
|
|
3620
|
-
const error = typeof code === "string" ? code : "generic_failure";
|
|
3621
|
-
return { status: error === "permission_error" ? "refused" : "failed", error };
|
|
3622
|
-
}, "outcomeOf");
|
|
3623
|
-
var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
|
|
3624
|
-
var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
|
|
3625
|
-
var inputOf = /* @__PURE__ */ __name((definition, syncAllowed) => strictObject(syncAllowed || !("sync_first" in definition.input.entries) ? definition.input.entries : Object.fromEntries(Object.entries(definition.input.entries).filter(([name]) => !["sync_first", "sync_time", "max_chats", "max_messages"].includes(name)))), "inputOf");
|
|
3626
|
-
var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
|
|
3627
|
-
const permissions = defaults.settings.permissions ?? {};
|
|
3628
|
-
const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
|
|
3629
|
-
return shared && (!key2.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level));
|
|
3630
|
-
}, "syncAllowedFor");
|
|
3631
|
-
var entryRunner = /* @__PURE__ */ __name((registration) => {
|
|
3632
|
-
const run = callRunner(registration);
|
|
3633
|
-
const { log } = registration;
|
|
3634
|
-
return async (key2, definition, args, ctx) => {
|
|
3635
|
-
const startedAt = Date.now();
|
|
3636
|
-
const command = `mcp ${commandOf(key2, definition)}`;
|
|
3637
|
-
const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
|
|
3638
|
-
const app = registration.messenger?.app;
|
|
3639
|
-
const caller = registration.callers ? callerOf(ctx, key2, registration.callers) : currentCaller();
|
|
3640
|
-
const env = registration.defaults.env ?? process.env;
|
|
3641
|
-
const settings = registration.defaults.settings;
|
|
3642
|
-
const recording = key2 !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
|
|
3643
|
-
app,
|
|
3644
|
-
command,
|
|
3645
|
-
...settings.profile === void 0 ? {} : { profile: settings.profile },
|
|
3646
|
-
env,
|
|
3647
|
-
record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
|
|
3648
|
-
keepFailed: true,
|
|
3649
|
-
trace: false,
|
|
3650
|
-
format: "json",
|
|
3651
|
-
context: runContextOf({ bin: app.command, command, env, caller }),
|
|
3652
|
-
...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
|
|
3653
|
-
...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
|
|
3654
|
-
...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
|
|
3655
|
-
...traceId === void 0 ? {} : { traceId }
|
|
3656
|
-
}) : void 0;
|
|
3657
|
-
const profile = registration.defaults.settings.profile;
|
|
3658
|
-
const scope = {
|
|
3659
|
-
runId: recording?.runId ?? newRunId(new Date(startedAt), command),
|
|
3660
|
-
command,
|
|
3661
|
-
startedAt,
|
|
3662
|
-
...profile === void 0 ? {} : { profile },
|
|
3663
|
-
...traceId === void 0 ? {} : { traceId },
|
|
3664
|
-
...recording ? { events: recording.events } : {}
|
|
3665
|
-
};
|
|
3666
|
-
const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
|
|
3667
|
-
const input = inputOf(definition, syncAllowedFor(key2, registration.defaults));
|
|
3668
|
-
const parsed = safeParse(input, args);
|
|
3669
|
-
return parsed.success ? run(key2, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key2, definition)}: ${summarize(parsed.issues)}`, {
|
|
3670
|
-
arguments: toJsonSchema(input)
|
|
3671
|
-
}), app?.errors);
|
|
3672
|
-
}), "work");
|
|
3673
|
-
const result = await (caller ? withCaller(caller, work) : work());
|
|
3674
|
-
if (recording) {
|
|
3675
|
-
if (result.isError) {
|
|
3676
|
-
const error = result.structuredContent?.error;
|
|
3677
|
-
const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
|
|
3678
|
-
await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
|
|
3679
|
-
} else
|
|
3680
|
-
await recording.succeed(result.structuredContent).catch(() => void 0);
|
|
3681
|
-
}
|
|
3682
|
-
await log?.({
|
|
3683
|
-
tool: key2,
|
|
3684
|
-
tier: tierOf(key2, definition, registration.messenger),
|
|
3685
|
-
...outcomeOf(result),
|
|
3686
|
-
startedAt,
|
|
3687
|
-
finishedAt: Date.now()
|
|
3688
|
-
}, caller)?.catch(() => void 0);
|
|
3689
|
-
return result;
|
|
3690
|
-
};
|
|
3691
|
-
}, "entryRunner");
|
|
3692
|
-
var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
|
|
3693
|
-
const where = {
|
|
3694
|
-
profile: defaults.settings.profile,
|
|
3695
|
-
env: defaults.env,
|
|
3696
|
-
pictures: defaults.settings.pictureSearch,
|
|
3697
|
-
reranker: defaults.settings.searchReranker
|
|
3698
|
-
};
|
|
3699
|
-
return async (key2, definition, args, ctx) => {
|
|
3700
|
-
const path = commandOf(key2, definition).split(" ");
|
|
3701
|
-
const run = `mcp ${path.join(" ")}`;
|
|
3702
|
-
try {
|
|
3703
|
-
const execute = /* @__PURE__ */ __name(async () => {
|
|
3704
|
-
const syncAllowed = syncAllowedFor(key2, defaults);
|
|
3705
|
-
if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
|
|
3706
|
-
throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
|
|
3707
|
-
reason: "input.too-large",
|
|
3708
|
-
max_bytes: MAX_BUFFERED_INPUT,
|
|
3709
|
-
retryable: false
|
|
3710
|
-
});
|
|
3711
|
-
definition.check?.(args);
|
|
3712
|
-
if (definition.changesStore)
|
|
3713
|
-
refuseStoreChange(messenger.app, defaults.env);
|
|
3714
|
-
refuseLacking(messenger, path);
|
|
3715
|
-
for (const permission of readKeysForCommand(path)) {
|
|
3716
|
-
if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
|
|
3717
|
-
throw new CliError("permission_error", `profile denies ${permission}`, { permission });
|
|
3718
|
-
}
|
|
3719
|
-
if (args.sync_first && !syncAllowed)
|
|
3720
|
-
throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
|
|
3721
|
-
if (definition.custom) {
|
|
3722
|
-
const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
|
|
3723
|
-
return answered(result2, definition.outputLimit?.(args, defaults), targets);
|
|
3724
|
-
}
|
|
3725
|
-
if (definition.local)
|
|
3726
|
-
return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
|
|
3727
|
-
const { online, stored: local, served } = definition;
|
|
3728
|
-
const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
|
|
3729
|
-
const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
|
|
3730
|
-
name: run
|
|
3731
|
-
}) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
|
|
3732
|
-
...storeModeDeps(messenger, store, account, defaults.guard),
|
|
3733
|
-
...where,
|
|
3734
|
-
embedders: defaults.embedders
|
|
3735
|
-
}), args, defaults, (work) => session.use(run, async (adapter, release) => {
|
|
3736
|
-
try {
|
|
3737
|
-
return await work(adapter);
|
|
3738
|
-
} finally {
|
|
3739
|
-
await release();
|
|
3740
|
-
}
|
|
3741
|
-
})), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
|
|
3742
|
-
try {
|
|
3743
|
-
return await work(adapter);
|
|
3744
|
-
} finally {
|
|
3745
|
-
await release();
|
|
3746
|
-
}
|
|
3747
|
-
})())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
|
|
3748
|
-
return answered(result, definition.outputLimit?.(args, defaults), targets);
|
|
3749
|
-
}, "execute");
|
|
3750
|
-
return around ? await around(key2, definition, execute) : await execute();
|
|
3751
|
-
} catch (error) {
|
|
3752
|
-
return failed(error, messenger?.app?.errors, effectsOf(definition));
|
|
3753
|
-
}
|
|
3754
|
-
};
|
|
3755
|
-
}, "callRunner");
|
|
3756
|
-
var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
|
|
3757
|
-
if (!definition.output)
|
|
3758
|
-
return looseObject({});
|
|
3759
|
-
const entity = ENTITIES[definition.output.entity];
|
|
3760
|
-
return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
|
|
3761
|
-
}, "outputSchemaOf");
|
|
3762
|
-
var Picture = class {
|
|
3763
|
-
static {
|
|
3764
|
-
__name(this, "Picture");
|
|
3765
|
-
}
|
|
3766
|
-
bytes;
|
|
3767
|
-
mimeType;
|
|
3768
|
-
about;
|
|
3769
|
-
constructor(bytes, mimeType, about) {
|
|
3770
|
-
this.bytes = bytes;
|
|
3771
|
-
this.mimeType = mimeType;
|
|
3772
|
-
this.about = about;
|
|
3773
|
-
}
|
|
3774
|
-
};
|
|
3775
|
-
var BinaryResource = class {
|
|
3776
|
-
static {
|
|
3777
|
-
__name(this, "BinaryResource");
|
|
3778
|
-
}
|
|
3779
|
-
base64;
|
|
3780
|
-
mimeType;
|
|
3781
|
-
uri;
|
|
3782
|
-
about;
|
|
3783
|
-
constructor(base64, mimeType, uri, about) {
|
|
3784
|
-
this.base64 = base64;
|
|
3785
|
-
this.mimeType = mimeType;
|
|
3786
|
-
this.uri = uri;
|
|
3787
|
-
this.about = about;
|
|
3788
|
-
}
|
|
3789
|
-
};
|
|
3790
|
-
var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
|
|
3791
|
-
const bounded = /* @__PURE__ */ __name((result) => {
|
|
3792
|
-
if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
|
|
3793
|
-
throw new CliError("invalid_response", "tool output exceeds its byte limit \u2014 reduce limit or use a narrower request", { reason: "output.too-large", max_bytes: maxBytes, retryable: false });
|
|
3794
|
-
return result;
|
|
3795
|
-
}, "bounded");
|
|
3796
|
-
if (answer === null || Array.isArray(answer) || typeof answer !== "object")
|
|
3797
|
-
throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
|
|
3798
|
-
const objectBody = /* @__PURE__ */ __name((value) => {
|
|
3799
|
-
const serialized = JSON.parse(agentJson(value));
|
|
3800
|
-
if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
|
|
3801
|
-
throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
|
|
3802
|
-
return serialized;
|
|
3803
|
-
}, "objectBody");
|
|
3804
|
-
if (answer instanceof BinaryResource) {
|
|
3805
|
-
const about = sealed(answer.about);
|
|
3806
|
-
return bounded({
|
|
3807
|
-
structuredContent: objectBody(about),
|
|
3808
|
-
content: [
|
|
3809
|
-
{ type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
|
|
3810
|
-
{ type: "text", text: agentJson(about) }
|
|
3811
|
-
]
|
|
3812
|
-
});
|
|
3813
|
-
}
|
|
3814
|
-
if (answer instanceof Picture) {
|
|
3815
|
-
const about = sealed(answer.about);
|
|
3816
|
-
return bounded({
|
|
3817
|
-
structuredContent: objectBody(about),
|
|
3818
|
-
content: [
|
|
3819
|
-
{ type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
|
|
3820
|
-
{ type: "text", text: agentJson(about) }
|
|
3821
|
-
]
|
|
3822
|
-
});
|
|
3823
|
-
}
|
|
3824
|
-
const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
|
|
3825
|
-
return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
|
|
3826
|
-
}, "answered");
|
|
3827
|
-
var failed = /* @__PURE__ */ __name((error, errors, effects) => {
|
|
3828
|
-
const judged = judgedEffects(effects);
|
|
3829
|
-
const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
|
|
3830
|
-
return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
|
|
3831
|
-
}, "failed");
|
|
3832
|
-
|
|
3833
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.681.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.106.0_commander@15_8d845c31697914d824aa80d8eec93941/node_modules/@wirecat/cli-core/dist/mcp/surface.js
|
|
3834
|
-
import { randomUUID } from "node:crypto";
|
|
3835
|
-
var MATCHES = 8;
|
|
3836
|
-
var ANSWER = answerSchema();
|
|
3837
|
-
var agentAnswer = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3838
|
-
const meta = pipe(looseObject({}), description(`run facts; ${prefix}_tools_search shows the full answer`));
|
|
3839
|
-
const next = optional(pipe(array(looseObject({})), description("steps to run next: command and args")));
|
|
3840
|
-
return looseObject(writes2 ? { item: optional(unknown()), next, meta } : {
|
|
3841
|
-
items: optional(array(unknown())),
|
|
3842
|
-
item: optional(unknown()),
|
|
3843
|
-
page: optional(looseObject({ has_more: boolean() })),
|
|
3844
|
-
next,
|
|
3845
|
-
missing: optional(array(looseObject({ field: string(), why: string() }))),
|
|
3846
|
-
meta
|
|
3847
|
-
});
|
|
3848
|
-
}, "agentAnswer");
|
|
3849
|
-
var listedAs = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3850
|
-
const checked = toStandardJsonSchema(ANSWER);
|
|
3851
|
-
const shown = toStandardJsonSchema(agentAnswer(prefix, writes2))["~standard"].jsonSchema;
|
|
3852
|
-
return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
|
|
3853
|
-
}, "listedAs");
|
|
3854
|
-
var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
|
|
3855
|
-
var STOP_WORDS = new Set("a an the to of in on at by for from with into out about and or but is are be been was were it its this that these those which who whom whose what when where how do does did can could should would will my our your their his her them they we you i one some any all each every another other".split(" "));
|
|
3856
|
-
var wordsOf = /* @__PURE__ */ __name((text3) => text3.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
|
|
3857
|
-
var stem = /* @__PURE__ */ __name((word2) => {
|
|
3858
|
-
const bare = word2.replace(/'s$/u, "");
|
|
3859
|
-
if (bare.length > 4 && bare.endsWith("ies"))
|
|
3860
|
-
return `${bare.slice(0, -3)}y`;
|
|
3861
|
-
for (const ending of ["ing", "ed", "es", "s"])
|
|
3862
|
-
if (bare.length - ending.length >= 3 && bare.endsWith(ending))
|
|
3863
|
-
return bare.slice(0, -ending.length);
|
|
3864
|
-
return bare;
|
|
3865
|
-
}, "stem");
|
|
3866
|
-
var sameWord = /* @__PURE__ */ __name((asked, known) => {
|
|
3867
|
-
if (asked === known)
|
|
3868
|
-
return true;
|
|
3869
|
-
const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
|
|
3870
|
-
return short.length >= 3 && long.startsWith(short);
|
|
3871
|
-
}, "sameWord");
|
|
3872
|
-
var fieldsOf2 = /* @__PURE__ */ __name((command, one) => [
|
|
3873
|
-
[4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
|
|
3874
|
-
[2, wordsOf(one.title)],
|
|
3875
|
-
[1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
|
|
3876
|
-
].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
|
|
3877
|
-
var search = /* @__PURE__ */ __name((commands, query) => {
|
|
3878
|
-
const named = normal(query);
|
|
3879
|
-
const all = Object.entries(commands);
|
|
3880
|
-
if (!named)
|
|
3881
|
-
return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
|
|
3882
|
-
const words = [
|
|
3883
|
-
...new Set(wordsOf(query).filter((word2) => word2.length > 1 && !STOP_WORDS.has(word2)).map(stem))
|
|
3884
|
-
];
|
|
3885
|
-
return all.map((entry) => {
|
|
3886
|
-
const fields = fieldsOf2(entry[0], entry[1]);
|
|
3887
|
-
const weights = words.map((word2) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word2, one)) ? Math.max(best, weight) : best, 0));
|
|
3888
|
-
const matched = weights.filter((weight) => weight > 0).length;
|
|
3889
|
-
const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
|
|
3890
|
-
return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
|
|
3891
|
-
}).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
|
|
3892
|
-
}, "search");
|
|
3893
|
-
var nearest = /* @__PURE__ */ __name((commands, asked) => {
|
|
3894
|
-
const words = normal(asked).split(" ");
|
|
3895
|
-
return Object.keys(commands).map((one) => ({ one, shared: words.filter((word2) => normal(one).split(" ").includes(word2)).length })).filter(({ shared }) => shared > 0).sort((a, b) => b.shared - a.shared).slice(0, 3).map(({ one }) => one);
|
|
3896
|
-
}, "nearest");
|
|
3897
|
-
var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
|
|
3898
|
-
const body = result.structuredContent;
|
|
3899
|
-
if (result.isError || !Array.isArray(body?.next))
|
|
3900
|
-
return result;
|
|
3901
|
-
const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
|
|
3902
|
-
const { next: _, ...rest } = body;
|
|
3903
|
-
const kept = next.length > 0 ? { ...rest, next } : rest;
|
|
3904
|
-
return {
|
|
3905
|
-
...result,
|
|
3906
|
-
structuredContent: kept,
|
|
3907
|
-
content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
|
|
3908
|
-
};
|
|
3909
|
-
}, "runnableOnly");
|
|
3910
|
-
var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
|
|
3911
|
-
var sampleOf = /* @__PURE__ */ __name((commands) => {
|
|
3912
|
-
const reading = Object.entries(commands).filter(([, one]) => !one.writes);
|
|
3913
|
-
const bare = reading.filter(([, one]) => takesNothing(one));
|
|
3914
|
-
return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
|
|
3915
|
-
}, "sampleOf");
|
|
3916
|
-
var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
|
|
3917
|
-
const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
|
|
3918
|
-
const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
|
|
3919
|
-
const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
|
|
3920
|
-
const sample = messenger ? "messages list" : sampleOf(commands);
|
|
3921
|
-
const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
|
|
3922
|
-
server.registerTool(`${prefix}_tools_search`, {
|
|
3923
|
-
outputSchema: toStandardJsonSchema(looseObject({})),
|
|
3924
|
-
title: "Find a command",
|
|
3925
|
-
description: `Find the command for a task \u2014 ${tasks} \u2014 before calling ${prefix}_read or ${prefix}_write with it. Each match gives its command, whether it writes, its arguments and the shape of its answer. With no words, lists every command and title, without arguments.`,
|
|
3926
|
-
inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
|
|
3927
|
-
annotations: { ...READ, openWorldHint: false, idempotentHint: true }
|
|
3928
|
-
}, async ({ query }) => {
|
|
3929
|
-
const found = search(commands, query ?? "");
|
|
3930
|
-
const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
|
|
3931
|
-
command,
|
|
3932
|
-
title: one.title,
|
|
3933
|
-
description: one.description,
|
|
3934
|
-
writes: one.writes,
|
|
3935
|
-
availability: one.availability?.() ?? { available: true },
|
|
3936
|
-
arguments: toJsonSchema(one.input),
|
|
3937
|
-
output: toJsonSchema(one.output ?? ANSWER)
|
|
3938
|
-
})) : found.map(([command, one]) => ({
|
|
3939
|
-
command,
|
|
3940
|
-
title: one.title,
|
|
3941
|
-
writes: one.writes,
|
|
3942
|
-
availability: one.availability?.() ?? { available: true }
|
|
3943
|
-
}));
|
|
3944
|
-
const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
|
|
3945
|
-
items,
|
|
3946
|
-
limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
|
|
3947
|
-
has_more: found.length > items.length
|
|
3948
|
-
});
|
|
3949
|
-
return answered(list);
|
|
3950
|
-
});
|
|
3951
|
-
const callers = {
|
|
3952
|
-
env: process.env,
|
|
3953
|
-
client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
|
|
3954
|
-
connectionId: randomUUID()
|
|
3955
|
-
};
|
|
3956
|
-
const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
|
|
3957
|
-
try {
|
|
3958
|
-
const command = byNormal.get(normal(asked));
|
|
3959
|
-
const one = command === void 0 ? void 0 : commands[command];
|
|
3960
|
-
if (command === void 0 || !one) {
|
|
3961
|
-
withheld?.(normal(asked));
|
|
3962
|
-
const near = nearest(commands, asked);
|
|
3963
|
-
throw new CliError("validation_error", `no command "${asked}" here${near.length ? ` \u2014 did you mean ${near.map((name) => `"${name}"`).join(", ")}?` : ""}; ${prefix}_tools_search finds one`);
|
|
3964
|
-
}
|
|
3965
|
-
if (one.writes !== writing)
|
|
3966
|
-
throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
|
|
3967
|
-
const args = writing ? agentArguments(given ?? {}) : given ?? {};
|
|
3968
|
-
const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
|
|
3969
|
-
if (one.checked)
|
|
3970
|
-
return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
|
|
3971
|
-
const parsed = safeParse(strictObject(one.input.entries), args);
|
|
3972
|
-
if (!parsed.success)
|
|
3973
|
-
throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
|
|
3974
|
-
arguments: toJsonSchema(one.input)
|
|
3975
|
-
});
|
|
3976
|
-
return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
|
|
3977
|
-
} catch (error) {
|
|
3978
|
-
return failed(error, errors);
|
|
3979
|
-
}
|
|
3980
|
-
}, "runner");
|
|
3981
|
-
const call = strictObject({
|
|
3982
|
-
command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
|
|
3983
|
-
arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
|
|
3984
|
-
});
|
|
3985
|
-
server.registerTool(`${prefix}_read`, {
|
|
3986
|
-
outputSchema: listedAs(prefix, false),
|
|
3987
|
-
title: "Run a reading command",
|
|
3988
|
-
description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
|
|
3989
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3990
|
-
annotations: READ
|
|
3991
|
-
}, runner(false));
|
|
3992
|
-
if (Object.values(commands).some((one) => one.writes))
|
|
3993
|
-
server.registerTool(`${prefix}_write`, {
|
|
3994
|
-
outputSchema: listedAs(prefix, true),
|
|
3995
|
-
title: "Run a writing command",
|
|
3996
|
-
description: `Run one command that changes something \u2014 ${messenger ? "sends, edits, deletes, joins" : "creates, edits, deletes"} \u2014 with the arguments ${prefix}_tools_search showed. ${untrusted}`,
|
|
3997
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3998
|
-
annotations: WRITE
|
|
3999
|
-
}, runner(true));
|
|
4000
|
-
}, "registerCommands");
|
|
4001
|
-
var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
|
|
4002
|
-
const run = entryRunner(registration);
|
|
4003
|
-
return Object.fromEntries(Object.entries(tools).map(([key2, definition]) => [
|
|
4004
|
-
commandOf(key2, definition),
|
|
4005
|
-
{
|
|
4006
|
-
title: definition.title,
|
|
4007
|
-
description: definition.description,
|
|
4008
|
-
writes: definition.annotations.readOnlyHint !== true,
|
|
4009
|
-
input: inputOf(definition, syncAllowedFor(key2, registration.defaults)),
|
|
4010
|
-
...definition.output ? { output: outputSchemaOf(definition) } : {},
|
|
4011
|
-
checked: true,
|
|
4012
|
-
run: /* @__PURE__ */ __name((args, ctx) => run(key2, definition, args, ctx), "run")
|
|
4013
|
-
}
|
|
4014
|
-
]));
|
|
4015
|
-
}, "surfaceCommands");
|
|
4016
|
-
var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
|
|
4017
|
-
|
|
4018
3625
|
export {
|
|
4019
3626
|
toolsFromCommands,
|
|
4020
|
-
runCommandForAgent
|
|
4021
|
-
message,
|
|
4022
|
-
READ,
|
|
4023
|
-
WRITE,
|
|
4024
|
-
tool,
|
|
4025
|
-
chatOf,
|
|
4026
|
-
tierOf,
|
|
4027
|
-
outcomeOf,
|
|
4028
|
-
commandOf,
|
|
4029
|
-
toolKey,
|
|
4030
|
-
Picture,
|
|
4031
|
-
BinaryResource,
|
|
4032
|
-
answered,
|
|
4033
|
-
failed,
|
|
4034
|
-
normal,
|
|
4035
|
-
registerCommands,
|
|
4036
|
-
surfaceCommands,
|
|
4037
|
-
outputOf
|
|
3627
|
+
runCommandForAgent
|
|
4038
3628
|
};
|